Finally the SEGA SC-3000 emulator for PROPC3 and C3Synapse ready for download!

digimorfdigimorf Posts: 74
edited 2013-05-04 - 09:33:33 in Propeller 1
sega-sc-3000-sg-1000.jpg
Hi everybody!

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:

MAIN PROGRAM:
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.

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 Assembly 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/

MEMORY:
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.

GAMES SUPPORTED:
This is the list of the fully playable games that are supported so far:
  • EXERION
  • STAR FORCE
  • CHOP LIFTER
  • STAR JACKER
  • NINJA PRINCESS
  • PACAR
  • CHAMPION BOXING
  • HOME MAHJONG
  • SUPER MAHJONG
  • CHAMPION TENNIS
  • GOLGO13
  • SPACE ARMOR
  • TOORUKUN
  • ZIPPY RACE
  • CHALLENGE DERBY
  • CHAMPION WRESTLING
  • SPACE MOUNTAIN
  • WONDER BOY
  • ZOOM909
  • CHAMPION HOCKEY
  • FLICKY
  • SPACE INVADERS
  • OTHELLO ( Reversi )
  • GUZZLER
  • CASTLE
  • DRAGON WANG
  • PACHINKO 2
  • C_SO!
  • SEGA FLIPPER
  • CHAMPION GOLF
  • SUPER TANK
  • SOUKOBAN
  • CONGOBONGO
  • GIRL'S GARDEN
  • LODERUNNER
  • MONACO GP
If you want to try these and games that aren't supported yet by this emulator you can go to my FLASH emulator here:
http://www.play-sc-3000.com
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.

sega_sc-3000_joystick-pinout.jpg
More on the original SEGA Joystick in this page:
http://www.sc-3000.com/index.php/SEGA-SJ-200-Joystick/SEGA-SJ-200-Technical-information.html

If you want you can build one by yourself, the joystick circuit is very simple and you need 6 push buttons and few wires:

sega_sj-200_circuit.jpg

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:
  1. Unzip the zip archive attached to this post.
  2. Load into the Propeller IDE the main file "SC-3000_Emulator_010.spin".
  3. 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.
  4. Press F11 to compile and upload the program into the PropC3.
  5. PLAY and ENJOY !
DOWNLOAD IT:

The source code will be soon available on the website:
http://www.c3emulation.com

The playable emulator is here:

Comments

  • Heater.Heater. Posts: 21,233
    edited 2013-03-29 - 22:44:52
    digimorf,

    Awesome, brilliant, fantastic!

    Having put some effort into z80 emulation myself I can really appreciate this.

    I hope pullmoll is still lurking around to see this.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-03-29 - 23:20:23
    Wow - superb effort. Looks like a lot of work went into getting this going.

    Looks like the speed is ok. I've wondered at times whether we could merge the caching code from the GCC project with the Z80 emulation. It could run faster if you needed this.

    What games have you got so far?
  • Ahle2Ahle2 Posts: 998
    edited 2013-03-30 - 00:34:02
    --== Awesome ==--
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2013-03-30 - 05:53:55
    Every time I think that the therapy has finally worked, somebody comes back with some more Z80 stuff. Back to rehab then (or lots more settled apple juice, so as to forget).

    I have to move down to the south coast soon and there have been yet more cries of "Get rid of all that junk!" from the Harpie. The couple of, real, Z80s have survived though.

    Alan
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-03-30 - 06:55:54
    That is VERY cool!

    Well done.
  • digimorfdigimorf Posts: 74
    edited 2013-03-31 - 02:56:35
    Thank you very much guys, I hope you will enjoy it! :smile:
    Dr_Acula wrote: »
    ...What games have you got so far?...

    Actually a good percentage of the games released by SEGA for the SG-1000/SC-3000 are fully playable. I have updated the first post with the list of games actually supported :)
    You can get some information about SG-1000/SC-3000 games here also:
    http://www.smspower.org/Games/Index?sid=8de5248927fea22ceeb59d06ed45f9ae

    Happy Easter to everybody!
  • BaggersBaggers Posts: 2,965
    edited 2013-03-31 - 12:50:46
    Excellent work digimorf :D and have a great what's left of easter :)
  • digimorfdigimorf Posts: 74
    edited 2013-04-01 - 09:55:02
    Thank you very much !!
  • digimorfdigimorf Posts: 74
    edited 2013-04-03 - 23:35:57
    For those of you that want to read something more about the Console SEGA SG-1000 or the compuer version SEGA SC-3000, here there is the link to tech notes taken from the website SMSpower:

    Sega SC-3000 Hardware Notes (2004/07/29)
  • digimorfdigimorf Posts: 74
    edited 2013-04-08 - 00:08:44
    Someone has already tried the emulator? Do you need more information or instructions in order to play with it ? :)
  • AndreLAndreL Posts: 1,004
    edited 2013-04-18 - 02:01:06
    I tried it seems to work great. I think that most people in the USA have never heard of the SC-3000 that's why there's not more of a response, but anyone with a PropC3 and Synapse should check it out since its very interesting code, so if you haven't tried it, give it a try, worth a look.

    Andre'
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,090
    edited 2013-04-18 - 13:07:27
    Got a Synapse board on it's way to me just to try this out..

    Jeff
  • digimorfdigimorf Posts: 74
    edited 2013-04-21 - 02:19:54
    AndreL wrote: »
    I tried it seems to work great. I think that most people in the USA have never heard of the SC-3000 that's why there's not more of a response, but anyone with a PropC3 and Synapse should check it out since its very interesting code, so if you haven't tried it, give it a try, worth a look.

    Andre'

    Thanks. Actually the emulator itself occupies almost 14KB ! Even if I'm sure that the code can be optimized more, I think it's interesting to give it a try :)
    Got a Synapse board on it's way to me just to try this out..

    Jeff

    Good! Let me know what you think about it! :) I'm sure that this emulator can grow up more, because it could be the base to emulate COLECO Vision also.
    300px-ColecoVision.jpg

    Then with a little more effort it can emulate MSX1 and SEGA Master System platforms. :)
    250px-Sega_master_system.jpeg


    Probably the code could use the C3Synapse memory space with an efficient LMM system, and maybe when the GCC will fully support the C3Synapse this emulator can be easily ported in C++. Actually the drivers are coded in PASM of course.
  • David BetzDavid Betz Posts: 13,699
    edited 2013-04-21 - 03:58:10
    digimorf wrote: »
    Probably the code could use the C3Synapse memory space with an efficient LMM system, and maybe when the GCC will fully support the C3Synapse this emulator can be easily ported in C++. Actually the drivers are coded in PASM of course.
    PropGCC already supports your Synapse board. It has for a while.
  • digimorfdigimorf Posts: 74
    edited 2013-04-22 - 14:23:50
    Great! Is there a document or a readme that explain how the PropGCC works with the C3Synapse ?
  • David BetzDavid Betz Posts: 13,699
    edited 2013-04-23 - 06:44:28
    digimorf wrote: »
    Great! Is there a document or a readme that explain how the PropGCC works with the C3Synapse ?
    It works the same as any of the other cache drivers for PropGCC. You just choose "synapse" from the SimpleIDE board selection menu.
  • digimorfdigimorf Posts: 74
    edited 2013-05-04 - 09:33:33
    David Betz wrote: »
    It works In yoir opothe same as any of the other cache drivers for PropGCC. You just choose "synapse" from the SimpleIDE board selection menu.
    Oh cool,
    so if the speed is reasonable the emulator could be ported to c++. In your opinion it is bettr to run tv drivers in spin or should be ported to c++ ?
Sign In or Register to comment.