don't click here

Any Questions about Sonic 3D Blast for Saturn or PC?

Discussion in 'Engineering & Reverse Engineering' started by Neil Harding, Nov 29, 2009.

Thread Status:
Not open for further replies.
  1. We started the Saturn port of Sonic 3D in July, and it was in the stores for Thanksgiving, so it was an incredibly tight schedule. I wrote a program to convert 68000 assembly language into C code. It was optimized so that it didn't do more than was needed, so move.w #10,d0; add.w #1,d0 didn't set the carry flag, zero flag etc, unless they were tested before they were changed again. My brother worked on sprite emulation (since that was hardware register manipulation on the Megadrive, there was no point converting that code to the Saturn because we were using 256 colour sprites rather than 16 colour ones.)

    Neil Harding
     
  2. Skeledroid

    Skeledroid

    Member
    227
    0
    0
    Was the program you wrote usable universally for other Genesis games?

    Did Sega have any plans for converting anything else in this manner (for Sega Saturn specifically)?
     
  3. Techokami

    Techokami

    For use only on NTSC Genesis systems Researcher
    1,373
    81
    28
    HoleNet!
    Sonic Worlds Next
    Out of curiousity, do you happen to still have this converter available?
     
  4. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,641
    57
    28
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    If the answer to the above two questions are yes, then this converter could prove to be incredibly useful.
     
  5. Afti

    Afti

    ORIGINAL MACHINE Member
    3,521
    0
    0
    I think you're missing something.

    The converter worked with the source. Might he still have a copy?
     
  6. Skeledroid

    Skeledroid

    Member
    227
    0
    0
    :imagines porting sonic hacks to the sega saturn and other awesome sega genesis games:
     
  7. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Or anything that has a C compiler.
     
  8. Mr. Fox

    Mr. Fox

    Member
    559
    9
    18
    I seriously doubt he has anything from over 12 years ago.

    Anyway, it's nice to see a professional developer here. Though unfortunately most of us don't know anything about the Saturn programming.

    Maybe you can provide some cool insider story instead, Mr. Harding?
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I'm pretty sure a few of us know something about PC programming.
     
  10. nineko

    nineko

    I am the Holy Cat Tech Member
    6,298
    475
    63
    italy
    I have all my floppies from 1988. And they contain GAMES, not even valuable pieces of softwares. So I wouldn't say it's impossible.
     
  11. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    I have two questions, and it's not "can we have it?":

    Were there any performance issues with the output of the 68000 to C converter that needed to be fixed for the final product? What did you do to handle jump tables within subroutines (you can't have an array of labels in C)?
     
  12. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    That second one could be done with a switch statement, in SADX switch statements show up as jump tables in ASM.
     
  13. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    Hi!

    I've already sent you a PM about it, but there's an October prototype of your port on my site -- http://www.hidden-palace.org/?releases/600 Might be fun to go down memory lane. Or not :)

    I was actually close to writing a 68000 -> PC converter, but converting things manually was much more fun, and you could optimize based on the program logic. Of course in your circumstance that would be impossible due to the time constraints :) The look-ahead optimisation sounds really cool though.

    Luke
     
  14. The 68K2C converter worked pretty well, it would be possible to port multiple programs with it. We used it for the PC version as well, (although I had to make some changes to support that fact that PC is little endian). The PC version of Sonic 3D would run on a 75Mhz Pentium (so NO problem, supporting current PCs). The converter handled jump tables (detected and converted into switch statement), and even allowed for simple stack manipulation.

    So you could have

    doLogic:
    jsr moveSonic
    ....
    moveSonic:
    add.w d0,d1
    bge notOffScreen
    addq #4,sp
    rts

    which would NOT carry on the line after the jsr moveSonic, but would return to the line that called doLogic.

    I'll post how I did that later, if anyone wants to have a guess how I did it, leave a comment :)

    I think the 68k2c was a macro assembler but the list of macros was fixed (that is the only thing that would need to be changed to make it general purpose). It produced code that was very quick since, it kept track of the condition flags, and only generated the code to set them if it was used. I think it might be interesting to make a 68k2j (converting to Java bytecode) which would allow for old games to be ported to cellphones.
     
  15. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,641
    57
    28
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    You don't happen to have The 68K2C Convertor still lying around do you?
    I'm sure a lot of us would find it useful, and I've been considering learning C recently, but this is yet another reason to. =P
     
  16. I THINK I have a copy of the 68K2C converter BUT it is on my other PC, which is not working at the moment (it won't boot up because of corrupted Windows, Hal.dll missing or corrupted, and I can't use Windows recovery console since it has C drive as raid 0 drive so Windows can't see it). The converter is designed to be used with source code, not disassembled code, although that should still work it would be harder to read than if you had the original code. It does not sort out memory mapped registers as we rewrote the code that dealt with screen, sprites and sound.
     
  17. doc eggfan

    doc eggfan

    Are you pondering what I'm pondering? Wiki Sysop
    9,681
    232
    43
    ACT
    GreatMegaLD, GreatSC3k, Great SG1k
    I guess I'd like to know more about the special stage development. I think I remember Sonic Team were involved with the Saturn ones, and they had some pretty good transparency effects which the Saturn was supposedly incapable of producing. The PC ones were entirely different, and fun in there own way if a little too easy.

    There's no real specific question there, I just remember the special stages were the most interesting part after already playing the game on mega drive.
     
  18. Yes Sonic Team did the bonus section for the Saturn version, we just received a binary file that we would run (and it returned the number of rings collected If I remember correctly). I think Stephen wrote the bonus level on the PC.
     
  19. Spanner

    Spanner

    The Tool Member
    Try running a Linux Live CD, you might be able to view the contents of your drive on there.
     
  20. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    Doesn't Recovery Console have a load third party RAID driver option?
     
Thread Status:
Not open for further replies.