Difference between revisions of "Sonic Jam 6/ROM Editing"
From Sonic Retro
(→Values) |
m |
||
Line 66: | Line 66: | ||
|bra.w locret_B6A ; No button pressed, branch to this other one. | |bra.w locret_B6A ; No button pressed, branch to this other one. | ||
|} | |} | ||
+ | |||
+ | ===Level Functions=== | ||
+ | |||
+ | ====Bonus Level==== | ||
+ | {|class="prettytable" | ||
+ | !Offset||Instruction||Comment | ||
+ | |- | ||
+ | |ROM:0000780A | ||
+ | |move.w d3,d0 | ||
+ | |- | ||
+ | |ROM:0000780C | ||
+ | |mulu.w #$20,d0 | ||
+ | |- | ||
+ | |ROM:00007810 | ||
+ | |cmpi.w #0,4(a6,d0.w) | ||
+ | |- | ||
+ | |ROM:00007816 | ||
+ | |bne.w loc_792A | ||
+ | |- | ||
+ | |ROM:0000781A | ||
+ | |cmpi.w #2,(word_FF0042).l | ||
+ | |Compare 2 with current level map number | ||
+ | |- | ||
+ | |ROM:00007822 | ||
+ | |beq.w loc_7836 | ||
+ | |If level map number is 2, branch | ||
+ | |- | ||
+ | |ROM:00007826 | ||
+ | |cmpi.w #5,(word_FF0042).l | ||
+ | |Compare 5 with current level map number | ||
+ | |- | ||
+ | |ROM:0000782E | ||
+ | |beq.w loc_7836 | ||
+ | |If level map number is 5, branch | ||
+ | |- | ||
+ | |ROM:00007832 | ||
+ | |bra.w loc_7842 | ||
+ | |} | ||
+ | |||
+ | As you can clearly see, level map number 2 and 5 are respectively the Level 1-1 bonus, and the Level 1-2 bonus. | ||
+ | This makes the level not restart after exiting out of this level and returning to the main one, making it appear as a single level. | ||
+ | Adding another level to the list should be as simple as adding a cmp instruction and branching accordingly. | ||
[[Category:Sonic Community Hacking Guide]] | [[Category:Sonic Community Hacking Guide]] |
Revision as of 12:28, 31 October 2008
SCHG: Sonic Jam 6 |
---|
Main Article |
ROM Editing |
Editing ROM |
RAM Editing |
Editing RAM |
Art Editing |
Editing Art |
Value Reference |
Value Reference |
Values
Offset | Description | Note |
---|---|---|
0x1430 | Array which contains music numbers for each map (WORD ARRAY). | |
0x0ad2 | Demo properties (structure array, 0xe bytes long). |
|
0x0dde | Level map world-level number (structure array, 0x4 bytes long). |
|
Functions
Title Screen Functions
Button check
Level Functions
Bonus Level
Offset | Instruction | Comment |
---|---|---|
ROM:0000780A | move.w d3,d0 | |
ROM:0000780C | mulu.w #$20,d0 | |
ROM:00007810 | cmpi.w #0,4(a6,d0.w) | |
ROM:00007816 | bne.w loc_792A | |
ROM:0000781A | cmpi.w #2,(word_FF0042).l | Compare 2 with current level map number |
ROM:00007822 | beq.w loc_7836 | If level map number is 2, branch |
ROM:00007826 | cmpi.w #5,(word_FF0042).l | Compare 5 with current level map number |
ROM:0000782E | beq.w loc_7836 | If level map number is 5, branch |
ROM:00007832 | bra.w loc_7842 |
As you can clearly see, level map number 2 and 5 are respectively the Level 1-1 bonus, and the Level 1-2 bonus. This makes the level not restart after exiting out of this level and returning to the main one, making it appear as a single level. Adding another level to the list should be as simple as adding a cmp instruction and branching accordingly.