Difference between revisions of "Port Sonic 2's Level Select to Sonic 1"
From Sonic Retro
(→Edit the Main Game Mode Array) |
(→main game loop) |
||
Line 9: | Line 9: | ||
move.b ($FFFFF600).w,d0 ; load Game Mode | move.b ($FFFFF600).w,d0 ; load Game Mode | ||
andi.w #$1C,d0 | andi.w #$1C,d0 | ||
+ | jsr GameModeArray(pc,d0.w) ; jump to apt location in ROM | ||
+ | bra.s MainGameLoop | ||
+ | </asm> | ||
+ | |||
+ | notice that $1C up there? that prevents us from adding new entries, Sonic 2 use $3C there, so we will update it to: | ||
+ | <asm> | ||
+ | MainGameLoop: | ||
+ | move.b ($FFFFF600).w,d0 ; load Game Mode | ||
+ | andi.w #$3C,d0 | ||
jsr GameModeArray(pc,d0.w) ; jump to apt location in ROM | jsr GameModeArray(pc,d0.w) ; jump to apt location in ROM | ||
bra.s MainGameLoop | bra.s MainGameLoop |
Revision as of 08:53, 26 February 2011
You probably saw an old method of adding the sonic 2 level select to sonic 1 on SSRG by Esreal, well time we added it the exact same way Sonic 2 does it.
Contents
Edit the Main Game Mode Array
the main game mode array in sonic 1 does not have entries for the sonic 2 menu system, we will add them here.
main game loop
first we update the main game loop: <asm> MainGameLoop: move.b ($FFFFF600).w,d0 ; load Game Mode andi.w #$1C,d0 jsr GameModeArray(pc,d0.w) ; jump to apt location in ROM bra.s MainGameLoop </asm>
notice that $1C up there? that prevents us from adding new entries, Sonic 2 use $3C there, so we will update it to: <asm> MainGameLoop: move.b ($FFFFF600).w,d0 ; load Game Mode andi.w #$3C,d0 jsr GameModeArray(pc,d0.w) ; jump to apt location in ROM bra.s MainGameLoop </asm>