Sonic 1 32X port

Discussion in 'Showroom' started by Clownacy, Jul 16, 2016.

Thread Status:
Not open for further replies.
  1. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,021
    This has been sitting around in The Basement for a year or so. The author didn't want their name associated with it, and would rather someone else release it. I'm releasing something soon that uses parts of this project, so it doesn't make sense to keep it hidden any longer.

    [​IMG]

    As you can see, it's a plain port of S1 to the 32X, but it also comes with a basic SH2 program that displays a 256-colour image in the background. The SH2 code is assembled with asmsh, so you asm68k nuts should feel right at home. The code itself, for both CPUs, is all in one file: mars/sh2/code.asm.

    The differences from the standard Hivebrain disasm are minimal, so you can quite easily pick apart how to port your own hack to the 32X using it. There was one bugfix, involving SBZ's cycling palettes, however. You can see this in _inc/SBZ pallet script 1.asm and _inc/SBZ pallet script 2.asm, and the code that references them.

    As a 32X noob, there's a chance I'll screw something up trying to explain this, but here goes:
    For those that don't know, one of the bigger hurdles in porting to the 32X is the cartridge 'size' limit: The 68k can only see the first 512KB of the ROM at all times; the rest must be accessed through a 1MB bankswitch window. You can perform a bankswitch with 'move.b #your_mb_section,(marsreg+bankctl)'. As far as addressing goes, the first 512KB of the cartridge is mapped to $880000-$8FFFFF, and the bankswitch window ranges from $900000 to $9FFFFF, so you'll need to make use of asm68k's 'obj' or AS' 'phase' to correct how addresses are handled. These restrictions don't apply to data the SH2 needs to access: both CPUs can access the first 4MB of the cartridge, so don't worry so much about where mars/sh2/code.bin has to go.

    The disasm itself already has most of this laid out and explained: essential stuff that's needed at all times, like code, go after obj *+marsipl, stuff that's only needed here and there, like the zone art, goes after obj *+marsbank (this disasm doesn't bother with that, though, since S1's already 512KB), and SH2 stuff just goes wherever.
     

    Attached Files:

    DanielHall and FireRat like this.
  2. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    I know the author didn't want his name associated with it, but the artwork is kind of a giveaway.

    All I can say really, is that I feel he is one of the very few around here who steps up a high game, and he shouldn't be ashamed of this in particular. Many are very quick to judge and critique, and often forget the actual hardwork that went into it (often they confuse; the hardwork that was "expected" to have gone into it, with the hardwork that actually "went" into it), but that's no reason to avoid credit.

    That's my verdict on it.
     
    DanielHall likes this.
  3. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    280
    Yeah I figured it out who made this the moment I saw screenshots, and I don't even know the person personally.

    I agree with Markey that their shouldn't be any shame about this, I think it's pretty awesome that the person who made this, made this. I looked into it and I can tell a lot of work been put it in.
     
  4. Gardeguey

    Gardeguey Well-Known Member Member

    Joined:
    Aug 6, 2010
    Messages:
    82
    Location:
    México
    Ok screw it, yes, I did this.
    just telling since I returned with my bizarre hack S A N O K T E H G E D J E H O G (just once, or maybe another hack?, idk) and in that pros-only topic I said that i was leaving romhacking and well... I lied changed opinion

    reasons: SEGA allowing "mods" and also that Toby Fox thing I never knew before (I did play his hack one time)
     
    Last edited: Jul 17, 2016
    EMK-20218, LuigiXHero and FireRat like this.
  5. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    280
    Hi Gardeguey glad your back. I know we haven't met but the stuff I seen you do was pretty cool.
     
  6. โบวี่

    โบวี่ Tsingtao Enjoyer Member

    Joined:
    Dec 27, 2011
    Messages:
    215
    You're talking about the Earthbound Halloween hack. Correct?
     
  7. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,021
    So, again, speaking as a 32X noob, I think I found an error in the SH2 code: I ported it to AS, and found that the assembled code caused the game to hang in Kega and Gens/GS. I fixed this by placing a 'nop' instruction after the 'bra's in Slave_GoToHere and Master_GoToHere. I always thought that code was fishy, delayed branches and all. I guess asmsh's 'lits' output was coincidentally creating valid code, while AS' 'ltorg' wasn't.

    Edit: Or... it could have been because I had an unaligned dc.l just after the ltorg.
     
    Last edited: Aug 3, 2016
    Soldaten likes this.
  8. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    I'm glad to see that one of my friends from the old times from the scene is back. For obvious reason, I'm really happy with this.

    About the source... Hm... It works very well. Except for this (awesome) Pokémon picture everywhere in the game. To be honest, I still didn't make a deep bug search or deep test on it, but until I tested it I found it as a flawless Sonic 1 port. Great stuff!
     
Thread Status:
Not open for further replies.