Creating a Built in 4 Score device

Started by lifewithmatthew, September 14, 2021, 11:57:14 am

Previous topic - Next topic

WooCash

Hello everyone! I am looking for a way to use Four Score PAL with Japanese and European games. My knowledge of electronics is very basic, but maybe the information I found will be useful to you.

A Polish fan of Pegasus (Famiclone) made a PCB acting as a HORI 4 Player Adaptor and Four Score adapter. Everything is based on EPM3064A. Picture of the PCB and link to the original topic. Krzysiobal did not share the code but he is also on this forum under nick krzy. Maybe he would share some information with the community.
http://archive.nes.science/nesdev-forums/f9/t18747.xhtml

Japanese Famicom fan Takuya Matsubar made a working HORI clone on the Arduino. Provides code and PCB.
https://sites.google.com/site/yugenkaisyanico/diy_fc_multitap
https://github.com/nicotakuya/diyfcmultitap

Cluster from Russia made a 2 in 1 adapter. 4 players adapter and arkanoid controller. He published the complete code for FPGA.
https://clusterrr.com/dendy-accessories/
https://pastebin.com/nt39ZGvH

lifewithmatthew

Quote from: P on September 18, 2021, 03:22:28 pmIf you build a Four-Score you need to make sure the signature is wired or games won't detect it as connected.
I made a test program for both the Four-Score and Famicom expansion controllers (the "Simple" method in the wiki). I've yet to add Hori's Famicom multitap though.
Hey P, I have a question about the rom you made for controller testing.

Since the last post, I learned to use PIC microcontrollers and have it all working with a single microcontroller.  4 players using the four score method works, 2 players works, turbo buttons work AND I have them all working through the expansion port on the bottom.

The last thing I want to do is get a "simple" mode working for four players.  The expansion port exposes $4016.D1 and $4017.D1 that I can use to write data to.  Do they shift the bits along with controller 1 and 2 or do they use a separate clock pulse?

P

Interesting, I'm more familiar with PIC than AVR myself (I've only used AVR with Arduino), what model did you use?

To answer your question, they do shift when controller 1 and 2 shifts respectively. There are just two clocks, the $4016 CLK and the $4017 CLK. So in summary the program does something like this:

1) Pulse $4016.
2) Read controller 1 ($4016.D0).
3) Read controller 3 ($4016.D1).
4) Pulse $4017.
5) Read controller 2 ($4017.D0).
6) Read controller 4 ($4017.D1).
7) First bit done, repeat 1 to 6 again until all 8 bits are read.


BTW I noticed that Nesdev is up again. Finally!

Akerasoft

I created a 4 player adapter that is compatible with Four Score.
It is not tested yet because I don't have all of the electronic parts yet.

https://github.com/Akerasoft/openfourplayer168

This is done in assembly language for speed.
It uses ATMEGA168P but probably should work on ATMEGA328P which is on Arduino Uno R3.

Due to the assembly language it might not work on Arduino.
You can still load it with an ICSP programmer, but it will likely erase the boot loader.
So just buying the chips and making a board is the way to go.

After complete, I plan on doing so myself also.

avr-gcc is complaining about my jmp statements so I'm not sure if it is assembling correctly.

Also it uses 3 interrupts.
2 standard interrupts (INT0 and INT1).
1 extra interrupt by using pin change interrupt and only enabling 1 pin.

I have a potentially slower C++ version for Teensy 2.0 but don't have the Micro USB cable to program it.
It uses INT0/INT1 and INT6.  The catch is Teensy 2.0 has an INT6 pin on it.  With an upgrade to Arduino Teensy 2.0 is supported.

It could be rewritten for avr-gcc/c++ but then it cannot be run on Arduino and also needs to be programmed with ICSP programmer.
In avr-gcc/C++ the 3 interrupt trick can be used.

I have programming experience in MS-DOS assembly and .Net Framework.  This is my first attempt making a usable project for ATMEGA168/ATMEGA328.

So I don't know arv-gcc very well and the assembler that it comes with.
If it turns out that the code does not compile or the warnings are very bad, I would greatly appreciate help with GCC.

I used the Programmer's Notepad that was included in the WinAVR project:
http://winavr.sourceforge.net/
Makefile is included.  As long as the full WinAVR or the avr-gcc compiler stack is in your path you should be able to build.

muramasa

Quote from: Akerasoft on January 02, 2022, 09:43:37 pmI created a 4 player adapter that is compatible with Four Score.
It is not tested yet because I don't have all of the electronic parts yet.

I'm really glad you shared this and am hoping to give this a whirl.

Akerasoft

After researching and experimenting.  I have found that the version that uses interrupts is too slow.
The solution requires reading the 4 NES Controllers using polling and then outputting to serial to parallel registers and connecting those to parallel to serial registers.  That is the best way with an ATMEGA168/328.
With a larger chip with more pins, the serial to parallel registers are not required.