Dynamic Title Cards

Discussion in 'Tutorials Archive' started by Selbi, Dec 26, 2009.

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

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Dynamic Title Cards in Sonic 1


    Before I start: This guide is NOT a tl;dr. I just made it as clearly as possible, so the ASM boxes are huge. =P


    You edited GHZ 1 and GHZ 2 and now they are looking completly different, because you, for example, used dynamic tile sets or you made dynamic palettes? 2 different acts, one having a green and the other one a red palette? Of course, now the name is not correct anymore, one of the acts should be named RHZ (Red Hill Zone). Well, but how can we do it? By duplicating the title card textes for each zone and telling the game to use the correct one!


    Trust me, it looks way harder than it actually is, because all you need to do is to tell the game to use different mappings for each zone. And it's even easier to do when you have me, someone who likes to create copy/paste guides. So if you have problems, you just failed at doing so. =P


    So, here we go:


    1: Duplicating the Title Card pointers


    Go to "Map_Obj34:". This code are the mappings for the title card textes. Right at the beginning we have this:



    dc.w byte_C9FE-Map_obj34
    dc.w byte_CA2C-Map_obj34


    dc.w byte_CA5A-Map_obj34


    ...



    These things are pointing to each mapping area. However, it's kinda hard to understand, because "byte_" and some hex numbers is not that helpful. Here is what it would look like when it's perfectly done:



    dc.w GHZ_TTLMaps-Map_obj34
    dc.w LZ_TTLMaps-Map_obj34


    dc.w MZ_TTLMaps-Map_obj34


    dc.w SLZ_TTLMaps-Map_obj34


    ...



    Hopefully it's easier to understand now. But basically, this thing is still useless, because we want it for every act:



    dc.w GHZ1_TTLMaps-Map_obj34
    dc.w GHZ2_TTLMaps-Map_obj34


    dc.w GHZ3_TTLMaps-Map_obj34


    dc.w LZ1_TTLMaps-Map_obj34


    dc.w LZ2_TTLMaps-Map_obj34


    dc.w LZ3_TTLMaps-Map_obj34


    dc.w MZ1_TTLMaps-Map_obj34


    dc.w MZ2_TTLMaps-Map_obj34


    dc.w MZ3_TTLMaps-Map_obj34


    dc.w SLZ1_TTLMaps-Map_obj34


    dc.w SLZ2_TTLMaps-Map_obj34


    dc.w SLZ3_TTLMaps-Map_obj34


    dc.w SYZ1_TTLMaps-Map_obj34


    dc.w SYZ2_TTLMaps-Map_obj34


    dc.w SYZ3_TTLMaps-Map_obj34


    dc.w SBZ1_TTLMaps-Map_obj34


    dc.w SBZ2_TTLMaps-Map_obj34


    dc.w SBZ3_TTLMaps-Map_obj34


    dc.w ZONE_TTLMaps-Map_obj34


    dc.w Act1_TTLMaps-Map_obj34


    dc.w Act2_TTLMaps-Map_obj34


    dc.w Act3_TTLMaps-Map_obj34


    dc.w Oval_TTLMaps-Map_obj34


    dc.w FZ_TTLMaps-Map_obj34



    But now the misc stuff (Oval etc.) has a wrong spot, so we need to fix this by putting them at the default position again (actually not necesary, but I'm too lazy to change the pointers for them as well =P):



    Map_obj34: dc.w GHZ1_TTLMaps-Map_obj34
    dc.w GHZ2_TTLMaps-Map_obj34


    dc.w GHZ3_TTLMaps-Map_obj34


    dc.w LZ1_TTLMaps-Map_obj34


    dc.w LZ2_TTLMaps-Map_obj34


    dc.w LZ3_TTLMaps-Map_obj34


    dc.w ZONE_TTLMaps-Map_obj34


    dc.w Act1_TTLMaps-Map_obj34


    dc.w Act2_TTLMaps-Map_obj34


    dc.w Act3_TTLMaps-Map_obj34


    dc.w Oval_TTLMaps-Map_obj34


    dc.w MZ1_TTLMaps-Map_obj34


    dc.w MZ2_TTLMaps-Map_obj34


    dc.w MZ3_TTLMaps-Map_obj34


    dc.w SLZ1_TTLMaps-Map_obj34


    dc.w SLZ2_TTLMaps-Map_obj34


    dc.w SLZ3_TTLMaps-Map_obj34


    dc.w SYZ1_TTLMaps-Map_obj34


    dc.w SYZ2_TTLMaps-Map_obj34


    dc.w SYZ3_TTLMaps-Map_obj34


    dc.w SBZ1_TTLMaps-Map_obj34


    dc.w SBZ2_TTLMaps-Map_obj34


    dc.w SBZ3_TTLMaps-Map_obj34


    dc.w FZ_TTLMaps-Map_obj34



    Now as we changed these things, we will also need to do that at all the other points where the game points to those routines. Go to "Map_Obj3A:" and replace the pointers at the beginning with this:



    Map_obj3A: dc.w byte_CBEA-Map_obj3A
    dc.w byte_CC13-Map_obj3A


    dc.w byte_CC32-Map_obj3A


    dc.w byte_CC51-Map_obj3A


    dc.w byte_CC75-Map_obj3A


    dc.w Act1_TTLMaps-Map_obj34


    dc.w Act2_TTLMaps-Map_obj34


    dc.w Act3_TTLMaps-Map_obj34


    dc.w Oval_TTLMaps-Map_obj34



    And replace the pointers as well in "Map_Obj7E:" with this:



    Map_obj7E: dc.w byte_CCAC-Map_obj7E
    dc.w byte_CCEE-Map_obj7E


    dc.w byte_CD0D-Map_obj7E


    dc.w Oval_TTLMaps-Map_obj34


    dc.w byte_CD31-Map_obj7E


    dc.w byte_CD46-Map_obj7E


    dc.w byte_CD5B-Map_obj7E


    dc.w byte_CD6B-Map_obj7E


    dc.w byte_CDA8-Map_obj7E



    If you want to build now, you'll get millions of errors, because we changed all the names as well as added new ones. We need to do 3 more steps.


    2: Duplicating the Title Card mappings


    Now as we have the new pointers, we need to duplicate the mappings as well. If we have the GHZ text now (created with my tool):



    byte_C9FE: dc.b $A ; GREEN HILL
    dc.b $F8, 5, 0, $18, $B4 ; G


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 5, 0, $10, $D4 ; E


    dc.b $F8, 5, 0, $10, $E4 ; E


    dc.b $F8, 5, 0, $2E, $F4 ; N


    dc.b $F8, 0, 0, $56, $4 ; Space


    dc.b $F8, 5, 0, $1C, $14 ; H


    dc.b $F8, 1, 0, $20, $24 ; I


    dc.b $F8, 5, 0, $26, $2C ; L


    dc.b $F8, 5, 0, $26, $3C ; L



    We will have to copy and paste it 2 times AFTER IT (nowhere else). Then, replace the "byte_C9FE:" in the first one with "GHZ1_TTLMaps:", in the second one with "GHZ2_TTLMaps:" and in the third one with "GHZ3_TTLMaps:". Repeat this process for every other title card (except the misc stuff after SBZ (Act 1-3, Oval and FZ)).


    In the end the whole routine should look like this:



    Map_obj34: dc.w GHZ1_TTLMaps-Map_obj34
    dc.w GHZ2_TTLMaps-Map_obj34


    dc.w GHZ3_TTLMaps-Map_obj34


    dc.w LZ1_TTLMaps-Map_obj34


    dc.w LZ2_TTLMaps-Map_obj34


    dc.w LZ3_TTLMaps-Map_obj34


    dc.w ZONE_TTLMaps-Map_obj34


    dc.w Act1_TTLMaps-Map_obj34


    dc.w Act2_TTLMaps-Map_obj34


    dc.w Act3_TTLMaps-Map_obj34


    dc.w Oval_TTLMaps-Map_obj34


    dc.w MZ1_TTLMaps-Map_obj34


    dc.w MZ2_TTLMaps-Map_obj34


    dc.w MZ3_TTLMaps-Map_obj34


    dc.w SLZ1_TTLMaps-Map_obj34


    dc.w SLZ2_TTLMaps-Map_obj34


    dc.w SLZ3_TTLMaps-Map_obj34


    dc.w SYZ1_TTLMaps-Map_obj34


    dc.w SYZ2_TTLMaps-Map_obj34


    dc.w SYZ3_TTLMaps-Map_obj34


    dc.w SBZ1_TTLMaps-Map_obj34


    dc.w SBZ2_TTLMaps-Map_obj34


    dc.w SBZ3_TTLMaps-Map_obj34


    dc.w FZ_TTLMaps-Map_obj34


    GHZ1_TTLMaps: dc.b $A ; GREEN HILL ACT 1


    dc.b $F8, 5, 0, $18, $B4 ; G


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 5, 0, $10, $D4 ; E


    dc.b $F8, 5, 0, $10, $E4 ; E


    dc.b $F8, 5, 0, $2E, $F4 ; N


    dc.b $F8, 0, 0, $56, $4 ; Space


    dc.b $F8, 5, 0, $1C, $14 ; H


    dc.b $F8, 1, 0, $20, $24 ; I


    dc.b $F8, 5, 0, $26, $2C ; L


    dc.b $F8, 5, 0, $26, $3C ; L


    GHZ2_TTLMaps: dc.b $A ; GREEN HILL ACT 2


    dc.b $F8, 5, 0, $18, $B4 ; G


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 5, 0, $10, $D4 ; E


    dc.b $F8, 5, 0, $10, $E4 ; E


    dc.b $F8, 5, 0, $2E, $F4 ; N


    dc.b $F8, 0, 0, $56, $4 ; Space


    dc.b $F8, 5, 0, $1C, $14 ; H


    dc.b $F8, 1, 0, $20, $24 ; I


    dc.b $F8, 5, 0, $26, $2C ; L


    dc.b $F8, 5, 0, $26, $3C ; L


    GHZ3_TTLMaps: dc.b $A ; GREEN HILL ACT 3


    dc.b $F8, 5, 0, $18, $B4 ; G


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 5, 0, $10, $D4 ; E


    dc.b $F8, 5, 0, $10, $E4 ; E


    dc.b $F8, 5, 0, $2E, $F4 ; N


    dc.b $F8, 0, 0, $56, $4 ; Space


    dc.b $F8, 5, 0, $1C, $14 ; H


    dc.b $F8, 1, 0, $20, $24 ; I


    dc.b $F8, 5, 0, $26, $2C ; L


    dc.b $F8, 5, 0, $26, $3C ; L


    LZ1_TTLMaps: dc.b 9 ; LABYRINTH ACT 1


    dc.b $F8, 5, 0, $26, $C4 ; L


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, 4, $E4 ; B


    dc.b $F8, 5, 0, $4A, $F4 ; Y


    dc.b $F8, 5, 0, $3A, $4 ; R


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $2E, $1C ; N


    dc.b $F8, 5, 0, $42, $2C ; T


    dc.b $F8, 5, 0, $1C, $3C ; H


    LZ2_TTLMaps: dc.b 9 ; LABYRINTH ACT 2


    dc.b $F8, 5, 0, $26, $C4 ; L


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, 4, $E4 ; B


    dc.b $F8, 5, 0, $4A, $F4 ; Y


    dc.b $F8, 5, 0, $3A, $4 ; R


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $2E, $1C ; N


    dc.b $F8, 5, 0, $42, $2C ; T


    dc.b $F8, 5, 0, $1C, $3C ; H


    LZ3_TTLMaps: dc.b 9 ; LABYRINTH ACT 3


    dc.b $F8, 5, 0, $26, $C4 ; L


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, 4, $E4 ; B


    dc.b $F8, 5, 0, $4A, $F4 ; Y


    dc.b $F8, 5, 0, $3A, $4 ; R


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $2E, $1C ; N


    dc.b $F8, 5, 0, $42, $2C ; T


    dc.b $F8, 5, 0, $1C, $3C ; H


    MZ1_TTLMaps: dc.b 6 ; MARBLE ACT 1


    dc.b $F8, 5, 0, $2A, $EC ; M


    dc.b $F8, 5, 0, 0, $FC ; A


    dc.b $F8, 5, 0, $3A, $C ; R


    dc.b $F8, 5, 0, 4, $1C ; B


    dc.b $F8, 5, 0, $26, $2C ; L


    dc.b $F8, 5, 0, $10, $3C ; E


    MZ2_TTLMaps: dc.b 6 ; MARBLE ACT 2


    dc.b $F8, 5, 0, $2A, $EC ; M


    dc.b $F8, 5, 0, 0, $FC ; A


    dc.b $F8, 5, 0, $3A, $C ; R


    dc.b $F8, 5, 0, 4, $1C ; B


    dc.b $F8, 5, 0, $26, $2C ; L


    dc.b $F8, 5, 0, $10, $3C ; E


    MZ3_TTLMaps: dc.b 6 ; MARBLE ACT 3


    dc.b $F8, 5, 0, $2A, $EC ; M


    dc.b $F8, 5, 0, 0, $FC ; A


    dc.b $F8, 5, 0, $3A, $C ; R


    dc.b $F8, 5, 0, 4, $1C ; B


    dc.b $F8, 5, 0, $26, $2C ; L


    dc.b $F8, 5, 0, $10, $3C ; E


    SLZ1_TTLMaps: dc.b $A ; STAR LIGHT ACT 1


    dc.b $F8, 5, 0, $3E, $B4 ; S


    dc.b $F8, 5, 0, $42, $C4 ; T


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, $3A, $E4 ; R


    dc.b $F8, 0, 0, $56, $F4 ; Space


    dc.b $F8, 5, 0, $26, $4 ; L


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $18, $1C ; G


    dc.b $F8, 5, 0, $1C, $2C ; H


    dc.b $F8, 5, 0, $42, $3C ; T


    SLZ2_TTLMaps: dc.b $A ; STAR LIGHT ACT 2


    dc.b $F8, 5, 0, $3E, $B4 ; S


    dc.b $F8, 5, 0, $42, $C4 ; T


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, $3A, $E4 ; R


    dc.b $F8, 0, 0, $56, $F4 ; Space


    dc.b $F8, 5, 0, $26, $4 ; L


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $18, $1C ; G


    dc.b $F8, 5, 0, $1C, $2C ; H


    dc.b $F8, 5, 0, $42, $3C ; T


    SLZ3_TTLMaps: dc.b $A ; STAR LIGHT ACT 3


    dc.b $F8, 5, 0, $3E, $B4 ; S


    dc.b $F8, 5, 0, $42, $C4 ; T


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, $3A, $E4 ; R


    dc.b $F8, 0, 0, $56, $F4 ; Space


    dc.b $F8, 5, 0, $26, $4 ; L


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $18, $1C ; G


    dc.b $F8, 5, 0, $1C, $2C ; H


    dc.b $F8, 5, 0, $42, $3C ; T


    SYZ1_TTLMaps: dc.b $B ; SPRING YARD ACT 1


    dc.b $F8, 5, 0, $3E, $A4 ; S


    dc.b $F8, 5, 0, $36, $B4 ; P


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 1, 0, $20, $D4 ; I


    dc.b $F8, 5, 0, $2E, $DC ; N


    dc.b $F8, 5, 0, $18, $EC ; G


    dc.b $F8, 0, 0, $56, $FC ; Space


    dc.b $F8, 5, 0, $4A, $C ; Y


    dc.b $F8, 5, 0, 0, $1C ; A


    dc.b $F8, 5, 0, $3A, $2C ; R


    dc.b $F8, 5, 0, $0C, $3C ; D


    SYZ2_TTLMaps: dc.b $B ; SPRING YARD ACT 2


    dc.b $F8, 5, 0, $3E, $A4 ; S


    dc.b $F8, 5, 0, $36, $B4 ; P


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 1, 0, $20, $D4 ; I


    dc.b $F8, 5, 0, $2E, $DC ; N


    dc.b $F8, 5, 0, $18, $EC ; G


    dc.b $F8, 0, 0, $56, $FC ; Space


    dc.b $F8, 5, 0, $4A, $C ; Y


    dc.b $F8, 5, 0, 0, $1C ; A


    dc.b $F8, 5, 0, $3A, $2C ; R


    dc.b $F8, 5, 0, $0C, $3C ; D


    SYZ3_TTLMaps: dc.b $B ; SPRING YARD ACT 3


    dc.b $F8, 5, 0, $3E, $A4 ; S


    dc.b $F8, 5, 0, $36, $B4 ; P


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 1, 0, $20, $D4 ; I


    dc.b $F8, 5, 0, $2E, $DC ; N


    dc.b $F8, 5, 0, $18, $EC ; G


    dc.b $F8, 0, 0, $56, $FC ; Space


    dc.b $F8, 5, 0, $4A, $C ; Y


    dc.b $F8, 5, 0, 0, $1C ; A


    dc.b $F8, 5, 0, $3A, $2C ; R


    dc.b $F8, 5, 0, $0C, $3C ; D


    SBZ1_TTLMaps: dc.b $B ; SCRAP BRAIN ACT 1


    dc.b $F8, 5, 0, $3E, $A4 ; S


    dc.b $F8, 5, 0, 8, $B4 ; C


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, $36, $E4 ; P


    dc.b $F8, 0, 0, $56, $F4 ; Space


    dc.b $F8, 5, 0, 4, $4 ; B


    dc.b $F8, 5, 0, $3A, $14 ; R


    dc.b $F8, 5, 0, 0, $24 ; A


    dc.b $F8, 1, 0, $20, $34 ; I


    dc.b $F8, 5, 0, $2E, $3C ; N


    SBZ2_TTLMaps: dc.b $B ; SCRAP BRAIN ACT 2


    dc.b $F8, 5, 0, $3E, $A4 ; S


    dc.b $F8, 5, 0, 8, $B4 ; C


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, $36, $E4 ; P


    dc.b $F8, 0, 0, $56, $F4 ; Space


    dc.b $F8, 5, 0, 4, $4 ; B


    dc.b $F8, 5, 0, $3A, $14 ; R


    dc.b $F8, 5, 0, 0, $24 ; A


    dc.b $F8, 1, 0, $20, $34 ; I


    dc.b $F8, 5, 0, $2E, $3C ; N


    SBZ3_TTLMaps: dc.b $B ; SCRAP BRAIN ACT 3


    dc.b $F8, 5, 0, $3E, $A4 ; S


    dc.b $F8, 5, 0, 8, $B4 ; C


    dc.b $F8, 5, 0, $3A, $C4 ; R


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, $36, $E4 ; P


    dc.b $F8, 0, 0, $56, $F4 ; Space


    dc.b $F8, 5, 0, 4, $4 ; B


    dc.b $F8, 5, 0, $3A, $14 ; R


    dc.b $F8, 5, 0, 0, $24 ; A


    dc.b $F8, 1, 0, $20, $34 ; I


    dc.b $F8, 5, 0, $2E, $3C ; N


    ZONE_TTLMaps: dc.b 4 ; ZONE


    dc.b $F8, 5, 0, $4E, $E0


    dc.b $F8, 5, 0, $32, $F0


    dc.b $F8, 5, 0, $2E, 0


    dc.b $F8, 5, 0, $10, $10


    dc.b 0


    Act1_TTLMaps: dc.b 2 ; ACT 1


    dc.b 4, $C, 0, $53, $EC


    dc.b $F4, 2, 0, $57, $C


    Act2_TTLMaps: dc.b 2 ; ACT 2


    dc.b 4, $C, 0, $53, $EC


    dc.b $F4, 6, 0, $5A, 8


    Act3_TTLMaps: dc.b 2 ; ACT 3


    dc.b 4, $C, 0, $53, $EC


    dc.b $F4, 6, 0, $60, 8


    Oval_TTLMaps: dc.b $D ; Oval


    dc.b $E4, $C, 0, $70, $F4


    dc.b $E4, 2, 0, $74, $14


    dc.b $EC, 4, 0, $77, $EC


    dc.b $F4, 5, 0, $79, $E4


    dc.b $14, $C, $18, $70, $EC


    dc.b 4, 2, $18, $74, $E4


    dc.b $C, 4, $18, $77, 4


    dc.b $FC, 5, $18, $79, $C


    dc.b $EC, 8, 0, $7D, $FC


    dc.b $F4, $C, 0, $7C, $F4


    dc.b $FC, 8, 0, $7C, $F4


    dc.b 4, $C, 0, $7C, $EC


    dc.b $C, 8, 0, $7C, $EC


    dc.b 0


    FZ_TTLMaps: dc.b 5 ; FINAL


    dc.b $F8, 5, 0, $14, $4 ; F


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $2E, $1C ; N


    dc.b $F8, 5, 0, 0, $2C ; A


    dc.b $F8, 5, 0, $26, $3C ; L


    even



    (I created it with my program again, because I think it's easier to understand that way.)


    Building should work now, but still we have a problem: The game is (obviously) pointing to the wrong spots.


    3: Telling the game to use the correct mappings


    Go to "Obj34_ChkSBZ3:". There we already have the nice code to check for a specific zone and act and set the correct title card:



    Obj34_CheckSBZ3: ; XREF: Obj34_Index
    movea.l a0,a1


    moveq #0,d0


    move.b ($FFFFFE10).w,d0


    -> cmpi.w #$103,($FFFFFE10).w ; check if level is SBZ 3


    -> bne.s Obj34_CheckFZ


    -> moveq #5,d0 ; load title card number 5 (SBZ)



    Since we want it for every act, the following thing is huge:



    Obj34_CheckSBZ3: ; XREF: Obj34_Index
    movea.l a0,a1 ; copy a0 to a1


    moveq #0,d0 ; clear d0


    move.b ($FFFFFE10).w,d0 ; move current zone (not act) number to d0


    Obj34_ChkGHZ1: cmpi.w #$000,($FFFFFE10).w ; is current level GHZ 1?


    bne.s Obj34_ChkGHZ2 ; if not, branch


    moveq #0,d0 ; use GHZ 1 title card text


    Obj34_ChkGHZ2: cmpi.w #$001,($FFFFFE10).w ; is current level GHZ 2?


    bne.s Obj34_ChkGHZ3 ; if not, branch


    moveq #1,d0 ; use GHZ 2 title card text


    Obj34_ChkGHZ3: cmpi.w #$002,($FFFFFE10).w ; is current level GHZ 3?


    bne.s Obj34_ChkLZ1 ; if not, branch


    moveq #2,d0 ; use GHZ 3 title card text


    Obj34_ChkLZ1: cmpi.w #$100,($FFFFFE10).w ; is current level LZ 1?


    bne.s Obj34_ChkLZ2 ; if not, branch


    moveq #3,d0 ; use LZ 1 title card text


    Obj34_ChkLZ2: cmpi.w #$101,($FFFFFE10).w ; is current level LZ 2?


    bne.s Obj34_ChkLZ3 ; if not, branch


    moveq #4,d0 ; use LZ 2 title card text


    Obj34_ChkLZ3: cmpi.w #$102,($FFFFFE10).w ; is current level LZ 3?


    bne.s Obj34_ChkMZ1 ; if not, branch


    moveq #5,d0 ; use LZ 3 title card text


    Obj34_ChkMZ1: cmpi.w #$200,($FFFFFE10).w ; is current level MZ 1?


    bne.s Obj34_ChkMZ2 ; if not, branch


    moveq #11,d0 ; use MZ 1 title card text


    Obj34_ChkMZ2: cmpi.w #$201,($FFFFFE10).w ; is current level MZ 2?


    bne.s Obj34_ChkMZ3 ; if not, branch


    moveq #12,d0 ; use MZ 2 title card text


    Obj34_ChkMZ3: cmpi.w #$202,($FFFFFE10).w ; is current level MZ 3?


    bne.s Obj34_ChkSLZ1 ; if not, branch


    moveq #13,d0 ; use MZ 3 title card text


    Obj34_ChkSLZ1: cmpi.w #$300,($FFFFFE10).w ; is current level SLZ 1?


    bne.s Obj34_ChkSLZ2 ; if not, branch


    moveq #14,d0 ; use SLZ 1 title card text


    Obj34_ChkSLZ2: cmpi.w #$301,($FFFFFE10).w ; is current level SLZ 2?


    bne.s Obj34_ChkSLZ3 ; if not, branch


    moveq #15,d0 ; use SLZ 2 title card text


    Obj34_ChkSLZ3: cmpi.w #$302,($FFFFFE10).w ; is current level SLZ 3?


    bne.s Obj34_ChkSYZ1 ; if not, branch


    moveq #16,d0 ; use SLZ 3 title card text


    Obj34_ChkSYZ1: cmpi.w #$400,($FFFFFE10).w ; is current level SYZ 1?


    bne.s Obj34_ChkSYZ2 ; if not, branch


    moveq #17,d0 ; use SYZ 1 title card text


    Obj34_ChkSYZ2: cmpi.w #$401,($FFFFFE10).w ; is current level SYZ 2?


    bne.s Obj34_ChkSYZ3 ; if not, branch


    moveq #18,d0 ; use SYZ 2 title card text


    Obj34_ChkSYZ3: cmpi.w #$402,($FFFFFE10).w ; is current level SYZ 3?


    bne.s Obj34_ChkSBZ1 ; if not, branch


    moveq #19,d0 ; use SYZ 3 title card text


    Obj34_ChkSBZ1: cmpi.w #$500,($FFFFFE10).w ; is current level SBZ 1?


    bne.s Obj34_ChkSBZ2 ; if not, branch


    moveq #20,d0 ; use SBZ 1 title card text


    Obj34_ChkSBZ2: cmpi.w #$501,($FFFFFE10).w ; is current level SBZ 2?


    bne.s Obj34_ChkSBZ3 ; if not, branch


    moveq #21,d0 ; use SBZ 2 title card text


    Obj34_ChkSBZ3: cmpi.w #$103,($FFFFFE10).w ; is current level SBZ 3?


    bne.s Obj34_CheckFZ ; if not, branch


    moveq #22,d0 ; use SBZ 3 title card text (LZ 4)


    Obj34_CheckFZ:


    move.w d0,d2 ; move d0 to d2 for whatever reason


    cmpi.w #$502,($FFFFFE10).w ; is current level FZ?


    bne.s Obj34_LoadConfig ; if not, branch


    moveq #23,d0 ; use FZ title card text


    move.b #$17,d2 ; use "FINAL" mappings



    If you build now, every act until MZ3 will work. The others are using non exsisting title card configuration, so instead of "weeeeeee it works" you'll say "whaaaaat flying title card patterns". So, we are sadly still not done yet.


    4: Extending the configuration so every act works


    I did everything of this guide based on my program, and there every title card is based on GHZ's position, so you are "forced" to copy the GHZ one in "Obj34_ConData:" over every other one. You'll need to do that 3 times, because we have 3 acts per zone. Here another c/p box:



    Obj34_ConData: dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; GHZ 1
    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; LZ 1


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; MZ 1


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SLZ 1


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SYZ 1


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SBZ 1


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; GHZ 2


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; LZ 2


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; MZ 2


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SLZ 2


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SYZ 2


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SBZ 2


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; GHZ 3


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; LZ 3


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; MZ 3


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SLZ 3


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SYZ 3


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SBZ 3


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; GHZ 4


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; LZ 4


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; MZ 4


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SLZ 4


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SYZ 4


    dc.w $0000,$0120, $FEFC,$013C, $0414,$0154, $0214,$0154 ; SBZ 4


    dc.w $0000,$0120, $FEE4,$0144, $03EC,$03EC, $0214,$0154 ; FZ



    Nice designed and everything =P. (If you have any problems, put an "even" after this piece of code.)


    Now build! Try it out and... oh wait, it looks excactly the same as before. That is because we just copied the mappings as they already were. Of course it doesn't look different therefore. But now you can do it on your turn. Just crab out your copy of Sonic 1 - Text Code Generator, generate a name, replace that "byte_Cxxx" thing with "xxxx_TTLMaps" and there you go! =P


    Have fun. ;)


    Credits:


    - Guide, code and pretty much everything: Me (Selbi)
     
    Last edited by a moderator: Jan 14, 2011
  2. Pokepunch

    Pokepunch That guy who posts on occasion Member

    Joined:
    Aug 7, 2009
    Messages:
    270
    Location:
    UK
  3. Pokepunch

    Pokepunch That guy who posts on occasion Member

    Joined:
    Aug 7, 2009
    Messages:
    270
    Location:
    UK
    i cant get rid of the double post
     
    Last edited by a moderator: Dec 26, 2009
  4. MrSpade

    MrSpade It's meant to be Mr_Spad3 but y'know... Member

    Joined:
    Dec 5, 2009
    Messages:
    172
    Location:
    The UK
    Interesting guide you got there, Really easy to get through, and really well laid out, even if it is only a C&P guide!


    Well done.
     
  5. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    This should be awesome to hacks that uses the dynamic tile-set system.


    To make every levels with 2-act like in S2 and use this feature to simulate more levels. Well, this is a suggestion i give for some people that use this guide. This is very interesting and useful. Thanks, Selbi!


    ;)
     
  6. NewSonic

    NewSonic Newcomer Member

    Joined:
    Sep 16, 2008
    Messages:
    19
    This is very usefull and innovative.


    Nice work.
     
  7. Pokepunch

    Pokepunch That guy who posts on occasion Member

    Joined:
    Aug 7, 2009
    Messages:
    270
    Location:
    UK
    SLZ1_TTLMaps: dc.b $A ; STAR LIGHT ACT 1


    dc.b $F8, 5, 0, $3E, $B4 ; S


    dc.b $F8, 5, 0, $42, $C4 ; T


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, $3A, $E4 ; R


    dc.b $F8, 0, 0, $56, $F4 ; Space


    dc.b $F8, 5, 0, $26, $4 ; L


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $18, $1C ; G


    dc.b $F8, 5, 0, $1C, $2C ; H


    dc.b $F8, 5, 0, $42, $3C ; T


    SLZ1_TTLMaps: dc.b $A ; STAR LIGHT ACT 1


    dc.b $F8, 5, 0, $3E, $B4 ; S


    dc.b $F8, 5, 0, $42, $C4 ; T


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, $3A, $E4 ; R


    dc.b $F8, 0, 0, $56, $F4 ; Space


    dc.b $F8, 5, 0, $26, $4 ; L


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $18, $1C ; G


    dc.b $F8, 5, 0, $1C, $2C ; H


    dc.b $F8, 5, 0, $42, $3C ; T


    SLZ1_TTLMaps: dc.b $A ; STAR LIGHT ACT 1


    dc.b $F8, 5, 0, $3E, $B4 ; S


    dc.b $F8, 5, 0, $42, $C4 ; T


    dc.b $F8, 5, 0, 0, $D4 ; A


    dc.b $F8, 5, 0, $3A, $E4 ; R


    dc.b $F8, 0, 0, $56, $F4 ; Space


    dc.b $F8, 5, 0, $26, $4 ; L


    dc.b $F8, 1, 0, $20, $14 ; I


    dc.b $F8, 5, 0, $18, $1C ; G


    dc.b $F8, 5, 0, $1C, $2C ; H


    dc.b $F8, 5, 0, $42, $3C ; T


    A bit of a problem
     
    Last edited by a moderator: Dec 27, 2009
  8. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Oh how helpful. You are posting a part of the code and say you have a problem, without saying what kind of problem you have.
     
  9. Pokepunch

    Pokepunch That guy who posts on occasion Member

    Joined:
    Aug 7, 2009
    Messages:
    270
    Location:
    UK
    Look closer
     
  10. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Oh yeah, this happens when you do a massive copy/paste. Thanks for mentioning it.
     
  11. Tongara

    Tongara Well-Known Member Exiled

    Joined:
    Feb 10, 2009
    Messages:
    353
    Location:
    Birmingham, UK
    Selbi <3
     
  12. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Thank you. I could do everything except set the act number!
     
  13. theocas

    theocas #! Member

    Joined:
    Apr 10, 2010
    Messages:
    375
    Love it! This guide just saved me trying to do the same thing for hours and then not getting it...
     
Thread Status:
Not open for further replies.