Blindly use wram labels for everything except mobile, part 1.

Wram banks and mobile make this tough, since any address can secretly be a ghost.

As usual, mobile completely disregards 99% of the codebase. It's been ignored in kind.
This commit is contained in:
yenatch 2015-02-08 00:03:32 -08:00
parent 0683bc8770
commit 8e03321069
21 changed files with 10879 additions and 10151 deletions

View File

@ -40,7 +40,7 @@ _SoundRestart:: ; e8000
ld hl, Channel1 ; start of channel data ld hl, Channel1 ; start of channel data
ld de, $01bf ; length of area to clear (entire sound wram area) ld de, $01bf ; length of area to clear (entire sound wram area)
.clearchannels ; clear $c101-$c2bf .clearchannels ; clear Channel1-$c2bf
xor a xor a
ld [hli], a ld [hli], a
dec de dec de
@ -129,15 +129,15 @@ _UpdateSound:: ; e805c
ld hl, Channel1DutyCycle - Channel1 ld hl, Channel1DutyCycle - Channel1
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
ld [$c292], a ld [wc292], a
; intensity ; intensity
ld a, [hli] ld a, [hli]
ld [$c293], a ld [wc293], a
; frequency ; frequency
ld a, [hli] ld a, [hli]
ld [$c294], a ld [wc294], a
ld a, [hl] ld a, [hl]
ld [$c295], a ld [wc295], a
; ;
call Functione8466 ; handle vibrato and other things call Functione8466 ; handle vibrato and other things
call HandleNoise call HandleNoise
@ -151,16 +151,16 @@ _UpdateSound:: ; e805c
jr nc, .next jr nc, .next
; are any sfx channels active? ; are any sfx channels active?
; if so, mute ; if so, mute
ld hl, $c1cc ; Channel5Flags ld hl, Channel5Flags
bit 0, [hl] bit 0, [hl]
jr nz, .restnote jr nz, .restnote
ld hl, $c1fe ; Channel6Flags ld hl, Channel6Flags
bit 0, [hl] bit 0, [hl]
jr nz, .restnote jr nz, .restnote
ld hl, $c230 ; Channel7Flags ld hl, Channel7Flags
bit 0, [hl] bit 0, [hl]
jr nz, .restnote jr nz, .restnote
ld hl, $c262 ; Channel8Flags ld hl, Channel8Flags
bit 0, [hl] bit 0, [hl]
jr z, .next jr z, .next
.restnote .restnote
@ -261,14 +261,14 @@ UpdateChannels: ; e8125
jr nz, .asm_e8184 jr nz, .asm_e8184
jr .asm_e8175 jr .asm_e8175
.asm_e816b .asm_e816b
ld a, [$c294] ld a, [wc294]
ld [rNR13], a ld [rNR13], a
ld a, [$c295] ld a, [wc295]
ld [rNR14], a ld [rNR14], a
.asm_e8175 .asm_e8175
bit 0, [hl] bit 0, [hl]
ret z ret z
ld a, [$c292] ld a, [wc292]
ld d, a ld d, a
ld a, [rNR11] ld a, [rNR11]
and a, $3f ; sound length and a, $3f ; sound length
@ -276,13 +276,13 @@ UpdateChannels: ; e8125
ld [rNR11], a ld [rNR11], a
ret ret
.asm_e8184 .asm_e8184
ld a, [$c292] ld a, [wc292]
ld d, a ld d, a
ld a, [rNR11] ld a, [rNR11]
and a, $3f ; sound length and a, $3f ; sound length
or d or d
ld [rNR11], a ld [rNR11], a
ld a, [$c294] ld a, [wc294]
ld [rNR13], a ld [rNR13], a
ret ret
.ch1rest .ch1rest
@ -293,15 +293,15 @@ UpdateChannels: ; e8125
call ClearChannel call ClearChannel
ret ret
.asm_e81a2 .asm_e81a2
ld hl, $c292 ld hl, wc292
ld a, $3f ; sound length ld a, $3f ; sound length
or [hl] or [hl]
ld [rNR11], a ld [rNR11], a
ld a, [$c293] ld a, [wc293]
ld [rNR12], a ld [rNR12], a
ld a, [$c294] ld a, [wc294]
ld [rNR13], a ld [rNR13], a
ld a, [$c295] ld a, [wc295]
or a, $80 or a, $80
ld [rNR14], a ld [rNR14], a
ret ret
@ -318,7 +318,7 @@ UpdateChannels: ; e8125
jr nz, .asm_e81e6 jr nz, .asm_e81e6
bit 0, [hl] bit 0, [hl]
ret z ret z
ld a, [$c292] ld a, [wc292]
ld d, a ld d, a
ld a, [rNR21] ld a, [rNR21]
and a, $3f ; sound length and a, $3f ; sound length
@ -326,19 +326,19 @@ UpdateChannels: ; e8125
ld [rNR21], a ld [rNR21], a
ret ret
.asm_e81db ; unused .asm_e81db ; unused
ld a, [$c294] ld a, [wc294]
ld [rNR23], a ld [rNR23], a
ld a, [$c295] ld a, [wc295]
ld [rNR24], a ld [rNR24], a
ret ret
.asm_e81e6 .asm_e81e6
ld a, [$c292] ld a, [wc292]
ld d, a ld d, a
ld a, [rNR21] ld a, [rNR21]
and a, $3f ; sound length and a, $3f ; sound length
or d or d
ld [rNR21], a ld [rNR21], a
ld a, [$c294] ld a, [wc294]
ld [rNR23], a ld [rNR23], a
ret ret
.ch2rest .ch2rest
@ -349,15 +349,15 @@ UpdateChannels: ; e8125
call ClearChannel call ClearChannel
ret ret
.asm_e8204 .asm_e8204
ld hl, $c292 ld hl, wc292
ld a, $3f ; sound length ld a, $3f ; sound length
or [hl] or [hl]
ld [rNR21], a ld [rNR21], a
ld a, [$c293] ld a, [wc293]
ld [rNR22], a ld [rNR22], a
ld a, [$c294] ld a, [wc294]
ld [rNR23], a ld [rNR23], a
ld a, [$c295] ld a, [wc295]
or a, $80 ; initial (restart) or a, $80 ; initial (restart)
ld [rNR24], a ld [rNR24], a
ret ret
@ -374,13 +374,13 @@ UpdateChannels: ; e8125
jr nz, .asm_e823a jr nz, .asm_e823a
ret ret
.asm_e822f ; unused .asm_e822f ; unused
ld a, [$c294] ld a, [wc294]
ld [rNR33], a ld [rNR33], a
ld a, [$c295] ld a, [wc295]
ld [rNR34], a ld [rNR34], a
ret ret
.asm_e823a .asm_e823a
ld a, [$c294] ld a, [wc294]
ld [rNR33], a ld [rNR33], a
ret ret
.ch3rest .ch3rest
@ -398,15 +398,15 @@ UpdateChannels: ; e8125
call .asm_e8268 call .asm_e8268
ld a, $80 ld a, $80
ld [rNR30], a ld [rNR30], a
ld a, [$c294] ld a, [wc294]
ld [rNR33], a ld [rNR33], a
ld a, [$c295] ld a, [wc295]
or a, $80 or a, $80
ld [rNR34], a ld [rNR34], a
ret ret
.asm_e8268 .asm_e8268
push hl push hl
ld a, [$c293] ld a, [wc293]
and a, $0f ; only 0-9 are valid and a, $0f ; only 0-9 are valid
ld l, a ld l, a
ld h, $00 ld h, $00
@ -453,7 +453,7 @@ UpdateChannels: ; e8125
ld a, [hli] ld a, [hli]
ld [$ff3f], a ld [$ff3f], a
pop hl pop hl
ld a, [$c293] ld a, [wc293]
and a, $f0 and a, $f0
sla a sla a
ld [rNR32], a ld [rNR32], a
@ -469,7 +469,7 @@ UpdateChannels: ; e8125
jr nz, .asm_e82d4 jr nz, .asm_e82d4
ret ret
.asm_e82c1 ; unused .asm_e82c1 ; unused
ld a, [$c294] ld a, [wc294]
ld [rNR43], a ld [rNR43], a
ret ret
.ch4rest .ch4rest
@ -482,9 +482,9 @@ UpdateChannels: ; e8125
.asm_e82d4 .asm_e82d4
ld a, $3f ; sound length ld a, $3f ; sound length
ld [rNR41], a ld [rNR41], a
ld a, [$c293] ld a, [wc293]
ld [rNR42], a ld [rNR42], a
ld a, [$c294] ld a, [wc294]
ld [rNR43], a ld [rNR43], a
ld a, $80 ld a, $80
ld [rNR44], a ld [rNR44], a
@ -493,16 +493,16 @@ UpdateChannels: ; e8125
_CheckSFX: ; e82e7 _CheckSFX: ; e82e7
; return carry if any sfx channels are active ; return carry if any sfx channels are active
ld hl, $c1cc ; Channel5Flags ld hl, Channel5Flags
bit 0, [hl] bit 0, [hl]
jr nz, .sfxon jr nz, .sfxon
ld hl, $c1fe ; Channel6Flags ld hl, Channel6Flags
bit 0, [hl] bit 0, [hl]
jr nz, .sfxon jr nz, .sfxon
ld hl, $c230 ; Channel7Flags ld hl, Channel7Flags
bit 0, [hl] bit 0, [hl]
jr nz, .sfxon jr nz, .sfxon
ld hl, $c262 ; Channel8Flags ld hl, Channel8Flags
bit 0, [hl] bit 0, [hl]
jr nz, .sfxon jr nz, .sfxon
and a and a
@ -692,7 +692,7 @@ LoadNote: ; e83d1
ld hl, Channel1NoteDuration - Channel1 ld hl, Channel1NoteDuration - Channel1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld hl, $c297 ; ???? ld hl, wc297 ; ????
sub [hl] sub [hl]
jr nc, .ok jr nc, .ok
ld a, $01 ld a, $01
@ -771,7 +771,7 @@ LoadNote: ; e83d1
ld d, a ld d, a
.asm_e843e .asm_e843e
push bc push bc
ld hl, $c297 ld hl, wc297
ld b, $00 ; loop count ld b, $00 ; loop count
.loop .loop
inc b inc b
@ -806,7 +806,7 @@ LoadNote: ; e83d1
Functione8466: ; e8466 Functione8466: ; e8466
; handle vibrato and other things ; handle vibrato and other things
; unknowns: $c292, $c294 ; unknowns: wc292, $c294
ld hl, Channel1Flags2 - Channel1 ld hl, Channel1Flags2 - Channel1
add hl, bc add hl, bc
bit 2, [hl] bit 2, [hl]
@ -818,7 +818,7 @@ Functione8466: ; e8466
rlca rlca
ld [hl], a ld [hl], a
and a, $c0 and a, $c0
ld [$c292], a ld [wc292], a
ld hl, Channel1NoteFlags - Channel1 ld hl, Channel1NoteFlags - Channel1
add hl, bc add hl, bc
set 0, [hl] set 0, [hl]
@ -832,14 +832,14 @@ Functione8466: ; e8466
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
ld hl, $c294 ld hl, wc294
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
add hl, de add hl, de
ld e, l ld e, l
ld d, h ld d, h
ld hl, $c294 ld hl, wc294
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
@ -880,7 +880,7 @@ Functione8466: ; e8466
or [hl] or [hl]
ld [hl], a ld [hl], a
; ???? ; ????
ld a, [$c294] ld a, [wc294]
ld e, a ld e, a
; toggle vibrato up/down ; toggle vibrato up/down
ld hl, Channel1Flags3 - Channel1 ld hl, Channel1Flags3 - Channel1
@ -912,7 +912,7 @@ Functione8466: ; e8466
jr nc, .asm_e84ef jr nc, .asm_e84ef
ld a, $ff ld a, $ff
.asm_e84ef .asm_e84ef
ld [$c294], a ld [wc294], a
; ;
ld hl, Channel1NoteFlags - Channel1 ld hl, Channel1NoteFlags - Channel1
add hl, bc add hl, bc
@ -1038,7 +1038,7 @@ HandleNoise: ; e858c
bit 2, a ; sfx bit 2, a ; sfx
jr nz, .next jr nz, .next
; is ch8 on? (noise) ; is ch8 on? (noise)
ld hl, $c262 ; Channel8Flags ld hl, Channel8Flags
bit 0, [hl] ; on? bit 0, [hl] ; on?
jr z, .next jr z, .next
; is ch8 playing noise? ; is ch8 playing noise?
@ -1046,11 +1046,11 @@ HandleNoise: ; e858c
ret nz ; quit if so ret nz ; quit if so
; ;
.next .next
ld a, [$c2a2] ld a, [wc2a2]
and a and a
jr z, ReadNoiseSample jr z, ReadNoiseSample
dec a dec a
ld [$c2a2], a ld [wc2a2], a
ret ret
; e85af ; e85af
@ -1081,15 +1081,15 @@ ReadNoiseSample: ; e85af
and $f and $f
inc a inc a
ld [$c2a2], a ld [wc2a2], a
ld a, [de] ld a, [de]
inc de inc de
ld [$c293], a ld [wc293], a
ld a, [de] ld a, [de]
inc de inc de
ld [$c294], a ld [wc294], a
xor a xor a
ld [$c295], a ld [wc295], a
ld hl, NoiseSampleAddress ld hl, NoiseSampleAddress
ld [hl], e ld [hl], e
@ -1218,10 +1218,10 @@ RestoreVolume: ; e8679
cp a, $04 cp a, $04
ret nz ret nz
xor a xor a
ld hl, $c222 ld hl, Channel6CryPitch
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld hl, $c286 ld hl, Channel8CryPitch
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld a, [LastVolume] ld a, [LastVolume]
@ -1279,7 +1279,7 @@ GetNoiseSample: ; e86c5
ld a, [CurChannel] ld a, [CurChannel]
bit 2, a ; are we in a sfx channel? bit 2, a ; are we in a sfx channel?
jr nz, .sfx jr nz, .sfx
ld hl, $c262 ; Channel8Flags ld hl, Channel8Flags
bit 0, [hl] ; is ch8 on? (noise) bit 0, [hl] ; is ch8 on? (noise)
ret nz ret nz
ld a, [MusicNoiseSampleSet] ld a, [MusicNoiseSampleSet]
@ -1315,7 +1315,7 @@ GetNoiseSample: ; e86c5
ld [NoiseSampleAddressHi], a ld [NoiseSampleAddressHi], a
; clear ???? ; clear ????
xor a xor a
ld [$c2a2], a ld [wc2a2], a
ret ret
; e870f ; e870f
@ -1608,8 +1608,8 @@ MusicEE; e883e
and a, $03 ; ch0-3 and a, $03 ; ch0-3
ld e, a ld e, a
ld d, $00 ld d, $00
; hl = $c2b8 + channel id ; hl = wc2b8 + channel id
ld hl, $c2b8 ld hl, wc2b8
add hl, de add hl, de
; if set, jump ; if set, jump
ld a, [hl] ld a, [hl]
@ -1652,7 +1652,7 @@ MusicF9: ; e886d
; seems to be unused ; seems to be unused
; params: 0 ; params: 0
ld a, $01 ld a, $01
ld [$c2b5], a ld [wc2b5], a
ret ret
; e8873 ; e8873
@ -1729,7 +1729,7 @@ MusicE0: ; e88bd
; ???? ; ????
; params: 2 ; params: 2
call GetMusicByte call GetMusicByte
ld [$c297], a ld [wc297], a
call GetMusicByte call GetMusicByte
ld d, a ld d, a
and a, $0f and a, $0f
@ -2350,14 +2350,14 @@ _PlayMusic:: ; e8b30
dec a dec a
jr nz, .loop jr nz, .loop
xor a xor a
ld [$c2b5], a ld [wc2b5], a
ld [$c2b8], a ld [wc2b8], a
ld [$c2b9], a ld [wc2b9], a
ld [$c2ba], a ld [wc2ba], a
ld [$c2bb], a ld [wc2bb], a
ld [NoiseSampleAddressLo], a ld [NoiseSampleAddressLo], a
ld [NoiseSampleAddressHi], a ld [NoiseSampleAddressHi], a
ld [$c2a2], a ld [wc2a2], a
ld [MusicNoiseSampleSet], a ld [MusicNoiseSampleSet], a
call MusicOn call MusicOn
ret ret
@ -2432,7 +2432,7 @@ _PlayCryHeader:: ; e8b79
ld [hl], a ld [hl], a
.start .start
call StartChannel call StartChannel
ld a, [$c2bc] ld a, [wc2bc]
and a and a
jr z, .next jr z, .next
@ -2479,7 +2479,7 @@ _PlayCryHeader:: ; e8b79
_PlaySFX:: ; e8c04 _PlaySFX:: ; e8c04
; clear channels if they aren't already ; clear channels if they aren't already
call MusicOff call MusicOff
ld hl, $c1cc ; Channel5Flags ld hl, Channel5Flags
bit 0, [hl] ; ch5 on? bit 0, [hl] ; ch5 on?
jr z, .ch6 jr z, .ch6
res 0, [hl] ; turn it off res 0, [hl] ; turn it off
@ -2495,7 +2495,7 @@ _PlaySFX:: ; e8c04
ld [SoundInput], a ; global sound off ld [SoundInput], a ; global sound off
ld [rNR10], a ; sweep = 0 ld [rNR10], a ; sweep = 0
.ch6 .ch6
ld hl, $c1fe ; ch6 on? ld hl, Channel6Flags
bit 0, [hl] bit 0, [hl]
jr z, .ch7 jr z, .ch7
res 0, [hl] ; turn it off res 0, [hl] ; turn it off
@ -2508,7 +2508,7 @@ _PlaySFX:: ; e8c04
ld a, $80 ld a, $80
ld [rNR24], a ; restart sound (freq hi = 0) ld [rNR24], a ; restart sound (freq hi = 0)
.ch7 .ch7
ld hl, $c230 ; ch7 on? ld hl, Channel7Flags
bit 0, [hl] bit 0, [hl]
jr z, .ch8 jr z, .ch8
res 0, [hl] ; turn it off res 0, [hl] ; turn it off
@ -2522,7 +2522,7 @@ _PlaySFX:: ; e8c04
ld a, $80 ld a, $80
ld [rNR34], a ; restart sound (freq hi = 0) ld [rNR34], a ; restart sound (freq hi = 0)
.ch8 .ch8
ld hl, $c262 ; ch8 on? ld hl, Channel8Flags
bit 0, [hl] bit 0, [hl]
jr z, .chscleared jr z, .chscleared
res 0, [hl] ; turn it off res 0, [hl] ; turn it off
@ -2631,7 +2631,7 @@ PlayStereoSFX:: ; e8ca6
call GetLRTracks call GetLRTracks
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld hl, $c2bc ld hl, wc2bc
and [hl] and [hl]
ld hl, Channel1Tracks - Channel1 ld hl, Channel1Tracks - Channel1
@ -2647,7 +2647,7 @@ PlayStereoSFX:: ; e8ca6
jr c, .asm_e8d0c jr c, .asm_e8d0c
; ch3-4 ; ch3-4
ld a, [$c2be] ld a, [wc2be]
ld hl, $002e ; $c12f - Channel1 ld hl, $002e ; $c12f - Channel1
add hl, bc add hl, bc

View File

@ -16,12 +16,12 @@ Function38000: ; 38000
bit SUBSTATUS_CANT_RUN, a bit SUBSTATUS_CANT_RUN, a
jr nz, DontSwitch jr nz, DontSwitch
ld a, [$c731] ld a, [wc731]
and a and a
jr nz, DontSwitch jr nz, DontSwitch
ld hl, TrainerClassAttributes + 5 ld hl, TrainerClassAttributes + 5
ld a, [$cfc0] ld a, [wcfc0]
and a and a
jr nz, .ok jr nz, .ok
ld a, [TrainerClass] ld a, [TrainerClass]
@ -44,7 +44,7 @@ DontSwitch: ; 38041
SwitchOften: ; 38045 SwitchOften: ; 38045
callab Function34941 callab Function34941
ld a, [$c717] ld a, [wc717]
and $f0 and $f0
jp z, DontSwitch jp z, DontSwitch
@ -70,16 +70,16 @@ SwitchOften: ; 38045
jp c, DontSwitch jp c, DontSwitch
.switch .switch
ld a, [$c717] ld a, [wc717]
and $f and $f
inc a inc a
ld [$c718], a ld [wc718], a
jp AI_TrySwitch jp AI_TrySwitch
; 38083 ; 38083
SwitchRarely: ; 38083 SwitchRarely: ; 38083
callab Function34941 callab Function34941
ld a, [$c717] ld a, [wc717]
and $f0 and $f0
jp z, DontSwitch jp z, DontSwitch
@ -105,16 +105,16 @@ SwitchRarely: ; 38083
jp c, DontSwitch jp c, DontSwitch
.switch .switch
ld a, [$c717] ld a, [wc717]
and $f and $f
inc a inc a
ld [$c718], a ld [wc718], a
jp AI_TrySwitch jp AI_TrySwitch
; 380c1 ; 380c1
SwitchSometimes: ; 380c1 SwitchSometimes: ; 380c1
callab Function34941 callab Function34941
ld a, [$c717] ld a, [wc717]
and $f0 and $f0
jp z, DontSwitch jp z, DontSwitch
@ -140,10 +140,10 @@ SwitchSometimes: ; 380c1
jp c, DontSwitch jp c, DontSwitch
.switch .switch
ld a, [$c717] ld a, [wc717]
and $f and $f
inc a inc a
ld [$c718], a ld [wc718], a
jp AI_TrySwitch jp AI_TrySwitch
; 380ff ; 380ff
@ -156,13 +156,13 @@ Function380ff: ; 380ff
AI_TryItem: ; 38105 AI_TryItem: ; 38105
ld a, [$cfc0] ld a, [wcfc0]
and a and a
ret nz ret nz
ld a, [$c650] ld a, [wc650]
ld b, a ld b, a
ld a, [$c651] ld a, [wc651]
or b or b
ret z ret z
@ -177,7 +177,7 @@ AI_TryItem: ; 38105
ld b, h ld b, h
ld c, l ld c, l
ld hl, AI_Items ld hl, AI_Items
ld de, $c650 ld de, wc650
.loop .loop
ld a, [hl] ld a, [hl]
and a and a
@ -221,15 +221,15 @@ AI_TryItem: ; 38105
xor a xor a
ld [de], a ld [de], a
inc a inc a
ld [$c70f], a ld [wc70f], a
ld hl, EnemySubStatus3 ld hl, EnemySubStatus3
res SUBSTATUS_BIDE, [hl] res SUBSTATUS_BIDE, [hl]
xor a xor a
ld [EnemyFuryCutterCount], a ld [EnemyFuryCutterCount], a
ld [$c681], a ld [EnemyProtectCount], a
ld [$c72c], a ld [wc72c], a
ld hl, EnemySubStatus4 ld hl, EnemySubStatus4
res SUBSTATUS_RAGE, [hl] res SUBSTATUS_RAGE, [hl]
@ -545,7 +545,7 @@ AIUpdateHUD: ; 38387
callba UpdateEnemyHUD callba UpdateEnemyHUD
ld a, $1 ld a, $1
ld [hBGMapMode], a ld [hBGMapMode], a
ld hl, $c6e6 ld hl, wc6e6
dec [hl] dec [hl]
scf scf
ret ret
@ -568,20 +568,20 @@ Function383a3: ; 383a3 (e:43a3)
Function383ae: ; 383ae (e:43ae) Function383ae: ; 383ae (e:43ae)
ld a, MAX_POTION ld a, MAX_POTION
ld [$d1f1], a ld [wd1f1], a
jr asm_383c6 jr asm_383c6
Function383b5: ; 383b5 (e:43b5) Function383b5: ; 383b5 (e:43b5)
call AI_HealStatus call AI_HealStatus
ld a, FULL_RESTORE ld a, FULL_RESTORE
ld [$d1f1], a ld [wd1f1], a
ld hl, EnemySubStatus3 ld hl, EnemySubStatus3
res SUBSTATUS_CONFUSED, [hl] res SUBSTATUS_CONFUSED, [hl]
xor a xor a
ld [EnemyConfuseCount], a ld [EnemyConfuseCount], a
asm_383c6: ; 383c6 asm_383c6: ; 383c6
ld de, $d1ec ld de, wd1ec
ld hl, EnemyMonHP + 1 ld hl, EnemyMonHP + 1
ld a, [hld] ld a, [hld]
ld [de], a ld [de], a
@ -617,20 +617,20 @@ Function383f4: ; 383f4 (e:43f4)
ld b, 200 ld b, 200
Function383f8: ; 383f8 Function383f8: ; 383f8
ld [$d1f1], a ld [wd1f1], a
ld hl, EnemyMonHP + 1 ld hl, EnemyMonHP + 1
ld a, [hl] ld a, [hl]
ld [$d1ec], a ld [wd1ec], a
add b add b
ld [hld], a ld [hld], a
ld [$d1ee], a ld [wd1ee], a
ld a, [hl] ld a, [hl]
ld [$d1ec + 1], a ld [wd1ec + 1], a
ld [$d1ee + 1], a ld [wd1ee + 1], a
jr nc, .asm_38415 jr nc, .asm_38415
inc a inc a
ld [hl], a ld [hl], a
ld [$d1ee + 1], a ld [wd1ee + 1], a
.asm_38415 .asm_38415
inc hl inc hl
ld a, [hld] ld a, [hld]
@ -650,17 +650,17 @@ Function383f8: ; 383f8
ld a, [de] ld a, [de]
dec de dec de
ld [hld], a ld [hld], a
ld [$d1ee], a ld [wd1ee], a
ld a, [de] ld a, [de]
ld [hl], a ld [hl], a
ld [$d1ef], a ld [wd1ef], a
.asm_38436 .asm_38436
Function38436: ; 38436 Function38436: ; 38436
call Function38571 call Function38571
hlcoord 2, 2 hlcoord 2, 2
xor a xor a
ld [$d10a], a ld [wd10a], a
call AIUsedItemSound call AIUsedItemSound
predef Functionc6e0 predef Functionc6e0
jp AIUpdateHUD jp AIUpdateHUD
@ -695,8 +695,8 @@ AI_TrySwitch: ; 3844b
AI_Switch: ; 3846c AI_Switch: ; 3846c
ld a, $1 ld a, $1
ld [$c711], a ld [wEnemyIsSwitching], a
ld [$c70f], a ld [wc70f], a
ld hl, EnemySubStatus4 ld hl, EnemySubStatus4
res SUBSTATUS_RAGE, [hl] res SUBSTATUS_RAGE, [hl]
xor a xor a
@ -718,7 +718,7 @@ AI_Switch: ; 3846c
call PrintText call PrintText
.asm_384a3 .asm_384a3
ld a, $1 ld a, $1
ld [$d264], a ld [wd264], a
callab NewEnemyMonStatus callab NewEnemyMonStatus
callab ResetEnemyStatLevels callab ResetEnemyStatLevels
ld hl, PlayerSubStatus1 ld hl, PlayerSubStatus1
@ -726,7 +726,7 @@ AI_Switch: ; 3846c
callba Function3d4e1 callba Function3d4e1
callba Function3d57a callba Function3d57a
xor a xor a
ld [$d264], a ld [wd264], a
ld a, [InLinkBattle] ld a, [InLinkBattle]
and a and a
ret nz ret nz
@ -832,7 +832,7 @@ Function38553: ; 38553
ld a, X_SPECIAL ld a, X_SPECIAL
Function38557: Function38557:
ld [$d1f1], a ld [wd1f1], a
push bc push bc
call Function38571 call Function38571
pop bc pop bc
@ -842,17 +842,17 @@ Function38557:
Function38568: ; 38568 Function38568: ; 38568
ld [$d1f1], a ld [wd1f1], a
call Function38571 call Function38571
jp AIUpdateHUD jp AIUpdateHUD
; 38571 ; 38571
Function38571: ; 38571 Function38571: ; 38571
ld a, [$d1f1] ld a, [wd1f1]
ld [$d265], a ld [wd265], a
call GetItemName call GetItemName
ld hl, StringBuffer1 ld hl, StringBuffer1
ld de, $d050 ld de, wd050
ld bc, ITEM_NAME_LENGTH ld bc, ITEM_NAME_LENGTH
call CopyBytes call CopyBytes
ld hl, UnknownText_0x3858c ld hl, UnknownText_0x3858c

View File

@ -179,7 +179,7 @@ AI_Types: ; 38635
pop bc pop bc
pop hl pop hl
ld a, [$d265] ld a, [wd265]
and a and a
jr z, .immune jr z, .immune
cp 10 ; 1.0 cp 10 ; 1.0
@ -431,7 +431,7 @@ AI_Smart_LeechHit: ; 387f7
pop hl pop hl
; 60% chance to discourage this move if not very effective. ; 60% chance to discourage this move if not very effective.
ld a, [$d265] ld a, [wd265]
cp 10 ; 1.0 cp 10 ; 1.0
jr c, .asm_38815 jr c, .asm_38815
@ -509,7 +509,7 @@ AI_Smart_LockOn: ; 3881d
push hl push hl
push bc push bc
callba Function347c8 callba Function347c8
ld a, [$d265] ld a, [wd265]
cp $a cp $a
pop bc pop bc
pop hl pop hl
@ -969,7 +969,7 @@ AI_Smart_Whirlwind: ; 38a2a
push hl push hl
callab Function3484e callab Function3484e
ld a, [$c716] ld a, [wc716]
cp 10 ; neutral cp 10 ; neutral
pop hl pop hl
ret c ret c
@ -1048,7 +1048,7 @@ AI_Smart_Bind: ; 38a71
; Bind, Wrap, Fire Spin, Clamp ; Bind, Wrap, Fire Spin, Clamp
; 50% chance to discourage this move if the player is already trapped. ; 50% chance to discourage this move if the player is already trapped.
ld a, [$c730] ld a, [wc730]
and a and a
jr nz, .asm_38a8b jr nz, .asm_38a8b
@ -1325,11 +1325,11 @@ AI_Smart_Rage: ; 38b7f
; Encourage this move based on Rage's counter. ; Encourage this move based on Rage's counter.
.asm_38b8c .asm_38b8c
ld a, [$c72c] ld a, [wc72c]
cp $2 cp $2
ret c ret c
dec [hl] dec [hl]
ld a, [$c72c] ld a, [wc72c]
cp $3 cp $3
ret c ret c
dec [hl] dec [hl]
@ -1368,7 +1368,7 @@ AI_Smart_Mimic: ; 38ba8
ld [hBattleTurn], a ld [hBattleTurn], a
callab Function347c8 callab Function347c8
ld a, [$d265] ld a, [wd265]
cp $a cp $a
pop hl pop hl
jr c, .asm_38bef jr c, .asm_38bef
@ -1489,7 +1489,7 @@ AI_Smart_Encore: ; 38c3b
predef Function347d3 predef Function347d3
pop hl pop hl
ld a, [$d265] ld a, [wd265]
cp $a cp $a
jr nc, .asm_38c68 jr nc, .asm_38c68
@ -1811,7 +1811,7 @@ AI_Smart_Conversion2: ; 38d98
callab Function347c8 callab Function347c8
ld a, [$d265] ld a, [wd265]
cp $a cp $a
pop hl pop hl
jr c, .asm_38dc9 jr c, .asm_38dc9
@ -1888,7 +1888,7 @@ AI_Smart_MeanLook: ; 38dfb
; Otherwise, discourage this move unless the player only has not very effective moves against the enemy. ; Otherwise, discourage this move unless the player only has not very effective moves against the enemy.
push hl push hl
callab Function3484e callab Function3484e
ld a, [$c716] ld a, [wc716]
cp $b ; not very effective cp $b ; not very effective
pop hl pop hl
ret nc ret nc
@ -2051,7 +2051,7 @@ AI_Smart_Curse: ; 38e5c
AI_Smart_Protect: ; 38ed2 AI_Smart_Protect: ; 38ed2
ld a, [$c681] ld a, [EnemyProtectCount]
and a and a
jr nz, .asm_38f13 jr nz, .asm_38f13
@ -2146,7 +2146,7 @@ AI_Smart_PerishSong: ; 38f4a
push hl push hl
callab Function3484e callab Function3484e
ld a, [$c716] ld a, [wc716]
cp 10 ; 1.0 cp 10 ; 1.0
pop hl pop hl
ret c ret c
@ -2218,7 +2218,7 @@ AI_Smart_Sandstorm: ; 38f7a
AI_Smart_Endure: ; 38fac AI_Smart_Endure: ; 38fac
ld a, [$c681] ld a, [EnemyProtectCount]
and a and a
jr nz, .asm_38fd8 jr nz, .asm_38fd8
@ -2404,7 +2404,7 @@ AI_Smart_BatonPass: ; 39062
push hl push hl
callab Function3484e callab Function3484e
ld a, [$c716] ld a, [wc716]
cp 10 ; neutral cp 10 ; neutral
pop hl pop hl
ret c ret c
@ -2437,7 +2437,7 @@ AI_Smart_RapidSpin: ; 39084
; 80% chance to greatly encourage this move if the enemy is ; 80% chance to greatly encourage this move if the enemy is
; trapped (Bind effect), seeded, or scattered with spikes. ; trapped (Bind effect), seeded, or scattered with spikes.
ld a, [$c731] ld a, [wc731]
and a and a
jr nz, .asm_39097 jr nz, .asm_39097
@ -2470,7 +2470,7 @@ AI_Smart_HiddenPower: ; 3909e
pop hl pop hl
; Discourage Hidden Power if not very effective. ; Discourage Hidden Power if not very effective.
ld a, [$d265] ld a, [wd265]
cp 10 cp 10
jr c, .bad jr c, .bad
@ -2480,7 +2480,7 @@ AI_Smart_HiddenPower: ; 3909e
jr c, .bad jr c, .bad
; Encourage Hidden Power if super-effective. ; Encourage Hidden Power if super-effective.
ld a, [$d265] ld a, [wd265]
cp 11 cp 11
jr nc, .good jr nc, .good
@ -2825,7 +2825,7 @@ AI_Smart_FutureSight: ; 391f3
AI_Smart_Stomp: ; 39200 AI_Smart_Stomp: ; 39200
; 80% chance to encourage this move if the player has used Minimize. ; 80% chance to encourage this move if the player has used Minimize.
ld a, [$c6fe] ld a, [wc6fe]
and a and a
ret z ret z
@ -3463,7 +3463,7 @@ AI_Status: ; 39453
pop bc pop bc
pop hl pop hl
ld a, [$d265] ld a, [wd265]
and a and a
jr nz, .checkmove jr nz, .checkmove

View File

@ -77,7 +77,7 @@ Functioncc11c: ; cc11c
call BattleAnimRestoreHuds call BattleAnimRestoreHuds
.asm_cc141 .asm_cc141
ld a, [$cfca] ld a, [wcfca]
and a and a
jr z, .asm_cc15f jr z, .asm_cc15f
@ -135,7 +135,7 @@ Functioncc163: ; cc163
call BattleAnimDelayFrame call BattleAnimDelayFrame
.asm_cc196 .asm_cc196
ld a, [$d40f] ld a, [BattleAnimFlags]
bit 0, a bit 0, a
jr z, .playframe jr z, .playframe
@ -191,13 +191,13 @@ BattleAnimRequestPals: ; cc1e2
ld a, [rBGP] ld a, [rBGP]
ld b, a ld b, a
ld a, [$cfc7] ld a, [wcfc7]
cp b cp b
call nz, Functioncc91a call nz, Functioncc91a
ld a, [rOBP0] ld a, [rOBP0]
ld b, a ld b, a
ld a, [$cfc8] ld a, [wcfc8]
cp b cp b
call nz, Functioncc94b call nz, Functioncc94b
ret ret
@ -255,7 +255,7 @@ Functioncc220: ; cc220
Functioncc23d: ; cc23d Functioncc23d: ; cc23d
ld a, [$d40f] ld a, [BattleAnimFlags]
bit 3, a bit 3, a
jr z, .asm_cc254 jr z, .asm_cc254
@ -291,12 +291,12 @@ Functioncc25f: ; cc25f
; cc267 ; cc267
Functioncc267: ; cc267 Functioncc267: ; cc267
ld a, [$d412] ld a, [BattleAnimDuration]
and a and a
jr z, .asm_cc273 jr z, .asm_cc273
dec a dec a
ld [$d412], a ld [BattleAnimDuration], a
and a and a
ret ret
@ -313,7 +313,7 @@ Functioncc275: ; cc275
jr nz, .asm_cc286 jr nz, .asm_cc286
; Return from a subroutine. ; Return from a subroutine.
ld hl, $d40f ld hl, BattleAnimFlags
bit 1, [hl] bit 1, [hl]
jr nz, .asm_cc28e jr nz, .asm_cc28e
@ -324,7 +324,7 @@ Functioncc275: ; cc275
cp $d0 cp $d0
jr nc, .asm_cc28e jr nc, .asm_cc28e
ld [$d412], a ld [BattleAnimDuration], a
ret ret
.asm_cc28e .asm_cc28e
@ -334,8 +334,8 @@ Functioncc275: ; cc275
; cc293 ; cc293
Functioncc293: ; cc293 Functioncc293: ; cc293
; Execute battle animation command in [$d417]. ; Execute battle animation command in [BattleAnimByte].
ld a, [$d417] ld a, [BattleAnimByte]
sub $d0 sub $d0
ld e, a ld e, a
@ -409,13 +409,13 @@ BattleAnimCmd_ED: ; cc304 (33:4304)
ret ret
BattleAnimCmd_FF: ; cc305 (33:4305) BattleAnimCmd_FF: ; cc305 (33:4305)
ld hl, $d40f ld hl, BattleAnimFlags
res 1, [hl] res 1, [hl]
ld hl, $d413 ld hl, BattleAnimParent
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
ld hl, $d410 ld hl, BattleAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
@ -427,20 +427,20 @@ BattleAnimCmd_FE: ; cc317 (33:4317)
call GetBattleAnimByte call GetBattleAnimByte
ld d, a ld d, a
push de push de
ld hl, $d410 ld hl, BattleAnimAddress
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
ld hl, $d413 ld hl, BattleAnimParent
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
pop de pop de
ld hl, $d410 ld hl, BattleAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
ld hl, $d40f ld hl, BattleAnimFlags
set 1, [hl] set 1, [hl]
ret ret
@ -449,7 +449,7 @@ BattleAnimCmd_FC: ; cc339 (33:4339)
ld e, a ld e, a
call GetBattleAnimByte call GetBattleAnimByte
ld d, a ld d, a
ld hl, $d410 ld hl, BattleAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
@ -457,16 +457,16 @@ BattleAnimCmd_FC: ; cc339 (33:4339)
BattleAnimCmd_FD: ; cc348 (33:4348) BattleAnimCmd_FD: ; cc348 (33:4348)
call GetBattleAnimByte call GetBattleAnimByte
ld hl, $d40f ld hl, BattleAnimFlags
bit 2, [hl] bit 2, [hl]
jr nz, .asm_cc35b jr nz, .asm_cc35b
and a and a
jr z, .asm_cc363 jr z, .asm_cc363
dec a dec a
set 2, [hl] set 2, [hl]
ld [$d415], a ld [BattleAnimLoops], a
.asm_cc35b .asm_cc35b
ld hl, $d415 ld hl, BattleAnimLoops
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_cc372 jr z, .asm_cc372
@ -476,15 +476,15 @@ BattleAnimCmd_FD: ; cc348 (33:4348)
ld e, a ld e, a
call GetBattleAnimByte call GetBattleAnimByte
ld d, a ld d, a
ld hl, $d410 ld hl, BattleAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
ret ret
.asm_cc372 .asm_cc372
ld hl, $d40f ld hl, BattleAnimFlags
res 2, [hl] res 2, [hl]
ld hl, $d410 ld hl, BattleAnimAddress
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
@ -496,7 +496,7 @@ BattleAnimCmd_FD: ; cc348 (33:4348)
ret ret
BattleAnimCmd_EF: ; cc383 (33:4383) BattleAnimCmd_EF: ; cc383 (33:4383)
ld hl, $c689 ld hl, wc689
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_cc39a jr z, .asm_cc39a
@ -506,14 +506,14 @@ BattleAnimCmd_EF: ; cc383 (33:4383)
ld e, a ld e, a
call GetBattleAnimByte call GetBattleAnimByte
ld d, a ld d, a
ld hl, $d410 ld hl, BattleAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
ret ret
.asm_cc39a .asm_cc39a
ld hl, $d410 ld hl, BattleAnimAddress
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
@ -526,21 +526,21 @@ BattleAnimCmd_EF: ; cc383 (33:4383)
BattleAnimCmd_F9: ; cc3a6 (33:43a6) BattleAnimCmd_F9: ; cc3a6 (33:43a6)
call GetBattleAnimByte call GetBattleAnimByte
ld [$d416], a ld [BattleAnimVar], a
ret ret
BattleAnimCmd_FA: ; cc3ad (33:43ad) BattleAnimCmd_FA: ; cc3ad (33:43ad)
ld hl, $d416 ld hl, BattleAnimVar
inc [hl] inc [hl]
ret ret
BattleAnimCmd_FB: ; cc3b2 (33:43b2) BattleAnimCmd_FB: ; cc3b2 (33:43b2)
call GetBattleAnimByte call GetBattleAnimByte
ld hl, $d416 ld hl, BattleAnimVar
cp [hl] cp [hl]
jr z, .jump jr z, .jump
ld hl, $d410 ld hl, BattleAnimAddress
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
@ -556,7 +556,7 @@ BattleAnimCmd_FB: ; cc3b2 (33:43b2)
ld e, a ld e, a
call GetBattleAnimByte call GetBattleAnimByte
ld d, a ld d, a
ld hl, $d410 ld hl, BattleAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
@ -564,11 +564,11 @@ BattleAnimCmd_FB: ; cc3b2 (33:43b2)
BattleAnimCmd_F8: ; cc3d6 (33:43d6) BattleAnimCmd_F8: ; cc3d6 (33:43d6)
call GetBattleAnimByte call GetBattleAnimByte
ld hl, $c689 ld hl, wc689
cp [hl] cp [hl]
jr z, .jump jr z, .jump
ld hl, $d410 ld hl, BattleAnimAddress
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
@ -584,7 +584,7 @@ BattleAnimCmd_F8: ; cc3d6 (33:43d6)
ld e, a ld e, a
call GetBattleAnimByte call GetBattleAnimByte
ld d, a ld d, a
ld hl, $d410 ld hl, BattleAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
@ -593,11 +593,11 @@ BattleAnimCmd_F8: ; cc3d6 (33:43d6)
BattleAnimCmd_EE: ; cc3fa (33:43fa) BattleAnimCmd_EE: ; cc3fa (33:43fa)
call GetBattleAnimByte call GetBattleAnimByte
ld e, a ld e, a
ld a, [$c689] ld a, [wc689]
and e and e
jr nz, .jump jr nz, .jump
ld hl, $d410 ld hl, BattleAnimAddress
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
@ -612,7 +612,7 @@ BattleAnimCmd_EE: ; cc3fa (33:43fa)
ld e, a ld e, a
call GetBattleAnimByte call GetBattleAnimByte
ld d, a ld d, a
ld hl, $d410 ld hl, BattleAnimAddress
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
@ -620,41 +620,41 @@ BattleAnimCmd_EE: ; cc3fa (33:43fa)
BattleAnimCmd_D0: ; cc41f (33:441f) BattleAnimCmd_D0: ; cc41f (33:441f)
call GetBattleAnimByte call GetBattleAnimByte
ld [$d419], a ld [BattleAnimTemps], a
call GetBattleAnimByte call GetBattleAnimByte
ld [$d41a], a ld [BattleAnimTemps + 1], a
call GetBattleAnimByte call GetBattleAnimByte
ld [$d41b], a ld [BattleAnimTemps + 2], a
call GetBattleAnimByte call GetBattleAnimByte
ld [$d41c], a ld [BattleAnimTemps + 3], a
call Functioncc9a1 call Functioncc9a1
ret ret
BattleAnimCmd_F0: ; cc43b (33:443b) BattleAnimCmd_F0: ; cc43b (33:443b)
call GetBattleAnimByte call GetBattleAnimByte
ld [$d419], a ld [BattleAnimTemps], a
call GetBattleAnimByte call GetBattleAnimByte
ld [$d41a], a ld [BattleAnimTemps + 1], a
call GetBattleAnimByte call GetBattleAnimByte
ld [$d41b], a ld [BattleAnimTemps + 2], a
call GetBattleAnimByte call GetBattleAnimByte
ld [$d41c], a ld [BattleAnimTemps + 3], a
call Functionccb4f call Functionccb4f
ret ret
BattleAnimCmd_F1: ; cc457 (33:4457) BattleAnimCmd_F1: ; cc457 (33:4457)
call GetBattleAnimByte call GetBattleAnimByte
ld [$cfc7], a ld [wcfc7], a
ret ret
BattleAnimCmd_F2: ; cc45e (33:445e) BattleAnimCmd_F2: ; cc45e (33:445e)
call GetBattleAnimByte call GetBattleAnimByte
ld [$cfc8], a ld [wcfc8], a
ret ret
BattleAnimCmd_F3: ; cc465 (33:4465) BattleAnimCmd_F3: ; cc465 (33:4465)
call GetBattleAnimByte call GetBattleAnimByte
ld [$cfc9], a ld [wcfc9], a
ret ret
BattleAnimCmd_DF: ; cc46c (33:446c) BattleAnimCmd_DF: ; cc46c (33:446c)
@ -664,11 +664,11 @@ BattleAnimCmd_DF: ; cc46c (33:446c)
jr z, .asm_cc475 jr z, .asm_cc475
ld a, $f0 ld a, $f0
.asm_cc475 .asm_cc475
ld [$cfc8], a ld [wcfc8], a
ret ret
BattleAnimCmd_E5: ; cc479 (33:4479) BattleAnimCmd_E5: ; cc479 (33:4479)
ld hl, $d30a ld hl, OTPartyMon3HP
ld a, $a0 ld a, $a0
.asm_cc47e .asm_cc47e
ld [hl], $0 ld [hl], $0
@ -682,19 +682,19 @@ BattleAnimCmd_D2:
BattleAnimCmd_D3: BattleAnimCmd_D3:
BattleAnimCmd_D4: BattleAnimCmd_D4:
BattleAnimCmd_D5: ; cc485 (33:4485) BattleAnimCmd_D5: ; cc485 (33:4485)
ld a, [$d417] ld a, [BattleAnimByte]
and $f and $f
ld c, a ld c, a
ld hl, $d300 ld hl, wd300
xor a xor a
ld [$d419], a ld [BattleAnimTemps], a
.asm_cc492 .asm_cc492
ld a, [$d419] ld a, [BattleAnimTemps]
cp $4f cp $4f
ret nc ret nc
call GetBattleAnimByte call GetBattleAnimByte
ld [hli], a ld [hli], a
ld a, [$d419] ld a, [BattleAnimTemps]
ld [hli], a ld [hli], a
push bc push bc
push hl push hl
@ -706,11 +706,11 @@ BattleAnimCmd_D5: ; cc485 (33:4485)
add hl, hl add hl, hl
ld de, $8310 ld de, $8310
add hl, de add hl, de
ld a, [$d417] ld a, [BattleAnimByte]
call Functionce846 call Functionce846
ld a, [$d419] ld a, [BattleAnimTemps]
add c add c
ld [$d419], a ld [BattleAnimTemps], a
pop hl pop hl
pop bc pop bc
dec c dec c
@ -720,12 +720,12 @@ BattleAnimCmd_D5: ; cc485 (33:4485)
BattleAnimCmd_D6: ; cc4c0 (33:44c0) BattleAnimCmd_D6: ; cc4c0 (33:44c0)
call GetBattleAnimByte call GetBattleAnimByte
ld e, $a ld e, $a
ld bc, $d30a ld bc, OTPartyMon3HP
.asm_cc4c8 .asm_cc4c8
ld hl, $0 ld hl, $0
add hl, bc add hl, bc
ld d, [hl] ld d, [hl]
ld a, [$d417] ld a, [BattleAnimByte]
cp d cp d
jr z, .asm_cc4dd jr z, .asm_cc4dd
ld hl, $18 ld hl, $18
@ -744,12 +744,12 @@ BattleAnimCmd_D6: ; cc4c0 (33:44c0)
BattleAnimCmd_D8: ; cc4e3 (33:44e3) BattleAnimCmd_D8: ; cc4e3 (33:44e3)
call GetBattleAnimByte call GetBattleAnimByte
ld e, $5 ld e, $5
ld bc, $d3fa ld bc, ActiveBGEffects
.asm_cc4eb .asm_cc4eb
ld hl, $0 ld hl, $0
add hl, bc add hl, bc
ld d, [hl] ld d, [hl]
ld a, [$d417] ld a, [BattleAnimByte]
cp d cp d
jr z, .asm_cc500 jr z, .asm_cc500
ld hl, $4 ld hl, $4
@ -768,12 +768,12 @@ BattleAnimCmd_D8: ; cc4e3 (33:44e3)
BattleAnimCmd_D7: ; cc506 (33:4506) BattleAnimCmd_D7: ; cc506 (33:4506)
call GetBattleAnimByte call GetBattleAnimByte
ld e, $a ld e, $a
ld bc, $d30a ld bc, OTPartyMon3HP
.asm_cc50e .asm_cc50e
ld hl, $0 ld hl, $0
add hl, bc add hl, bc
ld d, [hl] ld d, [hl]
ld a, [$d417] ld a, [BattleAnimByte]
cp d cp d
jr z, .asm_cc523 jr z, .asm_cc523
ld hl, $18 ld hl, $18
@ -792,7 +792,7 @@ BattleAnimCmd_D7: ; cc506 (33:4506)
BattleAnimCmd_D9: ; cc52c (33:452c) BattleAnimCmd_D9: ; cc52c (33:452c)
ld hl, $d300 ld hl, wd300
.asm_cc52f .asm_cc52f
ld a, [hl] ld a, [hl]
and a and a
@ -814,12 +814,12 @@ BattleAnimCmd_D9: ; cc52c (33:452c)
ld hl, $8730 ld hl, $8730
ld de, $9060 ld de, $9060
ld a, $70 ld a, $70
ld [$d419], a ld [BattleAnimTemps], a
ld a, $7 ld a, $7
call Functioncc561 call Functioncc561
ld de, $9310 ld de, $9310
ld a, $60 ld a, $60
ld [$d419], a ld [BattleAnimTemps], a
ld a, $6 ld a, $6
call Functioncc561 call Functioncc561
ret ret
@ -831,7 +831,7 @@ Functioncc561: ; cc561 (33:4561)
ld bc, $3301 ld bc, $3301
call Request2bpp call Request2bpp
pop de pop de
ld a, [$d419] ld a, [BattleAnimTemps]
ld l, a ld l, a
ld h, $0 ld h, $0
add hl, de add hl, de
@ -847,7 +847,7 @@ Functioncc561: ; cc561 (33:4561)
BattleAnimCmd_DA: ; cc57e (33:457e) BattleAnimCmd_DA: ; cc57e (33:457e)
ld hl, $d300 ld hl, wd300
.asm_cc581 .asm_cc581
ld a, [hl] ld a, [hl]
and a and a
@ -869,12 +869,12 @@ BattleAnimCmd_DA: ; cc57e (33:457e)
ld hl, $8660 ld hl, $8660
ld de, $9050 ld de, $9050
ld a, $70 ld a, $70
ld [$d419], a ld [BattleAnimTemps], a
ld a, $7 ld a, $7
call Functioncc5b3 call Functioncc5b3
ld de, $9310 ld de, $9310
ld a, $60 ld a, $60
ld [$d419], a ld [BattleAnimTemps], a
ld a, $6 ld a, $6
call Functioncc5b3 call Functioncc5b3
ret ret
@ -886,7 +886,7 @@ Functioncc5b3: ; cc5b3 (33:45b3)
ld bc, $3302 ld bc, $3302
call Request2bpp call Request2bpp
pop de pop de
ld a, [$d419] ld a, [BattleAnimTemps]
ld l, a ld l, a
ld h, $0 ld h, $0
add hl, de add hl, de
@ -903,7 +903,7 @@ Functioncc5b3: ; cc5b3 (33:45b3)
BattleAnimCmd_DB: ; cc5d0 (33:45d0) BattleAnimCmd_DB: ; cc5d0 (33:45d0)
callab GetPokeBallWobble callab GetPokeBallWobble
ld a, c ld a, c
ld [$d416], a ld [BattleAnimVar], a
ret ret
BattleAnimCmd_E7: ; cc5db (33:45db) BattleAnimCmd_E7: ; cc5db (33:45db)
@ -914,32 +914,32 @@ BattleAnimCmd_DC: ; cc5dc (33:45dc)
push af push af
ld a, 1 ld a, 1
ld [rSVBK], a ; $ff00+$70 ld [rSVBK], a ; $ff00+$70
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; CurPartySpecies
push af push af
ld a, [hBattleTurn] ; $ff00+$e4 ld a, [hBattleTurn] ; $ff00+$e4
and a and a
jr z, .player jr z, .player
ld a, [TempBattleMonSpecies] ; $d205 ld a, [TempBattleMonSpecies] ; TempBattleMonSpecies
ld [CurPartySpecies], a ; $d108 ld [CurPartySpecies], a ; CurPartySpecies
ld hl, BattleMonDVs ; $c632 ld hl, BattleMonDVs ; BattleMonDVs
predef GetUnownLetter predef GetUnownLetter
ld de, $8000 ld de, $8000
predef GetFrontpic predef GetFrontpic
jr .done jr .done
.player .player
ld a, [TempEnemyMonSpecies] ; $d204 ld a, [TempEnemyMonSpecies] ; TempEnemyMonSpecies
ld [CurPartySpecies], a ; $d108 ld [CurPartySpecies], a ; CurPartySpecies
ld hl, EnemyMonDVs ; $d20c ld hl, EnemyMonDVs ; EnemyMonDVs
predef GetUnownLetter predef GetUnownLetter
ld de, $8000 ld de, $8000
predef GetBackpic predef GetBackpic
.done .done
pop af pop af
ld [CurPartySpecies], a ; $d108 ld [CurPartySpecies], a ; CurPartySpecies
pop af pop af
ld [rSVBK], a ; $ff00+$70 ld [rSVBK], a ; $ff00+$70
ret ret
@ -1116,7 +1116,7 @@ BattleAnimCmd_DE: ; cc750 (33:4750)
ld a, $1 ld a, $1
ld [rSVBK], a ; $ff00+$70 ld [rSVBK], a ; $ff00+$70
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; CurPartySpecies
push af push af
ld a, [hBattleTurn] ; $ff00+$e4 ld a, [hBattleTurn] ; $ff00+$e4
and a and a
@ -1130,7 +1130,7 @@ BattleAnimCmd_DE: ; cc750 (33:4750)
.done .done
pop af pop af
ld [CurPartySpecies], a ; $d108 ld [CurPartySpecies], a ; CurPartySpecies
pop af pop af
ld [rSVBK], a ; $ff00+$70 ld [rSVBK], a ; $ff00+$70
ret ret
@ -1140,31 +1140,31 @@ BattleAnimCmd_E6: ; cc776 (33:4776)
push af push af
ld a, $1 ld a, $1
ld [rSVBK], a ; $ff00+$70 ld [rSVBK], a ; $ff00+$70
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; CurPartySpecies
push af push af
ld a, [$c689] ld a, [wc689]
ld [CurPartySpecies], a ; $d108 ld [CurPartySpecies], a ; CurPartySpecies
ld a, [hBattleTurn] ; $ff00+$e4 ld a, [hBattleTurn] ; $ff00+$e4
and a and a
jr z, .player jr z, .player
ld hl, BattleMonDVs ; $c632 ld hl, BattleMonDVs ; BattleMonDVs
predef GetUnownLetter predef GetUnownLetter
ld de, $9000 ld de, $9000
predef GetFrontpic predef GetFrontpic
jr .done jr .done
.player .player
ld hl, EnemyMonDVs ; $d20c ld hl, EnemyMonDVs ; EnemyMonDVs
predef GetUnownLetter predef GetUnownLetter
ld de, $9310 ld de, $9310
predef GetBackpic predef GetBackpic
.done .done
pop af pop af
ld [CurPartySpecies], a ; $d108 ld [CurPartySpecies], a ; CurPartySpecies
ld b, $1 ld b, $1
call GetSGBLayout call GetSGBLayout
pop af pop af
@ -1182,7 +1182,7 @@ BattleAnimCmd_E4: ; cc7bf (33:47bf)
ret ret
BattleAnimCmd_F4: ; cc7c4 (33:47c4) BattleAnimCmd_F4: ; cc7c4 (33:47c4)
ld hl, $d40f ld hl, BattleAnimFlags
set 3, [hl] set 3, [hl]
ret ret
@ -1200,17 +1200,17 @@ BattleAnimCmd_E0: ; cc7cd (33:47cd)
ld e, a ld e, a
srl a srl a
srl a srl a
ld [$c2be], a ld [wc2be], a
call Functioncc7fc call Functioncc7fc
and 3 and 3
ld [CryTracks], a ; $c2bd ld [CryTracks], a ; CryTracks
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, Datacc7f8 ld hl, Datacc7f8
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld [$c2bc], a ld [wc2bc], a
call GetBattleAnimByte call GetBattleAnimByte
ld e, a ld e, a
@ -1258,14 +1258,14 @@ BattleAnimCmd_E1: ; cc807 (33:4807)
jr nz, .enemy jr nz, .enemy
ld a, $f0 ld a, $f0
ld [CryTracks], a ; $c2bd ld [CryTracks], a ; CryTracks
ld a, [BattleMonSpecies] ; $c62c ld a, [BattleMonSpecies] ; BattleMonSpecies
jr .asm_cc834 jr .asm_cc834
.enemy .enemy
ld a, $0f ld a, $0f
ld [CryTracks], a ; $c2bd ld [CryTracks], a ; CryTracks
ld a, [EnemyMonSpecies] ; $d206 ld a, [EnemyMonSpecies] ; EnemyMon
.asm_cc834 .asm_cc834
push hl push hl
@ -1293,18 +1293,18 @@ BattleAnimCmd_E1: ; cc807 (33:4807)
ld a, [hli] ld a, [hli]
ld c, a ld c, a
ld b, [hl] ld b, [hl]
ld hl, CryLength ; $c2b2 ld hl, CryLength ; CryLength
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
add hl, bc add hl, bc
ld a, l ld a, l
ld [CryLength], a ; $c2b2 ld [CryLength], a ; CryLength
ld a, h ld a, h
ld [CryLength + 1], a ld [CryLength + 1], a
ld a, 1 ld a, 1
ld [$c2bc], a ld [wc2bc], a
callab _PlayCryHeader callab _PlayCryHeader
@ -1324,7 +1324,7 @@ Datacc871: ; cc871
Functioncc881: ; cc881 Functioncc881: ; cc881
ld a, [$cfca] ld a, [wcfca]
cp $1 cp $1
jr z, .asm_cc88b jr z, .asm_cc88b
cp $4 cp $4
@ -1360,17 +1360,17 @@ BattleAnimAssignPals: ; cc8a4
ld a, $f0 ld a, $f0
.asm_cc8b2 .asm_cc8b2
ld [$cfc8], a ld [wcfc8], a
ld a, $e4 ld a, $e4
ld [$cfc7], a ld [wcfc7], a
ld [$cfc9], a ld [wcfc9], a
ret ret
.asm_cc8be .asm_cc8be
ld a, $e4 ld a, $e4
ld [$cfc7], a ld [wcfc7], a
ld [$cfc8], a ld [wcfc8], a
ld [$cfc9], a ld [wcfc9], a
call DmgToCgbBGPals call DmgToCgbBGPals
ld de, $e4e4 ld de, $e4e4
call DmgToCgbObjPals call DmgToCgbObjPals
@ -1403,9 +1403,9 @@ Functioncc8d3: ; cc8d3
Functioncc8f6: ; cc8f6 Functioncc8f6: ; cc8f6
call WaitTop call WaitTop
ld a, $e4 ld a, $e4
ld [$cfc7], a ld [wcfc7], a
ld [$cfc8], a ld [wcfc8], a
ld [$cfc9], a ld [wcfc9], a
call DmgToCgbBGPals call DmgToCgbBGPals
ld de, $e4e4 ld de, $e4e4
call DmgToCgbObjPals call DmgToCgbObjPals
@ -1427,13 +1427,13 @@ Functioncc91a: ; cc91a
push af push af
ld a, $5 ld a, $5
ld [rSVBK], a ld [rSVBK], a
ld hl, $d080 ld hl, BGPals
ld de, $d000 ld de, wd000
ld a, [rBGP] ld a, [rBGP]
ld b, a ld b, a
ld c, $7 ld c, $7
call CopyPals call CopyPals
ld hl, $d0c0 ld hl, OBPals
ld de, MartPointer ld de, MartPointer
ld a, [rBGP] ld a, [rBGP]
ld b, a ld b, a
@ -1455,8 +1455,8 @@ Functioncc94b: ; cc94b
push af push af
ld a, $5 ld a, $5
ld [rSVBK], a ld [rSVBK], a
ld hl, $d0d0 ld hl, OBPals + $10
ld de, $d050 ld de, Unkn2Pals + $10
ld a, [rOBP0] ld a, [rOBP0]
ld b, a ld b, a
ld c, $2 ld c, $2
@ -1470,8 +1470,8 @@ Functioncc94b: ; cc94b
Functioncc96e: ; cc96e Functioncc96e: ; cc96e
ld a, $0 ld a, $0
ld [$d418], a ld [wd418], a
ld hl, $d30a ld hl, OTPartyMon3HP
ld e, $a ld e, $a
.asm_cc978 .asm_cc978
ld a, [hl] ld a, [hl]
@ -1492,7 +1492,7 @@ Functioncc96e: ; cc96e
add hl, bc add hl, bc
dec e dec e
jr nz, .asm_cc978 jr nz, .asm_cc978
ld a, [$d418] ld a, [wd418]
ld l, a ld l, a
ld h, $c4 ld h, $c4
.asm_cc997 .asm_cc997

View File

@ -2,7 +2,7 @@
Functioncc9a1: ; cc9a1 (33:49a1) Functioncc9a1: ; cc9a1 (33:49a1)
ld hl, $d30a ld hl, OTPartyMon3HP
ld e, $a ld e, $a
.asm_cc9a6 .asm_cc9a6
ld a, [hl] ld a, [hl]
@ -17,7 +17,7 @@ Functioncc9a1: ; cc9a1 (33:49a1)
.asm_cc9b3 .asm_cc9b3
ld c, l ld c, l
ld b, h ld b, h
ld hl, $d40e ld hl, wd40e
inc [hl] inc [hl]
call Functioncc9c4 call Functioncc9c4
ret ret
@ -32,7 +32,7 @@ Functioncc9bd: ; cc9bd
Functioncc9c4: ; cc9c4 (33:49c4) Functioncc9c4: ; cc9c4 (33:49c4)
ld a, [$d419] ld a, [BattleAnimTemps]
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, BattleAnimObjects ld hl, BattleAnimObjects
@ -46,7 +46,7 @@ Functioncc9c4: ; cc9c4 (33:49c4)
ld d, h ld d, h
ld hl, $0 ld hl, $0
add hl, bc add hl, bc
ld a, [$d40e] ld a, [wd40e]
ld [hli], a ld [hli], a
ld a, [de] ld a, [de]
inc de inc de
@ -66,14 +66,14 @@ Functioncc9c4: ; cc9c4 (33:49c4)
ld a, [de] ld a, [de]
call Functionccb31 call Functionccb31
ld [hli], a ld [hli], a
ld a, [$d41a] ld a, [BattleAnimTemps + 1]
ld [hli], a ld [hli], a
ld a, [$d41b] ld a, [BattleAnimTemps + 2]
ld [hli], a ld [hli], a
xor a xor a
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld a, [$d41c] ld a, [BattleAnimTemps + 3]
ld [hli], a ld [hli], a
xor a xor a
ld [hli], a ld [hli], a
@ -94,35 +94,35 @@ Functioncca09: ; cca09
cp $fc cp $fc
jp z, .asm_ccaa2 jp z, .asm_ccaa2
push af push af
ld hl, $d419 ld hl, BattleAnimTemps
ld a, [$d420] ld a, [BattleAnimTemps + 7]
xor [hl] xor [hl]
and $e0 and $e0
ld [hl], a ld [hl], a
pop af pop af
push bc push bc
call Functionce83c call Functionce83c
ld a, [$d41b] ld a, [BattleAnimTemps + 2]
add [hl] add [hl]
ld [$d41b], a ld [BattleAnimTemps + 2], a
inc hl inc hl
ld a, [hli] ld a, [hli]
ld c, a ld c, a
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld a, [$d418] ld a, [wd418]
ld e, a ld e, a
ld d, $c4 ld d, $c4
.asm_cca3c .asm_cca3c
ld a, [$d41d] ld a, [BattleAnimTemps + 4]
ld b, a ld b, a
ld a, [$d41f] ld a, [BattleAnimTemps + 6]
add b add b
ld b, a ld b, a
push hl push hl
ld a, [hl] ld a, [hl]
ld hl, $d419 ld hl, BattleAnimTemps
bit 6, [hl] bit 6, [hl]
jr z, .asm_cca53 jr z, .asm_cca53
add $8 add $8
@ -135,14 +135,14 @@ Functioncca09: ; cca09
ld [de], a ld [de], a
inc hl inc hl
inc de inc de
ld a, [$d41c] ld a, [BattleAnimTemps + 3]
ld b, a ld b, a
ld a, [$d41e] ld a, [BattleAnimTemps + 5]
add b add b
ld b, a ld b, a
push hl push hl
ld a, [hl] ld a, [hl]
ld hl, $d419 ld hl, BattleAnimTemps
bit 5, [hl] bit 5, [hl]
jr z, .asm_cca6f jr z, .asm_cca6f
add $8 add $8
@ -155,13 +155,13 @@ Functioncca09: ; cca09
ld [de], a ld [de], a
inc hl inc hl
inc de inc de
ld a, [$d41b] ld a, [BattleAnimTemps + 2]
add $31 add $31
add [hl] add [hl]
ld [de], a ld [de], a
inc hl inc hl
inc de inc de
ld a, [$d419] ld a, [BattleAnimTemps]
ld b, a ld b, a
ld a, [hl] ld a, [hl]
xor b xor b
@ -171,14 +171,14 @@ Functioncca09: ; cca09
and $10 and $10
or b or b
ld b, a ld b, a
ld a, [$d421] ld a, [BattleAnimTemps + 8]
and $f and $f
or b or b
ld [de], a ld [de], a
inc hl inc hl
inc de inc de
ld a, e ld a, e
ld [$d418], a ld [wd418], a
cp $a0 cp $a0
jr nc, .asm_ccaa7 jr nc, .asm_ccaa7
dec c dec c
@ -204,36 +204,36 @@ Functionccaaa: ; ccaaa
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
and $80 and $80
ld [$d419], a ld [BattleAnimTemps], a
xor a xor a
ld [$d420], a ld [BattleAnimTemps + 7], a
ld hl, $0005 ld hl, $0005
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [$d421], a ld [BattleAnimTemps + 8], a
ld hl, $0002 ld hl, $0002
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [$d41a], a ld [BattleAnimTemps + 1], a
ld hl, $0006 ld hl, $0006
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
ld [$d41b], a ld [BattleAnimTemps + 2], a
ld a, [hli] ld a, [hli]
ld [$d41c], a ld [BattleAnimTemps + 3], a
ld a, [hli] ld a, [hli]
ld [$d41d], a ld [BattleAnimTemps + 4], a
ld a, [hli] ld a, [hli]
ld [$d41e], a ld [BattleAnimTemps + 5], a
ld a, [hli] ld a, [hli]
ld [$d41f], a ld [BattleAnimTemps + 6], a
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
ret z ret z
ld hl, $0001 ld hl, $0001
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [$d419], a ld [BattleAnimTemps], a
bit 0, [hl] bit 0, [hl]
ret z ret z
ld hl, $0007 ld hl, $0007
@ -242,10 +242,10 @@ Functionccaaa: ; ccaaa
ld d, a ld d, a
ld a, $b4 ld a, $b4
sub d sub d
ld [$d41c], a ld [BattleAnimTemps + 3], a
ld a, [hli] ld a, [hli]
ld d, a ld d, a
ld a, [$d41a] ld a, [BattleAnimTemps + 1]
cp $ff cp $ff
jr nz, .asm_ccb09 jr nz, .asm_ccb09
ld a, $28 ld a, $28
@ -275,11 +275,11 @@ Functionccaaa: ; ccaaa
pop af pop af
.asm_ccb26 .asm_ccb26
ld [$d41d], a ld [BattleAnimTemps + 4], a
ld a, [hli] ld a, [hli]
xor $ff xor $ff
inc a inc a
ld [$d41e], a ld [BattleAnimTemps + 5], a
ret ret
; ccb31 ; ccb31
@ -287,7 +287,7 @@ Functionccaaa: ; ccaaa
Functionccb31: ; ccb31 (33:4b31) Functionccb31: ; ccb31 (33:4b31)
push hl push hl
push bc push bc
ld hl, $d300 ld hl, wd300
ld b, a ld b, a
ld c, $5 ld c, $5
.asm_ccb39 .asm_ccb39
@ -950,7 +950,7 @@ Functioncd249: ; cd249 (33:5249)
push af push af
ld a, $1 ld a, $1
ld [rSVBK], a ; $ff00+$70 ld [rSVBK], a ; $ff00+$70
ld a, [CurItem] ; $d106 ld a, [CurItem] ; CurItem
ld e, a ld e, a
pop af pop af
ld [rSVBK], a ; $ff00+$70 ld [rSVBK], a ; $ff00+$70
@ -3894,7 +3894,7 @@ Functionce29f: ; ce29f (33:629f)
ld hl, $f ld hl, $f
add hl, bc add hl, bc
and [hl] and [hl]
ld [$cfc8], a ld [wcfc8], a
ret ret
; ce2c4 (33:62c4) ; ce2c4 (33:62c4)
@ -4853,7 +4853,7 @@ Functionce7d1: ; ce7d1
ld a, [hl] ld a, [hl]
and $c0 and $c0
srl a srl a
ld [$d420], a ld [BattleAnimTemps + 7], a
pop af pop af
ret ret

View File

@ -1,7 +1,7 @@
; BG effects for use in battle animations. ; BG effects for use in battle animations.
Functionc8000: ; c8000 (32:4000) Functionc8000: ; c8000 (32:4000)
ld hl, $d3fa ld hl, ActiveBGEffects
ld e, $5 ld e, $5
.asm_c8005 .asm_c8005
ld a, [hl] ld a, [hl]
@ -22,7 +22,7 @@ Functionc8000: ; c8000 (32:4000)
ret ret
Functionc801a: ; c801a (32:401a) Functionc801a: ; c801a (32:401a)
ld hl, $d3fa ld hl, ActiveBGEffects
ld e, $5 ld e, $5
.asm_c801f .asm_c801f
ld a, [hl] ld a, [hl]
@ -39,13 +39,13 @@ Functionc801a: ; c801a (32:401a)
ld b, h ld b, h
ld hl, $0 ld hl, $0
add hl, bc add hl, bc
ld a, [$d419] ld a, [BattleAnimTemps]
ld [hli], a ld [hli], a
ld a, [$d41a] ld a, [BattleAnimTemps + 1]
ld [hli], a ld [hli], a
ld a, [$d41b] ld a, [BattleAnimTemps + 2]
ld [hli], a ld [hli], a
ld a, [$d41c] ld a, [BattleAnimTemps + 3]
ld [hl], a ld [hl], a
ret ret
@ -182,7 +182,7 @@ Functionc80f3: ; c80f3 (32:40f3)
Functionc80fb: ; c80fb (32:40fb) Functionc80fb: ; c80fb (32:40fb)
ld a, $1 ld a, $1
ld [$d419], a ld [BattleAnimTemps], a
ld hl, $1 ld hl, $1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -214,14 +214,14 @@ Functionc80fb: ; c80fb (32:40fb)
ld h, 0 ld h, 0
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld [$cfc7], a ld [wcfc7], a
ret ret
Functionc812d: ; c812d (32:412d) Functionc812d: ; c812d (32:412d)
ld de, Unknown_c813d ld de, Unknown_c813d
call Functionc8d57 call Functionc8d57
jr c, .asm_c8139 jr c, .asm_c8139
ld [$cfc7], a ld [wcfc7], a
ret ret
.asm_c8139 .asm_c8139
call EndBattleBGEffect call EndBattleBGEffect
@ -236,7 +236,7 @@ Functionc8141: ; c8141 (32:4141)
ld de, Unknown_c8151 ld de, Unknown_c8151
call Functionc8d57 call Functionc8d57
jr c, .asm_c814d jr c, .asm_c814d
ld [$cfc7], a ld [wcfc7], a
ret ret
.asm_c814d .asm_c814d
call EndBattleBGEffect call EndBattleBGEffect
@ -251,8 +251,8 @@ Functionc8155: ; c8155 (32:4155)
ld de, Unknown_c8168 ld de, Unknown_c8168
call Functionc8d57 call Functionc8d57
jr c, .asm_c8164 jr c, .asm_c8164
ld [$cfc7], a ld [wcfc7], a
ld [$cfc9], a ld [wcfc9], a
ret ret
.asm_c8164 .asm_c8164
call EndBattleBGEffect call EndBattleBGEffect
@ -272,7 +272,7 @@ Functionc8171: ; c8171 (32:4171)
ld de, Unknown_c8188 ld de, Unknown_c8188
.asm_c817e .asm_c817e
call Functionc8d57 call Functionc8d57
ld [$cfc8], a ld [wcfc8], a
ret ret
; c8185 (32:4185) ; c8185 (32:4185)
@ -293,7 +293,7 @@ Functionc818b: ; c818b (32:418b)
ld de, Unknown_c81a2 ld de, Unknown_c81a2
.asm_c8198 .asm_c8198
call Functionc8d57 call Functionc8d57
ld [$cfc8], a ld [wcfc8], a
ret ret
; c819f (32:419f) ; c819f (32:419f)
@ -308,7 +308,7 @@ Unknown_c81a2:
Functionc81a5: ; c81a5 (32:41a5) Functionc81a5: ; c81a5 (32:41a5)
ld de, Unknown_c81af ld de, Unknown_c81af
call Functionc8d57 call Functionc8d57
ld [$cfc7], a ld [wcfc7], a
ret ret
; c81af (32:41af) ; c81af (32:41af)
@ -367,9 +367,9 @@ Functionc81ea: ; c81ea (32:41ea)
ld de, Unknown_c820c ld de, Unknown_c820c
.asm_c8200 .asm_c8200
ld a, e ld a, e
ld [$d41a], a ld [BattleAnimTemps + 1], a
ld a, d ld a, d
ld [$d41b], a ld [BattleAnimTemps + 2], a
call Functionc83ed call Functionc83ed
ret ret
; c820c (32:420c) ; c820c (32:420c)
@ -399,7 +399,7 @@ Jumptable_c8217: ; c8217 (32:4217)
Functionc8223: ; c8223 (32:4223) Functionc8223: ; c8223 (32:4223)
call Functionc9042 call Functionc9042
jr z, .asm_c8230 jr z, .asm_c8230
ld hl, $d40e ld hl, wd40e
inc [hl] inc [hl]
call EndBattleBGEffect call EndBattleBGEffect
ret ret
@ -409,19 +409,19 @@ Functionc8223: ; c8223 (32:4223)
call Functionc9038 call Functionc9038
jr nz, .asm_c8242 jr nz, .asm_c8242
ld a, $b8 ld a, $b8
ld [$d419], a ld [BattleAnimTemps], a
ld a, $84 ld a, $84
jr .asm_c8249 jr .asm_c8249
.asm_c8242 .asm_c8242
ld a, $b9 ld a, $b9
ld [$d419], a ld [BattleAnimTemps], a
ld a, $30 ld a, $30
.asm_c8249 .asm_c8249
ld [$d41a], a ld [BattleAnimTemps + 1], a
ld a, $40 ld a, $40
ld [$d41b], a ld [BattleAnimTemps + 2], a
xor a xor a
ld [$d41c], a ld [BattleAnimTemps + 3], a
call Functionc82ee call Functionc82ee
pop bc pop bc
ret ret
@ -465,7 +465,7 @@ Jumptable_c8284: ; c8284 (32:4284)
Functionc8290: ; c8290 (32:4290) Functionc8290: ; c8290 (32:4290)
call Functionc9042 call Functionc9042
jr z, .asm_c829d jr z, .asm_c829d
ld hl, $d40e ld hl, wd40e
inc [hl] inc [hl]
call EndBattleBGEffect call EndBattleBGEffect
ret ret
@ -475,19 +475,19 @@ Functionc8290: ; c8290 (32:4290)
call Functionc9038 call Functionc9038
jr nz, .asm_c82af jr nz, .asm_c82af
ld a, $ba ld a, $ba
ld [$d419], a ld [BattleAnimTemps], a
ld a, $84 ld a, $84
jr .asm_c82b6 jr .asm_c82b6
.asm_c82af .asm_c82af
ld a, $bb ld a, $bb
ld [$d419], a ld [BattleAnimTemps], a
ld a, $30 ld a, $30
.asm_c82b6 .asm_c82b6
ld [$d41a], a ld [BattleAnimTemps + 1], a
ld a, $40 ld a, $40
ld [$d41b], a ld [BattleAnimTemps + 2], a
xor a xor a
ld [$d41c], a ld [BattleAnimTemps + 3], a
call Functionc82ee call Functionc82ee
pop bc pop bc
ret ret
@ -628,9 +628,9 @@ Functionc837b: ; c837b (32:437b)
ld de, Unknown_c8394 ld de, Unknown_c8394
.asm_c8388 .asm_c8388
ld a, e ld a, e
ld [$d41a], a ld [BattleAnimTemps + 1], a
ld a, d ld a, d
ld [$d41b], a ld [BattleAnimTemps + 2], a
call Functionc83ed call Functionc83ed
ret ret
; c8394 (32:4394) ; c8394 (32:4394)
@ -658,9 +658,9 @@ Functionc83a8: ; c83a8 (32:43a8)
ld de, Unknown_c83c1 ld de, Unknown_c83c1
.asm_c83b5 .asm_c83b5
ld a, e ld a, e
ld [$d41a], a ld [BattleAnimTemps + 1], a
ld a, d ld a, d
ld [$d41b], a ld [BattleAnimTemps + 2], a
call Functionc83ed call Functionc83ed
ret ret
; c83c1 (32:43c1) ; c83c1 (32:43c1)
@ -704,9 +704,9 @@ Functionc83fa: ; c83fa (32:43fa)
ld e, [hl] ld e, [hl]
ld d, $0 ld d, $0
inc [hl] inc [hl]
ld a, [$d41a] ld a, [BattleAnimTemps + 1]
ld l, a ld l, a
ld a, [$d41b] ld a, [BattleAnimTemps + 2]
ld h, a ld h, a
add hl, de add hl, de
add hl, de add hl, de
@ -788,7 +788,7 @@ Functionc8458: ; c8458 (32:4458)
pop hl pop hl
inc hl inc hl
ld a, [hli] ld a, [hli]
ld [$d419], a ld [BattleAnimTemps], a
push de push de
ld e, [hl] ld e, [hl]
ld d, 0 ld d, 0
@ -802,7 +802,7 @@ Functionc8458: ; c8458 (32:4458)
.asm_c8484 .asm_c8484
push bc push bc
push hl push hl
ld a, [$d419] ld a, [BattleAnimTemps]
ld b, a ld b, a
.asm_c848a .asm_c848a
ld a, [de] ld a, [de]
@ -912,8 +912,8 @@ Functionc8561: ; c8561 (32:4561)
ret ret
Functionc8565: ; c8565 (32:4565) Functionc8565: ; c8565 (32:4565)
ld hl, $d422 ld hl, wd422
ld de, $d423 ld de, wd422 + 1
ld c, $3f ld c, $3f
ld a, [hl] ld a, [hl]
push af push af
@ -925,8 +925,8 @@ Functionc8565: ; c8565 (32:4565)
jr nz, .asm_c856f jr nz, .asm_c856f
pop af pop af
ld [hl], a ld [hl], a
ld de, $d200 ld de, LYOverridesBackup
ld hl, $d422 ld hl, wd422
ld bc, $0 ld bc, $0
.asm_c8580 .asm_c8580
ld a, [$ffc7] ld a, [$ffc7]
@ -1006,7 +1006,7 @@ Functionc85ce: ; c85ce (32:45ce)
ld hl, $1 ld hl, $1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [$d419], a ld [BattleAnimTemps], a
ld hl, $2 ld hl, $2
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
@ -1509,10 +1509,10 @@ Functionc8888: ; c8888 (32:4888)
Functionc88a5: ; c88a5 (32:48a5) Functionc88a5: ; c88a5 (32:48a5)
push af push af
ld a, [FXAnimIDHi] ; $cfc3 ld a, [FXAnimIDHi] ; FXAnimIDHi
or a or a
jr nz, .asm_c88b3 jr nz, .asm_c88b3
ld a, [FXAnimIDLo] ; $cfc2 ld a, [FXAnimIDLo] ; FXAnimID
cp ROLLOUT cp ROLLOUT
jr z, .asm_c88b7 jr z, .asm_c88b7
.asm_c88b3 .asm_c88b3
@ -1990,7 +1990,7 @@ Functionc8b22: ; c8b22 (32:4b22)
ld hl, Unknown_c8bd8 ld hl, Unknown_c8bd8
add hl, de add hl, de
ld a, [hli] ld a, [hli]
ld [$cfc9], a ld [wcfc9], a
ld d, a ld d, a
ld e, [hl] ld e, [hl]
ld bc, $2f30 ld bc, $2f30
@ -2001,7 +2001,7 @@ Functionc8b22: ; c8b22 (32:4b22)
ld d, [hl] ld d, [hl]
inc hl inc hl
ld a, [hl] ld a, [hl]
ld [$cfc9], a ld [wcfc9], a
ld e, a ld e, a
ld bc, $3728 ld bc, $3728
.asm_c8b5b .asm_c8b5b
@ -2012,12 +2012,12 @@ Functionc8b22: ; c8b22 (32:4b22)
Functionc8b60: ; c8b60 (32:4b60) Functionc8b60: ; c8b60 (32:4b60)
call Functionc8f19 call Functionc8f19
ld a, $e4 ld a, $e4
ld [$cfc7], a ld [wcfc7], a
ld [$cfc9], a ld [wcfc9], a
ret ret
Functionc8b6c: ; c8b6c (32:4b6c) Functionc8b6c: ; c8b6c (32:4b6c)
ld hl, $d200 ld hl, LYOverridesBackup
.asm_c8b6f .asm_c8b6f
ld [hl], d ld [hl], d
inc hl inc hl
@ -2303,7 +2303,7 @@ Functionc8ce1: ; c8ce1 (32:4ce1)
ld [hSCY], a ; $ff00+$d0 ld [hSCY], a ; $ff00+$d0
xor $ff xor $ff
inc a inc a
ld [$d314], a ld [OTPartyMon3SpclAtk], a
ret ret
Functionc8cf9: ; c8cf9 (32:4cf9) Functionc8cf9: ; c8cf9 (32:4cf9)
@ -2563,13 +2563,13 @@ Functionc8e52: ; c8e52 (32:4e52)
ld a, h ld a, h
push bc push bc
push af push af
ld hl, BGPals ; $d080 ld hl, BGPals ; BGPals
ld de, Unkn1Pals ; $d000 ld de, Unkn1Pals ; wd000
ld b, a ld b, a
ld c, $1 ld c, $1
call CopyPals call CopyPals
ld hl, $d0c8 ld hl, OBPals + 8
ld de, $d048 ld de, Unkn2Pals + 8
pop af pop af
ld b, a ld b, a
ld c, $1 ld c, $1
@ -2590,13 +2590,13 @@ Functionc8e7f: ; c8e7f (32:4e7f)
ld a, h ld a, h
push bc push bc
push af push af
ld hl, $d088 ld hl, BGPals + 8
ld de, $d008 ld de, Unkn1Pals + 8
ld b, a ld b, a
ld c, $1 ld c, $1
call CopyPals call CopyPals
ld hl, OBPals ; $d0c0 ld hl, OBPals ; OBPals
ld de, Unkn2Pals ; $d040 ld de, Unkn2Pals ; wd040
pop af pop af
ld b, a ld b, a
ld c, $1 ld c, $1
@ -2638,7 +2638,7 @@ Functionc8eca: ; c8eca (32:4eca)
xor a xor a
Functionc8ecb: ; c8ecb (32:4ecb) Functionc8ecb: ; c8ecb (32:4ecb)
ld hl, LYOverrides ; $d100 ld hl, LYOverrides ; wd100
ld e, $99 ld e, $99
.asm_c8ed0 .asm_c8ed0
ld [hli], a ld [hli], a
@ -2697,8 +2697,8 @@ Functionc8f19: ; c8f19 (32:4f19)
ld [hLCDStatCustom], a ; $ff00+$c6 ld [hLCDStatCustom], a ; $ff00+$c6
ld a, $e4 ld a, $e4
ld [rBGP], a ; $ff00+$47 ld [rBGP], a ; $ff00+$47
ld [$cfc7], a ld [wcfc7], a
ld [$cfc9], a ld [wcfc9], a
ld [$ffc7], a ld [$ffc7], a
ld [$ffc8], a ld [$ffc8], a
call Functionc8eca call Functionc8eca
@ -2707,14 +2707,14 @@ Functionc8f19: ; c8f19 (32:4f19)
Functionc8f2e: ; c8f2e (32:4f2e) Functionc8f2e: ; c8f2e (32:4f2e)
push bc push bc
xor a xor a
ld [$d419], a ld [BattleAnimTemps], a
ld a, e ld a, e
ld [$d41a], a ld [BattleAnimTemps + 1], a
ld a, d ld a, d
ld [$d41b], a ld [BattleAnimTemps + 2], a
ld a, $80 ld a, $80
ld [$d41c], a ld [BattleAnimTemps + 3], a
ld bc, $d200 ld bc, LYOverridesBackup
.asm_c8f43 .asm_c8f43
ld a, [$ffc7] ld a, [$ffc7]
cp c cp c
@ -2722,18 +2722,18 @@ Functionc8f2e: ; c8f2e (32:4f2e)
ld a, [$ffc8] ld a, [$ffc8]
cp c cp c
jr c, .asm_c8f58 jr c, .asm_c8f58
ld a, [$d41b] ld a, [BattleAnimTemps + 2]
ld d, a ld d, a
ld a, [$d419] ld a, [BattleAnimTemps]
call Functionc905d call Functionc905d
ld [bc], a ld [bc], a
.asm_c8f58 .asm_c8f58
inc bc inc bc
ld a, [$d41a] ld a, [BattleAnimTemps + 1]
ld hl, $d419 ld hl, BattleAnimTemps
add [hl] add [hl]
ld [hl], a ld [hl], a
ld hl, $d41c ld hl, BattleAnimTemps + 3
dec [hl] dec [hl]
jr nz, .asm_c8f43 jr nz, .asm_c8f43
pop bc pop bc
@ -2742,26 +2742,26 @@ Functionc8f2e: ; c8f2e (32:4f2e)
Functionc8f69: ; c8f69 (32:4f69) Functionc8f69: ; c8f69 (32:4f69)
push bc push bc
xor a xor a
ld [$d419], a ld [BattleAnimTemps], a
ld a, e ld a, e
ld [$d41a], a ld [BattleAnimTemps + 1], a
ld a, d ld a, d
ld [$d41b], a ld [BattleAnimTemps + 2], a
ld a, $40 ld a, $40
ld [$d41c], a ld [BattleAnimTemps + 3], a
ld bc, $d422 ld bc, wd422
.asm_c8f7e .asm_c8f7e
ld a, [$d41b] ld a, [BattleAnimTemps + 2]
ld d, a ld d, a
ld a, [$d419] ld a, [BattleAnimTemps]
call Functionc905d call Functionc905d
ld [bc], a ld [bc], a
inc bc inc bc
ld a, [$d41a] ld a, [BattleAnimTemps + 1]
ld hl, $d419 ld hl, BattleAnimTemps
add [hl] add [hl]
ld [hl], a ld [hl], a
ld hl, $d41c ld hl, BattleAnimTemps + 3
dec [hl] dec [hl]
jr nz, .asm_c8f7e jr nz, .asm_c8f7e
pop bc pop bc
@ -2769,26 +2769,26 @@ Functionc8f69: ; c8f69 (32:4f69)
Functionc8f9a: ; c8f9a (32:4f9a) Functionc8f9a: ; c8f9a (32:4f9a)
push bc push bc
ld [$d41c], a ld [BattleAnimTemps + 3], a
ld a, e ld a, e
ld [$d41a], a ld [BattleAnimTemps + 1], a
ld a, d ld a, d
ld [$d41b], a ld [BattleAnimTemps + 2], a
call Functionc8fe4 call Functionc8fe4
ld hl, $d200 ld hl, LYOverridesBackup
add hl, de add hl, de
ld c, l ld c, l
ld b, h ld b, h
.asm_c8faf .asm_c8faf
ld a, [$d41c] ld a, [BattleAnimTemps + 3]
and a and a
jr z, .asm_c8fe1 jr z, .asm_c8fe1
dec a dec a
ld [$d41c], a ld [BattleAnimTemps + 3], a
push af push af
ld a, [$d41b] ld a, [BattleAnimTemps + 2]
ld d, a ld d, a
ld a, [$d41a] ld a, [BattleAnimTemps + 1]
push hl push hl
call Functionc905d call Functionc905d
ld e, a ld e, a
@ -2806,9 +2806,9 @@ Functionc8f9a: ; c8f9a (32:4f9a)
ld [hl], e ld [hl], e
dec hl dec hl
.asm_c8fd6 .asm_c8fd6
ld a, [$d41a] ld a, [BattleAnimTemps + 1]
add $4 add $4
ld [$d41a], a ld [BattleAnimTemps + 1], a
pop af pop af
jr .asm_c8faf jr .asm_c8faf
.asm_c8fe1 .asm_c8fe1
@ -2819,7 +2819,7 @@ Functionc8f9a: ; c8f9a (32:4f9a)
Functionc8fe4: ; c8fe4 (32:4fe4) Functionc8fe4: ; c8fe4 (32:4fe4)
ld a, [$ffc7] ld a, [$ffc7]
ld e, a ld e, a
ld a, [$d419] ld a, [BattleAnimTemps]
add e add e
ld e, a ld e, a
ld d, $0 ld d, $0
@ -2907,11 +2907,11 @@ Functionc9042: ; c9042 (32:5042)
and $1 and $1
xor [hl] xor [hl]
jr nz, .asm_c9053 jr nz, .asm_c9053
ld a, [EnemySubStatus3] ; $c66f ld a, [EnemySubStatus3] ; EnemySubStatus3
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret ret
.asm_c9053 .asm_c9053
ld a, [PlayerSubStatus3] ; $c66a ld a, [PlayerSubStatus3] ; PlayerSubStatus3
and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND
ret ret

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@ BattleCommand54: ; 37588
; Raise Attack and Defense, and lower Speed. ; Raise Attack and Defense, and lower Speed.
ld a, $1 ld a, $1
ld [$c689], a ld [wc689], a
call AnimateCurrentMove call AnimateCurrentMove
ld a, $2 ld a, $2
call Function36532 call Function36532

View File

@ -5,11 +5,11 @@ BattleCommand34: ; 37418
call Function34548 call Function34548
jr nz, .asm_3742b jr nz, .asm_3742b
ld a, [$c689] ld a, [wc689]
push af push af
call BattleCommand0a call BattleCommand0a
pop af pop af
ld [$c689], a ld [wc689], a
.asm_3742b .asm_3742b
call Function37e36 call Function37e36

View File

@ -24,7 +24,7 @@ BattleCommand1b: ; 373c9
.use .use
ld a, b ld a, b
ld [hl], a ld [hl], a
ld [$d265], a ld [wd265], a
push af push af
ld a, BATTLE_VARS_MOVE_ANIM ld a, BATTLE_VARS_MOVE_ANIM
@ -40,11 +40,11 @@ BattleCommand1b: ; 373c9
call Function34548 call Function34548
jr nz, .done jr nz, .done
ld a, [$c689] ld a, [wc689]
push af push af
call BattleCommand0a call BattleCommand0a
pop af pop af
ld [$c689], a ld [wc689], a
.done .done
call BattleCommandaa call BattleCommandaa

View File

@ -44,7 +44,7 @@ BattleCommand5c: ; 37734
and a and a
jr nz, .asm_37750 jr nz, .asm_37750
ld a, 1 ld a, 1
ld [$c73e], a ld [wc73e], a
.asm_37750 .asm_37750
ld a, [AttackMissed] ld a, [AttackMissed]

View File

@ -21,7 +21,7 @@ BattleCommand50: ; 37492
; Can't steal mail. ; Can't steal mail.
ld [$d265], a ld [wd265], a
ld d, a ld d, a
callba ItemIsMail callba ItemIsMail
ret c ret c
@ -45,7 +45,7 @@ BattleCommand50: ; 37492
ld [de], a ld [de], a
call .playeritem call .playeritem
ld a, [$d265] ld a, [wd265]
ld [hl], a ld [hl], a
ld [de], a ld [de], a
jr .stole jr .stole
@ -69,7 +69,7 @@ BattleCommand50: ; 37492
; Can't steal mail! ; Can't steal mail!
ld [$d265], a ld [wd265], a
ld d, a ld d, a
callba ItemIsMail callba ItemIsMail
ret c ret c
@ -87,7 +87,7 @@ BattleCommand50: ; 37492
ld [de], a ld [de], a
call .enemyitem call .enemyitem
ld a, [$d265] ld a, [wd265]
ld [hl], a ld [hl], a
ld [de], a ld [de], a

View File

@ -82,7 +82,7 @@ CalcMagikarpLength: ; fbbfc
ld hl, .Lengths ld hl, .Lengths
ld a, 2 ld a, 2
ld [$d265], a ld [wd265], a
.read .read
ld a, [hli] ld a, [hli]
@ -111,7 +111,7 @@ CalcMagikarpLength: ; fbbfc
ld [hMultiplicand + 1], a ld [hMultiplicand + 1], a
ld a, 100 ld a, 100
ld [hMultiplicand + 2], a ld [hMultiplicand + 2], a
ld a, [$d265] ld a, [wd265]
ld [hMultiplier], a ld [hMultiplier], a
call Multiply call Multiply
ld b, 0 ld b, 0
@ -125,9 +125,9 @@ CalcMagikarpLength: ; fbbfc
.next .next
inc hl ; align to next triplet inc hl ; align to next triplet
ld a, [$d265] ld a, [wd265]
inc a inc a
ld [$d265], a ld [wd265], a
cp 16 cp 16
jr c, .read jr c, .read

View File

@ -4,14 +4,14 @@ Function1f8000: ; 1f8000
ld a, $3 ld a, $3
ld [rSVBK], a ld [rSVBK], a
xor a xor a
ld hl, $d100 ld hl, wd100
ld bc, $00e0 ld bc, $00e0
call ByteFill call ByteFill
ld a, $ff ld a, $ff
ld [$d10c], a ld [wd10c], a
ld [$d147], a ld [wd147], a
ld [$d182], a ld [wd182], a
ld de, $d100 ld de, wd100
ld a, [hRandomAdd] ld a, [hRandomAdd]
ld b, a ld b, a
.asm_1f8022 .asm_1f8022
@ -99,22 +99,22 @@ Function1f8081: ; 1f8081
ld b, a ld b, a
ld a, [hld] ld a, [hld]
ld c, a ld c, a
ld a, [$d10b] ld a, [wd10b]
cp b cp b
jr z, .asm_1f8089 jr z, .asm_1f8089
ld a, [$d10c] ld a, [wd10c]
cp c cp c
jr z, .asm_1f8089 jr z, .asm_1f8089
ld a, [$d146] ld a, [wd146]
cp b cp b
jr z, .asm_1f8089 jr z, .asm_1f8089
ld a, [$d147] ld a, [wd147]
cp c cp c
jr z, .asm_1f8089 jr z, .asm_1f8089
ld a, [$d181] ld a, [wd181]
cp b cp b
jr z, .asm_1f8089 jr z, .asm_1f8089
ld a, [$d182] ld a, [wd182]
cp c cp c
jr z, .asm_1f8089 jr z, .asm_1f8089
ld a, [$be51] ld a, [$be51]
@ -138,13 +138,13 @@ Function1f8081: ; 1f8081
ld bc, $3b ld bc, $3b
call CopyBytes call CopyBytes
ld a, [$d265] ld a, [wd265]
push af push af
push de push de
ld hl, -$3b ld hl, -$3b
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld [$d265], a ld [wd265], a
ld bc, $0030 ld bc, $0030
add hl, bc add hl, bc
push hl push hl
@ -156,7 +156,7 @@ Function1f8081: ; 1f8081
call CopyBytes call CopyBytes
pop de pop de
pop af pop af
ld [$d265], a ld [wd265], a
pop bc pop bc
dec c dec c
jp nz, .loop jp nz, .loop
@ -167,11 +167,11 @@ Function1f8081: ; 1f8081
ld [$be55], a ld [$be55], a
ld a, [$be53] ld a, [$be53]
ld [$be56], a ld [$be56], a
ld a, [$d10b] ld a, [wd10b]
ld [$be51], a ld [$be51], a
ld a, [$d146] ld a, [wd146]
ld [$be52], a ld [$be52], a
ld a, [$d181] ld a, [wd181]
ld [$be53], a ld [$be53], a
call CloseSRAM call CloseSRAM
ret ret

View File

@ -43,44 +43,44 @@ GiveOddEgg: ; 1fb4b6
ld a, OddEgg2 - OddEgg1 ld a, OddEgg2 - OddEgg1
call AddNTimes call AddNTimes
ld de, $c608 ld de, wEnemyMoveStruct
ld bc, $0046 ld bc, $0046
call CopyBytes call CopyBytes
ld a, EGG_TICKET ld a, EGG_TICKET
ld [CurItem], a ld [CurItem], a
ld a, $1 ld a, $1
ld [$d10c], a ld [wd10c], a
ld a, $ff ld a, $ff
ld [$d107], a ld [wd107], a
ld hl, NumItems ld hl, NumItems
call TossItem call TossItem
ld a, EGG ld a, EGG
ld [$cd2a], a ld [wcd2a], a
ld a, $cd29 % $100 ld a, wcd29 % $100
ld [$cd20], a ld [CreditsPos], a
ld a, $cd29 / $100 ld a, wcd29 / $100
ld [$cd21], a ld [wcd21], a
ld a, $c608 % $100 ld a, wEnemyMoveStruct % $100
ld [$cd22], a ld [wcd22], a
ld a, $c608 / $100 ld a, wEnemyMoveStruct / $100
ld [$cd23], a ld [wcd23], a
ld hl, .Odd ld hl, .Odd
ld de, $cd2b ld de, wcd2b
ld bc, PKMN_NAME_LENGTH ld bc, PKMN_NAME_LENGTH
call CopyBytes call CopyBytes
ld a, $cd2b % $100 ld a, wcd2b % $100
ld [$cd24], a ld [wcd24], a
ld a, $cd2b / $100 ld a, wcd2b / $100
ld [$cd25], a ld [wcd25], a
ld a, $c638 % $100 ld a, BattleMonHappiness % $100
ld [$cd26], a ld [wcd26], a
ld a, $c638 / $100 ld a, BattleMonHappiness / $100
ld [$cd27], a ld [wcd27], a
callba Function11b98f callba Function11b98f
ret ret
; 1fb546 ; 1fb546

View File

@ -122,7 +122,7 @@ GetFishGroupHeader: ; 9245b
; Return fishing encounter group header d in de. ; Return fishing encounter group header d in de.
push hl push hl
ld hl, $dc1e ld hl, wdc1e
bit 2, [hl] bit 2, [hl]
pop hl pop hl
jr z, .end jr z, .end
@ -141,14 +141,14 @@ GetFishGroupHeader: ; 9245b
ret ret
.group11 .group11
ld a, [$dfce] ld a, [wdfce]
cp 1 cp 1
jr nz, .end jr nz, .end
ld d, 6 ld d, 6
jr .end jr .end
.group12 .group12
ld a, [$dfce] ld a, [wdfce]
cp 2 cp 2
jr nz, .end jr nz, .end
ld d, 7 ld d, 7

View File

@ -116,7 +116,7 @@ ReadCaughtData: ; 4f134
jr nz, .asm_4f15f jr nz, .asm_4f15f
inc hl inc hl
ld a, [$d47c] ld a, [PlayerID + 1]
jr nz, .asm_4f15f jr nz, .asm_4f15f
ld a, 0 ld a, 0

View File

@ -74,20 +74,16 @@ lb: MACRO ; r, hi, lo
ENDM ENDM
bccoord: MACRO bccoord equs "coord bc,"
coord bc, \1, \2 decoord equs "coord de,"
ENDM hlcoord equs "coord hl,"
decoord: MACRO
coord de, \1, \2
ENDM
hlcoord: MACRO
coord hl, \1, \2
ENDM
coord: MACRO coord: MACRO
if _NARG < 4
ld \1, TileMap + SCREEN_WIDTH * (\3) + (\2) ld \1, TileMap + SCREEN_WIDTH * (\3) + (\2)
else
ld \1, \4 + SCREEN_WIDTH * (\3) + (\2)
endc
ENDM ENDM
dwcoord: MACRO dwcoord: MACRO

17841
main.asm

File diff suppressed because it is too large Load Diff

993
wram.asm

File diff suppressed because it is too large Load Diff