Difference between revisions of "Have a functional Eggman monitor in Sonic 1"
From Sonic Retro
(→SVN and HG Disassemblies) |
m (Text replacement - "\[\[Category:SCHG How-tos.*" to "") |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
This very simple guide will tell you how to get a functional Eggman monitor in ''Sonic 1''. It targets the [[Media:Sonic 1 (Split and Text by Hivebrain) (ASM68K).zip|Hivebrain 2005 Disassembly]]. | This very simple guide will tell you how to get a functional Eggman monitor in ''Sonic 1''. It targets the [[Media:Sonic 1 (Split and Text by Hivebrain) (ASM68K).zip|Hivebrain 2005 Disassembly]]. | ||
− | Open " | + | Open "sonic1.asm" and find this code: |
− | <asm>Obj2E_ChkEggman: ; XREF: Obj2E_Move | + | <syntaxhighlight lang="asm">Obj2E_ChkEggman: ; XREF: Obj2E_Move |
addq.b #2,$24(a0) | addq.b #2,$24(a0) | ||
move.w #29,$1E(a0) | move.w #29,$1E(a0) | ||
Line 10: | Line 10: | ||
cmpi.b #1,d0; does monitor contain Eggman? | cmpi.b #1,d0; does monitor contain Eggman? | ||
bne.s Obj2E_ChkSonic | bne.s Obj2E_ChkSonic | ||
− | rts ; Eggman monitor does nothing</ | + | rts ; Eggman monitor does nothing</syntaxhighlight>And replace it with this: |
− | <asm>Obj2E_ChkEggman: ; XREF: Obj2E_Move | + | <syntaxhighlight lang="asm">Obj2E_ChkEggman: ; XREF: Obj2E_Move |
addq.b #2,$24(a0) | addq.b #2,$24(a0) | ||
move.w #29,$1E(a0) | move.w #29,$1E(a0) | ||
Line 22: | Line 22: | ||
jsr Touch_ChkHurt ; run the Touch_ChkHurt routine | jsr Touch_ChkHurt ; run the Touch_ChkHurt routine | ||
move.l (sp)+,a0 ; pop the previous value of a0 from the stack, and increment stack pointer | move.l (sp)+,a0 ; pop the previous value of a0 from the stack, and increment stack pointer | ||
− | rts ; The Eggman monitor now does something!</ | + | rts ; The Eggman monitor now does something!</syntaxhighlight>Simple, isn't it? And it's set up in a way to use the regular "Touch_ChkHurt" routine, so shields and invincibilities are already taken in account by existing code, and the Eggman monitor will damage you like every other hazard would. |
==SVN and HG Disassemblies== | ==SVN and HG Disassemblies== | ||
Line 28: | Line 28: | ||
Go to the folder called "_incObj" and open the ASM file "2E Monitor Content Power-Up", now go to the label "Pow_ChkEggman". You should see this code: | Go to the folder called "_incObj" and open the ASM file "2E Monitor Content Power-Up", now go to the label "Pow_ChkEggman". You should see this code: | ||
− | <asm>Pow_ChkEggman: | + | <syntaxhighlight lang="asm">Pow_ChkEggman: |
move.b obAnim(a0),d0 | move.b obAnim(a0),d0 | ||
cmpi.b #1,d0 ; does monitor contain Eggman? | cmpi.b #1,d0 ; does monitor contain Eggman? | ||
bne.s Pow_ChkSonic | bne.s Pow_ChkSonic | ||
rts ; Eggman monitor does nothing | rts ; Eggman monitor does nothing | ||
− | ; ===========================================================================</ | + | ; ===========================================================================</syntaxhighlight>Now change this: |
− | <asm> rts ; Eggman monitor does nothing</ | + | <syntaxhighlight lang="asm"> rts ; Eggman monitor does nothing</syntaxhighlight>To this: |
− | <asm> bra Spik_Hurt ; Eggman monitor | + | <syntaxhighlight lang="asm"> bra Spik_Hurt ; Eggman monitor hits Sonic</syntaxhighlight>'''DONE!''' |
− | This is the most simple way to get a functional Eggman monitor in SVN and Hg disassemblies, | + | This is the most simple way to get a functional Eggman monitor in SVN and Hg disassemblies, you just need to branch the code to "Spik_Hurt" routine, the same used for spikes (object 36)! |
*Sonic will not lose rings if he has a shield and nothing will happen if he is invincible | *Sonic will not lose rings if he has a shield and nothing will happen if he is invincible | ||
{{S1Howtos}} | {{S1Howtos}} | ||
− | + | |Have_a_functional_Eggman_monitor_in_Sonic_1]] |
Latest revision as of 10:50, 25 August 2018
Hivebrain's Sonic 1 disassembly (2005)
(Original guide by nineko) This very simple guide will tell you how to get a functional Eggman monitor in Sonic 1. It targets the Hivebrain 2005 Disassembly.
Open "sonic1.asm" and find this code:
Obj2E_ChkEggman: ; XREF: Obj2E_Move
addq.b #2,$24(a0)
move.w #29,$1E(a0)
move.b $1C(a0),d0
cmpi.b #1,d0; does monitor contain Eggman?
bne.s Obj2E_ChkSonic
rts ; Eggman monitor does nothing
Obj2E_ChkEggman: ; XREF: Obj2E_Move
addq.b #2,$24(a0)
move.w #29,$1E(a0)
move.b $1C(a0),d0
cmpi.b #1,d0; does monitor contain Eggman?
bne.s Obj2E_ChkSonic ; if not, go and check for the next monitor type (1-up icon)
move.l a0,a1 ; move a0 to a1, because Touch_ChkHurt wants the damaging object to be in a1
move.l a0,-(sp) ; push a0 on the stack, and decrement stack pointer
lea ($FFFFD000).w,a0 ; put Sonic's ram address in a0, because Touch_ChkHurt wants the damaged object to be in a0
jsr Touch_ChkHurt ; run the Touch_ChkHurt routine
move.l (sp)+,a0 ; pop the previous value of a0 from the stack, and increment stack pointer
rts ; The Eggman monitor now does something!
SVN and HG Disassemblies
(adjunction by AlexShx) This very simple guide will tell you how to get a functional Eggman monitor in Sonic 1 using the SVN (info) (676 kB) or the HG disassemblies.
Go to the folder called "_incObj" and open the ASM file "2E Monitor Content Power-Up", now go to the label "Pow_ChkEggman". You should see this code:
Pow_ChkEggman:
move.b obAnim(a0),d0
cmpi.b #1,d0 ; does monitor contain Eggman?
bne.s Pow_ChkSonic
rts ; Eggman monitor does nothing
; ===========================================================================
rts ; Eggman monitor does nothing
bra Spik_Hurt ; Eggman monitor hits Sonic
This is the most simple way to get a functional Eggman monitor in SVN and Hg disassemblies, you just need to branch the code to "Spik_Hurt" routine, the same used for spikes (object 36)!
- Sonic will not lose rings if he has a shield and nothing will happen if he is invincible
|Have_a_functional_Eggman_monitor_in_Sonic_1]]