I am trying to code a ground pound move (My very first attempt for coding-from-scratch)
However, I have a problem...
When I patch the rom with Xkas, nothing happens in the game
the code:
header
lorom
org $E844 ;$20:E844
JSL in_air
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;stomp ground;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $648A30 ;The place where the code will be assembled
in_air:
lda $0077 ;player status (air/ground stuff) 0!=in air
bne stomp ;jump to stomp routine
beq not_stomp ;jump to not-stomp routine
stomp:
lda #$01
sta $18E7 ;Yoshi ground stomp flag
lda $0077 ;Player Position Status
cmp #$01 ;When in air...
bne not_stomp ;
lda #$02
sta $0015 ;controller data 1, which value is down?
lda #$02
sta $0016 ;controller data 1 one frame, which value is down?
lda #$02
sta $0017 ;controller data 2, which value is down?
lda #$02
sta $0018 ;controller data 2 ONE FRAME, which value is down?
rtl
not_stomp:
rts ;return
;additional information
;Yoshi stomps ground status:
;read breakpoint:
;$00/EF87 AD E7 18 LDA $18E7 [$00:18E7] A:0024 X:0000 Y:0000 P:envMXdizC
;Write breakpoint:
;1
;$01/F19E 8D E7 18 STA $18E7 [$01:18E7] A:F101 X:0007 Y:000A P:envMXdizc
;2
;$01/EBD6 9C E7 18 STZ $18E7 [$01:18E7] A:EB00 X:0007 Y:0000 P:envMXdiZc
;Powerup(?):
;$00/D156 E6 19 INC $19 [$00:0019] A100 X:0000 Y:0000 P:envMXdiZc ;grow
;$00/F600 64 19 STZ $19 [$00:0019] A:2501 X:0006 Y:0004 P:envMXdizc ;shrink
;$00/D156 E6 19 INC $19 [$00:0019] A100 X:0000 Y:0000 P:envMXdiZc ;grow
;$01/C5F9 85 19 STA $19 [$00:0019] A:C503 X:000B Y:0005 P:envMXdizc ;fire get
;$01/C59A 85 19 STA $19 [$00:0019] A:C502 X:0003 Y:000F P:envMXdizc ;feather/cape get
;$00/D0B6 64 19 STZ $19 [$00:0019] A0B6 X:0000 Y:0000 P:envMXdiZc ;rest in peace get
---------------------------------------------------------------
I think this code doesnt make any sense, but could someone help me what is wrong with it?
And remember, this is just my VERY FIRST ASM code...
My blog. I could post stuff now and then
My Assembly for the SNES tutorial (it's actually finished now!)
However, I have a problem...
When I patch the rom with Xkas, nothing happens in the game
the code:
header
lorom
org $E844 ;$20:E844
JSL in_air
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;stomp ground;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $648A30 ;The place where the code will be assembled
in_air:
lda $0077 ;player status (air/ground stuff) 0!=in air
bne stomp ;jump to stomp routine
beq not_stomp ;jump to not-stomp routine
stomp:
lda #$01
sta $18E7 ;Yoshi ground stomp flag
lda $0077 ;Player Position Status
cmp #$01 ;When in air...
bne not_stomp ;
lda #$02
sta $0015 ;controller data 1, which value is down?
lda #$02
sta $0016 ;controller data 1 one frame, which value is down?
lda #$02
sta $0017 ;controller data 2, which value is down?
lda #$02
sta $0018 ;controller data 2 ONE FRAME, which value is down?
rtl
not_stomp:
rts ;return
;additional information
;Yoshi stomps ground status:
;read breakpoint:
;$00/EF87 AD E7 18 LDA $18E7 [$00:18E7] A:0024 X:0000 Y:0000 P:envMXdizC
;Write breakpoint:
;1
;$01/F19E 8D E7 18 STA $18E7 [$01:18E7] A:F101 X:0007 Y:000A P:envMXdizc
;2
;$01/EBD6 9C E7 18 STZ $18E7 [$01:18E7] A:EB00 X:0007 Y:0000 P:envMXdiZc
;Powerup(?):
;$00/D156 E6 19 INC $19 [$00:0019] A100 X:0000 Y:0000 P:envMXdiZc ;grow
;$00/F600 64 19 STZ $19 [$00:0019] A:2501 X:0006 Y:0004 P:envMXdizc ;shrink
;$00/D156 E6 19 INC $19 [$00:0019] A100 X:0000 Y:0000 P:envMXdiZc ;grow
;$01/C5F9 85 19 STA $19 [$00:0019] A:C503 X:000B Y:0005 P:envMXdizc ;fire get
;$01/C59A 85 19 STA $19 [$00:0019] A:C502 X:0003 Y:000F P:envMXdizc ;feather/cape get
;$00/D0B6 64 19 STZ $19 [$00:0019] A0B6 X:0000 Y:0000 P:envMXdiZc ;rest in peace get
---------------------------------------------------------------
I think this code doesnt make any sense, but could someone help me what is wrong with it?
And remember, this is just my VERY FIRST ASM code...
My blog. I could post stuff now and then
My Assembly for the SNES tutorial (it's actually finished now!)