Sega SC-3000 emulated on a PropC3 equipped with a C3Synapse
digimorf
Posts: 74
Hi to everybody!
Here it is the first video of the early working version of the Sega SC-3000 emulator for the PropC3+C3Synapse.
This video shows the Parallax PropC3 unit, equipped with a C3Synapse memory expansion, that run the Sega SC-3000 emulator for Propeller. As I have said, this is an early version of the emulator and still needs to be bug fixed but, it can run already many games such as: Exerion, Champion boxing, Ninja princess, Pacar, Star force and many others.
( Sorry for the quality of the video, my camera really as to be changed! )
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. In addiction I have built a simple parallel Joystick interface that uses the free IO pins left on the PropC3 unit.
The emulator is configured as follows:
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.
VDP:
This is the TMS9928 driver that I'm developing. The actual version is completely in ASM and has the IO interface embedded. It uses 16Kb of shared memory as fast VRAM.
PSG:
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 memory mapper program actually is really simple and has is embedded in each emulated chip. It has to be improved.
In the future I will embed a boot loader in the emulator, something like that shown in this video that I made some time ago:
http://www.youtube.com/watch?v=0q_NxV6mi0I&feature=g-upl
And as soon as I will have a stable alpha version I will start publishing the source code within the Parallax forum.
Enjoy for now!
Here it is the first video of the early working version of the Sega SC-3000 emulator for the PropC3+C3Synapse.
This video shows the Parallax PropC3 unit, equipped with a C3Synapse memory expansion, that run the Sega SC-3000 emulator for Propeller. As I have said, this is an early version of the emulator and still needs to be bug fixed but, it can run already many games such as: Exerion, Champion boxing, Ninja princess, Pacar, Star force and many others.
( Sorry for the quality of the video, my camera really as to be changed! )
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. In addiction I have built a simple parallel Joystick interface that uses the free IO pins left on the PropC3 unit.
The emulator is configured as follows:
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.
VDP:
This is the TMS9928 driver that I'm developing. The actual version is completely in ASM and has the IO interface embedded. It uses 16Kb of shared memory as fast VRAM.
PSG:
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 memory mapper program actually is really simple and has is embedded in each emulated chip. It has to be improved.
In the future I will embed a boot loader in the emulator, something like that shown in this video that I made some time ago:
http://www.youtube.com/watch?v=0q_NxV6mi0I&feature=g-upl
And as soon as I will have a stable alpha version I will start publishing the source code within the Parallax forum.
Enjoy for now!
Comments
Well done Francesco, more emulation for the prop is a good thing...
/Johannes
Looks like I need to get hold of a C3:)
I must admit that I'm going very slow in this project but little by little things seem to work out.
There is still the boot loaded to be done for loading roms into the C3Synapse. Actually the rom loader is run from the ram of the PropC3, then it reboots the C3 that loads the emulator from the eeprom. There is no more space for a boot loader within the emulator since half of the ram is taken by the TMS9928 VRAM ( 16 KB ), and 9,8KB are taken by the qz80.
I had to fit the TMS9928 vdp main driver, the renderer with lookup tables, the tv driver and the SN76489 in almost 6KB, and leave some space for the line buffer and memory maspped registers for the VDP.
Not easy.
I think that If I split the emulator in 2 Propellers, one on the PropC3 and an external one placed on some board on top of the C3Synapse, maybe I can have more chances to complete this emulator, and maybe to have more resources to go beyond with a Sega Master System emulation.
But this is not in my plans right now.
What sort of speed are you getting the Z80 to run. I never got it much over 2Mhz, and the Sega is 3.57Mhz. Are you using a cache for the ram?
I wonder if it would run on a touchscreen? I'm working at the moment on a hybrid propeller and a real Z80 chip as I think there are some clever things we can do.
Are you reusing space in hub ram after a cog is loaded?
Hi guys, thank you very much.
I haven't implemented any cache yet, nor measured speed, nor implemented any "frame skip" method to increase emulation speed like I did for my Flash Action Script emulators. The first goal was to make all games work.
Almost the 75% of the games now work, but I had to reduce the code of the qz80 in some places to save some machine cycles. The actual memory access routines for the C3Synapse are the following:
As you can see the access to the C3Synapse is very simple, and here the access to the memory space is from 0 to $FFFF, so I handle only two nibbles of the address. This saves a lot of time. The memory mapper of the SEGA SC-3000 is pretty simple, so I removed all memory access tables and put only one control on the write routine. The SEGA SC-3000 has only 2KB of DRAM mapped from $C000. Considering that the Z80 can handle 64KB a time, and the SEGA SC-3000 only use that memory space, it's useless to update everytime the third nibble of the address.
Some games run almost at the same speed of a real machine, others are really slow, mostly the sprites move very slow, not the background music. That means to me that there's something that can still be done to improve the speed.
Exerion for example, one of the games in the video, is really fast, more than I expected. I still have to see that but I haven't so mush time now. I'm studying something else. But right now I'm really happy and proud of what's coming out from this emulator
Uhm, I'm not sure about that. Now I have only one cog free, so that should drive the touch screen. But, the controls for the SC-3000, I mean in the real machine, it's provided by a Intel8255, so the Z80, when accesses the PPI port expect to read data from the keyboard matrix. This means that the z80 writes one byte to enable one column of the matrix, then it reads 2 bytes from the rows. In the emulated machine I only control the joystick, so I can reduce the code and embed it in the qz80 code:
No. The hub ram is full. 16KB used by the TMS9928 as VRAM, and 9,8KB are used by the qz80. The other memory is used by the VDP program code ( driver, renderers and TV driver )
Have you seen the AX81, AX81b and AX82 stuff.