Finally here it is the first version of my SEGA SC-3000 / SG-1000 emulator for the PropC3 board + C3Synapse expansion.
The Sega SC-3000 system is emulated by the Propeller present in the PropC3 unit and uses the memory space on the expansion memory C3Synapse for the Z80 emulation.
HOW IT'S MADE:
The main program is really simple and is only used to lanuch the three CHIPS. There are few shared locations of the memory that are used to exchange data between the CHIPS ( when the Z80 access the I/O ports with in and out instructions. In this way every CHIP has its own interface to the Z80 that "wakes up" the CHIP to listen to the BUS when its address is called by the Z80.
This is the customized version of the zq80 program by Pulmoll http://forums.parallax.com/showthread.php?121579-qZ80-the-third-shot&highlight=qz80
The Z80 uses the SRAM memory space of the C3Synapse as fast as possible. In order to do that I had to make a customized version of the qz80 by Pullmoll.
This is the TMS9928 driver that I'm developing. The actual version is completely in Assembly and has the IO interface embedded. It uses 16Kb of shared memory as fast VRAM.
This is the SN76489 driver used by my VGM music player. It has been updated and the length of the code reduced to save memory for the emulator. Actually there is the stable version of the SN76489 available in the OBEX section of the Parallax site:http://obex.parallax.com/objects/891/
The shared memory of the Propeller is used to store the code of the Z80, SN76489 and the TMS9918. This portion of memory is about 14~16 KB. The remaining 16KB are used by the TMS9918 as VRAM because the access to the Shared memory is fast enough to let the internal tile engine to drive the TV out driver. The memory space of the Z80 whish goes from memory location 0x0 to 0xFFFF ( 64KB ) is stored 0into the C3Synapse. Actually the SEGA SC-3000 uses the ROM memory which usually goes from 0x0 to 0x7FFF, 32KB, but there are few game cartridges that are even 40KB. The RAM is mapped starting from 0xC000, and is mirrored in banks of 2KB.
For simplicity in this version of the emulator I used a full memory range from 0 to 64KB and the memory mapper program actually is really simple and has been embedded in the code of Z80.
Potentially a different memory mapper can be configured to use a banked memory system like the one used by MSX systems, because you can use 512KB of the Synapse.In my experience the only differences between the SC-3000 and the MSX ( which are the PSG and the memory mapper ) can be implemented here, but probably the code of the TMS9918 and of the Z80 should be reduced a bit to make the memory mapper fit in the shared memory of the Propeller.
In the future I will upgrade the boot loader to chose and launch the games, but now the loader loads the game ROM from the SD Card into the Synapse, then it boots the PropC3 from the SD card with the file SC-3000.bin ( which is the emulator itself ). After the boot the emulator starts the game.
This is the list of the fully playable games that are supported so far:
If you want to try these and games that aren't supported yet by this emulator you can go to my FLASH emulator here:
- STAR FORCE
- CHOP LIFTER
- STAR JACKER
- NINJA PRINCESS
- CHAMPION BOXING
- HOME MAHJONG
- SUPER MAHJONG
- CHAMPION TENNIS
- SPACE ARMOR
- ZIPPY RACE
- CHALLENGE DERBY
- CHAMPION WRESTLING
- SPACE MOUNTAIN
- WONDER BOY
- CHAMPION HOCKEY
- SPACE INVADERS
- OTHELLO ( Reversi )
- DRAGON WANG
- PACHINKO 2
- SEGA FLIPPER
- CHAMPION GOLF
- SUPER TANK
- GIRL'S GARDEN
- MONACO GP
WHAT YOU NEED:
1) You need a compatible ATARI/SEGA Joystick, but pay attention that the SEGA Joysticks have two different fire buttons and not only one like the ATARI ones. You can the pinout and the wiring to the C3Synapse inside the main file of the zip archive.
More on the original SEGA Joystick in this page:
If you want you can build one by yourself, the joystick circuit is very simple and you need 6 push buttons and few wires:
The only thing you have to add to this is a little interface with pull up resistors ( 10KOhm ) that connect each signal to the 3.3v terminal on the C3Synapse.
HOW TO USE IT:
- Unzip the zip archive attached to this post.
- Load into the Propeller IDE the main file "SC-3000_Emulator_010.spin".
- Scroll down the program window until you reach the end. You will see a list of games that are commented. Chose a game and uncomment its line.
- Press F11 to compile and upload the program into the PropC3.
- PLAY and ENJOY !
The source code will be soon available on the website: http://www.c3emulation.com
The playable emulator is here: