Shop OBEX P1 Docs P2 Docs Learn Events
C3 platform emulation fan site — Parallax Forums

C3 platform emulation fan site

AndreLAndreL Posts: 1,004
edited 2012-09-23 02:51 in Propeller 1
For those interested in emulation, game development, and related subjects. A customer that develops emulators is using the C3 as a standard platform for some new projects. Here is the site if you want to follow along or contribute:

http://www.c3emulation.com/

It just went live I think, so not much on there, but the developers have never programmed a C3 or the Prop, I sent him one a couple weeks ago, and after reading the HYDRA book, C3 docs, etc. he is already coding in ASM :) So, they are moving quickly. Should be interesting to see what they get up and running. They are SEGA fans, so that will be the first target.

Andre'
«1

Comments

  • JT CookJT Cook Posts: 487
    edited 2011-05-20 17:10
    That is pretty cool! I had a similar project in mind, except using the Chameleon instead of Prop by itself. When things slow down a bit I might have to try to get something going.

    It will be interesting to see what he comes up with on the C3!!
  • doggiedocdoggiedoc Posts: 2,245
    edited 2011-05-20 17:46
    Andre' - he's done a real nice job on that site. Looks promising for sure. He also gives you several really good plugs!

    Paul
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-05-21 01:13
    Ironically I have just finished my SN76489 emulator for the prop and I logged on to this forum today to start a thread about it. :)
    Because of the simplicity of this chip, It´s running at 175kHz and takes only 71 rows of assembly.

    Btw, of course I'm interested in emulation on the C3!

    / Ahle2
  • digimorfdigimorf Posts: 74
    edited 2011-05-21 09:24
    Hi, I must thank you Andr
  • max72max72 Posts: 1,155
    edited 2011-05-22 05:03
    Welcome to the forum.
    Nice to see another Italian here.
    Massimo
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-05-22 05:08
    @digimorf
    Welcome to this fabulous forum !!!
    Good luck with your emulator. I'm really looking forward to follow the progress and try it out on my C3!!
    (Btw, try out my chiptune player for the C3)

    /Ahle2
  • digimorfdigimorf Posts: 74
    edited 2011-05-22 08:27
    Thank you guys for your welcome!
    Ahle2 wrote: »
    @digimorf
    Welcome to this fabulous forum !!!
    Good luck with your emulator. I'm really looking forward to follow the progress and try it out on my C3!!
    (Btw, try out my chiptune player for the C3)
    /Ahle2

    Thank you Ahle2, I will try it for sure!!!! :) And if I wil use some "ideas" from your code I will include credits on the site. If you agree of course.
    max72 wrote: »
    Welcome to the forum.
    Nice to see another Italian here.
    Massimo

    Hi Massimo! Yes, I'm from province of Turin :) Nice to meet you!
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-05-25 12:00
    I'm following your progress on your site. Very pedagogically written. :)
    Hope this is going to spawn some interest in emulation as well as the C3.

    Of course you can use or (misuse) anything I have done!!

    Btw, you made me realize that I have got a bug in my SN76489 emulation. :)

    /Ahle2
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-05-25 13:17
    Looks good! I only had time for a quick peek, but I will be back :)
  • digimorfdigimorf Posts: 74
    edited 2011-05-27 02:19
    Ahle2 wrote: »
    I'm following your progress on your site. Very pedagogically written. :)
    Hope this is going to spawn some interest in emulation as well as the C3.

    Of course you can use or (misuse) anything I have done!!

    Btw, you made me realize that I have got a bug in my SN76489 emulation. :)

    /Ahle2

    Thank you very much! My actual version of PSG is less optimized than yours, but actually I prefer to keep it simple since I started coding for Propeller some weeks ago.

    Now I'm going to setup sd drivers, and have a try with your simple VGM player to have a test with what I've coded right now.
    Then if everything works I will publish some sample code as a middle step.
    Looks good! I only had time for a quick peek, but I will be back :)

    Thank you very much!
  • blittledblittled Posts: 681
    edited 2011-05-27 09:24
    JT Cook, which Chameleon do you have? I have the PIC version and would be interested in your project once you start it.
  • JT CookJT Cook Posts: 487
    edited 2011-05-27 09:58
    I have both, but if I did it, it would be for the PIC version. It would probably be a little ways off before I would even start it because I still need to finish up the game I am working on.
  • digimorfdigimorf Posts: 74
    edited 2011-05-31 14:57
    Just to let you know that on the site there is a first version of my SN76849 to play with. Just a mono channel version that you can try out and test by sending bytes in sequence to the chip.
    Basically this is useful to give an idea on how this chip works.
    later on I will go deep in developing the other channels :)
  • digimorfdigimorf Posts: 74
    edited 2011-06-16 14:45
    Hi guys, just a quick message to inform you that a SN76489 chip Cog with a little VGM player for testing, is ready for Propeller C3 on our site
    http://www.c3emulation.com
    Hope you will enjoy it! ;)
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-06-17 09:52
    I will try it soon. :)
    What's the next step? TMS9928A emulation?
    I think TMS9928A emulation will need every trick in the book to be made to run in less than 3 cogs.
    Anyway, I wish you good luck in your quest!

    /Ahle2
  • digimorfdigimorf Posts: 74
    edited 2011-06-17 10:54
    Ahle2 wrote: »
    I will try it soon. :)
    What's the next step? TMS9928A emulation?
    I think TMS9928A emulation will need every trick in the book to be made to run in less than 3 cogs.
    Anyway, I wish you good luck in your quest!
    /Ahle2

    Thank you.
    Maybe there will be some bugs still to fix, but I prefer to optimize and fix more over the code when the emulation will start to get body.

    The next step will be the memory access routines, SRAM and SD... Just surfing the wave of vgms, I will make them load from SD and put into SRAM. This will help me in figuring out hot to read a ROM game and buil up the memory map for the emulation.

    But you are right, the VDP is very, very tricky... I can't remember how many times I optimized the VDP actionscript class of my emulators, and I know that in ASM will be really a challenge, Especially for the interrupt signal and the use of 16k of VRAM. However, let's do step by step :)
  • digimorfdigimorf Posts: 74
    edited 2011-06-18 08:34
    Just a video with a subversion of the VGM player.
    The VGM music was edited with MOD2PSG ( more info on the site, tools section ) to make it smaller and fit in the shared memory.

    Have fun!
    Francesco.
  • Cole LoganCole Logan Posts: 196
    edited 2011-06-18 11:08
    Man that sounds awesome. One question thought. Is this reading the info from ram or an SD card. I don't have a C3 yet but would like to try it out.
  • digimorfdigimorf Posts: 74
    edited 2011-06-18 12:48
    Cole Logan wrote: »
    Man that sounds awesome.
    Hey, thank you!
    Cole Logan wrote: »
    One question thought. Is this reading the info from ram or an SD card. I don't have a C3 yet but would like to try it out.
    Well, I must say that a VGM player wasn't my goal, but I needed a test application for the emulated chip. The actual version of the player loads a binary file during compilation. If you look at the code in the DAT section you will find:
    DAT
    Str    byte "vgmmusic", 0   
    Data  file "Music.vgm"
    
    and the access to memory data is made by
    databyte := byte[Data][head]
    
    where Data is the pointer and head is a counter incremented each cycle.
    The VGM is loaded in the main memory of the Propeller. Not the correct solution but is fast enough for a test :)
    In the C3 there are still 64Kb of SRAM to use and 1MB of flash... for my emulator I will load ROM files into SRAM that is really easy to program, even in ASM, and the advantage is that is really FAST! Anyway I think there are still some things to fix in the emulation, but as I mentioned I wil do in a second pass :) Actually it works enough to go on in the development :)

    I've never seen a Propeler, I came from Arduino world, but in one month more or less, in spare time ( some night and some weekend ) I could learn a lot of things and put them into practice :) So... In my opinion C3 is really a great board, and it's worth it!
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-06-18 15:04
    That was the easy part! ;)
    The TMS9928A will need some serious effort. But I do have a good feeling about this project, so I'm sure you will pull it off!
  • digimorfdigimorf Posts: 74
    edited 2011-06-19 01:20
    Ahle2 wrote: »
    That was the easy part! ;)
    The TMS9928A will need some serious effort. But I do have a good feeling about this project, so I'm sure you will pull it off!

    Hehe, you're right :) I've decided to start with this because I wanted to see some resuilts in a "short time" :) Now I'm motivated to go on :)
    With my flash emulator I've started with VDP instead, and it was a real pain! It took me several months to optimize it, and it was written in a High level language. At a certain point I was depressed because it was slow, but... I tried to check other points of view. I've studied different solutions and I could make it faster. However This time is really different.

    However thank you very much for your feeling :) Hope to make a good job.

    OT: By the way, compliments for yours!!! I've seen many videos about your works :D SIDcog is amazing!
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-06-19 03:05
    I have been coding an emulation of the HuC6270 (used in the PC Engine / Turbo Grafx 16), so I know that the graphics part of an emulator is the most time-consuming part.
    The main processor (HuC6280) took maybe 1/10 of the time to get "perfect" compared to the VDC; And the sound chip took maybe 1/20 of the time.

    Sadly the PCe is a too complex machine to get working on the current generation Propeller chip, but I have successfully compiled and run the emulator on a 200 Mhz ARM processor with 16Mb of ram.
    I am however certain that the Prop2 will be able to do it. (with some external memory attached of course)*

    (Btw, have you tried the C3 version of my chiptune player yet?)

    /Ahle2
  • digimorfdigimorf Posts: 74
    edited 2011-06-19 03:28
    Yes you are right, and there's also one thing: Interrupts.

    When I've coded a color video driver for Arduino, I could take advantage from its interrupt, but it was really a pain because of the speed ( 16Mhz ) and the poor memory. The Propeller there's the VSU that can do really incredible things, and if i can fit the VDP Vram on the external SRAM, in some way I can think that it would be fine.

    SC-3000 uses first 32/40K for ROM, and just 2k for RAM mapped at 0xC000. So amulating normal games that have no RAM onboard, I still have space for 16k of VRAM. C3 has 64K of SRAM :)
    And if it would be a problem, at least I can put a little expansion board, and take some advantage from the I/O port, and add SEGA Joysticks plugs, Tape jacks, and an extra 32k of SRAM for the VDP Vram.
    That would be enough :)
  • digimorfdigimorf Posts: 74
    edited 2011-07-19 03:09
    Hi to everybody, just made another step ahead... memory access routines are ready, a kind of All in one driver with the essential for my future emulator.

    I've coded some assembly routines to handle SPI, SRAM and SD mounting/reading sectors.

    I've decided also to start some graphics by studying the drivers included in the support package.
    What I've used is the J_T_Cooks' graphic engine used in Spintris, but I've embedded some extra functions in the tile driver.

    Right now it's enough, but of course to implement the TMS9928 much more works has to be done.

    However hope you will enjoy this video, soon I will include sources in the site.
    Enjoy!
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-07-19 03:23
    And here I was thinking that you have abandon the project.
    Nice to see some progress on this. The GUI looks fabulous.

    /Johannes
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-07-19 03:25
    How fast is your spi-ram access? I have an unreleased driver capable of continous 20Mbit/sec between hub-ram and spi-ram using the video generator.
  • digimorfdigimorf Posts: 74
    edited 2011-07-19 07:50
    Ahle2 wrote: »
    And here I was thinking that you have abandon the project.
    Nice to see some process on this. The GUI looks fabulous.

    /Johannes

    WOW, thank you for trusting me LOL :P Anyway thank you for appreciation, I'm going a little bit slow because I'm developing during spare time :( And of course this is subdivided between, family, house works, and so on.
    Ahle2 wrote: »
    How fast is your spi-ram access? I have an unreleased driver capable of continous 20Mbit/sec between hub-ram and spi-ram using the video generator.

    I don't use the VSU to transfer bits, but, to be honest I haven't measured exactly the speed of my code, even because my final goal for SPI-SRAM is the access for Z80 to SRAM, so the transfer mode won't be sequential. Even between VDP and VRAM the access is not always sequential.

    And the boot section, when a ROM will be copied from SD to SRAM doesn't need to be so much fast.

    However I've tryied to measure cnt before the transfer and immediately after the unrolled 8 bit cycle and main SPI routines transferred 8 bit in 160 cycles ( I'm excluding the control word for setting mode and address )

    But I don't think that this have a meaning, because the real speed will be influenced by many factor during emulation.

    Actually the unrolled cycle of 8 bits takes 4 instructions to read or write each bit ( read and write are separated ) The code is reduced drastically...

    each bit
    and    outa, _SPI_SCK_MASK   ' low clock
    rol    _out, #1  wc          ' rotate byte
    muxc   outa, _SPI_MOSI       ' write rotation result to MOSI 
    or     outa, _SPI_SCK        ' rise clock 
    

    So an average test will be done when Z80 will access directly to SRAM :)
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-07-19 11:01
    That GUI player blows me away... Awesome work!

    Is there some code posted somewhere where we can try this out ourselves?

    OBC
  • jazzedjazzed Posts: 11,803
    edited 2011-07-19 11:11
    Awesome job on that GUI. I could really use something like that.
    Can you post a package here that includes the GUI? Is it MIT licensed?
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-07-19 11:57
    Fantastic Job :)
Sign In or Register to comment.