How to use the SSFII mapper

Discussion in 'Tutorials Archive' started by RocketRobz, Dec 5, 2013.

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

    RocketRobz Coolest of TWL, and Sonic fan Member

    Joined:
    Aug 20, 2009
    Messages:
    80
    ;From a SSFII Doc - credits to Bart Trzynadlowski and Tim Meekins, those who contributed information

    ;

    ;The Sega Genesis/MegaDrive maps ROM from 0x000000 to 0x3FFFFF which means that
    ;the CPU can only see 4 megabytes of cartridge ROM.

    ;

    The SSFII mapper is a special ROM remapper/bankswitcher on the first 4MB ROM space
    that is used to break the the classic 4MB limit.

    To use the SSFII mapper on Sonic 1, 2, and 3&K,
    Copy and paste this macro to the beginning of your asm file.:


    setROMBank    macro    page,range        ; page = 0-63 (16MB) 512KB pages useable
                            ; range = $A130F1 = $0-$7FFFF not writable

            if range=$80000
            move.b  #page,($A130F3).l    ; range = $A130F3 = $80000-$FFFFF
            endif
            if range=$100000
            move.b  #page,($A130F5).l    ; range = $A130F5 = $100000-$17FFFF
            endif
            if range=$180000
            move.b  #page,($A130F7).l    ; range = $A130F7 = $180000-$1FFFFF
            endif
            if range=$200000
            move.b  #page,($A130F9).l    ; range = $A130F9 = $200000-$27FFFF
            endif
            if range=$280000
            move.b  #page,($A130FB).l    ; range = $A130FB = $280000-$2FFFFF
            endif
            if range=$300000
            move.b  #page,($A130FD).l    ; range = $A130FD = $300000-$37FFFF
            endif
            if range=$380000
            move.b  #page,($A130FF).l    ; range = $A130FF = $380000-$3FFFFF
            endif
            endm
    ;From a SSFII Doc - credits to Bart Trzynadlowski and Tim Meekins, those who contributed information

    ;

    ;A page is
    ;specified with 6 bits (bits 7 and 6 are always 0) thus allowing a possible 0-63
    ;pages (SSFII only has 9, though.)
    ;
    ;The first area, 0x000000-0x07FFFF is fixed
    ;and cannot be remapped because that is where the vector table resides.
    ;

    Remember, the 'range' cannot be none other than:
    $80000
    $100000
    $180000
    $200000
    $280000
    $300000
    $380000

    Then, copy and paste this under the GameProgram label (or the Test_LockOn label for Sonic 3&K):


    ;        move.b  #2,($A130F1).l ; SRAM?
            move.b  #1,($A130F3).l
            move.b  #2,($A130F5).l
            move.b  #3,($A130F7).l
            move.b  #4,($A130F9).l
            move.b  #5,($A130FB).l
            move.b  #6,($A130FD).l
            move.b  #7,($A130FF).l
    This sets up the first 4MB of the ROM correctly.

    Finally, remove the ChecksumCheck routine.

    Tested and works on Regen and Kega Fusion.
    Hope this helps you all people!
    If there is anything missing, reply here.
     
    Last edited by a moderator: Dec 6, 2013
  2. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    How does this interact with the SRAM handler, if at all? At one point, GerbilSoft said that $A130F1 is involved there if the ROM is >= 2 megabytes.
     
    Last edited by a moderator: Dec 5, 2013
  3. OrdosAlpha

    OrdosAlpha RIGHT! Naebody move! Root Admin

    Joined:
    Aug 5, 2007
    Messages:
    1,793
    Location:
    Glasgow, Scotland
    This entire paragraph is fucking wrong. They overshot the 32 megabit limit because of all the fucking audio samples (vocal & SFX), their custom soundfont (which I believe is uncompressed, and still sounds shit compared to the soundfont they used back in Special Champion Edition), and the code for the additional game modes compared to the Super Famicom build.

    Have you every heard the CPS-1 renditions of the Super tracks? I have, and they sound way better than what the MD got lumbered with. The CPS-1 used similar sound hardware to the MD.
     
  4. amphobius

    amphobius spreader of the pink text Member

    Joined:
    Feb 24, 2008
    Messages:
    970
    Location:
    United Kingdom
    The "CPS1" versions of the Super tracks aren't actually the CPS1 in action - it's still similar stuff, however they're actually from the Sharp X68000 port of SSF2 (and the FM versions of the original tracks in that are far superior to the original CPS1 tracks). Still, it had similar sound hardware, as it used the YM2151, arguably the YM2612's bigger brother, allowing for 8 FM channels (but had no DAC) and two dedicated sample channels.

    The MD SSF2 port was terrible. Why it needed to exist I have no idea.
     
    Last edited by a moderator: Dec 6, 2013
Thread Status:
Not open for further replies.