diff options
author | dannye <corrnondacqb@yahoo.com> | 2016-06-11 16:16:56 -0500 |
---|---|---|
committer | dannye <corrnondacqb@yahoo.com> | 2016-06-11 16:16:56 -0500 |
commit | c979b3bb03b121dd03a800df74144cd69a74601a (patch) | |
tree | 0d6bb48125efe6f6215347967383ba4c3b7da391 | |
parent | 269f2c3ba72776e975f5b00d9a1361cadbda42a7 (diff) | |
parent | 6e8c3883e430b567f7aa8f9230e366e03610bd5a (diff) |
Merge branch 'master' of https://github.com/pret/pokeyellow
485 files changed, 15737 insertions, 15789 deletions
diff --git a/constants/event_constants.asm b/constants/event_constants.asm index 5b379fae..d2bf1123 100644 --- a/constants/event_constants.asm +++ b/constants/event_constants.asm @@ -2560,3 +2560,5 @@ const_value = 0 const EVENT_9FD ; 9FD, (D886, bit 5) const EVENT_9FE ; 9FE, (D886, bit 6) const EVENT_9FF ; 9FF, (D886, bit 7) + +NUM_EVENT_FLAGS EQU const_value diff --git a/constants/event_macros.asm b/constants/event_macros.asm index bf0a95b5..a3ce9746 100644 --- a/constants/event_macros.asm +++ b/constants/event_macros.asm @@ -57,6 +57,16 @@ event_byte = ((\2) / 8) ld \1, wEventFlags + event_byte ENDM +EventFlagAddressa: MACRO +event_byte = ((\1) / 8) + ld [wEventFlags + event_byte], a + ENDM + +aEventFlagAddress: MACRO +event_byte = ((\1) / 8) + ld a, [wEventFlags + event_byte] + ENDM + ;\1 = event index CheckEventHL: MACRO event_byte = ((\1) / 8) diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm index 10cffac8..fb4116d7 100755 --- a/constants/hide_show_constants.asm +++ b/constants/hide_show_constants.asm @@ -240,3 +240,6 @@ const HS_SEAFOAM_ISLANDS_5_BOULDER_1 ; E9 const HS_SEAFOAM_ISLANDS_5_BOULDER_2 ; EA const HS_ARTICUNO ; EB + const HS_DAISY_SITTING_COPY ; EC + const HS_DAISY_WALKING_COPY ; ED + const HS_TOWN_MAP_COPY ; EE diff --git a/constants/music_constants.asm b/constants/music_constants.asm index c0ff2b8b..71ff1aba 100644 --- a/constants/music_constants.asm +++ b/constants/music_constants.asm @@ -276,9 +276,10 @@ ENDM music_const SFX_SHOOTING_STAR, SFX_Shooting_Star ; AUDIO_4 + music_const SFX_UNKNOWN_801B0_4, SFX_801b0_4 music_const SFX_UNKNOWN_801B3_4, SFX_801b3_4 music_const SFX_UNKNOWN_801B6_4, SFX_801b6_4 music_const SFX_UNKNOWN_801B9_4, SFX_801b9_4 music_const SFX_UNKNOWN_801BC_4, SFX_801bc_4 music_const SFX_UNKNOWN_801BF_4, SFX_801bf_4 - music_const SFX_UNKNOWN_GET_ITEM2_4_2, SFX_Get_Item2_4_2 + music_const SFX_GET_ITEM2_4_2, SFX_Get_Item2_4_2 diff --git a/constants/pikachu_emotion_constants.asm b/constants/pikachu_emotion_constants.asm index 13033857..c34a08f7 100644 --- a/constants/pikachu_emotion_constants.asm +++ b/constants/pikachu_emotion_constants.asm @@ -47,12 +47,12 @@ pikaemotion_emotebubble: MACRO db \1 ENDM -pikaemotion_4: MACRO +pikaemotion_movement: MACRO db PIKAEMOTION_4 dw \1 ENDM -pikaemotion_5: MACRO +pikaemotion_pikapic: MACRO db PIKAEMOTION_5 db \1 ENDM diff --git a/constants/sprite_constants.asm b/constants/sprite_constants.asm index ae0c9dfa..3349e374 100755 --- a/constants/sprite_constants.asm +++ b/constants/sprite_constants.asm @@ -85,6 +85,8 @@ const_value = 1 const SPRITE_CHANSEY ; $44 const SPRITE_JESSIE ; $45 const SPRITE_JAMES ; $46 + + ; 4-tile sprites const SPRITE_BALL ; $47 const SPRITE_OMANYTE ; $48 const SPRITE_BOULDER ; $49 diff --git a/data/animated_objects_3e_1.asm b/data/animated_objects_3e_1.asm new file mode 100755 index 00000000..2461c469 --- /dev/null +++ b/data/animated_objects_3e_1.asm @@ -0,0 +1,361 @@ +Unkn_f9405: + dw Unkn_f943d + dw Unkn_f9440 + dw Unkn_f9445 + dw Unkn_f944a + dw Unkn_f944f + dw Unkn_f9454 + dw Unkn_f9459 + dw Unkn_f945e + dw Unkn_f9463 + dw Unkn_f9468 + dw Unkn_f946d + dw Unkn_f9472 + dw Unkn_f9477 + dw Unkn_f947c + dw Unkn_f9481 + dw Unkn_f9486 + dw Unkn_f948b + dw Unkn_f9494 + dw Unkn_f9499 + dw Unkn_f949e + dw Unkn_f94fb + dw Unkn_f94a1 + dw Unkn_f94b0 + dw Unkn_f94bf + dw Unkn_f94ce + dw Unkn_f94dd + dw Unkn_f94ec + dw Unkn_f94fe + +Unkn_f943d: + frame $00, 32 + endanim + +Unkn_f9440: + frame $01, 8 + frame $02, 8 + dorestart + +Unkn_f9445: + frame $03, 8 + frame $04, 8 + dorestart + +Unkn_f944a: + frame $05, 8 + frame $06, 8 + dorestart + +Unkn_f944f: + frame $07, 8 + frame $08, 8 + dorestart + +Unkn_f9454: + frame $09, 8 + frame $0a, 8 + dorestart + +Unkn_f9459: + frame $0b, 8 + frame $0c, 8 + dorestart + +Unkn_f945e: + frame $0d, 8 + frame $0e, 8 + dorestart + +Unkn_f9463: + frame $01, 8, OAM_HFLIP, OAM_VFLIP + frame $02, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9468: + frame $03, 8, OAM_HFLIP, OAM_VFLIP + frame $04, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f946d: + frame $05, 8, OAM_HFLIP, OAM_VFLIP + frame $06, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9472: + frame $07, 8, OAM_HFLIP, OAM_VFLIP + frame $08, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9477: + frame $09, 8, OAM_HFLIP, OAM_VFLIP + frame $0a, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f947c: + frame $0b, 8, OAM_HFLIP, OAM_VFLIP + frame $0c, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9481: + frame $0d, 8, OAM_HFLIP, OAM_VFLIP + frame $0e, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9486: + frame $11, 7 + frame $12, 7 + dorestart + +Unkn_f948b: + frame $13, 2 + frame $14, 2 + dorepeat 8 + frame $15, 2 + endanim + +Unkn_f9494: + frame $16, 32 + frame $16, 32 + delanim + +Unkn_f9499: + frame $17, 32 + frame $17, 32 + delanim + +Unkn_f949e: + frame $18, 32 + endanim + +Unkn_f94a1: + frame $1a, 4 + dorepeat 1 + frame $1a, 3 + dorepeat 1 + frame $1a, 2 + dorepeat 1 + frame $1a, 1 + delanim + +Unkn_f94b0: + frame $1b, 4 + dorepeat 1 + frame $1b, 3 + dorepeat 1 + frame $1b, 2 + dorepeat 1 + frame $1b, 1 + delanim + +Unkn_f94bf: + frame $1c, 4 + dorepeat 1 + frame $1c, 3 + dorepeat 1 + frame $1c, 2 + dorepeat 1 + frame $1c, 1 + delanim + +Unkn_f94ce: + frame $1d, 4 + dorepeat 1 + frame $1d, 3 + dorepeat 1 + frame $1d, 2 + dorepeat 1 + frame $1d, 1 + delanim + +Unkn_f94dd: + frame $1e, 4 + dorepeat 1 + frame $1e, 3 + dorepeat 1 + frame $1e, 2 + dorepeat 1 + frame $1e, 1 + delanim + +Unkn_f94ec: + frame $1f, 4 + dorepeat 1 + frame $1f, 3 + dorepeat 1 + frame $1f, 2 + dorepeat 1 + frame $1f, 1 + delanim + +Unkn_f94fb: + frame $19, 1 + delanim + +Unkn_f94fe: + frame $20, 7 + frame $21, 7 + frame $22, 7 + frame $23, 7 + dorestart + +Unkn_f9507: + dbw $00, Unkn_f9573 + dbw $00, Unkn_f9578 + dbw $36, Unkn_f9578 + dbw $03, Unkn_f9578 + dbw $39, Unkn_f9578 + dbw $06, Unkn_f9578 + dbw $3c, Unkn_f9578 + dbw $09, Unkn_f9578 + dbw $60, Unkn_f9578 + dbw $0c, Unkn_f9578 + dbw $63, Unkn_f9578 + dbw $30, Unkn_f9578 + dbw $66, Unkn_f9578 + dbw $33, Unkn_f9578 + dbw $69, Unkn_f9578 + dbw $6c, Unkn_f9578 + dbw $9c, Unkn_f9578 + dbw $a0, Unkn_f9578 + dbw $a3, Unkn_f9578 + dbw $a7, Unkn_f95db + dbw $a8, Unkn_f95f4 + dbw $98, Unkn_f9625 + dbw $e0, Unkn_f959d + dbw $e6, Unkn_f959d + dbw $ca, Unkn_f959d + dbw $a7, Unkn_f95ce + dbw $00, Unkn_f9632 + dbw $00, Unkn_f963f + dbw $00, Unkn_f9650 + dbw $00, Unkn_f9661 + dbw $00, Unkn_f9672 + dbw $00, Unkn_f9683 + dbw $80, Unkn_f9694 + dbw $84, Unkn_f9694 + dbw $88, Unkn_f9694 + dbw $8c, Unkn_f9694 + +Unkn_f9573: + db 1 + db $fc, $fc, $00, $00 + +Unkn_f9578: + db 9 + db $f4, $f4, $00, $00 + db $f4, $fc, $01, $00 + db $f4, $04, $02, $00 + db $fc, $f4, $10, $00 + db $fc, $fc, $11, $00 + db $fc, $04, $12, $00 + db $04, $f4, $20, $00 + db $04, $fc, $21, $00 + db $04, $04, $22, $00 + +Unkn_f959d: + db 12 + db $f8, $e8, $00, $00 + db $f8, $f0, $01, $00 + db $f8, $f8, $02, $00 + db $f8, $00, $03, $00 + db $f8, $08, $04, $00 + db $f8, $10, $05, $00 + db $00, $e8, $10, $00 + db $00, $f0, $11, $00 + db $00, $f8, $12, $00 + db $00, $00, $13, $00 + db $00, $08, $14, $00 + db $00, $10, $15, $00 + +Unkn_f95ce: + db 3 + db $fc, $0b, $00, $10 + db $04, $03, $0f, $10 + db $04, $0b, $10, $10 + +Unkn_f95db: + db 6 + db $fc, $f0, $00, $30 + db $fc, $08, $00, $10 + db $04, $f0, $10, $30 + db $04, $f8, $0f, $30 + db $04, $00, $0f, $10 + db $04, $08, $10, $10 + +Unkn_f95f4: + db 12 + db $f4, $f0, $00, $10 + db $f4, $f8, $01, $10 + db $f4, $00, $01, $30 + db $f4, $08, $00, $30 + db $fc, $f0, $10, $10 + db $fc, $f8, $11, $10 + db $fc, $00, $11, $30 + db $fc, $08, $10, $30 + db $04, $f0, $20, $10 + db $04, $f8, $21, $10 + db $04, $00, $21, $30 + db $04, $08, $20, $30 + +Unkn_f9625: + db 3 + db $04, $f4, $00, $00 + db $04, $fc, $01, $00 + db $04, $04, $02, $00 + +Unkn_f9632: + db 3 + db $fc, $f4, $bf, $00 + db $fc, $fc, $d5, $00 + db $fc, $04, $d0, $00 + +Unkn_f963f: + db 4 + db $fc, $f0, $bf, $00 + db $fc, $f8, $d1, $00 + db $fc, $00, $d5, $00 + db $fc, $08, $d0, $00 + +Unkn_f9650: + db 4 + db $fc, $f0, $bf, $00 + db $fc, $f8, $d3, $00 + db $fc, $00, $d5, $00 + db $fc, $08, $d0, $00 + +Unkn_f9661: + db 4 + db $fc, $f0, $bf, $00 + db $fc, $f8, $d7, $00 + db $fc, $00, $d5, $00 + db $fc, $08, $d0, $00 + +Unkn_f9672: + db 4 + db $fc, $f0, $bf, $00 + db $fc, $f8, $d1, $00 + db $fc, $00, $d8, $00 + db $fc, $08, $d0, $00 + +Unkn_f9683: + db 4 + db $fc, $f0, $bf, $00 + db $fc, $f8, $d5, $00 + db $fc, $00, $d0, $00 + db $fc, $08, $d0, $00 + +Unkn_f9694: + db 12 + db $f4, $f0, $03, $20 + db $f4, $f8, $02, $20 + db $f4, $00, $01, $20 + db $f4, $08, $00, $20 + db $fc, $f0, $13, $20 + db $fc, $f8, $12, $20 + db $fc, $00, $11, $20 + db $fc, $08, $10, $20 + db $04, $f0, $23, $20 + db $04, $f8, $22, $20 + db $04, $00, $21, $20 + db $04, $08, $20, $20 diff --git a/data/animated_objects_3e_2.asm b/data/animated_objects_3e_2.asm new file mode 100755 index 00000000..4e9f5b3c --- /dev/null +++ b/data/animated_objects_3e_2.asm @@ -0,0 +1,236 @@ +YellowIntro_AnimatedObjectFramesData: + dw Unkn_fa100 + dw Unkn_fa103 + dw Unkn_fa10a + dw Unkn_fa111 + dw Unkn_fa118 + dw Unkn_fa11b + dw Unkn_fa11e + dw Unkn_fa121 + dw Unkn_fa124 + dw Unkn_fa127 + dw Unkn_fa138 + +Unkn_fa100: + frame $00, 32 + endanim + +Unkn_fa103: + frame $01, 4 + frame $02, 4 + frame $03, 4 + dorestart + +Unkn_fa10a: + frame $04, 4 + frame $05, 4 + frame $06, 4 + dorestart + +Unkn_fa111: + frame $07, 4 + frame $08, 4 + frame $09, 4 + dorestart + +Unkn_fa118: + frame $0a, 32 + endanim + +Unkn_fa11b: + frame $0b, 32 + endanim + +Unkn_fa11e: + frame $0c, 32 + endanim + +Unkn_fa121: + frame $0d, 32 + endanim + +Unkn_fa124: + frame $0e, 32 + endanim + +Unkn_fa127: + frame $0f, 31 + frame $11, 2 + frame $0f, 2 + frame $11, 2 + frame $0f, 31 + frame $11, 2 + frame $0f, 23 + frame $10, 32 + endanim + +Unkn_fa138: + frame $12, 4 + frame $13, 4 + dorestart + +YellowIntro_AnimatedObjectOAMData: + dbw $00, Unkn_fa179 + dbw $96, Unkn_fa17e + dbw $98, Unkn_fa17e + dbw $9a, Unkn_fa17e + dbw $0c, Unkn_fa18f + dbw $0e, Unkn_fa18f + dbw $3c, Unkn_fa18f + dbw $60, Unkn_fa1b0 + dbw $70, Unkn_fa1b0 + dbw $80, Unkn_fa1b0 + dbw $90, Unkn_fa201 + dbw $00, Unkn_fa201 + dbw $06, Unkn_fa201 + dbw $c6, Unkn_fa292 + dbw $6d, Unkn_fa2f7 + dbw $f0, Unkn_fa308 + dbw $f4, Unkn_fa308 + dbw $f8, Unkn_fa308 + dbw $9c, Unkn_fa329 + dbw $ec, Unkn_fa329 + +Unkn_fa179: + db 1 + db $fc, $fc, $00, $00 +Unkn_fa17e: + db 4 + db $f8, $f8, $00, $00 + db $f8, $00, $01, $00 + db $00, $f8, $10, $00 + db $00, $00, $11, $00 + +Unkn_fa18f: + db 8 + db $f0, $f8, $00, $00 + db $f0, $00, $01, $00 + db $f8, $f8, $10, $00 + db $f8, $00, $11, $00 + db $00, $f8, $20, $00 + db $00, $00, $20, $20 + db $08, $f8, $21, $00 + db $08, $00, $21, $20 + +Unkn_fa1b0: + db 20 + db $e8, $f8, $00, $00 + db $e8, $00, $01, $00 + db $f0, $f8, $02, $00 + db $f0, $00, $03, $00 + db $f8, $f0, $04, $00 + db $f8, $f8, $05, $00 + db $f8, $00, $06, $00 + db $f8, $08, $04, $20 + db $00, $f0, $07, $00 + db $00, $f8, $08, $00 + db $00, $00, $08, $20 + db $00, $08, $07, $20 + db $08, $f0, $09, $00 + db $08, $f8, $0a, $00 + db $08, $00, $0a, $20 + db $08, $08, $09, $20 + db $10, $f0, $0b, $00 + db $10, $f8, $0c, $00 + db $10, $00, $0c, $20 + db $10, $08, $0b, $20 + +Unkn_fa201: + db 36 + db $e8, $e8, $00, $00 + db $e8, $f0, $01, $00 + db $e8, $f8, $02, $00 + db $e8, $00, $03, $00 + db $e8, $08, $04, $00 + db $e8, $10, $05, $00 + db $f0, $e8, $10, $00 + db $f0, $f0, $11, $00 + db $f0, $f8, $12, $00 + db $f0, $00, $13, $00 + db $f0, $08, $14, $00 + db $f0, $10, $15, $00 + db $f8, $e8, $20, $00 + db $f8, $f0, $21, $00 + db $f8, $f8, $22, $00 + db $f8, $00, $23, $00 + db $f8, $08, $24, $00 + db $f8, $10, $25, $00 + db $00, $e8, $30, $00 + db $00, $f0, $31, $00 + db $00, $f8, $32, $00 + db $00, $00, $33, $00 + db $00, $08, $34, $00 + db $00, $10, $35, $00 + db $08, $e8, $40, $00 + db $08, $f0, $41, $00 + db $08, $f8, $42, $00 + db $08, $00, $43, $00 + db $08, $08, $44, $00 + db $08, $10, $45, $00 + db $10, $e8, $50, $00 + db $10, $f0, $51, $00 + db $10, $f8, $52, $00 + db $10, $00, $53, $00 + db $10, $08, $54, $00 + db $10, $10, $55, $00 + +Unkn_fa292: + db 25 + db $ec, $f0, $00, $00 + db $ec, $f8, $01, $00 + db $ec, $00, $02, $00 + db $ec, $08, $03, $00 + db $ec, $10, $04, $00 + db $f4, $f0, $05, $00 + db $f4, $f8, $06, $00 + db $f4, $00, $07, $00 + db $f4, $08, $08, $00 + db $f4, $10, $09, $00 + db $fc, $f0, $10, $00 + db $fc, $f8, $11, $00 + db $fc, $00, $12, $00 + db $fc, $08, $13, $00 + db $fc, $10, $14, $00 + db $04, $f0, $15, $00 + db $04, $f8, $16, $00 + db $04, $00, $17, $00 + db $04, $08, $18, $00 + db $04, $10, $19, $00 + db $0c, $f0, $20, $00 + db $0c, $f8, $21, $00 + db $0c, $00, $22, $00 + db $0c, $08, $23, $00 + db $0c, $10, $24, $00 + +Unkn_fa2f7: + db 4 + db $fc, $f0, $00, $00 + db $fc, $f8, $01, $00 + db $fc, $00, $01, $20 + db $fc, $08, $00, $20 + +Unkn_fa308: + db 8 + db $f8, $e8, $00, $10 + db $f8, $f0, $01, $10 + db $00, $e8, $02, $10 + db $00, $f0, $03, $10 + db $f8, $08, $01, $30 + db $f8, $10, $00, $30 + db $00, $08, $03, $30 + db $00, $10, $02, $30 + +Unkn_fa329: + db 12 + db $f8, $d8, $00, $10 + db $f8, $e0, $01, $10 + db $f8, $e8, $02, $10 + db $00, $d8, $10, $10 + db $00, $e0, $11, $10 + db $00, $e8, $12, $10 + db $f8, $10, $02, $30 + db $f8, $18, $01, $30 + db $f8, $20, $00, $30 + db $00, $10, $12, $30 + db $00, $18, $11, $30 + db $00, $20, $10, $30 diff --git a/data/pikachu_emotions.asm b/data/pikachu_emotions.asm new file mode 100755 index 00000000..a1d902c3 --- /dev/null +++ b/data/pikachu_emotions.asm @@ -0,0 +1,266 @@ +PikachuEmotion0_fd115: ; fd115 (3f:5115) + db $ff + +PikachuEmotion2_fd116: ; fd116 (3f:5116) + pikaemotion_dummy2 + pikaemotion_emotebubble SMILE_BUBBLE + pikaemotion_pcm PikachuCry35 + pikaemotion_pikapic $2 + db $ff + +PikachuEmotion10_fd11e: ; fd11e (3f:511e) + pikaemotion_dummy2 + pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES + pikaemotion_emotebubble HEART_BUBBLE + pikaemotion_pcm PikachuCry5 + pikaemotion_pikapic $a + db $ff + +PikachuEmotion7_fd128: ; fd128 (3f:5128) + pikaemotion_dummy2 + pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES + pikaemotion_movement Pointer_fd224 + pikaemotion_pcm PikachuCry1 + pikaemotion_movement Pointer_fd224 + pikaemotion_pikapic $7 + db $ff + +PikachuEmotion4_fd136: ; fd136 (3f:5136) + pikaemotion_dummy2 + pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES + pikaemotion_movement Pointer_fd230 + pikaemotion_pcm PikachuCry29 + pikaemotion_pikapic $4 + db $ff + +PikachuEmotion1_fd141: ; fd141 (3f:5141) + pikaemotion_dummy2 + pikaemotion_pcm + pikaemotion_pikapic $1 + db $ff + +PikachuEmotion8_fd147: ; fd147 (3f:5147) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry39 + pikaemotion_pikapic $8 + db $ff + +PikachuEmotion5_fd14d: ; fd14d (3f:514d) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry31 + pikaemotion_pikapic $5 + db $ff + +PikachuEmotion6_fd153: ; fd153 (3f:5153) + pikaemotion_dummy2 + pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES + pikaemotion_pcm + pikaemotion_movement Pointer_fd21e + pikaemotion_emotebubble SKULL_BUBBLE + pikaemotion_pikapic $6 + db $ff + +PikachuEmotion3_fd160: ; fd160 (3f:5160) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry40 + pikaemotion_pikapic $3 + db $ff + +PikachuEmotion9_fd166: ; fd166 (3f:5166) + pikaemotion_dummy2 + pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES + pikaemotion_pcm PikachuCry6 + pikaemotion_movement Pointer_fd218 + pikaemotion_emotebubble SKULL_BUBBLE + pikaemotion_pikapic $9 + db $ff + +PikachuEmotion11_fd173: ; fd173 (3f:5173) + pikaemotion_emotebubble ZZZ_BUBBLE + pikaemotion_pcm PikachuCry37 + pikaemotion_pikapic $b + db $ff + +PikachuEmotion12_fd17a: ; fd17a (3f:517a) + pikaemotion_dummy2 + pikaemotion_pcm + pikaemotion_pikapic $c + db $ff + +PikachuEmotion13_fd180: ; fd180 (3f:5180) + pikaemotion_dummy2 + pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES + pikaemotion_movement Pointer_fd21e + pikaemotion_pikapic $d + db $ff + +PikachuEmotion14_fd189: ; fd189 (3f:5189) + pikaemotion_dummy2 + pikaemotion_emotebubble BOLT_BUBBLE + pikaemotion_pcm PikachuCry10 + pikaemotion_pikapic $e + db $ff + +PikachuEmotion15_fd191: ; fd191 (3f:5191) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry34 + pikaemotion_pikapic $f + db $ff + +PikachuEmotion16_fd197: ; fd197 (3f:5197) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry33 + pikaemotion_pikapic $10 + db $ff + +PikachuEmotion17_fd19d: ; fd19d (3f:519d) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry13 + pikaemotion_pikapic $11 + db $ff + +PikachuEmotion18_fd1a3: ; fd1a3 (3f:51a3) + pikaemotion_dummy2 + pikaemotion_pcm + pikaemotion_pikapic $12 + db $ff + +PikachuEmotion19_fd1a9: ; fd1a9 (3f:51a9) + pikaemotion_dummy2 + pikaemotion_emotebubble HEART_BUBBLE + pikaemotion_pcm PikachuCry33 + pikaemotion_pikapic $13 + db $ff + +PikachuEmotion20_fd1b1: ; fd1b1 (3f:51b1) + pikaemotion_dummy2 + pikaemotion_emotebubble HEART_BUBBLE + pikaemotion_pcm PikachuCry5 + pikaemotion_pikapic $14 + db $ff + +PikachuEmotion21_fd1b9: ; fd1b9 (3f:51b9) + pikaemotion_dummy2 + pikaemotion_emotebubble FISH_BUBBLE + pikaemotion_pcm + pikaemotion_pikapic $15 + db $ff + +PikachuEmotion22_fd1c1: ; fd1c1 (3f:51c1) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry4 + pikaemotion_pikapic $16 + db $ff + +PikachuEmotion23_fd1c7: ; fd1c7 (3f:51c7) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry19 + pikaemotion_pikapic $17 + pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW + db $ff + +PikachuEmotion24_fd1cf: ; fd1cf (3f:51cf) + pikaemotion_dummy2 + pikaemotion_emotebubble EXCLAMATION_BUBBLE + pikaemotion_pcm + pikaemotion_pikapic $18 + db $ff + +PikachuEmotion25_fd1d7: ; fd1d7 (3f:51d7) + pikaemotion_dummy2 + pikaemotion_emotebubble BOLT_BUBBLE + pikaemotion_pcm PikachuCry35 + pikaemotion_pikapic $19 + db $ff + +PikachuEmotion26_fd1df: ; fd1df (3f:51df) + pikaemotion_dummy2 + pikaemotion_emotebubble ZZZ_BUBBLE + pikaemotion_pcm PikachuCry37 + pikaemotion_pikapic $1a + pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW + pikaemotion_subcmd PIKAEMOTION_SUBCMD_CHECKPEWTERCENTER + db $ff + +PikachuEmotion27_fd1eb: ; fd1eb (3f:51eb) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry9 + pikaemotion_pikapic $1b + db $ff + +PikachuEmotion28_fd1f1: ; fd1f1 (3f:51f1) + pikaemotion_dummy2 + pikaemotion_pcm PikachuCry15 + pikaemotion_pikapic $1c + db $ff + +PikachuEmotion29_fd1f7: ; fd1f7 (3f:51f7) + pikaemotion_pcm PikachuCry5 + pikaemotion_pikapic $a + db $ff + +PikachuEmotion30_fd1fc: ; fd1fc (3f:51fc) + pikaemotion_9 + pikaemotion_emotebubble HEART_BUBBLE + pikaemotion_pcm PikachuCry5 + pikaemotion_pikapic $14 + pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW + pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADFONT + pikaemotion_subcmd PIKAEMOTION_SUBCMD_CHECKLAVENDERTOWER + db $ff + +PikachuEmotion31_fd20a: ; fd20a (3f:520a) + pikaemotion_pcm PikachuCry19 + pikaemotion_pikapic $17 + pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW + pikaemotion_subcmd PIKAEMOTION_SUBCMD_CHECKBILLSHOUSE + db $ff + +PikachuEmotion32_fd213: ; fd213 (3f:5213) + pikaemotion_pcm PikachuCry26 + pikaemotion_pikapic $17 + db $ff + +Pointer_fd218: ; fd218 (3f:5218) + db $00 + db $39, $01 + db $3e, $1e + db $3f + +Pointer_fd21e: ; fd21e (3f:521e) + db $00 + db $39, $00 + db $3e, $1e + db $3f + +Pointer_fd224: ; fd224 (3f:5224) + db $00 + db $3c, $07, $2f + db $3c, $07, $2f + db $3f + +Pointer_fd22c: ; fd22c (3f:522c) + db $3b, $1f, $03 + db $3f + +Pointer_fd230: ; fd230 (3f:5230) + db $00 + db $3c, $0f, $1f + db $3c, $0f, $1f + db $3f + +Pointer_fd238: ; fd238 (3f:5238) + db $00 + db $05, $07 + db $39, $00 + db $05, $07 + db $06, $07 + db $39, $00 + db $06, $07 + db $08, $07 + db $39, $00 + db $08, $07 + db $07, $07 + db $39, $00 + db $07, $07 + db $3f diff --git a/data/pikachu_pic_animation.asm b/data/pikachu_pic_animation.asm new file mode 100755 index 00000000..f1f6bd68 --- /dev/null +++ b/data/pikachu_pic_animation.asm @@ -0,0 +1,397 @@ +Data_fe242: + db 4, %11000000 + db 4, %11100100 + db 4, %11000000 + db 4, %11100100 + db 4, %11000000 + db 4, %11100100 + db 4, %11000000 + db 4, %11100100 + db 4, %11000000 + db 4, %11100100 + db 4, %11000000 + db 4, %11100100 + db 4, %11000000 + db 4, %11100100 + db 4, %11000000 + db 4, %11100100 + db 4, %11000000 + db 4, %11100100 + db 4, %11000000 + db 4, %11100100 + db $ff + +Data_fe26b: ; fe26b (3f:626b) + pikapic_loadgfx Pic_e4000 + pikapic_loadgfx Pic_e49d1 + pikapic_loadgfx PikachuSprite + pikapic_object $1, $80, $0, $0 + pikapic_object $2, $b2, $5, $5 + pikapic_object $3, $b6, $5, $5 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe28a: ; fe28a (3f:628a) + pikapic_setduration 40 + pikapic_loadgfx Pic_e4000 + pikapic_loadgfx GFX_e40cc + pikapic_object $4, $80, $0, $0 + pikapic_object $6, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry PikachuCry3 + pikapic_looptofinish + +Data_fe2a4: ; fe2a4 (3f:62a4) + pikapic_setduration 44 + pikapic_loadgfx Pic_e411c + pikapic_loadgfx GFX_e41d2 + pikapic_object $4, $80, $0, $0 + pikapic_object $7, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe2be: ; fe2be (3f:62be) + pikapic_setduration 80 + pikapic_loadgfx Pic_e4272 + pikapic_loadgfx GFX_e4323 + pikapic_object $4, $80, $0, $0 + pikapic_object $8, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe2d8: ; fe2d8 (3f:62d8) + pikapic_setduration 70 + pikapic_loadgfx Pic_e4383 + pikapic_loadgfx GFX_e444b + pikapic_object $4, $80, $0, $0 + pikapic_object $9, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe2f2: ; fe2f2 (3f:62f2) + pikapic_setduration 32 + pikapic_loadgfx Pic_e458b + pikapic_loadgfx GFX_e463b + pikapic_object $4, $80, $0, $0 + pikapic_object $a, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe30c: ; fe30c (3f:630c) + pikapic_setduration 50 + pikapic_loadgfx Pic_e467b + pikapic_loadgfx GFX_e472e + pikapic_object $4, $80, $0, $0 + pikapic_object $b, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry PikachuCry38 + pikapic_looptofinish + +Data_fe326: ; fe326 (3f:6326) + pikapic_setduration 58 + pikapic_loadgfx Pic_e476e + pikapic_loadgfx GFX_e4841 + pikapic_object $4, $80, $0, $0 + pikapic_object $c, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe340: ; fe340 (3f:6340) + pikapic_setduration 44 + pikapic_loadgfx Pic_e49d1 + pikapic_loadgfx GFX_e4a99 + pikapic_object $4, $80, $0, $0 + pikapic_object $d, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe35a: ; fe35a (3f:635a) + pikapic_setduration 56 + pikapic_loadgfx Pic_e4b39 + pikapic_loadgfx GFX_e4bde + pikapic_object $4, $80, $0, $0 + pikapic_object $e, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe374: ; fe374 (3f:6374) + pikapic_setduration 56 + pikapic_loadgfx Pic_e4c3e + pikapic_loadgfx GFX_e4ce0 + pikapic_loadgfx GFX_e4e70 + pikapic_object $4, $80, $0, $0 + pikapic_object $10, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe390: ; fe390 (3f:6390) + pikapic_setduration 100 + pikapic_loadgfx Pic_e5000 + pikapic_loadgfx GFX_e50af + pikapic_object $4, $80, $0, $0 + pikapic_object $11, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe3aa: ; fe3aa (3f:63aa) + pikapic_setduration 50 + pikapic_loadgfx Pic_e523f + pikapic_loadgfx GFX_e52fe + pikapic_object $4, $80, $0, $0 + pikapic_object $12, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry PikachuCry25 + pikapic_looptofinish + +Data_fe3c4: ; fe3c4 (3f:63c4) + pikapic_setduration 50 + pikapic_loadgfx Pic_e548e + pikapic_loadgfx GFX_e5541 + pikapic_object $4, $80, $0, $0 + pikapic_object $13, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe3de: ; fe3de (3f:63de) + pikapic_setduration 40 + pikapic_loadgfx Pic_e56d1 + pikapic_loadgfx GFX_e5794 + pikapic_object $4, $80, $0, $0 + pikapic_object $14, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe3f8: ; fe3f8 (3f:63f8) + pikapic_setduration 50 + pikapic_loadgfx Pic_e5924 + pikapic_loadgfx GFX_e59ed + pikapic_object $4, $80, $0, $0 + pikapic_object $15, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe412: ; fe412 (3f:6412) + pikapic_setduration 32 + pikapic_loadgfx Pic_e5b7d + pikapic_loadgfx GFX_e5c4d + pikapic_object $4, $80, $0, $0 + pikapic_object $16, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe42c: ; fe42c (3f:642c) + pikapic_setduration 100 + pikapic_loadgfx Pic_e5ddd + pikapic_loadgfx GFX_e5e90 + pikapic_object $4, $80, $0, $0 + pikapic_object $17, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe446: ; fe446 (3f:6446) + pikapic_setduration 32 + pikapic_loadgfx GFX_e6020 + pikapic_loadgfx GFX_e61b0 + pikapic_object $5, $80, $0, $0 + pikapic_object $18, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry PikachuCry18 + pikapic_looptofinish + +Data_fe460: ; fe460 (3f:6460) + pikapic_setduration 44 + pikapic_loadgfx Pic_e6340 + pikapic_loadgfx GFX_e63f7 + pikapic_object $4, $80, $0, $0 + pikapic_object $19, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe47a: ; fe47a (3f:647a) + pikapic_setduration 50 + pikapic_loadgfx Pic_e6587 + pikapic_loadgfx GFX_e6646 + pikapic_object $4, $80, $0, $0 + pikapic_object $1a, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe494: ; fe494 (3f:6494) + pikapic_setduration 40 + pikapic_loadgfx Pic_e67d6 + pikapic_loadgfx GFX_e682f + pikapic_loadgfx GFX_e69bf + pikapic_loadgfx GFX_e6b4f + pikapic_loadgfx GFX_e6cdf + pikapic_object $4, $80, $0, $0 + pikapic_object $1b, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry PikachuCry20 + pikapic_looptofinish + +Data_fe4b4: ; fe4b4 (3f:64b4) + pikapic_setduration 40 + pikapic_loadgfx GFX_e6e6f + pikapic_loadgfx GFX_e6fff + pikapic_object $5, $80, $0, $0 + pikapic_object $1c, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe4ce: ; fe4ce (3f:64ce) + pikapic_setduration 70 + pikapic_loadgfx GFX_e718f + pikapic_loadgfx GFX_e731f + pikapic_object $5, $80, $0, $0 + pikapic_object $1d, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe4e8: ; fe4e8 (3f:64e8) + pikapic_setduration 60 + pikapic_loadgfx GFX_e74af + pikapic_loadgfx GFX_e763f + pikapic_object $5, $80, $0, $0 + pikapic_object $1e, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe502: ; fe502 (3f:6502) + pikapic_setduration 50 + pikapic_loadgfx Pic_e77cf + pikapic_loadgfx GFX_e7863 + pikapic_loadgfx GFX_e79f3 + pikapic_object $4, $80, $0, $0 + pikapic_object $1f, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_writebyte 13 + pikapic_waitbgmap + pikapic_thunderbolt + pikapic_ret + +Data_fe51f: ; fe51f (3f:651f) + pikapic_waitbgmap + +Data_fe520: ; fe520 (3f:6520) + pikapic_setduration 100 + pikapic_loadgfx Pic_e5000 + pikapic_loadgfx GFX_e50af + pikapic_loadgfx GFX_e7b83 + pikapic_loadgfx GFX_e7d13 + pikapic_object $4, $80, $0, $0 + pikapic_object $20, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe53e: ; fe53e (3f:653e) + pikapic_setduration 30 + pikapic_loadgfx Pic_f0abf + pikapic_loadgfx GFX_f0b64 + pikapic_object $4, $80, $0, $0 + pikapic_object $21, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +Data_fe558: ; fe558 (3f:6558) + pikapic_setduration 64 + pikapic_loadgfx Pic_f0cf4 + pikapic_loadgfx GFX_f0d82 + pikapic_object $4, $80, $0, $0 + pikapic_object $22, $99, $0, $0 + pikapic_waitbgmap + pikapic_cry + pikapic_looptofinish + +PikaPicAnimGFXHeaders: +pikapicanimgfx: MACRO +\2_id:: + db \1 ; size + dba \2 ; pointer + endm + + dbbw 1, $39,$0000 ; 00 + pikapicanimgfx -1, Pic_e4000 ; 01 + pikapicanimgfx 5, GFX_e40cc ; 02 + pikapicanimgfx -1, Pic_e411c ; 03 + pikapicanimgfx 10, GFX_e41d2 ; 04 + pikapicanimgfx -1, Pic_e4272 ; 05 + pikapicanimgfx 6, GFX_e4323 ; 06 + pikapicanimgfx -1, Pic_e4383 ; 07 + pikapicanimgfx 20, GFX_e444b ; 08 + pikapicanimgfx -1, Pic_e458b ; 09 + pikapicanimgfx 4, GFX_e463b ; 0a + pikapicanimgfx -1, Pic_e467b ; 0b + pikapicanimgfx 4, GFX_e472e ; 0c + pikapicanimgfx -1, Pic_e476e ; 0d + pikapicanimgfx 25, GFX_e4841 ; 0e + pikapicanimgfx -1, Pic_e49d1 ; 0f + pikapicanimgfx 10, GFX_e4a99 ; 00 + pikapicanimgfx -1, Pic_e4b39 ; 11 + pikapicanimgfx 6, GFX_e4bde ; 12 + pikapicanimgfx -1, Pic_e4c3e ; 13 + pikapicanimgfx 25, GFX_e4ce0 ; 14 + pikapicanimgfx 25, GFX_e4e70 ; 15 + pikapicanimgfx -1, Pic_e5000 ; 16 + pikapicanimgfx 25, GFX_e50af ; 17 + pikapicanimgfx -1, Pic_e523f ; 18 + pikapicanimgfx 25, GFX_e52fe ; 19 + pikapicanimgfx -1, Pic_e548e ; 1a + pikapicanimgfx 25, GFX_e5541 ; 1b + pikapicanimgfx -1, Pic_e56d1 ; 1c + pikapicanimgfx 25, GFX_e5794 ; 1d + pikapicanimgfx -1, Pic_e5924 ; 1e + pikapicanimgfx 25, GFX_e59ed ; 1f + pikapicanimgfx -1, Pic_e5b7d ; 20 + pikapicanimgfx 25, GFX_e5c4d ; 21 + pikapicanimgfx -1, Pic_e5ddd ; 22 + pikapicanimgfx 25, GFX_e5e90 ; 23 + pikapicanimgfx 25, GFX_e6020 ; 24 + pikapicanimgfx 25, GFX_e61b0 ; 25 + pikapicanimgfx -1, Pic_e6340 ; 26 + pikapicanimgfx 25, GFX_e63f7 ; 27 + pikapicanimgfx -1, Pic_e6587 ; 28 + pikapicanimgfx 25, GFX_e6646 ; 29 + pikapicanimgfx -1, Pic_e67d6 ; 2a + pikapicanimgfx 25, GFX_e682f ; 2b + pikapicanimgfx 25, GFX_e69bf ; 2c + pikapicanimgfx 25, GFX_e6b4f ; 2d + pikapicanimgfx 25, GFX_e6cdf ; 2e + pikapicanimgfx 25, GFX_e6e6f ; 2f + pikapicanimgfx 25, GFX_e6fff ; 30 + pikapicanimgfx 25, GFX_e718f ; 31 + pikapicanimgfx 25, GFX_e731f ; 32 + pikapicanimgfx 25, GFX_e74af ; 33 + pikapicanimgfx 25, GFX_e763f ; 34 + pikapicanimgfx -1, Pic_e77cf ; 35 + pikapicanimgfx 25, GFX_e7863 ; 36 + pikapicanimgfx 25, GFX_e79f3 ; 37 + pikapicanimgfx 25, GFX_e7b83 ; 38 + pikapicanimgfx 25, GFX_e7d13 ; 39 + pikapicanimgfx -1, Pic_f0abf ; 3a + pikapicanimgfx 25, GFX_f0b64 ; 3b + pikapicanimgfx -1, Pic_f0cf4 ; 3c + pikapicanimgfx 25, GFX_f0d82 ; 3d + pikapicanimgfx 24, PikachuSprite ; 3e diff --git a/engine/bank3c.asm b/engine/bank3c.asm index 81b03374..1f3c967f 100644 --- a/engine/bank3c.asm +++ b/engine/bank3c.asm @@ -1,158 +1,4 @@ -PlayPikachuSoundClip:: ; f0000 (3c:4000) - ld a, e - ld e, a - ld d, $0 - ld hl, PikachuCriesPointerTable - add hl, de - add hl, de - add hl, de - ld b, [hl] ; bank of pikachu cry data - inc hl - ld a, [hli] ; cry data pointer - ld h, [hl] - ld l, a - ld c, $4 -.loop - dec c - jr z, .done_delay - call DelayFrame - jr .loop - -.done_delay - di - push bc - push hl - ld a, $80 - ld [rNR52], a - ld a, $77 - ld [rNR50], a - xor a - ld [rNR30], a - ld hl, $ff30 ; wave data - ld de, wRedrawRowOrColumnSrcTiles -.saveWaveDataLoop - ld a, [hl] - ld [de], a - inc de - ld a, $ff - ld [hli], a - ld a, l - cp $40 ; end of wave data - jr nz, .saveWaveDataLoop - ld a, $80 - ld [rNR30], a - ld a, [rNR51] - or $44 - ld [rNR51], a - ld a, $ff - ld [rNR31], a - ld a, $20 - ld [rNR32], a - ld a, $ff - ld [rNR33], a - ld a, $87 - ld [rNR34], a - pop hl - pop bc - call PlayPikachuPCM - xor a - ld [wc0f3], a - ld [wc0f4], a - ld a, $80 - ld [rNR52], a - xor a - ld [rNR30], a - ld hl, $ff30 - ld de, wRedrawRowOrColumnSrcTiles -.reloadWaveDataLoop - ld a, [de] - inc de - ld [hli], a - ld a, l - cp $40 ; end of wave data - jr nz, .reloadWaveDataLoop - ld a, $80 - ld [rNR30], a - ld a, [rNR51] - and $bb - ld [rNR51], a - xor a - ld [wChannelSoundIDs+CH4], a - ld [wChannelSoundIDs+CH5], a - ld [wChannelSoundIDs+CH6], a - ld [wChannelSoundIDs+CH7], a - ld a, [H_LOADEDROMBANK] - ei - ret - -PikachuCriesPointerTable: ; f008e (3c:408e) -; format: -; db bank -; dw pointer to cry - -; bank 21 - pikacry_def PikachuCry1 ; 21:4000 - pikacry_def PikachuCry2 ; 21:491a - pikacry_def PikachuCry3 ; 21:4fdc - pikacry_def PikachuCry4 ; 21:59ee - -; bank 22 - pikacry_def PikachuCry5 ; 22:4000 - pikacry_def PikachuCry6 ; 22:5042 - pikacry_def PikachuCry7 ; 22:6254 - -; bank 23 - pikacry_def PikachuCry8 ; 23:4000 - pikacry_def PikachuCry9 ; 23:50ca - pikacry_def PikachuCry10 ; 23:5e0c - -; bank 24 - pikacry_def PikachuCry11 ; 24:4000 - pikacry_def PikachuCry12 ; 24:4722 - pikacry_def PikachuCry13 ; 24:54a4 - -; bank 25 - pikacry_def PikachuCry14 ; 25:4000 - pikacry_def PikachuCry15 ; 25:589a - -; banks 31-34, in no particular order - - pikacry_def PikachuCry16 ; 31:4000 - pikacry_def PikachuCry17 ; 34:4000 - pikacry_def PikachuCry18 ; 31:549a - pikacry_def PikachuCry19 ; 33:4000 - pikacry_def PikachuCry20 ; 32:4000 - pikacry_def PikachuCry21 ; 32:6002 - pikacry_def PikachuCry22 ; 31:63a4 - pikacry_def PikachuCry23 ; 34:4862 - pikacry_def PikachuCry24 ; 33:5632 - pikacry_def PikachuCry25 ; 34:573c - pikacry_def PikachuCry26 ; 33:725c - -; bank 35 - pikacry_def PikachuCry27 ; 35:4000 - pikacry_def PikachuCry28 ; 35:4b5a - pikacry_def PikachuCry29 ; 35:5da4 - pikacry_def PikachuCry30 ; 35:69ce - pikacry_def PikachuCry31 ; 35:6e80 - -; bank 36 - pikacry_def PikachuCry32 ; 36:4000 - pikacry_def PikachuCry33 ; 36:458a - pikacry_def PikachuCry34 ; 36:523c - -; bank 37 - pikacry_def PikachuCry35 ; 37:4000 - pikacry_def PikachuCry36 ; 37:522a - -; banks 36-38 - pikacry_def PikachuCry37 ; 38:4000 - pikacry_def PikachuCry38 ; 38:4dfa - pikacry_def PikachuCry39 ; 37:6e0c - pikacry_def PikachuCry40 ; 38:5a64 - pikacry_def PikachuCry41 ; 36:6746 - pikacry_def PikachuCry42 ; 38:6976 - +INCLUDE "engine/pikachu_pcm.asm" INCLUDE "engine/overworld/advance_player_sprite.asm" ResetStatusAndHalveMoneyOnBlackout:: ; f0274 (3c:4274) @@ -169,30 +15,30 @@ ResetStatusAndHalveMoneyOnBlackout:: ; f0274 (3c:4274) ld [wNPCMovementScriptPointerTableNum], a ld [wFlags_0xcd60], a - ld [$ff9f], a - ld [$ff9f + 1], a - ld [$ff9f + 2], a + ld [hMoney], a + ld [hMoney + 1], a + ld [hMoney + 2], a call HasEnoughMoney jr c, .lostmoney ; never happens ; Halve the player's money. ld a, [wPlayerMoney] - ld [$ff9f], a + ld [hMoney], a ld a, [wPlayerMoney + 1] - ld [$ff9f + 1], a + ld [hMoney + 1], a ld a, [wPlayerMoney + 2] - ld [$ff9f + 2], a + ld [hMoney + 2], a xor a - ld [$ffa2], a - ld [$ffa3], a + ld [hDivideBCDDivisor], a + ld [hDivideBCDDivisor + 1], a ld a, 2 - ld [$ffa4], a + ld [hDivideBCDDivisor + 2], a predef DivideBCDPredef3 - ld a, [$ffa2] + ld a, [hDivideBCDQuotient] ld [wPlayerMoney], a - ld a, [$ffa2 + 1] + ld a, [hDivideBCDQuotient + 1] ld [wPlayerMoney + 1], a - ld a, [$ffa2 + 2] + ld a, [hDivideBCDQuotient + 2] ld [wPlayerMoney + 2], a .lostmoney @@ -217,10 +63,12 @@ Func_f02da:: ; f02da (3c:42da) cp a, $ff jr nz, .asm_f02e5 ret + .asm_f02ee ld hl, wCurrentMapScriptFlags set 6, [hl] ret + .asm_f02f4 ld hl, wCurrentMapScriptFlags set 5, [hl] @@ -264,6 +112,7 @@ Func_f0a54:: ; f0a54 (3c:4a54) ret Func_f0a55:: ; f0a55 (3c:4a55) +; referenced in an unused function ld hl, Pointer_f0a76 ; 3c:4a76 .loop ld a, [hli] @@ -281,7 +130,7 @@ Func_f0a55:: ; f0a55 (3c:4a55) .asm_f0a68 ld a, [hli] ld c, a - ld b, $0 + ld b, 0 ld a, [hli] ld h, [hl] ld l, a @@ -290,10 +139,17 @@ Func_f0a55:: ; f0a55 (3c:4a55) ret Pointer_f0a76:: ; f0a76 (3c:4a76) - db $27, $07, $7b, $4a, $ff - db $01, $ec, $02, $ed, $03, $ee, $ff + dbbw BLUES_HOUSE, Pointer_f0a7bEnd - Pointer_f0a7b, Pointer_f0a7b + db $ff + +Pointer_f0a7b: + db 1, HS_DAISY_SITTING_COPY + db 2, HS_DAISY_WALKING_COPY + db 3, HS_TOWN_MAP_COPY + db $ff +Pointer_f0a7bEnd: -Func_f0a82: ; f0a82 +TryApplyPikachuMovementData: ; f0a82 ld a, [wd472] bit 7, a ret z @@ -317,8 +173,8 @@ Func_f0a82: ; f0a82 pop af ld [wUpdateSpritesEnabled], a pop hl - call Func_159b ; homecall Func_fd2a1 - pikachu movement script? - callab Func_fcba1 + call ApplyPikachuMovementData + callab RefreshPikachuFollow ret Pic_f0abf: ; f0abf (3c:4abf) @@ -357,7 +213,7 @@ INCLUDE "scripts/pewterpokecenter2.asm" Func_f1e22: ld hl, PikachuMovementData_f1e2b ld b, SPRITE_FACING_RIGHT - call Func_f0a82 + call TryApplyPikachuMovementData ret PikachuMovementData_f1e2b: @@ -374,7 +230,7 @@ INCLUDE "scripts/celadonmansion3_2.asm" Func_f1f23: ld hl, PikachuMovementData_f1f2c ld b, SPRITE_FACING_DOWN - call Func_f0a82 + call TryApplyPikachuMovementData ret PikachuMovementData_f1f2c: @@ -436,10 +292,10 @@ Func_f2cee: Func_f2cf4: ; should return to a, instead returns to b call Random swap a - cp $55 + cp 1 * $ff / 3 ld b, 0 ret c - cp $aa + cp 2 * $ff / 3 ld b, 1 ret c ld b, 2 @@ -451,7 +307,7 @@ Func_f2d06: ret Func_f2d0c: - ld hl, GymTrashCans3a + ld hl, GymTrashCans3c ld a, [wGymTrashCanIndex] ld c, a ld b, 0 @@ -472,7 +328,7 @@ Func_f2d0c: ld [wSecondLockTrashCanIndex + 1], a ret -GymTrashCans3a: ; f2d31 (3c:6d31) +GymTrashCans3c: ; f2d31 (3c:6d31) ; First byte: number of trashcan entries ; Following four byte pairs: indices for the second trash can. ; BUG: Rows that have 3 trashcan entries are sampled incorrectly. diff --git a/engine/bank3d.asm b/engine/bank3d.asm index aac3ddce..fbf816b6 100644 --- a/engine/bank3d.asm +++ b/engine/bank3d.asm @@ -3,49 +3,49 @@ INCLUDE "engine/battle/link_battle_versus_text.asm" INCLUDE "engine/battle/unused_stats_functions.asm" INCLUDE "engine/battle/scroll_draw_trainer_pic.asm" -Func_f429f:: ; f429f (3d:429f) +StarterPikachuBattleEntranceAnimation: ; f429f (3d:429f) coord hl, 0, 5 - ld c, $0 -.asm_f42a4 + ld c, 0 +.loop1 inc c ld a, c - cp $9 + cp 9 ret z - ld d, $5b + ld d, 7 * 13 push bc push hl -.asm_f42ad - call Func_f42c2 +.loop2 + call .PlaceColumn dec hl ld a, d - sub $7 + sub 7 ld d, a dec c - jr nz, .asm_f42ad - ld c, $2 + jr nz, .loop2 + ld c, 2 call DelayFrames pop hl pop bc inc hl - jr .asm_f42a4 + jr .loop1 -Func_f42c2:: ; f42c2 (3d:f42c2) +.PlaceColumn: ; f42c2 (3d:f42c2) push hl push de push bc - ld e, $7 -.loop + ld e, 7 +.loop3 ld a, d - cp $31 - jr nc, .asm_f42ce + cp 7 * 7 + jr nc, .okay ld a, $7f -.asm_f42ce +.okay ld [hl], a - ld bc, $14 + ld bc, SCREEN_WIDTH add hl, bc inc d dec e - jr nz, .loop + jr nz, .loop3 pop bc pop de pop hl @@ -172,56 +172,56 @@ PikachuMoods: ; f43a6 (3d:43a6) db $6c ; Unknown (d = 10) db $00 ; Unknown (d = 11) -RedPicBack:: INCBIN "pic/trainer/redb.pic" -OldManPic:: INCBIN "pic/trainer/oldman.pic" -ProfOakPicBack:: INCBIN "pic/ytrainer/prof.oakb.pic" +RedPicBack: INCBIN "pic/trainer/redb.pic" +OldManPic: INCBIN "pic/trainer/oldman.pic" +ProfOakPicBack: INCBIN "pic/ytrainer/prof.oakb.pic" -Func_f453f:: ; f453f (3d:453f) +LoadYellowTitleScreenGFX: ; f453f (3d:453f) ld hl, PokemonLogoGraphics ld de, vChars2 - ld bc, $730 + ld bc, 115 * $10 ld a, BANK(PokemonLogoGraphics) ; redundant because this function is in bank3d call FarCopyData - ld hl, YellowLogoGraphics+$230 - ld de, vChars0+$fd0 - ld bc, $30 + ld hl, YellowLogoGraphics + 35 * $10 + ld de, vChars0 + 253 * $10 + ld bc, 3 * $10 ld a, BANK(YellowLogoGraphics) call FarCopyData - ld hl, YellowLogoGraphics+$260 + ld hl, YellowLogoGraphics + 38 * $10 ld de, vChars1 - ld bc, $400 + ld bc, 64 * $10 ld a, BANK(YellowLogoGraphics) call FarCopyData - ld hl, YellowLogoGraphics+$660 - ld de, vChars0+$f00 - ld bc, $c0 + ld hl, YellowLogoGraphics + 102 * $10 + ld de, vChars0 + 240 * $10 + ld bc, 12 * $10 ld a, BANK(YellowLogoGraphics) call FarCopyData ret -Func_f4578:: ; f4578 (3d:4578) +TitleScreen_PlacePokemonLogo: ; f4578 (3d:4578) coord hl, 2, 1 - ld de, Pointer_f45f9 - ld bc, 7 << 8 | 16 ; 16x7 (xy) - call CopyScreenArea + ld de, TitleScreenPokemonLogoTilemap + lb bc, 7, 16 + call Bank3D_CopyBox ret -Func_f4585:: ; f4585 (3d:4585) +TitleScreen_PlacePikaSpeechBubble: ; f4585 (3d:4585) coord hl, 6, 4 - ld de, Pointer_f4673 - ld bc, 4 << 8 | 7 ; 7x4 (xy) - call CopyScreenArea + ld de, TitleScreenPikaBubbleTilemap + lb bc, 4, 7 + call Bank3D_CopyBox coord hl, 9, 8 ld [hl], $64 inc hl ld [hl], $65 ret -Func_f459a:: ; f459a (3d:459a) +TitleScreen_PlacePikachu: ; f459a (3d:459a) coord hl, 4, 8 - ld de, Pointer_f468f - ld bc, 9 << 8 | 12 ; 12x9 (xy) - call CopyScreenArea + ld de, TitleScreenPikachuTilemap + lb bc, 9, 12 + call Bank3D_CopyBox coord hl, 16, 10 ld [hl], $96 coord hl, 16, 11 @@ -230,13 +230,13 @@ Func_f459a:: ; f459a (3d:459a) ld [hl], $a7 coord hl, 16, 13 ld [hl], $b1 - ld hl, Pointer_f45c7 + ld hl, TitleScreenPikachuEyesOAMData ld de, wOAMBuffer ld bc, $20 call CopyData ret -Pointer_f45c7: ; f45c7 (3d:45c7) +TitleScreenPikachuEyesOAMData: ; f45c7 (3d:45c7) db $60, $40, $f1, $22 db $60, $48, $f0, $22 db $68, $40, $f3, $22 @@ -246,25 +246,26 @@ Pointer_f45c7: ; f45c7 (3d:45c7) db $68, $60, $f2, $02 db $68, $68, $f3, $02 -CopyScreenArea:: ; f45e7 (3d:45e7) +Bank3D_CopyBox: ; f45e7 (3d:45e7) ; copy cxb (xy) screen area from de to hl +.row push bc push hl -.loop +.col ld a, [de] inc de ld [hli], a dec c - jr nz, .loop + jr nz, .col pop hl - ld bc, $14 + ld bc, SCREEN_WIDTH add hl, bc pop bc dec b - jr nz, CopyScreenArea + jr nz, .row ret -Pointer_f45f9: ; f45f9 (3d:45f9) +TitleScreenPokemonLogoTilemap: ; f45f9 (3d:45f9) ; 16x7 (xy) db $f4, $f4, $f4, $f4, $f4, $f4, $49, $f4, $72, $30, $f4, $f4, $f4, $f4, $f4, $f4 db $fd, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $f4, $0d, $0e, $0f @@ -274,17 +275,18 @@ Pointer_f45f9: ; f45f9 (3d:45f9) db $f4, $41, $42, $43, $44, $45, $46, $47, $48, $f4, $4a, $4b, $4c, $4d, $4e, $4f db $f4, $6a, $6b, $6c, $6d, $f4, $f4, $f4, $f4, $f4, $f4, $6e, $6f, $70, $71, $f4 -Pointer_f4669:: ; f4669 (3d:4669) +Pointer_f4669: ; f4669 (3d:4669) +; Unreferenced db $47, $48, $49, $4a, $4b, $4c, $4d, $4e, $4f, $5f -Pointer_f4673:: ; f4673 (3d:4673) +TitleScreenPikaBubbleTilemap: ; f4673 (3d:4673) ; 7x4 (xy) db $24, $25, $66, $67, $68, $69, $2a db $50, $51, $52, $53, $54, $55, $56 db $57, $58, $59, $5a, $5b, $5c, $5d db $6d, $5e, $5f, $60, $61, $62, $63 -Pointer_f468f:: ; f468f (3d:468f) +TitleScreenPikachuTilemap: ; f468f (3d:468f) ; 12x9 (xy) db $80, $81, $82, $83, $00, $00, $00, $00, $84, $85, $86, $87 db $88, $89, $8a, $8b, $8c, $8d, $8d, $8e, $8f, $8a, $90, $91 @@ -298,15 +300,17 @@ Pointer_f468f:: ; f468f (3d:468f) ; f46f9 (3d:46f9) PokemonLogoGraphics: INCBIN "gfx/pokemon_logo.2bpp" +PokemonLogoGraphicsEnd: YellowLogoGraphics: INCBIN "gfx/yellow_titlescreen.2bpp" +YellowLogoGraphicsEnd: INCLUDE "engine/menu/link_menu.asm" -HandleMenuInputDouble:: ; f5a40 (3d:5a40) +HandleMenuInputDouble: ; f5a40 (3d:5a40) xor a ld [wPartyMenuAnimMonEnabled], a -HandleMenuInputPokemonSelectionDouble:: ; f5a44 (3d:5a44) +HandleMenuInputPokemonSelectionDouble: ; f5a44 (3d:5a44) ld a, [H_DOWNARROWBLINKCNT1] push af ld a, [H_DOWNARROWBLINKCNT2] @@ -318,7 +322,7 @@ HandleMenuInputPokemonSelectionDouble:: ; f5a44 (3d:5a44) .loop1 xor a ld [wAnimCounter], a ; counter for pokemon shaking animation - call Func_f5ab0 + call .UpdateCursorTile call JoypadLowSensitivity ld a, [hJoy5] and a ; was a key pressed? @@ -376,7 +380,7 @@ HandleMenuInputPokemonSelectionDouble:: ; f5a44 (3d:5a44) ld a, [hJoy5] ret -Func_f5ab0:: ; f5ab0 (3d:5ab0) +.UpdateCursorTile: ; f5ab0 (3d:5ab0) ld a, [wTopMenuItemY] and a jr z, .asm_f5ac0 @@ -427,12 +431,12 @@ Func_f5ab0:: ; f5ab0 (3d:5ab0) ld a, l ld [wMenuCursorLocation], a ld a, h - ld [wMenuCursorLocation+1], a + ld [wMenuCursorLocation + 1], a ld a, [wCurrentMenuItem] ld [wLastMenuItem], a ret -PrintStrengthTxt:: ; f5b06 (3d:5b06) +PrintStrengthTxt: ; f5b06 (3d:5b06) ld hl, wd728 set 0, [hl] ld hl, Text_f5b17 @@ -440,7 +444,7 @@ PrintStrengthTxt:: ; f5b06 (3d:5b06) ld hl, Text_f5b28 jp PrintText -Text_f5b17:: ; f5b17 (3d:5b17) +Text_f5b17: ; f5b17 (3d:5b17) TX_FAR _UsedStrengthText ; 2d:417e TX_ASM ld a, [wcf91] @@ -448,11 +452,11 @@ Text_f5b17:: ; f5b17 (3d:5b17) call Delay3 jp TextScriptEnd -Text_f5b28:: ; f5b28 (3d:5b28) +Text_f5b28: ; f5b28 (3d:5b28) TX_FAR _CanMoveBouldersText ; 2d:4193 db "@" -IsSurfingAllowed: ; cdc0 (3:4dc0) +IsSurfingAllowed: ; f5b2d (3d:5b2d) ; Returns whether surfing is allowed in bit 1 of wd728. ; Surfing isn't allowed on the Cycling Road or in the lowest level of the ; Seafoam Islands before the current has been slowed with boulders. @@ -479,19 +483,19 @@ IsSurfingAllowed: ; cdc0 (3:4dc0) ld hl, CyclingIsFunText jp PrintText -CoordsData_f5b64:: ; f5b64 (3d:5b64) +CoordsData_f5b64: ; f5b64 (3d:5b64) db 11, 07 db $ff -CurrentTooFastText:: ; f5b67 (3d:5b67) +CurrentTooFastText: ; f5b67 (3d:5b67) TX_FAR _CurrentTooFastText ; 2d:41ab db "@" -CyclingIsFunText:: ; f5b6c (3d:5b6c) +CyclingIsFunText: ; f5b6c (3d:5b6c) TX_FAR _CyclingIsFunText ; 2d:41ca db "@" -AddItemToInventory_:: ; f5b70 (3d:5b70) +AddItemToInventory_: ; f5b70 (3d:5b70) ld a, [wItemQuantity] ; a = item quantity push af push bc @@ -643,7 +647,7 @@ BlankLeaderNames: INCBIN "gfx/blank_leader_names.2bpp" CircleTile: INCBIN "gfx/circle_tile.2bpp" BadgeNumbersTileGraphics: INCBIN "gfx/badge_numbers.2bpp" -ReadSuperRodData:: ; f5ea4 (3d:5ea4) +ReadSuperRodData: ; f5ea4 (3d:5ea4) ld a, [wCurMap] ld c, a ld hl, FishingSlots diff --git a/engine/bank3e.asm b/engine/bank3e.asm index f5b3c765..32f5ebfd 100644 --- a/engine/bank3e.asm +++ b/engine/bank3e.asm @@ -1,4498 +1,5 @@ -SurfingPikachuMinigame: - call SurfingPikachuMinigame_BlankPals - call DelayFrame - call DelayFrame - call DelayFrame - ld a, [hTilesetType] - push af - xor a - ld [hTilesetType], a - ld a, [wUpdateSpritesEnabled] - push af - ld a, $ff - ld [wUpdateSpritesEnabled], a - ld a, [rIE] - push af - xor a - ld [rIF], a - ld a, $f - ld [rIE], a - ld a, $8 - ld [rSTAT], a - ld a, [H_AUTOBGTRANSFERDEST + 1] - push af - ld a, $98 - ld [H_AUTOBGTRANSFERDEST + 1], a - call Func_f8fb3 - call Func_f807a - xor a - ld [rBGP], a - ld [rOBP0], a - ld [rOBP1], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - call ClearObjectAnimationBuffers - call ClearSprites - xor a - ld [hLCDCPointer], a - ld [hSCX], a - ld [hSCY], a - ld a, $90 - ld [hWY], a - call DelayFrame - pop af - ld [H_AUTOBGTRANSFERDEST + 1], a - xor a - ld [rIF], a - pop af - ld [rIE], a - xor a - ld [rSTAT], a - call RunDefaultPaletteCommand - call Func_0f16 - call PlayDefaultMusic - call GBPalNormal - pop af - ld [wUpdateSpritesEnabled], a - pop af - ld [hTilesetType], a - ret - -Func_f807a: - call Func_f8116 - call DelayFrame - ld b, $e - call RunPaletteCommand -.loop - ld a, [wc5d1] - bit 7, a - ret nz - call Func_f923f - call Func_f80ac - ret nz - call Func_f8282 - ld a, $3c - ld [wCurrentAnimatedObjectOAMBufferOffset], a - call RunObjectAnimations - call Func_f8848 - call Func_f80a8 - call Func_f80c4 - jr .loop - -Func_f80a8: - call DelayFrame - ret - -Func_f80ac: - ld hl, wPreventBlackout - bit 1, [hl] - ret z - ld a, [hJoyPressed] - and $4 - ret - -Func_f80b7: - ld a, [hJoyPressed] - and $8 - ret z - ld hl, wc5e2 - ld a, [hl] - xor $1 - ld [hl], a - ret - -Func_f80c4: - ld a, [wc634] - and a - ret z - ld hl, wChannelNoteDelayCounters - ld a, $1 - cp [hl] - ret nz - inc hl - cp [hl] - ret nz - inc hl - cp [hl] - ret nz - ld a, [wc5e3] - ld e, a - ld a, [wc5e3 + 1] - and $3 - ld d, a - sla e - rl d - ld e, d - ld d, $0 - ld hl, Unkn_f80f5 - add hl, de - add hl, de - ld a, [hli] - ld [wMusicTempo + 1], a - ld a, [hl] - ld [wMusicTempo], a - ret - -Unkn_f80f5: - dw $75 - dw $6d - dw $65 - dw $5d - dw $55 - -Func_f80ff: - ld hl, wChannelNoteDelayCounters - ld a, $1 - cp [hl] - ret nz - inc hl - cp [hl] - ret nz - inc hl - cp [hl] - ret nz - ld a, $75 - ld [wMusicTempo + 1], a - xor a - ld [wMusicTempo], a - ret - -Func_f8116: - call Func_f9279 - call ClearSprites - call DisableLCD - ld hl, wSerialEnemyMonsPatchList - ld bc, $67 - xor a - call FillMemory - ld hl, wc700 - ld bc, $200 - xor a - call FillMemory - xor a - ld [H_AUTOBGTRANSFERENABLED], a - call ClearObjectAnimationBuffers - - ld hl, SurfingPikachu1Graphics - ld de, $9000 - ld bc, $500 - ld a, BANK(SurfingPikachu1Graphics) - call FarCopyData - - ld hl, SurfingPikachu1Graphics + $410 - ld de, $8000 - ld bc, $1000 - ld a, BANK(SurfingPikachu1Graphics) - call FarCopyData - - ld a, Unkn_f93d3 % $100 - ld [wAnimatedObjectSpawnStateDataPointer], a - ld a, Unkn_f93d3 / $100 - ld [wAnimatedObjectSpawnStateDataPointer + 1], a - ld a, Jumptable_f93fa % $100 - ld [wAnimatedObjectJumptablePointer], a - ld a, Jumptable_f93fa / $100 - ld [wAnimatedObjectJumptablePointer + 1], a - ld a, Unkn_f9507 % $100 - ld [wAnimatedObjectOAMDataPointer], a - ld a, Unkn_f9507 / $100 - ld [wAnimatedObjectOAMDataPointer + 1], a - ld a, Unkn_f9405 % $100 - ld [wAnimatedObjectFramesDataPointer], a - ld a, Unkn_f9405 / $100 - ld [wAnimatedObjectFramesDataPointer + 1], a - ld hl, vBGMap0 - ld bc, $800 - ld a, $0 - call FillMemory - ld hl, $98c0 - ld bc, $180 - ld a, $b - call FillMemory - ld a, $1 - lb de, $74, $58 - call SpawnAnimatedObject - ld a, $74 - ld [wc5ea], a - call Func_f9223 - xor a - ld [hSCX], a - ld [hSCY], a - ld a, $7e - ld [hWY], a - ld a, $42 - ld [hLCDCPointer], a - ld a, $40 - ld [wc5e3], a - xor a - ld [wc5e3 + 1], a - xor a - ld [wc5d6], a - ld a, $60 - ld [wc5d7], a - ld hl, wc61a - ld bc, $14 - ld a, $74 - call FillMemory - call Func_f81ff - call Func_f8256 - ld a, $e3 - ld [rLCDC], a - call Func_f81e9 - ld a, $e4 - ld [rOBP0], a - ld a, $e0 - ld [rOBP1], a - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - ret - -Func_f81e9: - ld a, [wOnSGB] - and a - jr nz, .asm_f81f7 - ld a, $d0 - ld [rBGP], a - call UpdateGBCPal_BGP - ret - -.asm_f81f7 - ld a, $e4 - ld [rBGP], a - call UpdateGBCPal_BGP - ret - -Func_f81ff: - ld hl, wSpriteDataEnd - ld de, Unkn_f8249 - ld b, $97 - ld c, $80 - ld a, $4 - call Func_f8233 - ld de, Unkn_f8248 - ld b, $96 - ld c, $50 - ld a, $1 - call Func_f8233 - ld de, Unkn_f824d - ld b, $14 - ld c, $20 - ld a, $5 - call Func_f8233 - ld de, Unkn_f8252 - ld b, $20 - ld c, $80 - ld a, $4 - call Func_f8233 - ret - -Func_f8233: -.asm_f8233 - push af - ld [hl], b - inc hl - ld [hl], c - inc hl - ld a, [de] - ld [hl], a - inc hl - ld [hl], $0 - inc hl - ld a, c - add $8 - ld c, a - inc de - pop af - dec a - jr nz, .asm_f8233 - ret - -Unkn_f8248: - db $fe - -Unkn_f8249: - db $d0 - db $d0 - db $d0 - db $d0 - -Unkn_f824d: - db $ec - db $ed - db $ed - db $ee - db $ef - -Unkn_f8252: - db $ec - db $ed - db $ee - db $ef - -Func_f8256: - ld de, $9c21 - ld hl, Unkn_f8279 - ld c, $9 -.asm_f825e - ld a, [hli] - ld [de], a - inc de - dec c - jr nz, .asm_f825e - ld hl, $9c01 - ld [hl], $15 - ld hl, $9c02 - ld [hl], $16 - ld hl, $9c2c - ld [hl], $1b - ld hl, $9c2d - ld [hl], $1c - ret - -Unkn_f8279: - db $17 - db $18 - db $19 - db $19 - db $19 - db $19 - db $19 - db $19 - db $19 - -Func_f8282: - ld a, [wc5d1] - ld e, a - ld d, $0 - ld hl, Jumptable_f8291 - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] - -Jumptable_f8291: - dw Func_f82ab - dw Func_f82bd - dw Func_f8324 - dw Func_f835c - dw Func_f838c - dw Func_f8399 - dw Func_f83aa - dw Func_f83bb - dw Func_f83cc - dw Func_f83e3 - dw Func_f8406 - dw Func_f840f - dw Func_f841d - -Func_f82ab: - ld a, $2 - lb de, $48, $e0 - call SpawnAnimatedObject - ld hl, wc5d1 - inc [hl] - ld a, $1 - ld [wc634], a - ret - -Func_f82bd: - ld a, [wc5e5] - cp $18 - jr nc, .asm_f82e8 - ld hl, wc5d6 - ld a, [hli] - or [hl] - and a - jr z, .asm_f82f6 - call Random - ld [wc5d5], a - call Func_f9210 - call Func_f88ae - call Func_f886b - call Func_f8cb0 - call Func_f844c - call Func_f88e4 - call Func_f88fd - ret - -.asm_f82e8 - ld hl, wc5d1 - inc [hl] - xor a - ld [wc634], a - ld a, $c0 - ld [wc632], a - ret - -.asm_f82f6 - ld a, $1 -Func_f82f8: - ld [wc630], a - ld a, $c - ld [wc5d1], a -Func_f8300: - ld a, $80 - ld [wc631], a - ld a, $b - lb de, $88, $58 - call SpawnAnimatedObject - ld hl, $7 - add hl, bc - ld [hl], $80 - ld hl, $b - add hl, bc - ld [hl], $80 - ld hl, $c - add hl, bc - ld [hl], $30 - xor a - ld [wc634], a - ret - -Func_f8324: - call Func_f8440 - jr c, .asm_f833d - xor a - ld [wc5d5], a - call Func_f9210 - call Func_f88ae - call Func_f886b - call Func_f8c97 - call Func_f80ff - ret - -.asm_f833d - ld hl, wc5d1 - inc [hl] - ld a, $90 - ld [hSCX], a - ld a, $72 - ld [wc5d3], a - ld a, $4 - ld [wc5d2], a - xor a - ld [hLCDCPointer], a - ld [wc617], a - ld [wc618], a - ld [wc619], a - ret - -Func_f835c: - ld a, [hSCX] - and a - jr z, .asm_f837b - call Func_f9210 - call Func_f88ae - call Func_f886b - ld a, [hSCX] - dec a - dec a - dec a - dec a - ld [hSCX], a - ld a, $e0 - ld [wc62e], a - call Func_f8cc7 - ret - -.asm_f837b - xor a - ld [wc5e3], a - ld [wc5e3 + 1], a - ld hl, wc5d1 - inc [hl] - ld a, $5 - ld [wc5d2], a - ret - -Func_f838c: - call Func_f891e - ld a, $20 - ld [wc632], a - ld hl, wc5d1 - inc [hl] - ret - -Func_f8399: - call Func_f8440 - ret nc - call Func_f8a92 - ld a, $40 - ld [wc632], a - ld hl, wc5d1 - inc [hl] - ret - -Func_f83aa: - call Func_f8440 - ret nc - call Func_f8ae4 - ld a, $40 - ld [wc632], a - ld hl, wc5d1 - inc [hl] - ret - -Func_f83bb: - call Func_f8440 - ret nc - call Func_f8b7a - ld a, $40 - ld [wc632], a - ld hl, wc5d1 - inc [hl] - ret - -Func_f83cc: - call Func_f8440 - ret nc - call Func_f8aa9 - push af - call Func_f8b5d - pop af - ret nc - ld a, $40 - ld [wc632], a - ld hl, wc5d1 - inc [hl] - ret - -Func_f83e3: - call Func_f8440 - ret nc - call Func_f8afb - push af - call Func_f8b5d - pop af - ret nc - ld a, $80 - ld [wc632], a - ld hl, wc5d1 - inc [hl] - call Func_f8b92 - ret nc - call Func_f8a7c -Func_f83ff: - ld a, $6 - ld [wc5d2], a - ret - -Func_f8406: - call Func_f8440 -Func_f8408: - ret nc - ld hl, wc5d1 - inc [hl] - ret - -Func_f840f: - call Func_f9210 - ld a, [hJoyPressed] - and $1 - ret z - ld hl, wc5d1 - set 7, [hl] - ret - -Func_f841d: - call Func_f9210 - call Func_f88ae - call Func_f886b - call Func_f8cb0 - call Func_f80ff - ld hl, wc631 - ld a, [hl] - and a - jr z, .asm_f8435 - dec [hl] - ret - -.asm_f8435 - ld a, [hJoyPressed] - and $1 - ret z - ld hl, wc5d1 - set 7, [hl] - ret - -Func_f8440: - ld hl, wc632 - ld a, [hl] - and a - jr z, .asm_f844a - dec [hl] - and a - ret - -.asm_f844a - scf - ret - -Func_f844c: - ld a, [wc5e6] - ld h, a - ld a, [wc5e7] - ld l, a - ld a, [wc5e3] - ld e, a - ld a, [wc5e3 + 1] - ld d, a - add hl, de - ld a, h - ld [wc5e6], a - ld a, l - ld [wc5e7], a - ret nc - ld hl, wc5e5 - inc [hl] - ld hl, wOAMBuffer + 4 * 4 + 1 - dec [hl] - dec [hl] - ret - -Func_f8470 - ld a, [wc5d2] - ld e, a - ld d, $0 - ld hl, Jumptable_f847f - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] - -Jumptable_f847f: - dw Func_f848d - dw Func_f84e2 - dw Func_f8516 - dw Func_f8545 - dw Func_f8561 - dw Func_f856d - dw Func_f8579 - -Func_f848d: - ld a, [wc630] - and a - jr nz, .asm_f84d2 - call Func_f87b5 - ld a, [wc5ea] - ld hl, $5 - add hl, bc - ld [hl], a - call Func_f871e - jr c, .asm_f84aa - call Func_f8742 - call Func_f86b8 - ret - -.asm_f84aa - call Func_f8742 - ld a, $1 - ld [wc5d2], a - xor a - ld hl, $c - add hl, bc - ld [hl], a - ld hl, $d - add hl, bc - ld [hl], a - ld hl, $e - add hl, bc - ld [hl], a - ld [wc5d9], a - ld [wc62f], a - xor a - ld [wChannelSoundIDs + CH7], a - ld a, $91 - call PlaySound - ret - -.asm_f84d2 - xor a - ld [wc5e3], a - ld [wc5e3 + 1], a - ld a, $4 - ld [wc5d2], a - call Func_f8742 - ret - -Func_f84e2: - call Func_f8598 - call Func_f928c - ret nc - call Func_f8606 - jr c, .asm_f84fd - call Func_f8bed - ld hl, $c - add hl, bc - ld [hl], $0 - ld a, $2 - ld [wc5d2], a - ret - -.asm_f84fd - ld a, $3 - ld [wc5d2], a - ld a, $60 - ld [wc5e1], a - ld a, $10 - call SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters - xor a - ld [wChannelSoundIDs + CH7], a - ld a, $93 - call PlaySound - ret - -Func_f8516: - ld hl, $c - add hl, bc - ld a, [hl] - cp $20 - jr nc, .asm_f8539 - inc [hl] - inc [hl] - inc [hl] - inc [hl] - ld d, $4 - call Func_f9362 - ld hl, $7 - add hl, bc - ld [hl], a - call Func_f87b5 - ld a, [wc5ea] - ld hl, $5 - add hl, bc - ld [hl], a - ret - -.asm_f8539 - ld hl, $7 - add hl, bc - ld [hl], $0 - ld a, $0 - ld [wc5d2], a - ret - -Func_f8545: - ld hl, wc5e1 - ld a, [hl] - and a - jr z, .asm_f8556 - dec [hl] - ld a, [wc5ea] - ld hl, $5 - add hl, bc - ld [hl], a - ret - -.asm_f8556 - ld a, $0 - ld [wc5d2], a - ld a, $4 - call SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters - ret - -Func_f8561: - ld a, [wc5ea] - ld hl, $5 - add hl, bc - ld [hl], a - call Func_f8742 - ret - -Func_f856d: - ld a, $f - call SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters - ld hl, $c - add hl, bc - ld [hl], $0 - ret - -Func_f8579: - ld hl, $c - add hl, bc - ld a, [hl] - inc [hl] - inc [hl] - and $3f - cp $20 - jr c, .asm_f8591 - ld d, $10 - call Func_f9362 - ld hl, $7 - add hl, bc - ld [hl], a - ret - -.asm_f8591 - ld hl, $7 - add hl, bc - ld [hl], $0 - ret - -Func_f8598: - ld de, hJoy5 - ld a, [de] - and $20 - jr nz, .asm_f85a6 - ld a, [de] - and $10 - jr nz, .asm_f85cc - ret - -.asm_f85a6 - ld hl, $e - add hl, bc - ld [hl], $0 - ld hl, $d - add hl, bc - ld a, [hl] - inc [hl] - cp $b - jr c, .asm_f85be - call Func_f85f2 - ld hl, wc62f - set 0, [hl] -.asm_f85be - ld hl, $1 - add hl, bc - ld a, [hl] - cp $e - jr nc, .asm_f85c9 - inc [hl] - ret - -.asm_f85c9 - ld [hl], $1 - ret - -.asm_f85cc - ld hl, $d - add hl, bc - ld [hl], $0 - ld hl, $e - add hl, bc - ld a, [hl] - inc [hl] - cp $d - jr c, .asm_f85e4 - call Func_f85f2 - ld hl, wc62f - set 1, [hl] -.asm_f85e4 - ld hl, $1 - add hl, bc - ld a, [hl] - cp $1 - jr z, .asm_f85ef - dec [hl] - ret - -.asm_f85ef - ld [hl], $e - ret - -Func_f85f2: - call Func_f8bdf - xor a - ld hl, $d - add hl, bc - ld [hl], a - ld hl, $e - add hl, bc - ld [hl], a - ld a, $92 - call PlaySound - ret - -Func_f8606: - ld hl, $1 - add hl, bc - ld a, [wc5ef] - cp $6 - jr z, .asm_f863d - cp $14 - jr z, .asm_f867b - cp $12 - jr z, .asm_f867b - cp $7 - jr z, .asm_f865c - ld a, [hl] - cp $1 - jp z, .asm_f86ad - cp $2 - jr z, .asm_f869a - cp $3 - jr z, .asm_f869f - cp $4 - jr z, .asm_f86a2 - cp $5 - jr z, .asm_f869f - cp $6 - jr z, .asm_f869a - cp $7 - jr z, .asm_f86ad - jr .asm_f86ad - -.asm_f863d - ld a, [hl] - cp $1 - jr z, .asm_f86ad - cp $2 - jr z, .asm_f86ad - cp $3 - jr z, .asm_f86ad - cp $4 - jr z, .asm_f869a - cp $5 - jr z, .asm_f869f - cp $6 - jr z, .asm_f86a2 - cp $7 - jr z, .asm_f869f - jr .asm_f86ad - -.asm_f865c - ld a, [hl] - cp $1 - jr z, .asm_f869f - cp $2 - jr z, .asm_f86a2 - cp $3 - jr z, .asm_f869f - cp $4 - jr z, .asm_f869a - cp $5 - jr z, .asm_f86ad - cp $6 - jr z, .asm_f86ad - cp $7 - jr z, .asm_f86ad - jr .asm_f86ad - -.asm_f867b - ld a, [hl] - cp $1 - jr z, .asm_f86ad - cp $2 - jr z, .asm_f869a - cp $3 - jr z, .asm_f869f - cp $4 - jr z, .asm_f86a2 - cp $5 - jr z, .asm_f86a2 - cp $6 - jr z, .asm_f869f - cp $7 - jr z, .asm_f869a - jr .asm_f86ad - -.asm_f869a - call Func_f86f7 - jr .asm_f86a2 - -.asm_f869f - call Func_f86d0 -.asm_f86a2 - xor a - ld [wChannelSoundIDs + CH7], a - ld a, $95 - call PlaySound - and a - ret - -.asm_f86ad - ld a, $40 - ld [wc5e3], a - xor a - ld [wc5e3 + 1], a - scf - ret - -Func_f86b8: - ld a, [wc5e3 + 1] - cp $2 - ret nc - ld h, a - ld a, [wc5e3] - ld l, a - ld de, $2 - add hl, de - ld a, h - ld [wc5e3 + 1], a - ld a, l - ld [wc5e3], a - ret - -Func_f86d0: - ld a, [wc5e3 + 1] - and a - jr nz, .asm_f86e2 - ld a, [wc5e3] - cp $40 - jr nc, .asm_f86e2 - xor a - ld [wc5e3], a - ret - -.asm_f86e2 - ld a, [wc5e3 + 1] - ld h, a - ld a, [wc5e3] - ld l, a - ld de, $ffc0 - add hl, de - ld a, h - ld [wc5e3 + 1], a - ld a, l - ld [wc5e3], a - ret - -Func_f86f7: - ld a, [wc5e3 + 1] - and a - jr nz, .asm_f8709 - ld a, [wc5e3] - cp $80 - jr nc, .asm_f8709 - xor a - ld [wc5e3], a - ret - -.asm_f8709 - ld a, [wc5e3 + 1] - ld h, a - ld a, [wc5e3] - ld l, a - ld de, $ff80 - add hl, de - ld a, h - ld [wc5e3 + 1], a - ld a, l - ld [wc5e3], a - ret - -Func_f871e: - ld a, [hSCX] - and $7 - cp $3 - jr c, .asm_f8740 - cp $5 - jr nc, .asm_f8740 - ld a, [wc5ef] - cp $14 - jr nz, .asm_f8740 - call Func_f87a8 - cp $a - jr c, .asm_f8740 - ld [wc5ec], a - call Func_f9284 - scf - ret - -.asm_f8740 - and a - ret - -Func_f8742: - ld a, [hSCX] - and $7 - cp $3 - ret c - cp $5 - ret nc - ld a, [wc5ef] - cp $6 - jr z, .asm_f8766 - cp $14 - jr z, .asm_f8766 - cp $7 - jr z, .asm_f876a - call Func_f8778 - ld a, $4 - ld hl, $1 - add hl, bc - ld [hl], a - ret - -.asm_f8766 - ld a, $6 - jr .asm_f876c - -.asm_f876a - ld a, $2 -.asm_f876c - ld e, a - ld a, [wc5de] - dec a - add e - ld hl, $1 - add hl, bc - ld [hl], a - ret - -Func_f8778: - ld hl, wc5e0 - ld a, [hl] - inc [hl] - and $7 - ret nz - ld a, [wc5df] - and a - jr z, .asm_f8796 - ld a, [wc5de] - and a - jr z, .asm_f8791 - dec a - ld [wc5de], a - ret - -.asm_f8791 - xor a - ld [wc5df], a - ret - -.asm_f8796 - ld a, [wc5de] - cp $2 - jr z, .asm_f87a2 - inc a - ld [wc5de], a - ret - -.asm_f87a2 - ld a, $1 - ld [wc5df], a - ret - -Func_f87a8: - ld a, [wc5e3] - ld l, a - ld a, [wc5e3 + 1] - ld h, a - add hl, hl - add hl, hl - add hl, hl - ld a, h - ret - -Func_f87b5: - ld hl, wc5eb - ld a, [hl] - inc [hl] - and $3 - ret nz - call Func_f87ce - ld d, a - ld hl, $4 - add hl, bc - ld e, [hl] - ld a, $a - push bc - call SpawnAnimatedObject - pop bc - ret - -Func_f87ce: - ld a, [hSCX] - and $8 - jr nz, .asm_f87d9 - ld hl, wc622 - jr .asm_f87dc - -.asm_f87d9 - ld hl, wc623 -.asm_f87dc - ld a, [wc5f0] - cp $6 - jr z, .asm_f87ed - cp $14 - jr z, .asm_f87ed - cp $7 - jr z, .asm_f87f5 - ld a, [hl] - ret - -.asm_f87ed - ld a, [hSCX] - and $7 - ld e, a - ld a, [hl] - sub e - ret - -.asm_f87f5 - ld a, [hSCX] - and $7 - add [hl] - ret - -Func_f87fb: - ld hl, $4 - add hl, bc - ld a, [hl] - cp $58 - ret z - add $4 - ld [hl], a - ret - -Func_f8807: - call MaskCurrentAnimatedObjectStruct - ret - -Func_f880b: - ld hl, $b - add hl, bc - ld a, [hl] - and a - ret z - dec [hl] - dec [hl] - ld d, a - ld hl, $c - add hl, bc - ld a, [hl] - inc [hl] - call Func_f9362 - cp $80 - jr nc, .asm_f8825 - xor $ff - inc a -.asm_f8825 - ld hl, $7 - add hl, bc - ld [hl], a - ret - -Func_f882b: - ld hl, $b - add hl, bc - ld a, [hl] - inc [hl] - and $1 - ret z - ld hl, $4 - add hl, bc - ld a, [hl] - cp $c0 - jr z, .asm_f883f - inc [hl] - ret - -.asm_f883f - ld a, $1 - ld [wc633], a - call MaskCurrentAnimatedObjectStruct - ret - -Func_f8848: - ld a, [wc635] - ld e, a - ld d, $0 - ld a, [wc5e3] - ld l, a - ld a, [wc5e3 + 1] - ld h, a - add hl, de - ld a, l - ld [wc635], a - ld d, h - ld hl, wOAMBuffer + 5 * 4 + 1 - ld e, $9 -.asm_f8861 - ld a, [hl] - add d - ld [hli], a - inc hl - inc hl - inc hl - dec e - jr nz, .asm_f8861 - ret - -Func_f886b: - ld a, [wc5ef] - ld a, [hSCX] - add $48 - ld e, a - srl e - srl e - srl e - ld d, $0 - ld hl, vBGMap0 - add hl, de - ld a, [wc5ea] - srl a - srl a - srl a - ld c, a -.asm_f8889 - ld a, c - and a - jr z, .asm_f889a - dec c - ld de, $20 - add hl, de - ld a, h - and $3 - or $98 - ld h, a - jr .asm_f8889 - -.asm_f889a - ld de, wc5ef - ld a, e - ld [H_VBCOPYDEST], a - ld a, d - ld [H_VBCOPYDEST + 1], a - ld a, l - ld [H_VBCOPYSRC], a - ld a, h - ld [H_VBCOPYSRC + 1], a - ld a, $1 - ld [H_VBCOPYSIZE], a - ret - -Func_f88ae: - ld a, [hSCX] - and $8 - jr nz, .asm_f88b9 - ld hl, wc621 - jr .asm_f88bc - -.asm_f88b9 - ld hl, wc622 -.asm_f88bc - ld a, [wc5ef] - cp $6 - jr z, .asm_f88d0 - cp $14 - jr z, .asm_f88d0 - cp $7 - jr z, .asm_f88db - ld a, [hl] - ld [wc5ea], a - ret - -.asm_f88d0 - ld a, [hSCX] - and $7 - ld e, a - ld a, [hl] - sub e - ld [wc5ea], a - ret - -.asm_f88db - ld a, [hSCX] - and $7 - add [hl] - ld [wc5ea], a - ret - -Func_f88e4: - ld hl, wc5d6 - ld e, $99 - call Func_f88f0 - ret nc - inc hl - ld e, $99 -Func_f88f0: - ld a, [hl] - and a - jr z, .asm_f88fa - sub $1 - daa - ld [hl], a - and a - ret - -.asm_f88fa - ld [hl], e - scf - ret - -Func_f88fd: - ld de, wc5d7 - ld hl, wOAMBuffer + 0 * 4 + 2 - ld a, [de] - call Func_f890b - ld hl, wOAMBuffer + 2 * 4 + 2 - ld a, [de] -Func_f890b: - ld c, a - swap a - and $f - add $d0 - ld [hli], a - inc hl - inc hl - inc hl - ld a, c - and $f - add $d0 - ld [hl], a - dec de - ret - -Func_f891e: - ld hl, wTileMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - xor a - call FillMemory - ld hl, Tilemap_f8946 - coord de, 0, 6 - ld bc, Tilemap_f8946End - Tilemap_f8946 - call CopyData - call Func_f8a0e - ld hl, wOAMBuffer + 5 * 4 + 1 - ld bc, $24 - xor a - call FillMemory - ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a - ret - -Tilemap_f8946: -INCBIN "gfx/unknown_f8946.map" -Tilemap_f8946End: - -Func_f8a0e: - coord hl, 1, 1 - lb de, $3b, $3c - ld a, $40 - call Func_f8a72 - coord hl, 1, 2 - lb de, $3f, $3f - ld a, $ff - call Func_f8a72 - coord hl, 1, 3 - lb de, $3f, $3f - ld a, $ff - call Func_f8a72 - coord hl, 1, 4 - lb de, $3f, $3f - ld a, $ff - call Func_f8a72 - coord hl, 1, 5 - lb de, $3f, $3f - ld a, $ff - call Func_f8a72 - coord hl, 1, 6 - lb de, $3f, $3f - ld a, $ff - call Func_f8a72 - coord hl, 1, 7 - lb de, $3f, $3f - ld a, $ff - call Func_f8a72 - coord hl, 1, 8 - lb de, $3f, $3f - ld a, $ff - call Func_f8a72 - coord hl, 1, 9 - lb de, $3d, $3e - ld a, $40 - call Func_f8a72 - ret - -Func_f8a72: - ld [hl], d - inc hl - ld c, $10 -.asm_f8a76 - ld [hli], a - dec c - jr nz, .asm_f8a76 - ld [hl], e - ret - -Func_f8a7c: - ld hl, Tilemap_f8a89 - coord de, 6, 8 - ld bc, $9 - call CopyData - ret - -Tilemap_f8a89: - db $20,$2e,$2f,$30,$31,$2c,$32,$23,$33 - -Func_f8a92: - ld hl, Tilemap_f8aa2 - coord de, 2, 2 - ld bc, $7 - call CopyData - call Func_f8aca - ret - -Tilemap_f8aa2: - db $20,$21,$ff,$22,$23,$24,$25 - -Func_f8aa9: - ld c, $63 -.asm_f8aab - push bc - ld hl, wc5d6 - ld a, [hli] - or [hl] - and a - jr z, .asm_f8ac7 - call Func_f88e4 - ld e, $1 -.asm_f8ab9 - call Func_f8b42 - pop bc - dec c - jr nz, .asm_f8aab -.asm_f8abf - ld a, $90 - call PlaySound -.asm_f8ac5 - and a - ret - -.asm_f8ac7 - pop bc - scf - ret - -Func_f8aca: - coord hl, 10, 2 - ld de, wc5d7 - ld a, [de] - call Func_f9350 - inc hl - ld a, [de] - call Func_f9350 - inc hl - inc hl - ld [hl], $21 - inc hl - ld [hl], $25 - inc hl - ld [hl], $26 - ret - -Func_f8ae4: - ld hl, Tilemap_f8af4 - coord de, 2, 4 - ld bc, $7 - call CopyData - call Func_f8b25 - ret - -Tilemap_f8af4: - db $27,$28,$29,$2a,$23,$26,$26 - -Func_f8afb: - ld c, $63 -.asm_f8afd - push bc - ld hl, wc5da - ld a, [hli] - ld e, a - or [hl] - jr z, .asm_f8b22 - ld d, [hl] - ld a, e - sub $1 - daa - ld e, a - ld a, d - sbc $0 - daa - ld [hld], a - ld [hl], e - ld e, $1 - call Func_f8b42 - pop bc - dec c - jr nz, .asm_f8afd - ld a, $90 - call PlaySound -.asm_f8b20 - and a - ret - -.asm_f8b22 - pop bc - scf - ret - -Func_f8b25: - ld a, [wc5db] - coord hl, 10, 4 - call Func_f9350 - ld a, [wc5da] - coord hl, 12, 4 - call Func_f9350 - inc hl - inc hl - ld [hl], $21 - inc hl - ld [hl], $25 - inc hl - ld [hl], $26 - ret - -Func_f8b42: - ld a, [wc5dc] - add e - daa - ld [wc5dc], a - ld a, [wc5dd] - adc $0 - daa - ld [wc5dd], a - ret nc - ld a, $99 - ld [wc5dc], a - ld [wc5dd], a - ret - -Func_f8b5d: - ld a, [wc5dd] - coord hl, 10, 6 - call Func_f9350 - ld a, [wc5dc] - coord hl, 12, 6 - call Func_f9350 - inc hl - inc hl - ld [hl], $21 - inc hl - ld [hl], $25 - inc hl - ld [hl], $26 - ret - -Func_f8b7a: - ld hl, Tilemap_f8b8d - coord de, 2, 6 - ld bc, $5 - call CopyData - call Func_f8b25 - call Func_f8b5d - ret - -Tilemap_f8b8d: - db $2b,$2c,$25,$28,$2d - -Func_f8b92: - ld hl, wd496 - ld a, [wc5dd] - cp [hl] - jr c, .asm_f8ba6 - jr nz, .asm_f8bb0 - dec hl - ld a, [wc5dc] - cp [hl] - jr c, .asm_f8ba6 - jr nz, .asm_f8bb0 -.asm_f8ba6 - call WaitForSoundToFinish - ld e, $1b - call Func_f8bcb - and a - ret - -.asm_f8bb0 - ld a, [wc5dc] - ld [wd495], a - ld a, [wc5dd] - ld [wd496], a - call WaitForSoundToFinish - ld e, $21 - call Func_f8bcb - ld a, $96 - call PlaySound - scf - ret - -Func_f8bcb: ; f8bcb (3e:4bcb) - push de - callab IsSurfingPikachuInThePlayersParty - pop de - ret nc - callab PlayPikachuSoundClip - ret - -Func_f8bdf: - ld a, [wc5d9] - inc a - cp $4 - jr c, .asm_f8be9 - ld a, $3 -.asm_f8be9 - ld [wc5d9], a - ret - -Func_f8bed: - ld a, [wc5d9] - and a - ret z - ld a, [wc62f] - and $3 - cp $3 - jr z, .asm_f8c2b - ld a, [wc5d9] - ld d, a - ld e, $1 - ld a, $0 -.asm_f8c03 - add e - sla e - dec d - jr nz, .asm_f8c03 -.asm_f8c09 - push af - ld e, $50 - call Func_f8c7c - pop af - dec a - jr nz, .asm_f8c09 - ld hl, $5 - add hl, bc - ld a, [hl] - sub $10 - ld d, a - ld hl, $4 - add hl, bc - ld e, [hl] - ld a, [wc5d9] - add $3 - push bc - call SpawnAnimatedObject - pop bc - ret - -.asm_f8c2b - ld a, [wc5d9] - cp $3 - jr c, .asm_f8c53 - ld a, $a -.asm_f8c34 - push af - ld e, $50 - call Func_f8c7c - pop af - dec a - jr nz, .asm_f8c34 - ld hl, $5 - add hl, bc - ld a, [hl] - sub $10 - ld d, a - ld hl, $4 - add hl, bc - ld e, [hl] - ld a, $9 - push bc - call SpawnAnimatedObject - pop bc - ret - -.asm_f8c53 - ld e, $50 - call Func_f8c7c - ld e, $50 - call Func_f8c7c - ld e, $50 - call Func_f8c7c - ld e, $30 - call Func_f8c7c - ld hl, $5 - add hl, bc - ld a, [hl] - sub $10 - ld d, a - ld hl, $4 - add hl, bc - ld e, [hl] - ld a, $8 - push bc - call SpawnAnimatedObject - pop bc - ret - -Func_f8c7c: - ld a, [wc5da] - add e - daa - ld [wc5da], a - ld a, [wc5db] - adc $0 - daa - ld [wc5db], a - ret nc - ld a, $99 - ld [wc5da], a - ld [wc5db], a - ret - -Func_f8c97: - ld a, $a0 - ld [wc62e], a - ld a, [hSCX] - ld h, a - ld a, [wc617] - ld l, a - ld de, $900 - add hl, de - ld a, l - ld [wc617], a - ld a, h - ld [hSCX], a - jr Func_f8cc7 - -Func_f8cb0: - ld a, $a0 - ld [wc62e], a - ld a, [hSCX] - ld h, a - ld a, [wc617] - ld l, a - ld de, $180 - add hl, de - ld a, l - ld [wc617], a - ld a, h - ld [hSCX], a -Func_f8cc7: - ld hl, wc618 - ld a, [hSCX] - cp [hl] - ret z - ld [hl], a - and $f0 - ld hl, wc619 - cp [hl] - ret z - ld [hl], a - call Func_f8d44 - ld a, b - ld [wc5e8], a - ld a, c - ld [wc5e9], a - push de - ld hl, wc61a - ld de, wc61c - ld c, $12 -.asm_f8ceb - ld a, [de] - inc de - ld [hli], a - dec c - jr nz, .asm_f8ceb - ld a, [wc5e8] - ld [hli], a - ld a, [wc5e9] - ld [hl], a - pop de - ld hl, wRedrawRowOrColumnSrcTiles - ld c, $8 -.asm_f8cff - ld a, [de] - call Func_f8d28 - inc de - dec c - jr nz, .asm_f8cff - ld a, [wc62e] - ld e, a - ld a, [hSCX] - add e - and $f0 - srl a - srl a - srl a - ld e, a - ld d, $0 - ld hl, vBGMap0 - add hl, de - ld a, l - ld [hRedrawRowOrColumnDest], a - ld a, h - ld [hRedrawRowOrColumnDest + 1], a - ld a, $1 - ld [hRedrawRowOrColumnMode], a - ret - -Func_f8d28: - push de - push hl - ld l, a - ld h, $0 - ld de, Unkn_f96e5 - add hl, hl - add hl, hl - add hl, de - ld e, l - ld d, h - pop hl - ld a, [de] - inc de - ld [hli], a - ld a, [de] - inc de - ld [hli], a - ld a, [de] - inc de - ld [hli], a - ld a, [de] - inc de - ld [hli], a - pop de - ret - -Func_f8d44: - ld a, [wc5d3] - ld e, a - ld d, $0 - ld hl, Jumptable_f8d53 - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] - -Jumptable_f8d53: - dw Func_f8e4b - dw Func_f8f28 - dw Func_f8f31 - dw Func_f8f3a - dw Func_f8f43 - dw Func_f8e7d - dw Func_f8f4c - dw Func_f8f55 - dw Func_f8f5e - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8f94 - dw Func_f8ec5 - dw Func_f8ece - dw Func_f8ed7 - dw Func_f8ee0 - dw Func_f8ee9 - dw Func_f8ef2 - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8f94 - dw Func_f8efb - dw Func_f8f04 - dw Func_f8f0d - dw Func_f8f16 - dw Func_f8f1f - dw Func_f8efb - dw Func_f8f04 - dw Func_f8f0d - dw Func_f8f16 - dw Func_f8f1f - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8f94 - dw Func_f8f28 - dw Func_f8f31 - dw Func_f8f3a - dw Func_f8f43 - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8f94 - dw Func_f8f4c - dw Func_f8f55 - dw Func_f8f5e - dw Func_f8f4c - dw Func_f8f55 - dw Func_f8f5e - dw Func_f8f4c - dw Func_f8f55 - dw Func_f8f5e - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8f94 - dw Func_f8f67 - dw Func_f8f70 - dw Func_f8efb - dw Func_f8f04 - dw Func_f8f0d - dw Func_f8f16 - dw Func_f8f1f - dw Func_f8f67 - dw Func_f8f70 - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8f94 - dw Func_f8ec5 - dw Func_f8ece - dw Func_f8ed7 - dw Func_f8ee0 - dw Func_f8ee9 - dw Func_f8ef2 - dw Func_f8e7d - dw Func_f8f67 - dw Func_f8f70 - dw Func_f8f67 - dw Func_f8f70 - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8f94 - dw Func_f8efb - dw Func_f8f04 - dw Func_f8f0d - dw Func_f8f16 - dw Func_f8f1f - dw Func_f8f28 - dw Func_f8f31 - dw Func_f8f3a - dw Func_f8f43 - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8e7d - dw Func_f8f94 - dw Func_f8e86 - dw Func_f8e8f - dw Func_f8e98 - dw Func_f8ea1 - dw Func_f8eaa - dw Func_f8eb3 - dw Func_f8ebc - dw Func_f8f9d - dw Func_f8e7d - dw Func_f8f79 - dw Func_f8f82 - dw Func_f8f82 - dw Func_f8f82 - dw Func_f8f82 - dw Func_f8f82 - dw Func_f8f82 - dw Func_f8f82 - dw Func_f8f8b - -Func_f8e4b: - ld a, [wc5e5] - cp $16 - jr c, .asm_f8e5a - jr z, .asm_f8e56 - jr nc, .asm_f8e6e -.asm_f8e56 - ld a, $6a - jr .asm_f8e6b - -.asm_f8e5a - ld a, [wc5d5] - and a - jr z, .asm_f8e6e - dec a - and $7 - ld e, a - ld d, $0 - ld hl, Unkn_f8e75 - add hl, de - ld a, [hl] -.asm_f8e6b - ld [wc5d3], a -.asm_f8e6e - lb bc, $74, $74 - ld de, Unkn_f973d - ret - -Unkn_f8e75: - db $01,$0e,$1a,$29,$32,$40,$4d,$5c - -Func_f8e7d: - lb bc, $74, $74 - ld de, Unkn_f973d - jp Func_f8fa9 - -Func_f8e86: - lb bc, $74, $6c - ld de, Unkn_f9745 - jp Func_f8fa9 - -Func_f8e8f: - lb bc, $64, $5c - ld de, Unkn_f974d - jp Func_f8fa9 - -Func_f8e98: - lb bc, $54, $4c - ld de, Unkn_f9755 - jp Func_f8fa9 - -Func_f8ea1: - lb bc, $44, $44 - ld de, Unkn_f975d - jp Func_f8fa9 - -Func_f8eaa: - lb bc, $44, $4c - ld de, Unkn_f9765 - jp Func_f8fa9 - -Func_f8eb3: - lb bc, $54, $5c - ld de, Unkn_f976d - jp Func_f8fa9 - -Func_f8ebc: - lb bc, $64, $6c - ld de, Unkn_f9775 - jp Func_f8fa9 - -Func_f8ec5: - lb bc, $74, $6c - ld de, Unkn_f977d - jp Func_f8fa9 - -Func_f8ece: - lb bc, $64, $5c - ld de, Unkn_f9785 - jp Func_f8fa9 - -Func_f8ed7: - lb bc, $54, $4c - ld de, Unkn_f978d - jp Func_f8fa9 - -Func_f8ee0: - lb bc, $4c, $4c - ld de, Unkn_f9795 - jp Func_f8fa9 - -Func_f8ee9: - lb bc, $54, $5c - ld de, Unkn_f979d - jp Func_f8fa9 - -Func_f8ef2: - lb bc, $64, $6c - ld de, Unkn_f97a5 - jp Func_f8fa9 - -Func_f8efb: - lb bc, $74, $6c - ld de, Unkn_f97ad - jp Func_f8fa9 - -Func_f8f04: - lb bc, $64, $5c - ld de, Unkn_f97b5 - jp Func_f8fa9 - -Func_f8f0d: - lb bc, $54, $54 - ld de, Unkn_f97bd - jp Func_f8fa9 - -Func_f8f16: - lb bc, $54, $5c - ld de, Unkn_f97c5 - jp Func_f8fa9 - -Func_f8f1f: - lb bc, $64, $6c - ld de, Unkn_f97cd - jp Func_f8fa9 - -Func_f8f28: - lb bc, $74, $6c - ld de, Unkn_f97d5 - jp Func_f8fa9 - -Func_f8f31: - lb bc, $64, $5c - ld de, Unkn_f97dd - jp Func_f8fa9 - -Func_f8f3a: - lb bc, $5c, $5c - ld de, Unkn_f97e5 - jp Func_f8fa9 - -Func_f8f43: - lb bc, $64, $6c - ld de, Unkn_f97ed - jp Func_f8fa9 - -Func_f8f4c: - lb bc, $74, $6c - ld de, Unkn_f97f5 - jp Func_f8fa9 - -Func_f8f55: - lb bc, $64, $64 - ld de, Unkn_f97fd - jp Func_f8fa9 - -Func_f8f5e: - lb bc, $64, $6c - ld de, Unkn_f9805 - jp Func_f8fa9 - -Func_f8f67: - lb bc, $74, $6c - ld de, Unkn_f980d - jp Func_f8fa9 - -Func_f8f70: - lb bc, $6c, $6c - ld de, Unkn_f9815 - jp Func_f8fa9 - -Func_f8f79: - lb bc, $74, $74 - ld de, Unkn_f981d - jp Func_f8fa9 - -Func_f8f82: - lb bc, $74, $74 - ld de, Unkn_f9825 - jp Func_f8fa9 - -Func_f8f8b: - lb bc, $74, $74 - ld de, Unkn_f9825 - jp Func_f8fae - -Func_f8f94: - lb bc, $74, $74 - ld de, Unkn_f973d - jp Func_f8fae - -Func_f8f9d: - lb bc, $74, $74 - ld de, Unkn_f973d - ret - -Func_f8fa4: - inc a - ld [wc5d3], a - ret - -Func_f8fa9: - ld hl, wc5d3 - inc [hl] - ret - -Func_f8fae: - xor a - ld [wc5d3], a - ret - -Func_f8fb3: - call Func_f9279 - call ClearSprites - call DisableLCD - xor a - ld [H_AUTOBGTRANSFERENABLED], a - call ClearObjectAnimationBuffers - ld hl, $6324 - ld de, $8800 - ld bc, $900 - ld a, $20 - call FarCopyData - ld a, Unkn_f93d3 % $100 - ld [wAnimatedObjectSpawnStateDataPointer], a - ld a, Unkn_f93d3 / $100 - ld [wAnimatedObjectSpawnStateDataPointer + 1], a - ld a, Jumptable_f93fa % $100 - ld [wAnimatedObjectJumptablePointer], a - ld a, Jumptable_f93fa / $100 - ld [wAnimatedObjectJumptablePointer + 1], a - ld a, Unkn_f9507 % $100 - ld [wAnimatedObjectOAMDataPointer], a - ld a, Unkn_f9507 / $100 - ld [wAnimatedObjectOAMDataPointer + 1], a - ld a, Unkn_f9405 % $100 - ld [wAnimatedObjectFramesDataPointer], a - ld a, Unkn_f9405 / $100 - ld [wAnimatedObjectFramesDataPointer + 1], a - ld a, $c - lb de, $74, $58 - call SpawnAnimatedObject - call Func_f9053 - xor a - ld [hSCX], a - ld [hSCY], a - ld a, $90 - ld [hWY], a - ld b, $f - call RunPaletteCommand - ld a, $e3 - ld [rLCDC], a - ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a - call DelayFrame - call DelayFrame - call DelayFrame - call Func_f81e9 - ld a, $e4 - ld [rOBP0], a - ld a, $e0 - ld [rOBP1], a - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - call DelayFrame - ld a, $99 - ld c, $20 - call PlayMusic - xor a - ld [wc633], a -.asm_f9041 - ld a, [wc633] - and a - ret nz - ld a, $0 - ld [wCurrentAnimatedObjectOAMBufferOffset], a - call RunObjectAnimations - call DelayFrame - jr .asm_f9041 - -Func_f9053: - ld hl, wTileMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $ff - call FillMemory - ld hl, Tilemap_f90bc - coord de, 0, 6 - ld bc, 12 * SCREEN_WIDTH - call CopyData - ld de, Tilemap_f91c8 - coord hl, 4, 0 - lb bc, 6, 12 - call .CopyBox - coord hl, 3, 7 - lb bc, 3, 15 - call .FillBoxWithFF - ld hl, Tilemap_f91ac - coord de, 3, 7 - ld bc, 15 - call CopyData - ld hl, Tilemap_f91bb - coord de, 4, 9 - ld bc, 13 - call CopyData - ret - -.CopyBox: -.copy_row - push bc - push hl -.copy_col - ld a, [de] - inc de - ld [hli], a - dec c - jr nz, .copy_col - ld bc, SCREEN_WIDTH - pop hl - add hl, bc - pop bc - dec b - jr nz, .copy_row - ret - -.FillBoxWithFF: -.fill_row - push bc - push hl -.fill_col - ld [hl], $ff - inc hl - dec c - jr nz, .fill_col - pop hl - ld bc, SCREEN_WIDTH - add hl, bc - pop bc - dec b - jr nz, .fill_row - ret - -Tilemap_f90bc: INCBIN "gfx/unknown_f90bc.map" -Tilemap_f91ac: INCBIN "gfx/unknown_f91ac.map" -Tilemap_f91bb: INCBIN "gfx/unknown_f91bb.map" -Tilemap_f91c8: INCBIN "gfx/unknown_f91c8.map" - -Func_f9210: - ld hl, wc710 - ld de, wc710 + 1 - ld c, $80 - ld a, [hl] - push af -.asm_f921a - ld a, [de] - inc de - ld [hli], a - dec c - jr nz, .asm_f921a - pop af - ld [hl], a - ret - -Func_f9223: - ld hl, wc700 - ld bc, $100 - ld de, $0 -.asm_f922c - ld a, e - and $1f - ld e, a - push hl - ld hl, Unkn_f96c5 - add hl, de - ld a, [hl] - pop hl - ld [hli], a - inc e - dec bc - ld a, c - or b - jr nz, .asm_f922c - ret - -Func_f923f: - call Joypad - ld a, [H_FRAMECOUNTER] - and a - jr nz, .asm_f9250 - ld a, [hJoyHeld] - ld [hJoy5], a - ld a, $2 - ld [H_FRAMECOUNTER], a - ret - -.asm_f9250 - xor a - ld [hJoy5], a - ret - -SurfingPikachuMinigame_BlankPals: - xor a - ld [rBGP], a - ld [rOBP0], a - ld [rOBP1], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - ret - -SurfingPikachuMinigame_NormalPals: - ld a, $e4 - ld [rBGP], a - ld [rOBP0], a - ld a, $e0 - ld [rOBP1], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - ret - -Func_f9279: - ld hl, wTileMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - xor a - call FillMemory - ret - -Func_f9284: - xor a - ld [wc5ed], a - ld [wc5ee], a - ret - -Func_f928c: - ld a, [wc5ed] - and a - jr nz, .asm_f92e4 - ld a, [wc5ec] - ld d, a - ld a, [wc5ee] - or d - jr z, .asm_f92dd - ld a, [wc5ee] - ld e, a - ld hl, $ff80 - add hl, de - ld a, l - ld [wc5ee], a - ld a, h - ld [wc5ec], a - ld e, a - ld d, $0 - call Func_f9340 - ld e, l - ld d, h - ld a, $4 - call Func_f9340 - ld a, l - xor $ff - inc a - ld l, a - ld a, h - xor $ff - ld h, a - push hl - ld hl, $5 - add hl, bc - ld d, [hl] - ld hl, $c - add hl, bc - ld e, [hl] - pop hl - add hl, de - ld e, l - ld d, h - ld hl, $5 - add hl, bc - ld [hl], d - ld hl, $c - add hl, bc - ld [hl], e - and a - ret - -.asm_f92dd - ld a, $1 - ld [wc5ed], a - and a - ret - -.asm_f92e4 - ld a, [wc5ea] - ld e, a - ld hl, $5 - add hl, bc - ld a, [hl] - cp $90 - jr nc, .asm_f92f4 - cp e - jr nc, .asm_f9330 -.asm_f92f4 - ld a, [wc5ec] - ld d, a - ld a, [wc5ee] - ld e, a - ld hl, $80 - add hl, de - ld a, l - ld [wc5ee], a - ld a, h - ld [wc5ec], a - ld e, a - ld d, $0 - call Func_f9340 - ld e, l - ld d, h - ld a, $4 - call Func_f9340 - push hl - ld hl, $5 - add hl, bc - ld d, [hl] - ld hl, $c - add hl, bc - ld e, [hl] - pop hl - add hl, de - ld e, l - ld d, h - ld hl, $5 - add hl, bc - ld [hl], d - ld hl, $c - add hl, bc - ld [hl], e - and a - ret - -.asm_f9330 - ld hl, $5 - add hl, bc - ld a, [wc5ea] - ld [hl], a - ld hl, $c - add hl, bc - ld [hl], $0 - scf - ret - -Func_f9340: - ld hl, $0 -.asm_f9343 - srl a - jr nc, .asm_f9348 - add hl, de -.asm_f9348 - sla e - rl d - and a - jr nz, .asm_f9343 - ret - -Func_f9350: - ld c, a - swap a - and $f - add $d0 - ld [hli], a - ld a, c - and $f - add $d0 - ld [hl], a - dec de - ret - -Func_f9360: ; cosine - add $10 -Func_f9362: ; sine - and $3f - cp $20 - jr nc, .asm_f936d - call Func_f9377 - ld a, h - ret - -.asm_f936d - and $1f - call Func_f9377 - ld a, h - xor $ff - inc a - ret - -Func_f9377: - ld e, a - ld a, d - ld d, $0 - ld hl, Unkn_f9393 - add hl, de - add hl, de - ld e, [hl] - inc hl - ld d, [hl] - ld hl, $0 -.asm_f9386 - srl a - jr nc, .asm_f938b - add hl, de -.asm_f938b - sla e - rl d - and a - jr nz, .asm_f9386 - ret - -Unkn_f9393: - sine_wave $100 - -Unkn_f93d3: - db $00, $00, $00 - db $04, $01, $00 - db $11, $02, $00 - db $12, $02, $00 - db $15, $00, $00 - db $16, $00, $00 - db $17, $00, $00 - db $18, $00, $00 - db $19, $00, $00 - db $1a, $00, $00 - db $14, $00, $00 - db $13, $03, $00 - db $1b, $04, $00 - -Jumptable_f93fa: - dw Func_f9404 - dw Func_f8470 - dw Func_f87fb - dw Func_f880b - dw Func_f882b - -Func_f9404: - ret - -Unkn_f9405: - dw Unkn_f943d - dw Unkn_f9440 - dw Unkn_f9445 - dw Unkn_f944a - dw Unkn_f944f - dw Unkn_f9454 - dw Unkn_f9459 - dw Unkn_f945e - dw Unkn_f9463 - dw Unkn_f9468 - dw Unkn_f946d - dw Unkn_f9472 - dw Unkn_f9477 - dw Unkn_f947c - dw Unkn_f9481 - dw Unkn_f9486 - dw Unkn_f948b - dw Unkn_f9494 - dw Unkn_f9499 - dw Unkn_f949e - dw Unkn_f94fb - dw Unkn_f94a1 - dw Unkn_f94b0 - dw Unkn_f94bf - dw Unkn_f94ce - dw Unkn_f94dd - dw Unkn_f94ec - dw Unkn_f94fe - -Unkn_f943d: - frame $00, 32 - endanim - -Unkn_f9440: - frame $01, 8 - frame $02, 8 - dorestart - -Unkn_f9445: - frame $03, 8 - frame $04, 8 - dorestart - -Unkn_f944a: - frame $05, 8 - frame $06, 8 - dorestart - -Unkn_f944f: - frame $07, 8 - frame $08, 8 - dorestart - -Unkn_f9454: - frame $09, 8 - frame $0a, 8 - dorestart - -Unkn_f9459: - frame $0b, 8 - frame $0c, 8 - dorestart - -Unkn_f945e: - frame $0d, 8 - frame $0e, 8 - dorestart - -Unkn_f9463: - frame $01, 8, OAM_HFLIP, OAM_VFLIP - frame $02, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9468: - frame $03, 8, OAM_HFLIP, OAM_VFLIP - frame $04, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f946d: - frame $05, 8, OAM_HFLIP, OAM_VFLIP - frame $06, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9472: - frame $07, 8, OAM_HFLIP, OAM_VFLIP - frame $08, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9477: - frame $09, 8, OAM_HFLIP, OAM_VFLIP - frame $0a, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f947c: - frame $0b, 8, OAM_HFLIP, OAM_VFLIP - frame $0c, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9481: - frame $0d, 8, OAM_HFLIP, OAM_VFLIP - frame $0e, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9486: - frame $11, 7 - frame $12, 7 - dorestart - -Unkn_f948b: - frame $13, 2 - frame $14, 2 - dorepeat 8 - frame $15, 2 - endanim - -Unkn_f9494: - frame $16, 32 - frame $16, 32 - delanim - -Unkn_f9499: - frame $17, 32 - frame $17, 32 - delanim - -Unkn_f949e: - frame $18, 32 - endanim - -Unkn_f94a1: - frame $1a, 4 - dorepeat 1 - frame $1a, 3 - dorepeat 1 - frame $1a, 2 - dorepeat 1 - frame $1a, 1 - delanim - -Unkn_f94b0: - frame $1b, 4 - dorepeat 1 - frame $1b, 3 - dorepeat 1 - frame $1b, 2 - dorepeat 1 - frame $1b, 1 - delanim - -Unkn_f94bf: - frame $1c, 4 - dorepeat 1 - frame $1c, 3 - dorepeat 1 - frame $1c, 2 - dorepeat 1 - frame $1c, 1 - delanim - -Unkn_f94ce: - frame $1d, 4 - dorepeat 1 - frame $1d, 3 - dorepeat 1 - frame $1d, 2 - dorepeat 1 - frame $1d, 1 - delanim - -Unkn_f94dd: - frame $1e, 4 - dorepeat 1 - frame $1e, 3 - dorepeat 1 - frame $1e, 2 - dorepeat 1 - frame $1e, 1 - delanim - -Unkn_f94ec: - frame $1f, 4 - dorepeat 1 - frame $1f, 3 - dorepeat 1 - frame $1f, 2 - dorepeat 1 - frame $1f, 1 - delanim - -Unkn_f94fb: - frame $19, 1 - delanim - -Unkn_f94fe: - frame $20, 7 - frame $21, 7 - frame $22, 7 - frame $23, 7 - dorestart - -Unkn_f9507: - dbw $00, Unkn_f9573 - dbw $00, Unkn_f9578 - dbw $36, Unkn_f9578 - dbw $03, Unkn_f9578 - dbw $39, Unkn_f9578 - dbw $06, Unkn_f9578 - dbw $3c, Unkn_f9578 - dbw $09, Unkn_f9578 - dbw $60, Unkn_f9578 - dbw $0c, Unkn_f9578 - dbw $63, Unkn_f9578 - dbw $30, Unkn_f9578 - dbw $66, Unkn_f9578 - dbw $33, Unkn_f9578 - dbw $69, Unkn_f9578 - dbw $6c, Unkn_f9578 - dbw $9c, Unkn_f9578 - dbw $a0, Unkn_f9578 - dbw $a3, Unkn_f9578 - dbw $a7, Unkn_f95db - dbw $a8, Unkn_f95f4 - dbw $98, Unkn_f9625 - dbw $e0, Unkn_f959d - dbw $e6, Unkn_f959d - dbw $ca, Unkn_f959d - dbw $a7, Unkn_f95ce - dbw $00, Unkn_f9632 - dbw $00, Unkn_f963f - dbw $00, Unkn_f9650 - dbw $00, Unkn_f9661 - dbw $00, Unkn_f9672 - dbw $00, Unkn_f9683 - dbw $80, Unkn_f9694 - dbw $84, Unkn_f9694 - dbw $88, Unkn_f9694 - dbw $8c, Unkn_f9694 - -Unkn_f9573: - db 1 - db $fc, $fc, $00, $00 - -Unkn_f9578: - db 9 - db $f4, $f4, $00, $00 - db $f4, $fc, $01, $00 - db $f4, $04, $02, $00 - db $fc, $f4, $10, $00 - db $fc, $fc, $11, $00 - db $fc, $04, $12, $00 - db $04, $f4, $20, $00 - db $04, $fc, $21, $00 - db $04, $04, $22, $00 - -Unkn_f959d: - db 12 - db $f8, $e8, $00, $00 - db $f8, $f0, $01, $00 - db $f8, $f8, $02, $00 - db $f8, $00, $03, $00 - db $f8, $08, $04, $00 - db $f8, $10, $05, $00 - db $00, $e8, $10, $00 - db $00, $f0, $11, $00 - db $00, $f8, $12, $00 - db $00, $00, $13, $00 - db $00, $08, $14, $00 - db $00, $10, $15, $00 - -Unkn_f95ce: - db 3 - db $fc, $0b, $00, $10 - db $04, $03, $0f, $10 - db $04, $0b, $10, $10 - -Unkn_f95db: - db 6 - db $fc, $f0, $00, $30 - db $fc, $08, $00, $10 - db $04, $f0, $10, $30 - db $04, $f8, $0f, $30 - db $04, $00, $0f, $10 - db $04, $08, $10, $10 - -Unkn_f95f4: - db 12 - db $f4, $f0, $00, $10 - db $f4, $f8, $01, $10 - db $f4, $00, $01, $30 - db $f4, $08, $00, $30 - db $fc, $f0, $10, $10 - db $fc, $f8, $11, $10 - db $fc, $00, $11, $30 - db $fc, $08, $10, $30 - db $04, $f0, $20, $10 - db $04, $f8, $21, $10 - db $04, $00, $21, $30 - db $04, $08, $20, $30 - -Unkn_f9625: - db 3 - db $04, $f4, $00, $00 - db $04, $fc, $01, $00 - db $04, $04, $02, $00 - -Unkn_f9632: - db 3 - db $fc, $f4, $bf, $00 - db $fc, $fc, $d5, $00 - db $fc, $04, $d0, $00 - -Unkn_f963f: - db 4 - db $fc, $f0, $bf, $00 - db $fc, $f8, $d1, $00 - db $fc, $00, $d5, $00 - db $fc, $08, $d0, $00 - -Unkn_f9650: - db 4 - db $fc, $f0, $bf, $00 - db $fc, $f8, $d3, $00 - db $fc, $00, $d5, $00 - db $fc, $08, $d0, $00 - -Unkn_f9661: - db 4 - db $fc, $f0, $bf, $00 - db $fc, $f8, $d7, $00 - db $fc, $00, $d5, $00 - db $fc, $08, $d0, $00 - -Unkn_f9672: - db 4 - db $fc, $f0, $bf, $00 - db $fc, $f8, $d1, $00 - db $fc, $00, $d8, $00 - db $fc, $08, $d0, $00 - -Unkn_f9683: - db 4 - db $fc, $f0, $bf, $00 - db $fc, $f8, $d5, $00 - db $fc, $00, $d0, $00 - db $fc, $08, $d0, $00 - -Unkn_f9694: - db 12 - db $f4, $f0, $03, $20 - db $f4, $f8, $02, $20 - db $f4, $00, $01, $20 - db $f4, $08, $00, $20 - db $fc, $f0, $13, $20 - db $fc, $f8, $12, $20 - db $fc, $00, $11, $20 - db $fc, $08, $10, $20 - db $04, $f0, $23, $20 - db $04, $f8, $22, $20 - db $04, $00, $21, $20 - db $04, $08, $20, $20 - -Unkn_f96c5: - db 0, 0, 0, 1, 1, 1, 1, 2 - db 2, 2, 1, 1, 1, 1, 0, 0 - db 0, 0, 0, -1, -1, -1, -1, -2 - db -2, -2, -1, -1, -1, -1, 0, 0 - -Unkn_f96e5: - db $00, $00, $00, $00 - db $0b, $0b, $0b, $0b - db $0b, $02, $02, $06 - db $03, $0b, $07, $03 - db $06, $06, $06, $06 - db $07, $07, $07, $07 - db $06, $04, $04, $08 - db $05, $07, $08, $05 - db $0b, $0b, $11, $12 - db $0b, $0b, $13, $03 - db $14, $12, $04, $08 - db $13, $07, $08, $05 - db $06, $14, $06, $14 - db $13, $07, $13, $07 - db $08, $08, $08, $08 - db $14, $12, $14, $12 - db $0b, $11, $02, $14 - db $06, $14, $06, $14 - db $0c, $0c, $0d, $0d - db $0d, $0d, $0d, $0d - db $0e, $0f, $10, $0b - db $12, $13, $12, $13 - -Unkn_f973d: - db $00, $00, $00, $01, $01, $01, $01, $01 -Unkn_f9745: - db $00, $00, $00, $01, $01, $02, $04, $06 -Unkn_f974d: - db $00, $00, $00, $01, $02, $04, $06, $0e -Unkn_f9755: - db $00, $00, $00, $10, $11, $06, $0e, $0e -Unkn_f975d: - db $00, $00, $00, $15, $15, $0e, $0e, $0e -Unkn_f9765: - db $00, $00, $00, $03, $05, $07, $0e, $0e -Unkn_f976d: - db $00, $00, $00, $01, $03, $05, $07, $0e -Unkn_f9775: - db $00, $00, $00, $01, $01, $03, $05, $07 -Unkn_f977d: - db $00, $00, $00, $01, $01, $02, $04, $06 -Unkn_f9785: - db $00, $00, $00, $01, $02, $04, $06, $0e -Unkn_f978d: - db $00, $00, $00, $08, $0f, $0a, $0e, $0e -Unkn_f9795: - db $00, $00, $00, $09, $0d, $0b, $0e, $0e -Unkn_f979d: - db $00, $00, $00, $01, $03, $05, $07, $0e -Unkn_f97a5: - db $00, $00, $00, $01, $01, $03, $05, $07 -Unkn_f97ad: - db $00, $00, $00, $01, $01, $02, $04, $06 -Unkn_f97b5: - db $00, $00, $00, $01, $10, $11, $06, $0e -Unkn_f97bd: - db $00, $00, $00, $01, $15, $15, $0e, $0e -Unkn_f97c5: - db $00, $00, $00, $01, $03, $05, $07, $0e -Unkn_f97cd: - db $00, $00, $00, $01, $01, $03, $05, $07 -Unkn_f97d5: - db $00, $00, $00, $01, $01, $02, $04, $06 -Unkn_f97dd: - db $00, $00, $00, $01, $08, $0f, $0a, $0e -Unkn_f97e5: - db $00, $00, $00, $01, $09, $0d, $0b, $0e -Unkn_f97ed: - db $00, $00, $00, $01, $01, $03, $05, $07 -Unkn_f97f5: - db $00, $00, $00, $01, $01, $10, $11, $06 -Unkn_f97fd: - db $00, $00, $00, $01, $01, $15, $15, $0e -Unkn_f9805: - db $00, $00, $00, $01, $01, $03, $05, $07 -Unkn_f980d: - db $00, $00, $00, $01, $01, $08, $0f, $0a -Unkn_f9815: - db $00, $00, $00, $01, $01, $09, $0d, $0b -Unkn_f981d: - db $00, $00, $00, $14, $14, $14, $14, $14 -Unkn_f9825: - db $00, $00, $00, $12, $13, $13, $13, $13 - -PlayIntroScene: - ld a, [rIE] - push af - xor a - ld [rIF], a - ld a, $f - ld [rIE], a - ld a, $8 - ld [rSTAT], a - call Func_f9f0d - call DelayFrame -.asm_f9841 - ld a, [wc634] - bit 7, a - jr nz, .asm_f986e - call JoypadLowSensitivity - ld a, [hJoyPressed] - and $b - jr nz, .asm_f986e - call Func_f98fc - ld a, $0 - ld [wCurrentAnimatedObjectOAMBufferOffset], a - call RunObjectAnimations - ld a, [wc634] - cp $7 - call z, Func_f98a2 - cp $b - call z, Func_f98cb - call DelayFrame - jr .asm_f9841 - -.asm_f986e - call Func_f9fc9 - xor a - ld [hLCDCPointer], a - call DelayFrame - xor a - ld [rIF], a - pop af - ld [rIE], a - ld a, $90 - ld [hWY], a - call ClearObjectAnimationBuffers - ld hl, wTileMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - xor a - call Func_f9fb3 - call Func_f9fbe - ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a - call DelayFrame - call DelayFrame - call DelayFrame - xor a - ld [H_AUTOBGTRANSFERENABLED], a - ret - -Func_f98a2: - ld a, [wOAMBuffer + 8 * 4 + 3] - or $1 - ld [wOAMBuffer + 8 * 4 + 3], a - ld a, [wOAMBuffer + 14 * 4 + 3] - or $1 - ld [wOAMBuffer + 14 * 4 + 3], a - ld a, [wOAMBuffer + 16 * 4 + 3] - or $1 - ld [wOAMBuffer + 16 * 4 + 3], a -Func_f98b8: - ld a, [wOAMBuffer + 18 * 4 + 3] - or $1 - ld [wOAMBuffer + 18 * 4 + 3], a - ld a, [wOAMBuffer + 19 * 4 + 3] - or $1 - ld [wOAMBuffer + 19 * 4 + 3], a - ret - -Func_f98cb: - ld a, [wOAMBuffer + 18 * 4 + 3] - or $1 - ld [wOAMBuffer + 18 * 4 + 3], a - ld a, [wOAMBuffer + 19 * 4 + 3] - or $1 - ld [wOAMBuffer + 19 * 4 + 3], a - ld a, [wOAMBuffer + 20 * 4 + 3] - or $1 - ld [wOAMBuffer + 20 * 4 + 3], a - ld a, [wOAMBuffer + 25 * 4 + 3] - or $1 - ld [wOAMBuffer + 25 * 4 + 3], a - ld a, [wOAMBuffer + 26 * 4 + 3] - or $1 - ld [wOAMBuffer + 26 * 4 + 3], a - ld a, [wOAMBuffer + 28 * 4 + 3] - or $1 - ld [wOAMBuffer + 28 * 4 + 3], a - ret - -Func_f98fc: - ld a, [wc634] - ld hl, Jumptable_f9906 - call Func_fa06e - jp [hl] - -Jumptable_f9906: - dw Func_f992f - dw Func_f995f - dw Func_f996a - dw Func_f9a08 - dw Func_f9a1e - dw Func_f9a60 - dw Func_f9a6b - dw Func_f9ab1 - dw Func_f9ad8 - dw Func_f9af9 - dw Func_f9b04 - dw Func_f9bf6 - dw Func_f9cac - dw Func_f9d12 - dw Func_f9d22 - dw Func_f9d8f - dw Func_f9dbf - dw Func_f9e12 - -Func_f992a: - ld hl, wc634 - inc [hl] - ret - -Func_f992f: - xor a - ld [hLCDCPointer], a - lb de, $58, $58 - ld a, $1 - call Func_f9e1d - xor a - ld [hSCX], a - ld [hSCY], a - ld a, $90 - ld [hWY], a - ld a, $e4 - ld [rBGP], a - ld [rOBP0], a - ld a, $c4 - ld [rOBP1], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - ld a, $82 - ld [wc635], a - call Func_f992a - ret - -Func_f995f: - call Func_f9e41 - ret nc - call Func_f9e29 - call Func_f992a - ret - -Func_f996a: - call Func_f9e80 - ld c, $8 - call UpdateMusicCTimes - xor a - ld [hLCDCPointer], a - ld hl, vBGMap0 - ld bc, $400 - xor a - call Func_f9fb3 - call Func_f9996 - lb de, $58, $b8 ; overloaded - ld a, $4 ; overloaded - call Func_f99d2 - ld a, $1 - call Func_f9e9a - call Func_f9e35 - call Func_f992a - ret - -Func_f9996: - ld hl, $98d4 - ld de, $20 - ld b, $6 - ld a, $90 -.asm_f99a0 - ld c, $6 - push af - push hl -.asm_f99a4 - ld [hli], a - inc a - dec c - jr nz, .asm_f99a4 - pop hl - add hl, de - pop af - add $10 - dec b - jr nz, .asm_f99a0 - ld a, [hGBC] - and a - jr z, .asm_f99d1 - ld hl, $98d4 - ld de, $20 - ld b, $6 - ld a, $1 - ld [rVBK], a -.asm_f99c2 - ld c, $6 - push hl -.asm_f99c5 - ld [hli], a - dec c - jr nz, .asm_f99c5 - pop hl - add hl, de - dec b - jr nz, .asm_f99c2 - xor a - ld [rVBK], a -.asm_f99d1 - ret - -Func_f99d2: - ld hl, Unkn_f99f0 - ld a, $8 -.asm_f99d7 - push af - ld e, [hl] - inc hl - ld d, [hl] - inc hl - ld a, [hli] - push hl - push af - ld a, $8 - call SpawnAnimatedObject - pop af - ld hl, $b - add hl, bc - ld [hl], a - pop hl - pop af - dec a - jr nz, .asm_f99d7 - ret - -Unkn_f99f0: - db $d0, $20, $02 - db $f0, $30, $04 - db $d0, $40, $06 - db $c0, $50, $08 - db $e0, $60, $08 - db $c0, $70, $06 - db $e0, $80, $04 - db $f0, $90, $02 - -Func_f9a08: - call Func_f9e41 - jr c, .asm_f9a17 - ld a, [hSCX] - cp $68 - ret z - add $4 - ld [hSCX], a - ret - -.asm_f9a17 - call MaskAllAnimatedObjectStructs - call Func_f992a - ret - -Func_f9a1e: - call Func_f9e80 - ld c, $5 - call UpdateMusicCTimes - ld a, [hGBC] - and a - jr z, .asm_f9a47 - ld hl, $98d4 - ld de, $20 - ld b, $6 - ld a, $1 - ld [rVBK], a - xor a -.asm_f9a38 - ld c, $6 - push hl -.asm_f9a3b - ld [hli], a - dec c - jr nz, .asm_f9a3b - pop hl - add hl, de - dec b - jr nz, .asm_f9a38 - xor a - ld [rVBK], a -.asm_f9a47 - xor a - ld [hLCDCPointer], a - call Func_f9e5f - lb de, $58, $58 - ld a, $2 - call Func_f9e1d - xor a - call Func_f9e9a - call Func_f9e35 - call Func_f992a - ret - -Func_f9a60: - call Func_f9e41 - ret nc - call Func_f9e29 - call Func_f992a - ret - -Func_f9a6b: - call Func_f9e80 - ld c, $5 - call UpdateMusicCTimes - ld a, $42 - ld [hLCDCPointer], a - call Func_f9ec4 - ld hl, vBGMap0 - ld bc, $60 - xor a - call Func_f9fb3 - ld hl, $9860 - ld c, $10 - ld a, $20 -.asm_f9a8b - ld [hli], a - inc a - ld [hli], a - dec a - dec c - jr nz, .asm_f9a8b - ld hl, $9880 - ld bc, $300 - ld a, $10 - call Func_f9fb3 - lb de, $40, $f8 - ld a, $5 - call Func_f9e1d - ld a, $1 - call Func_f9e9a - call Func_f9e3b - call Func_f992a - ret - -Func_f9ab1: - call Func_f9e41 - jr c, .asm_f9ad1 - ld hl, hSCX - inc [hl] - inc [hl] - ld hl, wc800 - ld de, wc800 + 1 - ld a, [hl] - push af - ld c, $ff -.asm_f9ac5 - ld a, [de] - inc de - ld [hli], a - dec c - jr nz, .asm_f9ac5 - pop af - ld [hl], a - call Func_f9ef8 - ret - -.asm_f9ad1 - call Func_f9e29 - call Func_f992a - ret - -Func_f9ad8: - call Func_f9e80 - ld c, $5 - call UpdateMusicCTimes - xor a - ld [hLCDCPointer], a - call Func_f9e5f - lb de, $58, $58 - ld a, $3 - call Func_f9e1d - xor a - call Func_f9e9a - call Func_f9e35 - call Func_f992a - ret - -Func_f9af9: - call Func_f9e41 - ret nc - call Func_f9e29 - call Func_f992a - ret - -Func_f9b04: - call Func_f9e80 - ld c, $5 - call UpdateMusicCTimes - xor a - ld [hLCDCPointer], a - ld hl, vBGMap0 - ld bc, $400 - xor a - call Func_f9fb3 - ld hl, vBGMap0 - ld bc, $100 - ld a, $2 - call Func_f9fb3 - ld hl, $9900 - ld de, Unkn_f9b6e - lb bc, 6, 20 - call .FillBGMapBox - ld hl, $988c - ld de, Unkn_f9be6 - lb bc, 3, 4 - call .FillBGMapBox - ld hl, $98e3 - ld de, Unkn_f9bf2 - lb bc, 2, 2 - call .FillBGMapBox - lb de, $98, $58 - ld a, $6 - call Func_f9e1d - ld a, $1 - call Func_f9e9a - call Func_f9e35 - call Func_f992a - ret - -.FillBGMapBox: -.fill_row - push bc - push hl -.fill_col - ld a, [de] - inc de - ld [hli], a - dec c - jr nz, .fill_col - pop hl - ld bc, $20 - add hl, bc - pop bc - dec b - jr nz, .fill_row - ret - -Unkn_f9b6e: INCBIN "gfx/unknown_f9b6e.map" -Unkn_f9be6: INCBIN "gfx/unknown_f9be6.map" -Unkn_f9bf2: INCBIN "gfx/unknown_f9bf2.map" - -Func_f9bf6: - call Func_f9e41 - jr c, .asm_f9c25 - ld a, [wc635] - and $7 - ret nz - ld a, [wc635] - and $8 - sla a - sla a - sla a - ld e, a - ld d, $0 - ld hl, GFX_f9c2c - add hl, de - ld a, l - ld [H_VBCOPYSRC], a - ld a, h - ld [H_VBCOPYSRC + 1], a - xor a - ld [H_VBCOPYDEST], a - ld a, $96 - ld [H_VBCOPYDEST + 1], a - ld a, $4 - ld [H_VBCOPYSIZE], a - ret - -.asm_f9c25 - call Func_f9e29 - call Func_f992a - ret - -GFX_f9c2c: INCBIN "gfx/unknown_f9c2c.2bpp" -GFX_f9c6c: INCBIN "gfx/unknown_f9c6c.2bpp" ; indirectly referenced - -Func_f9cac: - call Func_f9e80 - ld c, $5 - call UpdateMusicCTimes - xor a - ld [hLCDCPointer], a - ld hl, vBGMap0 - ld bc, $80 - ld a, $1 - call Func_f9fb3 - ld hl, $9880 - ld bc, $140 - xor a - call Func_f9fb3 - ld hl, $99c0 - ld bc, $80 - ld a, $1 - call Func_f9fb3 - ld hl, $98c5 - ld de, $20 - ld a, $4 - ld b, $8 -.asm_f9ce1 - ld c, $c - push hl -.asm_f9ce4 - ld [hli], a - inc a - dec c - jr nz, .asm_f9ce4 - pop hl - add hl, de - add $4 - dec b - jr nz, .asm_f9ce1 - ld hl, $98c4 - ld [hl], $3 - ld hl, $98e4 - ld [hl], $74 - ld hl, $99a5 - ld [hl], $0 - lb de, $60, $58 - ld a, $9 - call Func_f9e1d - xor a - call Func_f9e9a - call Func_f9e35 - call Func_f992a - ret - -Func_f9d12: - call Func_f9e41 - ret nc - lb de, $68, $58 - ld a, $a - call SpawnAnimatedObject - call Func_f992a - ret - -Func_f9d22: - ld de, Unkn_f9dd6 - call Func_f9e4d - jr c, .asm_f9d3c - ld [rBGP], a - ld [rOBP0], a - and $f0 - ld [rOBP1], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - ret - -.asm_f9d3c - call MaskAllAnimatedObjectStructs - call Func_f9fbe - ld hl, wTileMap - ld bc, $50 - ld a, $1 - call Func_f9fb3 - coord hl, 0, 4 - ld bc, CopyVideoDataAlternate - xor a - call Func_f9fb3 - coord hl, 0, 14 - ld bc, $50 - ld a, $1 - call Func_f9fb3 - ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a - call DelayFrame - call DelayFrame - call DelayFrame - xor a - ld [H_AUTOBGTRANSFERENABLED], a - ld a, $e4 - ld [rOBP0], a - ld [rBGP], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - lb de, $58, $58 - ld a, $7 - call Func_f9e1d - call Func_f992a - ld a, $28 - ld [wc635], a - ret - -Func_f9d8f: - call Func_f9e41 - jr c, .asm_f9dad - ld a, [wc635] - and $3 - ret nz - ld a, [rOBP0] - xor $ff - ld [rOBP0], a - ld a, [rBGP] - xor $3 - ld [rBGP], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - ret - -.asm_f9dad - xor a - ld [hLCDCPointer], a - ld a, $e4 - ld [rBGP], a - ld [rOBP0], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - call Func_f992a -Func_f9dbf: - ld de, Unkn_f9e0a - call Func_f9e4d - jr c, .asm_f9dd2 - ld [rOBP0], a - ld [rBGP], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - ret - -.asm_f9dd2 - call Func_f992a - ret - -Unkn_f9dd6: - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $e4 - db $e4, $c0, $c0, $ff - -Unkn_f9e0a: - db $e4, $90, $90, $40 - db $40, $00, $00, $ff - -Func_f9e12: - ld c, 64 - call DelayFrames - ld hl, wc634 - set 7, [hl] - ret - -Func_f9e1d: - call SpawnAnimatedObject - ld a, c - ld [wc636], a - ld a, b - ld [wc636 + 1], a - ret - -Func_f9e29: - ld a, [wc636] - ld c, a - ld a, [wc636 + 1] - ld b, a - call MaskCurrentAnimatedObjectStruct - ret - -Func_f9e35: - ld a, $80 - ld [wc635], a - ret - -Func_f9e3b: - ld a, $58 - ld [wc635], a - ret - -Func_f9e41: - ld hl, wc635 - ld a, [hl] - and a - jr z, .asm_f9e4b - dec [hl] - and a - ret - -.asm_f9e4b - scf - ret - -Func_f9e4d: - ld hl, wc635 - ld a, [hl] - inc [hl] - ld l, a - ld h, $0 - add hl, de - ld a, [hl] - cp $ff - jr z, .asm_f9e5d - and a - ret - -.asm_f9e5d - scf - ret - -Func_f9e5f: - ld hl, vBGMap0 - ld bc, $80 - ld a, $1 - call Func_f9fb3 - ld hl, $9880 - ld bc, $140 - xor a - call Func_f9fb3 - ld hl, $99c0 - ld bc, $80 - ld a, $1 - call Func_f9fb3 - ret - -Func_f9e80: - xor a - ld [rBGP], a - ld [rOBP0], a - ld [rOBP1], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - call DelayFrame - call DelayFrame - call DisableLCD - ret - -Func_f9e9a: - ld e, a - callab Func_720ad - xor a - ld [hSCX], a - ld [hSCY], a - ld a, $90 - ld [hWY], a - ld a, $e3 - ld [rLCDC], a - ld a, $e4 - ld [rBGP], a - ld [rOBP0], a - ld a, $e0 - ld [rOBP1], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - ret - -Func_f9ec4: - ld de, wc800 - ld a, $8 -.asm_f9ec9 - push af - ld hl, Unkn_f9ed8 - ld bc, $20 - call Func_f9faa - pop af - dec a - jr nz, .asm_f9ec9 - ret - -Unkn_f9ed8: - db 0, 0, 1, 2, 2, 3, 3, 3 - db 4, 3, 3, 3, 2, 2, 1, 0 - db 0, 0, -1, -2, -2, -3, -3, -3 - db -4, -3, -3, -3, -2, -2, -1, 0 - -Func_f9ef8: - ld a, $10 - ld [H_VBCOPYSRC], a - ld a, $c8 - ld [H_VBCOPYSRC + 1], a - ld a, $10 - ld [H_VBCOPYDEST], a - ld a, $c7 - ld [H_VBCOPYDEST + 1], a - ld a, $7 - ld [H_VBCOPYSIZE], a - ret - -Func_f9f0d: - xor a - ld [H_AUTOBGTRANSFERENABLED], a - ld [hSCX], a - ld [hSCY], a - ld [H_AUTOBGTRANSFERDEST], a - ld a, $98 - ld [H_AUTOBGTRANSFERDEST + 1], a - call Func_f9f9e - ld hl, wTileMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $1 - call Func_f9fb3 - coord hl, 0, 4 - ld bc, CopyVideoDataAlternate - xor a - call Func_f9fb3 - ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a - call DelayFrame - call DelayFrame - call DelayFrame - xor a - ld [H_AUTOBGTRANSFERENABLED], a - ld de, $6b5a - ld hl, $8000 - ld bc, $3eff - call CopyVideoData - ld de, $635a - ld hl, $9000 - ld bc, $3e80 - call CopyVideoData - call ClearObjectAnimationBuffers - call Func_f9f75 - ld b, $8 - call RunPaletteCommand - xor a - ld hl, wc634 - ld [hli], a - ld [hli], a - ld [hli], a - ld [hl], a - ld a, MUSIC_INTRO_BATTLE - ld c, BANK(Music_IntroBattle) - call PlayMusic - ret - -Func_f9f75: - ld a, Unkn_f9fda % $100 - ld [wAnimatedObjectSpawnStateDataPointer], a - ld a, Unkn_f9fda / $100 - ld [wAnimatedObjectSpawnStateDataPointer + 1], a - ld a, Jumptable_f9ffb % $100 - ld [wAnimatedObjectJumptablePointer], a - ld a, Jumptable_f9ffb / $100 - ld [wAnimatedObjectJumptablePointer + 1], a - ld a, Unkn_fa13d % $100 - ld [wAnimatedObjectOAMDataPointer], a - ld a, Unkn_fa13d / $100 - ld [wAnimatedObjectOAMDataPointer + 1], a - ld a, Unkn_fa0ea % $100 - ld [wAnimatedObjectFramesDataPointer], a - ld a, Unkn_fa0ea / $100 - ld [wAnimatedObjectFramesDataPointer + 1], a - ret - -Func_f9f9e: - ld hl, wTileMap - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $7f - call Func_f9fb3 - ret - -Func_f9faa: - ld a, [hli] - ld [de], a - inc de - dec bc - ld a, c - or b - jr nz, Func_f9faa - ret - -Func_f9fb3: - push de - ld e, a -.asm_f9fb5 - ld a, e - ld [hli], a - dec bc - ld a, c - or b - jr nz, .asm_f9fb5 - pop de - ret - -Func_f9fbe: - ld hl, wSpriteDataEnd - ld bc, $a0 - xor a - call Func_f9fb3 - ret - -Func_f9fc9: - xor a - ld [rBGP], a - ld [rOBP0], a - ld [rOBP1], a - call UpdateGBCPal_BGP - call UpdateGBCPal_OBP0 - call UpdateGBCPal_OBP1 - ret - -Unkn_f9fda: - db $00, $00, $00 - db $01, $01, $00 - db $02, $01, $00 - db $03, $01, $00 - db $04, $02, $00 - db $05, $03, $00 - db $06, $04, $00 - db $07, $01, $00 - db $08, $05, $00 - db $09, $01, $00 - db $0a, $01, $00 - -Jumptable_f9ffb: - dw Func_fa007 - dw Func_fa007 - dw Func_fa008 - dw Func_fa014 - dw Func_fa02b - dw Func_fa062 - -Func_fa007: - ret - -Func_fa008: - ld hl, $4 - add hl, bc - ld a, [hl] - cp $58 - ret z - sub $4 - ld [hl], a - ret - -Func_fa014: - ld hl, $4 - add hl, bc - ld a, [hl] - cp $58 - jr z, .asm_fa020 - add $4 - ld [hl], a -.asm_fa020 - ld hl, $5 - add hl, bc - cp $58 - ret z - add $1 - ld [hl], a - ret - -Func_fa02b: - ld hl, $b - add hl, bc - ld e, [hl] - ld d, $0 - ld hl, Jumptable_fa03b - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] - -Jumptable_fa03b: - dw Func_fa03f - dw Func_fa051 - -Func_fa03f: - ld hl, $5 - add hl, bc - ld a, [hl] - cp $58 - jr z, .asm_fa04c - sub $2 - ld [hl], a - ret - -.asm_fa04c - ld hl, $b - add hl, bc - inc [hl] -Func_fa051: - ld hl, $c - add hl, bc - ld a, [hl] - inc [hl] - ld d, $8 - call Func_fa079 - ld hl, $7 - add hl, bc - ld [hl], a - ret - -Func_fa062: - ld hl, $b - add hl, bc - ld a, [hl] - ld hl, $4 - add hl, bc - add [hl] - ld [hl], a - ret - -Func_fa06e: - ld e, a - ld d, $0 - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - ret - -Func_fa077: ; cosine - add $10 -Func_fa079: - and $3f - cp $20 - jr nc, .asm_fa084 - call Func_fa08e - ld a, h - ret - -.asm_fa084 - and $1f - call Func_fa08e - ld a, h - xor $ff - inc a - ret - -Func_fa08e: - ld e, a - ld a, d - ld d, $0 - ld hl, Unkn_fa0aa - add hl, de - add hl, de - ld e, [hl] - inc hl - ld d, [hl] - ld hl, $0 -.asm_fa09d - srl a - jr nc, .asm_fa0a2 - add hl, de -.asm_fa0a2 - sla e - rl d - and a - jr nz, .asm_fa09d - ret - -Unkn_fa0aa: - sine_wave $100 - -Unkn_fa0ea: - dw Unkn_fa100 - dw Unkn_fa103 - dw Unkn_fa10a - dw Unkn_fa111 - dw Unkn_fa118 - dw Unkn_fa11b - dw Unkn_fa11e - dw Unkn_fa121 - dw Unkn_fa124 - dw Unkn_fa127 - dw Unkn_fa138 - -Unkn_fa100: - frame $00, 32 - endanim - -Unkn_fa103: - frame $01, 4 - frame $02, 4 - frame $03, 4 - dorestart - -Unkn_fa10a: - frame $04, 4 - frame $05, 4 - frame $06, 4 - dorestart - -Unkn_fa111: - frame $07, 4 - frame $08, 4 - frame $09, 4 - dorestart - -Unkn_fa118: - frame $0a, 32 - endanim - -Unkn_fa11b: - frame $0b, 32 - endanim - -Unkn_fa11e: - frame $0c, 32 - endanim - -Unkn_fa121: - frame $0d, 32 - endanim - -Unkn_fa124: - frame $0e, 32 - endanim - -Unkn_fa127: - frame $0f, 31 - frame $11, 2 - frame $0f, 2 - frame $11, 2 - frame $0f, 31 - frame $11, 2 - frame $0f, 23 - frame $10, 32 - endanim - -Unkn_fa138: - frame $12, 4 - frame $13, 4 - dorestart - -Unkn_fa13d: - dbw $00, Unkn_fa179 - dbw $96, Unkn_fa17e - dbw $98, Unkn_fa17e - dbw $9a, Unkn_fa17e - dbw $0c, Unkn_fa18f - dbw $0e, Unkn_fa18f - dbw $3c, Unkn_fa18f - dbw $60, Unkn_fa1b0 - dbw $70, Unkn_fa1b0 - dbw $80, Unkn_fa1b0 - dbw $90, Unkn_fa201 - dbw $00, Unkn_fa201 - dbw $06, Unkn_fa201 - dbw $c6, Unkn_fa292 - dbw $6d, Unkn_fa2f7 - dbw $f0, Unkn_fa308 - dbw $f4, Unkn_fa308 - dbw $f8, Unkn_fa308 - dbw $9c, Unkn_fa329 - dbw $ec, Unkn_fa329 - -Unkn_fa179: - db 1 - db $fc, $fc, $00, $00 -Unkn_fa17e: - db 4 - db $f8, $f8, $00, $00 - db $f8, $00, $01, $00 - db $00, $f8, $10, $00 - db $00, $00, $11, $00 - -Unkn_fa18f: - db 8 - db $f0, $f8, $00, $00 - db $f0, $00, $01, $00 - db $f8, $f8, $10, $00 - db $f8, $00, $11, $00 - db $00, $f8, $20, $00 - db $00, $00, $20, $20 - db $08, $f8, $21, $00 - db $08, $00, $21, $20 - -Unkn_fa1b0: - db 20 - db $e8, $f8, $00, $00 - db $e8, $00, $01, $00 - db $f0, $f8, $02, $00 - db $f0, $00, $03, $00 - db $f8, $f0, $04, $00 - db $f8, $f8, $05, $00 - db $f8, $00, $06, $00 - db $f8, $08, $04, $20 - db $00, $f0, $07, $00 - db $00, $f8, $08, $00 - db $00, $00, $08, $20 - db $00, $08, $07, $20 - db $08, $f0, $09, $00 - db $08, $f8, $0a, $00 - db $08, $00, $0a, $20 - db $08, $08, $09, $20 - db $10, $f0, $0b, $00 - db $10, $f8, $0c, $00 - db $10, $00, $0c, $20 - db $10, $08, $0b, $20 - -Unkn_fa201: - db 36 - db $e8, $e8, $00, $00 - db $e8, $f0, $01, $00 - db $e8, $f8, $02, $00 - db $e8, $00, $03, $00 - db $e8, $08, $04, $00 - db $e8, $10, $05, $00 - db $f0, $e8, $10, $00 - db $f0, $f0, $11, $00 - db $f0, $f8, $12, $00 - db $f0, $00, $13, $00 - db $f0, $08, $14, $00 - db $f0, $10, $15, $00 - db $f8, $e8, $20, $00 - db $f8, $f0, $21, $00 - db $f8, $f8, $22, $00 - db $f8, $00, $23, $00 - db $f8, $08, $24, $00 - db $f8, $10, $25, $00 - db $00, $e8, $30, $00 - db $00, $f0, $31, $00 - db $00, $f8, $32, $00 - db $00, $00, $33, $00 - db $00, $08, $34, $00 - db $00, $10, $35, $00 - db $08, $e8, $40, $00 - db $08, $f0, $41, $00 - db $08, $f8, $42, $00 - db $08, $00, $43, $00 - db $08, $08, $44, $00 - db $08, $10, $45, $00 - db $10, $e8, $50, $00 - db $10, $f0, $51, $00 - db $10, $f8, $52, $00 - db $10, $00, $53, $00 - db $10, $08, $54, $00 - db $10, $10, $55, $00 - -Unkn_fa292: - db 25 - db $ec, $f0, $00, $00 - db $ec, $f8, $01, $00 - db $ec, $00, $02, $00 - db $ec, $08, $03, $00 - db $ec, $10, $04, $00 - db $f4, $f0, $05, $00 - db $f4, $f8, $06, $00 - db $f4, $00, $07, $00 - db $f4, $08, $08, $00 - db $f4, $10, $09, $00 - db $fc, $f0, $10, $00 - db $fc, $f8, $11, $00 - db $fc, $00, $12, $00 - db $fc, $08, $13, $00 - db $fc, $10, $14, $00 - db $04, $f0, $15, $00 - db $04, $f8, $16, $00 - db $04, $00, $17, $00 - db $04, $08, $18, $00 - db $04, $10, $19, $00 - db $0c, $f0, $20, $00 - db $0c, $f8, $21, $00 - db $0c, $00, $22, $00 - db $0c, $08, $23, $00 - db $0c, $10, $24, $00 - -Unkn_fa2f7: - db 4 - db $fc, $f0, $00, $00 - db $fc, $f8, $01, $00 - db $fc, $00, $01, $20 - db $fc, $08, $00, $20 - -Unkn_fa308: - db 8 - db $f8, $e8, $00, $10 - db $f8, $f0, $01, $10 - db $00, $e8, $02, $10 - db $00, $f0, $03, $10 - db $f8, $08, $01, $30 - db $f8, $10, $00, $30 - db $00, $08, $03, $30 - db $00, $10, $02, $30 - -Unkn_fa329: - db 12 - db $f8, $d8, $00, $10 - db $f8, $e0, $01, $10 - db $f8, $e8, $02, $10 - db $00, $d8, $10, $10 - db $00, $e0, $11, $10 - db $00, $e8, $12, $10 - db $f8, $10, $02, $30 - db $f8, $18, $01, $30 - db $f8, $20, $00, $30 - db $00, $10, $12, $30 - db $00, $18, $11, $30 - db $00, $20, $10, $30 - +INCLUDE "engine/surfing_minigame.asm" +INCLUDE "engine/yellow_intro.asm" +INCLUDE "data/animated_objects_3e_2.asm" YellowIntroGraphics: INCBIN "gfx/yellow_intro.2bpp" - INCLUDE "engine/animated_objects_3e.asm" diff --git a/engine/bank3f.asm b/engine/bank3f.asm index 85674ec4..23eadbb1 100644 --- a/engine/bank3f.asm +++ b/engine/bank3f.asm @@ -1,1804 +1,10 @@ INCLUDE "data/map_songs.asm" INCLUDE "data/map_header_pointers.asm" INCLUDE "data/map_header_banks.asm" - -Func_fc4dd:: ; fc4dd (3f:44dd) -; possibly to test if pika should be out? - ld a, [wPikachuOverworldStateFlags] - bit 5, a - jr nz, .hide ; 3f:44f8 - ld a, [wPikachuOverworldStateFlags] - bit 7, a - jr nz, .hide - call IsStarterPikachuInOurParty - jr nc, .hide - ld a, [wWalkBikeSurfState] - and a - jr nz, .hide - scf - ret - -.hide - and a - ret - -Func_fc4fa:: ; fc4fa (3f:44fa) - ld hl, wPikachuOverworldStateFlags - bit 4, [hl] - res 4, [hl] - jr nz, .asm_fc515 - call EnablePikachuFollowingPlayer - call Func_fc523 - ld a, $ff - ld [wSpriteStateData1 + $f2], a - call ClearPikachuFollowCommandBuffer - call Func_fc5bc - ret - -.asm_fc515 - call Func_fc53f - xor a - ld [wd431], a - ld a, [wSpriteStateData1 + $9] - ld [wSpriteStateData1 + $f9], a - ret - -Func_fc523:: ; fc523 (3f:4523) - ld hl, wSpriteStateData1 + $f0 - call Func_fc52c - ld hl, wSpriteStateData2 + $f0 -Func_fc52c:: ; fc52c (3f:4523) - ld bc, $10 - xor a - call FillMemory - ret - -Func_fc534:: ; fc534 (3f:4534) - call Func_fc53f - call Func_fc5bc - xor a - ld [wd431], a - ret - -Func_fc53f:: ; fc53f (3f:453f) - ld bc, wSpriteStateData1 + $f0 - ld a, [wYCoord] - add $4 - ld e, a - ld a, [wXCoord] - add $4 - ld d, a - ld a, [wd431] - and a - jr z, .asm_fc5aa - cp $1 - jr z, .asm_fc59e - cp $2 - jr z, .asm_fc584 - cp $3 - jr z, .asm_fc5aa - cp $4 - jr z, .asm_fc5a4 - cp $5 - jr z, .asm_fc5a7 - cp $6 - jr z, .asm_fc5a1 - cp $7 - jr z, .asm_fc572 - jr .asm_fc59e - -.asm_fc572 - ld a, [wSpriteStateData1 + $9] - and a ; SPRITE_FACING_DOWN - jr z, .asm_fc5a4 - cp SPRITE_FACING_UP - jr z, .asm_fc5a7 - cp SPRITE_FACING_LEFT - jr z, .asm_fc5a1 - cp SPRITE_FACING_RIGHT - jr z, .asm_fc59e -.asm_fc584 - ld a, [wSpriteStateData1 + $9] - and a - jr nz, .asm_fc58d - dec e - jr .asm_fc5aa - -.asm_fc58d - cp SPRITE_FACING_UP - jr nz, .asm_fc594 - inc e - jr .asm_fc5aa - -.asm_fc594 - cp SPRITE_FACING_LEFT - jr nz, .asm_fc59b - inc d - jr .asm_fc5aa - -.asm_fc59b - dec d - jr .asm_fc5aa - -.asm_fc59e - inc d - jr .asm_fc5aa - -.asm_fc5a1 - dec d - jr .asm_fc5aa - -.asm_fc5a4 - inc e - jr .asm_fc5aa - -.asm_fc5a7 - dec e - jr .asm_fc5aa ; useless jr -.asm_fc5aa - ld hl, $104 - add hl, bc - ld [hl], e - inc hl - ld [hl], d - inc hl -Func_fc4b2:: ; fc4b2 (3f:44b2) - ld [hl], $fe - push hl - ld hl, wd472 - set 5, [hl] - pop hl - ret - -Func_fc5bc:: ; fc5bc (3f:45bc) - ld a, $49 - ld [wSpriteStateData1 + $f0], a - ld a, $ff - ld [wSpriteStateData1 + $f2], a - ld a, [wd431] - and a - jr z, .asm_fc5e4 - cp $1 - jr z, .asm_fc5e4 - cp $3 - jr z, .asm_fc5eb - cp $4 - jr z, .asm_fc5e4 - cp $6 - jr z, .asm_fc5e4 - cp $7 - jr z, .asm_fc5f1 - call Func_fccb2 - ret - -.asm_fc5e4 - ld a, [wSpriteStateData1 + $9] - ld [wSpriteStateData1 + $f9], a - ret - -.asm_fc5eb - ld a, $0 - ld [wSpriteStateData1 + $f9], a - ret - -.asm_fc5f1 - ld a, [wSpriteStateData1 + $9] - xor $4 - ld [wSpriteStateData1 + $f9], a - ret - -Func_fc5fa:: ; fc5fa (3f:45fa) - ld a, [wCurMap] - cp OAKS_LAB - jr z, .asm_fc63d - cp ROUTE_22_GATE - jr z, .asm_fc62d - cp MT_MOON_2 - jr z, .asm_fc635 - cp ROCK_TUNNEL_1 - jr z, .asm_fc645 - ld a, [wCurMap] - ld hl, Pointer_fc64b - call Func_1568 ; similar to IsInArray, but not the same - jr c, .asm_fc639 - ld a, [wCurMap] - ld hl, Pointer_fc653 - call Func_1568 - jr nc, .asm_fc641 - ld a, [wSpriteStateData1 + $9] - and a - jr nz, .asm_fc641 - ld a, $3 - jr .asm_fc647 - -.asm_fc62d - ld a, [wSpriteStateData1 + $9] - and a - jr z, .asm_fc645 - jr .asm_fc641 - -.asm_fc635 - ld a, $3 - jr .asm_fc647 - -.asm_fc639 - ld a, $4 - jr .asm_fc647 - -.asm_fc63d - ld a, $6 - jr .asm_fc647 - -.asm_fc641 - ld a, $1 - jr .asm_fc647 - -.asm_fc645 - ld a, $3 -.asm_fc647 - ld [wd431], a - ret - -Pointer_fc64b:: ; fc64b (3f:464b) - db $c2, $4c, $4f, $ba, $be, $b8, $54, $ff - -Pointer_fc653:: ; fc653 (3f:4653) - db $2f, $e6, $3e, $5e, $80, $31, $a4, $ff - -Func_fc65b:: ; fc65b (3f:465b) - ld a, [wCurMap] - cp VIRIDIAN_FOREST_EXIT - jr z, .asm_fc673 - cp VIRIDIAN_FOREST_ENTRANCE - jr z, .asm_fc67c - ld a, [wCurMap] - ld hl, Pointer_fc68e - call Func_1568 - jr c, .asm_fc688 - jr .asm_fc684 - -.asm_fc673 - ld a, [wSpriteStateData1 + $9] - cp SPRITE_FACING_UP - jr z, .asm_fc688 - jr .asm_fc684 - -.asm_fc67c - ld a, [wSpriteStateData1 + $9] - and a ; SPRITE_FACING_DOWN - jr z, .asm_fc684 - jr .asm_fc688 - -.asm_fc684 - ld a, $0 - jr .asm_fc68a - -.asm_fc688 - ld a, $1 -.asm_fc68a - ld [wd431], a - ret - -Pointer_fc68e:: ; fc68e (3f:468e) - db $33, $dd, $df, $e0, $e1, $de, $ec, $7f, $a8, $a9, $aa, $ff - -Func_fc69a:: ; fc69a (3f:469a) - ld a, [wCurMap] - cp ROUTE_22_GATE - jr z, .asm_fc6a7 - cp ROUTE_2_GATE - jr z, .asm_fc6b0 - jr .asm_fc6bd - -.asm_fc6a7 - ld a, [wSpriteStateData1 + $9] - cp SPRITE_FACING_UP - jr z, .asm_fc6b9 - jr .asm_fc6bd - -.asm_fc6b0 - ld a, [wSpriteStateData1 + $9] - cp SPRITE_FACING_UP - jr z, .asm_fc6b9 - jr .asm_fc6bd - -.asm_fc6b9 - ld a, $1 - jr .asm_fc6c1 - -.asm_fc6bd - ld a, $3 - jr .asm_fc6c1 - -.asm_fc6c1 - ld [wd431], a - ret - -Func_fc6c5:: ; fc6c5 (3f:46c5) - push hl - ld hl, wPikachuOverworldStateFlags - set 2, [hl] - pop hl - ret - -Func_fc6cd:: ; fc6cd (3f:46cd) - push hl - ld hl, wPikachuOverworldStateFlags - res 2, [hl] - pop hl - ret - -Func_fc6d5:: ; fc6d5 (3f:46d5) - call Func_fc6cd - call Func_fc727 - ret nc - push bc - call Func_fcd25 - pop bc - ret c - ld bc, wSpriteStateData1 + $f0 - ld hl, $1 - add hl, bc - bit 7, [hl] - jp nz, asm_fc745 - ld a, [wFontLoaded] - bit 0, a - jp nz, asm_fc76a - call CheckPikachuFollowingPlayer - jp nz, asm_fc76a - ld a, [hl] - and $7f - cp $a - jr c, .asm_fc704 - xor a -.asm_fc704 - add a - ld e, a - ld d, 0 - ld hl, PointerTable_fc710 - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl - -PointerTable_fc710: ; fc710 (3f:4710) - dw Func_fc793 - dw Func_fc7aa - dw Func_fc803 - dw asm_fc9c3 - dw asm_fca1c - dw asm_fc9ee - dw asm_fc87f - dw asm_fc904 - dw asm_fc937 - dw asm_fc969 - dw Func_fc726 - -Func_fc726: ; fc726 (3f:4726) - ret - -Func_fc727: ; fc727 (3f:4727) - call Func_fc4dd - jr nc, .asm_fc73b - ld a, [wSpriteStateData1 + $f1] - and a - jr nz, .asm_fc739 - push bc - push hl - call Func_fc534 - pop hl - pop bc -.asm_fc739 - scf - ret - -.asm_fc73b - ld hl, wSpriteStateData1 + $f2 - ld [hl], $ff - dec hl - ld [hl], $0 - xor a - ret - -asm_fc745: ; fc745 (3f:4745) - ld hl, $1 - add hl, bc - res 7, [hl] - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], a - call CheckPikachuFollowingPlayer - jr nz, .asm_fc75f - ld a, [wSpriteStateData1 + $9] - xor $4 - ld hl, $9 - add hl, bc - ld [hl], a -.asm_fc75f - xor a - ld hl, $7 - add hl, bc - ld [hli], a - ld [hl], a - call Func_fca99 - ret - -asm_fc76a: ; fc76a (3f:476a) - xor a - ld hl, $7 - add hl, bc - ld [hli], a - ld [hl], a - call Func_fca99 - call Func_fc82e - jr c, .asm_fc783 - push bc - callab InitializeSpriteScreenPosition - pop bc -.asm_fc783 - ld hl, $1 - add hl, bc - ld [hl], $1 - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], $0 - call Func_fcba1 - ret - -Func_fc793: ; fc793 (3f:4793) - call Func_fcba1 - push bc - callab InitializeSpriteScreenPosition - pop bc - ld hl, $2 - add hl, bc - ld [hl], $ff - dec hl - ld [hl], $1 - ret - -Func_fc7aa: ; fc7aa (3f:47aa) - call Func_fcc92 - jp c, Func_fc803 - dec a - ld l, a - ld h, $0 - add hl, hl - add hl, hl - ld de, Pointer_fc7e3 - add hl, de - ld d, h - ld e, l - ld a, [de] - inc de - ld hl, $9 - add hl, bc - ld [hl], a - ld a, [de] - inc de - ld hl, $5 - add hl, bc - ld [hl], a - dec hl - dec hl - ld a, [de] - ld [hl], a - inc de - ld a, [de] - ld hl, $1 - add hl, bc - ld [hl], a - cp $4 - jp z, Func_fca0a - call Func_fcd17 - jp c, Func_fc9df - jp Func_fc9b4 - -Pointer_fc7e3: ; fc7e3 (3f:47e3) - db $0, $0 - db $1, $3 - db $4, $0 - db $ff, $3 - db $8, $ff - db $0, $3 - db $c, $1 - db $0, $3 - db $0, $0 - db $1, $4 - db $4, $0 - db $ff, $4 - db $8, $ff - db $0, $4 - db $c, $1 - db $0, $4 - -Func_fc803: ; fc803 (3f:4803) - call Func_fcae2 - ret c - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - dec [hl] - jr nz, .asm_fc823 - push hl - call Func_fccee - pop hl - cp $5 - jr nc, Func_fc842 - ld [hl], $20 - call Random - and $c - ld hl, $9 - add hl, bc - ld [hl], a -.asm_fc823 - xor a - ld hl, $7 - add hl, bc - ld [hli], a - ld [hl], a - call Func_fca99 - ret - -Func_fc82e: ; fc82e (3f:482e) - ld a, [wWalkCounter] - and a - ret z - scf - ret - -Func_fc835: ; fc835 (3f:4835) - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], $10 - ld hl, $1 - add hl, bc - ld [hl], $1 - ret - -Func_fc842: ; fc842 (3f:4842) - ld hl, $0 - push af - call Random - ld a, [hRandomAdd] - and %11 - ld e, a - ld d, $0 - ld hl, PointerTable_fc85a - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - pop af - jp hl - -PointerTable_fc85a: ; fc85a (3f:485a) - dw Func_fc862 - dw Func_fc8f8 - dw Func_fc92b - dw Func_fc95d - -Func_fc862: ; fc862 (3f:4862) - dec a - add a - add a - and $c - ld hl, $9 - add hl, bc - ld [hl], a - ld hl, $1 - add hl, bc - ld [hl], $6 - xor a - ld [wd432], a - ld [wd433], a - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], $11 -asm_fc87f: ; fc87f (3f:487f) - ld a, [wd432] - ld e, a - ld a, [wd433] - ld d, a - call Func_fc82e - jr c, Func_fc8c7 - call Func_fc6c5 - ld hl, $4 - add hl, bc - ld a, [hl] - sub e - ld e, a - inc hl - inc hl - ld a, [hl] - sub d - ld d, a - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld a, [hl] - dec a - add a - add $d6 - ld l, a - ld a, $48 - adc $0 - ld h, a - ld a, [hli] - ld [wd432], a - add e - ld e, a - ld a, [hl] - ld [wd433], a - add d - ld d, a - ld hl, $4 - add hl, bc - ld [hl], e - inc hl - inc hl - ld [hl], d - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - dec [hl] - ret nz - jp Func_fc835 - -Func_fc8c7: ; fc8c7 (3f:48c7) - ld hl, $4 - add hl, bc - ld a, [hl] - sub e - ld [hl], a - inc hl - inc hl - ld a, [hl] - sub d - ld [hl], a - jp Func_fc835 - -Pointer_fc8d6: ; fc8d6 (3f:48d6) - db $0, $0, $fe, $1, $fc - db $2, $fe, $3, $0, $4 - db $fe, $3, $fc, $2, $fe - db $1, $0, $0, $fe, $ff - db $fc, $fe, $fe, $fd, $0 - db $fc, $fe, $fd, $fc, $fe - db $fe, $ff, $00, $00 - -Func_fc8f8: ; fc8f8 (3f:48f8) - ld hl, $1 - add hl, bc - ld [hl], $7 - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], $30 -asm_fc904: ; fc904 (3f:4904) - call Func_fc82e - jp c, Func_fc835 - call Func_fc6c5 - ld hl, $7 - add hl, bc - ld a, [hl] - inc a - cp $8 - ld [hl], a - jr nz, .asm_fc91f - xor a - ld [hli], a - ld a, [hl] - inc a - and %11 - ld [hl], a -.asm_fc91f - call Func_fca99 - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - dec [hl] - ret nz - jp Func_fc835 - -Func_fc92b: ; fc92b (3f:492b) - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], $20 - ld hl, $1 - add hl, bc - ld [hl], $8 -asm_fc937: ; fc937 (3f:4937) - call Func_fc82e - jp c, Func_fc835 - call Func_fc6c5 - ld hl, $7 - add hl, bc - ld a, [hl] - inc a - cp $8 - ld [hl], a - jr nz, .asm_fc951 - xor a - ld [hli], a - ld a, [hl] - xor $1 - ld [hl], a -.asm_fc951 - call Func_fca99 - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - dec [hl] - ret nz - jp Func_fc835 - -Func_fc95d: ; fc95d (3f:495d) - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], $20 - ld hl, $1 - add hl, bc - ld [hl], $9 -asm_fc969: ; fc969 (3f:4969) - call Func_fc82e - jp c, Func_fc835 - call Func_fc6c5 - ld hl, $7 - add hl, bc - ld a, [hl] - inc a - cp $8 - ld [hl], a - jr nz, .asm_fc988 - xor a - ld [hl], a - ld hl, $9 - add hl, bc - ld a, [hl] - call Func_fc994 - ld [hl], a -.asm_fc988 - call Func_fca99 - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - dec [hl] - ret nz - jp Func_fc835 - -Func_fc994: ; fc994 (3f:4994) - push hl - ld hl, Pointer_fc9ac - ld d, a -.loop - ld a, [hli] - cp d - jr nz, .loop - ld a, [hl] - pop hl - ret - -Func_fc9a0: ; fc9a0 (3f:49a0) - push hl - ld hl, Pointer_fc9ac_End - ld d, a -.loop - ld a, [hld] - cp d - jr nz, .loop - ld a, [hl] - pop hl - ret - -Pointer_fc9ac: ; fc9ac (3f:49ac) - db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT, SPRITE_FACING_UP, SPRITE_FACING_RIGHT - db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT, SPRITE_FACING_UP, SPRITE_FACING_RIGHT -Pointer_fc9ac_End: -Func_fc9b4: ; fc9b4 (3f:49b4) - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], $8 - ld hl, $1 - add hl, bc - ld [hl], $3 - call Func_fca38 -asm_fc9c3: ; fc9c3 (3f:49c3) - call Func_fca4b - call Func_fca7e - call Func_fca99 - ld hl, $100 - add hl, bc - dec [hl] - ret nz - call Func_fca75 - call Func_fccb2 - ld hl, $1 - add hl, bc - ld [hl], $1 - ret - -Func_fc9df: ; fc9df (3f:49df) - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], $4 - ld hl, $1 - add hl, bc - ld [hl], $5 - call Func_fca38 -asm_fc9ee: ; fc9ee (3f:49ee) - call asm_fca59 - call Func_fca7e - call Func_fca99 - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - dec [hl] - ret nz - call Func_fca75 - call Func_fccb2 - ld hl, $1 - add hl, bc - ld [hl], $1 - ret - -Func_fca0a: ; fca0a (3f:4a0a) - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - ld [hl], $8 - ld hl, $1 - add hl, bc - ld [hl], $4 - call Func_fca38 - call Func_fca38 -asm_fca1c: ; fca1c (3f:4a1c) - call asm_fca59 - call Func_fca7e - call Func_fca99 - ld hl, wSpriteStateData2 - wSpriteStateData1 - add hl, bc - dec [hl] - ret nz - call Func_fca75 - call Func_fccb2 - ld hl, $1 - add hl, bc - ld [hl], $1 - ret - -Func_fca38: ; fca38 (3f:4a38) - ld hl, $3 - add hl, bc - ld e, [hl] - inc hl - inc hl - ld d, [hl] - ld hl, $104 - add hl, bc - ld a, [hl] - add e - ld [hli], a - ld a, [hl] - add d - ld [hl], a - ret - -Func_fca4b: ; fca4b (3f:4a4b) - ld a, [wWalkBikeSurfState] - cp $1 - jr nz, Func_fca68 - ld a, [wd736] - bit 6, a - jr nz, Func_fca68 -asm_fca59: ; fca59 (3f:4a59) - ld hl, $3 - add hl, bc - ld a, [hli] - add a - add a - add [hl] - ld [hli], a - ld a, [hli] - add a - add a - add [hl] - ld [hl], a - ret - -Func_fca68: ; fca68 (3f:4a68) - ld hl, $3 - add hl, bc - ld a, [hli] - add a - add [hl] - ld [hli], a - ld a, [hli] - add a - add [hl] - ld [hli], a - ret - -Func_fca75: ; fca75 (3f:4a75) - ld hl, $3 - add hl, bc - xor a - ld [hli], a - inc hl - ld [hl], a - ret - -Func_fca7e: ; fca7e (3f:4a7e) - call Func_fcdad - ld d, $2 - jr nc, .asm_fca87 - ld d, $5 -.asm_fca87 - ld hl, $7 - add hl, bc - ld a, [hl] - inc a - cp d - jr nz, .asm_fca91 - xor a -.asm_fca91 - ld [hli], a - ret nz - ld a, [hl] - inc a - and $3 - ld [hl], a - ret - -Func_fca99: ; fca99 (3f:4a99) - ld a, [wPikachuOverworldStateFlags] - bit 3, a - jr nz, .asm_fcad1 - ld hl, $10e - add hl, bc - ld a, [hl] - dec a - swap a - ld d, a - ld a, [wd736] - bit 7, a - jr nz, .asm_fcad8 - ld hl, $9 - add hl, bc - ld a, [hl] - or d - ld d, a - ld a, [wFontLoaded] - bit 0, a - jr z, .asm_fcac4 - call Func_fcae2 - ret c - jr .asm_fcacb - -.asm_fcac4 - ld hl, $8 - add hl, bc - ld a, d - or [hl] - ld d, a -.asm_fcacb - ld hl, $2 - add hl, bc - ld [hl], d - ret - -.asm_fcad1 - ld hl, $2 - add hl, bc - ld [hl], $ff - ret - -.asm_fcad8 - ld a, [wSpriteStateData1 + $2] - and $f - or d - ld [wSpriteStateData1 + $f2], a - ret - -Func_fcae2: ; fcae2 (3f:4ae2) - ld hl, $104 - add hl, bc - ld a, [wYCoord] - add $4 - cp [hl] - jr nz, .asm_fcaff - inc hl - ld a, [wXCoord] - add $4 - cp [hl] - jr nz, .asm_fcaff - ld hl, $2 - add hl, bc - ld [hl], $ff - scf - ret - -.asm_fcaff - and a - ret - -Func_fcb01: ; fcb01 (3f:4b01) - push bc - push de - push hl - ld bc, wSpriteStateData1 + $f0 - ld a, [wXCoord] - add $4 - ld d, a - ld a, [wYCoord] - add $4 - ld e, a - ld hl, $104 - add hl, bc - ld a, [hl] - sub e - and a - jr z, .asm_fcb30 - cp $ff - jr z, .asm_fcb26 - cp $1 - jr z, .asm_fcb26 - jr .asm_fcb48 - -.asm_fcb26 - ld hl, $105 - add hl, bc - ld a, [hl] - sub d - jr z, .asm_fcb43 - jr .asm_fcb48 - -.asm_fcb30 - ld hl, $105 - add hl, bc - ld a, [hl] - sub d - cp $ff - jr z, .asm_fcb43 - cp $1 - jr z, .asm_fcb43 - and a - jr z, .asm_fcb43 - jr .asm_fcb48 - -.asm_fcb43 - pop hl - pop de - pop bc - scf - ret - -.asm_fcb48 - pop hl - pop de - pop bc - xor a - ret - -GetPikachuFacingDirectionAndReturnToE: ; fcb4d (3f:4b4d) - call GetPikachuFacingDirection - ld e, a - ret - -GetPikachuFacingDirection: ; fcb52 (3f:4b52) - ld bc, wSpriteStateData1 + $f0 - ld a, [wXCoord] - add $4 - ld d, a - ld a, [wYCoord] - add $4 - ld e, a - ld hl, wSpriteStateData2 - wSpriteStateData1 + 4 - add hl, bc - ld a, [hl] - cp e - jr z, .asm_fcb71 - jr nc, .asm_fcb6e - ld a, SPRITE_FACING_UP - ret - -.asm_fcb6e - ld a, SPRITE_FACING_DOWN - ret - -.asm_fcb71 - ld hl, wSpriteStateData2 - wSpriteStateData1 + 5 - add hl, bc - ld a, [hl] - cp d - jr z, .asm_fcb81 - jr nc, .asm_fcb7e - ld a, SPRITE_FACING_LEFT - ret - -.asm_fcb7e - ld a, SPRITE_FACING_RIGHT - ret - -.asm_fcb81 - ld a, $ff ; standing - ret - -ClearPikachuFollowCommandBuffer: ; fcb84 (3f:4b84) - push bc - ld hl, wPikachuFollowCommandBufferSize - ld [hl], $ff - inc hl - ld bc, $10 - xor a - call FillMemory - pop bc - ret - -AppendPikachuFollowCommandToBuffer: ; fcb94 (3f:4b94) - ld hl, wPikachuFollowCommandBufferSize - inc [hl] - ld e, [hl] - ld d, 0 - ld hl, wPikachuFollowCommandBuffer - add hl, de - ld [hl], a - ret - -Func_fcba1: ; fcba1 (3f:4ba1) - call ClearPikachuFollowCommandBuffer - call GetPikachuFollowCommand - ret c - call AppendPikachuFollowCommandToBuffer - ret - -GetPikachuFollowCommand: ; fcbac (3f:4bac) - ld bc, wSpriteStateData1 + $f0 - ld hl, wSpriteStateData2 - wSpriteStateData1 + 4 - add hl, bc - ld a, [wYCoord] - add $4 - sub [hl] - jr z, .checkXCoord - jr c, .pikaAbovePlayer - call CheckAbsoluteValueLessThan2 - jr c, .return1 - ld a, $5 - and a - ret - -.return1 - ld a, $1 - and a - ret - -.pikaAbovePlayer - call CheckAbsoluteValueLessThan2 - jr c, .return2 - ld a, $6 - and a - ret - -.return2 - ld a, $2 - and a - ret - -.checkXCoord - ld hl, wSpriteStateData2 - wSpriteStateData1 + 5 - add hl, bc - ld a, [wXCoord] - add $4 - sub [hl] - jr z, .pikachuOnTopOfPlayer - jr c, .pikaToLeftOfPlayer - call CheckAbsoluteValueLessThan2 - jr c, .return4 - ld a, $8 - and a - ret - -.return4 - ld a, $4 - and a - ret - -.pikaToLeftOfPlayer - call CheckAbsoluteValueLessThan2 - jr c, .return3 - ld a, $7 - and a - ret - -.return3 - ld a, $3 - and a - ret - -.pikachuOnTopOfPlayer - scf - ret - -CheckAbsoluteValueLessThan2: ; fcc01 (3f:4c01) - jr nc, .positive - cpl - inc a -.positive - cp $2 - ret - -Func_fcc08:: ; fcc08 (3f:4c08) - call Func_fcc23 - ret nc - ld a, [wd736] - bit 6, a - jr nz, .asm_fcc1b - call Func_fcc42 - ret c - call AppendPikachuFollowCommandToBuffer - ret - -.asm_fcc1b - call Func_fcc64 - ret c - call AppendPikachuFollowCommandToBuffer - ret - -Func_fcc23: ; fcc23 (3f:4c28) - ld a, [wPikachuOverworldStateFlags] - bit 5, a - jr nz, .asm_fcc40 - ld a, [wPikachuOverworldStateFlags] - bit 7, a - jr nz, .asm_fcc40 - ld a, [wd472] - bit 7, a - jr z, .asm_fcc40 - ld a, [wWalkBikeSurfState] - and a - jr nz, .asm_fcc40 - scf - ret - -.asm_fcc40 - and a - ret - -Func_fcc42: ; fcc42 (3f:4c42) - xor a - ld a, [wPlayerDirection] - bit 3, a - jr nz, .asm_fcc58 - bit 2, a - jr nz, .asm_fcc5b - bit 1, a - jr nz, .asm_fcc5e - bit 0, a - jr nz, .asm_fcc61 - scf - ret - -.asm_fcc58 - ld a, $2 - ret - -.asm_fcc5b - ld a, $1 - ret - -.asm_fcc5e - ld a, $3 - ret - -.asm_fcc61 - ld a, $4 - ret - -Func_fcc64: ; fcc64 (3f:4c64) - ld hl, wPikachuOverworldStateFlags - bit 6, [hl] - jr z, .asm_fcc6e - res 6, [hl] - ret - -.asm_fcc6e - set 6, [hl] - xor a - ld a, [wPlayerDirection] - bit 3, a - jr nz, .asm_fcc86 - bit 2, a - jr nz, .asm_fcc89 - bit 1, a - jr nz, .asm_fcc8c - bit 0, a - jr nz, .asm_fcc8f - scf - ret - -.asm_fcc86 - ld a, $6 - ret - -.asm_fcc89 - ld a, $5 - ret - -.asm_fcc8c - ld a, $7 - ret - -.asm_fcc8f - ld a, $8 - ret - -Func_fcc92: ; fcc92 (3f:4c92) - ld hl, wPikachuFollowCommandBufferSize - ld a, [hl] - cp $ff - jr z, .asm_fccb0 - and a - jr z, .asm_fccb0 - dec [hl] - ld e, a - ld d, 0 - ld hl, wPikachuFollowCommandBuffer - add hl, de - inc e - ld a, $ff -.asm_fcca8 - ld d, [hl] - ldd [hl], a - ld a, d - dec e - jr nz, .asm_fcca8 - and a - ret - -.asm_fccb0 - scf - ret - -Func_fccb2:: ; fccb2 (3f:4cb2) - call Func_fcd01 - and a - jr z, .asm_fccbf - dec a - and $3 - add a - add a - jr .asm_fccea - -.asm_fccbf - ld a, [wYCoord] - add $4 - ld d, a - ld a, [wXCoord] - add $4 - ld e, a - ld a, [wSpriteStateData2 + $f4] - cp d - jr z, .asm_fccd9 - ld a, SPRITE_FACING_DOWN - jr c, .asm_fccea - ld a, SPRITE_FACING_UP - jr .asm_fccea - -.asm_fccd9 - ld a, [wSpriteStateData2 + $f5] - cp e - jr z, .asm_fcce7 - ld a, SPRITE_FACING_RIGHT - jr c, .asm_fccea - ld a, SPRITE_FACING_LEFT - jr .asm_fccea - -.asm_fcce7 - ld a, [wSpriteStateData1 + $9] -.asm_fccea - ld [wSpriteStateData1 + $f9], a - ret - -Func_fccee: ; fccee (3f:4cee) - ld hl, wPikachuFollowCommandBufferSize - ld a, [hl] - cp $ff - jr z, .asm_fccff - ld e, a - ld d, 0 - ld hl, wPikachuFollowCommandBuffer - add hl, de - ld a, [hl] - ret - -.asm_fccff - xor a - ret - -Func_fcd01: ; fcd01 (3f:4d01) - ld hl, wPikachuFollowCommandBufferSize - ld a, [hl] - cp $ff - jr z, .asm_fcd15 - and a - jr z, .asm_fcd15 - ld e, a - ld d, 0 - ld hl, wPikachuFollowCommandBuffer - add hl, de - ld a, [hl] - ret - -.asm_fcd15 - xor a - ret - -Func_fcd17: ; fcd17 (3f:4d17) - ld a, [wPikachuFollowCommandBufferSize] - cp $ff - ret z - cp $2 - jr nc, .asm_fcd23 - and a - ret - -.asm_fcd23 - scf - ret - -Func_fcd25: ; fcd25 (3f:4d25) - ld h, wSpriteStateData2 / $100 - ld a, [H_CURRENTSPRITEOFFSET] - add $4 - ld l, a - ld b, [hl] - ld a, [wYCoord] - cp b - jr z, .asm_fcd3a - jr nc, .asm_fcd63 - add $8 - cp b - jr c, .asm_fcd63 -.asm_fcd3a - inc l - ld b, [hl] - ld a, [wXCoord] - cp b - jr z, .asm_fcd49 - jr nc, .asm_fcd63 - add $9 - cp b - jr c, .asm_fcd63 -.asm_fcd49 - call Func_fcd83 - ld d, $60 - ld a, [hli] - ld e, a - cp d - jr nc, .asm_fcd63 - ld a, [hld] - cp d - jr nc, .asm_fcd63 - ld bc, -20 - add hl, bc - ld a, [hli] - cp d - jr nc, .asm_fcd63 - ld a, [hl] - cp d - jr c, .asm_fcd6f -.asm_fcd63 - ld h, wSpriteStateData1 / $100 - ld a, [H_CURRENTSPRITEOFFSET] - add $2 - ld l, a - ld [hl], $ff - scf - jr .asm_fcd82 - -.asm_fcd6f - ld h, wSpriteStateData2 / $100 - ld a, [H_CURRENTSPRITEOFFSET] - add $7 - ld l, a - ld a, [wGrassTile] - cp e - ld a, $0 - jr nz, .asm_fcd80 - ld a, $80 -.asm_fcd80 - ld [hl], a - and a -.asm_fcd82 - ret - -Func_fcd83: ; fcd83 (3f:4d83) - ld h, wSpriteStateData1 / $100 - ld a, [H_CURRENTSPRITEOFFSET] - add $4 - ld l, a - ld a, [hli] - add $4 - and $f0 - srl a - ld c, a - ld b, $0 - inc l - ld a, [hl] - add $2 - srl a - srl a - srl a - add SCREEN_WIDTH - ld d, 0 - ld e, a - ld hl, wTileMap - rept 5 - add hl, bc - endr - add hl, de - ret - -Func_fcdad: ; fcdad (3f:4dad) - push bc - push af - ld a, [wPikachuHappiness] - cp $50 - pop bc - ld a, b - pop bc - ret - -IsStarterPikachuInOurParty:: ; fcdb8 (3f:4db8) - ld hl, wPartySpecies - ld de, wPartyMon1OTID - ld bc, wPartyMonOT - push hl -.loop - pop hl - ld a, [hli] - push hl - inc a - jr z, .noPlayerPikachu - cp PIKACHU + 1 - jr nz, .curMonNotPlayerPikachu - ld h, d - ld l, e - ld a, [wPlayerID] - cp [hl] - jr nz, .curMonNotPlayerPikachu - inc hl - ld a, [wPlayerID+1] - cp [hl] - jr nz, .curMonNotPlayerPikachu - push de - push bc - ld hl, wPlayerName - ld d, $6 ; possible player length - 1 -.nameCompareLoop - dec d - jr z, .sameOT - ld a, [bc] - inc bc - cp [hl] - inc hl - jr z, .nameCompareLoop - pop bc - pop de -.curMonNotPlayerPikachu - ld hl, wPartyMon2 - wPartyMon1 - add hl, de - ld d, h - ld e, l - ld hl, NAME_LENGTH - add hl, bc - ld b, h - ld c, l - jr .loop - -.sameOT - pop bc - pop de - ld h, d - ld l, e - ld bc, -NAME_LENGTH - add hl, bc - ld a, [hli] - or [hl] - jr z, .noPlayerPikachu ; XXX how is this determined? - pop hl - scf - ret - -.noPlayerPikachu - pop hl - and a - ret - -IsThisPartymonStarterPikachu_Box:: ; fce0d (3f:4e0d) - ld hl, wBoxMon1 - ld bc, wBoxMon2 - wBoxMon1 - ld de, wBoxMonOT - jr asm_fce21 - -IsThisPartymonStarterPikachu_Party:: ; fce18 (3f:4e18) -IsThisPartymonStarterPikachu:: - ld hl, wPartyMon1 - ld bc, wPartyMon2 - wPartyMon1 - ld de, wPartyMonOT -asm_fce21: ; fce21 (3f:4e21) - ld a, [wWhichPokemon] - call AddNTimes - ld a, [hl] - cp PIKACHU - jr nz, .notPlayerPikachu - ld bc, wPartyMon1OTID - wPartyMon1 - add hl, bc - ld a, [wPlayerID] - cp [hl] - jr nz, .notPlayerPikachu - inc hl - ld a, [wPlayerID+1] - cp [hl] - jr nz, .notPlayerPikachu - ld h, d - ld l, e - ld a, [wWhichPokemon] - ld bc, NAME_LENGTH - call AddNTimes - ld de, wPlayerName - ld b, $6 -.loop - dec b - jr z, .isPlayerPikachu - ld a, [de] - inc de - cp [hl] - inc hl - jr z, .loop -.notPlayerPikachu - and a - ret - -.isPlayerPikachu - scf - ret - -Func_fce5a:: ; fce5a (3f:4e5a) - push de - call IsStarterPikachuInOurParty - pop de - ret nc - ld a, d - cp $80 - ld a, [wPikachuMood] - jr c, .asm_fce6c - cp d - jr c, .asm_fce6e - ret - -.asm_fce6c - cp d - ret c -.asm_fce6e - ld a, d - ld [wPikachuMood], a - ret - -Func_fce73:: ; fce73 (3f:4e73) -; function to test if Pikachu is alive? - xor a - ld [wWhichPokemon], a - ld hl, wPartyCount -.loop - inc hl - ld a, [hl] - cp $ff - jr z, .asm_fcea9 - push hl - call IsThisPartymonStarterPikachu_Party - pop hl - jr nc, .asm_fce9e - ld a, [wWhichPokemon] - ld hl, wPartyMon1HP - ld bc, wPartyMon2 - wPartyMon1 - call AddNTimes - ld a, [hli] - or [hl] - ld d, a - inc hl - inc hl - ld a, [hl] - and a - jr nz, .asm_fcea7 - jr .asm_fcea9 - -.asm_fce9e - ld a, [wWhichPokemon] - inc a - ld [wWhichPokemon], a - jr .loop - -.asm_fcea7 - scf - ret - -.asm_fcea9 - and a - ret - -IsSurfingPikachuInThePlayersParty:: ; fceab (3f:4eab) - ld hl, wPartySpecies - ld de, wPartyMon1Moves - ld bc, wPartyMonOT - push hl -.loop - pop hl - ld a, [hli] - push hl - inc a - jr z, .noSurfingPlayerPikachu - cp PIKACHU+1 - jr nz, .curMonNotSurfingPlayerPikachu - ld h, d - ld l, e - push hl - push bc - ld b, NUM_MOVES -.moveSearchLoop - ld a, [hli] - cp SURF - jr z, .foundSurfingPikachu - dec b - jr nz, .moveSearchLoop - pop bc - pop hl - jr .curMonNotSurfingPlayerPikachu - -.foundSurfingPikachu - pop bc - pop hl - inc hl - inc hl - inc hl - inc hl - ld a, [wPlayerID] - cp [hl] - jr nz, .curMonNotSurfingPlayerPikachu - inc hl - ld a, [wPlayerID+1] - cp [hl] - jr nz, .curMonNotSurfingPlayerPikachu - push de - push bc - ld hl, wPlayerName - ld d, $6 -.nameCompareLoop - dec d - jr z, .foundSurfingPlayerPikachu - ld a, [bc] - inc bc - cp [hl] - inc hl - jr z, .nameCompareLoop - pop bc - pop de -.curMonNotSurfingPlayerPikachu - ld hl, wPartyMon2 - wPartyMon1 - add hl, de - ld d, h - ld e, l - ld hl, NAME_LENGTH - add hl, bc - ld b, h - ld c, l - jr .loop - -.foundSurfingPlayerPikachu - pop bc - pop de - pop hl - scf - ret - -.noSurfingPlayerPikachu - pop hl - and a - ret - +INCLUDE "engine/pikachu_follow.asm" +INCLUDE "engine/pikachu_status.asm" +INCLUDE "engine/pikachu_emotions.asm" +INCLUDE "engine/pikachu_movement.asm" INCLUDE "engine/pikachu_pic_animation.asm" Func_fe66e: diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 665d79f7..24b3863b 100755 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -1898,7 +1898,7 @@ SendOutMon: ; 3ccfb (f:4cfb) ld [H_WHOSETURN], a ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a - callab Func_f429f + callab StarterPikachuBattleEntranceAnimation callab IsPlayerPikachuAsleepInParty ld e, $24 jr c, .asm_3cd81 diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm index 53a68b64..f4c99e3d 100755 --- a/engine/battle/end_of_battle.asm +++ b/engine/battle/end_of_battle.asm @@ -46,7 +46,7 @@ EndOfBattle: ; 13765 (4:7765) ld [wForceEvolution], a predef EvolutionAfterBattle ld d, $82 - callab Func_fce5a + callab UpdatePikachuMoodAfterBattle .resetVariables xor a ld [wLowHealthAlarm], a ;disable low health alarm diff --git a/engine/diploma_3a.asm b/engine/diploma_3a.asm index 60769e09..f85cc288 100755 --- a/engine/diploma_3a.asm +++ b/engine/diploma_3a.asm @@ -82,11 +82,11 @@ Func_e9ad3: ld de, Tilemap_e9b3e coord hl, 6, 2 lb bc, 10, 12 - call Func_e925d + call Diploma_Surfing_CopyBox ld de, Tilemap_e9bb6 coord hl, 5, 13 lb bc, 1, 11 - call Func_e925d + call Diploma_Surfing_CopyBox ld de, String_e9bd5 coord hl, 2, 15 call PlaceString @@ -105,7 +105,7 @@ Func_e9ad3: ld de, TileMap_e9bc1 coord hl, 2, 0 lb bc, 4, 5 - call Func_e925d + call Diploma_Surfing_CopyBox ret Tilemap_e9b3e: diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm index f99cf18f..c8e6de3b 100755 --- a/engine/hall_of_fame.asm +++ b/engine/hall_of_fame.asm @@ -223,8 +223,7 @@ HoFLoadMonPlayerPicTileIDs: ; 703c7 (1c:43c7) predef_jump CopyTileIDsFromList HoFDisplayPlayerStats: ; 703d1 (1c:43d1) - ld hl, wd747 - set 3, [hl] + SetEvent EVENT_HALL_OF_FAME_DEX_RATING predef DisplayDexRating coord hl, 0, 4 lb bc, 6, 10 diff --git a/engine/hidden_object_functions14.asm b/engine/hidden_object_functions14.asm index 0724f962..e69e802c 100755 --- a/engine/hidden_object_functions14.asm +++ b/engine/hidden_object_functions14.asm @@ -89,7 +89,7 @@ FightingDojoText: ; 5298a (14:698a) db "@" PrintIndigoPlateauHQText: ; 5298f (14:698f) - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 7ef1a7c8..78950150 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -14,7 +14,7 @@ RedBedroomPCText: ; 5db8e (17:5b8e) db $fc ; FuncTX_ItemStoragePC Route15GateLeftBinoculars: ; 5db8f (17:5b8f) - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index 443f8369..cdba142b 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -3,7 +3,7 @@ GymStatues: ; 625e8 (18:65e8) ; if in a gym and don’t have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID ; else ret call EnableAutoTextBoxDrawing - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz ld hl, .BadgeFlags @@ -64,7 +64,7 @@ PrintBenchGuyText: ; 6245d (18:645d) .match ld a, [hli] ld b, a - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp b jr nz, .loop ; player isn't facing left at the bench guy ld a, [hl] @@ -192,7 +192,7 @@ BookcaseText: ; 62511 (18:6511) db "@" OpenPokemonCenterPC: ; 62516 (18:6516) - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ; check to see if player is facing up ret nz call EnableAutoTextBoxDrawing diff --git a/engine/hidden_object_functions3.asm b/engine/hidden_object_functions3.asm index e43ae451..78da8274 100755 --- a/engine/hidden_object_functions3.asm +++ b/engine/hidden_object_functions3.asm @@ -1,6 +1,6 @@ ; prints text for bookshelves in buildings without sign events PrintBookshelfText: ; f9de (3:79de) - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction cp SPRITE_FACING_UP jr nz, .noMatch ; facing up diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 648255d9..4867b447 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -116,7 +116,7 @@ GameOverText: ; 1e3aa (7:63aa) db "@" PrintCinnabarQuiz: ; 1e3af (7:63af) - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing @@ -367,7 +367,7 @@ MagazinesText: ; 1e544 (7:6544) BillsHousePC: ; 1e549 (7:6549) call EnableAutoTextBoxDrawing - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING @@ -498,7 +498,7 @@ BillsHousePokemonListText2: ; 1e67f (7:667f) db "@" DisplayOakLabEmailText: ; 1e684 (7:6684) - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing diff --git a/engine/items/items.asm b/engine/items/items.asm index 92d53819..1858c5f0 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -1,18 +1,18 @@ UseItem_: ; d2ed (3:52ed) - ld a,1 - ld [wActionResultOrTookBattleTurn],a ; initialise to success value - ld a,[wcf91] ;contains item_ID - cp a,HM_01 - jp nc,ItemUseTMHM - ld hl,ItemUsePtrTable + ld a, 1 + ld [wActionResultOrTookBattleTurn], a ; initialise to success value + ld a, [wcf91] ;contains item_ID + cp HM_01 + jp nc, ItemUseTMHM + ld hl, ItemUsePtrTable dec a add a - ld c,a - ld b,0 - add hl,bc - ld a,[hli] - ld h,[hl] - ld l,a + ld c, a + ld b, 0 + add hl, bc + ld a, [hli] + ld h, [hl] + ld l, a jp [hl] ItemUsePtrTable: ; d307 (3:5307) @@ -170,8 +170,7 @@ ItemUseBall: ; d3ad (3:53ad) jp nz,.captured ld a,$1 ld [wCapturedMonSpecies], a - ld a, [wd74c] - bit 7, a + CheckEvent EVENT_02F ld b, $63 jp nz,.setAnimData jp .captured @@ -243,7 +242,7 @@ ItemUseBall: ; d3ad (3:53ad) jr z,.notFrozenOrAsleep ld c,25 .notFrozenOrAsleep - ld a,b + ld a, b sub c jp c,.captured ld b,a @@ -438,16 +437,16 @@ ItemUseBall: ; d3ad (3:53ad) ld a,TOSS_ANIM ld [wAnimationID],a xor a - ld [H_WHOSETURN],a - ld [wAnimationType],a - ld [wDamageMultipliers],a - ld a,[wWhichPokemon] + ld [H_WHOSETURN], a + ld [wAnimationType], a + ld [wDamageMultipliers], a + ld a, [wWhichPokemon] push af - ld a,[wcf91] + ld a, [wcf91] push af predef MoveAnimation pop af - ld [wcf91],a + ld [wcf91], a pop af ld [wWhichPokemon],a @@ -507,19 +506,19 @@ ItemUseBall: ; d3ad (3:53ad) .skip6 ld a,[wcf91] push af - ld a,[wEnemyMonSpecies2] - ld [wcf91],a - ld a,[wEnemyMonLevel] - ld [wCurEnemyLVL],a + ld a, [wEnemyMonSpecies2] + ld [wcf91], a + ld a, [wEnemyMonLevel] + ld [wCurEnemyLVL], a callab LoadEnemyMonData pop af - ld [wcf91],a + ld [wcf91], a pop hl pop af - ld [hld],a + ld [hld], a dec hl pop af - ld [hld],a + ld [hld], a pop af ld [hl],a ld a,[wEnemyMonSpecies] @@ -536,18 +535,18 @@ ItemUseBall: ; d3ad (3:53ad) ; Add the caught Pokémon to the Pokédex. predef IndexToPokedex - ld a,[wd11e] + ld a, [wd11e] dec a - ld c,a - ld b,FLAG_TEST - ld hl,wPokedexOwned + ld c, a + ld b, FLAG_TEST + ld hl, wPokedexOwned predef FlagActionPredef - ld a,c + ld a, c push af - ld a,[wd11e] + ld a, [wd11e] dec a - ld c,a - ld b,FLAG_SET + ld c, a + ld b, FLAG_SET predef FlagActionPredef pop af @@ -570,7 +569,7 @@ ItemUseBall: ; d3ad (3:53ad) cp PARTY_LENGTH ; is party full? jr z,.sendToBox xor a ; PLAYER_PARTY_DATA - ld [wMonDataLocation],a + ld [wMonDataLocation], a call ClearSprites ld hl, .emptyString call PrintText @@ -581,8 +580,7 @@ ItemUseBall: ; d3ad (3:53ad) call ClearSprites call SendNewMonToBox ld hl,ItemUseBallText07 - ld a, [wd7f1] - bit 0, a + CheckEvent EVENT_MET_BILL jr nz,.printTransferredToPCText ld hl,ItemUseBallText08 .printTransferredToPCText @@ -604,7 +602,7 @@ ItemUseBall: ; d3ad (3:53ad) ; Remove a ball from the bag. ld hl,wNumBagItems inc a - ld [wItemQuantity],a + ld [wItemQuantity], a jp RemoveItemFromInventory .emptyString @@ -635,7 +633,7 @@ ItemUseBallText05: ; d6b0 (3:56b0) ;"All right! {MonName} was caught!" ;play sound TX_FAR _ItemUseBallText05 - db $12,$06 + db $12, $06 db "@" ItemUseBallText07: ; d6b7 (3:59b7) ;"X was transferred to Bill's PC" @@ -650,46 +648,47 @@ ItemUseBallText06: ; d6c1 (3:56c1) ;"New DEX data will be added..." ;play sound TX_FAR _ItemUseBallText06 - db $13,$06 + db $13, $06 db "@" ItemUseTownMap: ; d6c8 (3:56c8) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp nz,ItemUseNotTime + jp nz, ItemUseNotTime jpba DisplayTownMap ItemUseBicycle: ; d6d7 (3:56d7) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp nz,ItemUseNotTime - ld a,[wWalkBikeSurfState] - ld [wWalkBikeSurfStateCopy],a - cp a,2 ; is the player surfing? - jp z,ItemUseNotTime + jp nz, ItemUseNotTime + ld a, [wWalkBikeSurfState] + ld [wWalkBikeSurfStateCopy], a + cp 2 ; is the player surfing? + jp z, ItemUseNotTime dec a ; is player already bicycling? - jr nz,.tryToGetOnBike + jr nz, .tryToGetOnBike .getOffBike call ItemUseReloadOverworldData xor a - ld [wWalkBikeSurfState],a ; change player state to walking + ld [wWalkBikeSurfState], a ; change player state to walking ld a, $00 - ld [wd431], a + ld [wPikachuSpawnState], a call PlayDefaultMusic ; play walking music - ld hl,GotOffBicycleText + ld hl, GotOffBicycleText jp PrintText + .tryToGetOnBike call IsBikeRidingAllowed - jp nc,NoCyclingAllowedHere + jp nc, NoCyclingAllowedHere call ItemUseReloadOverworldData xor a ; no keys pressed - ld [hJoyHeld],a ; current joypad state + ld [hJoyHeld], a ; current joypad state ld a, $1 - ld [wWalkBikeSurfState],a ; change player state to bicycling + ld [wWalkBikeSurfState], a ; change player state to bicycling call PlayDefaultMusic ; play bike riding music xor a - ld [wWalkBikeSurfState],a - ld hl,GotOnBicycleText + ld [wWalkBikeSurfState], a + ld hl, GotOnBicycleText call PrintText ld a, $1 ld [wWalkBikeSurfState], a @@ -697,79 +696,82 @@ ItemUseBicycle: ; d6d7 (3:56d7) ; used for Surf out-of-battle effect ItemUseSurfboard: ; d725 (3:5725) - ld a,[wWalkBikeSurfState] - ld [wWalkBikeSurfStateCopy],a - cp a,2 ; is the player already surfing? - jr z,.tryToStopSurfing + ld a, [wWalkBikeSurfState] + ld [wWalkBikeSurfStateCopy], a + cp 2 ; is the player already surfing? + jr z, .tryToStopSurfing .tryToSurf call IsNextTileShoreOrWater - jp nc,SurfingAttemptFailed - ld hl,TilePairCollisionsWater + jp nc, SurfingAttemptFailed + ld hl, TilePairCollisionsWater call CheckForTilePairCollisions - jp c,SurfingAttemptFailed + jp c, SurfingAttemptFailed .surf call .makePlayerMoveForward - ld hl,wd730 - set 7,[hl] - ld a,2 - ld [wWalkBikeSurfState],a ; change player state to surfing + ld hl, wd730 + set 7, [hl] + ld a, 2 + ld [wWalkBikeSurfState], a ; change player state to surfing call PlayDefaultMusic ; play surfing music - ld hl,SurfingGotOnText + ld hl, SurfingGotOnText jp PrintText + .tryToStopSurfing xor a - ld [hSpriteIndexOrTextID],a - ld d,16 ; talking range in pixels (normal range) + ld [hSpriteIndexOrTextID], a + ld d, 16 ; talking range in pixels (normal range) call IsSpriteInFrontOfPlayer2 - res 7,[hl] - ld a,[hSpriteIndexOrTextID] + res 7, [hl] + ld a, [hSpriteIndexOrTextID] and a ; is there a sprite in the way? - jr nz,.cannotStopSurfing - ld hl,TilePairCollisionsWater + jr nz, .cannotStopSurfing + ld hl, TilePairCollisionsWater call CheckForTilePairCollisions - jr c,.cannotStopSurfing - ld a,[wTileInFrontOfPlayer] - ld c,a + jr c, .cannotStopSurfing + ld a, [wTileInFrontOfPlayer] + ld c, a call IsTilePassable - jr nc,.stopSurfing + jr nc, .stopSurfing .cannotStopSurfing - ld hl,SurfingNoPlaceToGetOffText + ld hl, SurfingNoPlaceToGetOffText jp PrintText + .stopSurfing call .makePlayerMoveForward - ld a,$3 - ld [wd431], a - ld hl,wPikachuOverworldStateFlags - set 5,[hl] - ld hl,wd730 - set 7,[hl] + ld a, $3 + ld [wPikachuSpawnState], a + ld hl, wPikachuOverworldStateFlags + set 5, [hl] + ld hl, wd730 + set 7, [hl] xor a - ld [wWalkBikeSurfState],a ; change player state to walking + ld [wWalkBikeSurfState], a ; change player state to walking dec a - ld [wJoyIgnore],a + ld [wJoyIgnore], a call PlayDefaultMusic ; play walking music call GBPalWhiteOutWithDelay3 jp LoadWalkingPlayerSpriteGraphics + ; uses a simulated button press to make the player move forward .makePlayerMoveForward - ld a,[wPlayerDirection] ; direction the player is going - bit PLAYER_DIR_BIT_UP,a - ld b,D_UP - jr nz,.storeSimulatedButtonPress - bit PLAYER_DIR_BIT_DOWN,a - ld b,D_DOWN - jr nz,.storeSimulatedButtonPress - bit PLAYER_DIR_BIT_LEFT,a - ld b,D_LEFT - jr nz,.storeSimulatedButtonPress - ld b,D_RIGHT + ld a, [wPlayerDirection] ; direction the player is going + bit PLAYER_DIR_BIT_UP, a + ld b, D_UP + jr nz, .storeSimulatedButtonPress + bit PLAYER_DIR_BIT_DOWN, a + ld b, D_DOWN + jr nz, .storeSimulatedButtonPress + bit PLAYER_DIR_BIT_LEFT, a + ld b, D_LEFT + jr nz, .storeSimulatedButtonPress + ld b, D_RIGHT .storeSimulatedButtonPress - ld a,b - ld [wSimulatedJoypadStatesEnd],a + ld a, b + ld [wSimulatedJoypadStatesEnd], a xor a - ld [wWastedByteCD39],a + ld [wWastedByteCD39], a inc a - ld [wSimulatedJoypadStatesIndex],a + ld [wSimulatedJoypadStatesIndex], a ret SurfingGotOnText: ; d7c1 (3:57c1) @@ -784,25 +786,25 @@ ItemUsePokedex: ; d7cb (3:57cb) predef_jump ShowPokedexMenu ItemUseEvoStone: ; d7d0 (3:57d0) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp nz,ItemUseNotTime - ld a,[wWhichPokemon] + jp nz, ItemUseNotTime + ld a, [wWhichPokemon] push af - ld a,[wcf91] - ld [wEvoStoneItemID],a + ld a, [wcf91] + ld [wEvoStoneItemID], a push af - ld a,EVO_STONE_PARTY_MENU - ld [wPartyMenuTypeOrMessageID],a - ld a,$ff - ld [wUpdateSpritesEnabled],a + ld a, EVO_STONE_PARTY_MENU + ld [wPartyMenuTypeOrMessageID], a + ld a, $ff + ld [wUpdateSpritesEnabled], a call DisplayPartyMenu ld a, [wcf91] ld [wLoadedMon], a pop bc - jr c,.canceledItemUse - ld a,b - ld [wcf91],a + jr c, .canceledItemUse + ld a, b + ld [wcf91], a call Func_d85d jr nc, .noEffect callab IsThisPartymonStarterPikachu_Party @@ -819,24 +821,26 @@ ItemUseEvoStone: ; d7d0 (3:57d0) ld a, $82 ld [wPikachuMood], a jr .canceledItemUse + .notPlayerPikachu - ld a,SFX_HEAL_AILMENT + ld a, SFX_HEAL_AILMENT call PlaySoundWaitForCurrent call WaitForSoundToFinish - ld a,$01 - ld [wForceEvolution],a + ld a, $01 + ld [wForceEvolution], a callab TryEvolvingMon ; try to evolve pokemon pop af - ld [wWhichPokemon],a - ld hl,wNumBagItems - ld a,1 ; remove 1 stone - ld [wItemQuantity],a + ld [wWhichPokemon], a + ld hl, wNumBagItems + ld a, 1 ; remove 1 stone + ld [wItemQuantity], a jp RemoveItemFromInventory + .noEffect call ItemUseNoEffect .canceledItemUse xor a - ld [wActionResultOrTookBattleTurn],a ; item not used + ld [wActionResultOrTookBattleTurn], a ; item not used pop af ret @@ -880,6 +884,7 @@ Func_d85d: ; d85d (3:585d) jr nz, .loop scf ret + .cannotEvolveWithUsedStone and a ret @@ -889,42 +894,43 @@ RefusingText: ; d8a2 (3:58a2) db "@" ItemUseVitamin: ; d8a7 (3:58a7) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp nz,ItemUseNotTime + jp nz, ItemUseNotTime ItemUseMedicine: ; d8ae (3:58ae) - ld a,[wPartyCount] + ld a, [wPartyCount] and a - jp z,Func_e4bf - ld a,[wWhichPokemon] + jp z, Func_e4bf + ld a, [wWhichPokemon] push af - ld a,[wcf91] + ld a, [wcf91] push af - ld a,USE_ITEM_PARTY_MENU - ld [wPartyMenuTypeOrMessageID],a - ld a,$ff - ld [wUpdateSpritesEnabled],a - ld a,[wPseudoItemID] + ld a, USE_ITEM_PARTY_MENU + ld [wPartyMenuTypeOrMessageID], a + ld a, $ff + ld [wUpdateSpritesEnabled], a + ld a, [wPseudoItemID] and a ; using Softboiled? - jr z,.notUsingSoftboiled + jr z, .notUsingSoftboiled ; if using softboiled call GoBackToPartyMenu jr .getPartyMonDataAddress + .notUsingSoftboiled call DisplayPartyMenu .getPartyMonDataAddress - jp c,.canceledItemUse - ld hl,wPartyMons - ld bc,wPartyMon2 - wPartyMon1 - ld a,[wWhichPokemon] + jp c, .canceledItemUse + ld hl, wPartyMons + ld bc, wPartyMon2 - wPartyMon1 + ld a, [wWhichPokemon] call AddNTimes - ld a,[wWhichPokemon] - ld [wUsedItemOnWhichPokemon],a - ld d,a - ld a,[wcf91] - ld e,a - ld [wd0b5],a + ld a, [wWhichPokemon] + ld [wUsedItemOnWhichPokemon], a + ld d, a + ld a, [wcf91] + ld e, a + ld [wd0b5], a pop af push af cp $28 @@ -936,65 +942,65 @@ ItemUseMedicine: ; d8ae (3:58ae) pop hl .asm_d906 pop af - ld [wcf91],a + ld [wcf91], a pop af - ld [wWhichPokemon],a - ld a,[wPseudoItemID] + ld [wWhichPokemon], a + ld a, [wPseudoItemID] and a ; using Softboiled? - jr z,.checkItemType + jr z, .checkItemType ; if using softboiled - ld a,[wWhichPokemon] + ld a, [wWhichPokemon] cp d ; is the pokemon trying to use softboiled on itself? - jr z,ItemUseMedicine ; if so, force another choice + jr z, ItemUseMedicine ; if so, force another choice .checkItemType - ld a,[wcf91] - cp a,REVIVE - jr nc,.healHP ; if it's a Revive or Max Revive - cp a,FULL_HEAL - jr z,.cureStatusAilment ; if it's a Full Heal - cp a,HP_UP - jp nc,.useVitamin ; if it's a vitamin or Rare Candy - cp a,FULL_RESTORE - jr nc,.healHP ; if it's a Full Restore or one of the potions + ld a, [wcf91] + cp REVIVE + jr nc, .healHP ; if it's a Revive or Max Revive + cp FULL_HEAL + jr z, .cureStatusAilment ; if it's a Full Heal + cp HP_UP + jp nc, .useVitamin ; if it's a vitamin or Rare Candy + cp FULL_RESTORE + jr nc, .healHP ; if it's a Full Restore or one of the potions ; fall through if it's one of the status-specifc healing items .cureStatusAilment ld bc,wPartyMon1Status - wPartyMon1 add hl,bc ; hl now points to status ld a,[wcf91] lb bc, ANTIDOTE_MSG, 1 << PSN - cp a,ANTIDOTE - jr z,.checkMonStatus + cp ANTIDOTE + jr z, .checkMonStatus lb bc, BURN_HEAL_MSG, 1 << BRN - cp a,BURN_HEAL - jr z,.checkMonStatus + cp BURN_HEAL + jr z, .checkMonStatus lb bc, ICE_HEAL_MSG, 1 << FRZ - cp a,ICE_HEAL - jr z,.checkMonStatus + cp ICE_HEAL + jr z, .checkMonStatus lb bc, AWAKENING_MSG, SLP - cp a,AWAKENING - jr z,.checkMonStatus + cp AWAKENING + jr z, .checkMonStatus lb bc, PARALYZ_HEAL_MSG, 1 << PAR - cp a,PARLYZ_HEAL - jr z,.checkMonStatus + cp PARLYZ_HEAL + jr z, .checkMonStatus lb bc, FULL_HEAL_MSG, $ff ; Full Heal .checkMonStatus - ld a,[hl] ; pokemon's status + ld a, [hl] ; pokemon's status and c ; does the pokemon have a status ailment the item can cure? - jp z,.healingItemNoEffect + jp z, .healingItemNoEffect ; if the pokemon has a status the item can heal xor a - ld [hl],a ; remove the status ailment in the party data - ld a,b - ld [wPartyMenuTypeOrMessageID],a ; the message to display for the item used - ld a,[wPlayerMonNumber] + ld [hl], a ; remove the status ailment in the party data + ld a, b + ld [wPartyMenuTypeOrMessageID], a ; the message to display for the item used + ld a, [wPlayerMonNumber] cp d ; is pokemon the item was used on active in battle? - jp nz,.doneHealing + jp nz, .doneHealing ; if it is active in battle xor a - ld [wBattleMonStatus],a ; remove the status ailment in the in-battle pokemon data + ld [wBattleMonStatus], a ; remove the status ailment in the in-battle pokemon data push hl - ld hl,wPlayerBattleStatus3 - res BadlyPoisoned,[hl] ; heal Toxic status + ld hl, wPlayerBattleStatus3 + res BadlyPoisoned, [hl] ; heal Toxic status pop hl ld bc,wPartyMon1Stats - wPartyMon1Status add hl,bc ; hl now points to party stats @@ -1003,23 +1009,25 @@ ItemUseMedicine: ; d8ae (3:58ae) call CopyData ; copy party stats to in-battle stat data predef DoubleOrHalveSelectedStats jp .doneHealing + .healHP inc hl ; hl = address of current HP - ld a,[hli] - ld b,a - ld [wHPBarOldHP+1],a - ld a,[hl] - ld c,a - ld [wHPBarOldHP],a ; current HP stored at wHPBarOldHP (2 bytes, big-endian) + ld a, [hli] + ld b, a + ld [wHPBarOldHP+1], a + ld a, [hl] + ld c, a + ld [wHPBarOldHP], a ; current HP stored at wHPBarOldHP (2 bytes, big-endian) or b - jr nz,.notFainted + jr nz, .notFainted .fainted - ld a,[wcf91] - cp a,REVIVE - jr z,.updateInBattleFaintedData - cp a,MAX_REVIVE - jr z,.updateInBattleFaintedData + ld a, [wcf91] + cp REVIVE + jr z, .updateInBattleFaintedData + cp MAX_REVIVE + jr z, .updateInBattleFaintedData jp .healingItemNoEffect + .updateInBattleFaintedData ld a, [wWhichPokemon] push af @@ -1035,69 +1043,71 @@ ItemUseMedicine: ; d8ae (3:58ae) pop af ld [wWhichPokemon], a - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jr z,.compareCurrentHPToMaxHP + jr z, .compareCurrentHPToMaxHP push hl push de push bc - ld a,[wUsedItemOnWhichPokemon] - ld c,a - ld hl,wPartyFoughtCurrentEnemyFlags - ld b,FLAG_TEST + ld a, [wUsedItemOnWhichPokemon] + ld c, a + ld hl, wPartyFoughtCurrentEnemyFlags + ld b, FLAG_TEST predef FlagActionPredef - ld a,c + ld a, c and a - jr z,.next - ld a,[wUsedItemOnWhichPokemon] - ld c,a - ld hl,wPartyGainExpFlags - ld b,FLAG_SET + jr z, .next + ld a, [wUsedItemOnWhichPokemon] + ld c, a + ld hl, wPartyGainExpFlags + ld b, FLAG_SET predef FlagActionPredef .next pop bc pop de pop hl jr .compareCurrentHPToMaxHP + .notFainted - ld a,[wcf91] - cp a,REVIVE - jp z,.healingItemNoEffect - cp a,MAX_REVIVE - jp z,.healingItemNoEffect + ld a, [wcf91] + cp REVIVE + jp z, .healingItemNoEffect + cp MAX_REVIVE + jp z, .healingItemNoEffect .compareCurrentHPToMaxHP push hl push bc ld bc,wPartyMon1MaxHP - (wPartyMon1HP + 1) add hl,bc ; hl now points to max HP pop bc - ld a,[hli] + ld a, [hli] cp b - jr nz,.skipComparingLSB ; no need to compare the LSB's if the MSB's don't match - ld a,[hl] + jr nz, .skipComparingLSB ; no need to compare the LSB's if the MSB's don't match + ld a, [hl] cp c .skipComparingLSB pop hl - jr nz,.notFullHP + jr nz, .notFullHP .fullHP ; if the pokemon's current HP equals its max HP - ld a,[wcf91] - cp a,FULL_RESTORE - jp nz,.healingItemNoEffect + ld a, [wcf91] + cp FULL_RESTORE + jp nz, .healingItemNoEffect inc hl inc hl - ld a,[hld] ; status ailment + ld a, [hld] ; status ailment and a ; does the pokemon have a status ailment? - jp z,.healingItemNoEffect - ld a,FULL_HEAL - ld [wcf91],a + jp z, .healingItemNoEffect + ld a, FULL_HEAL + ld [wcf91], a dec hl dec hl dec hl jp .cureStatusAilment + .notFullHP ; if the pokemon's current HP doesn't equal its max HP xor a - ld [wLowHealthAlarm],a ;disable low health alarm - ld [wChannelSoundIDs + CH4],a + ld [wLowHealthAlarm], a ;disable low health alarm + ld [wChannelSoundIDs + CH4], a push hl push de ld bc,wPartyMon1MaxHP - (wPartyMon1HP + 1) @@ -1108,105 +1118,106 @@ ItemUseMedicine: ; d8ae (3:58ae) ld [wHPBarMaxHP],a ; max HP stored at wHPBarMaxHP (2 bytes, big-endian) ld a,[wPseudoItemID] and a ; using Softboiled? - jp z,.notUsingSoftboiled2 + jp z, .notUsingSoftboiled2 ; if using softboiled - ld hl,wHPBarMaxHP - ld a,[hli] + ld hl, wHPBarMaxHP + ld a, [hli] push af - ld a,[hli] + ld a, [hli] push af - ld a,[hli] + ld a, [hli] push af - ld a,[hl] + ld a, [hl] push af - ld hl,wPartyMon1MaxHP - ld a,[wWhichPokemon] - ld bc,wPartyMon2 - wPartyMon1 + ld hl, wPartyMon1MaxHP + ld a, [wWhichPokemon] + ld bc, wPartyMon2 - wPartyMon1 call AddNTimes - ld a,[hli] - ld [wHPBarMaxHP + 1],a - ld [H_DIVIDEND],a - ld a,[hl] - ld [wHPBarMaxHP],a - ld [H_DIVIDEND + 1],a - ld a,5 - ld [H_DIVISOR],a - ld b,2 ; number of bytes + ld a, [hli] + ld [wHPBarMaxHP + 1], a + ld [H_DIVIDEND], a + ld a, [hl] + ld [wHPBarMaxHP], a + ld [H_DIVIDEND + 1], a + ld a, 5 + ld [H_DIVISOR], a + ld b, 2 ; number of bytes call Divide ; get 1/5 of max HP of pokemon that used Softboiled ld bc,(wPartyMon1HP + 1) - (wPartyMon1MaxHP + 1) add hl,bc ; hl now points to LSB of current HP of pokemon that used Softboiled ; subtract 1/5 of max HP from current HP of pokemon that used Softboiled - ld a,[H_QUOTIENT + 3] + ld a, [H_QUOTIENT + 3] push af - ld b,a - ld a,[hl] - ld [wHPBarOldHP],a + ld b, a + ld a, [hl] + ld [wHPBarOldHP], a sub b - ld [hld],a - ld [wHPBarNewHP],a - ld a,[H_QUOTIENT + 2] - ld b,a - ld a,[hl] - ld [wHPBarOldHP+1],a + ld [hld], a + ld [wHPBarNewHP], a + ld a, [H_QUOTIENT + 2] + ld b, a + ld a, [hl] + ld [wHPBarOldHP+1], a sbc b - ld [hl],a - ld [wHPBarNewHP+1],a + ld [hl], a + ld [wHPBarNewHP+1], a coord hl, 4, 1 - ld a,[wWhichPokemon] - ld bc,2 * SCREEN_WIDTH + ld a, [wWhichPokemon] + ld bc, 2 * SCREEN_WIDTH call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled - ld a,SFX_HEAL_HP + ld a, SFX_HEAL_HP call PlaySoundWaitForCurrent - ld a,[hFlags_0xFFFA] - set 0,a - ld [hFlags_0xFFFA],a - ld a,$02 - ld [wHPBarType],a + ld a, [hFlags_0xFFFA] + set 0, a + ld [hFlags_0xFFFA], a + ld a, $02 + ld [wHPBarType], a predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled - ld a,[hFlags_0xFFFA] - res 0,a - ld [hFlags_0xFFFA],a + ld a, [hFlags_0xFFFA] + res 0, a + ld [hFlags_0xFFFA], a pop af - ld b,a ; store heal amount (1/5 of max HP) - ld hl,wHPBarOldHP + 1 + ld b, a ; store heal amount (1/5 of max HP) + ld hl, wHPBarOldHP + 1 pop af - ld [hld],a + ld [hld], a pop af - ld [hld],a + ld [hld], a pop af - ld [hld],a + ld [hld], a pop af - ld [hl],a + ld [hl], a jr .addHealAmount + .notUsingSoftboiled2 - ld a,[wcf91] - cp a,SODA_POP - ld b,60 ; Soda Pop heal amount - jr z,.addHealAmount - ld b,80 ; Lemonade heal amount - jr nc,.addHealAmount - cp a,FRESH_WATER - ld b,50 ; Fresh Water heal amount - jr z,.addHealAmount - cp a,SUPER_POTION - ld b,200 ; Hyper Potion heal amount - jr c,.addHealAmount - ld b,50 ; Super Potion heal amount - jr z,.addHealAmount - ld b,20 ; Potion heal amount + ld a, [wcf91] + cp SODA_POP + ld b, 60 ; Soda Pop heal amount + jr z, .addHealAmount + ld b, 80 ; Lemonade heal amount + jr nc, .addHealAmount + cp FRESH_WATER + ld b, 50 ; Fresh Water heal amount + jr z, .addHealAmount + cp SUPER_POTION + ld b, 200 ; Hyper Potion heal amount + jr c, .addHealAmount + ld b, 50 ; Super Potion heal amount + jr z, .addHealAmount + ld b, 20 ; Potion heal amount .addHealAmount pop de pop hl - ld a,[hl] + ld a, [hl] add b - ld [hld],a - ld [wHPBarNewHP],a - ld a,[hl] - ld [wHPBarNewHP+1],a - jr nc,.noCarry + ld [hld], a + ld [wHPBarNewHP], a + ld a, [hl] + ld [wHPBarNewHP+1], a + jr nc, .noCarry inc [hl] - ld a,[hl] - ld [wHPBarNewHP + 1],a + ld a, [hl] + ld [wHPBarNewHP + 1], a .noCarry push de inc hl @@ -1222,38 +1233,40 @@ ItemUseMedicine: ; d8ae (3:58ae) ld a,[de] sub b dec de - ld b,[hl] - ld a,[de] + ld b, [hl] + ld a, [de] sbc b - jr nc,.setCurrentHPToMaxHp ; if current HP exceeds max HP after healing - ld a,[wcf91] - cp a,HYPER_POTION - jr c,.setCurrentHPToMaxHp ; if using a Full Restore or Max Potion - cp a,MAX_REVIVE - jr z,.setCurrentHPToMaxHp ; if using a Max Revive + jr nc, .setCurrentHPToMaxHp ; if current HP exceeds max HP after healing + ld a, [wcf91] + cp HYPER_POTION + jr c, .setCurrentHPToMaxHp ; if using a Full Restore or Max Potion + cp MAX_REVIVE + jr z, .setCurrentHPToMaxHp ; if using a Max Revive jr .updateInBattleData + .setCurrentHPToHalfMaxHP dec hl dec de - ld a,[hli] + ld a, [hli] srl a - ld [de],a - ld [wHPBarNewHP+1],a - ld a,[hl] + ld [de], a + ld [wHPBarNewHP+1], a + ld a, [hl] rr a inc de - ld [de],a - ld [wHPBarNewHP],a + ld [de], a + ld [wHPBarNewHP], a dec de jr .doneHealingPartyHP + .setCurrentHPToMaxHp - ld a,[hli] - ld [de],a - ld [wHPBarNewHP+1],a + ld a, [hli] + ld [de], a + ld [wHPBarNewHP+1], a inc de - ld a,[hl] - ld [de],a - ld [wHPBarNewHP],a + ld a, [hl] + ld [de], a + ld [wHPBarNewHP], a dec de .doneHealingPartyHP ; done updating the pokemon's current HP in the party data structure ld a,[wcf91] @@ -1262,101 +1275,106 @@ ItemUseMedicine: ; d8ae (3:58ae) ld bc,wPartyMon1Status - (wPartyMon1MaxHP + 1) add hl,bc xor a - ld [hl],a ; remove the status ailment in the party data + ld [hl], a ; remove the status ailment in the party data .updateInBattleData - ld h,d - ld l,e + ld h, d + ld l, e pop de - ld a,[wPlayerMonNumber] + ld a, [wPlayerMonNumber] cp d ; is pokemon the item was used on active in battle? - jr nz,.calculateHPBarCoords + jr nz, .calculateHPBarCoords ; copy party HP to in-battle HP - ld a,[hli] - ld [wBattleMonHP],a - ld a,[hld] - ld [wBattleMonHP + 1],a - ld a,[wcf91] - cp a,FULL_RESTORE - jr nz,.calculateHPBarCoords + ld a, [hli] + ld [wBattleMonHP], a + ld a, [hld] + ld [wBattleMonHP + 1], a + ld a, [wcf91] + cp FULL_RESTORE + jr nz, .calculateHPBarCoords xor a - ld [wBattleMonStatus],a ; remove the status ailment in the in-battle pokemon data + ld [wBattleMonStatus], a ; remove the status ailment in the in-battle pokemon data .calculateHPBarCoords ld hl,wOAMBuffer + $90 ld bc,2 * SCREEN_WIDTH inc d .calculateHPBarCoordsLoop - add hl,bc + add hl, bc dec d - jr nz,.calculateHPBarCoordsLoop + jr nz, .calculateHPBarCoordsLoop jr .doneHealing + .healingItemNoEffect call ItemUseNoEffect jp .done + .doneHealing - ld a,[wPseudoItemID] + ld a, [wPseudoItemID] and a ; using Softboiled? - jr nz,.skipRemovingItem ; no item to remove if using Softboiled + jr nz, .skipRemovingItem ; no item to remove if using Softboiled push hl call RemoveUsedItem pop hl .skipRemovingItem - ld a,[wcf91] - cp a,FULL_RESTORE - jr c,.playStatusAilmentCuringSound - cp a,FULL_HEAL - jr z,.playStatusAilmentCuringSound - ld a,SFX_HEAL_HP + ld a, [wcf91] + cp FULL_RESTORE + jr c, .playStatusAilmentCuringSound + cp FULL_HEAL + jr z, .playStatusAilmentCuringSound + ld a, SFX_HEAL_HP call PlaySoundWaitForCurrent - ld a,[hFlags_0xFFFA] - set 0,a - ld [hFlags_0xFFFA],a - ld a,$02 - ld [wHPBarType],a + ld a, [hFlags_0xFFFA] + set 0, a + ld [hFlags_0xFFFA], a + ld a, $02 + ld [wHPBarType], a predef UpdateHPBar2 ; animate the HP bar lengthening - ld a,[hFlags_0xFFFA] - res 0,a - ld [hFlags_0xFFFA],a - ld a,REVIVE_MSG - ld [wPartyMenuTypeOrMessageID],a - ld a,[wcf91] - cp a,REVIVE - jr z,.showHealingItemMessage - cp a,MAX_REVIVE - jr z,.showHealingItemMessage - ld a,POTION_MSG - ld [wPartyMenuTypeOrMessageID],a + ld a, [hFlags_0xFFFA] + res 0, a + ld [hFlags_0xFFFA], a + ld a, REVIVE_MSG + ld [wPartyMenuTypeOrMessageID], a + ld a, [wcf91] + cp REVIVE + jr z, .showHealingItemMessage + cp MAX_REVIVE + jr z, .showHealingItemMessage + ld a, POTION_MSG + ld [wPartyMenuTypeOrMessageID], a jr .showHealingItemMessage + .playStatusAilmentCuringSound - ld a,SFX_HEAL_AILMENT + ld a, SFX_HEAL_AILMENT call PlaySoundWaitForCurrent .showHealingItemMessage xor a - ld [H_AUTOBGTRANSFERENABLED],a + ld [H_AUTOBGTRANSFERENABLED], a call ClearScreen dec a - ld [wUpdateSpritesEnabled],a + ld [wUpdateSpritesEnabled], a call RedrawPartyMenu ; redraws the party menu and displays the message - ld a,1 - ld [H_AUTOBGTRANSFERENABLED],a - ld c,50 + ld a, 1 + ld [H_AUTOBGTRANSFERENABLED], a + ld c, 50 call DelayFrames call WaitForTextScrollButtonPress jr .done + .canceledItemUse xor a - ld [wActionResultOrTookBattleTurn],a ; item use failed + ld [wActionResultOrTookBattleTurn], a ; item use failed pop af pop af .done - ld a,[wPseudoItemID] + ld a, [wPseudoItemID] and a ; using Softboiled? ret nz ; if so, return call GBPalWhiteOut - call z,RunDefaultPaletteCommand - ld a,[wIsInBattle] + call z, RunDefaultPaletteCommand + ld a, [wIsInBattle] and a ret nz jp ReloadMapData + .useVitamin push hl ld a,[hl] @@ -1368,64 +1386,67 @@ ItemUseMedicine: ; d8ae (3:58ae) ld [wCurEnemyLVL],a ; store level call GetMonHeader push de - ld a,d - ld hl,wPartyMonNicks + ld a, d + ld hl, wPartyMonNicks call GetPartyMonName pop de pop hl - ld a,[wcf91] - cp a,RARE_CANDY - jp z,.useRareCandy + ld a, [wcf91] + cp RARE_CANDY + jp z, .useRareCandy push hl - sub a,HP_UP + sub HP_UP add a ld bc,wPartyMon1HPExp - wPartyMon1 add hl,bc add l - ld l,a - jr nc,.noCarry2 + ld l, a + jr nc, .noCarry2 inc h .noCarry2 - ld a,10 - ld b,a - ld a,[hl] ; a = MSB of stat experience of the appropriate stat - cp a,100 ; is there already at least 25600 (256 * 100) stat experience? - jr nc,.vitaminNoEffect ; if so, vitamins can't add any more + ld a, 10 + ld b, a + ld a, [hl] ; a = MSB of stat experience of the appropriate stat + cp 100 ; is there already at least 25600 (256 * 100) stat experience? + jr nc, .vitaminNoEffect ; if so, vitamins can't add any more add b ; add 2560 (256 * 10) stat experience - jr nc,.noCarry3 ; a carry should be impossible here, so this will always jump - ld a,255 + jr nc, .noCarry3 ; a carry should be impossible here, so this will always jump + ld a, 255 .noCarry3 - ld [hl],a + ld [hl], a pop hl call .recalculateStats - ld hl,VitaminText - ld a,[wcf91] - sub a,HP_UP - 1 - ld c,a + ld hl, VitaminText + ld a, [wcf91] + sub HP_UP - 1 + ld c, a .statNameLoop ; loop to get the address of the name of the stat the vitamin increases dec c - jr z,.gotStatName + jr z, .gotStatName .statNameInnerLoop - ld a,[hli] - ld b,a - ld a,$50 + ld a, [hli] + ld b, a + ld a, $50 cp b - jr nz,.statNameInnerLoop + jr nz, .statNameInnerLoop jr .statNameLoop + .gotStatName - ld de,wcf4b - ld bc,10 + ld de, wcf4b + ld bc, 10 call CopyData ; copy the stat's name to wcf4b - ld a,SFX_HEAL_AILMENT + ld a, SFX_HEAL_AILMENT call PlaySound - ld hl,VitaminStatRoseText + ld hl, VitaminStatRoseText call PrintText jp RemoveUsedItem + .vitaminNoEffect pop hl - ld hl,VitaminNoEffectText + ld hl, VitaminNoEffectText call PrintText jp GBPalWhiteOut + .recalculateStats ld bc,wPartyMon1Stats - wPartyMon1 add hl,bc @@ -1443,27 +1464,27 @@ ItemUseMedicine: ; d8ae (3:58ae) cp a, MAX_LEVEL jr z,.vitaminNoEffect ; can't raise level above 100 inc a - ld [hl],a ; store incremented level - ld [wCurEnemyLVL],a + ld [hl], a ; store incremented level + ld [wCurEnemyLVL], a push hl push de - ld d,a + ld d, a callab CalcExperience ; calculate experience for next level and store it at $ff96 pop de pop hl ld bc,wPartyMon1Exp - wPartyMon1Level add hl,bc ; hl now points to MSB of experience ; update experience to minimum for new level - ld a,[hExperience] - ld [hli],a - ld a,[hExperience + 1] - ld [hli],a - ld a,[hExperience + 2] - ld [hl],a + ld a, [hExperience] + ld [hli], a + ld a, [hExperience + 1] + ld [hli], a + ld a, [hExperience + 2] + ld [hl], a pop hl - ld a,[wWhichPokemon] + ld a, [wWhichPokemon] push af - ld a,[wcf91] + ld a, [wcf91] push af push de push hl @@ -1480,41 +1501,41 @@ ItemUseMedicine: ; d8ae (3:58ae) ld bc,(wPartyMon1MaxHP + 1) - wPartyMon1 add hl,bc ; hl now points to LSB of max HP pop bc - ld a,[hld] + ld a, [hld] sub c - ld c,a - ld a,[hl] + ld c, a + ld a, [hl] sbc b - ld b,a ; bc = the amount of max HP gained from leveling up + ld b, a ; bc = the amount of max HP gained from leveling up ; add the amount gained to the current HP ld de,(wPartyMon1HP + 1) - wPartyMon1MaxHP add hl,de ; hl now points to LSB of current HP ld a,[hl] add c - ld [hld],a - ld a,[hl] + ld [hld], a + ld a, [hl] adc b - ld [hl],a - ld a,RARE_CANDY_MSG - ld [wPartyMenuTypeOrMessageID],a + ld [hl], a + ld a, RARE_CANDY_MSG + ld [wPartyMenuTypeOrMessageID], a call RedrawPartyMenu pop de - ld a,d - ld [wWhichPokemon],a - ld a,e - ld [wd11e],a + ld a, d + ld [wWhichPokemon], a + ld a, e + ld [wd11e], a xor a ; PLAYER_PARTY_DATA - ld [wMonDataLocation],a + ld [wMonDataLocation], a call LoadMonData - ld d,$01 + ld d, $01 callab PrintStatsBox ; display new stats text box call WaitForTextScrollButtonPress ; wait for button press xor a ; PLAYER_PARTY_DATA - ld [wMonDataLocation],a + ld [wMonDataLocation], a predef LearnMoveFromLevelUp ; learn level up move, if any xor a - ld [wForceEvolution],a + ld [wForceEvolution], a callabd_ModifyPikachuHappiness PIKAHAPPY_LEVELUP ld a, [wWhichPokemon] push af @@ -1522,15 +1543,15 @@ ItemUseMedicine: ; d8ae (3:58ae) ld [wWhichPokemon], a callab Func_2fd6a ; evolve pokemon, if appropriate pop af - ld [wWhichPokemon],a + ld [wWhichPokemon], a callab TryEvolvingMon - ld a,$01 - ld [wUpdateSpritesEnabled],a + ld a, $01 + ld [wUpdateSpritesEnabled], a pop af - ld [wcf91],a + ld [wcf91], a pop af - ld [wWhichPokemon],a + ld [wWhichPokemon], a jp RemoveUsedItem VitaminStatRoseText: ; dd44 (3:5d44) @@ -1549,50 +1570,50 @@ VitaminText: ; dd4e (3:5d4e) db "SPECIAL@" ItemUseBait: ; dd72 (3:5d72) - ld hl,ThrewBaitText + ld hl, ThrewBaitText call PrintText - ld hl,wEnemyMonCatchRate ; catch rate + ld hl, wEnemyMonCatchRate ; catch rate srl [hl] ; halve catch rate - ld a,BAIT_ANIM - ld hl,wSafariBaitFactor ; bait factor - ld de,wSafariEscapeFactor ; escape factor + ld a, BAIT_ANIM + ld hl, wSafariBaitFactor ; bait factor + ld de, wSafariEscapeFactor ; escape factor jr BaitRockCommon ItemUseRock: ; dd87 (3:5d87) - ld hl,ThrewRockText + ld hl, ThrewRockText call PrintText - ld hl,wEnemyMonCatchRate ; catch rate - ld a,[hl] + ld hl, wEnemyMonCatchRate ; catch rate + ld a, [hl] add a ; double catch rate - jr nc,.noCarry - ld a,$ff + jr nc, .noCarry + ld a, $ff .noCarry - ld [hl],a - ld a,ROCK_ANIM - ld hl,wSafariEscapeFactor ; escape factor - ld de,wSafariBaitFactor ; bait factor + ld [hl], a + ld a, ROCK_ANIM + ld hl, wSafariEscapeFactor ; escape factor + ld de, wSafariBaitFactor ; bait factor BaitRockCommon: ; dd9f (3:5d9f) - ld [wAnimationID],a + ld [wAnimationID], a xor a - ld [wAnimationType],a - ld [H_WHOSETURN],a - ld [de],a ; zero escape factor (for bait), zero bait factor (for rock) + ld [wAnimationType], a + ld [H_WHOSETURN], a + ld [de], a ; zero escape factor (for bait), zero bait factor (for rock) .randomLoop ; loop until a random number less than 5 is generated call Random - and a,7 - cp a,5 - jr nc,.randomLoop + and 7 + cp 5 + jr nc, .randomLoop inc a ; increment the random number, giving a range from 1 to 5 inclusive - ld b,a - ld a,[hl] + ld b, a + ld a, [hl] add b ; increase bait factor (for bait), increase escape factor (for rock) - jr nc,.noCarry - ld a,$ff + jr nc, .noCarry + ld a, $ff .noCarry - ld [hl],a + ld [hl], a predef MoveAnimation ; do animation - ld c,70 + ld c, 70 jp DelayFrames ThrewBaitText: ; ddc6 (3:5dc6) @@ -1605,46 +1626,46 @@ ThrewRockText: ; ddca (3:5dca) ; also used for Dig out-of-battle effect ItemUseEscapeRope: ; ddcf (3:5dcf) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jr nz,.notUsable - ld a,[wCurMap] - cp a,AGATHAS_ROOM - jr z,.notUsable - cp a,BILLS_HOUSE - jr z,.notUsable - cp a,POKEMON_FAN_CLUB - jr z,.notUsable - ld a,[wCurMapTileset] - ld b,a - ld hl,EscapeRopeTilesets + jr nz, .notUsable + ld a, [wCurMap] + cp AGATHAS_ROOM + jr z, .notUsable + cp BILLS_HOUSE + jr z, .notUsable + cp POKEMON_FAN_CLUB + jr z, .notUsable + ld a, [wCurMapTileset] + ld b, a + ld hl, EscapeRopeTilesets .loop - ld a,[hli] - cp a,$ff - jr z,.notUsable + ld a, [hli] + cp $ff + jr z, .notUsable cp b - jr nz,.loop - ld hl,wd732 - set 3,[hl] - set 6,[hl] + jr nz, .loop + ld hl, wd732 + set 3, [hl] + set 6, [hl] call Func_1510 - ld hl,wd72e - res 4,[hl] - ld hl,wd790 - res 7,[hl] + ld hl, wd72e + res 4, [hl] + ResetEvent EVENT_IN_SAFARI_ZONE xor a - ld [wNumSafariBalls],a - ld [wSafariZoneEntranceCurScript],a + ld [wNumSafariBalls], a + ld [wSafariZoneEntranceCurScript], a inc a - ld [wEscapedFromBattle],a - ld [wActionResultOrTookBattleTurn],a ; item used - ld a,[wPseudoItemID] + ld [wEscapedFromBattle], a + ld [wActionResultOrTookBattleTurn], a ; item used + ld a, [wPseudoItemID] and a ; using Dig? ret nz ; if so, return call ItemUseReloadOverworldData - ld c,30 + ld c, 30 call DelayFrames jp RemoveUsedItem + .notUsable jp ItemUseNotTime @@ -1653,23 +1674,23 @@ EscapeRopeTilesets: ; de28 (3:5e28) db $ff ; terminator ItemUseRepel: ; de2e (3:5e2e) - ld b,100 + ld b, 100 ItemUseRepelCommon: ; e005 (3:6005) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp nz,ItemUseNotTime - ld a,b - ld [wRepelRemainingSteps],a + jp nz, ItemUseNotTime + ld a, b + ld [wRepelRemainingSteps], a jp PrintItemUseTextAndRemoveItem ; handles X Accuracy item ItemUseXAccuracy: ; de3e (3:5e3e) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp z,ItemUseNotTime - ld hl,wPlayerBattleStatus2 - set UsingXAccuracy,[hl] ; X Accuracy bit + jp z, ItemUseNotTime + ld hl, wPlayerBattleStatus2 + set UsingXAccuracy, [hl] ; X Accuracy bit callabd_ModifyPikachuHappiness PIKAHAPPY_USEDXITEM jp PrintItemUseTextAndRemoveItem @@ -1677,40 +1698,43 @@ ItemUseXAccuracy: ; de3e (3:5e3e) ; The Card Key is handled in a different way. ItemUseCardKey: ; de57 (3:de57) xor a - ld [wUnusedD71F],a + ld [wUnusedD71F], a call GetTileAndCoordsInFrontOfPlayer ld a,[GetTileAndCoordsInFrontOfPlayer] cp a,$18 jr nz,.next0 ld hl,CardKeyTable1 jr .next1 + .next0 - cp a,$24 - jr nz,.next2 - ld hl,CardKeyTable2 + cp $24 + jr nz, .next2 + ld hl, CardKeyTable2 jr .next1 + .next2 - cp a,$5e - jp nz,ItemUseNotTime - ld hl,CardKeyTable3 + cp $5e + jp nz, ItemUseNotTime + ld hl, CardKeyTable3 .next1 - ld a,[wCurMap] - ld b,a + ld a, [wCurMap] + ld b, a .loop - ld a,[hli] - cp a,$ff - jp z,ItemUseNotTime + ld a, [hli] + cp $ff + jp z, ItemUseNotTime cp b - jr nz,.nextEntry1 - ld a,[hli] + jr nz, .nextEntry1 + ld a, [hli] cp d - jr nz,.nextEntry2 - ld a,[hli] + jr nz, .nextEntry2 + ld a, [hli] cp e - jr nz,.nextEntry3 - ld a,[hl] - ld [wUnusedD71F],a + jr nz, .nextEntry3 + ld a, [hl] + ld [wUnusedD71F], a jr .done + .nextEntry1 inc hl .nextEntry2 @@ -1718,11 +1742,12 @@ ItemUseCardKey: ; de57 (3:de57) .nextEntry3 inc hl jr .loop + .done - ld hl,ItemUseText00 + ld hl, ItemUseText00 call PrintText - ld hl,wd728 - set 7,[hl] + ld hl, wd728 + set 7, [hl] ret ; These tables are probably supposed to be door locations in Silph Co., @@ -1736,48 +1761,48 @@ ItemUseCardKey: ; de57 (3:de57) ; 03: ID? CardKeyTable1: ; dea7 (3:5ea7) - db SILPH_CO_2F,$04,$04,$00 - db SILPH_CO_2F,$04,$05,$01 - db SILPH_CO_4F,$0C,$04,$02 - db SILPH_CO_4F,$0C,$05,$03 - db SILPH_CO_7F,$06,$0A,$04 - db SILPH_CO_7F,$06,$0B,$05 - db SILPH_CO_9F,$04,$12,$06 - db SILPH_CO_9F,$04,$13,$07 - db SILPH_CO_10F,$08,$0A,$08 - db SILPH_CO_10F,$08,$0B,$09 + db SILPH_CO_2F, $04, $04, $00 + db SILPH_CO_2F, $04, $05, $01 + db SILPH_CO_4F, $0C, $04, $02 + db SILPH_CO_4F, $0C, $05, $03 + db SILPH_CO_7F, $06, $0A, $04 + db SILPH_CO_7F, $06, $0B, $05 + db SILPH_CO_9F, $04, $12, $06 + db SILPH_CO_9F, $04, $13, $07 + db SILPH_CO_10F, $08, $0A, $08 + db SILPH_CO_10F, $08, $0B, $09 db $ff CardKeyTable2: ; ded0 (3:5ed0) - db SILPH_CO_3F,$08,$09,$0A - db SILPH_CO_3F,$09,$09,$0B - db SILPH_CO_5F,$04,$07,$0C - db SILPH_CO_5F,$05,$07,$0D - db SILPH_CO_6F,$0C,$05,$0E - db SILPH_CO_6F,$0D,$05,$0F - db SILPH_CO_8F,$08,$07,$10 - db SILPH_CO_8F,$09,$07,$11 - db SILPH_CO_9F,$08,$03,$12 - db SILPH_CO_9F,$09,$03,$13 + db SILPH_CO_3F, $08, $09, $0A + db SILPH_CO_3F, $09, $09, $0B + db SILPH_CO_5F, $04, $07, $0C + db SILPH_CO_5F, $05, $07, $0D + db SILPH_CO_6F, $0C, $05, $0E + db SILPH_CO_6F, $0D, $05, $0F + db SILPH_CO_8F, $08, $07, $10 + db SILPH_CO_8F, $09, $07, $11 + db SILPH_CO_9F, $08, $03, $12 + db SILPH_CO_9F, $09, $03, $13 db $ff CardKeyTable3: ; def9 (3:5ef9) - db SILPH_CO_11F,$08,$09,$14 - db SILPH_CO_11F,$09,$09,$15 + db SILPH_CO_11F, $08, $09, $14 + db SILPH_CO_11F, $09, $09, $15 db $ff ItemUsePokedoll: ; df02 (3:5f02) - ld a,[wIsInBattle] + ld a, [wIsInBattle] dec a - jp nz,ItemUseNotTime - ld a,$01 - ld [wEscapedFromBattle],a + jp nz, ItemUseNotTime + ld a, $01 + ld [wEscapedFromBattle], a jp PrintItemUseTextAndRemoveItem ItemUseGuardSpec: ; df11 (3:5f11) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp z,ItemUseNotTime + jp z, ItemUseNotTime ld a, [wWhichPokemon] push af @@ -1787,22 +1812,22 @@ ItemUseGuardSpec: ; df11 (3:5f11) pop af ld [wWhichPokemon], a - ld hl,wPlayerBattleStatus2 - set ProtectedByMist,[hl] ; Mist bit + ld hl, wPlayerBattleStatus2 + set ProtectedByMist, [hl] ; Mist bit jp PrintItemUseTextAndRemoveItem ItemUseSuperRepel: ; df38 (3:5f38) - ld b,200 + ld b, 200 jp ItemUseRepelCommon ItemUseMaxRepel: ; df3d (3:5f3d) - ld b,250 + ld b, 250 jp ItemUseRepelCommon ItemUseDireHit: ; df42 (3:5f42) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp z,ItemUseNotTime + jp z, ItemUseNotTime ld a, [wWhichPokemon] push af @@ -1812,35 +1837,36 @@ ItemUseDireHit: ; df42 (3:5f42) pop af ld [wWhichPokemon], a - ld hl,wPlayerBattleStatus2 - set GettingPumped,[hl] ; Focus Energy bit + ld hl, wPlayerBattleStatus2 + set GettingPumped, [hl] ; Focus Energy bit jp PrintItemUseTextAndRemoveItem ItemUseXStat: ; df69 (3:df69) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jr nz,.inBattle + jr nz, .inBattle call ItemUseNotTime - ld a,2 - ld [wActionResultOrTookBattleTurn],a ; item not used + ld a, 2 + ld [wActionResultOrTookBattleTurn], a ; item not used ret + .inBattle - ld hl,wPlayerMoveNum - ld a,[hli] + ld hl, wPlayerMoveNum + ld a, [hli] push af ; save [wPlayerMoveNum] - ld a,[hl] + ld a, [hl] push af ; save [wPlayerMoveEffect] push hl - ld a,[wcf91] - sub a,X_ATTACK - ATTACK_UP1_EFFECT - ld [hl],a ; store player move effect + ld a, [wcf91] + sub X_ATTACK - ATTACK_UP1_EFFECT + ld [hl], a ; store player move effect call PrintItemUseTextAndRemoveItem - ld a,XSTATITEM_ANIM ; X stat item animation ID - ld [wPlayerMoveNum],a + ld a, XSTATITEM_ANIM ; X stat item animation ID + ld [wPlayerMoveNum], a call LoadScreenTilesFromBuffer1 ; restore saved screen call Delay3 xor a - ld [H_WHOSETURN],a ; set turn to player's turn + ld [H_WHOSETURN], a ; set turn to player's turn callba StatModifierUpEffect ; do stat increase move ld a, [wWhichPokemon] @@ -1853,110 +1879,110 @@ ItemUseXStat: ; df69 (3:df69) pop hl pop af - ld [hld],a ; restore [wPlayerMoveEffect] + ld [hld], a ; restore [wPlayerMoveEffect] pop af - ld [hl],a ; restore [wPlayerMoveNum] + ld [hl], a ; restore [wPlayerMoveNum] ret ItemUsePokeflute: ; dfbd (3:5fbd) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jr nz,.inBattle + jr nz, .inBattle ; if not in battle call ItemUseReloadOverworldData - ld a,[wCurMap] - cp a,ROUTE_12 - jr nz,.notRoute12 - ld a, [wd7d8] - bit 7, a - jr nz,.noSnorlaxOrPikachuToWakeUp + ld a, [wCurMap] + cp ROUTE_12 + jr nz, .notRoute12 + CheckEvent EVENT_BEAT_ROUTE12_SNORLAX + jr nz, .noSnorlaxOrPikachuToWakeUp ; if the player hasn't beaten Route 12 Snorlax - ld hl,Route12SnorlaxFluteCoords + ld hl, Route12SnorlaxFluteCoords call ArePlayerCoordsInArray - jr nc,.noSnorlaxOrPikachuToWakeUp - ld hl,PlayedFluteHadEffectText + jr nc, .noSnorlaxOrPikachuToWakeUp + ld hl, PlayedFluteHadEffectText call PrintText - ld hl, wd7d8 - set 6, [hl] + SetEvent EVENT_FIGHT_ROUTE12_SNORLAX ret + .notRoute12 - cp a,ROUTE_16 - jr nz,.notRoute16 - ld a, [wd7e0] - bit 1, a - jr nz,.noSnorlaxOrPikachuToWakeUp + cp ROUTE_16 + jr nz, .notRoute16 + CheckEvent EVENT_BEAT_ROUTE16_SNORLAX + jr nz, .noSnorlaxOrPikachuToWakeUp ; if the player hasn't beaten Route 16 Snorlax - ld hl,Route16SnorlaxFluteCoords + ld hl, Route16SnorlaxFluteCoords call ArePlayerCoordsInArray - jr nc,.noSnorlaxOrPikachuToWakeUp - ld hl,PlayedFluteHadEffectText + jr nc, .noSnorlaxOrPikachuToWakeUp + ld hl, PlayedFluteHadEffectText call PrintText - ld hl, wd7e0 - set 0, [hl] + SetEvent EVENT_FIGHT_ROUTE16_SNORLAX ret + .notRoute16 - cp a,PEWTER_POKECENTER - jr nz,.noSnorlaxOrPikachuToWakeUp + cp PEWTER_POKECENTER + jr nz, .noSnorlaxOrPikachuToWakeUp call CheckPikachuFollowingPlayer - jr z,.noSnorlaxOrPikachuToWakeUp - callab Func_fcb01 - jr nc,.noSnorlaxOrPikachuToWakeUp + jr z, .noSnorlaxOrPikachuToWakeUp + callab IsPikachuRightNextToPlayer + jr nc, .noSnorlaxOrPikachuToWakeUp ld hl, PlayedFluteHadEffectText call PrintText call ItemUseReloadOverworldData ld e, $1a callab Func_fd001 ret + .noSnorlaxOrPikachuToWakeUp - ld hl,PlayedFluteNoEffectText + ld hl, PlayedFluteNoEffectText jp PrintText + .inBattle xor a - ld [wWereAnyMonsAsleep],a - ld b,~SLP & $ff - ld hl,wPartyMon1Status + ld [wWereAnyMonsAsleep], a + ld b, $ff ^ SLP + ld hl, wPartyMon1Status call WakeUpEntireParty - ld a,[wIsInBattle] + ld a, [wIsInBattle] dec a ; is it a trainer battle? - jr z,.skipWakingUpEnemyParty + jr z, .skipWakingUpEnemyParty ; if it's a trainer battle - ld hl,wEnemyMon1Status + ld hl, wEnemyMon1Status call WakeUpEntireParty .skipWakingUpEnemyParty - ld hl,wBattleMonStatus - ld a,[hl] + ld hl, wBattleMonStatus + ld a, [hl] and b ; remove Sleep status - ld [hl],a - ld hl,wEnemyMonStatus - ld a,[hl] - ld c,a + ld [hl], a + ld hl, wEnemyMonStatus + ld a, [hl] + ld c, a and b ; remove Sleep status - ld [hl],a - ld a,c - and a,SLP - jr z,.asm_e063 - ld a,$1 - ld [wWereAnyMonsAsleep],a + ld [hl], a + ld a, c + and SLP + jr z, .asm_e063 + ld a, $1 + ld [wWereAnyMonsAsleep], a .asm_e063 call LoadScreenTilesFromBuffer2 ; restore saved screen - ld a,[wWereAnyMonsAsleep] + ld a, [wWereAnyMonsAsleep] and a ; were any pokemon asleep before playing the flute? - ld hl,PlayedFluteNoEffectText - jp z,PrintText ; if no pokemon were asleep + ld hl, PlayedFluteNoEffectText + jp z, PrintText ; if no pokemon were asleep ; if some pokemon were asleep - ld hl,PlayedFluteHadEffectText + ld hl, PlayedFluteHadEffectText call PrintText - ld a,[wLowHealthAlarm] - and a,$80 - jr nz,.skipMusic + ld a, [wLowHealthAlarm] + and $80 + jr nz, .skipMusic call WaitForSoundToFinish ; wait for sound to end callba Music_PokeFluteInBattle ; play in-battle pokeflute music .musicWaitLoop ; wait for music to finish playing - ld a,[wChannelSoundIDs + CH6] + ld a, [wChannelSoundIDs + CH6] and a ; music off? - jr nz,.musicWaitLoop + jr nz, .musicWaitLoop .skipMusic - ld hl,FluteWokeUpText + ld hl, FluteWokeUpText jp PrintText ; wakes up all party pokemon @@ -1967,40 +1993,40 @@ ItemUsePokeflute: ; dfbd (3:5fbd) ; OUTPUT: ; [wWereAnyMonsAsleep]: set to 1 if any pokemon were asleep WakeUpEntireParty: ; e094 (3:6094) - ld de,44 - ld c,6 + ld de, 44 + ld c, 6 .loop - ld a,[hl] + ld a, [hl] push af - and a,SLP ; is pokemon asleep? - jr z,.notAsleep - ld a,1 - ld [wWereAnyMonsAsleep],a ; indicate that a pokemon had to be woken up + and SLP ; is pokemon asleep? + jr z, .notAsleep + ld a, 1 + ld [wWereAnyMonsAsleep], a ; indicate that a pokemon had to be woken up .notAsleep pop af and b ; remove Sleep status - ld [hl],a - add hl,de + ld [hl], a + add hl, de dec c - jr nz,.loop + jr nz, .loop ret ; Format: ; 00: Y ; 01: X Route12SnorlaxFluteCoords: ; e0ac (3:60ac) - db 62,9 ; one space West of Snorlax - db 61,10 ; one space North of Snorlax - db 63,10 ; one space South of Snorlax - db 62,11 ; one space East of Snorlax + db 62, 9 ; one space West of Snorlax + db 61, 10 ; one space North of Snorlax + db 63, 10 ; one space South of Snorlax + db 62, 11 ; one space East of Snorlax db $ff ; terminator ; Format: ; 00: Y ; 01: X Route16SnorlaxFluteCoords: ; e0b5 (3:60b5) - db 10,27 ; one space East of Snorlax - db 10,25 ; one space West of Snorlax + db 10, 27 ; one space East of Snorlax + db 10, 25 ; one space West of Snorlax db $ff ; terminator PlayedFluteNoEffectText: ; e0ba (3:60ba) @@ -2015,27 +2041,27 @@ PlayedFluteHadEffectText: ; e0c4 (3:60c4) TX_FAR _PlayedFluteHadEffectText db $06 TX_ASM - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jr nz,.done + jr nz, .done ; play out-of-battle pokeflute music call StopAllMusic ; turn off music ld a, SFX_POKEFLUTE ld c, BANK(SFX_Pokeflute) call PlayMusic .musicWaitLoop ; wait for music to finish playing - ld a,[wChannelSoundIDs + CH2] - cp a, SFX_POKEFLUTE - jr z,.musicWaitLoop + ld a, [wChannelSoundIDs + CH2] + cp SFX_POKEFLUTE + jr z, .musicWaitLoop call PlayDefaultMusic ; start playing normal music again .done jp TextScriptEnd ; end text ItemUseCoinCase: ; e0e7 (3:60e7) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp nz,ItemUseNotTime - ld hl,CoinCaseNumCoinsText + jp nz, ItemUseNotTime + ld hl, CoinCaseNumCoinsText jp PrintText CoinCaseNumCoinsText: ; e0f1 (3:60f1) @@ -2051,7 +2077,7 @@ ItemUseOldRod: ; e0f9 (3:60f9) ItemUseGoodRod: ; e106 (3:6106) call FishingInit - jp c,ItemUseNotTime + jp c, ItemUseNotTime .RandomLoop call Random srl a @@ -2060,17 +2086,17 @@ ItemUseGoodRod: ; e106 (3:6106) cp 2 jr nc, .RandomLoop ; choose which monster appears - ld hl,GoodRodMons + ld hl, GoodRodMons add a - ld c,a - ld b,0 - add hl,bc - ld b,[hl] + ld c, a + ld b, 0 + add hl, bc + ld b, [hl] inc hl - ld c,[hl] + ld c, [hl] and a .SetBite - ld a,0 + ld a, 0 rla xor 1 jr RodResponse @@ -2125,30 +2151,32 @@ DoNotGenerateFishingEncounter: ; e16e (3:616e) ; checks if fishing is possible and if so, runs initialization code common to all rods ; unsets carry if fishing is possible, sets carry if not FishingInit: ; e182 (3:6182) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jr z,.notInBattle + jr z, .notInBattle scf ; can't fish during battle ret + .notInBattle call IsNextTileShoreOrWater - jr nc,.cannotFish - ld a,[wWalkBikeSurfState] - cp a,2 ; Surfing? - jr z,.cannotFish + jr nc, .cannotFish + ld a, [wWalkBikeSurfState] + cp 2 ; Surfing? + jr z, .cannotFish call ItemUseReloadOverworldData - ld hl,ItemUseText00 + ld hl, ItemUseText00 call PrintText - ld a,SFX_HEAL_AILMENT + ld a, SFX_HEAL_AILMENT call PlaySound ld a, $2 ld [wd49c], a ld a, $81 ld [wPikachuMood], a - ld c,80 + ld c, 80 call DelayFrames and a ret + .cannotFish scf ; can't fish when surfing ret @@ -2157,22 +2185,22 @@ ItemUseOaksParcel: ; e1b7 (3:61b7) jp ItemUseNotYoursToUse ItemUseItemfinder: ; e1ba (3:61ba) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp nz,ItemUseNotTime + jp nz, ItemUseNotTime call ItemUseReloadOverworldData callba HiddenItemNear ; check for hidden items - ld hl,ItemfinderFoundNothingText - jr nc,.printText ; if no hidden items - ld c,4 + ld hl, ItemfinderFoundNothingText + jr nc, .printText ; if no hidden items + ld c, 4 .loop - ld a,SFX_HEALING_MACHINE + ld a, SFX_HEALING_MACHINE call PlaySoundWaitForCurrent - ld a,SFX_PURCHASE + ld a, SFX_PURCHASE call PlaySoundWaitForCurrent dec c - jr nz,.loop - ld hl,ItemfinderFoundItemText + jr nz, .loop + ld hl, ItemfinderFoundItemText .printText jp PrintText @@ -2185,23 +2213,24 @@ ItemfinderFoundNothingText: ; e1eb (3:61eb) db "@" ItemUsePPUp: ; e1f0 (3:61f0) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp nz,ItemUseNotTime + jp nz, ItemUseNotTime ItemUsePPRestore: ; e1f7 (3:61f7) - ld a,[wWhichPokemon] + ld a, [wWhichPokemon] push af - ld a,[wcf91] - ld [wPPRestoreItem],a + ld a, [wcf91] + ld [wPPRestoreItem], a .chooseMon xor a - ld [wUpdateSpritesEnabled],a - ld a,USE_ITEM_PARTY_MENU - ld [wPartyMenuTypeOrMessageID],a + ld [wUpdateSpritesEnabled], a + ld a, USE_ITEM_PARTY_MENU + ld [wPartyMenuTypeOrMessageID], a call DisplayPartyMenu - jr nc,.chooseMove + jr nc, .chooseMove jp .itemNotUsed + .chooseMove ld a, [wIsInBattle] and a @@ -2216,37 +2245,38 @@ ItemUsePPRestore: ; e1f7 (3:61f7) jr z, .usePPItem call ItemUseNotTime jp .itemNotUsed + .usePPItem - ld a,[wPPRestoreItem] - cp a,ELIXER - jp nc,.useElixir ; if Elixir or Max Elixir - ld a,$02 - ld [wMoveMenuType],a - ld hl,RaisePPWhichTechniqueText - ld a,[wPPRestoreItem] - cp a,ETHER ; is it a PP Up? - jr c,.printWhichTechniqueMessage ; if so, print the raise PP message - ld hl,RestorePPWhichTechniqueText ; otherwise, print the restore PP message + ld a, [wPPRestoreItem] + cp ELIXER + jp nc, .useElixir ; if Elixir or Max Elixir + ld a, $02 + ld [wMoveMenuType], a + ld hl, RaisePPWhichTechniqueText + ld a, [wPPRestoreItem] + cp ETHER ; is it a PP Up? + jr c, .printWhichTechniqueMessage ; if so, print the raise PP message + ld hl, RestorePPWhichTechniqueText ; otherwise, print the restore PP message .printWhichTechniqueMessage call PrintText xor a - ld [wPlayerMoveListIndex],a + ld [wPlayerMoveListIndex], a callab MoveSelectionMenu ; move selection menu - ld a,0 - ld [wPlayerMoveListIndex],a - jr nz,.chooseMon - ld hl,wPartyMon1Moves + ld a, 0 + ld [wPlayerMoveListIndex], a + jr nz, .chooseMon + ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 call GetSelectedMoveOffset push hl - ld a,[hl] - ld [wd11e],a + ld a, [hl] + ld [wd11e], a call GetMoveName call CopyStringToCF4B ; copy name to wcf4b pop hl - ld a,[wPPRestoreItem] - cp a,ETHER - jr nc,.useEther ; if Ether or Max Ether + ld a, [wPPRestoreItem] + cp ETHER + jr nc, .useEther ; if Ether or Max Ether .usePPUp ld bc,wPartyMon1PP - wPartyMon1Moves add hl,bc @@ -2256,81 +2286,86 @@ ItemUsePPRestore: ; e1f7 (3:61f7) ld hl,PPMaxedOutText call PrintText jr .chooseMove + .PPNotMaxedOut - ld a,[hl] - add a,1 << 6 ; increase PP Up count by 1 - ld [hl],a - ld a,1 ; 1 PP Up used - ld [wd11e],a + ld a, [hl] + add 1 << 6 ; increase PP Up count by 1 + ld [hl], a + ld a, 1 ; 1 PP Up used + ld [wd11e], a call RestoreBonusPP ; add the bonus PP to current PP ld a, SFX_HEAL_AILMENT call PlaySound - ld hl,PPIncreasedText + ld hl, PPIncreasedText call PrintText .done pop af - ld [wWhichPokemon],a + ld [wWhichPokemon], a call GBPalWhiteOut call RunDefaultPaletteCommand jp RemoveUsedItem + .afterRestoringPP ; after using a (Max) Ether/Elixir - ld a,[wWhichPokemon] - ld b,a - ld a,[wPlayerMonNumber] + ld a, [wWhichPokemon] + ld b, a + ld a, [wPlayerMonNumber] cp b ; is the pokemon whose PP was restored active in battle? - jr nz,.skipUpdatingInBattleData - ld hl,wPartyMon1PP + jr nz, .skipUpdatingInBattleData + ld hl, wPartyMon1PP ld bc, wPartyMon2 - wPartyMon1 call AddNTimes - ld de,wBattleMonPP - ld bc,4 + ld de, wBattleMonPP + ld bc, 4 call CopyData ; copy party data to in-battle data .skipUpdatingInBattleData - ld a,SFX_HEAL_AILMENT + ld a, SFX_HEAL_AILMENT call PlaySound - ld hl,PPRestoredText + ld hl, PPRestoredText call PrintText jr .done + .useEther call .restorePP - jr nz,.afterRestoringPP + jr nz, .afterRestoringPP jp .noEffect + ; unsets zero flag if PP was restored, sets zero flag if not ; however, this is bugged for Max Ethers and Max Elixirs (see below) .restorePP xor a ; PLAYER_PARTY_DATA - ld [wMonDataLocation],a + ld [wMonDataLocation], a call GetMaxPP - ld hl,wPartyMon1Moves + ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 call GetSelectedMoveOffset ld bc, wPartyMon1PP - wPartyMon1Moves - add hl,bc ; hl now points to move's PP - ld a,[wMaxPP] - ld b,a - ld a,[wPPRestoreItem] - cp a,MAX_ETHER - jr z,.fullyRestorePP - ld a,[hl] ; move PP - and a,%00111111 ; lower 6 bit bits store current PP + add hl, bc ; hl now points to move's PP + ld a, [wMaxPP] + ld b, a + ld a, [wPPRestoreItem] + cp MAX_ETHER + jr z, .fullyRestorePP + ld a, [hl] ; move PP + and %00111111 ; lower 6 bit bits store current PP cp b ; does current PP equal max PP? ret z ; if so, return - add a,10 ; increase current PP by 10 + add 10 ; increase current PP by 10 ; b holds the max PP amount and b will hold the new PP amount. ; So, if the new amount meets or exceeds the max amount, ; cap the amount to the max amount by leaving b unchanged. ; Otherwise, store the new amount in b. cp b ; does the new amount meet or exceed the maximum? - jr nc,.storeNewAmount - ld b,a + jr nc, .storeNewAmount + ld b, a .storeNewAmount - ld a,[hl] ; move PP - and a,%11000000 ; PP Up counter bits + ld a, [hl] ; move PP + and %11000000 ; PP Up counter bits add b - ld [hl],a + ld [hl], a ret + .fullyRestorePP - ld a,[hl] ; move PP + ld a, [hl] ; move PP ; Note that this code has a bug. It doesn't mask out the upper two bits, which ; are used to count how many PP Ups have been used on the move. So, Max Ethers ; and Max Elixirs will not be detected as having no effect on a move with full @@ -2338,39 +2373,40 @@ ItemUsePPRestore: ; e1f7 (3:61f7) cp b ; does current PP equal max PP? ret z jr .storeNewAmount + .useElixir ; decrement the item ID so that ELIXER becomes ETHER and MAX_ELIXER becomes MAX_ETHER - ld hl,wPPRestoreItem + ld hl, wPPRestoreItem dec [hl] dec [hl] xor a - ld hl,wCurrentMenuItem - ld [hli],a - ld [hl],a ; zero the counter for number of moves that had their PP restored - ld b,4 + ld hl, wCurrentMenuItem + ld [hli], a + ld [hl], a ; zero the counter for number of moves that had their PP restored + ld b, 4 ; loop through each move and restore PP .elixirLoop push bc - ld hl,wPartyMon1Moves + ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 call GetSelectedMoveOffset - ld a,[hl] + ld a, [hl] and a ; does the current slot have a move? - jr z,.nextMove + jr z, .nextMove call .restorePP - jr z,.nextMove + jr z, .nextMove ; if some PP was restored - ld hl,wTileBehindCursor ; counter for number of moves that had their PP restored + ld hl, wTileBehindCursor ; counter for number of moves that had their PP restored inc [hl] .nextMove - ld hl,wCurrentMenuItem + ld hl, wCurrentMenuItem inc [hl] pop bc dec b - jr nz,.elixirLoop - ld a,[wTileBehindCursor] + jr nz, .elixirLoop + ld a, [wTileBehindCursor] and a ; did any moves have their PP restored? - jp nz,.afterRestoringPP + jp nz, .afterRestoringPP .noEffect call ItemUseNoEffect .itemNotUsed @@ -2378,7 +2414,7 @@ ItemUsePPRestore: ; e1f7 (3:61f7) call RunDefaultPaletteCommand pop af xor a - ld [wActionResultOrTookBattleTurn],a ; item use failed + ld [wActionResultOrTookBattleTurn], a ; item use failed ret RaisePPWhichTechniqueText: ; e358 (3:6358) @@ -2406,63 +2442,64 @@ UnusableItem: ; e371 (3:6371) jp ItemUseNotTime ItemUseTMHM: ; e374 (3:6374) - ld a,[wIsInBattle] + ld a, [wIsInBattle] and a - jp nz,ItemUseNotTime - ld a,[wcf91] - sub a,TM_01 + jp nz, ItemUseNotTime + ld a, [wcf91] + sub TM_01 push af - jr nc,.skipAdding - add a,55 ; if item is an HM, add 55 + jr nc, .skipAdding + add 55 ; if item is an HM, add 55 .skipAdding inc a - ld [wd11e],a + ld [wd11e], a predef TMToMove ; get move ID from TM/HM ID - ld a,[wd11e] - ld [wMoveNum],a + ld a, [wd11e] + ld [wMoveNum], a call GetMoveName call CopyStringToCF4B ; copy name to wcf4b pop af - ld hl,BootedUpTMText - jr nc,.printBootedUpMachineText - ld hl,BootedUpHMText + ld hl, BootedUpTMText + jr nc, .printBootedUpMachineText + ld hl, BootedUpHMText .printBootedUpMachineText call PrintText - ld hl,TeachMachineMoveText + ld hl, TeachMachineMoveText call PrintText coord hl, 14, 7 lb bc, 8, 15 - ld a,TWO_OPTION_MENU - ld [wTextBoxID],a + ld a, TWO_OPTION_MENU + ld [wTextBoxID], a call DisplayTextBoxID ; yes/no menu - ld a,[wCurrentMenuItem] + ld a, [wCurrentMenuItem] and a - jr z,.useMachine - ld a,2 - ld [wActionResultOrTookBattleTurn],a ; item not used + jr z, .useMachine + ld a, 2 + ld [wActionResultOrTookBattleTurn], a ; item not used ret + .useMachine - ld a,[wWhichPokemon] + ld a, [wWhichPokemon] push af - ld a,[wcf91] + ld a, [wcf91] push af .chooseMon - ld hl,wcf4b - ld de,wTempMoveNameBuffer - ld bc,14 + ld hl, wcf4b + ld de, wTempMoveNameBuffer + ld bc, 14 call CopyData ; save the move name because DisplayPartyMenu will overwrite it - ld a,$ff - ld [wUpdateSpritesEnabled],a - ld a,TMHM_PARTY_MENU - ld [wPartyMenuTypeOrMessageID],a + ld a, $ff + ld [wUpdateSpritesEnabled], a + ld a, TMHM_PARTY_MENU + ld [wPartyMenuTypeOrMessageID], a call DisplayPartyMenu push af - ld hl,wTempMoveNameBuffer - ld de,wcf4b - ld bc,14 + ld hl, wTempMoveNameBuffer + ld de, wcf4b + ld bc, 14 call CopyData pop af - jr nc,.checkIfAbleToLearnMove + jr nc, .checkIfAbleToLearnMove ; if the player canceled teaching the move pop af pop af @@ -2473,45 +2510,46 @@ ItemUseTMHM: ; e374 (3:6374) .checkIfAbleToLearnMove predef CanLearnTM ; check if the pokemon can learn the move push bc - ld a,[wWhichPokemon] - ld hl,wPartyMonNicks + ld a, [wWhichPokemon] + ld hl, wPartyMonNicks call GetPartyMonName pop bc - ld a,c + ld a, c and a ; can the pokemon learn the move? - jr nz,.checkIfAlreadyLearnedMove + jr nz, .checkIfAlreadyLearnedMove ; if the pokemon can't learn the move - ld a,SFX_DENIED + ld a, SFX_DENIED call PlaySoundWaitForCurrent - ld hl,MonCannotLearnMachineMoveText + ld hl, MonCannotLearnMachineMoveText call PrintText jr .chooseMon + .checkIfAlreadyLearnedMove callab CheckIfMoveIsKnown ; check if the pokemon already knows the move - jr c,.chooseMon + jr c, .chooseMon predef LearnMove ; teach move ld a, [wWhichPokemon] ld d, a pop af - ld [wcf91],a + ld [wcf91], a pop af - ld [wWhichPokemon],a - ld a,b + ld [wWhichPokemon], a + ld a, b and a ret z - ld a,[wWhichPokemon] + ld a, [wWhichPokemon] push af - ld a,d - ld [wWhichPokemon],a + ld a, d + ld [wWhichPokemon], a callabd_ModifyPikachuHappiness PIKAHAPPY_USEDTMHM callab IsThisPartymonStarterPikachu_Party - jr nc,.notTeachingThunderboltOrThunderToPikachu - ld a,[wcf91] - cp a,TM_24 ; are we teaching thunderbolt to the player pikachu? - jr z,.teachingThunderboltOrThunderToPlayerPikachu - cp a,TM_25 ; are we teaching thunder then? - jr nz,.notTeachingThunderboltOrThunderToPikachu + jr nc, .notTeachingThunderboltOrThunderToPikachu + ld a, [wcf91] + cp TM_24 ; are we teaching thunderbolt to the player pikachu? + jr z, .teachingThunderboltOrThunderToPlayerPikachu + cp TM_25 ; are we teaching thunder then? + jr nz, .notTeachingThunderboltOrThunderToPikachu .teachingThunderboltOrThunderToPlayerPikachu ld a, $5 ld [wd49c], a @@ -2521,7 +2559,7 @@ ItemUseTMHM: ; e374 (3:6374) pop af ld [wWhichPokemon], a - ld a,[wcf91] + ld a, [wcf91] call IsItemHM ret c jp RemoveUsedItem @@ -2543,28 +2581,28 @@ MonCannotLearnMachineMoveText: ; e492 (3:6492) db "@" PrintItemUseTextAndRemoveItem: ; e497 (3:6497) - ld hl,ItemUseText00 + ld hl, ItemUseText00 call PrintText - ld a,SFX_HEAL_AILMENT + ld a, SFX_HEAL_AILMENT call PlaySound call WaitForTextScrollButtonPress ; wait for button press RemoveUsedItem: ; e4a5 (3:64a5) - ld hl,wNumBagItems - ld a,1 ; one item - ld [wItemQuantity],a + ld hl, wNumBagItems + ld a, 1 ; one item + ld [wItemQuantity], a jp RemoveItemFromInventory ItemUseNoEffect: ; e4b0 (3:64b0) - ld hl,ItemUseNoEffectText + ld hl, ItemUseNoEffectText jr ItemUseFailed ItemUseNotTime: ; e4b5 (3:64b5) - ld hl,ItemUseNotTimeText + ld hl, ItemUseNotTimeText jr ItemUseFailed ItemUseNotYoursToUse: ; e4ba (3:64ba) - ld hl,ItemUseNotYoursToUseText + ld hl, ItemUseNotYoursToUseText jr ItemUseFailed Func_e4bf: ; e4bf (3:64bf) @@ -2577,29 +2615,29 @@ ThrowBallAtTrainerMon: ; e4ca (3:64ca) call RunDefaultPaletteCommand call LoadScreenTilesFromBuffer1 ; restore saved screen call Delay3 - ld a,TOSS_ANIM - ld [wAnimationID],a + ld a, TOSS_ANIM + ld [wAnimationID], a predef MoveAnimation ; do animation - ld hl,ThrowBallAtTrainerMonText1 + ld hl, ThrowBallAtTrainerMonText1 call PrintText - ld hl,ThrowBallAtTrainerMonText2 + ld hl, ThrowBallAtTrainerMonText2 call PrintText jr RemoveUsedItem NoCyclingAllowedHere: ; e4eb (3:64eb) - ld hl,NoCyclingAllowedHereText + ld hl, NoCyclingAllowedHereText jr ItemUseFailed BoxFullCannotThrowBall: ; e4f0 (3:64f0) - ld hl,BoxFullCannotThrowBallText + ld hl, BoxFullCannotThrowBallText jr ItemUseFailed SurfingAttemptFailed: ; e4f5 (3:64f5) - ld hl,NoSurfingHereText + ld hl, NoSurfingHereText ItemUseFailed: ; e4f8 (3:64f8) xor a - ld [wActionResultOrTookBattleTurn],a ; item use failed + ld [wActionResultOrTookBattleTurn], a ; item use failed jp PrintText ItemUseNotTimeText: ; e4ff (3:64ff) @@ -2662,37 +2700,37 @@ GotOffBicycleText: ; e540 (3:6540) ; [wWhichPokemon] = index of pokemon in party ; [wCurrentMenuItem] = index of move (when using a PP Up) RestoreBonusPP: ; e54a (3:654a) - ld hl,wPartyMon1Moves + ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 - ld a,[wWhichPokemon] + ld a, [wWhichPokemon] call AddNTimes push hl - ld de,wNormalMaxPPList - 1 + ld de, wNormalMaxPPList - 1 predef LoadMovePPs ; loads the normal max PP of each of the pokemon's moves to wNormalMaxPPList pop hl ld c, wPartyMon1PP - wPartyMon1Moves - ld b,0 - add hl,bc ; hl now points to move 1 PP - ld de,wNormalMaxPPList - ld b,0 ; initialize move counter to zero + ld b, 0 + add hl, bc ; hl now points to move 1 PP + ld de, wNormalMaxPPList + ld b, 0 ; initialize move counter to zero ; loop through the pokemon's moves .loop inc b - ld a,b - cp a,5 ; reached the end of the pokemon's moves? + ld a, b + cp 5 ; reached the end of the pokemon's moves? ret z ; if so, return - ld a,[wUsingPPUp] + ld a, [wUsingPPUp] dec a ; using a PP Up? - jr nz,.skipMenuItemIDCheck + jr nz, .skipMenuItemIDCheck ; if using a PP Up, check if this is the move it's being used on - ld a,[wCurrentMenuItem] + ld a, [wCurrentMenuItem] inc a cp b - jr nz,.nextMove + jr nz, .nextMove .skipMenuItemIDCheck - ld a,[hl] - and a,%11000000 ; have any PP Ups been used? - call nz,AddBonusPP ; if so, add bonus PP + ld a, [hl] + and %11000000 ; have any PP Ups been used? + call nz, AddBonusPP ; if so, add bonus PP .nextMove inc hl inc de @@ -2705,38 +2743,38 @@ RestoreBonusPP: ; e54a (3:654a) ; [hl] = move PP AddBonusPP: ; e586 (3:6586) push bc - ld a,[de] ; normal max PP of move - ld [H_DIVIDEND + 3],a + ld a, [de] ; normal max PP of move + ld [H_DIVIDEND + 3], a xor a - ld [H_DIVIDEND],a - ld [H_DIVIDEND + 1],a - ld [H_DIVIDEND + 2],a - ld a,5 - ld [H_DIVISOR],a - ld b,4 + ld [H_DIVIDEND], a + ld [H_DIVIDEND + 1], a + ld [H_DIVIDEND + 2], a + ld a, 5 + ld [H_DIVISOR], a + ld b, 4 call Divide - ld a,[hl] ; move PP - ld b,a + ld a, [hl] ; move PP + ld b, a swap a - and a,%1111 + and %1111 srl a srl a - ld c,a ; c = number of PP Ups used + ld c, a ; c = number of PP Ups used .loop - ld a,[H_QUOTIENT + 3] - cp a,8 ; is the amount greater than or equal to 8? - jr c,.addAmount - ld a,7 ; cap the amount at 7 + ld a, [H_QUOTIENT + 3] + cp 8 ; is the amount greater than or equal to 8? + jr c, .addAmount + ld a, 7 ; cap the amount at 7 .addAmount add b - ld b,a - ld a,[wUsingPPUp] + ld b, a + ld a, [wUsingPPUp] dec a ; is the player using a PP Up right now? - jr z,.done ; if so, only add the bonus once + jr z, .done ; if so, only add the bonus once dec c - jr nz,.loop + jr nz, .loop .done - ld [hl],b + ld [hl], b pop bc ret @@ -2753,74 +2791,75 @@ AddBonusPP: ; e586 (3:6586) ; OUTPUT: ; [wMaxPP] = max PP GetMaxPP: ; e5bb (3:65bb) - ld a,[wMonDataLocation] + ld a, [wMonDataLocation] and a - ld hl,wPartyMon1Moves - ld bc,wPartyMon2 - wPartyMon1 - jr z,.sourceWithMultipleMon - ld hl,wEnemyMon1Moves + ld hl, wPartyMon1Moves + ld bc, wPartyMon2 - wPartyMon1 + jr z, .sourceWithMultipleMon + ld hl, wEnemyMon1Moves dec a - jr z,.sourceWithMultipleMon - ld hl,wBoxMon1Moves - ld bc,wBoxMon2 - wBoxMon1 + jr z, .sourceWithMultipleMon + ld hl, wBoxMon1Moves + ld bc, wBoxMon2 - wBoxMon1 dec a - jr z,.sourceWithMultipleMon - ld hl,wDayCareMonMoves + jr z, .sourceWithMultipleMon + ld hl, wDayCareMonMoves dec a - jr z,.sourceWithOneMon - ld hl,wBattleMonMoves ; player's in-battle pokemon + jr z, .sourceWithOneMon + ld hl, wBattleMonMoves ; player's in-battle pokemon .sourceWithOneMon call GetSelectedMoveOffset2 jr .next + .sourceWithMultipleMon call GetSelectedMoveOffset .next - ld a,[hl] + ld a, [hl] dec a push hl - ld hl,Moves - ld bc,MoveEnd - Moves + ld hl, Moves + ld bc, MoveEnd - Moves call AddNTimes - ld de,wcd6d - ld a,BANK(Moves) + ld de, wcd6d + ld a, BANK(Moves) call FarCopyData - ld de,wcd6d + 5 ; PP is byte 5 of move data - ld a,[de] - ld b,a ; b = normal max PP + ld de, wcd6d + 5 ; PP is byte 5 of move data + ld a, [de] + ld b, a ; b = normal max PP pop hl push bc - ld bc,wPartyMon1PP - wPartyMon1Moves ; PP offset if not player's in-battle pokemon data - ld a,[wMonDataLocation] - cp a,4 ; player's in-battle pokemon? - jr nz,.addPPOffset - ld bc,wBattleMonPP - wBattleMonMoves ; PP offset if player's in-battle pokemon data + ld bc, wPartyMon1PP - wPartyMon1Moves ; PP offset if not player's in-battle pokemon data + ld a, [wMonDataLocation] + cp 4 ; player's in-battle pokemon? + jr nz, .addPPOffset + ld bc, wBattleMonPP - wBattleMonMoves ; PP offset if player's in-battle pokemon data .addPPOffset - add hl,bc - ld a,[hl] ; a = current PP - and a,%11000000 ; get PP Up count + add hl, bc + ld a, [hl] ; a = current PP + and %11000000 ; get PP Up count pop bc or b ; place normal max PP in 6 lower bits of a - ld h,d - ld l,e + ld h, d + ld l, e inc hl ; hl = wcd73 - ld [hl],a + ld [hl], a xor a ; add the bonus for the existing PP Up count - ld [wUsingPPUp],a + ld [wUsingPPUp], a call AddBonusPP ; add bonus PP from PP Ups - ld a,[hl] - and a,%00111111 ; mask out the PP Up count - ld [wMaxPP],a ; store max PP + ld a, [hl] + and %00111111 ; mask out the PP Up count + ld [wMaxPP], a ; store max PP ret GetSelectedMoveOffset: ; e627 (3:6627) - ld a,[wWhichPokemon] + ld a, [wWhichPokemon] call AddNTimes GetSelectedMoveOffset2: ; e62d (3:662d) - ld a,[wCurrentMenuItem] - ld c,a - ld b,0 - add hl,bc + ld a, [wCurrentMenuItem] + ld c, a + ld b, 0 + add hl, bc ret ; confirms the item toss and then tosses the item @@ -2833,49 +2872,50 @@ GetSelectedMoveOffset2: ; e62d (3:662d) ; clears carry flag if the item is tossed, sets carry flag if not TossItem_: ; e635 (3:6635) push hl - ld a,[wcf91] + ld a, [wcf91] call IsItemHM pop hl - jr c,.tooImportantToToss + jr c, .tooImportantToToss push hl call IsKeyItem_ - ld a,[wIsKeyItem] + ld a, [wIsKeyItem] pop hl and a - jr nz,.tooImportantToToss + jr nz, .tooImportantToToss push hl - ld a,[wcf91] - ld [wd11e],a + ld a, [wcf91] + ld [wd11e], a call GetItemName call CopyStringToCF4B ; copy name to wcf4b - ld hl,IsItOKToTossItemText + ld hl, IsItOKToTossItemText call PrintText coord hl, 14, 7 lb bc, 8, 15 - ld a,TWO_OPTION_MENU - ld [wTextBoxID],a + ld a, TWO_OPTION_MENU + ld [wTextBoxID], a call DisplayTextBoxID ; yes/no menu - ld a,[wMenuExitMethod] - cp a,CHOSE_SECOND_ITEM + ld a, [wMenuExitMethod] + cp CHOSE_SECOND_ITEM pop hl scf ret z ; return if the player chose No ; if the player chose Yes push hl - ld a,[wWhichPokemon] + ld a, [wWhichPokemon] call RemoveItemFromInventory - ld a,[wcf91] - ld [wd11e],a + ld a, [wcf91] + ld [wd11e], a call GetItemName call CopyStringToCF4B ; copy name to wcf4b - ld hl,ThrewAwayItemText + ld hl, ThrewAwayItemText call PrintText pop hl and a ret + .tooImportantToToss push hl - ld hl,TooImportantToTossText + ld hl, TooImportantToTossText call PrintText pop hl scf @@ -2901,32 +2941,32 @@ TooImportantToTossText: ; e6a3 (3:66a3) ; 00: item is not key item ; 01: item is key item IsKeyItem_: ; e6a8 (3:66a8) - ld a,$01 - ld [wIsKeyItem],a - ld a,[wcf91] - cp a,HM_01 ; is the item an HM or TM? - jr nc,.checkIfItemIsHM + ld a, $01 + ld [wIsKeyItem], a + ld a, [wcf91] + cp HM_01 ; is the item an HM or TM? + jr nc, .checkIfItemIsHM ; if the item is not an HM or TM push af - ld hl,KeyItemBitfield - ld de,wBuffer - ld bc,15 ; only 11 bytes are actually used + ld hl, KeyItemBitfield + ld de, wBuffer + ld bc, 15 ; only 11 bytes are actually used call CopyData pop af dec a - ld c,a - ld hl,wBuffer - ld b,FLAG_TEST + ld c, a + ld hl, wBuffer + ld b, FLAG_TEST predef FlagActionPredef - ld a,c + ld a, c and a ret nz .checkIfItemIsHM - ld a,[wcf91] + ld a, [wcf91] call IsItemHM ret c xor a - ld [wIsKeyItem],a + ld [wIsKeyItem], a ret INCLUDE "data/key_items.asm" @@ -3109,10 +3149,10 @@ SendNewMonToBox: ; e6e8 (3:66e8) IsNextTileShoreOrWater: ; e808 (3:6808) ld a, [wCurMapTileset] ld hl, WaterTilesets - ld de,1 + ld de, 1 call IsInArray ; does the current map allow surfing? ret nc ; if not, return - ld hl,WaterTile + ld hl, WaterTile ld a, [wCurMapTileset] cp SHIP_PORT ; Vermilion Dock tileset jr z, .skipShoreTiles ; if it's the Vermilion Dock tileset @@ -3120,10 +3160,10 @@ IsNextTileShoreOrWater: ; e808 (3:6808) jr z, .skipShoreTiles cp DOJO ; usual eastern shore tile jr z, .skipShoreTiles - ld hl,ShoreTiles + ld hl, ShoreTiles .skipShoreTiles - ld a,[wTileInFrontOfPlayer] - ld de,$1 + ld a, [wTileInFrontOfPlayer] + ld de, $1 call IsInArray ret @@ -3171,6 +3211,7 @@ FindWildLocationsOfMon: ; e848 (3:6848) inc hl inc c jr .loop + .done ld a, $ff ; list terminator ld [de], a diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index 43d4d6ef..e104f693 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -204,7 +204,7 @@ ExitBillsPC: ; 2153e (8:553e) ret BillsPCPrintBox: ; 21562 (8:5562) - callab Func_e8d35 + callab PrintPCBox jp BillsPCMenu BillsPCDeposit: ; 2156d (8:556d) @@ -553,7 +553,7 @@ CableClubLeftGameboy:: ; 21867 (8:5867) ld a, [hSerialConnectionStatus] cp USING_EXTERNAL_CLOCK ret z - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction cp SPRITE_FACING_RIGHT ret nz ld a, [wCurMap] @@ -570,7 +570,7 @@ CableClubRightGameboy:: ; 21887 (8:5887) ld a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK ret z - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction cp SPRITE_FACING_LEFT ret nz ld a, [wCurMap] @@ -587,7 +587,7 @@ JustAMomentText:: ; 218a7 (8:58a7) TX_FAR _JustAMomentText db "@" - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm index f7c92326..669b2ba8 100755 --- a/engine/menu/main_menu.asm +++ b/engine/menu/main_menu.asm @@ -128,7 +128,7 @@ InitOptions: ; 5bff (1:5bff) ld a,3 ; medium speed ld [wOptions],a ld a,64 ; audio? - ld [wd498], a + ld [wPrinterSettings], a ret Func_5cc1: ; 5cc1 (1:5cc1) diff --git a/engine/menu/options.asm b/engine/menu/options.asm index ff629839..86a55bd2 100644 --- a/engine/menu/options.asm +++ b/engine/menu/options.asm @@ -272,7 +272,7 @@ OptionsMenu_GBPrinterBrightness: ; 41e0c (10:5e0c) ld a, d .asm_41e2e ld b, a - ld [wd498], a + ld [wPrinterSettings], a .asm_41e32 ld b, $0 ld hl, GBPrinterOptionStringsPointerTable @@ -305,7 +305,7 @@ DarkestPrintText: ; 41e72 (10:5e72) db "DARKEST @" Func_41e7b: ; 41e7b (10:5e7b) - ld a, [wd498] + ld a, [wPrinterSettings] and a jr z, .asm_41e93 cp $20 diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index 68339dff..7715500b 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -13,7 +13,7 @@ ShowPokedexMenu: ; 40000 (10:4000) ld [hJoy7], a .setUpGraphics callab LoadPokedexTilePatterns -.asm_40025 +.loop ld b, SET_PAL_GENERIC call RunPaletteCommand .doPokemonListMenu @@ -44,6 +44,7 @@ ShowPokedexMenu: ; 40000 (10:4000) call GBPalWhiteOutWithDelay3 call RunDefaultPaletteCommand jp ReloadMapData + .goToSideMenu call HandlePokedexSideMenu dec b @@ -51,7 +52,7 @@ ShowPokedexMenu: ; 40000 (10:4000) dec b jr z, .doPokemonListMenu ; if pokemon not seen or player pressed B button dec b - jr z, .asm_40025 + jr z, .loop jp .setUpGraphics ; if pokemon data or area was shown ; handles the menu on the lower right in the pokedex screen @@ -133,6 +134,7 @@ HandlePokedexSideMenu: ; 40070 (10:4070) call DrawTileLine ; cover up the menu cursor in the pokemon list pop bc ret + .buttonBPressed push bc coord hl, 15, 8 @@ -141,20 +143,24 @@ HandlePokedexSideMenu: ; 40070 (10:4070) call DrawTileLine ; cover up the menu cursor in the side menu pop bc jr .exitSideMenu + .choseData call ShowPokedexDataInternal ld b, 0 jr .exitSideMenu + ; play pokemon cry .choseCry ld a, [wd11e] call GetCryData call PlaySound jr .handleMenuInput + .choseArea predef LoadTownMap_Nest ; display pokemon areas ld b, 0 jr .exitSideMenu + .chosePrint ld a, [hTilesetType] push af @@ -162,7 +168,7 @@ HandlePokedexSideMenu: ; 40070 (10:4070) ld [hTilesetType], a ld a, [wd11e] ld [wcf91], a - callab Func_e8b74 + callab PrintPokedexEntry xor a ld [H_AUTOBGTRANSFERENABLED], a call ClearScreen @@ -174,17 +180,17 @@ HandlePokedexSideMenu: ; 40070 (10:4070) ; handles the list of pokemon on the left of the pokedex screen ; sets carry flag if player presses A, unsets carry flag if player presses B HandlePokedexListMenu: ; 40140 (10:4140) - call Func_401c2 + call Pokedex_DrawInterface .loop - call Func_4027c + call Pokedex_PlacePokemonList call GBPalNormal call HandleMenuInput - bit 1, a ; was the B button pressed? + bit BIT_B_BUTTON, a ; was the B button pressed? jp nz, .buttonBPressed - bit 0, a ; was the A button pressed? + bit BIT_A_BUTTON, a ; was the A button pressed? jp nz, .buttonAPressed .checkIfUpPressed - bit 6, a ; was Up pressed? + bit BIT_D_UP, a ; was Up pressed? jr z, .checkIfDownPressed .upPressed ; scroll up one row ld a, [wListScrollOffset] @@ -193,8 +199,9 @@ HandlePokedexListMenu: ; 40140 (10:4140) dec a ld [wListScrollOffset], a jp .loop + .checkIfDownPressed - bit 7, a ; was Down pressed? + bit BIT_D_DOWN, a ; was Down pressed? jr z, .checkIfRightPressed .downPressed ; scroll down one row ld a, [wDexMaxSeenMon] @@ -208,8 +215,9 @@ HandlePokedexListMenu: ; 40140 (10:4140) inc a ld [wListScrollOffset], a jp .loop + .checkIfRightPressed - bit 4, a ; was Right pressed? + bit BIT_D_RIGHT, a ; was Right pressed? jr z, .checkIfLeftPressed .rightPressed ; scroll down 7 rows ld a, [wDexMaxSeenMon] @@ -226,8 +234,9 @@ HandlePokedexListMenu: ; 40140 (10:4140) ld a, b ld [wListScrollOffset], a jp .loop + .checkIfLeftPressed ; scroll up 7 rows - bit 5, a ; was Left pressed? + bit BIT_D_LEFT, a ; was Left pressed? jr z, .buttonAPressed .leftPressed ld a, [wListScrollOffset] @@ -237,14 +246,16 @@ HandlePokedexListMenu: ; 40140 (10:4140) xor a ld [wListScrollOffset], a jp .loop + .buttonAPressed scf ret + .buttonBPressed and a ret -Func_401c2: ; 401c2 (10:41c2) +Pokedex_DrawInterface: ; 401c2 (10:41c2) xor a ld [H_AUTOBGTRANSFERENABLED], a ; draw the horizontal line separating the seen and owned amounts from the menu @@ -300,6 +311,7 @@ Func_401c2: ; 401c2 (10:41c2) dec c jr nz, .maxSeenPokemonInnerLoop jr .maxSeenPokemonLoop + .storeMaxSeenPokemon ld a, b ld [wDexMaxSeenMon], a @@ -333,7 +345,7 @@ PokedexMenuItemsText: ; 40264 (10:4264) next "PRNT" next "QUIT@" -Func_4027c: ; 4027c (10:427c) +Pokedex_PlacePokemonList: ; 4027c (10:427c) xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 4, 2 @@ -381,6 +393,7 @@ Func_4027c: ; 4027c (10:427c) jr nz, .getPokemonName ; if the player has seen the pokemon ld de, .dashedLine ; print a dashed line in place of the name if the player hasn't seen the pokemon jr .skipGettingName + .dashedLine ; for unseen pokemon in the list db "----------@" .getPokemonName @@ -442,8 +455,8 @@ ShowPokedexDataInternal: ; 40323 (10:4323) call RunPaletteCommand pop af ld [wd11e], a - call Func_4039c - call c, Func_404ae + call DrawDexEntryOnScreen + call c, Pokedex_PrintFlavorTextAtRow11 .waitForButtonPress call JoypadLowSensitivity ld a, [hJoy5] @@ -478,22 +491,27 @@ PokedexDataDividerLine: ; 40387 (10:4387) db $6B, $69, $6B, $69, $6A db "@" -Func_4039c: ; 4039c (10:439c) +DrawDexEntryOnScreen: ; 4039c (10:439c) call ClearScreen + coord hl, 0, 0 ld de, 1 lb bc, $64, SCREEN_WIDTH call DrawTileLine ; draw top border + coord hl, 0, 17 ld b, $6f call DrawTileLine ; draw bottom border + coord hl, 0, 1 ld de, 20 lb bc, $66, $10 call DrawTileLine ; draw left border + coord hl, 19, 1 ld b, $67 call DrawTileLine ; draw right border + ld a, $63 ; upper left corner tile Coorda 0, 0 ld a, $65 ; upper right corner tile @@ -501,16 +519,21 @@ Func_4039c: ; 4039c (10:439c) ld a, $6c ; lower left corner tile Coorda 0, 17 ld a, $6e ; lower right corner tile + Coorda 19, 17 coord hl, 0, 9 + ld de, PokedexDataDividerLine call PlaceString ; draw horizontal divider line + coord hl, 9, 6 ld de, HeightWeightText call PlaceString + call GetMonName coord hl, 9, 2 call PlaceString + ld hl, PokedexEntryPointers ld a, [wd11e] dec a @@ -521,14 +544,17 @@ Func_4039c: ; 4039c (10:439c) ld a, [hli] ld e, a ld d, [hl] ; de = address of pokedex entry + coord hl, 9, 4 call PlaceString ; print species name + ld h, b ld l, c push de ld a, [wd11e] push af call IndexToPokedex + coord hl, 2, 8 ld a, "№" ld [hli], a @@ -537,6 +563,7 @@ Func_4039c: ; 4039c (10:439c) ld de, wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber ; print pokedex number + ld hl, wPokedexOwned call IsPokemonBitSet pop af @@ -544,10 +571,12 @@ Func_4039c: ; 4039c (10:439c) ld a, [wcf91] ld [wd0b5], a pop de + push af push bc push de push hl + call Delay3 call GBPalNormal call GetMonHeader ; load pokemon picture location @@ -555,13 +584,16 @@ Func_4039c: ; 4039c (10:439c) call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture ld a, [wcf91] call PlayCry ; play pokemon cry + pop hl pop de pop bc pop af + ld a, c and a ret z ; if the pokemon has not been owned, don't print the height, weight, or description + inc de ; de = address of feet (height) ld a, [de] ; reads feet, but a is overwritten without being used coord hl, 12, 6 @@ -617,9 +649,9 @@ Func_4039c: ; 4039c (10:439c) scf ret -Func_404ae: ; 404ae (10:44ae) +Pokedex_PrintFlavorTextAtRow11: ; 404ae (10:44ae) coord bc, 1, 11 -Func_404b1: ; 404b1 (10:44b1) +Pokedex_PrintFlavorTextAtBC: ; 404b1 (10:44b1) ld a, 2 ld [$fff9], a call TextCommandProcessor ; print pokedex description text @@ -627,7 +659,7 @@ Func_404b1: ; 404b1 (10:44b1) ld [$fff9], a ret -Func_404bc: ; 404bc (10:44bc) +Pokedex_PrepareDexEntryForPrinting: ; 404bc (10:44bc) coord hl, 0, 0 ld de, SCREEN_WIDTH lb bc, $66, $d @@ -643,15 +675,15 @@ Func_404bc: ; 404bc (10:44bc) Coorda 0, 13 ld a, $6e Coorda 19, 13 - ld a, [wOverworldMap+$40d] + ld a, [wPrinterPokedexEntryTextPointer] ld l, a - ld a, [wOverworldMap+$40e] + ld a, [wPrinterPokedexEntryTextPointer + 1] ld h, a coord bc, 1, 1 ld a, [hFlags_0xFFFA] set 3, a ld [hFlags_0xFFFA], a - call Func_404b1 + call Pokedex_PrintFlavorTextAtBC ld a, [hFlags_0xFFFA] res 3, a ld [hFlags_0xFFFA], a @@ -714,4 +746,4 @@ IndexToPokedex: ; 4109d (10:509d) pop bc ret -INCLUDE "data/pokedex_order.asm"
\ No newline at end of file +INCLUDE "data/pokedex_order.asm" diff --git a/engine/menu/start_menu.asm b/engine/menu/start_menu.asm index 8a9ad229..3eeb1c07 100755 --- a/engine/menu/start_menu.asm +++ b/engine/menu/start_menu.asm @@ -1,7 +1,7 @@ DisplayStartMenu:: ; 29d1 (0:29d1) switchbank StartMenu_Pokedex ; also bank for other functions - ld a,[wWalkBikeSurfState] ; walking/biking/surfing - ld [wWalkBikeSurfStateCopy],a + ld a, [wWalkBikeSurfState] ; walking/biking/surfing + ld [wWalkBikeSurfStateCopy], a ld a, $8f ; (SFX_02_3f - SFX_Headers_02) / 3 ; Start menu sound call PlaySound @@ -12,76 +12,73 @@ RedisplayStartMenu_DoNotDrawStartMenu: ; 29e9 (0:29e9) call UpdateSprites .loop call HandleMenuInput - ld b,a + ld b, a .checkIfUpPressed - bit 6,a ; was Up pressed? - jr z,.checkIfDownPressed - ld a,[wCurrentMenuItem] ; menu selection + bit 6, a ; was Up pressed? + jr z, .checkIfDownPressed + ld a, [wCurrentMenuItem] ; menu selection and a - jr nz,.loop - ld a,[wLastMenuItem] + jr nz, .loop + ld a, [wLastMenuItem] and a - jr nz,.loop + jr nz, .loop ; if the player pressed tried to go past the top item, wrap around to the bottom - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? - ld a,6 ; there are 7 menu items with the pokedex, so the max index is 6 - jr nz,.wrapMenuItemId + CheckEvent EVENT_GOT_POKEDEX ; does the player have the pokedex? + ld a, 6 ; there are 7 menu items with the pokedex, so the max index is 6 + jr nz, .wrapMenuItemId dec a ; there are only 6 menu items without the pokedex .wrapMenuItemId - ld [wCurrentMenuItem],a + ld [wCurrentMenuItem], a call EraseMenuCursor jr .loop .checkIfDownPressed - bit 7,a - jr z,.buttonPressed + bit 7, a + jr z, .buttonPressed ; if the player pressed tried to go past the bottom item, wrap around to the top - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? - ld a,[wCurrentMenuItem] - ld c,7 ; there are 7 menu items with the pokedex - jr nz,.checkIfPastBottom + CheckEvent EVENT_GOT_POKEDEX ; does the player have the pokedex? + ld a, [wCurrentMenuItem] + ld c, 7 ; there are 7 menu items with the pokedex + jr nz, .checkIfPastBottom dec c ; there are only 6 menu items without the pokedex .checkIfPastBottom cp c - jr nz,.loop + jr nz, .loop ; the player went past the bottom, so wrap to the top xor a - ld [wCurrentMenuItem],a + ld [wCurrentMenuItem], a call EraseMenuCursor jr .loop .buttonPressed ; A, B, or Start button pressed call PlaceUnfilledArrowMenuCursor - ld a,[wCurrentMenuItem] - ld [wBattleAndStartSavedMenuItem],a ; save current menu selection - ld a,b - and a,%00001010 ; was the Start button or B button pressed? - jp nz,CloseStartMenu + ld a, [wCurrentMenuItem] + ld [wBattleAndStartSavedMenuItem], a ; save current menu selection + ld a, b + and a, %00001010 ; was the Start button or B button pressed? + jp nz, CloseStartMenu call SaveScreenTilesToBuffer2 ; copy background from wTileMap to wTileMapBackup2 - ld a,[wd74b] - bit 5,a ; does the player have the pokedex? - ld a,[wCurrentMenuItem] - jr nz,.displayMenuItem + CheckEvent EVENT_GOT_POKEDEX ; does the player have the pokedex? + ld a, [wCurrentMenuItem] + jr nz, .displayMenuItem inc a ; adjust position to account for missing pokedex menu item .displayMenuItem - cp a,0 - jp z,StartMenu_Pokedex - cp a,1 - jp z,StartMenu_Pokemon - cp a,2 - jp z,StartMenu_Item - cp a,3 - jp z,StartMenu_TrainerInfo - cp a,4 - jp z,StartMenu_SaveReset - cp a,5 - jp z,StartMenu_Option + cp a, 0 + jp z, StartMenu_Pokedex + cp a, 1 + jp z, StartMenu_Pokemon + cp a, 2 + jp z, StartMenu_Item + cp a, 3 + jp z, StartMenu_TrainerInfo + cp a, 4 + jp z, StartMenu_SaveReset + cp a, 5 + jp z, StartMenu_Option ; EXIT falls through to here CloseStartMenu:: ; 2a72 (0:2a72) call Joypad - ld a,[hJoyPressed] - bit 0,a ; was A button newly pressed? - jr nz,CloseStartMenu + ld a, [hJoyPressed] + bit 0, a ; was A button newly pressed? + jr nz, CloseStartMenu call LoadTextBoxTilePatterns jp CloseTextDisplay diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm index f07c7bb2..2726c651 100755 --- a/engine/oak_speech.asm +++ b/engine/oak_speech.asm @@ -5,7 +5,7 @@ SetDefaultNames: ; 5e27 (1:5e27) push af ld a, [wd732] push af - ld a, [wd498] + ld a, [wPrinterSettings] push af ld hl, wPlayerName ld bc, wBoxDataEnd - wPlayerName @@ -16,11 +16,11 @@ SetDefaultNames: ; 5e27 (1:5e27) xor a call FillMemory xor a - ld [wd495], a - ld [wd496], a - ld [wd497], a + ld [wSurfingMinigameHiScore], a + ld [wSurfingMinigameHiScore + 1], a + ld [wSurfingMinigameHiScore + 2], a pop af - ld [wd498], a + ld [wPrinterSettings], a pop af ld [wd732], a pop af diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm index d2e710ae..3560c8e8 100755 --- a/engine/overworld/card_key.asm +++ b/engine/overworld/card_key.asm @@ -89,7 +89,7 @@ GetCoordsInFrontOfPlayer: ; 5265f (14:665f) ld d, a ld a, [wXCoord] ld e, a - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction and a jr nz, .notFacingDown ; facing down diff --git a/engine/overworld/check_player_state.asm b/engine/overworld/check_player_state.asm index a89b3d48..5dd91c4c 100644 --- a/engine/overworld/check_player_state.asm +++ b/engine/overworld/check_player_state.asm @@ -90,7 +90,7 @@ IsPlayerFacingEdgeOfMap: ; c148 (3:4148) push hl push de push bc - ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction + ld a, [wPlayerFacingDirection] ; player sprite's facing direction srl a ld c, a ld b, $0 @@ -160,7 +160,7 @@ IsWarpTileInFrontOfPlayer: ; c197 (3:4197) ld a, [wCurMap] cp SS_ANNE_5 jr z, .ssAnne5 - ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction + ld a, [wPlayerFacingDirection] ; player sprite's facing direction srl a ld c, a ld b, 0 diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 3978cb9c..488bc4de 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -188,7 +188,7 @@ ReplaceTreeTileBlock: ; ef1f (3:6f1f) ld h, [hl] ld l, a add hl, bc - ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction + ld a, [wPlayerFacingDirection] ; player sprite's facing direction and a jr z, .down cp SPRITE_FACING_UP diff --git a/engine/overworld/get_coords_tile_in_front_of_player.asm b/engine/overworld/get_coords_tile_in_front_of_player.asm index 494708de..1003570b 100644 --- a/engine/overworld/get_coords_tile_in_front_of_player.asm +++ b/engine/overworld/get_coords_tile_in_front_of_player.asm @@ -6,7 +6,7 @@ _GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d4) ld d, a ld a, [wXCoord] ld e, a - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction and a ; cp SPRITE_FACING_DOWN jr nz, .notFacingDown ; facing down @@ -45,7 +45,7 @@ GetTileTwoStepsInFrontOfPlayer: ; c309 (3:4309) ld a, [hli] ld d, a ld e, [hl] - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction and a ; cp SPRITE_FACING_DOWN jr nz, .notFacingDown ; facing down diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm index cba2a221..6e515b5a 100755 --- a/engine/overworld/hidden_objects.asm +++ b/engine/overworld/hidden_objects.asm @@ -61,7 +61,7 @@ CheckForHiddenObject: ; f25f8 (3c:65f8) ; checks if the coordinates in front of the player's sprite match Y in b and X in c ; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match CheckIfCoordsInFrontOfPlayerMatch: ; 46a01 (11:6a01) - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction cp SPRITE_FACING_UP jr z, .facingUp cp SPRITE_FACING_LEFT diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index a6ebd9be..5d95cb18 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -6,7 +6,7 @@ HandleLedges: ; 1a7f4 (6:67f4) and a ; OVERWORLD ret nz predef GetTileAndCoordsInFrontOfPlayer - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] ld b, a aCoord 8, 9 ld c, a diff --git a/engine/overworld/map_sprite_functions1.asm b/engine/overworld/map_sprite_functions1.asm index a8412a4e..722fc14e 100644 --- a/engine/overworld/map_sprite_functions1.asm +++ b/engine/overworld/map_sprite_functions1.asm @@ -28,7 +28,7 @@ _UpdateSprites: ; 4bb7 (1:4bb7) and a jp z, UpdatePlayerSprite cp $f0 ; pikachu - jp z, Func_1552 + jp z, SpawnPikachu ld a, [hl] UpdateNonPlayerSprite: ; 4be3 (1:4be3) diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index 1f13ddd2..10f0362e 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -20,26 +20,26 @@ _InitMapSprites: ; 1401b (5:401b) ; Loads sprite set for outside maps (cities and routes) and sets VRAM slots. ; sets carry if the map is a city or route, unsets carry if not InitOutsideMapSprites: ; 14029 (5:4029) - ld a,[wCurMap] - cp a,REDS_HOUSE_1F ; is the map a city or a route (map ID less than $25)? + ld a, [wCurMap] + cp a, REDS_HOUSE_1F ; is the map a city or a route (map ID less than $25)? ret nc ; if not, return call GetSplitMapSpriteSetID ; if so, choose the appropriate one - ld b,a ; b = spriteSetID - ld a,[wFontLoaded] - bit 0,a ; reloading upper half of tile patterns after displaying text? - jr nz,.loadSpriteSet ; if so, forcibly reload the sprite set - ld a,[wSpriteSetID] + ld b, a ; b = spriteSetID + ld a, [wFontLoaded] + bit 0, a ; reloading upper half of tile patterns after displaying text? + jr nz, .loadSpriteSet ; if so, forcibly reload the sprite set + ld a, [wSpriteSetID] cp b ; has the sprite set ID changed? - jr z,.skipLoadingSpriteSet ; if not, don't load it again + jr z, .skipLoadingSpriteSet ; if not, don't load it again .loadSpriteSet - ld a,b - ld [wSpriteSetID],a + ld a, b + ld [wSpriteSetID], a dec a - ld c,a - ld b,0 + ld c, a + ld b, 0 ld a, (wSpriteSetID - wSpriteSet) - ld hl,SpriteSets + ld hl, SpriteSets call AddNTimes ; get sprite set offset ld de, wSpriteSet ld bc, (wSpriteSetID - wSpriteSet) @@ -64,8 +64,8 @@ LoadSpriteSetFromMapHeader: ; 14061 (5:4061) call FillMemory ld a, SPRITE_PIKACHU ; load Pikachu separately ld [wSpriteSet], a - ld hl,wSpriteStateData1 + $10 - ld a,$0e + ld hl, wSprite01SpriteStateData1 + ld a, 14 .storeVRAMSlotsLoop push af ld a, [hl] ; $C1X0 (picture ID) (zero if sprite slot is not used) @@ -79,13 +79,14 @@ LoadSpriteSetFromMapHeader: ; 14061 (5:4061) ld b, 2 call CheckIfPictureIDAlreadyLoaded jr .continue + .isFourTileSprite ; loop through the space reserved for regular picture IDs ld de, wSpriteSet ld b, 9 call CheckIfPictureIDAlreadyLoaded .continue - ld de, $10 + ld de, wSprite02SpriteStateData1 - wSprite01SpriteStateData1 add hl, de pop af dec a @@ -96,6 +97,7 @@ CheckIfPictureIDAlreadyLoaded: ; 1409b (5:409b) ; Check if the current picture ID has already had its tile patterns loaded. ; This done by looping through the previous sprite slots and seeing if any of ; their picture ID's match that of the current sprite slot. +.loop ld a, [de] and a ; is sprite set slot not taken up yet? jr z, .spriteSlotNotTaken ; if so, load it as it signifies we've reached @@ -106,7 +108,8 @@ CheckIfPictureIDAlreadyLoaded: ; 1409b (5:409b) dec b ; have we reached the end of the sprite set? jr z, .spriteNotAlreadyLoaded ; if so, we're done here inc de - jr CheckIfPictureIDAlreadyLoaded + jr .loop + .spriteSlotNotTaken ld a, c ld [de], a @@ -127,6 +130,7 @@ CheckForFourTileSprite: ; 140ac (5:40ac) ; regular sprite and a ret + .notYellowSprite scf ret @@ -140,6 +144,7 @@ LoadMapSpriteTilePatterns: ; 140b7 (5:40b7) call LoadStillTilePattern call LoadWalkingTilePattern jr .continue + .fourTileSprite call LoadStillTilePattern .continue @@ -202,7 +207,7 @@ GetSpriteVRAMAddress: ; 14018 (5:4108) SpriteVRAMAddresses: ; 14118 (5:4118) ; Equivalent to multiplying $C0 (number of bytes in 12 tiles) times the VRAM ; slot and adding the result to $8000 (the VRAM base address). - dw vChars0 + $c0 + dw vChars0 + $0c0 dw vChars0 + $180 dw vChars0 + $240 dw vChars0 + $300 @@ -211,8 +216,8 @@ SpriteVRAMAddresses: ; 14118 (5:4118) dw vChars0 + $540 dw vChars0 + $600 dw vChars0 + $6c0 - dw vChars0 + $780 - dw vChars0 + $7c0 + dw vChars0 + $780 ; 4-tile sprites + dw vChars0 + $7c0 ; 4-tile sprites ReadSpriteSheetData: ; 1412e (5:412e) ld a, [hVRAMSlot] @@ -246,12 +251,11 @@ ReadSpriteSheetData: ; 1412e (5:412e) Func_14150: ; 14150 (5:4150) ld a, $1 - ld [wSpriteStateData2 + $e], a ; vram slot for player + ld [wPlayerSpriteImageBaseOffset], a ; vram slot for player ld a, $2 - ld [wSpriteStateData2 + $fe], a ; vram slot for Pikachu - + ld [wPikachuSpriteImageBaseOffset], a ; vram slot for Pikachu ld a, $e - ld hl, wSpriteStateData1 + $10 + ld hl, wSprite01SpriteStateData1 .loop ld [hVRAMSlot], a ; store current sprite set slot as a counter ld a, [hl] ; $c1x0 (picture ID) @@ -259,12 +263,12 @@ Func_14150: ; 14150 (5:4150) jr z, .spriteUnused call Func_14179 push hl - ld de, (wSpriteStateData2 + $e) - (wSpriteStateData1) ; $10e + ld de, (wPlayerSpriteImageBaseOffset) - (wSpriteStateData1) ; $10e add hl, de ; get $c2xe (sprite image base offset) ld [hl], a ; write offset pop hl .spriteUnused - ld de, $10 + ld de, wSprite02SpriteStateData1 - wSprite01SpriteStateData1 add hl, de ld a, [hVRAMSlot] dec a @@ -297,67 +301,68 @@ Func_14179: ; 14179 (5:4179) GetSplitMapSpriteSetID: ; 14193 (5:4193) ld e, a ld d, 0 - ld hl,MapSpriteSets + ld hl, MapSpriteSets add hl, de - ld a,[hl] ; a = spriteSetID - cp a,$f0 ; does the map have 2 sprite sets? + ld a, [hl] ; a = spriteSetID + cp a, $f0 ; does the map have 2 sprite sets? ret c ; Chooses the correct sprite set ID depending on the player's position within ; the map for maps with two sprite sets. - cp a,$f8 - jr z,.route20 - ld hl,SplitMapSpriteSets - and a,$0f + cp a, $f8 + jr z, .route20 + ld hl, SplitMapSpriteSets + and a, $0f dec a add a add a add l - ld l,a - jr nc,.noCarry + ld l, a + jr nc, .noCarry inc h .noCarry - ld a,[hli] ; determines whether the map is split East/West or North/South - cp a,$01 - ld a,[hli] ; position of dividing line - ld b,a - jr z,.eastWestDivide + ld a, [hli] ; determines whether the map is split East/West or North/South + cp a, $01 + ld a, [hli] ; position of dividing line + ld b, a + jr z, .eastWestDivide .northSouthDivide - ld a,[wYCoord] + ld a, [wYCoord] jr .compareCoord + .eastWestDivide - ld a,[wXCoord] + ld a, [wXCoord] .compareCoord cp b - jr c,.loadSpriteSetID + jr c, .loadSpriteSetID ; if in the East side or South side inc hl .loadSpriteSetID - ld a,[hl] + ld a, [hl] ret ; Uses sprite set $01 for West side and $0A for East side. ; Route 20 is a special case because the two map sections have a more complex ; shape instead of the map simply being split horizontally or vertically. .route20 - ld hl,wXCoord - ld a,[hl] - cp a,$2b - ld a,$01 + ld hl, wXCoord + ld a, [hl] + cp a, $2b + ld a, $01 ret c - ld a,[hl] - cp a,$3e - ld a,$0a + ld a, [hl] + cp a, $3e + ld a, $0a ret nc - ld a,[hl] - cp a,$37 - ld b,$08 - jr nc,.next - ld b,$0d + ld a, [hl] + cp a, $37 + ld b, $08 + jr nc, .next + ld b, $0d .next - ld a,[wYCoord] + ld a, [wYCoord] cp b - ld a,$0a + ld a, $0a ret c - ld a,$01 + ld a, $01 ret -INCLUDE "data/sprite_sets.asm"
\ No newline at end of file +INCLUDE "data/sprite_sets.asm" diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 418d7928..d69e2fbc 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -53,7 +53,7 @@ UpdatePlayerSprite: ; 4da5 (1:4da5) ld a, SPRITE_FACING_RIGHT jr .next .next - ld [wSpriteStateData1 + 9], a ; facing direction + ld [wPlayerFacingDirection], a ; facing direction ld a, [wFontLoaded] bit 0, a jr z, .moving @@ -89,7 +89,7 @@ UpdatePlayerSprite: ; 4da5 (1:4da5) Func_4e32: ; 4e32 (1:4e32) ld a, [wSpriteStateData1 + 8] ld b, a - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] add b ld [wSpriteStateData1 + 2], a ret diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index a78dba35..bea43308 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -35,7 +35,7 @@ EnterMapAnim: ; 70567 (1c:4567) ld hl, wFacingDirectionList call PlayerSpinInPlace ld a, $1 - ld [wd431], a + ld [wPikachuSpawnState], a .restoreDefaultMusic call PlayDefaultMusic .done @@ -46,7 +46,7 @@ EnterMapAnim: ; 70567 (1c:4567) call DelayFrames call PlayerSpinWhileMovingDown ld a, $0 - ld [wd431], a + ld [wPikachuSpawnState], a jr .done .flyAnimation pop hl @@ -63,7 +63,7 @@ EnterMapAnim: ; 70567 (1c:4567) call DoFlyAnimation call LoadPlayerSpriteGraphics ld a, $1 - ld [wd431], a + ld [wPikachuSpawnState], a jr .restoreDefaultMusic FlyAnimationEnterScreenCoords: ; 705ed (1c:45ed) diff --git a/engine/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm index bf47bf60..65dfcd87 100755 --- a/engine/overworld/pokecenter.asm +++ b/engine/overworld/pokecenter.asm @@ -63,7 +63,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) callab IsStarterPikachuInOurParty call c, Func_6eaa ld a, $5 - ld [wd431], a + ld [wPikachuSpawnState], a call Func_1525 .doNotReturnPikachu lb bc, 1, 0 diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm index ece4446d..d0d957be 100755 --- a/engine/overworld/ssanne.asm +++ b/engine/overworld/ssanne.asm @@ -32,7 +32,7 @@ AnimateBoulderDust: ; 7a0fb (1e:60fb) jp LoadPlayerSpriteGraphics GetMoveBoulderDustFunctionPointer: ; 7913f (1e:613f) - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction ld hl, MoveBoulderDustFunctionPointerTable ld c, a ld b, $0 diff --git a/engine/overworld/step_functions.asm b/engine/overworld/step_functions.asm index 5b9c7e2b..bc1a74aa 100644 --- a/engine/overworld/step_functions.asm +++ b/engine/overworld/step_functions.asm @@ -2,7 +2,7 @@ ApplyOutOfBattlePoisonDamage: ; c3de (3:43de) ld a, [wd730] add a jp c, .noBlackOut ; no black out if joypad states are being simulated - ld a, [wPreventBlackout] + ld a, [wd492] bit 7, a jp nz, .noBlackOut ld a, [wd72e] diff --git a/engine/overworld/try_pushing_boulder.asm b/engine/overworld/try_pushing_boulder.asm index 89e83ff9..b7e04092 100644 --- a/engine/overworld/try_pushing_boulder.asm +++ b/engine/overworld/try_pushing_boulder.asm @@ -38,7 +38,7 @@ Func_f0a7: ; f0a7 (3:70a7) jp nz, ResetBoulderPushFlags ld a, [hJoyHeld] ld b, a - ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction + ld a, [wPlayerFacingDirection] ; player's sprite facing direction cp SPRITE_FACING_UP jr z, .pushBoulderUp cp SPRITE_FACING_LEFT diff --git a/engine/palettes.asm b/engine/palettes.asm index f5a3ed49..636e5e97 100755 --- a/engine/palettes.asm +++ b/engine/palettes.asm @@ -164,9 +164,9 @@ SetPal_Overworld: ; 71fa5 (1c:5fa5) cp BRUNOS_ROOM jr z, .caveOrBruno cp TRADE_CENTER - jr z, .asm_71ffd + jr z, .trade_center_colosseum cp COLOSSEUM - jr z, .asm_71ffd + jr z, .trade_center_colosseum .normalDungeonOrBuilding ld a, [wLastMap] ; town or route that current dungeon or building is located .townOrRoute @@ -181,17 +181,21 @@ SetPal_Overworld: ; 71fa5 (1c:5fa5) ld a, SET_PAL_OVERWORLD ld [wDefaultPaletteCommand], a ret + .PokemonTowerOrAgatha ld a, PAL_GREYMON - 1 jr .town + .caveOrBruno ld a, PAL_CAVE - 1 jr .town + .Lorelei xor a jr .town -.asm_71ffd - ld a, $18 + +.trade_center_colosseum + ld a, PAL_GREYMON - 1 jr .town ; used when a Pokemon is the only thing on the screen @@ -313,17 +317,17 @@ DeterminePaletteIDOutOfBattle: ; 72094 (1c:6094) ld a, [hl] ret -Func_720ad:: ; 720ad (1c:60ad) +YellowIntroPaletteAction:: ; 720ad (1c:60ad) ld a, e and a - jr nz, Func_720bd + jr nz, .asm_720bd ld hl, PalPacket_Generic ld a, [hGBC] and a jp z, SendSGBPacket jp InitGBCPalettes -Func_720bd:: ; 720bd (1c:60bd) +.asm_720bd ld hl, UnknownPalPacket_72811 ld a, [hGBC] and a @@ -343,12 +347,12 @@ Func_720bd:: ; 720bd (1c:60bd) call TransferCurBGPData ret -Func_720e3:: ; 720e3 (1c:60e3) +LoadOverworldPikachuFrontpicPalettes:: ; 720e3 (1c:60e3) ld hl, PalPacket_Empty ld de, wPalPacket ld bc, $10 call CopyData - call Func_7213b + call GetPal_Pikachu ld hl, wPartyMenuBlkPacket ld [hl], a ld hl, wPartyMenuBlkPacket + 2 @@ -357,12 +361,13 @@ Func_720e3:: ; 720e3 (1c:60e3) ld hl, wPalPacket ld a, [hGBC] and a - jr nz, .asm_72109 + jr nz, .cgb_1 call SendSGBPacket - jr .asm_7210c -.asm_72109 + jr .okay_1 + +.cgb_1 call InitGBCPalettes -.asm_7210c +.okay_1 ld hl, BlkPacket_WholeScreen ld de, wPalPacket ld bc, $10 @@ -381,15 +386,16 @@ Func_720e3:: ; 720e3 (1c:60e3) ld hl, wPalPacket ld a, [hGBC] and a - jr nz, .asm_72137 + jr nz, .cgb_2 call SendSGBPacket - jr .asm_7213a -.asm_72137 + jr .okay_2 + +.cgb_2 call InitGBCPalettes -.asm_7213a +.okay_2 ret -Func_7213b:: ; 7213b (1c:613b) +GetPal_Pikachu:: ; 7213b (1c:613b) ; similar to SetPal_Overworld ld a, [wCurMapTileset] cp CEMETERY @@ -420,17 +426,21 @@ Func_7213b:: ; 7213b (1c:613b) .town inc a ; a town's pallete ID is its map ID + 1 ret + .PokemonTowerOrAgatha ld a, PAL_GREYMON - 1 jr .town + .caveOrBruno ld a, PAL_CAVE - 1 jr .town + .Lorelei - xor a + xor a ; PAL_PALLET - 1 jr .town + .battleOrTradeCenter - ld a, $18 + ld a, PAL_GREYMON - 1 jr .town InitPartyMenuBlkPacket: ; 7217f (1c:617f) diff --git a/engine/pikachu_emotions.asm b/engine/pikachu_emotions.asm new file mode 100755 index 00000000..9040e612 --- /dev/null +++ b/engine/pikachu_emotions.asm @@ -0,0 +1,409 @@ +IsPlayerTalkingToPikachu:: ; fcf0c (3f:4f0c) + ld a, [wd436] + and a + ret z + ld a, [hSpriteIndexOrTextID] + cp $f + ret nz + call InitializePikachuTextID + xor a + ld [hSpriteIndexOrTextID], a + ld [wd436], a + ret + +InitializePikachuTextID: ; fcf20 (3f:4f20) + ld a, $d4 ; display + ld [hSpriteIndexOrTextID], a + xor a + ld [wPlayerMovingDirection], a + ld a, $1 + ld [wAutoTextBoxDrawingControl], a + call DisplayTextID + xor a + ld [wAutoTextBoxDrawingControl], a + ret + +DoStarterPikachuEmotions: ; fcf35 (3f:4f35) + ld e, a + ld d, $0 + add hl, de + add hl, de + ld e, [hl] + inc hl + ld d, [hl] +.loop + ld a, [de] + inc de + cp $ff + jr z, .done + ld c, a + ld b, $0 + ld hl, StarterPikachuEmotionsJumptable + add hl, bc + add hl, bc + ld a, [hli] + ld h, [hl] + ld l, a + call JumpToAddress + jr .loop +.done + ret + +StarterPikachuEmotionsJumptable: ; fcf54 (3f:4f54) + dw StarterPikachuEmotionCommand_nop ; 0 + dw StarterPikachuEmotionCommand_text ; 1 + dw StarterPikachuEmotionCommand_pcm ; 2 + dw StarterPikachuEmotionCommand_emote ; 3 + dw StarterPikachuEmotionCommand_movement ; 4 + dw StarterPikachuEmotionCommand_pikapic ; 5 + dw StarterPikachuEmotionCommand_subcmd ; 6 + dw StarterPikachuEmotionCommand_delay ; 7 + dw StarterPikachuEmotionCommand_nop2 ; 8 + dw StarterPikachuEmotionCommand_9 ; 9 + dw StarterPikachuEmotionCommand_nop3 ; a + +StarterPikachuEmotionCommand_nop: ; fcf6a (3f:4f6a) +StarterPikachuEmotionCommand_nop3: ; fcf6a (3f:4f6a) + ret + +StarterPikachuEmotionCommand_text: ; fcf6b (3f:4f6b) + ld a, [de] + ld l, a + inc de + ld a, [de] + ld h, a + inc de + push de + call PrintText + pop de + ret + +StarterPikachuEmotionCommand_pcm: ; fcf77 (3f:4f77) + ld a, [de] + inc de + push de + ld e, a + nop + call PlayPikachuSoundClip_ + pop de + ret + +PlayPikachuSoundClip_: ; fcf81 (3f:4f81) + cp $ff + ret z + callab PlayPikachuSoundClip + ret + +StarterPikachuEmotionCommand_emote: ; fcf8d (3f:4f8d) + ld a, [wUpdateSpritesEnabled] + push af + ld a, $ff + ld [wUpdateSpritesEnabled], a + ld a, [de] + inc de + push de + call ShowPikachuEmoteBubble + pop de + pop af + ld [wUpdateSpritesEnabled], a + ret + +ShowPikachuEmoteBubble: ; fcfa2 (3f:4fa2) + ld [wWhichEmotionBubble], a + ld a, $f + ld [wEmotionBubbleSpriteIndex], a + predef EmotionBubble + ret + +StarterPikachuEmotionCommand_movement: ; fcfb0 (3f:4fb0) + ld a, [de] + inc de + ld l, a + ld a, [de] + inc de + ld h, a + push de + ld b, BANK(DoStarterPikachuEmotions) + call ApplyPikachuMovementData_ + pop de + ret + +StarterPikachuEmotionCommand_delay: ; fcfbe (3f:4fbe) + ld a, [de] + inc de + push de + ld c, a + call DelayFrames + pop de + ret + +StarterPikachuEmotionCommand_subcmd: ; fcfc7 (3f:4fc7) + ld a, [de] + inc de + push de + ld e, a + ld d, $0 + ld hl, Jumptable_fcfda + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + call JumpToAddress + pop de + ret + +Jumptable_fcfda: + dw LoadPikachuSpriteIntoVRAM + dw LoadFontTilePatterns + dw Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3 + dw WaitForTextScrollButtonPress + dw PikachuPewterPokecenterCheck + dw PikachuFanClubCheck + dw PikachuBillsHouseCheck + +StarterPikachuEmotionCommand_nop2: ; fcfe8 (3f:4fe8) + ret + +StarterPikachuEmotionCommand_9: ; fcfe9 (3f:4fe9) + push de + call StarterPikachuEmotionCommand_turnawayfromplayer + call UpdateSprites + pop de + ret + +StarterPikachuEmotionCommand_turnawayfromplayer: ; fcff2 (3f:4ff2) + ld a, [wPlayerFacingDirection] + xor $4 + ld [wPikachuFacingDirection], a + ret + +DeletedFunction_fcffb: ; fcffb (3f:4ffb) +; Inexplicably empty. + rept 5 + nop + endr + ret + +Func_fd001:: ; fd001 (3f:5001) + ld a, e + jr load_expression + +Func_fd004:: ; fd004 (3f:5004) + call MapSpecificPikachuExpression + jr c, load_expression + call GetPikaPicAnimationScriptIndex + call DeletedFunction_fcffb +load_expression: ; fd00f (3f:500f) + ld [wExpressionNumber], a + ld hl, PikachuEmotionTable + call DoStarterPikachuEmotions + ret + +PikachuEmotionTable: ; fd019 (3f:4019) + dw PikachuEmotion0_fd115 + dw PikachuEmotion1_fd141 + dw PikachuEmotion2_fd116 + dw PikachuEmotion3_fd160 + dw PikachuEmotion4_fd136 + dw PikachuEmotion5_fd14d + dw PikachuEmotion6_fd153 + dw PikachuEmotion7_fd128 + dw PikachuEmotion8_fd147 + dw PikachuEmotion9_fd166 + dw PikachuEmotion10_fd11e + dw PikachuEmotion11_fd173 + dw PikachuEmotion12_fd17a + dw PikachuEmotion13_fd180 + dw PikachuEmotion14_fd189 + dw PikachuEmotion15_fd191 + dw PikachuEmotion16_fd197 + dw PikachuEmotion17_fd19d + dw PikachuEmotion18_fd1a3 + dw PikachuEmotion19_fd1a9 + dw PikachuEmotion20_fd1b1 + dw PikachuEmotion21_fd1b9 ; used a fishing rod + dw PikachuEmotion22_fd1c1 + dw PikachuEmotion23_fd1c7 + dw PikachuEmotion24_fd1cf + dw PikachuEmotion25_fd1d7 + dw PikachuEmotion26_fd1df ; wake up pikachu in pewter pokemon center + dw PikachuEmotion27_fd1eb + dw PikachuEmotion28_fd1f1 + dw PikachuEmotion29_fd1f7 + dw PikachuEmotion30_fd1fc + dw PikachuEmotion31_fd20a + dw PikachuEmotion32_fd213 + dw PikachuEmotion33_fd05d + +PikachuEmotion33_fd05d: ; fd05d (3f:505d) + db $ff + +MapSpecificPikachuExpression: ; fd05e (3f:505e) + ld a, [wCurMap] + cp POKEMON_FAN_CLUB + jr nz, .notFanClub + ld hl, wd492 + bit 7, [hl] + ld a, $1d + jr z, .set_carry + call CheckPikachuFollowingPlayer + ld a, $1e + jr nz, .set_carry + jr .check_pikachu_status + +.notFanClub + ld a, [wCurMap] + cp PEWTER_POKECENTER + jr nz, .notPewterPokecenter + call CheckPikachuFollowingPlayer + ld a, $1a + jr nz, .set_carry + jr .check_pikachu_status + +.notPewterPokecenter + callab Func_f24ae + ld a, e + cp $ff + jr nz, .set_carry + jr .check_pikachu_status ; useless + +.check_pikachu_status + call IsPlayerPikachuAsleepInParty + ld a, $b + jr c, .set_carry + callab CheckPikachuFaintedOrStatused ; same bank + ld a, $1c + jr c, .set_carry + ld a, [wCurMap] + cp POKEMONTOWER_1 + jr c, .notInLavenderTower + cp POKEMONTOWER_7 + 1 + ld a, $16 + jr c, .set_carry +.notInLavenderTower + ld a, [wd49c] + and a + jr z, .no_carry + dec a + ld c, a + ld b, $0 + ld hl, Pointer_fd0cb + add hl, bc + ld a, [hl] + jr .set_carry + +.no_carry + and a + ret + +.set_carry + scf + ret + +Pointer_fd0cb: + db $12, $15, $17, $18, $19 + +IsPlayerPikachuAsleepInParty:: ; fd0d0 (3f:50d0) + xor a + ld [wWhichPokemon], a +.loop + ld a, [wWhichPokemon] + ld c, a + ld b, $0 + ld hl, wPartySpecies + add hl, bc + ld a, [hl] + cp $ff + jr z, .done + cp PIKACHU + jr nz, .curMonNotStarterPikachu + callab IsThisPartymonStarterPikachu + jr nc, .curMonNotStarterPikachu + ld a, [wWhichPokemon] + ld hl, wPartyMon1Status + ld bc, wPartyMon2 - wPartyMon1 + call AddNTimes + ld a, [hl] + and SLP + jr z, .done + jr .curMonSleepingPikachu +.curMonNotStarterPikachu + ld a, [wWhichPokemon] + cp PARTY_LENGTH - 1 + jr z, .done + inc a + ld [wWhichPokemon], a + jr .loop +.curMonSleepingPikachu + scf + ret +.done + and a + ret + +INCLUDE "data/pikachu_emotions.asm" + +Func_fd252: ; fd252 (3f:5252) + ld a, $40 + ld [h_0xFFFC], a + call LoadPikachuSpriteIntoVRAM + call Func_fd266 + and a + jr z, .asm_fd262 + call ApplyPikachuMovementData +.asm_fd262 + xor a + ld [h_0xFFFC], a + ret + +Func_fd266: + ld a, [wSpriteStateData2 + 15 * 16 + 4] + ld e, a + ld a, [wSpriteStateData2 + 15 * 16 + 5] + ld d, a + ld a, [wYCoord] + add 4 + cp e + jr z, .asm_fd280 + jr nc, .asm_fd27e + ld hl, Data_fd294 + ld a, 1 + ret + +.asm_fd27e + xor a + ret + +.asm_fd280 + ld a, [wXCoord] + add 4 + cp d + jr c, .asm_fd28e + ld hl, Data_fd299 + ld a, 2 + ret + +.asm_fd28e + ld hl, Data_fd29d + ld a, 3 + ret + +Data_fd294: + db $00 + db $36 + db $2b + db $34 + db $3f + +Data_fd299: + db $00 + db $36 + db $34 + db $3f + +Data_fd29d: + db $00 + db $36 + db $33 + db $3f diff --git a/engine/pikachu_follow.asm b/engine/pikachu_follow.asm new file mode 100755 index 00000000..a715b0a3 --- /dev/null +++ b/engine/pikachu_follow.asm @@ -0,0 +1,1577 @@ +Func_fc4dd:: ; fc4dd (3f:44dd) +; possibly to test if pika should be out? + ld a, [wPikachuOverworldStateFlags] + bit 5, a + jr nz, .hide ; 3f:44f8 + ld a, [wPikachuOverworldStateFlags] + bit 7, a + jr nz, .hide + call IsStarterPikachuInOurParty + jr nc, .hide + ld a, [wWalkBikeSurfState] + and a + jr nz, .hide + scf + ret + +.hide + and a + ret + +Func_fc4fa:: ; fc4fa (3f:44fa) + ld hl, wPikachuOverworldStateFlags + bit 4, [hl] + res 4, [hl] + jr nz, .normal_spawn_state + call EnablePikachuFollowingPlayer + call ClearPikachuSpriteStateData + ld a, $ff + ld [wPikachuSpriteImageIdx], a + call ClearPikachuFollowCommandBuffer + call CalculatePikachuFacingDirection + ret + +.normal_spawn_state + call CalculatePikachuPlacementCoords + xor a + ld [wPikachuSpawnState], a + ld a, [wPlayerFacingDirection] + ld [wPikachuFacingDirection], a + ret + +ClearPikachuSpriteStateData:: ; fc523 (3f:4523) + ld hl, wPikachuPictureID + call .clear + ld hl, wPikachuSpriteStateData2 +.clear + ld bc, $10 + xor a + call FillMemory + ret + +Func_fc534:: ; fc534 (3f:4534) + call CalculatePikachuPlacementCoords + call CalculatePikachuFacingDirection + xor a + ld [wPikachuSpawnState], a + ret + +CalculatePikachuPlacementCoords:: ; fc53f (3f:453f) + ld bc, wPikachuPictureID + ld a, [wYCoord] + add $4 + ld e, a + ld a, [wXCoord] + add $4 + ld d, a + ld a, [wPikachuSpawnState] + and a + jr z, .load_coords + cp $1 + jr z, .right_of_player + cp $2 + jr z, .check_player_facing2 + cp $3 + jr z, .load_coords + cp $4 + jr z, .below_player + cp $5 + jr z, .above_player + cp $6 + jr z, .left_of_player + cp $7 + jr z, .check_player_facing + jr .right_of_player + +.check_player_facing + ld a, [wPlayerFacingDirection] + and a ; SPRITE_FACING_DOWN + jr z, .below_player + cp SPRITE_FACING_UP + jr z, .above_player + cp SPRITE_FACING_LEFT + jr z, .left_of_player + cp SPRITE_FACING_RIGHT + jr z, .right_of_player +.check_player_facing2 + ld a, [wPlayerFacingDirection] + and a + jr nz, .check_up + dec e + jr .load_coords + +.check_up + cp SPRITE_FACING_UP + jr nz, .check_left + inc e + jr .load_coords + +.check_left + cp SPRITE_FACING_LEFT + jr nz, .left_of_player_2 + inc d + jr .load_coords + +.left_of_player_2 + dec d + jr .load_coords + +.right_of_player + inc d + jr .load_coords + +.left_of_player + dec d + jr .load_coords + +.below_player + inc e + jr .load_coords + +.above_player + dec e + jr .load_coords ; useless jr +.load_coords + ld hl, wPlayerMapY - wPlayerSpriteStateData1 + add hl, bc + ld [hl], e + inc hl + ld [hl], d + inc hl + ld [hl], $fe + push hl + ld hl, wd472 + set 5, [hl] + pop hl + ret + +CalculatePikachuFacingDirection:: ; fc5bc (3f:45bc) + ld a, $49 + ld [wPikachuPictureID], a + ld a, $ff + ld [wPikachuSpriteImageIdx], a + ld a, [wPikachuSpawnState] + and a + jr z, .copy_player_facing + cp $1 + jr z, .copy_player_facing + cp $3 + jr z, .force_facing_down + cp $4 + jr z, .copy_player_facing + cp $6 + jr z, .copy_player_facing + cp $7 + jr z, .face_the_other_way + call ComputePikachuFacingDirection + ret + +.copy_player_facing + ld a, [wPlayerFacingDirection] + ld [wPikachuFacingDirection], a + ret + +.force_facing_down + ld a, SPRITE_FACING_DOWN + ld [wPikachuFacingDirection], a + ret + +.face_the_other_way + ld a, [wPlayerFacingDirection] + xor $4 + ld [wPikachuFacingDirection], a + ret + +CalculatePikachuSpawnState1:: ; fc5fa (3f:45fa) + ld a, [wCurMap] + cp OAKS_LAB + jr z, .oaks_lab + cp ROUTE_22_GATE + jr z, .route_22_gate + cp MT_MOON_2 + jr z, .mt_moon_2 + cp ROCK_TUNNEL_1 + jr z, .rock_tunnel_1 + ld a, [wCurMap] + ld hl, Pointer_fc64b + call Pikachu_IsInArray ; similar to IsInArray, but not the same + jr c, .map_list_1 + ld a, [wCurMap] + ld hl, Pointer_fc653 + call Pikachu_IsInArray + jr nc, .not_map_list_2 + ld a, [wPlayerFacingDirection] + and a + jr nz, .not_map_list_2 + ld a, $3 + jr .load + +.route_22_gate + ld a, [wPlayerFacingDirection] + and a + jr z, .rock_tunnel_1 + jr .not_map_list_2 + +.mt_moon_2 + ld a, $3 + jr .load + +.map_list_1 + ld a, $4 + jr .load + +.oaks_lab + ld a, $6 + jr .load + +.not_map_list_2 + ld a, $1 + jr .load + +.rock_tunnel_1 + ld a, $3 +.load + ld [wPikachuSpawnState], a + ret + +Pointer_fc64b:: ; fc64b (3f:464b) + db VICTORY_ROAD_2 + db ROUTE_7_GATE + db ROUTE_8_GATE + db ROUTE_16_GATE_1F + db ROUTE_18_GATE_1F + db ROUTE_15_GATE_1F + db ROUTE_11_GATE_1F + db $ff + +Pointer_fc653:: ; fc653 (3f:4653) + db VIRIDIAN_FOREST_EXIT + db CERULEAN_HOUSE_2 + db TRASHED_HOUSE + db VERMILION_DOCK + db CELADON_MANSION_1 + db ROUTE_2_GATE + db FUCHSIA_HOUSE_3 + db $ff + +CalculatePikachuSpawnState2:: ; fc65b (3f:465b) + ld a, [wCurMap] + cp VIRIDIAN_FOREST_EXIT + jr z, .viridian_forest_exit + cp VIRIDIAN_FOREST_ENTRANCE + jr z, .viridian_forest_entrance + ld a, [wCurMap] + ld hl, Pointer_fc68e + call Pikachu_IsInArray + jr c, .in_array + jr .not_in_array + +.viridian_forest_exit + ld a, [wPlayerFacingDirection] + cp SPRITE_FACING_UP + jr z, .in_array + jr .not_in_array + +.viridian_forest_entrance + ld a, [wPlayerFacingDirection] + and a ; SPRITE_FACING_DOWN + jr z, .not_in_array + jr .in_array + +.not_in_array + ld a, $0 + jr .load_spawn_state + +.in_array + ld a, $1 +.load_spawn_state + ld [wPikachuSpawnState], a + ret + +Pointer_fc68e:: ; fc68e (3f:468e) + db VIRIDIAN_FOREST + db SAFARI_ZONE_REST_HOUSE_1 + db SAFARI_ZONE_REST_HOUSE_2 + db SAFARI_ZONE_REST_HOUSE_3 + db SAFARI_ZONE_REST_HOUSE_4 + db SAFARI_ZONE_SECRET_HOUSE + db SILPH_CO_ELEVATOR + db CELADON_MART_ELEVATOR + db CINNABAR_LAB_2 + db CINNABAR_LAB_3 + db CINNABAR_LAB_4 + db $ff + +CalculatePikachuSpawnState3:: ; fc69a (3f:469a) + ld a, [wCurMap] + cp ROUTE_22_GATE + jr z, .asm_fc6a7 + cp ROUTE_2_GATE + jr z, .asm_fc6b0 + jr .asm_fc6bd + +.asm_fc6a7 + ld a, [wPlayerFacingDirection] + cp SPRITE_FACING_UP + jr z, .asm_fc6b9 + jr .asm_fc6bd + +.asm_fc6b0 + ld a, [wPlayerFacingDirection] + cp SPRITE_FACING_UP + jr z, .asm_fc6b9 + jr .asm_fc6bd + +.asm_fc6b9 + ld a, $1 + jr .asm_fc6c1 + +.asm_fc6bd + ld a, $3 + jr .asm_fc6c1 + +.asm_fc6c1 + ld [wPikachuSpawnState], a + ret + +SetPikachuOverworldStateFlag2:: ; fc6c5 (3f:46c5) + push hl + ld hl, wPikachuOverworldStateFlags + set 2, [hl] + pop hl + ret + +ResetPikachuOverworldStateFlag2:: ; fc6cd (3f:46cd) + push hl + ld hl, wPikachuOverworldStateFlags + res 2, [hl] + pop hl + ret + +SpawnPikachu_:: ; fc6d5 (3f:46d5) + call ResetPikachuOverworldStateFlag2 + call Func_fc727 + ret nc + + push bc + call WillPikachuSpawnOnTheScreen + pop bc + ret c + + ld bc, wPikachuPictureID + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + bit 7, [hl] + jp nz, asm_fc745 + ld a, [wFontLoaded] + bit 0, a + jp nz, asm_fc76a + call CheckPikachuFollowingPlayer + jp nz, asm_fc76a + ld a, [hl] + and $7f + cp $a + jr c, .valid + xor a +.valid + add a + ld e, a + ld d, 0 + ld hl, PointerTable_fc710 + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp hl + +PointerTable_fc710: ; fc710 (3f:4710) + dw Func_fc793 + dw Func_fc7aa + dw Func_fc803 + dw asm_fc9c3 + dw asm_fca1c + dw asm_fc9ee + dw asm_fc87f + dw asm_fc904 + dw asm_fc937 + dw asm_fc969 + dw Func_fc726 + +Func_fc726: ; fc726 (3f:4726) + ret + +Func_fc727: ; fc727 (3f:4727) + call Func_fc4dd + jr nc, .dont_spawn + ld a, [wPikachuMovementStatus] + and a + jr nz, .already_spawned + push bc + push hl + call Func_fc534 + pop hl + pop bc +.already_spawned + scf + ret + +.dont_spawn + ld hl, wPikachuSpriteImageIdx + ld [hl], $ff + dec hl + ld [hl], $0 + xor a + ret + +asm_fc745: ; fc745 (3f:4745) + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + res 7, [hl] + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], a + call CheckPikachuFollowingPlayer + jr nz, .asm_fc75f + ld a, [wPlayerFacingDirection] + xor $4 + ld hl, wSprite01FacingDirection - wSprite01SpriteStateData1 + add hl, bc + ld [hl], a +.asm_fc75f + xor a + ld hl, wSprite01IntraAnimFrameCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hli], a + ld [hl], a + call UpdatePikachuWalkingSprite + ret + +asm_fc76a: ; fc76a (3f:476a) + xor a + ld hl, wSprite01IntraAnimFrameCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hli], a + ld [hl], a + call UpdatePikachuWalkingSprite + call Func_fc82e + jr c, .asm_fc783 + push bc + callab InitializeSpriteScreenPosition + pop bc +.asm_fc783 + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $1 + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $0 + call RefreshPikachuFollow + ret + +Func_fc793: ; fc793 (3f:4793) + call RefreshPikachuFollow + push bc + callab InitializeSpriteScreenPosition + pop bc + ld hl, wSprite01SpriteImageIdx - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $ff + dec hl + ld [hl], $1 + ret + +Func_fc7aa: ; fc7aa (3f:47aa) + call Func_fcc92 + jp c, Func_fc803 + dec a + ld l, a + ld h, $0 + add hl, hl + add hl, hl + ld de, Pointer_fc7e3 + add hl, de + ld d, h + ld e, l + ld a, [de] + inc de + ld hl, wSprite01FacingDirection - wSprite01SpriteStateData1 + add hl, bc + ld [hl], a + ld a, [de] + inc de + ld hl, wSprite01XStepVector - wSprite01SpriteStateData1 + add hl, bc + ld [hl], a + dec hl + dec hl + ld a, [de] + ld [hl], a + inc de + ld a, [de] + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], a + cp $4 + jp z, Func_fca0a + call AreThereAtLeastTwoStepsInPikachuFollowCommandBuffer + jp c, FastPikachuFollow + jp NormalPikachuFollow + +Pointer_fc7e3: ; fc7e3 (3f:47e3) + db 0, 0 + db 1, 3 + db 4, 0 + db -1, 3 + db 8, -1 + db 0, 3 + db 12, 1 + db 0, 3 + db 0, 0 + db 1, 4 + db 4, 0 + db -1, 4 + db 8, -1 + db 0, 4 + db 12, 1 + db 0, 4 + +Func_fc803: ; fc803 (3f:4803) + call Func_fcae2 + ret c + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + dec [hl] + jr nz, .asm_fc823 + push hl + call GetPikachuFollowCommand + pop hl + cp $5 + jr nc, Func_fc842 + ld [hl], $20 + call Random + and $c + ld hl, wSprite01FacingDirection - wSprite01SpriteStateData1 + add hl, bc + ld [hl], a +.asm_fc823 + xor a + ld hl, wSprite01IntraAnimFrameCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hli], a + ld [hl], a + call UpdatePikachuWalkingSprite + ret + +Func_fc82e: ; fc82e (3f:482e) + ld a, [wWalkCounter] + and a + ret z + scf + ret + +Func_fc835: ; fc835 (3f:4835) + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $10 + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $1 + ret + +Func_fc842: ; fc842 (3f:4842) + ld hl, $0 + push af + call Random + ld a, [hRandomAdd] + and %11 + ld e, a + ld d, $0 + ld hl, PointerTable_fc85a + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + pop af + jp hl + +PointerTable_fc85a: ; fc85a (3f:485a) + dw Func_fc862 + dw Func_fc8f8 + dw Func_fc92b + dw Func_fc95d + +Func_fc862: ; fc862 (3f:4862) + dec a + add a + add a + and $c + ld hl, wSprite01FacingDirection - wSprite01SpriteStateData1 + add hl, bc + ld [hl], a + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $6 + xor a + ld [wd432], a + ld [wd433], a + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $11 +asm_fc87f: ; fc87f (3f:487f) + ld a, [wd432] + ld e, a + ld a, [wd433] + ld d, a + call Func_fc82e + jr c, Func_fc8c7 + call SetPikachuOverworldStateFlag2 + ld hl, wSprite01YPixels - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + sub e + ld e, a + inc hl + inc hl + ld a, [hl] + sub d + ld d, a + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + dec a + add a + add Pointer_fc8d6 % $100 + ld l, a + ld a, Pointer_fc8d6 / $100 + adc $0 + ld h, a + ld a, [hli] + ld [wd432], a + add e + ld e, a + ld a, [hl] + ld [wd433], a + add d + ld d, a + ld hl, wSprite01YPixels - wSprite01SpriteStateData1 + add hl, bc + ld [hl], e + inc hl + inc hl + ld [hl], d + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + dec [hl] + ret nz + jp Func_fc835 + +Func_fc8c7: ; fc8c7 (3f:48c7) + ld hl, wSprite01YPixels - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + sub e + ld [hl], a + inc hl + inc hl + ld a, [hl] + sub d + ld [hl], a + jp Func_fc835 + +Pointer_fc8d6: ; fc8d6 (3f:48d6) + db 0, 0 + db -2, 1 + db -4, 2 + db -2, 3 + db 0, 4 + db -2, 3 + db -4, 2 + db -2, 1 + db 0, 0 + db -2, -1 + db -4, -2 + db -2, -3 + db 0, -4 + db -2, -3 + db -4, -2 + db -2, -1 + db 0, 0 + +Func_fc8f8: ; fc8f8 (3f:48f8) + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $7 + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $30 +asm_fc904: ; fc904 (3f:4904) + call Func_fc82e + jp c, Func_fc835 + call SetPikachuOverworldStateFlag2 + ld hl, wSprite01IntraAnimFrameCounter - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + inc a + cp $8 + ld [hl], a + jr nz, .asm_fc91f + xor a + ld [hli], a + ld a, [hl] + inc a + and %11 + ld [hl], a +.asm_fc91f + call UpdatePikachuWalkingSprite + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + dec [hl] + ret nz + jp Func_fc835 + +Func_fc92b: ; fc92b (3f:492b) + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $20 + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $8 +asm_fc937: ; fc937 (3f:4937) + call Func_fc82e + jp c, Func_fc835 + call SetPikachuOverworldStateFlag2 + ld hl, wSprite01IntraAnimFrameCounter - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + inc a + cp $8 + ld [hl], a + jr nz, .asm_fc951 + xor a + ld [hli], a + ld a, [hl] + xor $1 + ld [hl], a +.asm_fc951 + call UpdatePikachuWalkingSprite + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + dec [hl] + ret nz + jp Func_fc835 + +Func_fc95d: ; fc95d (3f:495d) + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $20 + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $9 +asm_fc969: ; fc969 (3f:4969) + call Func_fc82e + jp c, Func_fc835 + call SetPikachuOverworldStateFlag2 + ld hl, wSprite01IntraAnimFrameCounter - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + inc a + cp $8 + ld [hl], a + jr nz, .asm_fc988 + xor a + ld [hl], a + ld hl, wSprite01FacingDirection - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + call Func_fc994 + ld [hl], a +.asm_fc988 + call UpdatePikachuWalkingSprite + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + dec [hl] + ret nz + jp Func_fc835 + +Func_fc994: ; fc994 (3f:4994) + push hl + ld hl, Pointer_fc9ac + ld d, a +.loop + ld a, [hli] + cp d + jr nz, .loop + ld a, [hl] + pop hl + ret + +Func_fc9a0: ; fc9a0 (3f:49a0) + push hl + ld hl, Pointer_fc9ac_End + ld d, a +.loop + ld a, [hld] + cp d + jr nz, .loop + ld a, [hl] + pop hl + ret + +Pointer_fc9ac: ; fc9ac (3f:49ac) + db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT, SPRITE_FACING_UP, SPRITE_FACING_RIGHT + db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT, SPRITE_FACING_UP, SPRITE_FACING_RIGHT +Pointer_fc9ac_End: + +NormalPikachuFollow: ; fc9b4 (3f:49b4) + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $8 + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $3 + call AddPikachuStepVector +asm_fc9c3: ; fc9c3 (3f:49c3) + call TryDoubleAddPikachuStepVectorToScreenPixelCoords + call GetPikachuWalkingAnimationSpeed + call UpdatePikachuWalkingSprite + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + dec [hl] + ret nz + call ResetPikachuStepVector + call ComputePikachuFacingDirection + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $1 + ret + +FastPikachuFollow: ; fc9df (3f:49df) + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $4 + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $5 + call AddPikachuStepVector +asm_fc9ee: ; fc9ee (3f:49ee) + call DoubleAddPikachuStepVectorToScreenPixelCoords + call GetPikachuWalkingAnimationSpeed + call UpdatePikachuWalkingSprite + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + dec [hl] + ret nz + call ResetPikachuStepVector + call ComputePikachuFacingDirection + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $1 + ret + +Func_fca0a: ; fca0a (3f:4a0a) + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $8 + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $4 + call AddPikachuStepVector + call AddPikachuStepVector +asm_fca1c: ; fca1c (3f:4a1c) + call DoubleAddPikachuStepVectorToScreenPixelCoords + call GetPikachuWalkingAnimationSpeed + call UpdatePikachuWalkingSprite + ld hl, wSprite01WalkAnimationCounter - wSprite01SpriteStateData1 + add hl, bc + dec [hl] + ret nz + call ResetPikachuStepVector + call ComputePikachuFacingDirection + ld hl, wSprite01MovementStatus - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $1 + ret + +AddPikachuStepVector: ; fca38 (3f:4a38) + ld hl, wSprite01YStepVector - wSprite01SpriteStateData1 + add hl, bc + ld e, [hl] + inc hl + inc hl + ld d, [hl] + ld hl, wSprite01MapY - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + add e + ld [hli], a + ld a, [hl] + add d + ld [hl], a + ret + +TryDoubleAddPikachuStepVectorToScreenPixelCoords: ; fca4b (3f:4a4b) + ld a, [wWalkBikeSurfState] + cp $1 ; biking + jr nz, AddPikachuStepVectorToScreenPixelCoords + ld a, [wd736] + bit 6, a + jr nz, AddPikachuStepVectorToScreenPixelCoords +DoubleAddPikachuStepVectorToScreenPixelCoords: ; fca59 (3f:4a59) + ld hl, wSprite01YStepVector - wSprite01SpriteStateData1 + add hl, bc + ld a, [hli] + add a + add a + add [hl] + ld [hli], a + ld a, [hli] + add a + add a + add [hl] + ld [hl], a + ret + +AddPikachuStepVectorToScreenPixelCoords: ; fca68 (3f:4a68) + ld hl, wSprite01YStepVector - wSprite01SpriteStateData1 + add hl, bc + ld a, [hli] + add a + add [hl] + ld [hli], a + ld a, [hli] + add a + add [hl] + ld [hli], a + ret + +ResetPikachuStepVector: ; fca75 (3f:4a75) + ld hl, wSprite01YStepVector - wSprite01SpriteStateData1 + add hl, bc + xor a + ld [hli], a + inc hl + ld [hl], a + ret + +GetPikachuWalkingAnimationSpeed: ; fca7e (3f:4a7e) + call ComparePikachuHappinessTo80 + ld d, $2 + jr nc, .happy + ld d, $5 +.happy + ld hl, wSprite01IntraAnimFrameCounter - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + inc a + cp d + jr nz, .dont_reset + xor a +.dont_reset + ld [hli], a + ret nz + ld a, [hl] + inc a + and $3 + ld [hl], a + ret + +UpdatePikachuWalkingSprite: ; fca99 (3f:4a99) + ld a, [wPikachuOverworldStateFlags] + bit 3, a + jr nz, .uninitialized + ld hl, wSprite01SpriteImageBaseOffset - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + dec a + swap a + ld d, a + ld a, [wd736] + bit 7, a + jr nz, .copy_player + ld hl, wSprite01FacingDirection - wSprite01SpriteStateData1 + add hl, bc + ld a, [hl] + or d + ld d, a + ld a, [wFontLoaded] + bit 0, a + jr z, .normal_get_sprite_index + call Func_fcae2 + ret c + jr .load_sprite_index + +.normal_get_sprite_index + ld hl, wSprite01AnimFrameCounter - wSprite01SpriteStateData1 + add hl, bc + ld a, d + or [hl] + ld d, a +.load_sprite_index + ld hl, wSprite01SpriteImageIdx - wSprite01SpriteStateData1 + add hl, bc + ld [hl], d + ret + +.uninitialized + ld hl, wSprite01SpriteImageIdx - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $ff + ret + +.copy_player + ld a, [wPlayerSpriteImageIdx] + and $f + or d + ld [wPikachuSpriteImageIdx], a + ret + +Func_fcae2: ; fcae2 (3f:4ae2) + ld hl, wSprite01MapY - wSprite01SpriteStateData1 + add hl, bc + ld a, [wYCoord] + add $4 + cp [hl] + jr nz, .on_screen + inc hl + ld a, [wXCoord] + add $4 + cp [hl] + jr nz, .on_screen + ld hl, wSprite01SpriteImageIdx - wSprite01SpriteStateData1 + add hl, bc + ld [hl], $ff + scf + ret + +.on_screen + and a + ret + +IsPikachuRightNextToPlayer: ; fcb01 (3f:4b01) + push bc + push de + push hl + ld bc, wPikachuPictureID + ld a, [wXCoord] + add $4 + ld d, a + ld a, [wYCoord] + add $4 + ld e, a + ld hl, wPlayerMapY - wPlayerSpriteStateData1 + add hl, bc + ld a, [hl] + sub e + and a + jr z, .equal + cp $ff + jr z, .one_away + cp $1 + jr z, .one_away + jr .bad + +.one_away + ld hl, wPlayerMapX - wPlayerSpriteStateData1 + add hl, bc + ld a, [hl] + sub d + jr z, .good + jr .bad + +.equal + ld hl, wPlayerMapX - wPlayerSpriteStateData1 + add hl, bc + ld a, [hl] + sub d + cp $ff + jr z, .good + cp $1 + jr z, .good + and a + jr z, .good + jr .bad + +.good + pop hl + pop de + pop bc + scf + ret + +.bad + pop hl + pop de + pop bc + xor a + ret + +GetPikachuFacingDirectionAndReturnToE: ; fcb4d (3f:4b4d) + call GetPikachuFacingDirection + ld e, a + ret + +GetPikachuFacingDirection: ; fcb52 (3f:4b52) + ld bc, wPikachuPictureID + ld a, [wXCoord] + add $4 + ld d, a + ld a, [wYCoord] + add $4 + ld e, a + ld hl, wPlayerMapY - wPlayerSpriteStateData1 + add hl, bc + ld a, [hl] + cp e + jr z, .asm_fcb71 + jr nc, .asm_fcb6e + ld a, SPRITE_FACING_UP + ret + +.asm_fcb6e + ld a, SPRITE_FACING_DOWN + ret + +.asm_fcb71 + ld hl, wPlayerMapX - wPlayerSpriteStateData1 + add hl, bc + ld a, [hl] + cp d + jr z, .asm_fcb81 + jr nc, .asm_fcb7e + ld a, SPRITE_FACING_LEFT + ret + +.asm_fcb7e + ld a, SPRITE_FACING_RIGHT + ret + +.asm_fcb81 + ld a, $ff ; standing + ret + +ClearPikachuFollowCommandBuffer: ; fcb84 (3f:4b84) + push bc + ld hl, wPikachuFollowCommandBufferSize + ld [hl], $ff + inc hl + ld bc, $10 + xor a + call FillMemory + pop bc + ret + +AppendPikachuFollowCommandToBuffer: ; fcb94 (3f:4b94) + ld hl, wPikachuFollowCommandBufferSize + inc [hl] + ld e, [hl] + ld d, 0 + ld hl, wPikachuFollowCommandBuffer + add hl, de + ld [hl], a + ret + +RefreshPikachuFollow: ; fcba1 (3f:4ba1) + call ClearPikachuFollowCommandBuffer + call ComputePikachuFollowCommand + ret c + call AppendPikachuFollowCommandToBuffer + ret + +ComputePikachuFollowCommand: ; fcbac (3f:4bac) + ld bc, wPikachuPictureID + ld hl, wPlayerMapY - wPlayerSpriteStateData1 + add hl, bc + ld a, [wYCoord] + add $4 + sub [hl] + jr z, .checkXCoord + jr c, .pikaAbovePlayer + call CheckAbsoluteValueLessThan2 + jr c, .return1 + ld a, $5 + and a + ret + +.return1 + ld a, $1 + and a + ret + +.pikaAbovePlayer + call CheckAbsoluteValueLessThan2 + jr c, .return2 + ld a, $6 + and a + ret + +.return2 + ld a, $2 + and a + ret + +.checkXCoord + ld hl, wPlayerMapX - wPlayerSpriteStateData1 + add hl, bc + ld a, [wXCoord] + add $4 + sub [hl] + jr z, .pikachuOnTopOfPlayer + jr c, .pikaToLeftOfPlayer + call CheckAbsoluteValueLessThan2 + jr c, .return4 + ld a, $8 + and a + ret + +.return4 + ld a, $4 + and a + ret + +.pikaToLeftOfPlayer + call CheckAbsoluteValueLessThan2 + jr c, .return3 + ld a, $7 + and a + ret + +.return3 + ld a, $3 + and a + ret + +.pikachuOnTopOfPlayer + scf + ret + +CheckAbsoluteValueLessThan2: ; fcc01 (3f:4c01) + jr nc, .positive + cpl + inc a +.positive + cp $2 + ret + +Func_fcc08:: ; fcc08 (3f:4c08) + call Func_fcc23 + ret nc + ld a, [wd736] + bit 6, a + jr nz, .asm_fcc1b + call Func_fcc42 + ret c + call AppendPikachuFollowCommandToBuffer + ret + +.asm_fcc1b + call Func_fcc64 + ret c + call AppendPikachuFollowCommandToBuffer + ret + +Func_fcc23: ; fcc23 (3f:4c28) + ld a, [wPikachuOverworldStateFlags] + bit 5, a + jr nz, .asm_fcc40 + ld a, [wPikachuOverworldStateFlags] + bit 7, a + jr nz, .asm_fcc40 + ld a, [wd472] + bit 7, a + jr z, .asm_fcc40 + ld a, [wWalkBikeSurfState] + and a + jr nz, .asm_fcc40 + scf + ret + +.asm_fcc40 + and a + ret + +Func_fcc42: ; fcc42 (3f:4c42) + xor a + ld a, [wPlayerDirection] + bit 3, a + jr nz, .asm_fcc58 + bit 2, a + jr nz, .asm_fcc5b + bit 1, a + jr nz, .asm_fcc5e + bit 0, a + jr nz, .asm_fcc61 + scf + ret + +.asm_fcc58 + ld a, $2 + ret + +.asm_fcc5b + ld a, $1 + ret + +.asm_fcc5e + ld a, $3 + ret + +.asm_fcc61 + ld a, $4 + ret + +Func_fcc64: ; fcc64 (3f:4c64) + ld hl, wPikachuOverworldStateFlags + bit 6, [hl] + jr z, .asm_fcc6e + res 6, [hl] + ret + +.asm_fcc6e + set 6, [hl] + xor a + ld a, [wPlayerDirection] + bit 3, a + jr nz, .asm_fcc86 + bit 2, a + jr nz, .asm_fcc89 + bit 1, a + jr nz, .asm_fcc8c + bit 0, a + jr nz, .asm_fcc8f + scf + ret + +.asm_fcc86 + ld a, $6 + ret + +.asm_fcc89 + ld a, $5 + ret + +.asm_fcc8c + ld a, $7 + ret + +.asm_fcc8f + ld a, $8 + ret + +Func_fcc92: ; fcc92 (3f:4c92) + ld hl, wPikachuFollowCommandBufferSize + ld a, [hl] + cp $ff + jr z, .asm_fccb0 + and a + jr z, .asm_fccb0 + dec [hl] + ld e, a + ld d, 0 + ld hl, wPikachuFollowCommandBuffer + add hl, de + inc e + ld a, $ff +.asm_fcca8 + ld d, [hl] + ldd [hl], a + ld a, d + dec e + jr nz, .asm_fcca8 + and a + ret + +.asm_fccb0 + scf + ret + +ComputePikachuFacingDirection:: ; fccb2 (3f:4cb2) + call GetPikachuFollowCommandIfBufferSizeNonzero + and a + jr z, .check_y + dec a + and $3 + add a + add a + jr .load + +.check_y + ld a, [wYCoord] + add $4 + ld d, a + ld a, [wXCoord] + add $4 + ld e, a + ld a, [wPikachuMapY] + cp d + jr z, .check_x + ld a, SPRITE_FACING_DOWN + jr c, .load + ld a, SPRITE_FACING_UP + jr .load + +.check_x + ld a, [wPikachuMapX] + cp e + jr z, .copy_from_player + ld a, SPRITE_FACING_RIGHT + jr c, .load + ld a, SPRITE_FACING_LEFT + jr .load + +.copy_from_player + ld a, [wPlayerFacingDirection] +.load + ld [wPikachuFacingDirection], a + ret + +GetPikachuFollowCommand: ; fccee (3f:4cee) + ld hl, wPikachuFollowCommandBufferSize + ld a, [hl] + cp $ff + jr z, .asm_fccff + ld e, a + ld d, 0 + ld hl, wPikachuFollowCommandBuffer + add hl, de + ld a, [hl] + ret + +.asm_fccff + xor a + ret + +GetPikachuFollowCommandIfBufferSizeNonzero: ; fcd01 (3f:4d01) + ld hl, wPikachuFollowCommandBufferSize + ld a, [hl] + cp $ff + jr z, .default + and a + jr z, .default + ld e, a + ld d, 0 + ld hl, wPikachuFollowCommandBuffer + add hl, de + ld a, [hl] + ret + +.default + xor a + ret + +AreThereAtLeastTwoStepsInPikachuFollowCommandBuffer: ; fcd17 (3f:4d17) + ld a, [wPikachuFollowCommandBufferSize] + cp $ff + ret z + cp $2 + jr nc, .set_carry + and a + ret + +.set_carry + scf + ret + +WillPikachuSpawnOnTheScreen: ; fcd25 (3f:4d25) + ld h, wSpriteStateData2 / $100 + ld a, [H_CURRENTSPRITEOFFSET] ; If we're here, this can only be $f0 + add wPikachuMapY - wPikachuSpriteStateData2 + ld l, a + ld b, [hl] + ld a, [wYCoord] + cp b + jr z, .same_y + jr nc, .not_on_screen + add (SCREEN_HEIGHT / 2) - 1 + cp b + jr c, .not_on_screen +.same_y + inc l + ld b, [hl] + ld a, [wXCoord] + cp b + jr z, .same_x + jr nc, .not_on_screen + add (SCREEN_WIDTH / 2) - 1 + cp b + jr c, .not_on_screen +.same_x + call .GetNPCCurrentTile + ld d, $60 + ld a, [hli] + ld e, a + cp d + jr nc, .not_on_screen + ld a, [hld] + cp d + jr nc, .not_on_screen + ld bc, -20 + add hl, bc + ld a, [hli] + cp d + jr nc, .not_on_screen + ld a, [hl] + cp d + jr c, .on_screen +.not_on_screen + ld h, wSpriteStateData1 / $100 + ld a, [H_CURRENTSPRITEOFFSET] + add wPikachuSpriteImageIdx - wPikachuSpriteStateData1 + ld l, a + ld [hl], $ff + scf + jr .return + +.on_screen + ld h, wSpriteStateData2 / $100 + ld a, [H_CURRENTSPRITEOFFSET] + add wPikachuGrassPriority - wPikachuSpriteStateData2 + ld l, a + ld a, [wGrassTile] + cp e + ld a, $0 + jr nz, .priority + ld a, $80 +.priority + ld [hl], a + and a +.return + ret + +.GetNPCCurrentTile: ; fcd83 (3f:4d83) + ld h, wSpriteStateData1 / $100 + ld a, [H_CURRENTSPRITEOFFSET] + add wPikachuYPixels - wPikachuSpriteStateData1 + ld l, a + ld a, [hli] + add $4 + and $f0 + srl a + ld c, a + ld b, $0 + inc l + ld a, [hl] + add $2 + srl a + srl a + srl a + add SCREEN_WIDTH + ld d, 0 + ld e, a + ld hl, wTileMap + rept 5 + add hl, bc + endr + add hl, de + ret + +ComparePikachuHappinessTo80: ; fcdad (3f:4dad) +; preserves a and bc + push bc + push af + ld a, [wPikachuHappiness] + cp 80 + pop bc + ld a, b + pop bc + ret diff --git a/engine/pikachu_movement.asm b/engine/pikachu_movement.asm new file mode 100755 index 00000000..fbb71ffd --- /dev/null +++ b/engine/pikachu_movement.asm @@ -0,0 +1,1039 @@ +ApplyPikachuMovementData_:: ; fd2a1 (3f:52a1) + ld a, b + ld [wPikachuMovementScriptBank], a + ld a, l + ld [wPikachuMovementScriptAddress], a + ld a, h + ld [wPikachuMovementScriptAddress + 1], a + call PikachuSwapSpriteStateData +.loop + call LoadPikachuMovementCommandData + jr nc, .done + call ExecutePikachuMovementCommand + jr .loop + +.done + call PikachuSwapSpriteStateData + call DelayFrame + ret + +PikachuSwapSpriteStateData: + ld a, [wUpdateSpritesEnabled] + push af + ld a, $ff + ld [wUpdateSpritesEnabled], a + push hl + push de + push bc + + ld hl, wSpriteStateData1 + ld de, wPikachuSpriteStateData1 + ld c, $10 + call SwapBytes3f + + ld hl, wSpriteStateData2 + ld de, wPikachuSpriteStateData2 + ld c, $10 + call SwapBytes3f + + pop bc + pop de + pop hl + pop af + ld [wUpdateSpritesEnabled], a + ret + +SwapBytes3f: +.loop + ld b, [hl] + ld a, [de] + ld [hli], a + ld a, b + ld [de], a + inc de + dec c + jr nz, .loop + ret + +LoadPikachuMovementCommandData: + call GetPikachuMovementScriptByte + cp $3f + ret z + ld c, a + ld b, 0 + ld hl, Data_fd3b0 + add hl, bc + add hl, bc + add hl, bc + add hl, bc + ld a, [hli] + ld [wPikaPicAnimPointer + 1], a + ld a, [hli] + cp $80 + jr nz, .no_param + call GetPikachuMovementScriptByte +.no_param + ld [wPikaPicAnimPointer], a + ld a, [hli] + ld [wPikaPicAnimCurGraphicID], a + ld a, [hli] + cp $80 + jr nz, .no_param2 + call GetPikachuMovementScriptByte +.no_param2 + ld [wPikaPicAnimPointerSetupFinished], a + xor a + ld [wPikaPicAnimTimer], a + scf + ret + +ExecutePikachuMovementCommand: + xor a + ld [wd44d], a + ld [wd457], a + ld [wd458], a + ld a, [wPlayerGrassPriority] + push af +.loop + ld bc, wSpriteStateData1 + ld a, [wPikaPicAnimPointer + 1] + ld hl, Jumptable_fd4ac + call .JumpTable + ld a, [wPikaPicAnimCurGraphicID] + ld hl, Jumptable_fd65c + call .JumpTable + call Func_fd36e + call Func_fd39d + call DelayFrame + call DelayFrame + ld hl, wd44d + bit 7, [hl] + jr z, .loop + pop af + ld [wPlayerGrassPriority], a + scf + ret + +.JumpTable: + ld e, a + ld d, 0 + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Func_fd36e: + ld hl, 2 + add hl, bc + ld a, [wPikaPicAnimTimer + 1] + ld [hl], a + ld a, [wPikaSpriteY] + ld d, a + ld a, [wd456] + add d + ld hl, 4 + add hl, bc + ld [hl], a + ld a, [wPikaPicAnimDelay] + ld d, a + ld a, [wPikaPicTextboxStartY] + add d + ld hl, 6 + add hl, bc + ld [hl], a + ld hl, wd44d + bit 6, [hl] + ret z + ld hl, wPlayerGrassPriority - wSpriteStateData1 + add hl, bc + ld [hl], 0 + ret + +Func_fd39d: + ld hl, wd44d + bit 6, [hl] + res 6, [hl] + ld hl, wd736 + res 6, [hl] + ret z + set 6, [hl] + call Func_fd7f3 + ret + +Data_fd3b0: + db $01, $00, $00, $00 ; $00 + db $03, $80, $01, $00 ; $01 + db $04, $80, $01, $00 ; $02 + db $05, $80, $01, $00 ; $03 + db $06, $80, $01, $00 ; $04 + db $07, $80, $01, $00 ; $05 + db $08, $80, $01, $00 ; $06 + db $09, $80, $01, $00 ; $07 + db $0a, $80, $01, $00 ; $08 + db $03, $80, $06, $00 ; $09 + db $04, $80, $06, $00 ; $0a + db $05, $80, $06, $00 ; $0b + db $06, $80, $06, $00 ; $0c + db $07, $80, $06, $00 ; $0d + db $08, $80, $06, $00 ; $0e + db $09, $80, $06, $00 ; $0f + db $0a, $80, $06, $00 ; $10 + db $03, $80, $03, $80 ; $11 + db $04, $80, $03, $80 ; $12 + db $05, $80, $03, $80 ; $13 + db $06, $80, $03, $80 ; $14 + db $07, $80, $03, $80 ; $15 + db $08, $80, $03, $80 ; $16 + db $09, $80, $03, $80 ; $17 + db $0a, $80, $03, $80 ; $18 + db $03, $80, $07, $80 ; $19 + db $04, $80, $07, $80 ; $1a + db $05, $80, $07, $80 ; $1b + db $06, $80, $07, $80 ; $1c + db $0b, $27, $02, $00 ; $1d step down + db $0c, $27, $02, $00 ; $1e step up + db $0d, $27, $02, $00 ; $1f step left + db $0e, $27, $02, $00 ; $20 step right + db $0f, $27, $02, $00 ; $21 + db $10, $27, $02, $00 ; $22 + db $11, $27, $02, $00 ; $23 + db $12, $27, $02, $00 ; $24 + db $0b, $0f, $02, $00 ; $25 + db $0c, $0f, $02, $00 ; $26 + db $0d, $0f, $02, $00 ; $27 + db $0e, $0f, $02, $00 ; $28 + db $0f, $0f, $02, $00 ; $29 + db $10, $0f, $02, $00 ; $2a + db $11, $0f, $02, $00 ; $2b + db $12, $0f, $02, $00 ; $2c + db $0b, $0f, $08, $17 ; $2d + db $0c, $0f, $08, $17 ; $2e + db $0d, $0f, $08, $17 ; $2f + db $0e, $0f, $08, $17 ; $30 + db $0f, $0f, $08, $17 ; $31 + db $10, $0f, $08, $17 ; $32 + db $11, $0f, $08, $17 ; $33 + db $12, $0f, $08, $17 ; $34 + db $13, $0f, $06, $00 ; $35 look down + db $14, $0f, $06, $00 ; $36 look up + db $15, $0f, $06, $00 ; $37 look left + db $16, $0f, $06, $00 ; $38 look right + db $02, $80, $04, $00 ; $39 + db $02, $80, $05, $00 ; $3a + db $02, $80, $03, $80 ; $3b + db $02, $80, $07, $80 ; $3c + db $02, $80, $09, $80 ; $3d + db $02, $80, $06, $00 ; $3e + +Jumptable_fd4ac: + dw Func_fd4e5 + dw Func_fd4e9 + dw Func_fd504 + dw Func_fd50c + dw Func_fd511 + dw Func_fd518 + dw Func_fd52c + dw Func_fd540 + dw Func_fd553 + dw Func_fd566 + dw Func_fd579 + dw Func_fd5b1 + dw Func_fd5b5 + dw Func_fd5b9 + dw Func_fd5bd + dw Func_fd5c1 + dw Func_fd5c5 + dw Func_fd5c9 + dw Func_fd5cd + dw Func_fd5ea + dw Func_fd5ee + dw Func_fd5f2 + dw Func_fd5f6 + dw Func_fd4e5 + +Func_fd4dc: + ld a, [wd44d] + set 7, a + ld [wd44d], a + ret + +Func_fd4e5: + call Func_fd4dc + ret + +Func_fd4e9: + ld hl, 4 + add hl, bc + ld a, [hl] + ld [wPikaSpriteY], a + ld hl, 6 + add hl, bc + ld a, [hl] + ld [wPikaPicAnimDelay], a + xor a + ld [wd456], a + ld [wPikaPicTextboxStartY], a + call Func_fd4dc + ret + +Func_fd504: + call Func_fd775 + ret nz + call Func_fd4dc + ret + +Func_fd50c: + call GetObjectFacing + jr asm_fd58c + +Func_fd511: + call GetObjectFacing + xor %100 + jr asm_fd58c + +Func_fd518: + call GetObjectFacing + ld hl, Data_fd523 + call Func_fd5a0 + jr asm_fd58c + +Data_fd523: + db SPRITE_FACING_DOWN, SPRITE_FACING_RIGHT + db SPRITE_FACING_UP, SPRITE_FACING_LEFT + db SPRITE_FACING_LEFT, SPRITE_FACING_DOWN + db SPRITE_FACING_RIGHT, SPRITE_FACING_UP + db $ff + +Func_fd52c: + call GetObjectFacing + ld hl, Data_fd537 + call Func_fd5a0 + jr asm_fd58c + +Data_fd537: + db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT + db SPRITE_FACING_UP, SPRITE_FACING_RIGHT + db SPRITE_FACING_LEFT, SPRITE_FACING_UP + db SPRITE_FACING_RIGHT, SPRITE_FACING_DOWN + db $ff + +Func_fd540: + call GetObjectFacing + ld hl, Data_fd54b + call Func_fd5a0 + jr asm_fd58c + +Data_fd54b: + db SPRITE_FACING_DOWN, SPRITE_FACING_UP | $10 + db SPRITE_FACING_UP, SPRITE_FACING_LEFT | $10 + db SPRITE_FACING_LEFT, SPRITE_FACING_DOWN | $10 + db SPRITE_FACING_RIGHT, SPRITE_FACING_RIGHT | $10 + +Func_fd553: + call GetObjectFacing + ld hl, Data_fd55e + call Func_fd5a0 + jr asm_fd58c + +Data_fd55e: + db SPRITE_FACING_DOWN, SPRITE_FACING_DOWN | $10 + db SPRITE_FACING_UP, SPRITE_FACING_RIGHT | $10 + db SPRITE_FACING_LEFT, SPRITE_FACING_LEFT | $10 + db SPRITE_FACING_RIGHT, SPRITE_FACING_UP | $10 + +Func_fd566: + call GetObjectFacing + ld hl, Data_fd571 + call Func_fd5a0 + jr asm_fd58c + +Data_fd571: + db SPRITE_FACING_DOWN, SPRITE_FACING_RIGHT | $10 + db SPRITE_FACING_UP, SPRITE_FACING_DOWN | $10 + db SPRITE_FACING_LEFT, SPRITE_FACING_UP | $10 + db SPRITE_FACING_RIGHT, SPRITE_FACING_LEFT | $10 + +Func_fd579: + call GetObjectFacing + ld hl, Data_fd584 + call Func_fd5a0 + jr asm_fd58c + +Data_fd584: + db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT | $10 + db SPRITE_FACING_UP, SPRITE_FACING_UP | $10 + db SPRITE_FACING_LEFT, SPRITE_FACING_RIGHT | $10 + db SPRITE_FACING_RIGHT, SPRITE_FACING_DOWN | $10 + +asm_fd58c + rrca + rrca + and $7 + ld e, a + call Func_fd784 + ld d, a + call UpdatePikachuPosition + call Func_fd775 + ret nz + call Func_fd4dc + ret + +Func_fd5a0: + push de + ld d, a +.asm_fd5a2 + ld a, [hli] + cp d + jr z, .asm_fd5ad + inc hl + cp $ff + jr nz, .asm_fd5a2 + pop de + ret + +.asm_fd5ad + ld a, [hl] + pop de + scf + ret + +Func_fd5b1: + ld a, SPRITE_FACING_DOWN >> 2 + jr asm_fd5d1 + +Func_fd5b5: + ld a, SPRITE_FACING_UP >> 2 + jr asm_fd5d1 + +Func_fd5b9: + ld a, SPRITE_FACING_LEFT >> 2 + jr asm_fd5d1 + +Func_fd5bd: + ld a, SPRITE_FACING_RIGHT >> 2 + jr asm_fd5d1 + +Func_fd5c1: + ld e, 4 + jr asm_fd5d5 + +Func_fd5c5: + ld e, 5 + jr asm_fd5d5 + +Func_fd5c9: + ld e, 6 + jr asm_fd5d5 + +Func_fd5cd: + ld e, 7 + jr asm_fd5d5 + +asm_fd5d1 + ld e, a + call SetObjectFacing +asm_fd5d5 + call Func_fd784 + ld d, a + push de + call UpdatePikachuPosition + pop de + call Func_fd775 + ret nz + ld a, e + call Func_fd7cb + call Func_fd4dc + ret + +Func_fd5ea: + ld a, SPRITE_FACING_DOWN >> 2 + jr asm_fd5fa + +Func_fd5ee: + ld a, SPRITE_FACING_UP >> 2 + jr asm_fd5fa + +Func_fd5f2: + ld a, SPRITE_FACING_LEFT >> 2 + jr asm_fd5fa + +Func_fd5f6: + ld a, SPRITE_FACING_RIGHT >> 2 + jr asm_fd5fa + +asm_fd5fa + call SetObjectFacing + call Func_fd4dc + ret + +UpdatePikachuPosition: + push de + ld d, 0 + ld hl, Jumptable_fd60f + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + pop de + ld a, d + jp [hl] + +Jumptable_fd60f: + dw MovePikachuSpriteDown + dw MovePikachuSpriteUp + dw MovePikachuSpriteLeft + dw MovePikachuSpriteRight + dw MovePikachuSpriteDownLeft + dw MovePikachuSpriteDownRight + dw MovePikachuSpriteUpLeft + dw MovePikachuSpriteUpRight + +MovePikachuSpriteDown: + ld d, 0 + ld e, a + jr asm_fd64d + +MovePikachuSpriteUp: + ld d, 0 + cpl + inc a + ld e, a + jr asm_fd64d + +MovePikachuSpriteLeft: + cpl + inc a + ld d, a + ld e, 0 + jr asm_fd64d + +MovePikachuSpriteRight: + ld d, a + ld e, 0 + jr asm_fd64d + +MovePikachuSpriteDownLeft: + ld e, a + cpl + inc a + ld d, a + jr asm_fd64d + +MovePikachuSpriteDownRight: + ld e, a + ld d, a + jr asm_fd64d + +MovePikachuSpriteUpLeft: + cpl + inc a + ld e, a + ld d, a + jr asm_fd64d + +MovePikachuSpriteUpRight: + ld d, a + cpl + inc a + ld e, a + jr asm_fd64d + +asm_fd64d + ld a, [wPikaPicAnimDelay] + add d + ld [wPikaPicAnimDelay], a + ld a, [wPikaSpriteY] + add e + ld [wPikaSpriteY], a + ret + +Jumptable_fd65c: + dw Func_fd678 + dw Func_fd6a3 + dw Func_fd698 + dw Func_fd6f4 + dw Func_fd6ff + dw Func_fd718 + dw Func_fd68c + dw Func_fd6c6 + dw Func_fd6c0 + dw Func_fd6e2 + dw Func_fd68b + +Func_fd672: + ld hl, wd44d + set 6, [hl] + ret + +Func_fd678: + ld hl, 7 + add hl, bc + xor a + ld [hli], a + ld [hl], a + call Func_fd74a + ld d, a + call GetObjectFacing + or d + ld [wPikaPicAnimTimer + 1], a + ret + +Func_fd68b: + ret + +Func_fd68c: + call Func_fd74a + ld d, a + call Func_fd755 + or d + ld [wPikaPicAnimTimer + 1], a + ret + +Func_fd698: + call Func_fd74a + ld d, a + call GetObjectFacing + or d + ld d, a + jr asm_fd6ac + +Func_fd6a3: + call Func_fd74a + ld d, a + call Func_fd755 + or d + ld d, a +asm_fd6ac + ld hl, 8 + add hl, bc + call Func_fd78e + jr nz, .asm_fd6b6 + inc [hl] +.asm_fd6b6 + ld a, [hl] + rrca + rrca + and 3 + or d + ld [wPikaPicAnimTimer + 1], a + ret + +Func_fd6c0: + call GetObjectFacing + ld d, a + jr asm_fd6ca + +Func_fd6c6: + call Func_fd755 + ld d, a +asm_fd6ca + call Func_fd74a + or d + ld d, a + call Func_fd736 + or d + ld [wPikaPicAnimTimer + 1], a + call Func_fd79d + ld [wd456], a + and a + ret z + call Func_fd672 + ret + +Func_fd6e2: + call GetObjectFacing + ld d, a + call Func_fd74a + or d + ld [wPikaPicAnimTimer + 1], a + call Func_fd79d + ld [wd456], a + ret + +Func_fd6f4: + ld a, [wPikaPicAnimPointerSetupFinished] + and $40 + cp $40 + jr z, Func_fd6ff + jr Func_fd718 + +Func_fd6ff: + call Func_fd755 + ld d, a + call Func_fd78e + jr nz, .asm_fd710 + ld hl, Data_fd731 +.asm_fd70b + ld a, [hli] + cp d + jr nz, .asm_fd70b + ld d, [hl] +.asm_fd710 + call Func_fd74a + or d + ld [wPikaPicAnimTimer + 1], a + ret + +Func_fd718: + call Func_fd755 + ld d, a + call Func_fd78e + jr nz, .asm_fd529 + ld hl, Data_fd731End +.asm_fd524 + ld a, [hld] + cp d + jr nz, .asm_fd524 + ld d, [hl] +.asm_fd529 + call Func_fd74a + or d + ld [wPikaPicAnimTimer + 1], a + ret + +Data_fd731: + db SPRITE_FACING_DOWN + db SPRITE_FACING_LEFT + db SPRITE_FACING_UP + db SPRITE_FACING_RIGHT + db SPRITE_FACING_DOWN +Data_fd731End: + +Func_fd736: + push hl + ld hl, 7 + add hl, bc + ld a, [hl] + inc a + and $3 + ld [hli], a + jr nz, .asm_fd747 + ld a, [hl] + inc a + and $3 + ld [hl], a +.asm_fd747 + ld a, [hl] + pop hl + ret + +Func_fd74a: + push hl + ld hl, wSpriteStateData2 - wSpriteStateData1 + 14 + add hl, bc + ld a, [hl] + dec a + swap a + pop hl + ret + +Func_fd755: + push hl + ld hl, 2 + add hl, bc + ld a, [hl] + and $c + pop hl + ret + +GetObjectFacing: + push hl + ld hl, 9 + add hl, bc + ld a, [hl] + and $c + pop hl + ret + +SetObjectFacing: + push hl + ld hl, 9 + add hl, bc + add a + add a + and $c + ld [hl], a + pop hl + ret + +Func_fd775: + ld hl, wd457 + inc [hl] + ld a, [wPikaPicAnimPointer] + and $1f + inc a + cp [hl] + ret nz + ld [hl], 0 + ret + +Func_fd784: + ld a, [wPikaPicAnimPointer] + swap a + rrca + and $3 + inc a + ret + +Func_fd78e: + ld hl, wd458 + inc [hl] + ld a, [wPikaPicAnimPointerSetupFinished] + and $f + inc a + cp [hl] + ret nz + ld [hl], 0 + ret + +Func_fd79d: + call Func_fd7b2 + ld a, [wd458] + add e + ld [wd458], a + add $20 + ld e, a + push hl + push bc + call Sine_e + pop bc + pop hl + ret + +Func_fd7b2: + ld a, [wPikaPicAnimPointerSetupFinished] + and $f + inc a + ld d, a + ld a, [wPikaPicAnimPointerSetupFinished] + swap a + and $7 + ld e, a + ld a, 1 + jr z, .asm_fd7c9 +.asm_fd7c5 + add a + dec e + jr nz, .asm_fd7c5 +.asm_fd7c9 + ld e, a + ret + +Func_fd7cb: + push bc + ld c, a + ld b, 0 + ld hl, Data_fd7e3 + add hl, bc + add hl, bc + ld d, [hl] + inc hl + ld e, [hl] + pop bc + ld hl, wSpriteStateData2 - wSpriteStateData1 + 4 + add hl, bc + ld a, [hl] + add e + ld [hli], a + ld a, [hl] + add d + ld [hl], a + ret + +Data_fd7e3: + db 0, 1 + db 0, -1 + db -1, 0 + db 1, 0 + db -1, 1 + db 1, 1 + db -1, -1 + db 1, -1 + +Func_fd7f3: + push bc + push de + push hl + + ld bc, wOAMBuffer + 4 * 36 + ld a, [wPikaSpriteY] + ld e, a + ld a, [wPikaPicAnimDelay] + ld d, a + ld hl, Data_fd80b + call Func_fd814 + + pop hl + pop de + pop bc + ret + +Data_fd80b: + db $02 + db $0c, $00, $ff, 0 + db $0c, $08, $ff, 1 << OAM_X_FLIP + +Func_fd814: + ld a, e + add $10 + ld e, a + ld a, d + add $8 + ld d, a + ld a, [hli] +.asm_fd81d + push af + ld a, [hli] + add e + ld [bc], a + inc bc + ld a, [hli] + add d + ld [bc], a + inc bc + ld a, [hli] + ld [bc], a + inc bc + ld a, [hli] + ld [bc], a + inc bc + pop af + dec a + jr nz, .asm_fd81d + ret + +LoadPikachuShadowIntoVRAM: + ld hl, vNPCSprites2 + $7f * $10 + ld de, LedgeHoppingShadowGFX_3F + lb bc, BANK(LedgeHoppingShadowGFX_3F), (LedgeHoppingShadowGFX_3FEnd - LedgeHoppingShadowGFX_3F) / 8 + jp CopyVideoDataDoubleAlternate + +LedgeHoppingShadowGFX_3F: +INCBIN "gfx/ledge_hopping_shadow.1bpp" +LedgeHoppingShadowGFX_3FEnd: + +LoadPikachuBallIconIntoVRAM: + ld hl, vNPCSprites2 + $7e * $10 + ld de, GFX_fd86b + lb bc, BANK(GFX_fd86b), 1 + jp CopyVideoDataDoubleAlternate + +Func_fd851: + ld hl, vNPCSprites + $c * $10 + ld a, 3 +.asm_fd856 + push af + push hl + ld de, GFX_fd86b + lb bc, BANK(GFX_fd86b), 4 + call CopyVideoDataAlternate + pop hl + ld de, 4 * $10 + add hl, de + pop af + dec a + jr nz, .asm_fd856 + ret + +GFX_fd86b: +INCBIN "gfx/unknown_fd86b.2bpp" + +LoadPikachuSpriteIntoVRAM: ; fd8ab (3f:58ab) + ld de, PikachuSprite + lb bc, BANK(PikachuSprite), (SandshrewSprite - PikachuSprite) / 32 + ld hl, vNPCSprites + $c * $10 + push bc + call CopyVideoDataAlternate + ld de, PikachuSprite + $c * $10 + ld hl, vNPCSprites2 + $c * $10 + ld a, [h_0xFFFC] + and a + jr z, .load + ld de, PikachuSprite + $c * $10 + ld hl, vNPCSprites2 + $4c * $10 +.load + pop bc + call CopyVideoDataAlternate + call LoadPikachuShadowIntoVRAM + call LoadPikachuBallIconIntoVRAM + ret + +PikachuPewterPokecenterCheck: ; fd8d4 (3f:58d4) + ld a, [wCurMap] + cp PEWTER_POKECENTER + ret nz + call EnablePikachuFollowingPlayer + call StarterPikachuEmotionCommand_turnawayfromplayer + ret + +PikachuFanClubCheck: ; fd8e1 (3f:58e1) + ld a, [wCurMap] + cp POKEMON_FAN_CLUB + ret nz + call EnablePikachuFollowingPlayer + call StarterPikachuEmotionCommand_turnawayfromplayer + ret + +PikachuBillsHouseCheck: ; fd8ee (3f:58ee) + ld a, [wCurMap] + cp BILLS_HOUSE + ret nz + call EnablePikachuFollowingPlayer + ret + +Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3: ; fd8f8 (3f:58f8) + call LoadCurrentMapView + call UpdateSprites + call Delay3 + ret + +Cosine_e: ; cosine? + ld a, e + add $10 + jr asm_fd908 + +Sine_e: ; sine? + ld a, e +asm_fd908 + and $3f + cp $20 + jr nc, .asm_fd913 + call GetSine + ld a, h + ret + +.asm_fd913 + and $1f + call GetSine + ld a, h + cpl + inc a + ret + +GetSine: + ld e, a + ld a, d + ld d, 0 + ld hl, SineWave_3f + add hl, de + add hl, de + ld e, [hl] + inc hl + ld d, [hl] + ld hl, 0 +.asm_fd92b + srl a + jr nc, .asm_fd930 + add hl, de +.asm_fd930 + sla e + rl d + and a + jr nz, .asm_fd92b + ret + +SineWave_3f: + sine_wave $100 diff --git a/engine/pikachu_pcm.asm b/engine/pikachu_pcm.asm new file mode 100755 index 00000000..e0238468 --- /dev/null +++ b/engine/pikachu_pcm.asm @@ -0,0 +1,154 @@ +PlayPikachuSoundClip:: ; f0000 (3c:4000) + ld a, e + ld e, a + ld d, $0 + ld hl, PikachuCriesPointerTable + add hl, de + add hl, de + add hl, de + ld b, [hl] ; bank of pikachu cry data + inc hl + ld a, [hli] ; cry data pointer + ld h, [hl] + ld l, a + ld c, $4 +.loop + dec c + jr z, .done_delay + call DelayFrame + jr .loop + +.done_delay + di + push bc + push hl + ld a, $80 + ld [rNR52], a + ld a, $77 + ld [rNR50], a + xor a + ld [rNR30], a + ld hl, $ff30 ; wave data + ld de, wRedrawRowOrColumnSrcTiles +.saveWaveDataLoop + ld a, [hl] + ld [de], a + inc de + ld a, $ff + ld [hli], a + ld a, l + cp $40 ; end of wave data + jr nz, .saveWaveDataLoop + ld a, $80 + ld [rNR30], a + ld a, [rNR51] + or $44 + ld [rNR51], a + ld a, $ff + ld [rNR31], a + ld a, $20 + ld [rNR32], a + ld a, $ff + ld [rNR33], a + ld a, $87 + ld [rNR34], a + pop hl + pop bc + call PlayPikachuPCM + xor a + ld [wc0f3], a + ld [wc0f4], a + ld a, $80 + ld [rNR52], a + xor a + ld [rNR30], a + ld hl, $ff30 + ld de, wRedrawRowOrColumnSrcTiles +.reloadWaveDataLoop + ld a, [de] + inc de + ld [hli], a + ld a, l + cp $40 ; end of wave data + jr nz, .reloadWaveDataLoop + ld a, $80 + ld [rNR30], a + ld a, [rNR51] + and $bb + ld [rNR51], a + xor a + ld [wChannelSoundIDs+CH4], a + ld [wChannelSoundIDs+CH5], a + ld [wChannelSoundIDs+CH6], a + ld [wChannelSoundIDs+CH7], a + ld a, [H_LOADEDROMBANK] + ei + ret + +PikachuCriesPointerTable: ; f008e (3c:408e) +; format: +; db bank +; dw pointer to cry + +; bank 21 + pikacry_def PikachuCry1 ; 21:4000 + pikacry_def PikachuCry2 ; 21:491a + pikacry_def PikachuCry3 ; 21:4fdc + pikacry_def PikachuCry4 ; 21:59ee + +; bank 22 + pikacry_def PikachuCry5 ; 22:4000 + pikacry_def PikachuCry6 ; 22:5042 + pikacry_def PikachuCry7 ; 22:6254 + +; bank 23 + pikacry_def PikachuCry8 ; 23:4000 + pikacry_def PikachuCry9 ; 23:50ca + pikacry_def PikachuCry10 ; 23:5e0c + +; bank 24 + pikacry_def PikachuCry11 ; 24:4000 + pikacry_def PikachuCry12 ; 24:4722 + pikacry_def PikachuCry13 ; 24:54a4 + +; bank 25 + pikacry_def PikachuCry14 ; 25:4000 + pikacry_def PikachuCry15 ; 25:589a + +; banks 31-34, in no particular order + + pikacry_def PikachuCry16 ; 31:4000 + pikacry_def PikachuCry17 ; 34:4000 + pikacry_def PikachuCry18 ; 31:549a + pikacry_def PikachuCry19 ; 33:4000 + pikacry_def PikachuCry20 ; 32:4000 + pikacry_def PikachuCry21 ; 32:6002 + pikacry_def PikachuCry22 ; 31:63a4 + pikacry_def PikachuCry23 ; 34:4862 + pikacry_def PikachuCry24 ; 33:5632 + pikacry_def PikachuCry25 ; 34:573c + pikacry_def PikachuCry26 ; 33:725c + +; bank 35 + pikacry_def PikachuCry27 ; 35:4000 + pikacry_def PikachuCry28 ; 35:4b5a + pikacry_def PikachuCry29 ; 35:5da4 + pikacry_def PikachuCry30 ; 35:69ce + pikacry_def PikachuCry31 ; 35:6e80 + +; bank 36 + pikacry_def PikachuCry32 ; 36:4000 + pikacry_def PikachuCry33 ; 36:458a + pikacry_def PikachuCry34 ; 36:523c + +; bank 37 + pikacry_def PikachuCry35 ; 37:4000 + pikacry_def PikachuCry36 ; 37:522a + +; banks 36-38 + pikacry_def PikachuCry37 ; 38:4000 + pikacry_def PikachuCry38 ; 38:4dfa + pikacry_def PikachuCry39 ; 37:6e0c + pikacry_def PikachuCry40 ; 38:5a64 + pikacry_def PikachuCry41 ; 36:6746 + pikacry_def PikachuCry42 ; 38:6976 diff --git a/engine/pikachu_pic_animation.asm b/engine/pikachu_pic_animation.asm index 390bf39b..a49e9bc2 100755 --- a/engine/pikachu_pic_animation.asm +++ b/engine/pikachu_pic_animation.asm @@ -1,1714 +1,3 @@ -IsPlayerTalkingToPikachu:: ; fcf0c (3f:4f0c) - ld a, [wd436] - and a - ret z - ld a, [hSpriteIndexOrTextID] - cp $f - ret nz - call InitializePikachuTextID - xor a - ld [hSpriteIndexOrTextID], a - ld [wd436], a - ret - -InitializePikachuTextID: ; fcf20 (3f:4f20) - ld a, $d4 ; display - ld [hSpriteIndexOrTextID], a - xor a - ld [wPlayerMovingDirection], a - ld a, $1 - ld [wAutoTextBoxDrawingControl], a - call DisplayTextID - xor a - ld [wAutoTextBoxDrawingControl], a - ret - -DoStarterPikachuEmotions: ; fcf35 (3f:4f35) - ld e, a - ld d, $0 - add hl, de - add hl, de - ld e, [hl] - inc hl - ld d, [hl] -.loop - ld a, [de] - inc de - cp $ff - jr z, .done - ld c, a - ld b, $0 - ld hl, StarterPikachuEmotionsJumptable - add hl, bc - add hl, bc - ld a, [hli] - ld h, [hl] - ld l, a - call JumpToAddress - jr .loop -.done - ret - -StarterPikachuEmotionsJumptable: ; fcf54 (3f:4f54) - dw StarterPikachuEmotionCommand_nop ; 0 - dw StarterPikachuEmotionCommand_text ; 1 - dw StarterPikachuEmotionCommand_pcm ; 2 - dw StarterPikachuEmotionCommand_emote ; 3 - dw StarterPikachuEmotionCommand_4 ; 4 - dw StarterPikachuEmotionCommand_5 ; 5 - dw StarterPikachuEmotionCommand_subcmd ; 6 - dw StarterPikachuEmotionCommand_delay ; 7 - dw StarterPikachuEmotionCommand_nop2 ; 8 - dw StarterPikachuEmotionCommand_9 ; 9 - dw StarterPikachuEmotionCommand_nop3 ; a - -StarterPikachuEmotionCommand_nop: ; fcf6a (3f:4f6a) -StarterPikachuEmotionCommand_nop3: ; fcf6a (3f:4f6a) - ret - -StarterPikachuEmotionCommand_text: ; fcf6b (3f:4f6b) - ld a, [de] - ld l, a - inc de - ld a, [de] - ld h, a - inc de - push de - call PrintText - pop de - ret - -StarterPikachuEmotionCommand_pcm: ; fcf77 (3f:4f77) - ld a, [de] - inc de - push de - ld e, a - nop - call PlayPikachuSoundClip_ - pop de - ret - -PlayPikachuSoundClip_: ; fcf81 (3f:4f81) - cp $ff - ret z - callab PlayPikachuSoundClip - ret - -StarterPikachuEmotionCommand_emote: ; fcf8d (3f:4f8d) - ld a, [wUpdateSpritesEnabled] - push af - ld a, $ff - ld [wUpdateSpritesEnabled], a - ld a, [de] - inc de - push de - call ShowPikachuEmoteBubble - pop de - pop af - ld [wUpdateSpritesEnabled], a - ret - -ShowPikachuEmoteBubble: ; fcfa2 (3f:4fa2) - ld [wWhichEmotionBubble], a - ld a, $f - ld [wEmotionBubbleSpriteIndex], a - predef EmotionBubble - ret - -StarterPikachuEmotionCommand_4: ; fcfb0 (3f:4fb0) - ld a, [de] - inc de - ld l, a - ld a, [de] - inc de - ld h, a - push de - ld b, $3f - call Func_fd2a1 - pop de - ret - -StarterPikachuEmotionCommand_delay: ; fcfbe (3f:4fbe) - ld a, [de] - inc de - push de - ld c, a - call DelayFrames - pop de - ret - -StarterPikachuEmotionCommand_subcmd: ; fcfc7 (3f:4fc7) - ld a, [de] - inc de - push de - ld e, a - ld d, $0 - ld hl, Jumptable_fcfda - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - call JumpToAddress - pop de - ret - -Jumptable_fcfda: - dw LoadPikachuSpriteIntoVRAM - dw LoadFontTilePatterns - dw Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3 - dw WaitForTextScrollButtonPress - dw PikachuPewterPokecenterCheck - dw PikachuFanClubCheck - dw PikachuBillsHouseCheck - -StarterPikachuEmotionCommand_nop2: ; fcfe8 (3f:4fe8) - ret - -StarterPikachuEmotionCommand_9: ; fcfe9 (3f:4fe9) - push de - call Func_fcff2 - call UpdateSprites - pop de - ret - -Func_fcff2: ; fcff2 (3f:4ff2) - ld a, [wSpriteStateData1 + $9] - xor $4 - ld [wSpriteStateData1 + $f9], a - ret - -Func_fcffb: ; fcffb (3f:4ffb) -; Inexplicably empty. - rept 5 - nop - endr - ret - -Func_fd001:: ; fd001 (3f:5001) - ld a, e - jr asm_fd00f - -Func_fd004:: ; fd004 (3f:5004) - call Func_fd05e - jr c, asm_fd00f - call GetPikaPicAnimationScriptIndex - call Func_fcffb -asm_fd00f: ; fd00f (3f:500f) - ld [wExpressionNumber], a - ld hl, PikachuEmotionTable - call DoStarterPikachuEmotions - ret - -PikachuEmotionTable: ; fd019 (3f:4019) - dw PikachuEmotion0_fd115 - dw PikachuEmotion1_fd141 - dw PikachuEmotion2_fd116 - dw PikachuEmotion3_fd160 - dw PikachuEmotion4_fd136 - dw PikachuEmotion5_fd14d - dw PikachuEmotion6_fd153 - dw PikachuEmotion7_fd128 - dw PikachuEmotion8_fd147 - dw PikachuEmotion9_fd166 - dw PikachuEmotion10_fd11e - dw PikachuEmotion11_fd173 - dw PikachuEmotion12_fd17a - dw PikachuEmotion13_fd180 - dw PikachuEmotion14_fd189 - dw PikachuEmotion15_fd191 - dw PikachuEmotion16_fd197 - dw PikachuEmotion17_fd19d - dw PikachuEmotion18_fd1a3 - dw PikachuEmotion19_fd1a9 - dw PikachuEmotion20_fd1b1 - dw PikachuEmotion21_fd1b9 - dw PikachuEmotion22_fd1c1 - dw PikachuEmotion23_fd1c7 - dw PikachuEmotion24_fd1cf - dw PikachuEmotion25_fd1d7 - dw PikachuEmotion26_fd1df - dw PikachuEmotion27_fd1eb - dw PikachuEmotion28_fd1f1 - dw PikachuEmotion29_fd1f7 - dw PikachuEmotion30_fd1fc - dw PikachuEmotion31_fd20a - dw PikachuEmotion32_fd213 - dw PikachuEmotion33_fd05d - -PikachuEmotion33_fd05d: ; fd05d (3f:505d) - db $ff - -Func_fd05e: ; fd05e (3f:505e) - ld a, [wCurMap] - cp POKEMON_FAN_CLUB - jr nz, .notFanClub - ld hl, wPreventBlackout - bit 7, [hl] - ld a, $1d - jr z, .asm_fd0c9 - call CheckPikachuFollowingPlayer - ld a, $1e - jr nz, .asm_fd0c9 - jr .asm_fd096 -.notFanClub - ld a, [wCurMap] - cp PEWTER_POKECENTER - jr nz, .notPewterPokecenter - call CheckPikachuFollowingPlayer - ld a, $1a - jr nz, .asm_fd0c9 - jr .asm_fd096 -.notPewterPokecenter - callab Func_f24ae - ld a, e - cp $ff - jr nz, .asm_fd0c9 - jr .asm_fd096 -.asm_fd096 - call IsPlayerPikachuAsleepInParty - ld a, $b - jr c, .asm_fd0c9 - callab Func_fce73 ; same bank - ld a, $1c - jr c, .asm_fd0c9 - ld a, [wCurMap] - cp POKEMONTOWER_1 - jr c, .notInLavenderTower - cp POKEMONTOWER_7 + 1 - ld a, $16 - jr c, .asm_fd0c9 -.notInLavenderTower - ld a, [wd49c] - and a - jr z, .asm_fd0c7 - dec a - ld c, a - ld b, $0 - ld hl, Pointer_fd0cb - add hl, bc - ld a, [hl] - jr .asm_fd0c9 -.asm_fd0c7 - and a - ret -.asm_fd0c9 - scf - ret - -Pointer_fd0cb: - db $12, $15, $17, $18, $19 - -IsPlayerPikachuAsleepInParty:: ; fd0d0 (3f:50d0) - xor a - ld [wWhichPokemon], a -.loop - ld a, [wWhichPokemon] - ld c, a - ld b, $0 - ld hl, wPartySpecies - add hl, bc - ld a, [hl] - cp $ff - jr z, .done - cp PIKACHU - jr nz, .curMonNotStarterPikachu - callab IsThisPartymonStarterPikachu - jr nc, .curMonNotStarterPikachu - ld a, [wWhichPokemon] - ld hl, wPartyMon1Status - ld bc, wPartyMon2 - wPartyMon1 - call AddNTimes - ld a, [hl] - and SLP - jr z, .done - jr .curMonSleepingPikachu -.curMonNotStarterPikachu - ld a, [wWhichPokemon] - cp PARTY_LENGTH - 1 - jr z, .done - inc a - ld [wWhichPokemon], a - jr .loop -.curMonSleepingPikachu - scf - ret -.done - and a - ret - -PikachuEmotion0_fd115: ; fd115 (3f:5115) - db $ff - -PikachuEmotion2_fd116: ; fd116 (3f:5116) - pikaemotion_dummy2 - pikaemotion_emotebubble SMILE_BUBBLE - pikaemotion_pcm PikachuCry35 - pikaemotion_5 $2 - db $ff - -PikachuEmotion10_fd11e: ; fd11e (3f:511e) - pikaemotion_dummy2 - pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES - pikaemotion_emotebubble HEART_BUBBLE - pikaemotion_pcm PikachuCry5 - pikaemotion_5 $a - db $ff - -PikachuEmotion7_fd128: ; fd128 (3f:5128) - pikaemotion_dummy2 - pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES - pikaemotion_4 Pointer_fd224 - pikaemotion_pcm PikachuCry1 - pikaemotion_4 Pointer_fd224 - pikaemotion_5 $7 - db $ff - -PikachuEmotion4_fd136: ; fd136 (3f:5136) - pikaemotion_dummy2 - pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES - pikaemotion_4 Pointer_fd230 - pikaemotion_pcm PikachuCry29 - pikaemotion_5 $4 - db $ff - -PikachuEmotion1_fd141: ; fd141 (3f:5141) - pikaemotion_dummy2 - pikaemotion_pcm - pikaemotion_5 $1 - db $ff - -PikachuEmotion8_fd147: ; fd147 (3f:5147) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry39 - pikaemotion_5 $8 - db $ff - -PikachuEmotion5_fd14d: ; fd14d (3f:514d) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry31 - pikaemotion_5 $5 - db $ff - -PikachuEmotion6_fd153: ; fd153 (3f:5153) - pikaemotion_dummy2 - pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES - pikaemotion_pcm - pikaemotion_4 Pointer_fd21e - pikaemotion_emotebubble SKULL_BUBBLE - pikaemotion_5 $6 - db $ff - -PikachuEmotion3_fd160: ; fd160 (3f:5160) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry40 - pikaemotion_5 $3 - db $ff - -PikachuEmotion9_fd166: ; fd166 (3f:5166) - pikaemotion_dummy2 - pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES - pikaemotion_pcm PikachuCry6 - pikaemotion_4 Pointer_fd218 - pikaemotion_emotebubble SKULL_BUBBLE - pikaemotion_5 $9 - db $ff - -PikachuEmotion11_fd173: ; fd173 (3f:5173) - pikaemotion_emotebubble ZZZ_BUBBLE - pikaemotion_pcm PikachuCry37 - pikaemotion_5 $b - db $ff - -PikachuEmotion12_fd17a: ; fd17a (3f:517a) - pikaemotion_dummy2 - pikaemotion_pcm - pikaemotion_5 $c - db $ff - -PikachuEmotion13_fd180: ; fd180 (3f:5180) - pikaemotion_dummy2 - pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADEXTRAPIKASPRITES - pikaemotion_4 Pointer_fd21e - pikaemotion_5 $d - db $ff - -PikachuEmotion14_fd189: ; fd189 (3f:5189) - pikaemotion_dummy2 - pikaemotion_emotebubble BOLT_BUBBLE - pikaemotion_pcm PikachuCry10 - pikaemotion_5 $e - db $ff - -PikachuEmotion15_fd191: ; fd191 (3f:5191) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry34 - pikaemotion_5 $f - db $ff - -PikachuEmotion16_fd197: ; fd197 (3f:5197) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry33 - pikaemotion_5 $10 - db $ff - -PikachuEmotion17_fd19d: ; fd19d (3f:519d) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry13 - pikaemotion_5 $11 - db $ff - -PikachuEmotion18_fd1a3: ; fd1a3 (3f:51a3) - pikaemotion_dummy2 - pikaemotion_pcm - pikaemotion_5 $12 - db $ff - -PikachuEmotion19_fd1a9: ; fd1a9 (3f:51a9) - pikaemotion_dummy2 - pikaemotion_emotebubble HEART_BUBBLE - pikaemotion_pcm PikachuCry33 - pikaemotion_5 $13 - db $ff - -PikachuEmotion20_fd1b1: ; fd1b1 (3f:51b1) - pikaemotion_dummy2 - pikaemotion_emotebubble HEART_BUBBLE - pikaemotion_pcm PikachuCry5 - pikaemotion_5 $14 - db $ff - -PikachuEmotion21_fd1b9: ; fd1b9 (3f:51b9) - pikaemotion_dummy2 - pikaemotion_emotebubble FISH_BUBBLE - pikaemotion_pcm - pikaemotion_5 $15 - db $ff - -PikachuEmotion22_fd1c1: ; fd1c1 (3f:51c1) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry4 - pikaemotion_5 $16 - db $ff - -PikachuEmotion23_fd1c7: ; fd1c7 (3f:51c7) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry19 - pikaemotion_5 $17 - pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW - db $ff - -PikachuEmotion24_fd1cf: ; fd1cf (3f:51cf) - pikaemotion_dummy2 - pikaemotion_emotebubble EXCLAMATION_BUBBLE - pikaemotion_pcm - pikaemotion_5 $18 - db $ff - -PikachuEmotion25_fd1d7: ; fd1d7 (3f:51d7) - pikaemotion_dummy2 - pikaemotion_emotebubble BOLT_BUBBLE - pikaemotion_pcm PikachuCry35 - pikaemotion_5 $19 - db $ff - -PikachuEmotion26_fd1df: ; fd1df (3f:51df) - pikaemotion_dummy2 - pikaemotion_emotebubble ZZZ_BUBBLE - pikaemotion_pcm PikachuCry37 - pikaemotion_5 $1a - pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW - pikaemotion_subcmd PIKAEMOTION_SUBCMD_CHECKPEWTERCENTER - db $ff - -PikachuEmotion27_fd1eb: ; fd1eb (3f:51eb) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry9 - pikaemotion_5 $1b - db $ff - -PikachuEmotion28_fd1f1: ; fd1f1 (3f:51f1) - pikaemotion_dummy2 - pikaemotion_pcm PikachuCry15 - pikaemotion_5 $1c - db $ff - -PikachuEmotion29_fd1f7: ; fd1f7 (3f:51f7) - pikaemotion_pcm PikachuCry5 - pikaemotion_5 $a - db $ff - -PikachuEmotion30_fd1fc: ; fd1fc (3f:51fc) - pikaemotion_9 - pikaemotion_emotebubble HEART_BUBBLE - pikaemotion_pcm PikachuCry5 - pikaemotion_5 $14 - pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW - pikaemotion_subcmd PIKAEMOTION_SUBCMD_LOADFONT - pikaemotion_subcmd PIKAEMOTION_SUBCMD_CHECKLAVENDERTOWER - db $ff - -PikachuEmotion31_fd20a: ; fd20a (3f:520a) - pikaemotion_pcm PikachuCry19 - pikaemotion_5 $17 - pikaemotion_subcmd PIKAEMOTION_SUBCMD_SHOWMAPVIEW - pikaemotion_subcmd PIKAEMOTION_SUBCMD_CHECKBILLSHOUSE - db $ff - -PikachuEmotion32_fd213: ; fd213 (3f:5213) - pikaemotion_pcm PikachuCry26 - pikaemotion_5 $17 - db $ff - -Pointer_fd218: ; fd218 (3f:5218) - - db $00 - db $39, $01 - db $3e, $1e - db $3f - -Pointer_fd21e: ; fd21e (3f:521e) - db $00 - db $39, $00 - db $3e, $1e - db $3f - -Pointer_fd224: ; fd224 (3f:5224) - db $00 - db $3c, $07, $2f - db $3c, $07, $2f - db $3f - -Pointer_fd22c: ; fd22c (3f:522c) - db $3b, $1f, $03 - db $3f - -Pointer_fd230: ; fd230 (3f:5230) - db $00 - db $3c, $0f, $1f - db $3c, $0f, $1f - db $3f - -Pointer_fd238: ; fd238 (3f:5238) - db $00 - db $05, $07 - db $39, $00 - db $05, $07 - db $06, $07 - db $39, $00 - db $06, $07 - db $08, $07 - db $39, $00 - db $08, $07 - db $07, $07 - db $39, $00 - db $07, $07 - db $3f - -Func_fd252: ; fd252 (3f:5252) - ld a, $40 - ld [h_0xFFFC], a - call LoadPikachuSpriteIntoVRAM - call Func_fd266 - and a - jr z, .asm_fd262 - call Func_159b -.asm_fd262 - xor a - ld [h_0xFFFC], a - ret - -Func_fd266: - ld a, [wSpriteStateData2 + 15 * 16 + 4] - ld e, a - ld a, [wSpriteStateData2 + 15 * 16 + 5] - ld d, a - ld a, [wYCoord] - add 4 - cp e - jr z, .asm_fd280 - jr nc, .asm_fd27e - ld hl, Data_fd294 - ld a, 1 - ret - -.asm_fd27e - xor a - ret - -.asm_fd280 - ld a, [wXCoord] - add 4 - cp d - jr c, .asm_fd28e - ld hl, Data_fd299 - ld a, 2 - ret - -.asm_fd28e - ld hl, Data_fd29d - ld a, 3 - ret - -Data_fd294: - db $00 - db $36 - db $2b - db $34 - db $3f - -Data_fd299: - db $00 - db $36 - db $34 - db $3f - -Data_fd29d: - db $00 - db $36 - db $33 - db $3f - -Func_fd2a1:: ; fd2a1 (3f:52a1) - ld a, b - ld [wd44a], a - ld a, l - ld [wd44b], a - ld a, h - ld [wd44b + 1], a - call PikachuSwapSpriteStateData -.loop - call Func_fd2f5 - jr nc, .done - call Func_fd329 - jr .loop - -.done - call PikachuSwapSpriteStateData - call DelayFrame - ret - -PikachuSwapSpriteStateData: - ld a, [wUpdateSpritesEnabled] - push af - ld a, $ff - ld [wUpdateSpritesEnabled], a - push hl - push de - push bc - - ld hl, wSpriteStateData1 - ld de, wSpriteStateData1 + $f0 - ld c, $10 - call SwapBytes3f - - ld hl, wSpriteStateData2 - ld de, wSpriteStateData2 + $f0 - ld c, $10 - call SwapBytes3f - - pop bc - pop de - pop hl - pop af - ld [wUpdateSpritesEnabled], a - ret - -SwapBytes3f: -.loop - ld b, [hl] - ld a, [de] - ld [hli], a - ld a, b - ld [de], a - inc de - dec c - jr nz, .loop - ret - -Func_fd2f5: - call Func_157c - cp $3f - ret z - ld c, a - ld b, 0 - ld hl, Data_fd3b0 - add hl, bc - add hl, bc - add hl, bc - add hl, bc - ld a, [hli] - ld [wPikaPicAnimPointer + 1], a - ld a, [hli] - cp $80 - jr nz, .asm_fd311 - call Func_157c -.asm_fd311 - ld [wPikaPicAnimPointer], a - ld a, [hli] - ld [wPikaPicAnimCurGraphicID], a - ld a, [hli] - cp $80 - jr nz, .asm_fd320 - call Func_157c -.asm_fd320 - ld [wPikaPicAnimPointerSetupFinished], a - xor a - ld [wPikaPicAnimTimer], a - scf - ret - -Func_fd329: - xor a - ld [$d44c], a - ld [wd457], a - ld [wd458], a - ld a, [wSpriteStateData2 + 7] - push af -.asm_fd337 - ld bc, wSpriteStateData1 - ld a, [wPikaPicAnimPointer + 1] - ld hl, Jumptable_fd4ac - call Func_fd365 - ld a, [wPikaPicAnimCurGraphicID] - ld hl, Jumptable_fd65c - call Func_fd365 - call Func_fd36e - call Func_fd39d - call DelayFrame - call DelayFrame - ld hl, $d44c - bit 7, [hl] - jr z, .asm_fd337 - pop af - ld [wSpriteStateData2 + 7], a - scf - ret - -Func_fd365: - ld e, a - ld d, 0 - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] - -Func_fd36e: - ld hl, 2 - add hl, bc - ld a, [wPikaPicAnimTimer + 1] - ld [hl], a - ld a, [wPikaSpriteY] - ld d, a - ld a, [wd456] - add d - ld hl, 4 - add hl, bc - ld [hl], a - ld a, [wPikaPicAnimDelay] - ld d, a - ld a, [wPikaPicTextboxStartY] - add d - ld hl, 6 - add hl, bc - ld [hl], a - ld hl, $d44c - bit 6, [hl] - ret z - ld hl, wSpriteStateData2 + 7 - wSpriteStateData1 - add hl, bc - ld [hl], 0 - ret - -Func_fd39d: - ld hl, $d44c - bit 6, [hl] - res 6, [hl] - ld hl, wd736 - res 6, [hl] - ret z - set 6, [hl] - call Func_fd7f3 - ret - -Data_fd3b0: - db $01, $00, $00, $00 ; $00 - db $03, $80, $01, $00 ; $01 - db $04, $80, $01, $00 ; $02 - db $05, $80, $01, $00 ; $03 - db $06, $80, $01, $00 ; $04 - db $07, $80, $01, $00 ; $05 - db $08, $80, $01, $00 ; $06 - db $09, $80, $01, $00 ; $07 - db $0a, $80, $01, $00 ; $08 - db $03, $80, $06, $00 ; $09 - db $04, $80, $06, $00 ; $0a - db $05, $80, $06, $00 ; $0b - db $06, $80, $06, $00 ; $0c - db $07, $80, $06, $00 ; $0d - db $08, $80, $06, $00 ; $0e - db $09, $80, $06, $00 ; $0f - db $0a, $80, $06, $00 ; $10 - db $03, $80, $03, $80 ; $11 - db $04, $80, $03, $80 ; $12 - db $05, $80, $03, $80 ; $13 - db $06, $80, $03, $80 ; $14 - db $07, $80, $03, $80 ; $15 - db $08, $80, $03, $80 ; $16 - db $09, $80, $03, $80 ; $17 - db $0a, $80, $03, $80 ; $18 - db $03, $80, $07, $80 ; $19 - db $04, $80, $07, $80 ; $1a - db $05, $80, $07, $80 ; $1b - db $06, $80, $07, $80 ; $1c - db $0b, $27, $02, $00 ; $1d step down - db $0c, $27, $02, $00 ; $1e step up - db $0d, $27, $02, $00 ; $1f step left - db $0e, $27, $02, $00 ; $20 step right - db $0f, $27, $02, $00 ; $21 - db $10, $27, $02, $00 ; $22 - db $11, $27, $02, $00 ; $23 - db $12, $27, $02, $00 ; $24 - db $0b, $0f, $02, $00 ; $25 - db $0c, $0f, $02, $00 ; $26 - db $0d, $0f, $02, $00 ; $27 - db $0e, $0f, $02, $00 ; $28 - db $0f, $0f, $02, $00 ; $29 - db $10, $0f, $02, $00 ; $2a - db $11, $0f, $02, $00 ; $2b - db $12, $0f, $02, $00 ; $2c - db $0b, $0f, $08, $17 ; $2d - db $0c, $0f, $08, $17 ; $2e - db $0d, $0f, $08, $17 ; $2f - db $0e, $0f, $08, $17 ; $30 - db $0f, $0f, $08, $17 ; $31 - db $10, $0f, $08, $17 ; $32 - db $11, $0f, $08, $17 ; $33 - db $12, $0f, $08, $17 ; $34 - db $13, $0f, $06, $00 ; $35 look down - db $14, $0f, $06, $00 ; $36 look up - db $15, $0f, $06, $00 ; $37 look left - db $16, $0f, $06, $00 ; $38 look right - db $02, $80, $04, $00 ; $39 - db $02, $80, $05, $00 ; $3a - db $02, $80, $03, $80 ; $3b - db $02, $80, $07, $80 ; $3c - db $02, $80, $09, $80 ; $3d - db $02, $80, $06, $00 ; $3e - -Jumptable_fd4ac: - dw Func_fd4e5 - dw Func_fd4e9 - dw Func_fd504 - dw Func_fd50c - dw Func_fd511 - dw Func_fd518 - dw Func_fd52c - dw Func_fd540 - dw Func_fd553 - dw Func_fd566 - dw Func_fd579 - dw Func_fd5b1 - dw Func_fd5b5 - dw Func_fd5b9 - dw Func_fd5bd - dw Func_fd5c1 - dw Func_fd5c5 - dw Func_fd5c9 - dw Func_fd5cd - dw Func_fd5ea - dw Func_fd5ee - dw Func_fd5f2 - dw Func_fd5f6 - dw Func_fd4e5 - -Func_fd4dc: - ld a, [$d44c] - set 7, a - ld [$d44c], a - ret - -Func_fd4e5: - call Func_fd4dc - ret - -Func_fd4e9: - ld hl, 4 - add hl, bc - ld a, [hl] - ld [wPikaSpriteY], a - ld hl, 6 - add hl, bc - ld a, [hl] - ld [wPikaPicAnimDelay], a - xor a - ld [wd456], a - ld [wPikaPicTextboxStartY], a - call Func_fd4dc - ret - -Func_fd504: - call Func_fd775 - ret nz - call Func_fd4dc - ret - -Func_fd50c: - call GetObjectFacing - jr asm_fd58c - -Func_fd511: - call GetObjectFacing - xor %100 - jr asm_fd58c - -Func_fd518: - call GetObjectFacing - ld hl, Data_fd523 - call Func_fd5a0 - jr asm_fd58c - -Data_fd523: - db SPRITE_FACING_DOWN, SPRITE_FACING_RIGHT - db SPRITE_FACING_UP, SPRITE_FACING_LEFT - db SPRITE_FACING_LEFT, SPRITE_FACING_DOWN - db SPRITE_FACING_RIGHT, SPRITE_FACING_UP - db $ff - -Func_fd52c: - call GetObjectFacing - ld hl, Data_fd537 - call Func_fd5a0 - jr asm_fd58c - -Data_fd537: - db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT - db SPRITE_FACING_UP, SPRITE_FACING_RIGHT - db SPRITE_FACING_LEFT, SPRITE_FACING_UP - db SPRITE_FACING_RIGHT, SPRITE_FACING_DOWN - db $ff - -Func_fd540: - call GetObjectFacing - ld hl, Data_fd54b - call Func_fd5a0 - jr asm_fd58c - -Data_fd54b: - db SPRITE_FACING_DOWN, SPRITE_FACING_UP | $10 - db SPRITE_FACING_UP, SPRITE_FACING_LEFT | $10 - db SPRITE_FACING_LEFT, SPRITE_FACING_DOWN | $10 - db SPRITE_FACING_RIGHT, SPRITE_FACING_RIGHT | $10 - -Func_fd553: - call GetObjectFacing - ld hl, Data_fd55e - call Func_fd5a0 - jr asm_fd58c - -Data_fd55e: - db SPRITE_FACING_DOWN, SPRITE_FACING_DOWN | $10 - db SPRITE_FACING_UP, SPRITE_FACING_RIGHT | $10 - db SPRITE_FACING_LEFT, SPRITE_FACING_LEFT | $10 - db SPRITE_FACING_RIGHT, SPRITE_FACING_UP | $10 - -Func_fd566: - call GetObjectFacing - ld hl, Data_fd571 - call Func_fd5a0 - jr asm_fd58c - -Data_fd571: - db SPRITE_FACING_DOWN, SPRITE_FACING_RIGHT | $10 - db SPRITE_FACING_UP, SPRITE_FACING_DOWN | $10 - db SPRITE_FACING_LEFT, SPRITE_FACING_UP | $10 - db SPRITE_FACING_RIGHT, SPRITE_FACING_LEFT | $10 - -Func_fd579: - call GetObjectFacing - ld hl, Data_fd584 - call Func_fd5a0 - jr asm_fd58c - -Data_fd584: - db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT | $10 - db SPRITE_FACING_UP, SPRITE_FACING_UP | $10 - db SPRITE_FACING_LEFT, SPRITE_FACING_RIGHT | $10 - db SPRITE_FACING_RIGHT, SPRITE_FACING_DOWN | $10 - -asm_fd58c - rrca - rrca - and $7 - ld e, a - call Func_fd784 - ld d, a - call UpdatePikachuPosition - call Func_fd775 - ret nz - call Func_fd4dc - ret - -Func_fd5a0: - push de - ld d, a -.asm_fd5a2 - ld a, [hli] - cp d - jr z, .asm_fd5ad - inc hl - cp $ff - jr nz, .asm_fd5a2 - pop de - ret - -.asm_fd5ad - ld a, [hl] - pop de - scf - ret - -Func_fd5b1: - ld a, SPRITE_FACING_DOWN >> 2 - jr asm_fd5d1 - -Func_fd5b5: - ld a, SPRITE_FACING_UP >> 2 - jr asm_fd5d1 - -Func_fd5b9: - ld a, SPRITE_FACING_LEFT >> 2 - jr asm_fd5d1 - -Func_fd5bd: - ld a, SPRITE_FACING_RIGHT >> 2 - jr asm_fd5d1 - -Func_fd5c1: - ld e, 4 - jr asm_fd5d5 - -Func_fd5c5: - ld e, 5 - jr asm_fd5d5 - -Func_fd5c9: - ld e, 6 - jr asm_fd5d5 - -Func_fd5cd: - ld e, 7 - jr asm_fd5d5 - -asm_fd5d1 - ld e, a - call SetObjectFacing -asm_fd5d5 - call Func_fd784 - ld d, a - push de - call UpdatePikachuPosition - pop de - call Func_fd775 - ret nz - ld a, e - call Func_fd7cb - call Func_fd4dc - ret - -Func_fd5ea: - ld a, SPRITE_FACING_DOWN >> 2 - jr asm_fd5fa - -Func_fd5ee: - ld a, SPRITE_FACING_UP >> 2 - jr asm_fd5fa - -Func_fd5f2: - ld a, SPRITE_FACING_LEFT >> 2 - jr asm_fd5fa - -Func_fd5f6: - ld a, SPRITE_FACING_RIGHT >> 2 - jr asm_fd5fa - -asm_fd5fa - call SetObjectFacing - call Func_fd4dc - ret - -UpdatePikachuPosition: - push de - ld d, 0 - ld hl, Jumptable_fd60f - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - pop de - ld a, d - jp [hl] - -Jumptable_fd60f: - dw MovePikachuSpriteDown - dw MovePikachuSpriteUp - dw MovePikachuSpriteLeft - dw MovePikachuSpriteRight - dw MovePikachuSpriteDownLeft - dw MovePikachuSpriteDownRight - dw MovePikachuSpriteUpLeft - dw MovePikachuSpriteUpRight - -MovePikachuSpriteDown: - ld d, 0 - ld e, a - jr asm_fd64d - -MovePikachuSpriteUp: - ld d, 0 - cpl - inc a - ld e, a - jr asm_fd64d - -MovePikachuSpriteLeft: - cpl - inc a - ld d, a - ld e, 0 - jr asm_fd64d - -MovePikachuSpriteRight: - ld d, a - ld e, 0 - jr asm_fd64d - -MovePikachuSpriteDownLeft: - ld e, a - cpl - inc a - ld d, a - jr asm_fd64d - -MovePikachuSpriteDownRight: - ld e, a - ld d, a - jr asm_fd64d - -MovePikachuSpriteUpLeft: - cpl - inc a - ld e, a - ld d, a - jr asm_fd64d - -MovePikachuSpriteUpRight: - ld d, a - cpl - inc a - ld e, a - jr asm_fd64d - -asm_fd64d - ld a, [wPikaPicAnimDelay] - add d - ld [wPikaPicAnimDelay], a - ld a, [wPikaSpriteY] - add e - ld [wPikaSpriteY], a - ret - -Jumptable_fd65c: - dw Func_fd678 - dw Func_fd6a3 - dw Func_fd698 - dw Func_fd6f4 - dw Func_fd6ff - dw Func_fd718 - dw Func_fd68c - dw Func_fd6c6 - dw Func_fd6c0 - dw Func_fd6e2 - dw Func_fd68b - -Func_fd672: - ld hl, $d44c - set 6, [hl] - ret - -Func_fd678: - ld hl, 7 - add hl, bc - xor a - ld [hli], a - ld [hl], a - call Func_fd74a - ld d, a - call GetObjectFacing - or d - ld [wPikaPicAnimTimer + 1], a - ret - -Func_fd68b: - ret - -Func_fd68c: - call Func_fd74a - ld d, a - call Func_fd755 - or d - ld [wPikaPicAnimTimer + 1], a - ret - -Func_fd698: - call Func_fd74a - ld d, a - call GetObjectFacing - or d - ld d, a - jr asm_fd6ac - -Func_fd6a3: - call Func_fd74a - ld d, a - call Func_fd755 - or d - ld d, a -asm_fd6ac - ld hl, 8 - add hl, bc - call Func_fd78e - jr nz, .asm_fd6b6 - inc [hl] -.asm_fd6b6 - ld a, [hl] - rrca - rrca - and 3 - or d - ld [wPikaPicAnimTimer + 1], a - ret - -Func_fd6c0: - call GetObjectFacing - ld d, a - jr asm_fd6ca - -Func_fd6c6: - call Func_fd755 - ld d, a -asm_fd6ca - call Func_fd74a - or d - ld d, a - call Func_fd736 - or d - ld [wPikaPicAnimTimer + 1], a - call Func_fd79d - ld [wd456], a - and a - ret z - call Func_fd672 - ret - -Func_fd6e2: - call GetObjectFacing - ld d, a - call Func_fd74a - or d - ld [wPikaPicAnimTimer + 1], a - call Func_fd79d - ld [wd456], a - ret - -Func_fd6f4: - ld a, [wPikaPicAnimPointerSetupFinished] - and $40 - cp $40 - jr z, Func_fd6ff - jr Func_fd718 - -Func_fd6ff: - call Func_fd755 - ld d, a - call Func_fd78e - jr nz, .asm_fd710 - ld hl, Data_fd731 -.asm_fd70b - ld a, [hli] - cp d - jr nz, .asm_fd70b - ld d, [hl] -.asm_fd710 - call Func_fd74a - or d - ld [wPikaPicAnimTimer + 1], a - ret - -Func_fd718: - call Func_fd755 - ld d, a - call Func_fd78e - jr nz, .asm_fd529 - ld hl, Data_fd731End -.asm_fd524 - ld a, [hld] - cp d - jr nz, .asm_fd524 - ld d, [hl] -.asm_fd529 - call Func_fd74a - or d - ld [wPikaPicAnimTimer + 1], a - ret - -Data_fd731: - db SPRITE_FACING_DOWN - db SPRITE_FACING_LEFT - db SPRITE_FACING_UP - db SPRITE_FACING_RIGHT - db SPRITE_FACING_DOWN -Data_fd731End: - -Func_fd736: - push hl - ld hl, 7 - add hl, bc - ld a, [hl] - inc a - and $3 - ld [hli], a - jr nz, .asm_fd747 - ld a, [hl] - inc a - and $3 - ld [hl], a -.asm_fd747 - ld a, [hl] - pop hl - ret - -Func_fd74a: - push hl - ld hl, wSpriteStateData2 - wSpriteStateData1 + 14 - add hl, bc - ld a, [hl] - dec a - swap a - pop hl - ret - -Func_fd755: - push hl - ld hl, 2 - add hl, bc - ld a, [hl] - and $c - pop hl - ret - -GetObjectFacing: - push hl - ld hl, 9 - add hl, bc - ld a, [hl] - and $c - pop hl - ret - -SetObjectFacing: - push hl - ld hl, 9 - add hl, bc - add a - add a - and $c - ld [hl], a - pop hl - ret - -Func_fd775: - ld hl, wd457 - inc [hl] - ld a, [wPikaPicAnimPointer] - and $1f - inc a - cp [hl] - ret nz - ld [hl], 0 - ret - -Func_fd784: - ld a, [wPikaPicAnimPointer] - swap a - rrca - and $3 - inc a - ret - -Func_fd78e: - ld hl, wd458 - inc [hl] - ld a, [wPikaPicAnimPointerSetupFinished] - and $f - inc a - cp [hl] - ret nz - ld [hl], 0 - ret - -Func_fd79d: - call Func_fd7b2 - ld a, [wd458] - add e - ld [wd458], a - add $20 - ld e, a - push hl - push bc - call Sine_e - pop bc - pop hl - ret - -Func_fd7b2: - ld a, [wPikaPicAnimPointerSetupFinished] - and $f - inc a - ld d, a - ld a, [wPikaPicAnimPointerSetupFinished] - swap a - and $7 - ld e, a - ld a, 1 - jr z, .asm_fd7c9 -.asm_fd7c5 - add a - dec e - jr nz, .asm_fd7c5 -.asm_fd7c9 - ld e, a - ret - -Func_fd7cb: - push bc - ld c, a - ld b, 0 - ld hl, Data_fd7e3 - add hl, bc - add hl, bc - ld d, [hl] - inc hl - ld e, [hl] - pop bc - ld hl, wSpriteStateData2 - wSpriteStateData1 + 4 - add hl, bc - ld a, [hl] - add e - ld [hli], a - ld a, [hl] - add d - ld [hl], a - ret - -Data_fd7e3: - db 0, 1 - db 0, -1 - db -1, 0 - db 1, 0 - db -1, 1 - db 1, 1 - db -1, -1 - db 1, -1 - -Func_fd7f3: - push bc - push de - push hl - - ld bc, wOAMBuffer + 4 * 36 - ld a, [wPikaSpriteY] - ld e, a - ld a, [wPikaPicAnimDelay] - ld d, a - ld hl, Data_fd80b - call Func_fd814 - - pop hl - pop de - pop bc - ret - -Data_fd80b: - db $02 - db $0c, $00, $ff, 0 - db $0c, $08, $ff, 1 << OAM_X_FLIP - -Func_fd814: - ld a, e - add $10 - ld e, a - ld a, d - add $8 - ld d, a - ld a, [hli] -.asm_fd81d - push af - ld a, [hli] - add e - ld [bc], a - inc bc - ld a, [hli] - add d - ld [bc], a - inc bc - ld a, [hli] - ld [bc], a - inc bc - ld a, [hli] - ld [bc], a - inc bc - pop af - dec a - jr nz, .asm_fd81d - ret - -LoadPikachuShadowIntoVRAM: - ld hl, vNPCSprites2 + $7f * $10 - ld de, LedgeHoppingShadowGFX_3F - lb bc, BANK(LedgeHoppingShadowGFX_3F), (LedgeHoppingShadowGFX_3FEnd - LedgeHoppingShadowGFX_3F) / 8 - jp CopyVideoDataDoubleAlternate - -LedgeHoppingShadowGFX_3F: -INCBIN "gfx/ledge_hopping_shadow.1bpp" -LedgeHoppingShadowGFX_3FEnd: - -LoadPikachuBallIconIntoVRAM: - ld hl, vNPCSprites2 + $7e * $10 - ld de, GFX_fd86b - lb bc, BANK(GFX_fd86b), 1 - jp CopyVideoDataDoubleAlternate - -Func_fd851: - ld hl, vNPCSprites + $c * $10 - ld a, 3 -.asm_fd856 - push af - push hl - ld de, GFX_fd86b - lb bc, BANK(GFX_fd86b), 4 - call CopyVideoDataAlternate - pop hl - ld de, 4 * $10 - add hl, de - pop af - dec a - jr nz, .asm_fd856 - ret - -GFX_fd86b: -INCBIN "gfx/unknown_fd86b.2bpp" - -LoadPikachuSpriteIntoVRAM: ; fd8ab (3f:58ab) - ld de, PikachuSprite - lb bc, BANK(PikachuSprite), (SandshrewSprite - PikachuSprite) / 32 - ld hl, vNPCSprites + $c * $10 - push bc - call CopyVideoDataAlternate - ld de, PikachuSprite + $c * $10 - ld hl, vNPCSprites2 + $c * $10 - ld a, [h_0xFFFC] - and a - jr z, .load - ld de, PikachuSprite + $c * $10 - ld hl, vNPCSprites2 + $4c * $10 -.load - pop bc - call CopyVideoDataAlternate - call LoadPikachuShadowIntoVRAM - call LoadPikachuBallIconIntoVRAM - ret - -PikachuPewterPokecenterCheck: ; fd8d4 (3f:58d4) - ld a, [wCurMap] - cp PEWTER_POKECENTER - ret nz - call EnablePikachuFollowingPlayer - call Func_fcff2 - ret - -PikachuFanClubCheck: ; fd8e1 (3f:58e1) - ld a, [wCurMap] - cp POKEMON_FAN_CLUB - ret nz - call EnablePikachuFollowingPlayer - call Func_fcff2 - ret - -PikachuBillsHouseCheck: ; fd8ee (3f:58ee) - ld a, [wCurMap] - cp BILLS_HOUSE - ret nz - call EnablePikachuFollowingPlayer - ret - -Pikachu_LoadCurrentMapViewUpdateSpritesAndDelay3: ; fd8f8 (3f:58f8) - call LoadCurrentMapView - call UpdateSprites - call Delay3 - ret - -Cosine_e: ; cosine? - ld a, e - add $10 - jr asm_fd908 - -Sine_e: ; sine? - ld a, e -asm_fd908 - and $3f - cp $20 - jr nc, .asm_fd913 - call GetSine - ld a, h - ret - -.asm_fd913 - and $1f - call GetSine - ld a, h - cpl - inc a - ret - -GetSine: - ld e, a - ld a, d - ld d, 0 - ld hl, SineWave_3f - add hl, de - add hl, de - ld e, [hl] - inc hl - ld d, [hl] - ld hl, 0 -.asm_fd92b - srl a - jr nc, .asm_fd930 - add hl, de -.asm_fd930 - sla e - rl d - and a - jr nz, .asm_fd92b - ret - -SineWave_3f: - sine_wave $100 - GetPikaPicAnimationScriptIndex: ; fd978 (3f:5978) ld hl, PikachuMoodLookupTable ld a, [wPikachuMood] @@ -1757,7 +46,7 @@ PikaPicAnimationScriptPointerLookupTable: db $fa, $11, $11, $10, $0a, $0a db $ff, $11, $11, $13, $14, $14 -StarterPikachuEmotionCommand_5: ; fd9d0 (3f:59d0) +StarterPikachuEmotionCommand_pikapic: ; fd9d0 (3f:59d0) ld a, [H_AUTOBGTRANSFERENABLED] push af xor a @@ -1773,26 +62,26 @@ StarterPikachuEmotionCommand_5: ; fd9d0 (3f:59d0) ret Func_fd9e4: - call Func_fda2c - callab Func_720e3 - call Func_fd9ff + call PlacePikapicTextBoxBorder + callab LoadOverworldPikachuFrontpicPalettes + call ResetPikaPicAnimBuffer call LoadCurrentPikaPicAnimScriptPointer call Func_fda9a - call Func_fda2c + call PlacePikapicTextBoxBorder call RunDefaultPaletteCommand ret -Func_fd9ff: - ld hl, wPikaPicAnimPointer - ld bc, $11 +ResetPikaPicAnimBuffer: + ld hl, wCurPikaMovementData + ld bc, wCurPikaMovementDataEnd - wCurPikaMovementData xor a call FillMemory ld hl, wPikaPicAnimObjectDataBufferSize - ld bc, $21 + ld bc, wPikaPicAnimObjectDataBufferEnd - wPikaPicAnimObjectDataBufferSize xor a call FillMemory - call Func_fe15c - ld hl, $64 + call ClearPikaPicUsedGFXBuffer + ld hl, 100 ld a, l ld [wPikaPicAnimTimer], a ld a, h @@ -1803,7 +92,7 @@ Func_fd9ff: ld [wPikaPicTextboxStartY], a ret -Func_fda2c: +PlacePikapicTextBoxBorder: xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 6, 5 @@ -2832,9 +1121,9 @@ DecompressRequestPikaPicAnimGFX: ; fe128 .failed ret -Func_fe15c: - ld hl, wNPCMovementDirections - ld bc, $11 +ClearPikaPicUsedGFXBuffer: + ld hl, wPikaPicUsedGFXCount + ld bc, wPikaPicUsedGFXEnd - wPikaPicUsedGFXCount xor a call FillMemory ret @@ -2857,7 +1146,7 @@ GetPikaPicVRAMAddressForNewGFX: CheckIfThereIsRoomForPikaPicAnimGFX: push bc push hl - ld hl, wNPCMovementDirections + 1 + ld hl, wPikaPicUsedGFX ld c, 8 .loop ld a, [hl] @@ -2880,12 +1169,12 @@ CheckIfThereIsRoomForPikaPicAnimGFX: .empty ld [hl], d inc hl - ld a, [wNPCMovementDirections] + ld a, [wPikaPicUsedGFXCount] add $80 ld [hl], a - ld a, [wNPCMovementDirections] + ld a, [wPikaPicUsedGFXCount] add e - ld [wNPCMovementDirections], a + ld [wPikaPicUsedGFXCount], a cp $80 jr z, .asm_fe1a7 jr nc, .failed @@ -2905,7 +1194,7 @@ LookUpTileOffsetForCurrentPikaPicAnimGFX: push bc push hl ld b, a - ld hl, wNPCMovementDirections + 1 + ld hl, wPikaPicUsedGFX ld c, 8 .loop ld a, [hli] @@ -2995,455 +1284,4 @@ GetDMGBGPalForPikaThunderbolt: call DelayFrames ret -Data_fe242: - db 4, %11000000 - db 4, %11100100 - db 4, %11000000 - db 4, %11100100 - db 4, %11000000 - db 4, %11100100 - db 4, %11000000 - db 4, %11100100 - db 4, %11000000 - db 4, %11100100 - db 4, %11000000 - db 4, %11100100 - db 4, %11000000 - db 4, %11100100 - db 4, %11000000 - db 4, %11100100 - db 4, %11000000 - db 4, %11100100 - db 4, %11000000 - db 4, %11100100 - db $ff - -Data_fe26b: ; fe26b (3f:626b) - pikapic_loadgfx Pic_e4000 - pikapic_loadgfx Pic_e49d1 - pikapic_loadgfx PikachuSprite - pikapic_object $1, $80, $0, $0 - pikapic_object $2, $b2, $5, $5 - pikapic_object $3, $b6, $5, $5 - pikapic_waitbgmap - pikapic_cry -Data_fe286: ; fe286 (3f:6286) - pikapic_waitbgmap - pikapic_jump Data_fe286 - -Data_fe28a: ; fe28a (3f:628a) - pikapic_setduration 40 - pikapic_loadgfx Pic_e4000 - pikapic_loadgfx GFX_e40cc - pikapic_object $4, $80, $0, $0 - pikapic_object $6, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry PikachuCry3 -Data_fe2a0: ; fe2a0 (3f:62a0) - pikapic_waitbgmap - pikapic_jump Data_fe2a0 - -Data_fe2a4: ; fe2a4 (3f:62a4) - pikapic_setduration 44 - pikapic_loadgfx Pic_e411c - pikapic_loadgfx GFX_e41d2 - pikapic_object $4, $80, $0, $0 - pikapic_object $7, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe2ba: ; fe2ba (3f:62ba) - pikapic_waitbgmap - pikapic_jump Data_fe2ba - -Data_fe2be: ; fe2be (3f:62be) - pikapic_setduration 80 - pikapic_loadgfx Pic_e4272 - pikapic_loadgfx GFX_e4323 - pikapic_object $4, $80, $0, $0 - pikapic_object $8, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe2d4: ; fe2d4 (3f:62d4) - pikapic_waitbgmap - pikapic_jump Data_fe2d4 - -Data_fe2d8: ; fe2d8 (3f:62d8) - pikapic_setduration 70 - pikapic_loadgfx Pic_e4383 - pikapic_loadgfx GFX_e444b - pikapic_object $4, $80, $0, $0 - pikapic_object $9, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe2ee: ; fe2ee (3f:62ee) - pikapic_waitbgmap - pikapic_jump Data_fe2ee - -Data_fe2f2: ; fe2f2 (3f:62f2) - pikapic_setduration 32 - pikapic_loadgfx Pic_e458b - pikapic_loadgfx GFX_e463b - pikapic_object $4, $80, $0, $0 - pikapic_object $a, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe308: ; fe308 (3f:6308) - pikapic_waitbgmap - pikapic_jump Data_fe308 - -Data_fe30c: ; fe30c (3f:630c) - pikapic_setduration 50 - pikapic_loadgfx Pic_e467b - pikapic_loadgfx GFX_e472e - pikapic_object $4, $80, $0, $0 - pikapic_object $b, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry PikachuCry38 -Data_fe322: ; fe322 (3f:6322) - pikapic_waitbgmap - pikapic_jump Data_fe322 - -Data_fe326: ; fe326 (3f:6326) - pikapic_setduration 58 - pikapic_loadgfx Pic_e476e - pikapic_loadgfx GFX_e4841 - pikapic_object $4, $80, $0, $0 - pikapic_object $c, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe33c: ; fe33c (3f:633c) - pikapic_waitbgmap - pikapic_jump Data_fe33c - -Data_fe340: ; fe340 (3f:6340) - pikapic_setduration 44 - pikapic_loadgfx Pic_e49d1 - pikapic_loadgfx GFX_e4a99 - pikapic_object $4, $80, $0, $0 - pikapic_object $d, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe356: ; fe356 (3f:6356) - pikapic_waitbgmap - pikapic_jump Data_fe356 - -Data_fe35a: ; fe35a (3f:635a) - pikapic_setduration 56 - pikapic_loadgfx Pic_e4b39 - pikapic_loadgfx GFX_e4bde - pikapic_object $4, $80, $0, $0 - pikapic_object $e, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe370: ; fe370 (3f:6370) - pikapic_waitbgmap - pikapic_jump Data_fe370 - -Data_fe374: ; fe374 (3f:6374) - pikapic_setduration 56 - pikapic_loadgfx Pic_e4c3e - pikapic_loadgfx GFX_e4ce0 - pikapic_loadgfx GFX_e4e70 - pikapic_object $4, $80, $0, $0 - pikapic_object $10, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe38c: ; fe38c (3f:638c) - pikapic_waitbgmap - pikapic_jump Data_fe38c - -Data_fe390: ; fe390 (3f:6390) - pikapic_setduration 100 - pikapic_loadgfx Pic_e5000 - pikapic_loadgfx GFX_e50af - pikapic_object $4, $80, $0, $0 - pikapic_object $11, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe3a6: ; fe3a6 (3f:63a6) - pikapic_waitbgmap - pikapic_jump Data_fe3a6 - -Data_fe3aa: ; fe3aa (3f:63aa) - pikapic_setduration 50 - pikapic_loadgfx Pic_e523f - pikapic_loadgfx GFX_e52fe - pikapic_object $4, $80, $0, $0 - pikapic_object $12, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry PikachuCry25 -Data_fe3c0: ; fe3c0 (3f:63c0) - pikapic_waitbgmap - pikapic_jump Data_fe3c0 - -Data_fe3c4: ; fe3c4 (3f:63c4) - pikapic_setduration 50 - pikapic_loadgfx Pic_e548e - pikapic_loadgfx GFX_e5541 - pikapic_object $4, $80, $0, $0 - pikapic_object $13, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe3da: ; fe3da (3f:63da) - pikapic_waitbgmap - pikapic_jump Data_fe3da - -Data_fe3de: ; fe3de (3f:63de) - pikapic_setduration 40 - pikapic_loadgfx Pic_e56d1 - pikapic_loadgfx GFX_e5794 - pikapic_object $4, $80, $0, $0 - pikapic_object $14, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe3f4: ; fe3f4 (3f:63f4) - pikapic_waitbgmap - pikapic_jump Data_fe3f4 - -Data_fe3f8: ; fe3f8 (3f:63f8) - pikapic_setduration 50 - pikapic_loadgfx Pic_e5924 - pikapic_loadgfx GFX_e59ed - pikapic_object $4, $80, $0, $0 - pikapic_object $15, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe40e: ; fe40e (3f:640e) - pikapic_waitbgmap - pikapic_jump Data_fe40e - -Data_fe412: ; fe412 (3f:6412) - pikapic_setduration 32 - pikapic_loadgfx Pic_e5b7d - pikapic_loadgfx GFX_e5c4d - pikapic_object $4, $80, $0, $0 - pikapic_object $16, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe428: ; fe428 (3f:6428) - pikapic_waitbgmap - pikapic_jump Data_fe428 - -Data_fe42c: ; fe42c (3f:642c) - pikapic_setduration 100 - pikapic_loadgfx Pic_e5ddd - pikapic_loadgfx GFX_e5e90 - pikapic_object $4, $80, $0, $0 - pikapic_object $17, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe442: ; fe442 (3f:6442) - pikapic_waitbgmap - pikapic_jump Data_fe442 - -Data_fe446: ; fe446 (3f:6446) - pikapic_setduration 32 - pikapic_loadgfx GFX_e6020 - pikapic_loadgfx GFX_e61b0 - pikapic_object $5, $80, $0, $0 - pikapic_object $18, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry PikachuCry18 -Data_fe45c: ; fe45c (3f:645c) - pikapic_waitbgmap - pikapic_jump Data_fe45c - -Data_fe460: ; fe460 (3f:6460) - pikapic_setduration 44 - pikapic_loadgfx Pic_e6340 - pikapic_loadgfx GFX_e63f7 - pikapic_object $4, $80, $0, $0 - pikapic_object $19, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe476: ; fe476 (3f:6476) - pikapic_waitbgmap - pikapic_jump Data_fe476 - -Data_fe47a: ; fe47a (3f:647a) - pikapic_setduration 50 - pikapic_loadgfx Pic_e6587 - pikapic_loadgfx GFX_e6646 - pikapic_object $4, $80, $0, $0 - pikapic_object $1a, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe490: ; fe490 (3f:6490) - pikapic_waitbgmap - pikapic_jump Data_fe490 - -Data_fe494: ; fe494 (3f:6494) - pikapic_setduration 40 - pikapic_loadgfx Pic_e67d6 - pikapic_loadgfx GFX_e682f - pikapic_loadgfx GFX_e69bf - pikapic_loadgfx GFX_e6b4f - pikapic_loadgfx GFX_e6cdf - pikapic_object $4, $80, $0, $0 - pikapic_object $1b, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry PikachuCry20 -Data_fe4b0: ; fe4b0 (3f:64b0) - pikapic_waitbgmap - pikapic_jump Data_fe4b0 - -Data_fe4b4: ; fe4b4 (3f:64b4) - pikapic_setduration 40 - pikapic_loadgfx GFX_e6e6f - pikapic_loadgfx GFX_e6fff - pikapic_object $5, $80, $0, $0 - pikapic_object $1c, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe4ca: ; fe4ca (3f:64ca) - pikapic_waitbgmap - pikapic_jump Data_fe4ca - -Data_fe4ce: ; fe4ce (3f:64ce) - pikapic_setduration 70 - pikapic_loadgfx GFX_e718f - pikapic_loadgfx GFX_e731f - pikapic_object $5, $80, $0, $0 - pikapic_object $1d, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe4e4: ; fe4e4 (3f:64e4) - pikapic_waitbgmap - pikapic_jump Data_fe4e4 - -Data_fe4e8: ; fe4e8 (3f:64e8) - pikapic_setduration 60 - pikapic_loadgfx GFX_e74af - pikapic_loadgfx GFX_e763f - pikapic_object $5, $80, $0, $0 - pikapic_object $1e, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe4fe: ; fe4fe (3f:64fe) - pikapic_waitbgmap - pikapic_jump Data_fe4fe - -Data_fe502: ; fe502 (3f:6502) - pikapic_setduration 50 - pikapic_loadgfx Pic_e77cf - pikapic_loadgfx GFX_e7863 - pikapic_loadgfx GFX_e79f3 - pikapic_object $4, $80, $0, $0 - pikapic_object $1f, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry - pikapic_writebyte 13 - pikapic_waitbgmap - pikapic_thunderbolt - pikapic_ret - -Data_fe51f: ; fe51f (3f:651f) - pikapic_waitbgmap -Data_fe520: ; fe520 (3f:6520) - pikapic_setduration 100 - pikapic_loadgfx Pic_e5000 - pikapic_loadgfx GFX_e50af - pikapic_loadgfx GFX_e7b83 - pikapic_loadgfx GFX_e7d13 - pikapic_object $4, $80, $0, $0 - pikapic_object $20, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe53a: ; fe53a (3f:653a) - pikapic_waitbgmap - pikapic_jump Data_fe53a - -Data_fe53e: ; fe53e (3f:653e) - pikapic_setduration 30 - pikapic_loadgfx Pic_f0abf - pikapic_loadgfx GFX_f0b64 - pikapic_object $4, $80, $0, $0 - pikapic_object $21, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe554: ; fe554 (3f:6554) - pikapic_waitbgmap - pikapic_jump Data_fe554 - -Data_fe558: ; fe558 (3f:6558) - pikapic_setduration 64 - pikapic_loadgfx Pic_f0cf4 - pikapic_loadgfx GFX_f0d82 - pikapic_object $4, $80, $0, $0 - pikapic_object $22, $99, $0, $0 - pikapic_waitbgmap - pikapic_cry -Data_fe56e: ; fe56e (3f:656e) - pikapic_waitbgmap - pikapic_jump Data_fe56e - -PikaPicAnimGFXHeaders: -pikapicanimgfx: MACRO -\2_id:: - db \1 - dba \2 - endm - - dbbw $01, $39, $0000 - pikapicanimgfx -1, Pic_e4000 ; 01 - pikapicanimgfx 5, GFX_e40cc ; 02 - pikapicanimgfx -1, Pic_e411c ; 03 - pikapicanimgfx 10, GFX_e41d2 ; 04 - pikapicanimgfx -1, Pic_e4272 ; 05 - pikapicanimgfx 6, GFX_e4323 ; 06 - pikapicanimgfx -1, Pic_e4383 ; 07 - pikapicanimgfx 20, GFX_e444b ; 08 - pikapicanimgfx -1, Pic_e458b ; 09 - pikapicanimgfx 4, GFX_e463b ; 0a - pikapicanimgfx -1, Pic_e467b ; 0b - pikapicanimgfx 4, GFX_e472e ; 0c - pikapicanimgfx -1, Pic_e476e ; 0d - pikapicanimgfx 25, GFX_e4841 ; 0e - pikapicanimgfx -1, Pic_e49d1 ; 0f - pikapicanimgfx 10, GFX_e4a99 ; 00 - pikapicanimgfx -1, Pic_e4b39 ; 11 - pikapicanimgfx 6, GFX_e4bde ; 12 - pikapicanimgfx -1, Pic_e4c3e ; 13 - pikapicanimgfx 25, GFX_e4ce0 ; 14 - pikapicanimgfx 25, GFX_e4e70 ; 15 - pikapicanimgfx -1, Pic_e5000 ; 16 - pikapicanimgfx 25, GFX_e50af ; 17 - pikapicanimgfx -1, Pic_e523f ; 18 - pikapicanimgfx 25, GFX_e52fe ; 19 - pikapicanimgfx -1, Pic_e548e ; 1a - pikapicanimgfx 25, GFX_e5541 ; 1b - pikapicanimgfx -1, Pic_e56d1 ; 1c - pikapicanimgfx 25, GFX_e5794 ; 1d - pikapicanimgfx -1, Pic_e5924 ; 1e - pikapicanimgfx 25, GFX_e59ed ; 1f - pikapicanimgfx -1, Pic_e5b7d ; 20 - pikapicanimgfx 25, GFX_e5c4d ; 21 - pikapicanimgfx -1, Pic_e5ddd ; 22 - pikapicanimgfx 25, GFX_e5e90 ; 23 - pikapicanimgfx 25, GFX_e6020 ; 24 - pikapicanimgfx 25, GFX_e61b0 ; 25 - pikapicanimgfx -1, Pic_e6340 ; 26 - pikapicanimgfx 25, GFX_e63f7 ; 27 - pikapicanimgfx -1, Pic_e6587 ; 28 - pikapicanimgfx 25, GFX_e6646 ; 29 - pikapicanimgfx -1, Pic_e67d6 ; 2a - pikapicanimgfx 25, GFX_e682f ; 2b - pikapicanimgfx 25, GFX_e69bf ; 2c - pikapicanimgfx 25, GFX_e6b4f ; 2d - pikapicanimgfx 25, GFX_e6cdf ; 2e - pikapicanimgfx 25, GFX_e6e6f ; 2f - pikapicanimgfx 25, GFX_e6fff ; 30 - pikapicanimgfx 25, GFX_e718f ; 31 - pikapicanimgfx 25, GFX_e731f ; 32 - pikapicanimgfx 25, GFX_e74af ; 33 - pikapicanimgfx 25, GFX_e763f ; 34 - pikapicanimgfx -1, Pic_e77cf ; 35 - pikapicanimgfx 25, GFX_e7863 ; 36 - pikapicanimgfx 25, GFX_e79f3 ; 37 - pikapicanimgfx 25, GFX_e7b83 ; 38 - pikapicanimgfx 25, GFX_e7d13 ; 39 - pikapicanimgfx -1, Pic_f0abf ; 3a - pikapicanimgfx 25, GFX_f0b64 ; 3b - pikapicanimgfx -1, Pic_f0cf4 ; 3c - pikapicanimgfx 25, GFX_f0d82 ; 3d - pikapicanimgfx 24, PikachuSprite ; 3e +INCLUDE "data/pikachu_pic_animation.asm" diff --git a/engine/pikachu_status.asm b/engine/pikachu_status.asm new file mode 100755 index 00000000..17330645 --- /dev/null +++ b/engine/pikachu_status.asm @@ -0,0 +1,258 @@ +IsStarterPikachuInOurParty:: ; fcdb8 (3f:4db8) + ld hl, wPartySpecies + ld de, wPartyMon1OTID + ld bc, wPartyMonOT + push hl +.loop + pop hl + ld a, [hli] + push hl + inc a + jr z, .noPlayerPikachu + cp PIKACHU + 1 + jr nz, .curMonNotPlayerPikachu + ld h, d + ld l, e + ld a, [wPlayerID] + cp [hl] + jr nz, .curMonNotPlayerPikachu + inc hl + ld a, [wPlayerID+1] + cp [hl] + jr nz, .curMonNotPlayerPikachu + push de + push bc + ld hl, wPlayerName + ld d, $6 ; possible player length - 1 +.nameCompareLoop + dec d + jr z, .sameOT + ld a, [bc] + inc bc + cp [hl] + inc hl + jr z, .nameCompareLoop + pop bc + pop de +.curMonNotPlayerPikachu + ld hl, wPartyMon2 - wPartyMon1 + add hl, de + ld d, h + ld e, l + ld hl, NAME_LENGTH + add hl, bc + ld b, h + ld c, l + jr .loop + +.sameOT + pop bc + pop de + ld h, d + ld l, e + ld bc, -NAME_LENGTH + add hl, bc + ld a, [hli] + or [hl] + jr z, .noPlayerPikachu ; XXX how is this determined? + pop hl + scf + ret + +.noPlayerPikachu + pop hl + and a + ret + +IsThisPartymonStarterPikachu_Box:: ; fce0d (3f:4e0d) + ld hl, wBoxMon1 + ld bc, wBoxMon2 - wBoxMon1 + ld de, wBoxMonOT + jr asm_fce21 + +IsThisPartymonStarterPikachu_Party:: ; fce18 (3f:4e18) +IsThisPartymonStarterPikachu:: + ld hl, wPartyMon1 + ld bc, wPartyMon2 - wPartyMon1 + ld de, wPartyMonOT +asm_fce21: ; fce21 (3f:4e21) + ld a, [wWhichPokemon] + call AddNTimes + ld a, [hl] + cp PIKACHU + jr nz, .notPlayerPikachu + ld bc, wPartyMon1OTID - wPartyMon1 + add hl, bc + ld a, [wPlayerID] + cp [hl] + jr nz, .notPlayerPikachu + inc hl + ld a, [wPlayerID+1] + cp [hl] + jr nz, .notPlayerPikachu + ld h, d + ld l, e + ld a, [wWhichPokemon] + ld bc, NAME_LENGTH + call AddNTimes + ld de, wPlayerName + ld b, $6 +.loop + dec b + jr z, .isPlayerPikachu + ld a, [de] + inc de + cp [hl] + inc hl + jr z, .loop +.notPlayerPikachu + and a + ret + +.isPlayerPikachu + scf + ret + +UpdatePikachuMoodAfterBattle:: ; fce5a (3f:4e5a) +; because d is always $82 at this function, it serves to +; ensure Pikachu's mood is at least 130 after battle + push de + call IsStarterPikachuInOurParty + pop de + ret nc + ld a, d + cp 128 + ld a, [wPikachuMood] + jr c, .d_less_than_128 ; we never jump + cp d + jr c, .load_d_into_mood + ret + +.d_less_than_128 + cp d + ret c +.load_d_into_mood + ld a, d + ld [wPikachuMood], a + ret + +CheckPikachuFaintedOrStatused:: ; fce73 (3f:4e73) +; function to test if Pikachu is alive? + xor a + ld [wWhichPokemon], a + ld hl, wPartyCount +.loop + inc hl + ld a, [hl] + cp $ff + jr z, .dead_or_not_in_party + push hl + call IsThisPartymonStarterPikachu_Party + pop hl + jr nc, .next + ld a, [wWhichPokemon] + ld hl, wPartyMon1HP + ld bc, wPartyMon2 - wPartyMon1 + call AddNTimes + ld a, [hli] + or [hl] + ld d, a + inc hl + inc hl + ld a, [hl] ; status + and a + jr nz, .alive + jr .dead_or_not_in_party + +.next + ld a, [wWhichPokemon] + inc a + ld [wWhichPokemon], a + jr .loop + +.alive + scf + ret + +.dead_or_not_in_party + and a + ret + +IsSurfingPikachuInThePlayersParty:: ; fceab (3f:4eab) + ld hl, wPartySpecies + ld de, wPartyMon1Moves + ld bc, wPartyMonOT + push hl +.loop + pop hl + ld a, [hli] + push hl + inc a + jr z, .noSurfingPlayerPikachu + cp PIKACHU+1 + jr nz, .curMonNotSurfingPlayerPikachu + ld h, d + ld l, e + push hl + push bc + ld b, NUM_MOVES +.moveSearchLoop + ld a, [hli] + cp SURF + jr z, .foundSurfingPikachu + dec b + jr nz, .moveSearchLoop + pop bc + pop hl + jr .curMonNotSurfingPlayerPikachu + +.foundSurfingPikachu + pop bc + pop hl + inc hl + inc hl + inc hl + inc hl + ld a, [wPlayerID] + cp [hl] + jr nz, .curMonNotSurfingPlayerPikachu + inc hl + ld a, [wPlayerID+1] + cp [hl] + jr nz, .curMonNotSurfingPlayerPikachu + push de + push bc + ld hl, wPlayerName + ld d, $6 +.nameCompareLoop + dec d + jr z, .foundSurfingPlayerPikachu + ld a, [bc] + inc bc + cp [hl] + inc hl + jr z, .nameCompareLoop + pop bc + pop de +.curMonNotSurfingPlayerPikachu + ld hl, wPartyMon2 - wPartyMon1 + add hl, de + ld d, h + ld e, l + ld hl, NAME_LENGTH + add hl, bc + ld b, h + ld c, l + jr .loop + +.foundSurfingPlayerPikachu + pop bc + pop de + pop hl + scf + ret + +.noSurfingPlayerPikachu + pop hl + and a + ret diff --git a/engine/printer.asm b/engine/printer.asm index 08523bfd..d4cc8192 100755..100644 --- a/engine/printer.asm +++ b/engine/printer.asm @@ -1,831 +1,232 @@ -Func_e8783: ; e8783 (3a:4783) - ld a, 9 -Func_e8785: - push af - ld hl, wOverworldMap - lb bc, 4, 13 - xor a - call Func_e8a2e - xor a - ld [rSB], a - ld [rSC], a - ld [wUnknownSerialFlag_d49b], a - ld hl, wUnknownSerialFlag_d49a - set 0, [hl] - ld a, [wd498] - ld [$cae3], a - pop af - ld [$caf4], a - ret - -; e87a8 -Func_e87a8: ; e87a8 (3a:47a8) - ld a, [wOverworldMap] - ld e, a - ld d, 0 - ld hl, Jumptable_e87b7 - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] - -Jumptable_e87b7: - dw Func_e87fd - dw Func_e88c9 - dw Func_e88a6 - dw Func_e881f - dw Func_e8906 - dw Func_e88b4 - dw Func_e884b - dw Func_e8906 - dw Func_e88a6 - dw Func_e8864 - dw Func_e8906 - dw Func_e88a6 - dw Func_e8927 - dw Func_e87e9 - dw Func_e87f3 - dw Func_e88a6 - dw Func_e8889 - dw Func_e87f7 - dw Func_e8936 - dw Func_e8939 - -Func_e87df: - ld hl, wOverworldMap - inc [hl] - ret - -Func_e87e4: - ld hl, wOverworldMap - dec [hl] - ret - -Func_e87e9: - xor a - ld [$c971], a - ld hl, wOverworldMap - set 7, [hl] - ret - -Func_e87f3: - call Func_e87df - ret - -Func_e87f7: - ld a, $01 - ld [wOverworldMap], a - ret - -Func_e87fd: - call Func_e8981 - ld hl, Data_e8a3a - call Func_e8968 - xor a - ld [$c976], a - ld [$c977], a - ld a, [$caf4] - ld [$c6e9], a - call Func_e87df - call Func_e8949 - ld a, $01 - ld [$cae0], a - ret - -Func_e881f: - call Func_e8981 - ld hl, $c6e9 - ld a, [hl] - and a - jr z, Func_e884b - ld hl, Data_e8a46 - call Func_e8968 - call Func_e89e6 - ld a, $80 - ld [$c976], a - ld a, $02 - ld [$c977], a - call Func_e899f - call Func_e87df - call Func_e8949 - ld a, $02 - ld [$cae0], a - ret - -Func_e884b: - ld a, $06 - ld [wOverworldMap], a - ld hl, Data_e8a4c - call Func_e8968 - xor a - ld [$c976], a - ld [$c977], a - call Func_e87df - call Func_e8949 - ret - -Func_e8864: - call Func_e8981 - ld hl, Data_e8a40 - call Func_e8968 - call Func_e89cf - ld a, $04 - ld [$c976], a - ld a, $00 - ld [$c977], a - call Func_e899f - call Func_e87df - call Func_e8949 - ld a, $03 - ld [$cae0], a - ret - -Func_e8889: - call Func_e8981 - ld hl, Data_e8a3a - call Func_e8968 - xor a - ld [$c976], a - ld [$c977], a - ld a, [$caf4] - ld [$c6e9], a - call Func_e87df - call Func_e8949 - ret - -Func_e88a6: - ld hl, $c973 - inc [hl] - ld a, [hl] - cp a, $06 - ret c - xor a - ld [hl], a - call Func_e87df - ret - -Func_e88b4: - ld hl, $c973 - inc [hl] - ld a, [hl] - cp a, $06 - ret c - xor a - ld [hl], a - ld hl, $c6e9 - dec [hl] - call Func_e87e4 - call Func_e87e4 - ret - -Func_e88c9: - ld a, [wUnknownSerialFlag_d49b] - and a - ret nz - ld a, [$c970] - cp a, $ff - jr nz, .asm_e88dc - ld a, [$c971] - cp a, $ff - jr z, .asm_e88f8 -.asm_e88dc - ld a, [$c970] - cp a, $81 - jr nz, .asm_e88f8 - ld a, [$c971] - cp a, $00 - jr nz, .asm_e88f8 - ld hl, wUnknownSerialFlag_d49a - set 1, [hl] - ld a, $05 - ld [$c972], a - call Func_e87df - ret - -.asm_e88f8 - ld a, $ff - ld [$c970], a - ld [$c971], a - ld a, $0e - ld [wOverworldMap], a - ret - -Func_e8906: - ld a, [wUnknownSerialFlag_d49b] - and a - ret nz - ld a, [$c971] - and a, $f0 - jr nz, .asm_e8921 - ld a, [$c971] - and a, $01 - jr nz, .asm_e891d - call Func_e87df - ret - -.asm_e891d - call Func_e87e4 - ret - -.asm_e8921 - ld a, $12 - ld [wOverworldMap], a - ret - -Func_e8927: - ld a, [wUnknownSerialFlag_d49b] - and a - ret nz - ld a, [$c971] - and a, $f3 - ret nz - call Func_e87df - ret - -Func_e8936: - call Func_e87df -Func_e8939: - ld a, [wUnknownSerialFlag_d49b] - and a - ret nz - ld a, [$c971] - and a, $f0 - ret nz - xor a - ld [wOverworldMap], a - ret - -Func_e8949: -.asm_e8949 - ld a, [wUnknownSerialFlag_d49b] - and a - jr nz, .asm_e8949 - xor a - ld [$c974], a - ld [$c975], a - ld a, $01 - ld [wUnknownSerialFlag_d49b], a - ld a, $88 - ld [rSB], a - ld a, $01 - ld [rSC], a - ld a, $81 - ld [rSC], a - ret - -Func_e8968: - ld a, [hli] - ld [$c6ea], a - ld a, [hli] - ld [$c6eb], a - ld a, [hli] - ld [$c6ec], a - ld a, [hli] - ld [$c6ed], a - ld a, [hli] - ld [$c6ee], a - ld a, [hl] - ld [$c6ef], a - ret - -Func_e8981: - xor a - ld hl, $c6ea - ld [hli], a - ld [hli], a - ld [hli], a - ld [hl], a - ld hl, $c6ee - ld [hli], a - ld [hl], a - xor a - ld [$c976], a - ld [$c977], a - ld hl, $c6f0 - ld bc, $0280 - call Func_e8a2e - ret - -Func_e899f: - ld hl, $0000 - ld bc, $0004 - ld de, $c6ea - call Func_e89c2 - ld a, [$c976] - ld c, a - ld a, [$c977] - ld b, a - ld de, $c6f0 - call Func_e89c2 - ld a, l - ld [$c6ee], a - ld a, h - ld [$c6ef], a - ret - -Func_e89c2: -.asm_e89c2 - ld a, [de] - inc de - add l - jr nc, .asm_e89c8 - inc h -.asm_e89c8 - ld l, a - dec bc - ld a, c - or b - jr nz, .asm_e89c2 - ret - -Func_e89cf: - ld a, $01 - ld [$c6f0], a - ld a, [$cae2] - ld [$c6f1], a - ld a, $e4 - ld [$c6f2], a - ld a, [$cae3] - ld [$c6f3], a - ret - -Func_e89e6: - ld a, [$c6e9] - ld b, a - ld a, [$caf4] - sub b - ld hl, wPrinterTileBuffer - ld de, $0028 -.asm_e89f4 - and a - jr z, .asm_e89fb - add hl, de - dec a - jr .asm_e89f4 - -.asm_e89fb - ld e, l - ld d, h - ld hl, $c6f0 - ld c, $28 -.asm_e8a02 - ld a, [de] - inc de - push bc - push de - push hl - swap a - ld d, a - and a, $f0 - ld e, a - ld a, d - and a, $0f - ld d, a - and a, $08 - ld a, d - jr nz, .asm_e8a1a - or a, $90 - jr .asm_e8a1c - -.asm_e8a1a - or a, $80 -.asm_e8a1c - ld d, a - ld bc, $3a01 - call CopyVideoData - pop hl - ld de, $0010 - add hl, de - pop de - pop bc - dec c - jr nz, .asm_e8a02 - ret - -Func_e8a2e: ; e8a2e (3a:4a2e) - push de - ld e, a -.asm_e8a30 - ld [hl], e - inc hl - dec bc - ld a, c - or b - jr nz, .asm_e8a30 - ld a, e - pop de - ret - -Data_e8a3a: - db $01, $00, $00, $00, $01, $00 -Data_e8a40: - db $02, $00, $04, $00, $00, $00 -Data_e8a46: - db $04, $00, $80, $02, $00, $00 -Data_e8a4c: - db $04, $00, $00, $00, $04, $00 -Data_e8a52: - db $08, $00, $00, $00, $08, $00 -Data_e8a58: - db $0f, $00, $00, $00, $0f, $00 - -Func_e8a5e: ; e8a5e (3a:4a5e) - ld a, [wUnknownSerialFlag_d49b] - ld e, a - ld d, 0 - ld hl, Jumptable_e8a6d - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp [hl] - -Jumptable_e8a6d: - dw Func_e8ab2 - dw Func_e8ab3 - dw Func_e8abc - dw Func_e8ac6 - dw Func_e8ad0 - dw Func_e8ada - dw Func_e8ae4 - dw Func_e8b0f - dw Func_e8b19 - dw Func_e8b23 - dw Func_e8b2c - dw Func_e8b3a - dw Func_e8ab3 - dw Func_e8b44 - dw Func_e8b4d - dw Func_e8b4d - dw Func_e8b4d - dw Func_e8b44 - dw Func_e8b4d - dw Func_e8b23 - dw Func_e8b2c - dw Func_e8b6a - dw Func_e8ab3 - dw Func_e8b56 - dw Func_e8b4d - dw Func_e8b4d - dw Func_e8b4d - dw Func_e8b56 - dw Func_e8b4d - dw Func_e8b23 - dw Func_e8b2c - dw Func_e8b3a - -Func_e8aad: - ld hl, wUnknownSerialFlag_d49b - inc [hl] - ret - -Func_e8ab2: - ret - -Func_e8ab3: - ld a, $33 - call Func_e8b5f - call Func_e8aad - ret - -Func_e8abc: - ld a, [$c6ea] - call Func_e8b5f - call Func_e8aad - ret - -Func_e8ac6: - ld a, [$c6eb] - call Func_e8b5f - call Func_e8aad - ret - -Func_e8ad0: - ld a, [$c6ec] - call Func_e8b5f - call Func_e8aad - ret - -Func_e8ada: - ld a, [$c6ed] - call Func_e8b5f - call Func_e8aad - ret - -Func_e8ae4: - ld hl, $c976 - ld e, [hl] - inc hl - ld d, [hl] - ld a, e - or d - jr z, .asm_e8b0c - dec de - ld [hl], d - dec hl - ld [hl], e - ld a, [$c974] - ld e, a - ld a, [$c975] - ld d, a - ld hl, $c6f0 - add hl, de - inc de - ld a, e - ld [$c974], a - ld a, d - ld [$c975], a - ld a, [hl] - call Func_e8b5f - ret - -.asm_e8b0c - call Func_e8aad -Func_e8b0f: - ld a, [$c6ee] - call Func_e8b5f - call Func_e8aad - ret - -Func_e8b19: - ld a, [$c6ef] - call Func_e8b5f - call Func_e8aad - ret - -Func_e8b23: - ld a, $00 - call Func_e8b5f - call Func_e8aad - ret - -Func_e8b2c: - ld a, [rSB] - ld [$c970], a - ld a, $00 - call Func_e8b5f - call Func_e8aad - ret - -Func_e8b3a: - ld a, [rSB] - ld [$c971], a - xor a - ld [wUnknownSerialFlag_d49b], a - ret - -Func_e8b44: - ld a, $0f - call Func_e8b5f - call Func_e8aad - ret - -Func_e8b4d: - ld a, $00 - call Func_e8b5f - call Func_e8aad - ret - -Func_e8b56: - ld a, $08 - call Func_e8b5f - call Func_e8aad - ret - -Func_e8b5f: - ld [rSB], a - ld a, $01 - ld [rSC], a - ld a, $81 - ld [rSC], a - ret - -Func_e8b6a: - ld a, [rSB] - ld [$c971], a - xor a - ld [wUnknownSerialFlag_d49b], a - ret - -Func_e8b74: ; e8b74 (3a:4b74) - ld a, [$cfca] + const_def + const PRINTER_STATUS_BLANK + const PRINTER_STATUS_CHECKING_LINK + const PRINTER_STATUS_TRANSMITTING + const PRINTER_STATUS_PRINTING + const PRINTER_ERROR_1 + const PRINTER_ERROR_2 + const PRINTER_ERROR_3 + const PRINTER_ERROR_4 + const PRINTER_ERROR_WRONG_DEVICE + +INCLUDE "engine/printer/serial.asm" + +PrintPokedexEntry: ; e8b74 (3a:4b74) + ld a, [wUpdateSpritesEnabled] push af xor a - ld [$cfca], a - ld [$ffdb], a - call Func_e8f24 + ld [wUpdateSpritesEnabled], a + ld [hCanceledPrinting], a + call Printer_PlayPrinterMusic ld a, [rIE] push af xor a ld [rIF], a - ld a, $09 + ld a, $9 ld [rIE], a xor a - ld [$ffba], a - call Func_e8c30 - call Func_e8785 - ld a, [$caf9] + ld [H_AUTOBGTRANSFERENABLED], a + call Printer_GetDexEntryRegisters + call Printer_StartTransmission + ld a, [wPrinterPokedexMonIsOwned] and a - jr z, .asm_e8b9e - ld a, $10 - jr .asm_e8ba0 - -.asm_e8b9e - ld a, $13 -.asm_e8ba0 - ld [$cae2], a - call Func_e8efc + jr z, .not_caught + ld a, 16 + jr .got_size + +.not_caught + ld a, 19 +.got_size + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer call ClearScreen - callab Func_401c2 - callab Func_4027c - ld a, $01 - ld [$ffba], a - call Func_e8c0c - jr c, .asm_e8bf4 - ld a, [$caf9] + callab Pokedex_DrawInterface + callab Pokedex_PlacePokemonList + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a + call .TryPrintPage + jr c, .finish_printing + ld a, [wPrinterPokedexMonIsOwned] and a - jr z, .asm_e8bf4 + jr z, .finish_printing xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - ld c, $0c + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a + ld c, $c call DelayFrames call SaveScreenTilesToBuffer1 xor a - ld [$ffba], a - call Func_e8c50 - ld a, $07 - call Func_e8785 - ld a, $03 - ld [$cae2], a - call Func_e8efc + ld [H_AUTOBGTRANSFERENABLED], a + call Printer_PrepareDexEntryForPrinting + ld a, $7 + call Printer_StartTransmission + ld a, $3 + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer call LoadScreenTilesFromBuffer1 - ld a, $01 - ld [$ffba], a - call Func_e8c0c -.asm_e8bf4 + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a + call .TryPrintPage +.finish_printing xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a xor a ld [rIF], a pop af ld [rIE], a - call Func_0f3d - call Func_e8f3b + call ReloadMapAfterPrinter + call Printer_PlayMapMusic pop af - ld [$cfca], a + ld [wUpdateSpritesEnabled], a ret -Func_e8c0c: - call Func_e8f16 -.asm_e8c0f +.TryPrintPage: + call Printer_ResetJoypadHRAM +.print_loop call JoypadLowSensitivity - call Func_e8eca - jr c, .asm_e8c2e - ld a, [$c6e8] + call Printer_CheckPressingB + jr c, .pressed_b + ld a, [wPrinterSendState] bit 7, a - jr nz, .asm_e8c2c - call Func_e87a8 - call Func_e8f51 - call Func_e8f82 + jr nz, .completed + call PrinterTransmissionJumptable + call GBPrinter_CheckForErrors + call GBPrinter_UpdateStatusMessage call DelayFrame - jr .asm_e8c0f + jr .print_loop -.asm_e8c2c +.completed and a ret -.asm_e8c2e +.pressed_b scf ret -Func_e8c30: - callab Func_4039c +Printer_GetDexEntryRegisters: + callab DrawDexEntryOnScreen ld a, l - ld [$caf5], a + ld [wPrinterPokedexEntryTextPointer], a ld a, h - ld [$caf6], a - ld a, $00 - rla - ld [$caf9], a + ld [wPrinterPokedexEntryTextPointer + 1], a + ld a, $0 + rla ; copy carry flag state to bit 0 + ld [wPrinterPokedexMonIsOwned], a and a - jr z, .asm_e8c4d - ld a, $05 - jr .asm_e8c4f + jr z, .not_caught + ld a, $5 + jr .got_num_rows -.asm_e8c4d - ld a, $09 -.asm_e8c4f +.not_caught + ld a, $9 +.got_num_rows ret -Func_e8c50: +Printer_PrepareDexEntryForPrinting: call ClearScreen - callab Func_404bc + callab Pokedex_PrepareDexEntryForPrinting ret -Func_e8c5c: +PrintSurfingMinigameHighScore: xor a - ld [$ffdb], a - call Func_e8f24 - call Func_e910a + ld [hCanceledPrinting], a + call Printer_PlayPrinterMusic + call Printer_PrepareSurfingMinigameHighScoreTileMap ld a, [rIE] push af xor a ld [rIF], a - ld a, $09 + ld a, $9 ld [rIE], a - call Func_e8783 + call StartTransmission_Send9Rows ld a, $13 - ld [$cae2], a - call Func_e8efc - call Func_e8f16 -.asm_e8c7d + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer + call Printer_ResetJoypadHRAM +.loop call JoypadLowSensitivity - call Func_e8eca - jr c, .asm_e8c9a - ld a, [$c6e8] + call Printer_CheckPressingB + jr c, .quit + ld a, [wPrinterSendState] bit 7, a - jr nz, .asm_e8c9a - call Func_e87a8 - call Func_e8f51 - call Func_e8f82 + jr nz, .quit + call PrinterTransmissionJumptable + call GBPrinter_CheckForErrors + call GBPrinter_UpdateStatusMessage call DelayFrame - jr .asm_e8c7d + jr .loop -.asm_e8c9a +.quit xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - call Func_e8f09 + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a + call Printer_CopyTileMapFromPrinterTileBuffer xor a ld [rIF], a pop af ld [rIE], a - call Func_0f3d - call Func_e8f3b + call ReloadMapAfterPrinter + call Printer_PlayMapMusic ret -Func_e8cb1: +PrintDiploma: xor a - ld [$ffdb], a - call Func_e8f24 + ld [hCanceledPrinting], a + call Printer_PlayPrinterMusic call _DisplayDiploma ld a, [rIE] push af xor a ld [rIF], a - ld a, $09 + ld a, $9 ld [rIE], a - call Func_e8783 + call StartTransmission_Send9Rows ld a, $10 - ld [$cae2], a - call Func_e8efc + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer call Func_e8d11 jr c, .asm_e8cfa xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - ld c, $0c + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a + ld c, $c call DelayFrames call SaveScreenTilesToBuffer1 xor a - ld [$ffba], a + ld [H_AUTOBGTRANSFERENABLED], a call Func_e9ad3 - call Func_e8783 - ld a, $03 - ld [$cae2], a - call Func_e8efc + call StartTransmission_Send9Rows + ld a, $3 + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer call LoadScreenTilesFromBuffer1 call Func_e8d11 .asm_e8cfa xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - call Func_e8f09 + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a + call Printer_CopyTileMapFromPrinterTileBuffer xor a ld [rIF], a pop af ld [rIE], a - call Func_0f3d - call Func_e8f3b + call ReloadMapAfterPrinter + call Printer_PlayMapMusic ret Func_e8d11: - call Func_e8f16 + call Printer_ResetJoypadHRAM .asm_e8d14 call JoypadLowSensitivity - call Func_e8eca + call Printer_CheckPressingB jr c, .asm_e8d33 - ld a, [$c6e8] + ld a, [wPrinterSendState] bit 7, a jr nz, .asm_e8d31 - call Func_e87a8 - call Func_e8f51 - call Func_e8f82 + call PrinterTransmissionJumptable + call GBPrinter_CheckForErrors + call GBPrinter_UpdateStatusMessage call DelayFrame jr .asm_e8d14 @@ -837,9 +238,7 @@ Func_e8d11: scf ret - - -Func_e8d35:: ; e8d35 (3a:4e79) +PrintPCBox:: ; e8d35 (3a:4e79) ld a, [wBoxDataStart] and a jp z, Func_e8df4 @@ -847,79 +246,79 @@ Func_e8d35:: ; e8d35 (3a:4e79) push af xor a ld [wUpdateSpritesEnabled], a - ld [hItemCounter], a - call Func_e8f24 + ld [hCanceledPrinting], a + call Printer_PlayPrinterMusic ld a, [rIE] push af xor a ld [rIF], a - ld a, $09 + ld a, $9 ld [rIE], a call SaveScreenTilesToBuffer1 xor a ld [H_AUTOBGTRANSFERENABLED], a - call Func_e988a - call Func_e8783 + call PrintPCBox_DrawPage1 + call StartTransmission_Send9Rows ld a, $10 - ld [$cae2], a - call Func_e8efc + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer call LoadScreenTilesFromBuffer1 call Func_e8dfb jr c, .asm_e8ddc xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a ld c, 12 call DelayFrames xor a ld [H_AUTOBGTRANSFERENABLED], a - call Func_e98ec - call Func_e8783 - ld a, $00 - ld [$cae2], a - call Func_e8efc + call PrintPCBox_DrawPage2 + call StartTransmission_Send9Rows + ld a, $0 + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer call LoadScreenTilesFromBuffer1 call Func_e8dfb jr c, .asm_e8ddc xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a ld c, 12 call DelayFrames xor a ld [H_AUTOBGTRANSFERENABLED], a - call Func_e9907 - call Func_e8783 - ld a, $00 - ld [$cae2], a - call Func_e8efc + call PrintPCBox_DrawPage3 + call StartTransmission_Send9Rows + ld a, $0 + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer call LoadScreenTilesFromBuffer1 call Func_e8dfb jr c, .asm_e8ddc xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a ld c, 12 call DelayFrames xor a ld [H_AUTOBGTRANSFERENABLED], a - call Func_e9922 - call Func_e8783 - ld a, $03 - ld [$cae2], a - call Func_e8efc + call PrintPCBox_DrawPage4 + call StartTransmission_Send9Rows + ld a, $3 + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer call LoadScreenTilesFromBuffer1 call Func_e8dfb .asm_e8ddc xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a xor a ld [rIF], a pop af ld [rIE], a - call Func_0f3d - call Func_e8f3b + call ReloadMapAfterPrinter + call Printer_PlayMapMusic pop af ld [wUpdateSpritesEnabled], a ret @@ -930,17 +329,17 @@ Func_e8df4: ; e8df4 ret Func_e8dfb: ; e8dfb - call Func_e8f16 + call Printer_ResetJoypadHRAM .asm_e8dfe call JoypadLowSensitivity - call Func_e8eca + call Printer_CheckPressingB jr c, .asm_e8e1d - ld a, [wOverworldMap] + ld a, [wPrinterSendState] bit 7, a jr nz, .asm_e8e1b - call Func_e87a8 - call Func_e8f51 - call Func_e8f82 + call PrinterTransmissionJumptable + call GBPrinter_CheckForErrors + call GBPrinter_UpdateStatusMessage call DelayFrame jr .asm_e8dfe @@ -956,46 +355,46 @@ String_e8e1f: ; e8e1f TX_FAR _NoPokemonText db "@" -Func_e8e24: ; e8e24 +PrintFanClubPortrait: ; e8e24 xor a - ld [hItemCounter], a - call Func_e8f24 + ld [hCanceledPrinting], a + call Printer_PlayPrinterMusic call Func_ea3ea ld a, [rIE] push af xor a ld [rIF], a - ld a, $09 + ld a, $9 ld [rIE], a - call Func_e8783 + call StartTransmission_Send9Rows ld a, $13 - ld [$cae2], a - call Func_e8efc - call Func_e8f16 + ld [wcae2], a + call Printer_CopyTileMapToPrinterTileBuffer + call Printer_ResetJoypadHRAM .asm_e8e45 call JoypadLowSensitivity - call Func_e8eca + call Printer_CheckPressingB jr c, .asm_e8e62 - ld a, [wOverworldMap] + ld a, [wPrinterSendState] bit 7, a jr nz, .asm_e8e62 - call Func_e87a8 - call Func_e8f51 - call Func_e8f82 + call PrinterTransmissionJumptable + call GBPrinter_CheckForErrors + call GBPrinter_UpdateStatusMessage call DelayFrame jr .asm_e8e45 .asm_e8e62 xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - call Func_e8f09 + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a + call Printer_CopyTileMapFromPrinterTileBuffer xor a ld [rIF], a pop af ld [rIE], a - call Func_0f3d - call Func_e8f3b + call ReloadMapAfterPrinter + call Printer_PlayMapMusic ret Func_e8e79: ; e8e79 (3a:4e79) @@ -1008,30 +407,30 @@ Func_e8e79: ; e8e79 (3a:4e79) push af xor a ld [rIF], a - ld a, $09 + ld a, $9 ld [rIE], a - call Func_e8783 + call StartTransmission_Send9Rows ld a, $13 - ld [$cae2], a + ld [wcae2], a ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a - call Func_e8efc + call Printer_CopyTileMapToPrinterTileBuffer call Func_ea573 -.asm_e8e9c - ld a, [wOverworldMap] +.loop + ld a, [wPrinterSendState] bit 7, a - jr nz, .asm_e8eae + jr nz, .quit call Func_ea5d1 call Func_ea5b7 call DelayFrame - jr .asm_e8e9c + jr .loop -.asm_e8eae +.quit xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a + ld [wPrinterConnectionOpen], a + ld [wPrinterOpcode], a ld hl, wOAMBuffer + 32 * 4 - ld bc, $0020 + ld bc, 8 * 4 xor a call FillMemory xor a @@ -1044,54 +443,54 @@ Func_e8e79: ; e8e79 (3a:4e79) pop af ret -Func_e8eca: ; e8eca (3a:4eca) +Printer_CheckPressingB: ; e8eca (3a:4eca) ld a, [hJoyHeld] and B_BUTTON - jr nz, .asm_e8ed2 + jr nz, .quit and a ret -.asm_e8ed2 - ld a, [wOverworldMap] - cp $0c - jr nz, .asm_e8ef6 -.asm_e8ed9 - ld a, [wUnknownSerialFlag_d49b] +.quit + ld a, [wPrinterSendState] + cp $c + jr nz, .already_done +.wait_current_task + ld a, [wPrinterOpcode] and a - jr nz, .asm_e8ed9 + jr nz, .wait_current_task ld a, $16 - ld [wUnknownSerialFlag_d49b], a + ld [wPrinterOpcode], a ld a, $88 ld [rSB], a - ld a, $01 + ld a, $1 ld [rSC], a ld a, $81 ld [rSC], a -.asm_e8ef0 - ld a, [wUnknownSerialFlag_d49b] +.wait_send_cancel + ld a, [wPrinterOpcode] and a - jr nz, .asm_e8ef0 -.asm_e8ef6 - ld a, $01 - ld [hItemCounter], a + jr nz, .wait_send_cancel +.already_done + ld a, $1 + ld [hCanceledPrinting], a scf ret -Func_e8efc: ; e8efc (3a:4efc) +Printer_CopyTileMapToPrinterTileBuffer: ; e8efc (3a:4efc) coord hl, 0, 0 coord de, 0, 0, wPrinterTileBuffer ld bc, SCREEN_HEIGHT * SCREEN_WIDTH call CopyData ret -Func_e8f09: ; e8f09 (3a:4f09) +Printer_CopyTileMapFromPrinterTileBuffer: ; e8f09 (3a:4f09) coord hl, 0, 0, wPrinterTileBuffer coord de, 0, 0 ld bc, SCREEN_HEIGHT * SCREEN_WIDTH call CopyData ret -Func_e8f16: ; e8f16 (3a:4f16) +Printer_ResetJoypadHRAM: ; e8f16 (3a:4f16) xor a ld [hJoyLast], a ld [hJoyReleased], a @@ -1101,8 +500,8 @@ Func_e8f16: ; e8f16 (3a:4f16) ld [hJoy6], a ret -Func_e8f24: ; e8f24 (3a:4f24) - call Func_e8f42 +Printer_PlayPrinterMusic: ; e8f24 (3a:4f24) + call Printer_FadeOutMusicAndWait ld a, [wAudioROMBank] ld [wAudioSavedROMBank], a ld a, BANK(Music_GBPrinter) @@ -1112,58 +511,59 @@ Func_e8f24: ; e8f24 (3a:4f24) call PlaySound ret -Func_e8f3b: ; e8f3b (3a:4f3b) - call Func_e8f42 +Printer_PlayMapMusic: ; e8f3b (3a:4f3b) + call Printer_FadeOutMusicAndWait call PlayDefaultMusic ret -Func_e8f42: ; e8f42 (3a:4f42) +Printer_FadeOutMusicAndWait: ; e8f42 (3a:4f42) ld a, $4 ld [wAudioFadeOutControl], a call StopAllMusic -.asm_e8f4a +.wait_music_stop ld a, [wAudioFadeOutControl] and a - jr nz, .asm_e8f4a + jr nz, .wait_music_stop ret -Func_e8f51: ; e8f51 (3a:4f51) - ld a, [$c970] +GBPrinter_CheckForErrors: ; e8f51 (3a:4f51) + ld a, [wPrinterHandshake] cp $81 - jr z, .asm_e8f62 - ld a, [$c971] + jr z, .check_other_errors + ld a, [wPrinterStatusFlags] cp $ff - jr z, .asm_e8f7c + jr z, .error2 xor a - jr .asm_e8f7e + jr .load_status -.asm_e8f62 - ld a, [$c971] - and $e0 +.check_other_errors + ld a, [wPrinterStatusFlags] + and %11100000 ret z bit 7, a - jr nz, .asm_e8f78 + jr nz, .error1 bit 6, a - jr nz, .asm_e8f74 - ld a, 6 - jr .asm_e8f7e - -.asm_e8f74 - ld a, 7 - jr .asm_e8f7e - -.asm_e8f78 - ld a, 4 - jr .asm_e8f7e - -.asm_e8f7c - ld a, 5 -.asm_e8f7e - ld [wcae0], a + jr nz, .error4 + ; error 3 + ld a, PRINTER_ERROR_3 + jr .load_status + +.error4 + ld a, PRINTER_ERROR_4 + jr .load_status + +.error1 + ld a, PRINTER_ERROR_1 + jr .load_status + +.error2 + ld a, PRINTER_ERROR_2 +.load_status + ld [wPrinterStatusIndicator], a ret -Func_e8f82: - ld a, [wcae0] +GBPrinter_UpdateStatusMessage: + ld a, [wPrinterStatusIndicator] and a ret z push af @@ -1175,7 +575,7 @@ Func_e8f82: pop af ld e, a ld d, $0 - ld hl, Table_e8fca + ld hl, .PrinterStatusMessages add hl, de add hl, de ld e, [hl] @@ -1184,64 +584,64 @@ Func_e8f82: coord hl, 1, 7 call PlaceString coord hl, 2, 15 - ld de, String_e8fb8 + ld de, .PressBToCancel call PlaceString ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a xor a - ld [wcae0], a + ld [wPrinterStatusIndicator], a ret -String_e8fb8: +.PressBToCancel: db "Press B to Cancel@" -Table_e8fca: - dw String_e8fdc - dw String_e8fdd - dw String_e8ff0 - dw String_e9003 - dw String_e9014 - dw String_e9049 - dw String_e907e - dw String_e90b3 - dw String_e90e8 - -String_e8fdc: +.PrinterStatusMessages: + dw .Blank + dw .CheckingLink + dw .Transmitting + dw .Printing + dw .Error1 + dw .Error2 + dw .Error3 + dw .Error4 + dw .WrongDevice + +.Blank: db "@" -String_e8fdd: +.CheckingLink: db "" next " CHECKING LINK...@" -String_e8ff0: +.Transmitting: db "" next " TRANSMITTING...@" -String_e9003: +.Printing: db "" next " PRINTING...@" -String_e9014: +.Error1: db " Printer Error 1" next "" next "Check the Game Boy" next "Printer Manual.@" -String_e9049: +.Error2: db " Printer Error 2" next "" next "Check the Game Boy" next "Printer Manual.@" -String_e907e: +.Error3: db " Printer Error 3" next "" next "Check the Game Boy" next "Printer Manual.@" -String_e90b3: +.Error4: db " Printer Error 4" next "" next "Check the Game Boy" next "Printer Manual.@" -String_e90e8: +.WrongDevice: db "This is not the" next "Game Boy Printer!@" -Func_e910a: +Printer_PrepareSurfingMinigameHighScoreTileMap: call GBPalWhiteOutWithDelay3 call ClearScreen ld de, SurfingPikachu2Graphics @@ -1249,14 +649,14 @@ Func_e910a: lb bc, BANK(SurfingPikachu2Graphics), (SurfingPikachu2GraphicsEnd - SurfingPikachu2Graphics) / $10 call CopyVideoData coord hl, 0, 0 - call Func_e91a9 + call .PlaceRowAlternatingTiles coord hl, 0, 17 - call Func_e91a9 + call .PlaceRowAlternatingTiles coord hl, 0, 0 - call Func_e91b5 + call .PlaceColumnAlternatingTiles coord hl, 19, 0 - call Func_e91b5 - ld a, $04 + call .PlaceColumnAlternatingTiles + ld a, $4 coord hl, 0, 0 ld [hl], a coord hl, 0, 17 @@ -1265,41 +665,41 @@ Func_e910a: ld [hl], a coord hl, 19, 17 ld [hl], a - ld de, Data_e91c4 + ld de, .Tilemap1 coord hl, 10, 8 lb bc, 3, 8 - call Func_e925d - ld de, Data_e91dc + call Diploma_Surfing_CopyBox + ld de, .Tilemap2 coord hl, 2, 11 lb bc, 6, 16 - call Func_e925d - ld de, String_e923c + call Diploma_Surfing_CopyBox + ld de, .PikachusBeachString coord hl, 3, 2 call PlaceString - ld de, String_e924b + ld de, .HiScoreString coord hl, 9, 4 call PlaceString - ld de, String_e9256 + ld de, .PointsString coord hl, 12, 6 call PlaceString ld de, wPlayerName ld hl, wPlayerName ld bc, 0 -.asm_e9182 +.find_end_of_name ld a, [hli] inc c cp "@" - jr nz, .asm_e9182 + jr nz, .find_end_of_name ld a, 8 sub c - jr nc, .asm_e918e + jr nc, .got_name_length xor a -.asm_e918e +.got_name_length ld c, a coord hl, 2, 4 add hl, bc call PlaceString - call Func_e926f + call CopySurfingMinigameScore ld b, 8 call RunPaletteCommand ld a, $1 @@ -1308,35 +708,35 @@ Func_e910a: call GBPalNormal ret -Func_e91a9: +.PlaceRowAlternatingTiles: ld c, SCREEN_WIDTH / 2 -.asm_e91ab - ld [hl], $00 +.row_loop + ld [hl], $0 inc hl - ld [hl], $01 + ld [hl], $1 inc hl dec c - jr nz, .asm_e91ab + jr nz, .row_loop ret -Func_e91b5: +.PlaceColumnAlternatingTiles: ld c, SCREEN_HEIGHT / 2 ld de, SCREEN_WIDTH -.asm_e91ba - ld [hl], $02 +.col_loop + ld [hl], $2 add hl, de - ld [hl], $03 + ld [hl], $3 add hl, de dec c - jr nz, .asm_e91ba + jr nz, .col_loop ret -Data_e91c4: + +.Tilemap1: db $7f, $7f, $10, $11, $12, $13, $14, $15 db $0f, $3c, $3d, $3e, $20, $21, $30, $31 db $4c, $4d, $4e, $50, $34, $1a, $51, $2d - -Data_e91dc: +.Tilemap2: db $7f, $7f, $7f, $7f, $7f, $7f, $16, $17, $18, $19, $7f, $1b, $1c, $1d, $1e, $1f db $7f, $7f, $22, $23, $24, $25, $26, $27, $28, $29, $2a, $2b, $2c, $7f, $2e, $2f db $7f, $7f, $32, $33, $33, $35, $36, $37, $38, $39, $3a, $3b, $7f, $7f, $7f, $3f @@ -1344,39 +744,38 @@ Data_e91dc: db $52, $52, $52, $53, $54, $55, $56, $57, $58, $59, $5a, $5b, $5c, $5d, $5d, $5e db $7f, $7f, $7f, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $7f, $7f, $7f - -String_e923c: +.PikachusBeachString: db "Pikachu's Beach@" -String_e924b: +.HiScoreString: db "'s Hi-Score@" -String_e9256: +.PointsString: db "Points@" -Func_e925d: -.asm_e925d +Diploma_Surfing_CopyBox: +.y push bc push hl -.asm_e925f +.x ld a, [de] inc de ld [hli], a dec c - jr nz, .asm_e925f + jr nz, .x pop hl ld bc, SCREEN_WIDTH add hl, bc pop bc dec b - jr nz, .asm_e925d + jr nz, .y ret -Func_e926f: - ld de, wd496 +CopySurfingMinigameScore: + ld de, wSurfingMinigameHiScore + 1 coord hl, 7, 6 ld a, [de] - call Func_e927a + call .BCDConvertScore ld a, [de] -Func_e927a: +.BCDConvertScore: ld c, a swap a and $f @@ -1392,80 +791,79 @@ Func_e927a: SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" SurfingPikachu2GraphicsEnd: -Func_e988a: +PrintPCBox_DrawPage1: xor a ld [wBoxNumString], a call ClearScreen - call Func_e99de + call PrintPCBox_PlaceHorizontalLines coord hl, 0, 0 ld bc, 11 * SCREEN_WIDTH ld a, " " call FillMemory - call Func_e99b9 - call Func_e99a7 + call PrintPCBox_DrawLeftAndRightBorders + call PrintPCBox_DrawTopBorder coord hl, 4, 4 - ld de, String_e98db + ld de, .PokemonListString call PlaceString coord hl, 7, 6 - ld de, String_e98e8 + ld de, .BoxString call PlaceString coord hl, 11, 6 ld a, [wCurrentBoxNum] and $7f cp 9 - jr c, .asm_e98cc + jr c, .less_than_9 sub 9 ld [hl], "1" inc hl add "0" - jr .asm_e98ce + jr .placed_box_number -.asm_e98cc +.less_than_9 add "1" -.asm_e98ce +.placed_box_number ld [hl], a coord hl, 4, 9 ld de, wBoxSpecies - ld c, $03 - call Func_e994e + ld c, $3 + call PrintPCBox_PlaceBoxMonInfo ret +.PokemonListString: db "POKéMON LIST@" +.BoxString: db "BOX@" -String_e98db: db "POKéMON LIST@" -String_e98e8: db "BOX@" - -Func_e98ec: +PrintPCBox_DrawPage2: call ClearScreen - call Func_e99de - call Func_e99b9 + call PrintPCBox_PlaceHorizontalLines + call PrintPCBox_DrawLeftAndRightBorders ld a, [wBoxDataStart] cp 4 ret c coord hl, 4, 0 ld de, wBoxSpecies + 3 ld c, 6 - call Func_e994e + call PrintPCBox_PlaceBoxMonInfo ret -Func_e9907: +PrintPCBox_DrawPage3: call ClearScreen - call Func_e99de - call Func_e99b9 + call PrintPCBox_PlaceHorizontalLines + call PrintPCBox_DrawLeftAndRightBorders ld a, [wBoxDataStart] cp 10 ret c coord hl, 4, 0 ld de, wBoxSpecies + 9 ld c, 6 - call Func_e994e + call PrintPCBox_PlaceBoxMonInfo ret -Func_e9922: +PrintPCBox_DrawPage4: call ClearScreen - call Func_e99de - call Func_e99b9 + call PrintPCBox_PlaceHorizontalLines + call PrintPCBox_DrawLeftAndRightBorders coord hl, 0, 15 - call Func_e99cf + call PrintPCBox_DrawBottomBorderAtHL coord hl, 0, 16 ld bc, 2 * SCREEN_WIDTH ld a, " " @@ -1476,18 +874,18 @@ Func_e9922: coord hl, 4, 0 ld de, wBoxSpecies + 15 ld c, 5 - call Func_e994e + call PrintPCBox_PlaceBoxMonInfo ret -Func_e994e: -.asm_e994e +PrintPCBox_PlaceBoxMonInfo: +.loop ld a, c and a - jr z, .asm_e99a6 + jr z, .done dec c ld a, [de] cp $ff - jr z, .asm_e99a6 + jr z, .done ld [wd11e], a push bc push hl @@ -1529,73 +927,73 @@ Func_e994e: add hl, bc pop bc inc de - jr .asm_e994e + jr .loop -.asm_e99a6 +.done ret -Func_e99a7: +PrintPCBox_DrawTopBorder: coord hl, 0, 0 ld a, $79 ld [hli], a ld a, $7a ld c, SCREEN_WIDTH - 2 -.asm_e99b1 +.loop ld [hli], a dec c - jr nz, .asm_e99b1 + jr nz, .loop ld a, $7b ld [hl], a ret -Func_e99b9: +PrintPCBox_DrawLeftAndRightBorders: coord hl, 0, 0 ld de, SCREEN_WIDTH - 1 ld c, SCREEN_HEIGHT -.asm_e99c1 +.loop ld a, $7c ld [hl], a add hl, de ld a, $7c ld [hli], a dec c - jr nz, .asm_e99c1 + jr nz, .loop ret -Func_e99cc: +PrintPCBox_DrawBottomBorder: coord hl, 0, 17 -Func_e99cf: +PrintPCBox_DrawBottomBorderAtHL: ld a, $7d ld [hli], a ld a, $7a ld c, SCREEN_WIDTH - 2 -.asm_e99b1 +.loop ld [hli], a dec c - jr nz, .asm_e99b1 + jr nz, .loop ld a, $7e ld [hl], a ret -Func_e99de: +PrintPCBox_PlaceHorizontalLines: coord hl, 4, 0 ld c, 6 - call Func_e99eb + call .PlaceHorizontalLine coord hl, 6, 1 ld c, 6 -Func_e99eb: -.asm_e99eb +.PlaceHorizontalLine: +.loop push bc push hl - ld de, String_e99fd + ld de, .HorizontalLineString call PlaceString pop hl ld bc, 3 * SCREEN_WIDTH add hl, bc pop bc dec c - jr nz, .asm_e99eb + jr nz, .loop ret -String_e99fd: +.HorizontalLineString: db "----------@" diff --git a/engine/printer/serial.asm b/engine/printer/serial.asm new file mode 100755 index 00000000..54d31a15 --- /dev/null +++ b/engine/printer/serial.asm @@ -0,0 +1,622 @@ +StartTransmission_Send9Rows: ; e8783 (3a:4783) + ld a, 9 +Printer_StartTransmission: + push af + ld hl, wPrinterData + ld bc, wPrinterDataEnd - wPrinterData + xor a + call Printer_FillMemory + xor a + ld [rSB], a + ld [rSC], a + ld [wPrinterOpcode], a + ld hl, wPrinterConnectionOpen + set 0, [hl] + ld a, [wPrinterSettings] + ld [wPrinterSettingsTempCopy], a + pop af + ld [wPrinterQueueLength], a + ret + +; e87a8 +PrinterTransmissionJumptable: ; e87a8 (3a:47a8) + ld a, [wPrinterSendState] + ld e, a + ld d, 0 + ld hl, .Jumptable + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +.Jumptable: + dw Printer_InitSerial ; 00 + dw Printer_CheckConnectionStatus ; 01 + dw Printer_WaitSerial ; 02 + dw Printer_StartTransmittingTilemap ; 03 + dw Printer_TransmissionLoop ; 04 + dw Printer_WaitSerialAndLoopBack2 ; 05 + dw Printer_EndTilemapTransmission ; 06 + dw Printer_TransmissionLoop ; 07 + dw Printer_WaitSerial ; 08 + + dw Printer_SignalSendHeader ; 09 + dw Printer_TransmissionLoop ; 0a + dw Printer_WaitSerial ; 0b + dw Printer_WaitUntilFinished ; 0c + dw Printer_Quit ; 0d + + dw Printer_Next_ ; 0e + dw Printer_WaitSerial ; 0f + dw Printer_SignalLoopBack ; 10 + dw Printer_LoopBack ; 11 + dw Printer_WaitLoopBack ; 12 + dw Printer_WaitLoopBack_ ; 13 + +Printer_Next: + ld hl, wPrinterSendState + inc [hl] + ret + +Printer_Back: + ld hl, wPrinterSendState + dec [hl] + ret + +Printer_Quit: + xor a + ld [wPrinterStatusFlags], a + ld hl, wPrinterSendState + set 7, [hl] + ret + +Printer_Next_: + call Printer_Next + ret + +Printer_LoopBack: + ld a, $1 + ld [wPrinterSendState], a + ret + +Printer_InitSerial: + call ResetPrinterData + ld hl, PrinterDataPacket1 + call CopyPrinterDataHeader + xor a + ld [wPrinterDataSize], a + ld [wPrinterDataSize + 1], a + ld a, [wPrinterQueueLength] + ld [wPrinterRowIndex], a + call Printer_Next + call Printer_PrepareToSend + ld a, PRINTER_STATUS_CHECKING_LINK + ld [wPrinterStatusIndicator], a + ret + +Printer_StartTransmittingTilemap: + call ResetPrinterData + ld hl, wPrinterRowIndex + ld a, [hl] + and a + jr z, Printer_EndTilemapTransmission + ld hl, PrinterDataPacket3 + call CopyPrinterDataHeader + call Printer_Convert2RowsTo2bpp + ld a, (wPrinterSendDataSourceEnd - wPrinterSendDataSource) % $100 + ld [wPrinterDataSize], a + ld a, (wPrinterSendDataSourceEnd - wPrinterSendDataSource) / $100 + ld [wPrinterDataSize + 1], a + call ComputePrinterChecksum + call Printer_Next + call Printer_PrepareToSend + ld a, PRINTER_STATUS_TRANSMITTING + ld [wPrinterStatusIndicator], a + ret + +Printer_EndTilemapTransmission: + ld a, $6 + ld [wPrinterSendState], a + ld hl, PrinterDataPacket4 + call CopyPrinterDataHeader + xor a + ld [wPrinterDataSize], a + ld [wPrinterDataSize + 1], a + call Printer_Next + call Printer_PrepareToSend + ret + +Printer_SignalSendHeader: + call ResetPrinterData + ld hl, PrinterDataPacket2 + call CopyPrinterDataHeader + call Printer_StageHeaderForSend + ld a, $4 + ld [wPrinterDataSize], a + ld a, $0 + ld [wPrinterDataSize + 1], a + call ComputePrinterChecksum + call Printer_Next + call Printer_PrepareToSend + ld a, PRINTER_STATUS_PRINTING + ld [wPrinterStatusIndicator], a + ret + +Printer_SignalLoopBack: + call ResetPrinterData + ld hl, PrinterDataPacket1 + call CopyPrinterDataHeader + xor a + ld [wPrinterDataSize], a + ld [wPrinterDataSize + 1], a + ld a, [wPrinterQueueLength] + ld [wPrinterRowIndex], a + call Printer_Next + call Printer_PrepareToSend + ret + +Printer_WaitSerial: + ld hl, wPrinterSerialFrameDelay + inc [hl] + ld a, [hl] + cp $6 + ret c + xor a + ld [hl], a + call Printer_Next + ret + +Printer_WaitSerialAndLoopBack2: + ld hl, wPrinterSerialFrameDelay + inc [hl] + ld a, [hl] + cp $6 + ret c + xor a + ld [hl], a + ld hl, wPrinterRowIndex + dec [hl] + call Printer_Back + call Printer_Back + ret + +Printer_CheckConnectionStatus: + ld a, [wPrinterOpcode] + and a + ret nz + ld a, [wPrinterHandshake] + cp $ff + jr nz, .asm_e88dc + ld a, [wPrinterStatusFlags] + cp $ff + jr z, .asm_e88f8 +.asm_e88dc + ld a, [wPrinterHandshake] + cp $81 + jr nz, .asm_e88f8 + ld a, [wPrinterStatusFlags] + cp $0 + jr nz, .asm_e88f8 + ld hl, wPrinterConnectionOpen + set 1, [hl] + ld a, $5 + ld [wHandshakeFrameDelay], a + call Printer_Next + ret + +.asm_e88f8 + ld a, $ff + ld [wPrinterHandshake], a + ld [wPrinterStatusFlags], a + ld a, $e + ld [wPrinterSendState], a + ret + +Printer_TransmissionLoop: + ld a, [wPrinterOpcode] + and a + ret nz + ld a, [wPrinterStatusFlags] + and $f0 + jr nz, .asm_e8921 + ld a, [wPrinterStatusFlags] + and $1 + jr nz, .asm_e891d + call Printer_Next + ret + +.asm_e891d + call Printer_Back + ret + +.asm_e8921 + ld a, $12 + ld [wPrinterSendState], a + ret + +Printer_WaitUntilFinished: + ld a, [wPrinterOpcode] + and a + ret nz + ld a, [wPrinterStatusFlags] + and $f3 + ret nz + call Printer_Next + ret + +Printer_WaitLoopBack: + call Printer_Next +Printer_WaitLoopBack_: + ld a, [wPrinterOpcode] + and a + ret nz + ld a, [wPrinterStatusFlags] + and $f0 + ret nz + xor a + ld [wPrinterSendState], a + ret + +Printer_PrepareToSend: +.wait_printer_operation + ld a, [wPrinterOpcode] + and a + jr nz, .wait_printer_operation + xor a + ld [wPrinterSendByteOffset], a + ld [wPrinterSendByteOffset + 1], a + ld a, $1 + ld [wPrinterOpcode], a + ld a, $88 + ld [rSB], a + ld a, $1 + ld [rSC], a + ld a, $81 + ld [rSC], a + ret + +CopyPrinterDataHeader: + ld a, [hli] + ld [wPrinterDataHeader], a + ld a, [hli] + ld [wPrinterDataHeader + 1], a + ld a, [hli] + ld [wPrinterDataHeader + 2], a + ld a, [hli] + ld [wPrinterDataHeader + 3], a + ld a, [hli] + ld [wPrinterChecksum], a + ld a, [hl] + ld [wPrinterChecksum + 1], a + ret + +ResetPrinterData: + xor a + ld hl, wPrinterDataHeader + ld [hli], a + ld [hli], a + ld [hli], a + ld [hl], a + ld hl, wPrinterChecksum + ld [hli], a + ld [hl], a + xor a + ld [wPrinterDataSize], a + ld [wPrinterDataSize + 1], a + ld hl, wPrinterSendDataSource + ld bc, wPrinterSendDataSourceEnd - wPrinterSendDataSource + call Printer_FillMemory + ret + +ComputePrinterChecksum: + ld hl, $0 + ld bc, $4 + ld de, wPrinterDataHeader + call .AddToChecksum + ld a, [wPrinterDataSize] + ld c, a + ld a, [wPrinterDataSize + 1] + ld b, a + ld de, wPrinterSendDataSource + call .AddToChecksum + ld a, l + ld [wPrinterChecksum], a + ld a, h + ld [wPrinterChecksum + 1], a + ret + +.AddToChecksum: +.loop + ld a, [de] + inc de + add l + jr nc, .no_carry + inc h +.no_carry + ld l, a + dec bc + ld a, c + or b + jr nz, .loop + ret + +Printer_StageHeaderForSend: + ld a, $1 + ld [wPrinterSendDataSource], a + ld a, [wcae2] + ld [wPrinterSendDataSource + 1], a + ld a, %11100100 + ld [wPrinterSendDataSource + 2], a + ld a, [wPrinterSettingsTempCopy] + ld [wPrinterSendDataSource + 3], a + ret + +Printer_Convert2RowsTo2bpp: + ld a, [wPrinterRowIndex] + ld b, a + ld a, [wPrinterQueueLength] + sub b + ld hl, wPrinterTileBuffer + ld de, 2 * SCREEN_WIDTH +.get_row + and a + jr z, .got_row + add hl, de + dec a + jr .get_row + +.got_row + ld e, l + ld d, h + ld hl, wPrinterSendDataSource + ld c, 2 * SCREEN_WIDTH +.loop + ld a, [de] + inc de + push bc + push de + push hl + swap a + ld d, a + and $f0 + ld e, a + ld a, d + and $f + ld d, a + and $8 + ld a, d + jr nz, .vchars1 + or $90 + jr .got_addr + +.vchars1 + or $80 +.got_addr + ld d, a + lb bc, BANK(Printer_Convert2RowsTo2bpp), 1 + call CopyVideoData + pop hl + ld de, $10 + add hl, de + pop de + pop bc + dec c + jr nz, .loop + ret + +Printer_FillMemory: ; e8a2e (3a:4a2e) + push de + ld e, a +.loop + ld [hl], e + inc hl + dec bc + ld a, c + or b + jr nz, .loop + ld a, e + pop de + ret + +PrinterDataPacket1: + db 1, 0, $00, 0 + dw 1 +PrinterDataPacket2: + db 2, 0, $04, 0 + dw 0 +PrinterDataPacket3: + db 4, 0, $80, 2 + dw 0 +PrinterDataPacket4: + db 4, 0, $00, 0 + dw 4 +PrinterDataPacket5: ; unused + db 8, 0, $00, 0 + dw 8 +PrinterDataPacket6: ; unused + db 15, 0, $00, 0 + dw 15 + +PrinterSerial_: ; e8a5e (3a:4a5e) + ld a, [wPrinterOpcode] + ld e, a + ld d, 0 + ld hl, .Jumptable + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +.Jumptable: + dw .Nop + + dw .SignalTransmissionStart + dw .SendHeaderByte1 + dw .SendHeaderByte2 + dw .SendHeaderByte3 + dw .SendHeaderByte4 + dw .DataByte + dw .SendChecksumLo + dw .SendChecksumHi + dw .SignalTransmissionEnd + dw .Receive1 + dw .Receive2 + + dw .SignalTransmissionStart + dw .Send_0F + dw .Send_00 + dw .Send_00 + dw .Send_00 + dw .Send_0F + dw .Send_00 + dw .SignalTransmissionEnd + dw .Receive1 + dw .Receive2_ + + dw .SignalTransmissionStart + dw .SignalQuit + dw .Send_00 + dw .Send_00 + dw .Send_00 + dw .SignalQuit + dw .Send_00 + dw .SignalTransmissionEnd + dw .Receive1 + dw .Receive2 + +.NextInstruction: + ld hl, wPrinterOpcode + inc [hl] + ret + +.Nop: + ret + +.SignalTransmissionStart: + ld a, $33 + call .SendByte + call .NextInstruction + ret + +.SendHeaderByte1: + ld a, [wPrinterDataHeader] + call .SendByte + call .NextInstruction + ret + +.SendHeaderByte2: + ld a, [wPrinterDataHeader + 1] + call .SendByte + call .NextInstruction + ret + +.SendHeaderByte3: + ld a, [wPrinterDataHeader + 2] + call .SendByte + call .NextInstruction + ret + +.SendHeaderByte4: + ld a, [wPrinterDataHeader + 3] + call .SendByte + call .NextInstruction + ret + +.DataByte: + ld hl, wPrinterDataSize + ld e, [hl] + inc hl + ld d, [hl] + ld a, e + or d + jr z, .sent_last_byte + dec de + ld [hl], d + dec hl + ld [hl], e + ld a, [wPrinterSendByteOffset] + ld e, a + ld a, [wPrinterSendByteOffset + 1] + ld d, a + ld hl, wPrinterSendDataSource + add hl, de + inc de + ld a, e + ld [wPrinterSendByteOffset], a + ld a, d + ld [wPrinterSendByteOffset + 1], a + ld a, [hl] + call .SendByte + ret + +.sent_last_byte + call .NextInstruction +.SendChecksumLo: + ld a, [wPrinterChecksum] + call .SendByte + call .NextInstruction + ret + +.SendChecksumHi: + ld a, [wPrinterChecksum + 1] + call .SendByte + call .NextInstruction + ret + +.SignalTransmissionEnd: + ld a, $0 + call .SendByte + call .NextInstruction + ret + +.Receive1: + ld a, [rSB] + ld [wPrinterHandshake], a + ld a, $0 + call .SendByte + call .NextInstruction + ret + +.Receive2: + ld a, [rSB] + ld [wPrinterStatusFlags], a + xor a + ld [wPrinterOpcode], a + ret + +.Send_0F: + ld a, $f + call .SendByte + call .NextInstruction + ret + +.Send_00: + ld a, $0 + call .SendByte + call .NextInstruction + ret + +.SignalQuit: + ld a, $8 + call .SendByte + call .NextInstruction + ret + +.SendByte: + ld [rSB], a + ld a, $1 + ld [rSC], a + ld a, $81 + ld [rSC], a + ret + +.Receive2_: + ld a, [rSB] + ld [wPrinterStatusFlags], a + xor a + ld [wPrinterOpcode], a + ret diff --git a/engine/surfing_minigame.asm b/engine/surfing_minigame.asm new file mode 100755 index 00000000..f70e8119 --- /dev/null +++ b/engine/surfing_minigame.asm @@ -0,0 +1,2826 @@ +SurfingPikachuMinigame: + call SurfingPikachuMinigame_BlankPals + call DelayFrame + call DelayFrame + call DelayFrame + ld a, [hTilesetType] + push af + xor a + ld [hTilesetType], a + ld a, [wUpdateSpritesEnabled] + push af + ld a, $ff + ld [wUpdateSpritesEnabled], a + ld a, [rIE] + push af + xor a + ld [rIF], a + ld a, $f + ld [rIE], a + ld a, $8 + ld [rSTAT], a + ld a, [H_AUTOBGTRANSFERDEST + 1] + push af + ld a, $98 + ld [H_AUTOBGTRANSFERDEST + 1], a + call Func_f8fb3 + call Func_f807a + xor a + ld [rBGP], a + ld [rOBP0], a + ld [rOBP1], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + call ClearObjectAnimationBuffers + call ClearSprites + xor a + ld [hLCDCPointer], a + ld [hSCX], a + ld [hSCY], a + ld a, $90 + ld [hWY], a + call DelayFrame + pop af + ld [H_AUTOBGTRANSFERDEST + 1], a + xor a + ld [rIF], a + pop af + ld [rIE], a + xor a + ld [rSTAT], a + call RunDefaultPaletteCommand + call ReloadMapAfterSurfingMinigame + call PlayDefaultMusic + call GBPalNormal + pop af + ld [wUpdateSpritesEnabled], a + pop af + ld [hTilesetType], a + ret + +Func_f807a: + call Func_f8116 + call DelayFrame + ld b, $e + call RunPaletteCommand +.loop + ld a, [wc5d1] + bit 7, a + ret nz + call Func_f923f + call Func_f80ac + ret nz + call Func_f8282 + ld a, $3c + ld [wCurrentAnimatedObjectOAMBufferOffset], a + call RunObjectAnimations + call Func_f8848 + call Func_f80a8 + call Func_f80c4 + jr .loop + +Func_f80a8: + call DelayFrame + ret + +Func_f80ac: + ld hl, wd492 + bit 1, [hl] + ret z + ld a, [hJoyPressed] + and $4 + ret + +Func_f80b7: + ld a, [hJoyPressed] + and $8 + ret z + ld hl, wc5e2 + ld a, [hl] + xor $1 + ld [hl], a + ret + +Func_f80c4: + ld a, [wc634] + and a + ret z + ld hl, wChannelNoteDelayCounters + ld a, $1 + cp [hl] + ret nz + inc hl + cp [hl] + ret nz + inc hl + cp [hl] + ret nz + ld a, [wc5e3] + ld e, a + ld a, [wc5e3 + 1] + and $3 + ld d, a + sla e + rl d + ld e, d + ld d, $0 + ld hl, Unkn_f80f5 + add hl, de + add hl, de + ld a, [hli] + ld [wMusicTempo + 1], a + ld a, [hl] + ld [wMusicTempo], a + ret + +Unkn_f80f5: + dw $75 + dw $6d + dw $65 + dw $5d + dw $55 + +Func_f80ff: + ld hl, wChannelNoteDelayCounters + ld a, $1 + cp [hl] + ret nz + inc hl + cp [hl] + ret nz + inc hl + cp [hl] + ret nz + ld a, $75 + ld [wMusicTempo + 1], a + xor a + ld [wMusicTempo], a + ret + +Func_f8116: + call Func_f9279 + call ClearSprites + call DisableLCD + ld hl, wSerialEnemyMonsPatchList + ld bc, $67 + xor a + call FillMemory + ld hl, wc700 + ld bc, $200 + xor a + call FillMemory + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call ClearObjectAnimationBuffers + + ld hl, SurfingPikachu1Graphics + ld de, $9000 + ld bc, $500 + ld a, BANK(SurfingPikachu1Graphics) + call FarCopyData + + ld hl, SurfingPikachu1Graphics + $410 + ld de, $8000 + ld bc, $1000 + ld a, BANK(SurfingPikachu1Graphics) + call FarCopyData + + ld a, Unkn_f93d3 % $100 + ld [wAnimatedObjectSpawnStateDataPointer], a + ld a, Unkn_f93d3 / $100 + ld [wAnimatedObjectSpawnStateDataPointer + 1], a + ld a, Jumptable_f93fa % $100 + ld [wAnimatedObjectJumptablePointer], a + ld a, Jumptable_f93fa / $100 + ld [wAnimatedObjectJumptablePointer + 1], a + ld a, Unkn_f9507 % $100 + ld [wAnimatedObjectOAMDataPointer], a + ld a, Unkn_f9507 / $100 + ld [wAnimatedObjectOAMDataPointer + 1], a + ld a, Unkn_f9405 % $100 + ld [wAnimatedObjectFramesDataPointer], a + ld a, Unkn_f9405 / $100 + ld [wAnimatedObjectFramesDataPointer + 1], a + ld hl, vBGMap0 + ld bc, $800 + ld a, $0 + call FillMemory + ld hl, $98c0 + ld bc, $180 + ld a, $b + call FillMemory + ld a, $1 + lb de, $74, $58 + call SpawnAnimatedObject + ld a, $74 + ld [wc5ea], a + call Func_f9223 + xor a + ld [hSCX], a + ld [hSCY], a + ld a, $7e + ld [hWY], a + ld a, $42 + ld [hLCDCPointer], a + ld a, $40 + ld [wc5e3], a + xor a + ld [wc5e3 + 1], a + xor a + ld [wc5d6], a + ld a, $60 + ld [wc5d7], a + ld hl, wc61a + ld bc, $14 + ld a, $74 + call FillMemory + call Func_f81ff + call Func_f8256 + ld a, $e3 + ld [rLCDC], a + call Func_f81e9 + ld a, $e4 + ld [rOBP0], a + ld a, $e0 + ld [rOBP1], a + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + ret + +Func_f81e9: + ld a, [wOnSGB] + and a + jr nz, .asm_f81f7 + ld a, $d0 + ld [rBGP], a + call UpdateGBCPal_BGP + ret + +.asm_f81f7 + ld a, $e4 + ld [rBGP], a + call UpdateGBCPal_BGP + ret + +Func_f81ff: + ld hl, wSpriteDataEnd + ld de, Unkn_f8249 + ld b, $97 + ld c, $80 + ld a, $4 + call Func_f8233 + ld de, Unkn_f8248 + ld b, $96 + ld c, $50 + ld a, $1 + call Func_f8233 + ld de, Unkn_f824d + ld b, $14 + ld c, $20 + ld a, $5 + call Func_f8233 + ld de, Unkn_f8252 + ld b, $20 + ld c, $80 + ld a, $4 + call Func_f8233 + ret + +Func_f8233: +.asm_f8233 + push af + ld [hl], b + inc hl + ld [hl], c + inc hl + ld a, [de] + ld [hl], a + inc hl + ld [hl], $0 + inc hl + ld a, c + add $8 + ld c, a + inc de + pop af + dec a + jr nz, .asm_f8233 + ret + +Unkn_f8248: + db $fe + +Unkn_f8249: + db $d0 + db $d0 + db $d0 + db $d0 + +Unkn_f824d: + db $ec + db $ed + db $ed + db $ee + db $ef + +Unkn_f8252: + db $ec + db $ed + db $ee + db $ef + +Func_f8256: + ld de, $9c21 + ld hl, Unkn_f8279 + ld c, $9 +.asm_f825e + ld a, [hli] + ld [de], a + inc de + dec c + jr nz, .asm_f825e + ld hl, $9c01 + ld [hl], $15 + ld hl, $9c02 + ld [hl], $16 + ld hl, $9c2c + ld [hl], $1b + ld hl, $9c2d + ld [hl], $1c + ret + +Unkn_f8279: + db $17 + db $18 + db $19 + db $19 + db $19 + db $19 + db $19 + db $19 + db $19 + +Func_f8282: + ld a, [wc5d1] + ld e, a + ld d, $0 + ld hl, Jumptable_f8291 + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_f8291: + dw Func_f82ab + dw Func_f82bd + dw Func_f8324 + dw Func_f835c + dw Func_f838c + dw Func_f8399 + dw Func_f83aa + dw Func_f83bb + dw Func_f83cc + dw Func_f83e3 + dw Func_f8406 + dw Func_f840f + dw Func_f841d + +Func_f82ab: + ld a, $2 + lb de, $48, $e0 + call SpawnAnimatedObject + ld hl, wc5d1 + inc [hl] + ld a, $1 + ld [wc634], a + ret + +Func_f82bd: + ld a, [wc5e5] + cp $18 + jr nc, .asm_f82e8 + ld hl, wc5d6 + ld a, [hli] + or [hl] + and a + jr z, .asm_f82f6 + call Random + ld [wc5d5], a + call Func_f9210 + call Func_f88ae + call Func_f886b + call Func_f8cb0 + call Func_f844c + call Func_f88e4 + call Func_f88fd + ret + +.asm_f82e8 + ld hl, wc5d1 + inc [hl] + xor a + ld [wc634], a + ld a, $c0 + ld [wc632], a + ret + +.asm_f82f6 + ld a, $1 +Func_f82f8: + ld [wc630], a + ld a, $c + ld [wc5d1], a +Func_f8300: + ld a, $80 + ld [wc631], a + ld a, $b + lb de, $88, $58 + call SpawnAnimatedObject + ld hl, $7 + add hl, bc + ld [hl], $80 + ld hl, $b + add hl, bc + ld [hl], $80 + ld hl, $c + add hl, bc + ld [hl], $30 + xor a + ld [wc634], a + ret + +Func_f8324: + call Func_f8440 + jr c, .asm_f833d + xor a + ld [wc5d5], a + call Func_f9210 + call Func_f88ae + call Func_f886b + call Func_f8c97 + call Func_f80ff + ret + +.asm_f833d + ld hl, wc5d1 + inc [hl] + ld a, $90 + ld [hSCX], a + ld a, $72 + ld [wc5d3], a + ld a, $4 + ld [wc5d2], a + xor a + ld [hLCDCPointer], a + ld [wc617], a + ld [wc618], a + ld [wc619], a + ret + +Func_f835c: + ld a, [hSCX] + and a + jr z, .asm_f837b + call Func_f9210 + call Func_f88ae + call Func_f886b + ld a, [hSCX] + dec a + dec a + dec a + dec a + ld [hSCX], a + ld a, $e0 + ld [wc62e], a + call Func_f8cc7 + ret + +.asm_f837b + xor a + ld [wc5e3], a + ld [wc5e3 + 1], a + ld hl, wc5d1 + inc [hl] + ld a, $5 + ld [wc5d2], a + ret + +Func_f838c: + call Func_f891e + ld a, $20 + ld [wc632], a + ld hl, wc5d1 + inc [hl] + ret + +Func_f8399: + call Func_f8440 + ret nc + call Func_f8a92 + ld a, $40 + ld [wc632], a + ld hl, wc5d1 + inc [hl] + ret + +Func_f83aa: + call Func_f8440 + ret nc + call Func_f8ae4 + ld a, $40 + ld [wc632], a + ld hl, wc5d1 + inc [hl] + ret + +Func_f83bb: + call Func_f8440 + ret nc + call Func_f8b7a + ld a, $40 + ld [wc632], a + ld hl, wc5d1 + inc [hl] + ret + +Func_f83cc: + call Func_f8440 + ret nc + call Func_f8aa9 + push af + call Func_f8b5d + pop af + ret nc + ld a, $40 + ld [wc632], a + ld hl, wc5d1 + inc [hl] + ret + +Func_f83e3: + call Func_f8440 + ret nc + call Func_f8afb + push af + call Func_f8b5d + pop af + ret nc + ld a, $80 + ld [wc632], a + ld hl, wc5d1 + inc [hl] + call Func_f8b92 + ret nc + call Func_f8a7c +Func_f83ff: + ld a, $6 + ld [wc5d2], a + ret + +Func_f8406: + call Func_f8440 +Func_f8408: + ret nc + ld hl, wc5d1 + inc [hl] + ret + +Func_f840f: + call Func_f9210 + ld a, [hJoyPressed] + and $1 + ret z + ld hl, wc5d1 + set 7, [hl] + ret + +Func_f841d: + call Func_f9210 + call Func_f88ae + call Func_f886b + call Func_f8cb0 + call Func_f80ff + ld hl, wc631 + ld a, [hl] + and a + jr z, .asm_f8435 + dec [hl] + ret + +.asm_f8435 + ld a, [hJoyPressed] + and $1 + ret z + ld hl, wc5d1 + set 7, [hl] + ret + +Func_f8440: + ld hl, wc632 + ld a, [hl] + and a + jr z, .asm_f844a + dec [hl] + and a + ret + +.asm_f844a + scf + ret + +Func_f844c: + ld a, [wc5e6] + ld h, a + ld a, [wc5e7] + ld l, a + ld a, [wc5e3] + ld e, a + ld a, [wc5e3 + 1] + ld d, a + add hl, de + ld a, h + ld [wc5e6], a + ld a, l + ld [wc5e7], a + ret nc + ld hl, wc5e5 + inc [hl] + ld hl, wOAMBuffer + 4 * 4 + 1 + dec [hl] + dec [hl] + ret + +Func_f8470 + ld a, [wc5d2] + ld e, a + ld d, $0 + ld hl, Jumptable_f847f + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_f847f: + dw Func_f848d + dw Func_f84e2 + dw Func_f8516 + dw Func_f8545 + dw Func_f8561 + dw Func_f856d + dw Func_f8579 + +Func_f848d: + ld a, [wc630] + and a + jr nz, .asm_f84d2 + call Func_f87b5 + ld a, [wc5ea] + ld hl, $5 + add hl, bc + ld [hl], a + call Func_f871e + jr c, .asm_f84aa + call Func_f8742 + call Func_f86b8 + ret + +.asm_f84aa + call Func_f8742 + ld a, $1 + ld [wc5d2], a + xor a + ld hl, $c + add hl, bc + ld [hl], a + ld hl, $d + add hl, bc + ld [hl], a + ld hl, $e + add hl, bc + ld [hl], a + ld [wc5d9], a + ld [wc62f], a + xor a + ld [wChannelSoundIDs + CH7], a + ld a, SFX_UNKNOWN_801B3_4 + call PlaySound + ret + +.asm_f84d2 + xor a + ld [wc5e3], a + ld [wc5e3 + 1], a + ld a, $4 + ld [wc5d2], a + call Func_f8742 + ret + +Func_f84e2: + call Func_f8598 + call Func_f928c + ret nc + call Func_f8606 + jr c, .asm_f84fd + call Func_f8bed + ld hl, $c + add hl, bc + ld [hl], $0 + ld a, $2 + ld [wc5d2], a + ret + +.asm_f84fd + ld a, $3 + ld [wc5d2], a + ld a, $60 + ld [wc5e1], a + ld a, $10 + call SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters + xor a + ld [wChannelSoundIDs + CH7], a + ld a, SFX_UNKNOWN_801B9_4 + call PlaySound + ret + +Func_f8516: + ld hl, $c + add hl, bc + ld a, [hl] + cp $20 + jr nc, .asm_f8539 + inc [hl] + inc [hl] + inc [hl] + inc [hl] + ld d, $4 + call Func_f9362 + ld hl, $7 + add hl, bc + ld [hl], a + call Func_f87b5 + ld a, [wc5ea] + ld hl, $5 + add hl, bc + ld [hl], a + ret + +.asm_f8539 + ld hl, $7 + add hl, bc + ld [hl], $0 + ld a, $0 + ld [wc5d2], a + ret + +Func_f8545: + ld hl, wc5e1 + ld a, [hl] + and a + jr z, .asm_f8556 + dec [hl] + ld a, [wc5ea] + ld hl, $5 + add hl, bc + ld [hl], a + ret + +.asm_f8556 + ld a, $0 + ld [wc5d2], a + ld a, $4 + call SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters + ret + +Func_f8561: + ld a, [wc5ea] + ld hl, $5 + add hl, bc + ld [hl], a + call Func_f8742 + ret + +Func_f856d: + ld a, $f + call SetCurrentAnimatedObjectCallbackAndResetFrameStateRegisters + ld hl, $c + add hl, bc + ld [hl], $0 + ret + +Func_f8579: + ld hl, $c + add hl, bc + ld a, [hl] + inc [hl] + inc [hl] + and $3f + cp $20 + jr c, .asm_f8591 + ld d, $10 + call Func_f9362 + ld hl, $7 + add hl, bc + ld [hl], a + ret + +.asm_f8591 + ld hl, $7 + add hl, bc + ld [hl], $0 + ret + +Func_f8598: + ld de, hJoy5 + ld a, [de] + and $20 + jr nz, .asm_f85a6 + ld a, [de] + and $10 + jr nz, .asm_f85cc + ret + +.asm_f85a6 + ld hl, $e + add hl, bc + ld [hl], $0 + ld hl, $d + add hl, bc + ld a, [hl] + inc [hl] + cp $b + jr c, .asm_f85be + call Func_f85f2 + ld hl, wc62f + set 0, [hl] +.asm_f85be + ld hl, $1 + add hl, bc + ld a, [hl] + cp $e + jr nc, .asm_f85c9 + inc [hl] + ret + +.asm_f85c9 + ld [hl], $1 + ret + +.asm_f85cc + ld hl, $d + add hl, bc + ld [hl], $0 + ld hl, $e + add hl, bc + ld a, [hl] + inc [hl] + cp $d + jr c, .asm_f85e4 + call Func_f85f2 + ld hl, wc62f + set 1, [hl] +.asm_f85e4 + ld hl, $1 + add hl, bc + ld a, [hl] + cp $1 + jr z, .asm_f85ef + dec [hl] + ret + +.asm_f85ef + ld [hl], $e + ret + +Func_f85f2: + call Func_f8bdf + xor a + ld hl, $d + add hl, bc + ld [hl], a + ld hl, $e + add hl, bc + ld [hl], a + ld a, SFX_UNKNOWN_801B6_4 + call PlaySound + ret + +Func_f8606: + ld hl, $1 + add hl, bc + ld a, [wc5ef] + cp $6 + jr z, .asm_f863d + cp $14 + jr z, .asm_f867b + cp $12 + jr z, .asm_f867b + cp $7 + jr z, .asm_f865c + ld a, [hl] + cp $1 + jp z, .asm_f86ad + cp $2 + jr z, .asm_f869a + cp $3 + jr z, .asm_f869f + cp $4 + jr z, .asm_f86a2 + cp $5 + jr z, .asm_f869f + cp $6 + jr z, .asm_f869a + cp $7 + jr z, .asm_f86ad + jr .asm_f86ad + +.asm_f863d + ld a, [hl] + cp $1 + jr z, .asm_f86ad + cp $2 + jr z, .asm_f86ad + cp $3 + jr z, .asm_f86ad + cp $4 + jr z, .asm_f869a + cp $5 + jr z, .asm_f869f + cp $6 + jr z, .asm_f86a2 + cp $7 + jr z, .asm_f869f + jr .asm_f86ad + +.asm_f865c + ld a, [hl] + cp $1 + jr z, .asm_f869f + cp $2 + jr z, .asm_f86a2 + cp $3 + jr z, .asm_f869f + cp $4 + jr z, .asm_f869a + cp $5 + jr z, .asm_f86ad + cp $6 + jr z, .asm_f86ad + cp $7 + jr z, .asm_f86ad + jr .asm_f86ad + +.asm_f867b + ld a, [hl] + cp $1 + jr z, .asm_f86ad + cp $2 + jr z, .asm_f869a + cp $3 + jr z, .asm_f869f + cp $4 + jr z, .asm_f86a2 + cp $5 + jr z, .asm_f86a2 + cp $6 + jr z, .asm_f869f + cp $7 + jr z, .asm_f869a + jr .asm_f86ad + +.asm_f869a + call Func_f86f7 + jr .asm_f86a2 + +.asm_f869f + call Func_f86d0 +.asm_f86a2 + xor a + ld [wChannelSoundIDs + CH7], a + ld a, SFX_UNKNOWN_801BF_4 + call PlaySound + and a + ret + +.asm_f86ad + ld a, $40 + ld [wc5e3], a + xor a + ld [wc5e3 + 1], a + scf + ret + +Func_f86b8: + ld a, [wc5e3 + 1] + cp $2 + ret nc + ld h, a + ld a, [wc5e3] + ld l, a + ld de, $2 + add hl, de + ld a, h + ld [wc5e3 + 1], a + ld a, l + ld [wc5e3], a + ret + +Func_f86d0: + ld a, [wc5e3 + 1] + and a + jr nz, .asm_f86e2 + ld a, [wc5e3] + cp $40 + jr nc, .asm_f86e2 + xor a + ld [wc5e3], a + ret + +.asm_f86e2 + ld a, [wc5e3 + 1] + ld h, a + ld a, [wc5e3] + ld l, a + ld de, $ffc0 + add hl, de + ld a, h + ld [wc5e3 + 1], a + ld a, l + ld [wc5e3], a + ret + +Func_f86f7: + ld a, [wc5e3 + 1] + and a + jr nz, .asm_f8709 + ld a, [wc5e3] + cp $80 + jr nc, .asm_f8709 + xor a + ld [wc5e3], a + ret + +.asm_f8709 + ld a, [wc5e3 + 1] + ld h, a + ld a, [wc5e3] + ld l, a + ld de, $ff80 + add hl, de + ld a, h + ld [wc5e3 + 1], a + ld a, l + ld [wc5e3], a + ret + +Func_f871e: + ld a, [hSCX] + and $7 + cp $3 + jr c, .asm_f8740 + cp $5 + jr nc, .asm_f8740 + ld a, [wc5ef] + cp $14 + jr nz, .asm_f8740 + call Func_f87a8 + cp $a + jr c, .asm_f8740 + ld [wc5ec], a + call Func_f9284 + scf + ret + +.asm_f8740 + and a + ret + +Func_f8742: + ld a, [hSCX] + and $7 + cp $3 + ret c + cp $5 + ret nc + ld a, [wc5ef] + cp $6 + jr z, .asm_f8766 + cp $14 + jr z, .asm_f8766 + cp $7 + jr z, .asm_f876a + call Func_f8778 + ld a, $4 + ld hl, $1 + add hl, bc + ld [hl], a + ret + +.asm_f8766 + ld a, $6 + jr .asm_f876c + +.asm_f876a + ld a, $2 +.asm_f876c + ld e, a + ld a, [wc5de] + dec a + add e + ld hl, $1 + add hl, bc + ld [hl], a + ret + +Func_f8778: + ld hl, wc5e0 + ld a, [hl] + inc [hl] + and $7 + ret nz + ld a, [wc5df] + and a + jr z, .asm_f8796 + ld a, [wc5de] + and a + jr z, .asm_f8791 + dec a + ld [wc5de], a + ret + +.asm_f8791 + xor a + ld [wc5df], a + ret + +.asm_f8796 + ld a, [wc5de] + cp $2 + jr z, .asm_f87a2 + inc a + ld [wc5de], a + ret + +.asm_f87a2 + ld a, $1 + ld [wc5df], a + ret + +Func_f87a8: + ld a, [wc5e3] + ld l, a + ld a, [wc5e3 + 1] + ld h, a + add hl, hl + add hl, hl + add hl, hl + ld a, h + ret + +Func_f87b5: + ld hl, wc5eb + ld a, [hl] + inc [hl] + and $3 + ret nz + call Func_f87ce + ld d, a + ld hl, $4 + add hl, bc + ld e, [hl] + ld a, $a + push bc + call SpawnAnimatedObject + pop bc + ret + +Func_f87ce: + ld a, [hSCX] + and $8 + jr nz, .asm_f87d9 + ld hl, wc622 + jr .asm_f87dc + +.asm_f87d9 + ld hl, wc623 +.asm_f87dc + ld a, [wc5f0] + cp $6 + jr z, .asm_f87ed + cp $14 + jr z, .asm_f87ed + cp $7 + jr z, .asm_f87f5 + ld a, [hl] + ret + +.asm_f87ed + ld a, [hSCX] + and $7 + ld e, a + ld a, [hl] + sub e + ret + +.asm_f87f5 + ld a, [hSCX] + and $7 + add [hl] + ret + +Func_f87fb: + ld hl, $4 + add hl, bc + ld a, [hl] + cp $58 + ret z + add $4 + ld [hl], a + ret + +Func_f8807: + call MaskCurrentAnimatedObjectStruct + ret + +Func_f880b: + ld hl, $b + add hl, bc + ld a, [hl] + and a + ret z + dec [hl] + dec [hl] + ld d, a + ld hl, $c + add hl, bc + ld a, [hl] + inc [hl] + call Func_f9362 + cp $80 + jr nc, .asm_f8825 + xor $ff + inc a +.asm_f8825 + ld hl, $7 + add hl, bc + ld [hl], a + ret + +Func_f882b: + ld hl, $b + add hl, bc + ld a, [hl] + inc [hl] + and $1 + ret z + ld hl, $4 + add hl, bc + ld a, [hl] + cp $c0 + jr z, .asm_f883f + inc [hl] + ret + +.asm_f883f + ld a, $1 + ld [wc633], a + call MaskCurrentAnimatedObjectStruct + ret + +Func_f8848: + ld a, [wc635] + ld e, a + ld d, $0 + ld a, [wc5e3] + ld l, a + ld a, [wc5e3 + 1] + ld h, a + add hl, de + ld a, l + ld [wc635], a + ld d, h + ld hl, wOAMBuffer + 5 * 4 + 1 + ld e, $9 +.asm_f8861 + ld a, [hl] + add d + ld [hli], a + inc hl + inc hl + inc hl + dec e + jr nz, .asm_f8861 + ret + +Func_f886b: + ld a, [wc5ef] + ld a, [hSCX] + add $48 + ld e, a + srl e + srl e + srl e + ld d, $0 + ld hl, vBGMap0 + add hl, de + ld a, [wc5ea] + srl a + srl a + srl a + ld c, a +.asm_f8889 + ld a, c + and a + jr z, .asm_f889a + dec c + ld de, $20 + add hl, de + ld a, h + and $3 + or $98 + ld h, a + jr .asm_f8889 + +.asm_f889a + ld de, wc5ef + ld a, e + ld [H_VBCOPYDEST], a + ld a, d + ld [H_VBCOPYDEST + 1], a + ld a, l + ld [H_VBCOPYSRC], a + ld a, h + ld [H_VBCOPYSRC + 1], a + ld a, $1 + ld [H_VBCOPYSIZE], a + ret + +Func_f88ae: + ld a, [hSCX] + and $8 + jr nz, .asm_f88b9 + ld hl, wc621 + jr .asm_f88bc + +.asm_f88b9 + ld hl, wc622 +.asm_f88bc + ld a, [wc5ef] + cp $6 + jr z, .asm_f88d0 + cp $14 + jr z, .asm_f88d0 + cp $7 + jr z, .asm_f88db + ld a, [hl] + ld [wc5ea], a + ret + +.asm_f88d0 + ld a, [hSCX] + and $7 + ld e, a + ld a, [hl] + sub e + ld [wc5ea], a + ret + +.asm_f88db + ld a, [hSCX] + and $7 + add [hl] + ld [wc5ea], a + ret + +Func_f88e4: + ld hl, wc5d6 + ld e, $99 + call Func_f88f0 + ret nc + inc hl + ld e, $99 +Func_f88f0: + ld a, [hl] + and a + jr z, .asm_f88fa + sub $1 + daa + ld [hl], a + and a + ret + +.asm_f88fa + ld [hl], e + scf + ret + +Func_f88fd: + ld de, wc5d7 + ld hl, wOAMBuffer + 0 * 4 + 2 + ld a, [de] + call Func_f890b + ld hl, wOAMBuffer + 2 * 4 + 2 + ld a, [de] +Func_f890b: + ld c, a + swap a + and $f + add $d0 + ld [hli], a + inc hl + inc hl + inc hl + ld a, c + and $f + add $d0 + ld [hl], a + dec de + ret + +Func_f891e: + ld hl, wTileMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + xor a + call FillMemory + ld hl, Tilemap_f8946 + coord de, 0, 6 + ld bc, Tilemap_f8946End - Tilemap_f8946 + call CopyData + call Func_f8a0e + ld hl, wOAMBuffer + 5 * 4 + 1 + ld bc, $24 + xor a + call FillMemory + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a + ret + +Tilemap_f8946: +INCBIN "gfx/unknown_f8946.map" +Tilemap_f8946End: + +Func_f8a0e: + coord hl, 1, 1 + lb de, $3b, $3c + ld a, $40 + call Func_f8a72 + coord hl, 1, 2 + lb de, $3f, $3f + ld a, $ff + call Func_f8a72 + coord hl, 1, 3 + lb de, $3f, $3f + ld a, $ff + call Func_f8a72 + coord hl, 1, 4 + lb de, $3f, $3f + ld a, $ff + call Func_f8a72 + coord hl, 1, 5 + lb de, $3f, $3f + ld a, $ff + call Func_f8a72 + coord hl, 1, 6 + lb de, $3f, $3f + ld a, $ff + call Func_f8a72 + coord hl, 1, 7 + lb de, $3f, $3f + ld a, $ff + call Func_f8a72 + coord hl, 1, 8 + lb de, $3f, $3f + ld a, $ff + call Func_f8a72 + coord hl, 1, 9 + lb de, $3d, $3e + ld a, $40 + call Func_f8a72 + ret + +Func_f8a72: + ld [hl], d + inc hl + ld c, $10 +.asm_f8a76 + ld [hli], a + dec c + jr nz, .asm_f8a76 + ld [hl], e + ret + +Func_f8a7c: + ld hl, Tilemap_f8a89 + coord de, 6, 8 + ld bc, $9 + call CopyData + ret + +Tilemap_f8a89: + db $20,$2e,$2f,$30,$31,$2c,$32,$23,$33 + +Func_f8a92: + ld hl, Tilemap_f8aa2 + coord de, 2, 2 + ld bc, $7 + call CopyData + call Func_f8aca + ret + +Tilemap_f8aa2: + db $20,$21,$ff,$22,$23,$24,$25 + +Func_f8aa9: + ld c, $63 +.asm_f8aab + push bc + ld hl, wc5d6 + ld a, [hli] + or [hl] + and a + jr z, .asm_f8ac7 + call Func_f88e4 + ld e, $1 +.asm_f8ab9 + call Func_f8b42 + pop bc + dec c + jr nz, .asm_f8aab +.asm_f8abf + ld a, SFX_UNKNOWN_801B0_4 + call PlaySound +.asm_f8ac5 + and a + ret + +.asm_f8ac7 + pop bc + scf + ret + +Func_f8aca: + coord hl, 10, 2 + ld de, wc5d7 + ld a, [de] + call Func_f9350 + inc hl + ld a, [de] + call Func_f9350 + inc hl + inc hl + ld [hl], $21 + inc hl + ld [hl], $25 + inc hl + ld [hl], $26 + ret + +Func_f8ae4: + ld hl, Tilemap_f8af4 + coord de, 2, 4 + ld bc, $7 + call CopyData + call Func_f8b25 + ret + +Tilemap_f8af4: + db $27,$28,$29,$2a,$23,$26,$26 + +Func_f8afb: + ld c, $63 +.asm_f8afd + push bc + ld hl, wc5da + ld a, [hli] + ld e, a + or [hl] + jr z, .asm_f8b22 + ld d, [hl] + ld a, e + sub $1 + daa + ld e, a + ld a, d + sbc $0 + daa + ld [hld], a + ld [hl], e + ld e, $1 + call Func_f8b42 + pop bc + dec c + jr nz, .asm_f8afd + ld a, SFX_UNKNOWN_801B0_4 + call PlaySound +.asm_f8b20 + and a + ret + +.asm_f8b22 + pop bc + scf + ret + +Func_f8b25: + ld a, [wc5db] + coord hl, 10, 4 + call Func_f9350 + ld a, [wc5da] + coord hl, 12, 4 + call Func_f9350 + inc hl + inc hl + ld [hl], $21 + inc hl + ld [hl], $25 + inc hl + ld [hl], $26 + ret + +Func_f8b42: + ld a, [wc5dc] + add e + daa + ld [wc5dc], a + ld a, [wc5dd] + adc $0 + daa + ld [wc5dd], a + ret nc + ld a, $99 + ld [wc5dc], a + ld [wc5dd], a + ret + +Func_f8b5d: + ld a, [wc5dd] + coord hl, 10, 6 + call Func_f9350 + ld a, [wc5dc] + coord hl, 12, 6 + call Func_f9350 + inc hl + inc hl + ld [hl], $21 + inc hl + ld [hl], $25 + inc hl + ld [hl], $26 + ret + +Func_f8b7a: + ld hl, Tilemap_f8b8d + coord de, 2, 6 + ld bc, $5 + call CopyData + call Func_f8b25 + call Func_f8b5d + ret + +Tilemap_f8b8d: + db $2b,$2c,$25,$28,$2d + +Func_f8b92: + ld hl, wSurfingMinigameHiScore + 1 + ld a, [wc5dd] + cp [hl] + jr c, .asm_f8ba6 + jr nz, .asm_f8bb0 + dec hl + ld a, [wc5dc] + cp [hl] + jr c, .asm_f8ba6 + jr nz, .asm_f8bb0 +.asm_f8ba6 + call WaitForSoundToFinish + ldpikacry e, PikachuCry28 + call SurfingMinigame_PlayPikaCryIfSurfingPikaInParty + and a + ret + +.asm_f8bb0 + ld a, [wc5dc] + ld [wSurfingMinigameHiScore], a + ld a, [wc5dd] + ld [wSurfingMinigameHiScore + 1], a + call WaitForSoundToFinish + ldpikacry e, PikachuCry34 + call SurfingMinigame_PlayPikaCryIfSurfingPikaInParty + ld a, SFX_GET_ITEM2_4_2 + call PlaySound + scf + ret + +SurfingMinigame_PlayPikaCryIfSurfingPikaInParty: ; f8bcb (3e:4bcb) + push de + callab IsSurfingPikachuInThePlayersParty + pop de + ret nc + callab PlayPikachuSoundClip + ret + +Func_f8bdf: + ld a, [wc5d9] + inc a + cp $4 + jr c, .asm_f8be9 + ld a, $3 +.asm_f8be9 + ld [wc5d9], a + ret + +Func_f8bed: + ld a, [wc5d9] + and a + ret z + ld a, [wc62f] + and $3 + cp $3 + jr z, .asm_f8c2b + ld a, [wc5d9] + ld d, a + ld e, $1 + ld a, $0 +.asm_f8c03 + add e + sla e + dec d + jr nz, .asm_f8c03 +.asm_f8c09 + push af + ld e, $50 + call Func_f8c7c + pop af + dec a + jr nz, .asm_f8c09 + ld hl, $5 + add hl, bc + ld a, [hl] + sub $10 + ld d, a + ld hl, $4 + add hl, bc + ld e, [hl] + ld a, [wc5d9] + add $3 + push bc + call SpawnAnimatedObject + pop bc + ret + +.asm_f8c2b + ld a, [wc5d9] + cp $3 + jr c, .asm_f8c53 + ld a, $a +.asm_f8c34 + push af + ld e, $50 + call Func_f8c7c + pop af + dec a + jr nz, .asm_f8c34 + ld hl, $5 + add hl, bc + ld a, [hl] + sub $10 + ld d, a + ld hl, $4 + add hl, bc + ld e, [hl] + ld a, $9 + push bc + call SpawnAnimatedObject + pop bc + ret + +.asm_f8c53 + ld e, $50 + call Func_f8c7c + ld e, $50 + call Func_f8c7c + ld e, $50 + call Func_f8c7c + ld e, $30 + call Func_f8c7c + ld hl, $5 + add hl, bc + ld a, [hl] + sub $10 + ld d, a + ld hl, $4 + add hl, bc + ld e, [hl] + ld a, $8 + push bc + call SpawnAnimatedObject + pop bc + ret + +Func_f8c7c: + ld a, [wc5da] + add e + daa + ld [wc5da], a + ld a, [wc5db] + adc $0 + daa + ld [wc5db], a + ret nc + ld a, $99 + ld [wc5da], a + ld [wc5db], a + ret + +Func_f8c97: + ld a, $a0 + ld [wc62e], a + ld a, [hSCX] + ld h, a + ld a, [wc617] + ld l, a + ld de, $900 + add hl, de + ld a, l + ld [wc617], a + ld a, h + ld [hSCX], a + jr Func_f8cc7 + +Func_f8cb0: + ld a, $a0 + ld [wc62e], a + ld a, [hSCX] + ld h, a + ld a, [wc617] + ld l, a + ld de, $180 + add hl, de + ld a, l + ld [wc617], a + ld a, h + ld [hSCX], a +Func_f8cc7: + ld hl, wc618 + ld a, [hSCX] + cp [hl] + ret z + ld [hl], a + and $f0 + ld hl, wc619 + cp [hl] + ret z + ld [hl], a + call Func_f8d44 + ld a, b + ld [wc5e8], a + ld a, c + ld [wc5e9], a + push de + ld hl, wc61a + ld de, wc61c + ld c, $12 +.asm_f8ceb + ld a, [de] + inc de + ld [hli], a + dec c + jr nz, .asm_f8ceb + ld a, [wc5e8] + ld [hli], a + ld a, [wc5e9] + ld [hl], a + pop de + ld hl, wRedrawRowOrColumnSrcTiles + ld c, $8 +.asm_f8cff + ld a, [de] + call Func_f8d28 + inc de + dec c + jr nz, .asm_f8cff + ld a, [wc62e] + ld e, a + ld a, [hSCX] + add e + and $f0 + srl a + srl a + srl a + ld e, a + ld d, $0 + ld hl, vBGMap0 + add hl, de + ld a, l + ld [hRedrawRowOrColumnDest], a + ld a, h + ld [hRedrawRowOrColumnDest + 1], a + ld a, $1 + ld [hRedrawRowOrColumnMode], a + ret + +Func_f8d28: + push de + push hl + ld l, a + ld h, $0 + ld de, Unkn_f96e5 + add hl, hl + add hl, hl + add hl, de + ld e, l + ld d, h + pop hl + ld a, [de] + inc de + ld [hli], a + ld a, [de] + inc de + ld [hli], a + ld a, [de] + inc de + ld [hli], a + ld a, [de] + inc de + ld [hli], a + pop de + ret + +Func_f8d44: + ld a, [wc5d3] + ld e, a + ld d, $0 + ld hl, Jumptable_f8d53 + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_f8d53: + dw Func_f8e4b + dw Func_f8f28 + dw Func_f8f31 + dw Func_f8f3a + dw Func_f8f43 + dw Func_f8e7d + dw Func_f8f4c + dw Func_f8f55 + dw Func_f8f5e + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8f94 + dw Func_f8ec5 + dw Func_f8ece + dw Func_f8ed7 + dw Func_f8ee0 + dw Func_f8ee9 + dw Func_f8ef2 + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8f94 + dw Func_f8efb + dw Func_f8f04 + dw Func_f8f0d + dw Func_f8f16 + dw Func_f8f1f + dw Func_f8efb + dw Func_f8f04 + dw Func_f8f0d + dw Func_f8f16 + dw Func_f8f1f + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8f94 + dw Func_f8f28 + dw Func_f8f31 + dw Func_f8f3a + dw Func_f8f43 + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8f94 + dw Func_f8f4c + dw Func_f8f55 + dw Func_f8f5e + dw Func_f8f4c + dw Func_f8f55 + dw Func_f8f5e + dw Func_f8f4c + dw Func_f8f55 + dw Func_f8f5e + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8f94 + dw Func_f8f67 + dw Func_f8f70 + dw Func_f8efb + dw Func_f8f04 + dw Func_f8f0d + dw Func_f8f16 + dw Func_f8f1f + dw Func_f8f67 + dw Func_f8f70 + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8f94 + dw Func_f8ec5 + dw Func_f8ece + dw Func_f8ed7 + dw Func_f8ee0 + dw Func_f8ee9 + dw Func_f8ef2 + dw Func_f8e7d + dw Func_f8f67 + dw Func_f8f70 + dw Func_f8f67 + dw Func_f8f70 + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8f94 + dw Func_f8efb + dw Func_f8f04 + dw Func_f8f0d + dw Func_f8f16 + dw Func_f8f1f + dw Func_f8f28 + dw Func_f8f31 + dw Func_f8f3a + dw Func_f8f43 + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8e7d + dw Func_f8f94 + dw Func_f8e86 + dw Func_f8e8f + dw Func_f8e98 + dw Func_f8ea1 + dw Func_f8eaa + dw Func_f8eb3 + dw Func_f8ebc + dw Func_f8f9d + dw Func_f8e7d + dw Func_f8f79 + dw Func_f8f82 + dw Func_f8f82 + dw Func_f8f82 + dw Func_f8f82 + dw Func_f8f82 + dw Func_f8f82 + dw Func_f8f82 + dw Func_f8f8b + +Func_f8e4b: + ld a, [wc5e5] + cp $16 + jr c, .asm_f8e5a + jr z, .asm_f8e56 + jr nc, .asm_f8e6e +.asm_f8e56 + ld a, $6a + jr .asm_f8e6b + +.asm_f8e5a + ld a, [wc5d5] + and a + jr z, .asm_f8e6e + dec a + and $7 + ld e, a + ld d, $0 + ld hl, Unkn_f8e75 + add hl, de + ld a, [hl] +.asm_f8e6b + ld [wc5d3], a +.asm_f8e6e + lb bc, $74, $74 + ld de, Unkn_f973d + ret + +Unkn_f8e75: + db $01,$0e,$1a,$29,$32,$40,$4d,$5c + +Func_f8e7d: + lb bc, $74, $74 + ld de, Unkn_f973d + jp Func_f8fa9 + +Func_f8e86: + lb bc, $74, $6c + ld de, Unkn_f9745 + jp Func_f8fa9 + +Func_f8e8f: + lb bc, $64, $5c + ld de, Unkn_f974d + jp Func_f8fa9 + +Func_f8e98: + lb bc, $54, $4c + ld de, Unkn_f9755 + jp Func_f8fa9 + +Func_f8ea1: + lb bc, $44, $44 + ld de, Unkn_f975d + jp Func_f8fa9 + +Func_f8eaa: + lb bc, $44, $4c + ld de, Unkn_f9765 + jp Func_f8fa9 + +Func_f8eb3: + lb bc, $54, $5c + ld de, Unkn_f976d + jp Func_f8fa9 + +Func_f8ebc: + lb bc, $64, $6c + ld de, Unkn_f9775 + jp Func_f8fa9 + +Func_f8ec5: + lb bc, $74, $6c + ld de, Unkn_f977d + jp Func_f8fa9 + +Func_f8ece: + lb bc, $64, $5c + ld de, Unkn_f9785 + jp Func_f8fa9 + +Func_f8ed7: + lb bc, $54, $4c + ld de, Unkn_f978d + jp Func_f8fa9 + +Func_f8ee0: + lb bc, $4c, $4c + ld de, Unkn_f9795 + jp Func_f8fa9 + +Func_f8ee9: + lb bc, $54, $5c + ld de, Unkn_f979d + jp Func_f8fa9 + +Func_f8ef2: + lb bc, $64, $6c + ld de, Unkn_f97a5 + jp Func_f8fa9 + +Func_f8efb: + lb bc, $74, $6c + ld de, Unkn_f97ad + jp Func_f8fa9 + +Func_f8f04: + lb bc, $64, $5c + ld de, Unkn_f97b5 + jp Func_f8fa9 + +Func_f8f0d: + lb bc, $54, $54 + ld de, Unkn_f97bd + jp Func_f8fa9 + +Func_f8f16: + lb bc, $54, $5c + ld de, Unkn_f97c5 + jp Func_f8fa9 + +Func_f8f1f: + lb bc, $64, $6c + ld de, Unkn_f97cd + jp Func_f8fa9 + +Func_f8f28: + lb bc, $74, $6c + ld de, Unkn_f97d5 + jp Func_f8fa9 + +Func_f8f31: + lb bc, $64, $5c + ld de, Unkn_f97dd + jp Func_f8fa9 + +Func_f8f3a: + lb bc, $5c, $5c + ld de, Unkn_f97e5 + jp Func_f8fa9 + +Func_f8f43: + lb bc, $64, $6c + ld de, Unkn_f97ed + jp Func_f8fa9 + +Func_f8f4c: + lb bc, $74, $6c + ld de, Unkn_f97f5 + jp Func_f8fa9 + +Func_f8f55: + lb bc, $64, $64 + ld de, Unkn_f97fd + jp Func_f8fa9 + +Func_f8f5e: + lb bc, $64, $6c + ld de, Unkn_f9805 + jp Func_f8fa9 + +Func_f8f67: + lb bc, $74, $6c + ld de, Unkn_f980d + jp Func_f8fa9 + +Func_f8f70: + lb bc, $6c, $6c + ld de, Unkn_f9815 + jp Func_f8fa9 + +Func_f8f79: + lb bc, $74, $74 + ld de, Unkn_f981d + jp Func_f8fa9 + +Func_f8f82: + lb bc, $74, $74 + ld de, Unkn_f9825 + jp Func_f8fa9 + +Func_f8f8b: + lb bc, $74, $74 + ld de, Unkn_f9825 + jp Func_f8fae + +Func_f8f94: + lb bc, $74, $74 + ld de, Unkn_f973d + jp Func_f8fae + +Func_f8f9d: + lb bc, $74, $74 + ld de, Unkn_f973d + ret + +Func_f8fa4: + inc a + ld [wc5d3], a + ret + +Func_f8fa9: + ld hl, wc5d3 + inc [hl] + ret + +Func_f8fae: + xor a + ld [wc5d3], a + ret + +Func_f8fb3: + call Func_f9279 + call ClearSprites + call DisableLCD + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call ClearObjectAnimationBuffers + ld hl, $6324 + ld de, $8800 + ld bc, $900 + ld a, $20 + call FarCopyData + ld a, Unkn_f93d3 % $100 + ld [wAnimatedObjectSpawnStateDataPointer], a + ld a, Unkn_f93d3 / $100 + ld [wAnimatedObjectSpawnStateDataPointer + 1], a + ld a, Jumptable_f93fa % $100 + ld [wAnimatedObjectJumptablePointer], a + ld a, Jumptable_f93fa / $100 + ld [wAnimatedObjectJumptablePointer + 1], a + ld a, Unkn_f9507 % $100 + ld [wAnimatedObjectOAMDataPointer], a + ld a, Unkn_f9507 / $100 + ld [wAnimatedObjectOAMDataPointer + 1], a + ld a, Unkn_f9405 % $100 + ld [wAnimatedObjectFramesDataPointer], a + ld a, Unkn_f9405 / $100 + ld [wAnimatedObjectFramesDataPointer + 1], a + ld a, $c + lb de, $74, $58 + call SpawnAnimatedObject + call Func_f9053 + xor a + ld [hSCX], a + ld [hSCY], a + ld a, $90 + ld [hWY], a + ld b, $f + call RunPaletteCommand + ld a, $e3 + ld [rLCDC], a + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a + call DelayFrame + call DelayFrame + call DelayFrame + call Func_f81e9 + ld a, $e4 + ld [rOBP0], a + ld a, $e0 + ld [rOBP1], a + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + call DelayFrame + ld a, MUSIC_SURFING_PIKACHU + ld c, BANK(Music_SurfingPikachu) + call PlayMusic + xor a + ld [wc633], a +.loop + ld a, [wc633] + and a + ret nz + ld a, $0 + ld [wCurrentAnimatedObjectOAMBufferOffset], a + call RunObjectAnimations + call DelayFrame + jr .loop + +Func_f9053: + ld hl, wTileMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + ld a, $ff + call FillMemory + ld hl, Tilemap_f90bc + coord de, 0, 6 + ld bc, 12 * SCREEN_WIDTH + call CopyData + ld de, Tilemap_f91c8 + coord hl, 4, 0 + lb bc, 6, 12 + call .CopyBox + coord hl, 3, 7 + lb bc, 3, 15 + call .FillBoxWithFF + ld hl, Tilemap_f91ac + coord de, 3, 7 + ld bc, 15 + call CopyData + ld hl, Tilemap_f91bb + coord de, 4, 9 + ld bc, 13 + call CopyData + ret + +.CopyBox: +.copy_row + push bc + push hl +.copy_col + ld a, [de] + inc de + ld [hli], a + dec c + jr nz, .copy_col + ld bc, SCREEN_WIDTH + pop hl + add hl, bc + pop bc + dec b + jr nz, .copy_row + ret + +.FillBoxWithFF: +.fill_row + push bc + push hl +.fill_col + ld [hl], $ff + inc hl + dec c + jr nz, .fill_col + pop hl + ld bc, SCREEN_WIDTH + add hl, bc + pop bc + dec b + jr nz, .fill_row + ret + +Tilemap_f90bc: INCBIN "gfx/unknown_f90bc.map" +Tilemap_f91ac: INCBIN "gfx/unknown_f91ac.map" +Tilemap_f91bb: INCBIN "gfx/unknown_f91bb.map" +Tilemap_f91c8: INCBIN "gfx/unknown_f91c8.map" + +Func_f9210: + ld hl, wc710 + ld de, wc710 + 1 + ld c, $80 + ld a, [hl] + push af +.asm_f921a + ld a, [de] + inc de + ld [hli], a + dec c + jr nz, .asm_f921a + pop af + ld [hl], a + ret + +Func_f9223: + ld hl, wc700 + ld bc, $100 + ld de, $0 +.asm_f922c + ld a, e + and $1f + ld e, a + push hl + ld hl, Unkn_f96c5 + add hl, de + ld a, [hl] + pop hl + ld [hli], a + inc e + dec bc + ld a, c + or b + jr nz, .asm_f922c + ret + +Func_f923f: + call Joypad + ld a, [H_FRAMECOUNTER] + and a + jr nz, .asm_f9250 + ld a, [hJoyHeld] + ld [hJoy5], a + ld a, $2 + ld [H_FRAMECOUNTER], a + ret + +.asm_f9250 + xor a + ld [hJoy5], a + ret + +SurfingPikachuMinigame_BlankPals: + xor a + ld [rBGP], a + ld [rOBP0], a + ld [rOBP1], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + ret + +SurfingPikachuMinigame_NormalPals: + ld a, $e4 + ld [rBGP], a + ld [rOBP0], a + ld a, $e0 + ld [rOBP1], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + ret + +Func_f9279: + ld hl, wTileMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + xor a + call FillMemory + ret + +Func_f9284: + xor a + ld [wc5ed], a + ld [wc5ee], a + ret + +Func_f928c: + ld a, [wc5ed] + and a + jr nz, .asm_f92e4 + ld a, [wc5ec] + ld d, a + ld a, [wc5ee] + or d + jr z, .asm_f92dd + ld a, [wc5ee] + ld e, a + ld hl, $ff80 + add hl, de + ld a, l + ld [wc5ee], a + ld a, h + ld [wc5ec], a + ld e, a + ld d, $0 + call Func_f9340 + ld e, l + ld d, h + ld a, $4 + call Func_f9340 + ld a, l + xor $ff + inc a + ld l, a + ld a, h + xor $ff + ld h, a + push hl + ld hl, $5 + add hl, bc + ld d, [hl] + ld hl, $c + add hl, bc + ld e, [hl] + pop hl + add hl, de + ld e, l + ld d, h + ld hl, $5 + add hl, bc + ld [hl], d + ld hl, $c + add hl, bc + ld [hl], e + and a + ret + +.asm_f92dd + ld a, $1 + ld [wc5ed], a + and a + ret + +.asm_f92e4 + ld a, [wc5ea] + ld e, a + ld hl, $5 + add hl, bc + ld a, [hl] + cp $90 + jr nc, .asm_f92f4 + cp e + jr nc, .asm_f9330 +.asm_f92f4 + ld a, [wc5ec] + ld d, a + ld a, [wc5ee] + ld e, a + ld hl, $80 + add hl, de + ld a, l + ld [wc5ee], a + ld a, h + ld [wc5ec], a + ld e, a + ld d, $0 + call Func_f9340 + ld e, l + ld d, h + ld a, $4 + call Func_f9340 + push hl + ld hl, $5 + add hl, bc + ld d, [hl] + ld hl, $c + add hl, bc + ld e, [hl] + pop hl + add hl, de + ld e, l + ld d, h + ld hl, $5 + add hl, bc + ld [hl], d + ld hl, $c + add hl, bc + ld [hl], e + and a + ret + +.asm_f9330 + ld hl, $5 + add hl, bc + ld a, [wc5ea] + ld [hl], a + ld hl, $c + add hl, bc + ld [hl], $0 + scf + ret + +Func_f9340: + ld hl, $0 +.asm_f9343 + srl a + jr nc, .asm_f9348 + add hl, de +.asm_f9348 + sla e + rl d + and a + jr nz, .asm_f9343 + ret + +Func_f9350: + ld c, a + swap a + and $f + add $d0 + ld [hli], a + ld a, c + and $f + add $d0 + ld [hl], a + dec de + ret + +Func_f9360: ; cosine + add $10 +Func_f9362: ; sine + and $3f + cp $20 + jr nc, .asm_f936d + call Func_f9377 + ld a, h + ret + +.asm_f936d + and $1f + call Func_f9377 + ld a, h + xor $ff + inc a + ret + +Func_f9377: + ld e, a + ld a, d + ld d, $0 + ld hl, Unkn_f9393 + add hl, de + add hl, de + ld e, [hl] + inc hl + ld d, [hl] + ld hl, $0 +.asm_f9386 + srl a + jr nc, .asm_f938b + add hl, de +.asm_f938b + sla e + rl d + and a + jr nz, .asm_f9386 + ret + +Unkn_f9393: + sine_wave $100 + +Unkn_f93d3: + db $00, $00, $00 + db $04, $01, $00 + db $11, $02, $00 + db $12, $02, $00 + db $15, $00, $00 + db $16, $00, $00 + db $17, $00, $00 + db $18, $00, $00 + db $19, $00, $00 + db $1a, $00, $00 + db $14, $00, $00 + db $13, $03, $00 + db $1b, $04, $00 + +Jumptable_f93fa: + dw Func_f9404 + dw Func_f8470 + dw Func_f87fb + dw Func_f880b + dw Func_f882b + +Func_f9404: + ret + +INCLUDE "data/animated_objects_3e_1.asm" + +Unkn_f96c5: +; a sine wave with amplitude 2 + db 0, 0, 0, 1, 1, 1, 1, 2 + db 2, 2, 1, 1, 1, 1, 0, 0 + db 0, 0, 0, -1, -1, -1, -1, -2 + db -2, -2, -1, -1, -1, -1, 0, 0 + +Unkn_f96e5: + db $00, $00, $00, $00 + db $0b, $0b, $0b, $0b + db $0b, $02, $02, $06 + db $03, $0b, $07, $03 + db $06, $06, $06, $06 + db $07, $07, $07, $07 + db $06, $04, $04, $08 + db $05, $07, $08, $05 + db $0b, $0b, $11, $12 + db $0b, $0b, $13, $03 + db $14, $12, $04, $08 + db $13, $07, $08, $05 + db $06, $14, $06, $14 + db $13, $07, $13, $07 + db $08, $08, $08, $08 + db $14, $12, $14, $12 + db $0b, $11, $02, $14 + db $06, $14, $06, $14 + db $0c, $0c, $0d, $0d + db $0d, $0d, $0d, $0d + db $0e, $0f, $10, $0b + db $12, $13, $12, $13 + +Unkn_f973d: + db $00, $00, $00, $01, $01, $01, $01, $01 +Unkn_f9745: + db $00, $00, $00, $01, $01, $02, $04, $06 +Unkn_f974d: + db $00, $00, $00, $01, $02, $04, $06, $0e +Unkn_f9755: + db $00, $00, $00, $10, $11, $06, $0e, $0e +Unkn_f975d: + db $00, $00, $00, $15, $15, $0e, $0e, $0e +Unkn_f9765: + db $00, $00, $00, $03, $05, $07, $0e, $0e +Unkn_f976d: + db $00, $00, $00, $01, $03, $05, $07, $0e +Unkn_f9775: + db $00, $00, $00, $01, $01, $03, $05, $07 +Unkn_f977d: + db $00, $00, $00, $01, $01, $02, $04, $06 +Unkn_f9785: + db $00, $00, $00, $01, $02, $04, $06, $0e +Unkn_f978d: + db $00, $00, $00, $08, $0f, $0a, $0e, $0e +Unkn_f9795: + db $00, $00, $00, $09, $0d, $0b, $0e, $0e +Unkn_f979d: + db $00, $00, $00, $01, $03, $05, $07, $0e +Unkn_f97a5: + db $00, $00, $00, $01, $01, $03, $05, $07 +Unkn_f97ad: + db $00, $00, $00, $01, $01, $02, $04, $06 +Unkn_f97b5: + db $00, $00, $00, $01, $10, $11, $06, $0e +Unkn_f97bd: + db $00, $00, $00, $01, $15, $15, $0e, $0e +Unkn_f97c5: + db $00, $00, $00, $01, $03, $05, $07, $0e +Unkn_f97cd: + db $00, $00, $00, $01, $01, $03, $05, $07 +Unkn_f97d5: + db $00, $00, $00, $01, $01, $02, $04, $06 +Unkn_f97dd: + db $00, $00, $00, $01, $08, $0f, $0a, $0e +Unkn_f97e5: + db $00, $00, $00, $01, $09, $0d, $0b, $0e +Unkn_f97ed: + db $00, $00, $00, $01, $01, $03, $05, $07 +Unkn_f97f5: + db $00, $00, $00, $01, $01, $10, $11, $06 +Unkn_f97fd: + db $00, $00, $00, $01, $01, $15, $15, $0e +Unkn_f9805: + db $00, $00, $00, $01, $01, $03, $05, $07 +Unkn_f980d: + db $00, $00, $00, $01, $01, $08, $0f, $0a +Unkn_f9815: + db $00, $00, $00, $01, $01, $09, $0d, $0b +Unkn_f981d: + db $00, $00, $00, $14, $14, $14, $14, $14 +Unkn_f9825: + db $00, $00, $00, $12, $13, $13, $13, $13 diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm index b9abc1eb..c6068813 100755 --- a/engine/titlescreen.asm +++ b/engine/titlescreen.asm @@ -42,22 +42,22 @@ DisplayTitleScreen: ; 4171 (1:4171) ld a, BANK(NineTile) call FarCopyData ld hl, GamefreakLogoGraphics ; 4:4d78 - ld de, vTitleLogo + $650 - ld bc, $90 + ld de, vTitleLogo + 101 * $10 + ld bc, 9 * $10 ld a, BANK(GamefreakLogoGraphics) call FarCopyData - callab Func_f453f + callab LoadYellowTitleScreenGFX ld hl, vBGMap0 ld bc, (vBGMap1 + $400) - vBGMap0 ld a, " " call FillMemory - callab Func_f4578 - call Func_4418 + callab TitleScreen_PlacePokemonLogo + call FillSpriteBuffer0WithAA call .WriteCopyrightTiles call SaveScreenTilesToBuffer2 call LoadScreenTilesFromBuffer2 call EnableLCD - callab Func_f459a + callab TitleScreen_PlacePikachu ld a, $9b call TitleScreenCopyTileMapToVRAM call SaveScreenTilesToBuffer1 @@ -136,7 +136,7 @@ DisplayTitleScreen: ; 4171 (1:4171) call PlaySound ; scroll game version in from the right - callab Func_f4585 + callab TitleScreen_PlacePikaSpeechBubble ld a, SCREEN_HEIGHT_PIXELS ld [hWY], a call Delay3 @@ -147,15 +147,15 @@ DisplayTitleScreen: ; 4171 (1:4171) ld a, MUSIC_TITLE_SCREEN ld [wNewSoundID], a call PlaySound -.asm_428f +.loop xor a ld [wUnusedCC5B], a - ld [wTitleMonSpecies], a - ld [wTitleMonSpecies+1], a - ld [wTitleMonSpecies+2], a - ld [wTitleMonSpecies+3], a + ld [wTitleScreenScene], a + ld [wTitleScreenScene + 1], a + ld [wTitleScreenScene + 2], a + ld [wTitleScreenScene + 3], a ld a, $f - ld [wTitleMonSpecies+4], a + ld [wTitleScreenScene + 4], a .titleScreenLoop call IncrementResetCounter jp c, .doTitlescreenReset @@ -163,12 +163,13 @@ DisplayTitleScreen: ; 4171 (1:4171) call JoypadLowSensitivity ld a, [hJoyHeld] cp D_UP | SELECT | B_BUTTON - jr z, .asm_42bf + jr z, .go_to_main_menu and A_BUTTON | START - jr nz, .asm_42bf - call Func_4390 + jr nz, .go_to_main_menu + call DoTitleScreenFunction jr .titleScreenLoop -.asm_42bf + +.go_to_main_menu ld e, $a call TitleScreen_PlayPikachuPCM call GBPalWhiteOutWithDelay3 @@ -190,24 +191,28 @@ DisplayTitleScreen: ; 4171 (1:4171) cp D_UP | SELECT | B_BUTTON jp z, .doClearSaveDialogue jp MainMenu + .asm_42f0 ; 42f0 (1:42f0) +; unreferenced callab Func_e8e79 - jp .asm_428f + jp .loop .asm_42fb ; 42fb (1:42fb) - ld a, [wTitleMonSpecies+4] +; unreferenced + ld a, [wTitleScreenScene + 4] inc a cp $2a jr c, .asm_4305 ld a, $f .asm_4305 - ld [wTitleMonSpecies+4], a + ld [wTitleScreenScene + 4], a ld e, a callab PlayPikachuSoundClip xor a - ld [wTitleMonSpecies+2], a - ld [wTitleMonSpecies+3], a + ld [wTitleScreenScene + 2], a + ld [wTitleScreenScene + 3], a jp .titleScreenLoop + .doTitlescreenReset ; 431b (1:431b) ld [wAudioFadeOutControl], a call StopAllMusic @@ -249,49 +254,52 @@ CopyrightTextString: ; 4355 (1:4355) TitleScreen_PlayPikachuPCM: ; 4387 (1:4387) callab PlayPikachuSoundClip ret - -Func_4390: ; 4390 (1:4390) - call Func_43de - ld a, [wTitleMonSpecies] + +DoTitleScreenFunction: ; 4390 (1:4390) + call .CheckTimer + ld a, [wTitleScreenScene] ld e, a ld d, 0 - ld hl, PointerTable_43a2 + ld hl, .Jumptable add hl, de add hl, de ld a, [hli] ld h, [hl] ld l, a - jp hl - -PointerTable_43a2: ; 43a2 (1:43a2) - dw Func_43be - dw Func_43c3 - dw Func_43d9 - dw Func_43d9 - dw Func_43c7 - dw Func_43d9 - dw Func_43d9 - dw Func_43c3 - dw Func_43d9 - dw Func_43d9 - dw Func_43bf - dw Func_43ba + jp [hl] -Func_43ba: ; 43ba (1:43ba) + +.Jumptable: ; 43a2 (1:43a2) + dw .Nop + dw .BlinkHalf + dw .BlinkWait + dw .BlinkWait + dw .BlinkClosed + dw .BlinkWait + dw .BlinkWait + dw .BlinkHalf + dw .BlinkWait + dw .BlinkWait + dw .BlinkOpen + dw .GoBackToStart + +.GoBackToStart: ; 43ba (1:43ba) xor a - ld [wTitleMonSpecies], a -Func_43be + ld [wTitleScreenScene], a +.Nop ret - -Func_43bf: ; 43bf (1:43bf) + +.BlinkOpen: ; 43bf (1:43bf) ld e, 0 - jr asm_43c9 -Func_43c3: ; 43c3 (1:43c3) + jr .LoadBlinkFrame + +.BlinkHalf: ; 43c3 (1:43c3) ld e, 4 - jr asm_43c9 -Func_43c7: ; 43c7 (1:43c7) + jr .LoadBlinkFrame + +.BlinkClosed: ; 43c7 (1:43c7) ld e, 8 -asm_43c9: ; 43c9 (1:43c9) +.LoadBlinkFrame: ; 43c9 (1:43c9) ld hl, wOAMBuffer + 2 ld c, 8 .loop @@ -304,24 +312,24 @@ asm_43c9: ; 43c9 (1:43c9) inc hl dec c jr nz, .loop -Func_43d9: ; 43d9 (1:43d9) - ld hl, wTitleMonSpecies +.BlinkWait: ; 43d9 (1:43d9) + ld hl, wTitleScreenScene inc [hl] ret - -Func_43de: ; 43de (1:43de) - ld hl, wTitleMonSpecies + 1 + +.CheckTimer: ; 43de (1:43de) + ld hl, wTitleScreenTimer ld a, [hl] inc [hl] and a - jr z, .asm_43ed + jr z, .restart cp $80 - jr z, .asm_43ed + jr z, .restart cp $90 ret nz -.asm_43ed +.restart ld a, $1 - ld [wTitleMonSpecies], a + ld [wTitleScreenScene], a ret ; copy text of fixed length NAME_LENGTH (like player name, rival name, mon names, ...) @@ -333,7 +341,7 @@ NintenText: db "NINTEN@" SonyText: db "SONY@" IncrementResetCounter: ; 4405 (1:4405) - ld hl, wTitleMonSpecies + 2 + ld hl, wTitleScreenScene + 2 ld e, [hl] inc hl ld d, [hl] @@ -346,16 +354,17 @@ IncrementResetCounter: ; 4405 (1:4405) ld [hl], e and a ret + .doReset scf ret -Func_4418: ; 4418 (1:4418) +FillSpriteBuffer0WithAA: ; 4418 (1:4418) xor a call SwitchSRAMBankAndLatchClockData - ld hl, $a000 + ld hl, sSpriteBuffer0 ld bc, $20 ld a, $aa call FillMemory call PrepareRTCDataAndDisableSRAM - ret
\ No newline at end of file + ret diff --git a/engine/titlescreen2.asm b/engine/titlescreen2.asm index dec37da2..cf4506bc 100755 --- a/engine/titlescreen2.asm +++ b/engine/titlescreen2.asm @@ -91,7 +91,7 @@ TitleBallYTable: ; 374fa (d:74fa) TitleScreenAnimateBallIfStarterOut: ; 37506 (d:7506) ; Animate the TitleBall if a starter just got scrolled out. - ld a, [wTitleMonSpecies] + ld a, [wTitleScreenScene] cp STARTER1 jr z, .ok cp STARTER2 diff --git a/engine/unknown_ea3ea.asm b/engine/unknown_ea3ea.asm index c00785b4..9962649d 100755 --- a/engine/unknown_ea3ea.asm +++ b/engine/unknown_ea3ea.asm @@ -19,11 +19,11 @@ Func_ea3ea: ; ea3ea (3a:63ea) call LoadMonData ld hl, wTileMap - lb bc, $10, $12 + lb bc, 16, 18 call TextBoxBorder coord hl, 0, 12 - lb bc, $04, $12 + lb bc, 4, 18 call TextBoxBorder coord hl, 3, 10 @@ -46,7 +46,7 @@ Func_ea3ea: ; ea3ea (3a:63ea) ld [wPokeBallAnimData], a ld [wd0b5], a ld hl, wPartyMonNicks - call Func_ea511 + call .GetNamePointer coord hl, 8, 2 call PlaceString @@ -65,16 +65,16 @@ Func_ea3ea: ; ea3ea (3a:63ea) call PrintNumber coord hl, 8, 4 - ld de, String_ea52f + ld de, .OT call PlaceString ld hl, wPartyMonOT - call Func_ea511 + call .GetNamePointer coord hl, 9, 5 call PlaceString coord hl, 9, 6 - ld de, String_ea533 + ld de, .IDNo call PlaceString coord hl, 13, 6 @@ -83,7 +83,7 @@ Func_ea3ea: ; ea3ea (3a:63ea) call PrintNumber coord hl, 9, 8 - ld de, String_ea537 + ld de, .Stats ld a, [hFlags_0xFFFA] set 2, a ld [hFlags_0xFFFA], a @@ -115,24 +115,24 @@ Func_ea3ea: ; ea3ea (3a:63ea) coord hl, 1, 13 ld a, [wLoadedMonMoves] - call Func_ea51d + call .PlaceMoveName coord hl, 1, 14 ld a, [wLoadedMonMoves + 1] - call Func_ea51d + call .PlaceMoveName coord hl, 1, 15 ld a, [wLoadedMonMoves + 2] - call Func_ea51d + call .PlaceMoveName coord hl, 1, 16 ld a, [wLoadedMonMoves + 3] - call Func_ea51d + call .PlaceMoveName - ld b, $04 ; SET_PAL_STATUS_SCREEN + ld b, $4 ; SET_PAL_STATUS_SCREEN call RunPaletteCommand - ld a, $01 + ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 call GBPalNormal @@ -140,7 +140,7 @@ Func_ea3ea: ; ea3ea (3a:63ea) call LoadFlippedFrontSpriteByMonIndex ret -Func_ea511: ; ea511 (3a:6511) +.GetNamePointer: ; ea511 (3a:6511) ld bc, NAME_LENGTH ld a, [wWhichPokemon] call AddNTimes @@ -148,36 +148,36 @@ Func_ea511: ; ea511 (3a:6511) ld d, h ret -Func_ea51d: ; ea51d (3a:651d) +.PlaceMoveName: ; ea51d (3a:651d) and a - jr z, .asm_e6528 + jr z, .no_move ld [wPokeBallAnimData], a call GetMoveName - jr .asm_ea52b + jr .place_string -.asm_e6528 - ld de, String_ea554 -.asm_ea52b +.no_move + ld de, .Blank +.place_string call PlaceString ret ; ea52f -String_ea52f: +.OT: db "OT/@" ; ea533 -String_ea533: +.IDNo: db $73, "№/@" ; ea537 -String_ea537: +.Stats: db "ATTACK" next "DEFENSE" next "SPEED" next "SPECIAL@" ; ea554 -String_ea554: ; ea554 (3a:6554) +.Blank: ; ea554 (3a:6554) db "--------------@" GFX_ea563: ; ea563 (3a:6563) @@ -195,8 +195,8 @@ Func_ea573: ; ea573 (3a:6573) call CopyVideoData ld hl, wOAMBuffer + 32 * 4 - ld a, $08 - ld c, $08 + ld a, $8 + ld c, $8 .loop ld [hl], $10 inc hl @@ -204,9 +204,9 @@ Func_ea573: ; ea573 (3a:6573) inc hl ld [hl], $fe inc hl - ld [hl], $00 + ld [hl], $0 inc hl - add $08 + add $8 dec c jr nz, .loop ret @@ -218,7 +218,7 @@ GFX_ea597End: Func_ea5b7: ; ea5b7 (3a:65b7) ld hl, wOAMBuffer + 32 * 4 + 2 ld de, 4 - ld a, [$c971] + ld a, [wPrinterStatusFlags] ld c, 8 .asm_ea5c2 sla a @@ -235,7 +235,7 @@ Func_ea5b7: ; ea5b7 (3a:65b7) ret Func_ea5d1: ; ea5d1 (3a:65d1) - ld a, [wOverworldMap] + ld a, [wPrinterSendState] ld e, a ld d, 0 ld hl, Jumptable_ea5e0 @@ -269,19 +269,19 @@ Jumptable_ea5e0: Func_ea606: ; ea606 (3a:6606) - ld hl, wOverworldMap + ld hl, wPrinterSendState inc [hl] ret Func_ea60b: ; ea60b (3a:660b) - ld hl, wOverworldMap + ld hl, wPrinterSendState dec [hl] ret Func_ea610: ; ea610 (3a:6610) xor a - ld [$c971], a - ld hl, wOverworldMap + ld [wPrinterStatusFlags], a + ld hl, wPrinterSendState set 7, [hl] ret @@ -291,7 +291,7 @@ Func_ea61a: ; ea61a (3a:661a) Func_ea61e: ; ea61e (3a:661e) xor a - ld [wOverworldMap], a + ld [wPrinterSendState], a ret Func_ea623: ; ea623 (3a:6623) @@ -299,19 +299,19 @@ Func_ea623: ; ea623 (3a:6623) ld hl, Data_ea9de call Func_ea76b xor a - ld [$c976], a - ld [$c977], a - ld a, [$caf4] - ld [$c6e9], a + ld [wPrinterDataSize], a + ld [wPrinterDataSize + 1], a + ld a, [wPrinterQueueLength] + ld [wPrinterRowIndex], a call Func_ea606 call Func_ea74c - ld a, $01 - ld [$cae0], a + ld a, $1 + ld [wPrinterStatusIndicator], a ret Func_ea645: ; ea645 (3a:6645) call Func_ea784 - ld hl, $c6e9 + ld hl, wPrinterRowIndex ld a, [hl] and a jr z, Func_ea671 @@ -319,24 +319,24 @@ Func_ea645: ; ea645 (3a:6645) call Func_ea76b call Func_ea7e9 ld a, $80 - ld [$c976], a - ld a, $02 - ld [$c977], a + ld [wPrinterDataSize], a + ld a, $2 + ld [wPrinterDataSize + 1], a call Func_ea7a2 call Func_ea606 call Func_ea74c - ld a, $02 - ld [$cae0], a + ld a, $2 + ld [wPrinterStatusIndicator], a ret Func_ea671: ; ea671 (3a:6671) - ld a, $06 - ld [wOverworldMap], a + ld a, $6 + ld [wPrinterSendState], a ld hl, Data_ea9f0 call Func_ea76b xor a - ld [$c976], a - ld [$c977], a + ld [wPrinterDataSize], a + ld [wPrinterDataSize + 1], a call Func_ea606 call Func_ea74c ret @@ -346,22 +346,22 @@ Func_ea68a: ; ea68a (3a:668a) ld hl, Data_ea9e4 call Func_ea76b call Func_ea7d2 - ld a, $04 - ld [$c976], a - ld a, $00 - ld [$c977], a + ld a, $4 + ld [wPrinterDataSize], a + ld a, $0 + ld [wPrinterDataSize + 1], a call Func_ea7a2 call Func_ea606 call Func_ea74c - ld a, $03 - ld [$cae0], a + ld a, $3 + ld [wPrinterStatusIndicator], a ret Func_ea6af: ; ea6af (3a:66af) - ld hl, $c973 + ld hl, wPrinterSerialFrameDelay inc [hl] ld a, [hl] - cp a, $06 + cp a, $6 ret c xor a ld [hl], a @@ -369,14 +369,14 @@ Func_ea6af: ; ea6af (3a:66af) ret Func_ea6bd: ; ea6bd (3a:66bd) - ld hl, $c973 + ld hl, wPrinterSerialFrameDelay inc [hl] ld a, [hl] cp 6 ret c xor a ld [hl], a - ld hl, $c6e9 + ld hl, wPrinterRowIndex dec [hl] call Func_ea60b call Func_ea60b @@ -385,37 +385,37 @@ Func_ea6bd: ; ea6bd (3a:66bd) Func_ea6d2: ; ea6d2 (3a:66d2) call Func_ea742 ret c - ld a, [$c970] + ld a, [wPrinterHandshake] cp a, $ff jr nz, .asm_ea6e4 - ld a, [$c971] + ld a, [wPrinterStatusFlags] cp a, $ff jr z, .asm_ea6fb .asm_ea6e4 - ld a, [$c970] + ld a, [wPrinterHandshake] cp a, $81 jr nz, .asm_ea6fb - ld a, [$c971] - cp a, $00 + ld a, [wPrinterStatusFlags] + cp a, $0 jr nz, .asm_ea6fb - ld hl, wUnknownSerialFlag_d49a + ld hl, wPrinterConnectionOpen set 1, [hl] call Func_ea606 ret .asm_ea6fb - ld a, $0e - ld [wOverworldMap], a + ld a, $e + ld [wPrinterSendState], a ret Func_ea701: ; ea701 (3a:6701) call Func_ea742 ret c - ld a, [$c971] + ld a, [wPrinterStatusFlags] and $f0 jr nz, .asm_ea71b - ld a, [$c971] - and $01 + ld a, [wPrinterStatusFlags] + and $1 jr nz, .asm_ea717 call Func_ea606 ret @@ -426,13 +426,13 @@ Func_ea701: ; ea701 (3a:6701) .asm_ea71b ld a, $11 - ld [wOverworldMap], a + ld [wPrinterSendState], a ret Func_ea721: ; ea721 (3a:6721) call Func_ea742 ret c - ld a, [$c971] + ld a, [wPrinterStatusFlags] and $f3 ret nz call Func_ea606 @@ -441,18 +441,18 @@ Func_ea721: ; ea721 (3a:6721) Func_ea72f: ; ea72f (3a:672f) call Func_ea606 Func_ea732: ; ea732 (3a:6732) - ld a, [wUnknownSerialFlag_d49b] + ld a, [wPrinterOpcode] and a ret nz - ld a, [$c971] + ld a, [wPrinterStatusFlags] and $f0 ret nz xor a - ld [wOverworldMap], a + ld [wPrinterSendState], a ret Func_ea742: ; ea742 (3a:6742) - ld a, [wUnknownSerialFlag_d49b] + ld a, [wPrinterOpcode] and a jr nz, .asm_ea74a and a @@ -464,17 +464,17 @@ Func_ea742: ; ea742 (3a:6742) Func_ea74c: ; ea74c (3a:674c) .asm_ea74c - ld a, [wUnknownSerialFlag_d49b] + ld a, [wPrinterOpcode] and a jr nz, .asm_ea74c - ld a, $01 - ld [wUnknownSerialFlag_d49b], a + ld a, $1 + ld [wPrinterOpcode], a xor a - ld [$c974], a - ld [$c975], a + ld [wPrinterSendByteOffset], a + ld [wPrinterSendByteOffset + 1], a ld a, $88 ld [rSB], a - ld a, $01 + ld a, $1 ld [rSC], a ld a, $81 ld [rSC], a @@ -482,52 +482,52 @@ Func_ea74c: ; ea74c (3a:674c) Func_ea76b: ; ea76b (3a:676b) ld a, [hli] - ld [$c6ea], a + ld [wPrinterDataHeader], a ld a, [hli] - ld [$c6eb], a + ld [wPrinterDataHeader + 1], a ld a, [hli] - ld [$c6ec], a + ld [wPrinterDataHeader + 2], a ld a, [hli] - ld [$c6ed], a + ld [wPrinterDataHeader + 3], a ld a, [hli] - ld [$c6ee], a + ld [wPrinterDataHeader + 4], a ld a, [hl] - ld [$c6ef], a + ld [wPrinterDataHeader + 5], a ret Func_ea784: ; ea784 (3a:6784) xor a - ld hl, $c6ea + ld hl, wPrinterDataHeader ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld hl, $c6ee + ld hl, wPrinterDataHeader + 4 ld [hli], a ld [hl], a xor a - ld [$c976], a - ld [$c977], a - ld hl, $c6f0 + ld [wPrinterDataSize], a + ld [wPrinterDataSize + 1], a + ld hl, wPrinterSendDataSource ld bc, $280 call FillMemory ret Func_ea7a2: ; ea7a2 (3a:67a2) - ld hl, $0000 - ld bc, $0004 - ld de, $c6ea + ld hl, $0 + ld bc, $4 + ld de, wPrinterDataHeader call Func_ea7c5 - ld a, [$c976] + ld a, [wPrinterDataSize] ld c, a - ld a, [$c977] + ld a, [wPrinterDataSize + 1] ld b, a - ld de, $c6f0 + ld de, wPrinterSendDataSource call Func_ea7c5 ld a, l - ld [$c6ee], a + ld [wPrinterDataHeader + 4], a ld a, h - ld [$c6ef], a + ld [wPrinterDataHeader + 5], a ret Func_ea7c5: ; ea7c5 (3a:67c5) @@ -546,36 +546,36 @@ Func_ea7c5: ; ea7c5 (3a:67c5) ret Func_ea7d2: ; ea7d2 (3a:67d2) - ld a, $01 - ld [$c6f0], a - ld a, [$cae2] - ld [$c6f1], a + ld a, $1 + ld [wPrinterSendDataSource], a + ld a, [wcae2] + ld [wPrinterStatusReceived], a ld a, $e4 - ld [$c6f2], a - ld a, [$cae3] - ld [$c6f3], a + ld [wc6f2], a + ld a, [wPrinterSettingsTempCopy] + ld [wc6f3], a ret Func_ea7e9: ; ea7e9 (3a:67e9) - ld a, [$c6e9] + ld a, [wPrinterRowIndex] ld b, a - ld a, [$caf4] + ld a, [wPrinterQueueLength] sub b - ld hl, $c978 - ld de, $0028 -.asm_ea7f7 + ld hl, wPrinterTileBuffer + ld de, $28 +.get_start_addr and a - jr z, .asm_ea7fe + jr z, .start_working add hl, de dec a - jr .asm_ea7f7 + jr .get_start_addr -.asm_ea7fe +.start_working ld e, l ld d, h - ld hl, $c6f0 + ld hl, wPrinterSendDataSource ld c, $28 -.asm_ea805 +.prep_loop ld a, [de] inc de push bc @@ -586,47 +586,47 @@ Func_ea7e9: ; ea7e9 (3a:67e9) and $f0 ld e, a ld a, d - and $0f + and $f ld d, a - and $08 + and $8 ld a, d - jr nz, .asm_ea81d + jr nz, .vtiles1 or $90 - jr .asm_ea81f + jr .got_vram_address -.asm_ea81d +.vtiles1 or $80 -.asm_ea81f +.got_vram_address ld d, a - lb bc, $3a, $01 + lb bc, BANK(Func_ea7e9), $1 call CopyVideoData pop hl - ld de, $0010 + ld de, $10 add hl, de pop de pop bc dec c - jr nz, .asm_ea805 - call Func_ea834 + jr nz, .prep_loop + call .UnnecessaryCall ret -Func_ea834: ; ea834 (3a:6834) - ld hl, $cbdc - ld bc, $0020 +.UnnecessaryCall: ; ea834 (3a:6834) + ld hl, wcbdc + ld bc, $20 xor a call FillMemory - ld hl, $c300 + ld hl, wOAMBuffer ld c, $28 -.asm_ea843 +.master_loop push bc push hl - call Func_ea860 - jr nc, .asm_ea856 - call Func_ea886 - call Func_ea8a1 - call Func_ea902 - call Func_ea999 -.asm_ea856 + call .AreWePrintingThisSegment + jr nc, .skip_segment + call .GetVRAMAddress + call .GetOAMFlags + call .ApplyObjectPalettes + call .PlaceObject +.skip_segment pop hl inc hl inc hl @@ -634,44 +634,44 @@ Func_ea834: ; ea834 (3a:6834) inc hl pop bc dec c - jr nz, .asm_ea843 + jr nz, .master_loop ret -Func_ea860: ; ea860 (3a:6860) - ld a, [$c6e9] +.AreWePrintingThisSegment: ; ea860 (3a:6860) + ld a, [wPrinterRowIndex] ld b, a - ld a, [$caf4] + ld a, [wPrinterQueueLength] sub b ld c, a ld b, $10 -.asm_ea86b +.add_n_times ld a, c and a - jr z, .asm_ea876 + jr z, .check ld a, b add $10 ld b, a dec c - jr .asm_ea86b + jr .add_n_times -.asm_ea876 +.check ld a, b ld e, a add $10 ld d, a ld a, [hl] cp e - jr c, .asm_ea884 + jr c, .not_printing cp d - jr nc, .asm_ea884 + jr nc, .not_printing scf ret -.asm_ea884 +.not_printing and a ret -Func_ea886: ; ea886 (3a:6886) +.GetVRAMAddress: ; ea886 (3a:6886) push hl inc hl inc hl @@ -681,81 +681,81 @@ Func_ea886: ; ea886 (3a:6886) and $f0 ld e, a ld a, d - and $0f + and $f or $80 ld d, a - ld hl, $cbdc - lb bc, $3a, $01 + ld hl, wcbdc + lb bc, BANK(.GetVRAMAddress), $1 call CopyVideoData pop hl ret -Func_ea8a1: ; ea8a1 (3a:68a1) +.GetOAMFlags: ; ea8a1 (3a:68a1) push hl inc hl inc hl inc hl ld a, [hl] - call Func_ea8ab + call .DoBitOperation pop hl ret -Func_ea8ab: ; ea8ab (3a:68ab) +.DoBitOperation: ; ea8ab (3a:68ab) and $60 swap a ld e, a ld d, 0 - ld hl, Jumptable_ea8ba + ld hl, .Jumptable add hl, de ld a, [hli] ld h, [hl] ld l, a jp [hl] -Jumptable_ea8ba: ; ea8ba (3a:68ba) - dw Func_ea8c2 - dw Func_ea8c3 - dw Func_ea8c7 - dw Func_ea8cb +.Jumptable: ; ea8ba (3a:68ba) + dw .nop + dw .one + dw .two + dw .both -Func_ea8c2: ; ea8c2 (3a:68c2) +.nop: ; ea8c2 (3a:68c2) ret -Func_ea8c3: ; ea8c3 (3a:68c3) - call Func_ea8d2 +.one: ; ea8c3 (3a:68c3) + call .Invert ret -Func_ea8c7: ; ea8c7 (3a:68c7) - call Func_ea8e8 +.two: ; ea8c7 (3a:68c7) + call .Swap ret -Func_ea8cb: ; ea8cb (3a:68cb) - call Func_ea8d2 - call Func_ea8e8 +.both: ; ea8cb (3a:68cb) + call .Invert + call .Swap ret -Func_ea8d2: ; ea8d2 (3a:68d2) - ld hl, $cbdc +.Invert: ; ea8d2 (3a:68d2) + ld hl, wcbdc ld c, 16 -.asm_ea8d7 +.byte_loop ld d, [hl] ld a, 0 ld b, 8 -.asm_ea8dc +.bit_loop sla d rr a dec b - jr nz, .asm_ea8dc + jr nz, .bit_loop ld [hli], a dec c - jr nz, .asm_ea8d7 + jr nz, .byte_loop ret -Func_ea8e8: ; ea8e8 (3a:68e8) - ld hl, $cbdc - ld de, $cbea - ld c, $04 -.asm_ea8f0 +.Swap: ; ea8e8 (3a:68e8) + ld hl, wcbdc + ld de, wcbea + ld c, $4 +.swap_loop ld b, [hl] ld a, [de] ld [hli], a @@ -771,19 +771,19 @@ Func_ea8e8: ; ea8e8 (3a:68e8) dec de dec de dec c - jr nz, .asm_ea8f0 + jr nz, .swap_loop ret -Func_ea902: ; ea902 (3a:6902) +.ApplyObjectPalettes: ; ea902 (3a:6902) push hl - ld hl, $cbdc - ld de, $cbec - ld a, $08 -.asm_ea90b + ld hl, wcbdc + ld de, wcbec + ld a, 8 +.loop1 push af - ld bc, $0000 - ld a, $08 -.asm_ea911 + ld bc, $0 + ld a, 8 +.loop2 push af xor a rlc [hl] @@ -794,12 +794,12 @@ Func_ea902: ; ea902 (3a:6902) dec hl push hl push de - call Func_ea936 + call .ExpandPalettesToBC pop de pop hl pop af dec a - jr nz, .asm_ea911 + jr nz, .loop2 inc hl inc hl ld a, b @@ -810,19 +810,19 @@ Func_ea902: ; ea902 (3a:6902) inc de pop af dec a - jr nz, .asm_ea90b + jr nz, .loop1 pop hl ret -Func_ea936 ; ea936 (3a:6936) - call Func_ea93d - call Func_ea96d +.ExpandPalettesToBC: ; ea936 (3a:6936) + call .GetPaletteFunction + call .ApplyPaletteFunction ret -Func_ea93d: ; ea93d (3a:693d) +.GetPaletteFunction: ; ea93d (3a:693d) ld e, a ld d, 0 - ld hl, Jumptable_ea949 + ld hl, .PalJumptable add hl, de add hl, de ld a, [hli] @@ -830,41 +830,41 @@ Func_ea93d: ; ea93d (3a:693d) ld l, a jp [hl] -Jumptable_ea949: ; ea949 (3a:6949) - dw Func_ea951 - dw Func_ea95f - dw Func_ea956 - dw Func_ea966 +.PalJumptable: ; ea949 (3a:6949) + dw .Pal0 + dw .Pal1 + dw .Pal2 + dw .Pal3 -Func_ea951: ; ea951 (3a:6951) +.Pal0: ; ea951 (3a:6951) ld a, [rOBP0] - and $03 + and $3 ret -Func_ea956: ; ea956 (3a:6956) +.Pal2: ; ea956 (3a:6956) ld a, [rOBP0] - and $0c + and $c srl a srl a ret -Func_ea95f: ; ea95f (3a:695f) +.Pal1: ; ea95f (3a:695f) ld a, [rOBP0] and $30 swap a ret -Func_ea966: ; ea966 (3a:6966) +.Pal3: ; ea966 (3a:6966) ld a, [rOBP0] and $c0 rlca rlca ret -Func_ea96d: ; ea96d (3a:696d) +.ApplyPaletteFunction: ; ea96d (3a:696d) ld e, a ld d, 0 - ld hl, Jumptable_ea979 + ld hl, .PalFunJumptable add hl, de add hl, de ld a, [hli] @@ -872,62 +872,62 @@ Func_ea96d: ; ea96d (3a:696d) ld l, a jp [hl] -Jumptable_ea979: ; ea979 (3a:6979) - dw Func_ea981 - dw Func_ea986 - dw Func_ea98c - dw Func_ea992 +.PalFunJumptable: ; ea979 (3a:6979) + dw .zero_zero + dw .one_zero + dw .zero_one + dw .one_one -Func_ea981: ; ea981 (3a:6981) +.zero_zero: ; ea981 (3a:6981) sla b sla c ret -Func_ea986: ; ea986 (3a:6986) +.one_zero: ; ea986 (3a:6986) scf rl b sla c ret -Func_ea98c: ; ea98c (3a:698c) +.zero_one: ; ea98c (3a:698c) sla b scf rl c ret -Func_ea992: ; ea992 (3a:6992) +.one_one: ; ea992 (3a:6992) scf rl b scf rl c ret -Func_ea999: ; ea999 (3a:6999) +.PlaceObject: ; ea999 (3a:6999) push hl ld a, [hli] ld c, [hl] - and $08 - jr nz, .asm_ea9a5 - ld hl, $c6f0 - jr .asm_ea9a8 - -.asm_ea9a5 - ld hl, $c830 -.asm_ea9a8 - ld b, $00 + and $8 + jr nz, .use_wc830 + ld hl, wPrinterSendDataSource + jr .got_data_source + +.use_wc830 + ld hl, wc830 +.got_data_source + ld b, $0 ld a, c - and $f8 - sub $08 + and %11111000 + sub $8 ld c, a sla c rl b add hl, bc ld e, l ld d, h - ld hl, $cbec - ld c, $08 -.asm_ea9bc - call Func_ea9d0 + ld hl, wcbec + ld c, $8 +.coord_copy_loop + call .GetBitMask ld a, [de] and b or [hl] @@ -941,14 +941,14 @@ Func_ea999: ; ea999 (3a:6999) inc hl inc de dec c - jr nz, .asm_ea9bc + jr nz, .coord_copy_loop pop hl ret -Func_ea9d0: ; ea9d0 (3a:69d0) +.GetBitMask: ; ea9d0 (3a:69d0) push hl push de - ld de, $fff0 + ld de, -$10 add hl, de ld a, [hli] or [hl] @@ -959,14 +959,20 @@ Func_ea9d0: ; ea9d0 (3a:69d0) ret Data_ea9de: ; ea9de - db $01, $00, $00, $00, $01, $00 + db 1, 0, $00, 0 + dw 1 Data_ea9e4: ; ea9e4 - db $02, $00, $04, $00, $00, $00 + db 2, 0, $04, 0 + dw 0 Data_ea9ea: ; ea9ea - db $04, $00, $80, $02, $00, $00 + db 4, 0, $80, 2 + dw 0 Data_ea9f0: ; ea9f0 - db $04, $00, $00, $00, $04, $00 + db 4, 0, $00, 0 + dw 4 Data_ea9f6: ; ea9f6 - db $08, $00, $00, $00, $08, $00 + db 8, 0, $00, 0 + dw 8 Data_ea9fc: ; ea9fc - db $0f, $00, $00, $00, $0f, $00 + db 15, 0, $00, 0 + dw 15 diff --git a/engine/yellow_intro.asm b/engine/yellow_intro.asm new file mode 100755 index 00000000..5aad4d33 --- /dev/null +++ b/engine/yellow_intro.asm @@ -0,0 +1,1081 @@ +PlayIntroScene: + ld a, [rIE] + push af + xor a + ld [rIF], a + ld a, $f + ld [rIE], a + ld a, $8 + ld [rSTAT], a + call InitYellowIntroGFXAndMusic + call DelayFrame +.loop + ld a, [wYellowIntroCurrentScene] + bit 7, a + jr nz, .go_to_title_screen + call JoypadLowSensitivity + ld a, [hJoyPressed] + and A_BUTTON | B_BUTTON | START + jr nz, .go_to_title_screen + call Func_f98fc + ld a, $0 + ld [wCurrentAnimatedObjectOAMBufferOffset], a + call RunObjectAnimations + ld a, [wYellowIntroCurrentScene] + cp $7 + call z, Func_f98a2 + cp $b + call z, Func_f98cb + call DelayFrame + jr .loop + +.go_to_title_screen + call YellowIntro_BlankPalettes + xor a + ld [hLCDCPointer], a + call DelayFrame + xor a + ld [rIF], a + pop af + ld [rIE], a + ld a, $90 + ld [hWY], a + call ClearObjectAnimationBuffers + ld hl, wTileMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + xor a + call Bank3E_FillMemory + call YellowIntro_BlankOAMBuffer + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a + call DelayFrame + call DelayFrame + call DelayFrame + xor a + ld [H_AUTOBGTRANSFERENABLED], a + ret + +Func_f98a2: + ld a, [wOAMBuffer + 8 * 4 + 3] + or $1 + ld [wOAMBuffer + 8 * 4 + 3], a + ld a, [wOAMBuffer + 14 * 4 + 3] + or $1 + ld [wOAMBuffer + 14 * 4 + 3], a + ld a, [wOAMBuffer + 16 * 4 + 3] + or $1 + ld [wOAMBuffer + 16 * 4 + 3], a + ld a, [wOAMBuffer + 18 * 4 + 3] + or $1 + ld [wOAMBuffer + 18 * 4 + 3], a + ld a, [wOAMBuffer + 19 * 4 + 3] + or $1 + ld [wOAMBuffer + 19 * 4 + 3], a + ret + +Func_f98cb: + ld a, [wOAMBuffer + 18 * 4 + 3] + or $1 + ld [wOAMBuffer + 18 * 4 + 3], a + ld a, [wOAMBuffer + 19 * 4 + 3] + or $1 + ld [wOAMBuffer + 19 * 4 + 3], a + ld a, [wOAMBuffer + 20 * 4 + 3] + or $1 + ld [wOAMBuffer + 20 * 4 + 3], a + ld a, [wOAMBuffer + 25 * 4 + 3] + or $1 + ld [wOAMBuffer + 25 * 4 + 3], a + ld a, [wOAMBuffer + 26 * 4 + 3] + or $1 + ld [wOAMBuffer + 26 * 4 + 3], a + ld a, [wOAMBuffer + 28 * 4 + 3] + or $1 + ld [wOAMBuffer + 28 * 4 + 3], a + ret + +Func_f98fc: + ld a, [wYellowIntroCurrentScene] + ld hl, Jumptable_f9906 + call Func_fa06e + jp [hl] + +Jumptable_f9906: + dw YellowIntroScene0 ; running pika 1 + dw YellowIntroScene1 ; wait last + dw YellowIntroScene2 ; pikachu kick + dw YellowIntroScene3 ; wait last + dw YellowIntroScene4 ; running pika 2 + dw YellowIntroScene5 ; wait last + dw YellowIntroScene6 ; surfing pika + dw YellowIntroScene7 ; wait last + dw YellowIntroScene8 ; running pika 3 + dw YellowIntroScene9 ; wait last + dw YellowIntroScene10 ; flying pika + dw YellowIntroScene11 ; wait last + dw YellowIntroScene12 ; pika close up + dw YellowIntroScene13 ; wait last + dw YellowIntroScene14 ; pika thunderbolt + dw YellowIntroScene15 ; wait last + dw YellowIntroScene16 ; fade to white + dw YellowIntroScene17 ; wait and quit + +YellowIntro_NextScene: + ld hl, wYellowIntroCurrentScene + inc [hl] + ret + +YellowIntroScene0: + xor a + ld [hLCDCPointer], a + lb de, $58, $58 + ld a, $1 + call YellowIntro_SpawnAnimatedObjectAndSavePointer + xor a + ld [hSCX], a + ld [hSCY], a + ld a, $90 + ld [hWY], a + ld a, $e4 + ld [rBGP], a + ld [rOBP0], a + ld a, $c4 + ld [rOBP1], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + ld a, 130 + ld [wYellowIntroSceneTimer], a + call YellowIntro_NextScene + ret + +YellowIntroScene1: + call YellowIntro_CheckFrameTimerDecrement + ret nc + call YellowIntro_MaskCurrentAnimatedObjectStruct + call YellowIntro_NextScene + ret + +YellowIntroScene2: + call YellowIntro_BlankPalsDelay2AndDisableLCD + ld c, $8 + call UpdateMusicCTimes + xor a + ld [hLCDCPointer], a + ld hl, vBGMap0 + ld bc, $400 + xor a + call Bank3E_FillMemory + call YellowIntroScene2_PlaceGraphic + lb de, $58, $b8 ; overloaded + ld a, $4 ; overloaded + call LoadYellowIntroFlyingSpeedBars + ld a, $1 + call Func_f9e9a + call YellowIntro_SetTimerFor128Frames + call YellowIntro_NextScene + ret + +YellowIntroScene2_PlaceGraphic: + ld hl, $98d4 ; (20, 6) + ld de, $20 + ld b, $6 + ld a, $90 +.row + ld c, $6 + push af + push hl +.col + ld [hli], a + inc a + dec c + jr nz, .col + pop hl + add hl, de + pop af + add $10 + dec b + jr nz, .row + ld a, [hGBC] + and a + jr z, .dmg_sgb + ; We can actually set palettes! + ld hl, $98d4 ; (20, 6) + ld de, $20 + ld b, $6 + ld a, $1 + ld [rVBK], a +.attr_row + ld c, $6 + push hl +.attr_col + ld [hli], a + dec c + jr nz, .attr_col + pop hl + add hl, de + dec b + jr nz, .attr_row + xor a + ld [rVBK], a +.dmg_sgb + ret + +LoadYellowIntroFlyingSpeedBars: + ld hl, YellowIntroFlyingSpeedBarData + ld a, $8 +.loop +; Spawn object $8 at indicated coordinates with indicated speeds + push af + ld e, [hl] + inc hl + ld d, [hl] + inc hl + ld a, [hli] + push hl + push af + ld a, $8 + call SpawnAnimatedObject + pop af + ld hl, $b + add hl, bc + ld [hl], a + pop hl + pop af + dec a + jr nz, .loop + ret + +YellowIntroFlyingSpeedBarData: + ; y, x, speed + db $d0, $20, $02 + db $f0, $30, $04 + db $d0, $40, $06 + db $c0, $50, $08 + db $e0, $60, $08 + db $c0, $70, $06 + db $e0, $80, $04 + db $f0, $90, $02 + +YellowIntroScene3: + call YellowIntro_CheckFrameTimerDecrement + jr c, .expired + ld a, [hSCX] + cp $68 + ret z + add $4 + ld [hSCX], a + ret + +.expired + call MaskAllAnimatedObjectStructs + call YellowIntro_NextScene + ret + +YellowIntroScene4: + call YellowIntro_BlankPalsDelay2AndDisableLCD + ld c, $5 + call UpdateMusicCTimes + ld a, [hGBC] + and a + jr z, .dmg_sgb + ; We can actually set palettes! + ld hl, $98d4 + ld de, $20 + ld b, $6 + ld a, $1 + ld [rVBK], a + xor a +.attr_row + ld c, $6 + push hl +.attr_col + ld [hli], a + dec c + jr nz, .attr_col + pop hl + add hl, de + dec b + jr nz, .attr_row + xor a + ld [rVBK], a +.dmg_sgb + xor a + ld [hLCDCPointer], a + call Func_f9e5f + lb de, $58, $58 + ld a, $2 + call YellowIntro_SpawnAnimatedObjectAndSavePointer + xor a + call Func_f9e9a + call YellowIntro_SetTimerFor128Frames + call YellowIntro_NextScene + ret + +YellowIntroScene5: + call YellowIntro_CheckFrameTimerDecrement + ret nc + call YellowIntro_MaskCurrentAnimatedObjectStruct + call YellowIntro_NextScene + ret + +YellowIntroScene6: + call YellowIntro_BlankPalsDelay2AndDisableLCD + ld c, $5 + call UpdateMusicCTimes + ld a, $42 + ld [hLCDCPointer], a + call YellowIntro_Copy8BitSineWave + ld hl, vBGMap0 + ld bc, $60 + xor a + call Bank3E_FillMemory + ld hl, $9860 + ld c, $10 + ld a, $20 +.asm_f9a8b + ld [hli], a + inc a + ld [hli], a + dec a + dec c + jr nz, .asm_f9a8b + ld hl, $9880 + ld bc, $300 + ld a, $10 + call Bank3E_FillMemory + lb de, $40, $f8 + ld a, $5 + call YellowIntro_SpawnAnimatedObjectAndSavePointer + ld a, $1 + call Func_f9e9a + call YellowIntro_SetTimerFor88Frames + call YellowIntro_NextScene + ret + +YellowIntroScene7: + call YellowIntro_CheckFrameTimerDecrement + jr c, .expired + ld hl, hSCX + inc [hl] + inc [hl] + ld hl, wYellowIntroSurfingPikaSineWaveBuffer + ld de, wYellowIntroSurfingPikaSineWaveBuffer + 1 + ld a, [hl] + push af + ld c, $ff +.shift_loop + ld a, [de] + inc de + ld [hli], a + dec c + jr nz, .shift_loop + pop af + ld [hl], a + call Request7TileTransferFromC810ToC710 + ret + +.expired + call YellowIntro_MaskCurrentAnimatedObjectStruct + call YellowIntro_NextScene + ret + +YellowIntroScene8: + call YellowIntro_BlankPalsDelay2AndDisableLCD + ld c, $5 + call UpdateMusicCTimes + xor a + ld [hLCDCPointer], a + call Func_f9e5f + lb de, $58, $58 + ld a, $3 + call YellowIntro_SpawnAnimatedObjectAndSavePointer + xor a + call Func_f9e9a + call YellowIntro_SetTimerFor128Frames + call YellowIntro_NextScene + ret + +YellowIntroScene9: + call YellowIntro_CheckFrameTimerDecrement + ret nc + call YellowIntro_MaskCurrentAnimatedObjectStruct + call YellowIntro_NextScene + ret + +YellowIntroScene10: + call YellowIntro_BlankPalsDelay2AndDisableLCD + ld c, $5 + call UpdateMusicCTimes + xor a + ld [hLCDCPointer], a + ld hl, vBGMap0 + ld bc, $400 + xor a + call Bank3E_FillMemory + ld hl, vBGMap0 + ld bc, $100 + ld a, $2 + call Bank3E_FillMemory + ld hl, $9900 + ld de, Unkn_f9b6e + lb bc, 6, 20 + call .FillBGMapBox + ld hl, $988c + ld de, Unkn_f9be6 + lb bc, 3, 4 + call .FillBGMapBox + ld hl, $98e3 + ld de, Unkn_f9bf2 + lb bc, 2, 2 + call .FillBGMapBox + lb de, $98, $58 + ld a, $6 + call YellowIntro_SpawnAnimatedObjectAndSavePointer + ld a, $1 + call Func_f9e9a + call YellowIntro_SetTimerFor128Frames + call YellowIntro_NextScene + ret + +.FillBGMapBox: +.fill_row + push bc + push hl +.fill_col + ld a, [de] + inc de + ld [hli], a + dec c + jr nz, .fill_col + pop hl + ld bc, $20 + add hl, bc + pop bc + dec b + jr nz, .fill_row + ret + +Unkn_f9b6e: INCBIN "gfx/unknown_f9b6e.map" +Unkn_f9be6: INCBIN "gfx/unknown_f9be6.map" +Unkn_f9bf2: INCBIN "gfx/unknown_f9bf2.map" + +YellowIntroScene11: + call YellowIntro_CheckFrameTimerDecrement + jr c, .expired + ld a, [wYellowIntroSceneTimer] + and $7 + ret nz + ld a, [wYellowIntroSceneTimer] + and $8 + sla a + sla a + sla a + ld e, a + ld d, $0 + ld hl, YellowIntroCloudGFX1 + add hl, de + ld a, l + ld [H_VBCOPYSRC], a + ld a, h + ld [H_VBCOPYSRC + 1], a + xor a + ld [H_VBCOPYDEST], a + ld a, $96 + ld [H_VBCOPYDEST + 1], a + ld a, $4 + ld [H_VBCOPYSIZE], a + ret + +.expired + call YellowIntro_MaskCurrentAnimatedObjectStruct + call YellowIntro_NextScene + ret + +YellowIntroCloudGFX1: INCBIN "gfx/unknown_f9c2c.2bpp" +YellowIntroCloudGFX2: INCBIN "gfx/unknown_f9c6c.2bpp" ; indirectly referenced + +YellowIntroScene12: + call YellowIntro_BlankPalsDelay2AndDisableLCD + ld c, $5 + call UpdateMusicCTimes + xor a + ld [hLCDCPointer], a + ld hl, vBGMap0 + ld bc, $80 + ld a, $1 + call Bank3E_FillMemory + ld hl, $9880 + ld bc, $140 + xor a + call Bank3E_FillMemory + ld hl, $99c0 + ld bc, $80 + ld a, $1 + call Bank3E_FillMemory + + ; paste 8x12 graphic into vBGMap0 at (5, 6) starting at tile 4, skipping 4 vtiles at the end of each row + ld hl, $98c5 + ld de, $20 + ld a, $4 + ld b, 8 +.row + ld c, 12 + push hl +.col + ld [hli], a + inc a + dec c + jr nz, .col + pop hl + add hl, de + add $4 + dec b + jr nz, .row + + ld hl, $98c4 ; (4, 6) + ld [hl], $3 + ld hl, $98e4 ; (4, 7) + ld [hl], $74 + ld hl, $99a5 ; (5, 5) + ld [hl], $0 + lb de, $60, $58 + ld a, $9 + call YellowIntro_SpawnAnimatedObjectAndSavePointer + xor a + call Func_f9e9a + call YellowIntro_SetTimerFor128Frames + call YellowIntro_NextScene + ret + +YellowIntroScene13: + call YellowIntro_CheckFrameTimerDecrement + ret nc + lb de, $68, $58 + ld a, $a + call SpawnAnimatedObject + call YellowIntro_NextScene + ret + +YellowIntroScene14: + ld de, YellowIntroPalSequence_f9dd6 + call YellowIntro_LoadDMGPalAndIncrementCounter + jr c, .expired + ld [rBGP], a + ld [rOBP0], a + and $f0 + ld [rOBP1], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + ret + +.expired + call MaskAllAnimatedObjectStructs + call YellowIntro_BlankOAMBuffer + ld hl, wTileMap + ld bc, $50 + ld a, $1 + call Bank3E_FillMemory + coord hl, 0, 4 + ld bc, CopyVideoDataAlternate + xor a + call Bank3E_FillMemory + coord hl, 0, 14 + ld bc, $50 + ld a, $1 + call Bank3E_FillMemory + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a + call DelayFrame + call DelayFrame + call DelayFrame + xor a + ld [H_AUTOBGTRANSFERENABLED], a + ld a, $e4 + ld [rOBP0], a + ld [rBGP], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + lb de, $58, $58 + ld a, $7 + call YellowIntro_SpawnAnimatedObjectAndSavePointer + call YellowIntro_NextScene + ld a, $28 + ld [wYellowIntroSceneTimer], a + ret + +YellowIntroScene15: + call YellowIntro_CheckFrameTimerDecrement + jr c, .expired + ld a, [wYellowIntroSceneTimer] + and $3 + ret nz + ld a, [rOBP0] + xor $ff + ld [rOBP0], a + ld a, [rBGP] + xor $3 + ld [rBGP], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + ret + +.expired + xor a + ld [hLCDCPointer], a + ld a, $e4 + ld [rBGP], a + ld [rOBP0], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call YellowIntro_NextScene +YellowIntroScene16: + ld de, YellowIntroPalSequence_f9e0a + call YellowIntro_LoadDMGPalAndIncrementCounter + jr c, .expired + ld [rOBP0], a + ld [rBGP], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + ret + +.expired + call YellowIntro_NextScene + ret + +YellowIntroPalSequence_f9dd6: + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $e4 + db $e4, $c0, $c0, $ff + +YellowIntroPalSequence_f9e0a: + db $e4, $90, $90, $40 + db $40, $00, $00, $ff + +YellowIntroScene17: + ld c, 64 + call DelayFrames + ld hl, wYellowIntroCurrentScene + set 7, [hl] + ret + +YellowIntro_SpawnAnimatedObjectAndSavePointer: + call SpawnAnimatedObject + ld a, c + ld [wYellowIntroAnimatedObjectStructPointer], a + ld a, b + ld [wYellowIntroAnimatedObjectStructPointer + 1], a + ret + +YellowIntro_MaskCurrentAnimatedObjectStruct: + ld a, [wYellowIntroAnimatedObjectStructPointer] + ld c, a + ld a, [wYellowIntroAnimatedObjectStructPointer + 1] + ld b, a + call MaskCurrentAnimatedObjectStruct + ret + +YellowIntro_SetTimerFor128Frames: + ld a, 128 + ld [wYellowIntroSceneTimer], a + ret + +YellowIntro_SetTimerFor88Frames: + ld a, 88 + ld [wYellowIntroSceneTimer], a + ret + +YellowIntro_CheckFrameTimerDecrement: + ld hl, wYellowIntroSceneTimer + ld a, [hl] + and a + jr z, .asm_f9e4b + dec [hl] + and a + ret + +.asm_f9e4b + scf + ret + +YellowIntro_LoadDMGPalAndIncrementCounter: + ld hl, wYellowIntroSceneTimer + ld a, [hl] + inc [hl] + ld l, a + ld h, $0 + add hl, de + ld a, [hl] + cp $ff + jr z, .asm_f9e5d + and a + ret + +.asm_f9e5d + scf + ret + +Func_f9e5f: + ld hl, vBGMap0 + ld bc, $80 + ld a, $1 + call Bank3E_FillMemory + ld hl, $9880 + ld bc, $140 + xor a + call Bank3E_FillMemory + ld hl, $99c0 + ld bc, $80 + ld a, $1 + call Bank3E_FillMemory + ret + +YellowIntro_BlankPalsDelay2AndDisableLCD: + xor a + ld [rBGP], a + ld [rOBP0], a + ld [rOBP1], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + call DelayFrame + call DelayFrame + call DisableLCD + ret + +Func_f9e9a: + ld e, a + callab YellowIntroPaletteAction + xor a + ld [hSCX], a + ld [hSCY], a + ld a, $90 + ld [hWY], a + ld a, $e3 + ld [rLCDC], a + ld a, $e4 + ld [rBGP], a + ld [rOBP0], a + ld a, $e0 + ld [rOBP1], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + ret + +YellowIntro_Copy8BitSineWave: + ; Copy this sine wave into wYellowIntroSurfingPikaSineWaveBuffer 8 times (end just before wc900) + ld de, wYellowIntroSurfingPikaSineWaveBuffer + ld a, $8 +.loop + push af + ld hl, .SineWave + ld bc, .SineWaveEnd - .SineWave + call Bank3E_CopyData + pop af + dec a + jr nz, .loop + ret + +.SineWave: +; a sine wave with amplitude 4 + db 0, 0, 1, 2, 2, 3, 3, 3 + db 4, 3, 3, 3, 2, 2, 1, 0 + db 0, 0, -1, -2, -2, -3, -3, -3 + db -4, -3, -3, -3, -2, -2, -1, 0 +.SineWaveEnd: + +Request7TileTransferFromC810ToC710: + ld a, wc810 % $100 + ld [H_VBCOPYSRC], a + ld a, wc810 / $100 + ld [H_VBCOPYSRC + 1], a + ld a, wc710 % $100 + ld [H_VBCOPYDEST], a + ld a, wc710 / $100 + ld [H_VBCOPYDEST + 1], a + ld a, $7 + ld [H_VBCOPYSIZE], a + ret + +InitYellowIntroGFXAndMusic: + xor a + ld [H_AUTOBGTRANSFERENABLED], a + ld [hSCX], a + ld [hSCY], a + ld [H_AUTOBGTRANSFERDEST], a + ld a, $98 + ld [H_AUTOBGTRANSFERDEST + 1], a + call YellowIntro_BlankTileMap + ld hl, wTileMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + ld a, $1 + call Bank3E_FillMemory + coord hl, 0, 4 + ld bc, CopyVideoDataAlternate + xor a + call Bank3E_FillMemory + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a + call DelayFrame + call DelayFrame + call DelayFrame + xor a + ld [H_AUTOBGTRANSFERENABLED], a + ld de, $6b5a + ld hl, $8000 + ld bc, $3eff + call CopyVideoData + ld de, $635a + ld hl, $9000 + ld bc, $3e80 + call CopyVideoData + call ClearObjectAnimationBuffers + call LoadYellowIntroObjectAnimationDataPointers + ld b, $8 + call RunPaletteCommand + xor a + ld hl, wYellowIntroCurrentScene + ld [hli], a + ld [hli], a + ld [hli], a + ld [hl], a + ld a, MUSIC_INTRO_BATTLE + ld c, BANK(Music_IntroBattle) + call PlayMusic + ret + +LoadYellowIntroObjectAnimationDataPointers: + ld a, YellowIntro_AnimatedObjectSpawnStateData % $100 + ld [wAnimatedObjectSpawnStateDataPointer], a + ld a, YellowIntro_AnimatedObjectSpawnStateData / $100 + ld [wAnimatedObjectSpawnStateDataPointer + 1], a + ld a, YellowIntro_AnimatedObjectJumptable % $100 + ld [wAnimatedObjectJumptablePointer], a + ld a, YellowIntro_AnimatedObjectJumptable / $100 + ld [wAnimatedObjectJumptablePointer + 1], a + ld a, YellowIntro_AnimatedObjectOAMData % $100 + ld [wAnimatedObjectOAMDataPointer], a + ld a, YellowIntro_AnimatedObjectOAMData / $100 + ld [wAnimatedObjectOAMDataPointer + 1], a + ld a, YellowIntro_AnimatedObjectFramesData % $100 + ld [wAnimatedObjectFramesDataPointer], a + ld a, YellowIntro_AnimatedObjectFramesData / $100 + ld [wAnimatedObjectFramesDataPointer + 1], a + ret + +YellowIntro_BlankTileMap: + ld hl, wTileMap + ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + ld a, $7f + call Bank3E_FillMemory + ret + +Bank3E_CopyData: +.loop + ld a, [hli] + ld [de], a + inc de + dec bc + ld a, c + or b + jr nz, .loop + ret + +Bank3E_FillMemory: + push de + ld e, a +.loop + ld a, e + ld [hli], a + dec bc + ld a, c + or b + jr nz, .loop + pop de + ret + +YellowIntro_BlankOAMBuffer: + ld hl, wOAMBuffer + ld bc, wOAMBufferEnd - wOAMBuffer + xor a + call Bank3E_FillMemory + ret + +YellowIntro_BlankPalettes: + xor a + ld [rBGP], a + ld [rOBP0], a + ld [rOBP1], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + ret + +YellowIntro_AnimatedObjectSpawnStateData: + db $00, $00, $00 + db $01, $01, $00 + db $02, $01, $00 + db $03, $01, $00 + db $04, $02, $00 + db $05, $03, $00 + db $06, $04, $00 + db $07, $01, $00 + db $08, $05, $00 + db $09, $01, $00 + db $0a, $01, $00 + +YellowIntro_AnimatedObjectJumptable: + dw Func_fa007 + dw Func_fa007 + dw Func_fa008 + dw Func_fa014 + dw Func_fa02b + dw Func_fa062 + +Func_fa007: + ret + +Func_fa008: + ld hl, $4 + add hl, bc + ld a, [hl] + cp $58 + ret z + sub $4 + ld [hl], a + ret + +Func_fa014: + ld hl, $4 + add hl, bc + ld a, [hl] + cp $58 + jr z, .asm_fa020 + add $4 + ld [hl], a +.asm_fa020 + ld hl, $5 + add hl, bc + cp $58 + ret z + add $1 + ld [hl], a + ret + +Func_fa02b: + ld hl, $b + add hl, bc + ld e, [hl] + ld d, $0 + ld hl, Jumptable_fa03b + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_fa03b: + dw Func_fa03f + dw Func_fa051 + +Func_fa03f: + ld hl, $5 + add hl, bc + ld a, [hl] + cp $58 + jr z, .asm_fa04c + sub $2 + ld [hl], a + ret + +.asm_fa04c + ld hl, $b + add hl, bc + inc [hl] +Func_fa051: + ld hl, $c + add hl, bc + ld a, [hl] + inc [hl] + ld d, $8 + call Func_fa079 + ld hl, $7 + add hl, bc + ld [hl], a + ret + +Func_fa062: + ld hl, $b + add hl, bc + ld a, [hl] + ld hl, $4 + add hl, bc + add [hl] + ld [hl], a + ret + +Func_fa06e: + ld e, a + ld d, $0 + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + ret + +Func_fa077: ; cosine + add $10 +Func_fa079: + and $3f + cp $20 + jr nc, .asm_fa084 + call Func_fa08e + ld a, h + ret + +.asm_fa084 + and $1f + call Func_fa08e + ld a, h + xor $ff + inc a + ret + +Func_fa08e: + ld e, a + ld a, d + ld d, $0 + ld hl, Unkn_fa0aa + add hl, de + add hl, de + ld e, [hl] + inc hl + ld d, [hl] + ld hl, $0 +.asm_fa09d + srl a + jr nc, .asm_fa0a2 + add hl, de +.asm_fa0a2 + sla e + rl d + and a + jr nz, .asm_fa09d + ret + +Unkn_fa0aa: + sine_wave $100 @@ -168,7 +168,7 @@ ReadJoypad:: ; 01c8 (0:01c8) INCLUDE "home/overworld.asm" CheckForUserInterruption:: ; 10ba (0:10ba) -; Return carry if Up+Select+B, Start or A are pressed in c frames. +; Return carry if Up + Select + B, Start or A are pressed in c frames. ; Used only in the intro and title screen. call DelayFrame @@ -780,7 +780,7 @@ UncompressMonSprite:: ; 1407 (0:1407) ld a, [hli] ld [wSpriteInputPtr], a ; fetch sprite input pointer ld a, [hl] - ld [wSpriteInputPtr+1], a + ld [wSpriteInputPtr + 1], a ; define (by index number) the bank that a pokemon's image is in ; index = Mew, bank 1 ; index = Kabutops fossil, bank $B @@ -1323,14 +1323,13 @@ DisplayPlayerBlackedOutText:: ; 2988 (0:2988) ld a, [wd732] res 5, a ; reset forced to use bike bit ld [wd732], a - ld a, [wd790] - bit 7, a + CheckEvent EVENT_IN_SAFARI_ZONE jr z, .didnotblackoutinsafari xor a ld [wNumSafariBalls], a ld [wSafariSteps], a - ld [wSafariSteps+1], a - ld [wd790], a + ld [wSafariSteps + 1], a + EventFlagAddressa EVENT_IN_SAFARI_ZONE ld [wcf0d], a ld [wSafariZoneEntranceCurScript], a .didnotblackoutinsafari @@ -2120,18 +2119,18 @@ ChooseFlyDestination:: ; 2f9a (0:2f9a) res 4, [hl] jpba LoadTownMap_Fly -Func_2fa7:: ; 2fa7 (0:2fa7) - homecall Func_e8a5e +PrinterSerial:: ; 2fa7 (0:2fa7) + homecall PrinterSerial_ ret SerialFunction:: ; 2fb7 (0:2fb7) - ld a, [wUnknownSerialFlag_d49a] + ld a, [wPrinterConnectionOpen] bit 0, a ret z - ld a, [wUnknownSerialFlag_d49b] + ld a, [wPrinterOpcode] and a ret nz - ld hl, wOverworldMap+650 + ld hl, wOverworldMap + 650 inc [hl] ld a, [hl] cp $6 @@ -2139,7 +2138,7 @@ SerialFunction:: ; 2fb7 (0:2fb7) xor a ld [hl], a ld a, $0c - ld [wUnknownSerialFlag_d49b], a + ld [wPrinterOpcode], a ld a, $88 ld [rSB], a ld a, $1 @@ -2351,7 +2350,7 @@ StoreTrainerHeaderPointer:: ; 30f3 (0:30f3) ld a, h ld [wTrainerHeaderPtr], a ld a, l - ld [wTrainerHeaderPtr+1], a + ld [wTrainerHeaderPtr + 1], a ret ; executes the current map script from the function pointer array provided in hl. @@ -3781,10 +3780,10 @@ CalcStats:: ; 392b (0:392b) .statsLoop inc c call CalcStat - ld a, [H_MULTIPLICAND+1] + ld a, [H_MULTIPLICAND + 1] ld [de], a inc de - ld a, [H_MULTIPLICAND+2] + ld a, [H_MULTIPLICAND + 2] ld [de], a inc de ld a, c @@ -3818,12 +3817,12 @@ CalcStat:: ; 393f (0:393f) .statExpLoop ; calculates ceil(Sqrt(stat exp)) in b xor a ld [H_MULTIPLICAND], a - ld [H_MULTIPLICAND+1], a + ld [H_MULTIPLICAND + 1], a inc b ; increment current stat exp bonus ld a, b cp $ff jr z, .statExpDone - ld [H_MULTIPLICAND+2], a + ld [H_MULTIPLICAND + 2], a ld [H_MULTIPLIER], a call Multiply ld a, [hld] @@ -3912,9 +3911,9 @@ CalcStat:: ; 393f (0:393f) jr nc, .noCarry2 inc d ; da = (Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4 .noCarry2 - ld [H_MULTIPLICAND+2], a + ld [H_MULTIPLICAND + 2], a ld a, d - ld [H_MULTIPLICAND+1], a + ld [H_MULTIPLICAND + 1], a xor a ld [H_MULTIPLICAND], a ld a, [wCurEnemyLVL] @@ -3922,10 +3921,10 @@ CalcStat:: ; 393f (0:393f) call Multiply ; ((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level ld a, [H_MULTIPLICAND] ld [H_DIVIDEND], a - ld a, [H_MULTIPLICAND+1] - ld [H_DIVIDEND+1], a - ld a, [H_MULTIPLICAND+2] - ld [H_DIVIDEND+2], a + ld a, [H_MULTIPLICAND + 1] + ld [H_DIVIDEND + 1], a + ld a, [H_MULTIPLICAND + 2] + ld [H_DIVIDEND + 2], a ld a, $64 ld [H_DIVISOR], a ld a, $3 @@ -3937,38 +3936,38 @@ CalcStat:: ; 393f (0:393f) jr nz, .notHPStat ld a, [wCurEnemyLVL] ld b, a - ld a, [H_MULTIPLICAND+2] + ld a, [H_MULTIPLICAND + 2] add b - ld [H_MULTIPLICAND+2], a + ld [H_MULTIPLICAND + 2], a jr nc, .noCarry3 - ld a, [H_MULTIPLICAND+1] + ld a, [H_MULTIPLICAND + 1] inc a - ld [H_MULTIPLICAND+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level + ld [H_MULTIPLICAND + 1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level .noCarry3 - ld a, 10 ; +10 for HP stat + ld a, 10 ; + 10 for HP stat .notHPStat ld b, a - ld a, [H_MULTIPLICAND+2] + ld a, [H_MULTIPLICAND + 2] add b - ld [H_MULTIPLICAND+2], a + ld [H_MULTIPLICAND + 2], a jr nc, .noCarry4 - ld a, [H_MULTIPLICAND+1] + ld a, [H_MULTIPLICAND + 1] inc a ; non-HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + 5 - ld [H_MULTIPLICAND+1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level + 10 + ld [H_MULTIPLICAND + 1], a ; HP: (((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level) / 100 + Level + 10 .noCarry4 - ld a, [H_MULTIPLICAND+1] ; check for overflow (>999) + ld a, [H_MULTIPLICAND + 1] ; check for overflow (>999) cp 999 / $100 + 1 jr nc, .overflow cp 999 / $100 jr c, .noOverflow - ld a, [H_MULTIPLICAND+2] + ld a, [H_MULTIPLICAND + 2] cp 999 % $100 + 1 jr c, .noOverflow .overflow ld a, 999 / $100 ; overflow: cap at 999 - ld [H_MULTIPLICAND+1], a + ld [H_MULTIPLICAND + 1], a ld a, 999 % $100 - ld [H_MULTIPLICAND+2], a + ld [H_MULTIPLICAND + 2], a .noOverflow pop bc pop de diff --git a/home/overworld.asm b/home/overworld.asm index 23fe450e..e80b829c 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -70,6 +70,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) jr z, .notSimulating ld a, [hJoyHeld] jr .checkIfStartIsPressed + .notSimulating ld a, [hJoyPressed] .checkIfStartIsPressed @@ -79,6 +80,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) xor a ld [hSpriteIndexOrTextID], a ; start menu text ID jp .displayDialogue + .startButtonNotPressed bit 0, a ; A button jp z, .checkIfDownButtonIsPressed @@ -116,6 +118,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) xor a ld [wLinkTimeoutCounter], a jp EnterMap + ; predef LoadSAV ; ld a, [wCurMap] ; ld [wDestinationMap], a @@ -129,6 +132,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) and a jp nz, .newBattle jp OverworldLoop + .noDirectionButtonsPressed call UpdateSprites ; 231c ld hl, wFlags_0xcd60 @@ -146,6 +150,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) ld [wPlayerMovingDirection], a ; zero the direction .overworldloop jp OverworldLoop + .checkIfDownButtonIsPressed ld a, [hJoyHeld] ; current joypad state bit 7, a ; down button @@ -154,6 +159,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) ld [wSpriteStateData1 + 3], a ; delta Y ld a, PLAYER_DIR_DOWN jr .handleDirectionButtonPress + .checkIfUpButtonIsPressed bit 6, a ; up button jr z, .checkIfLeftButtonIsPressed @@ -161,6 +167,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) ld [wSpriteStateData1 + 3], a ; delta Y ld a, PLAYER_DIR_UP jr .handleDirectionButtonPress + .checkIfLeftButtonIsPressed bit 5, a ; left button jr z, .checkIfRightButtonIsPressed @@ -168,6 +175,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) ld [wSpriteStateData1 + 5], a ; delta X ld a, PLAYER_DIR_LEFT jr .handleDirectionButtonPress + .checkIfRightButtonIsPressed bit 4, a ; right button jr z, .noDirectionButtonsPressed @@ -199,6 +207,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) call NewBattle jp c, .battleOccurred jp OverworldLoop + .noDirectionChange ld a, [wPlayerDirection] ; current direction ld [wPlayerMovingDirection], a ; save direction @@ -221,6 +230,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) pop hl jp c, CheckWarpsCollision jp OverworldLoop + .surfing call CollisionCheckOnWater jp c, OverworldLoop @@ -229,6 +239,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) ld [wWalkCounter], a callab Func_fcc08 jr .moveAhead2 + .moveAhead call IsSpinning call UpdateSprites ; move sprites @@ -244,8 +255,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) jp nz, CheckMapConnections ; it seems like this check will never succeed (the other place where CheckMapConnections is run works) ; walking animation finished call StepCountCheck - ld a, [wd790] - bit 7, a ; in the safari zone? + CheckEvent EVENT_IN_SAFARI_ZONE ; in the safari zone? jr z, .notSafariZone callba SafariZoneCheckSteps ld a, [wSafariZoneGameOver] @@ -277,8 +287,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) ld a, [wCurMap] cp CINNABAR_GYM jr nz, .notCinnabarGym - ld hl, wd79b - set 7, [hl] + SetEvent EVENT_2A7 .notCinnabarGym ld hl, wd72e set 5, [hl] @@ -435,6 +444,7 @@ CheckWarpsCollision:: ; 051a (0:051a) ld a, [hl] ld [hWarpDestinationMap], a jr WarpFound2 + .retry1 inc hl .retry2 @@ -471,10 +481,12 @@ WarpFound2:: ; 054a (0:054a) ld [wMapPalOffset], a call GBFadeOutToBlack .notRockTunnel - callab Func_fc5fa ; 3f:45fa + callab CalculatePikachuSpawnState1 ; 3f:45fa call PlayMapChangeSound jr .done -; for maps that can have the 0xFF destination map, which means to return to the outside map; not all these maps are necessarily indoors, though + +; for maps that can have the 0xFF destination map, which means to return to the outside map +; not all these maps are necessarily indoors, though .indoorMaps ld a, [hWarpDestinationMap] ; destination map cp $ff @@ -490,16 +502,18 @@ WarpFound2:: ; 054a (0:054a) ld hl, wd732 set 3, [hl] jr .skipMapChangeSound + .notWarpPad call PlayMapChangeSound .skipMapChangeSound ld hl, wd736 res 0, [hl] res 1, [hl] - callab Func_fc65b ; 3f:465b + callab CalculatePikachuSpawnState2 ; 3f:465b jr .done + .goBackOutside - callab Func_fc69a ; 3f:469a + callab CalculatePikachuSpawnState3 ; 3f:469a ld a, [wLastMap] ld [wCurMap], a call PlayMapChangeSound @@ -548,6 +562,7 @@ CheckMapConnections:: ; 05db (0:05db) ld a, h ld [wCurrentTileBlockMapViewPointer + 1], a jp .loadNewMap + .checkEastMap ld b, a ld a, [wCurrentMapWidth2] ; map width @@ -584,6 +599,7 @@ CheckMapConnections:: ; 05db (0:05db) ld a, h ld [wCurrentTileBlockMapViewPointer + 1], a jp .loadNewMap + .checkNorthMap ld a, [wYCoord] cp $ff @@ -610,6 +626,7 @@ CheckMapConnections:: ; 05db (0:05db) ld a, h ld [wCurrentTileBlockMapViewPointer + 1], a jp .loadNewMap + .checkSouthMap ld b, a ld a, [wCurrentMapHeight2] @@ -641,7 +658,7 @@ CheckMapConnections:: ; 05db (0:05db) ld hl, wPikachuOverworldStateFlags set 4, [hl] ld a, $2 - ld [wd431], a + ld [wPikachuSpawnState], a call LoadMapHeader ; 0dab (0:0dab) call PlayDefaultMusicFadeOutCurrent ; music ld b, SET_PAL_OVERWORLD @@ -651,6 +668,7 @@ CheckMapConnections:: ; 05db (0:05db) call InitMapSprites call LoadTileBlockMap jp OverworldLoopLessDelay + .didNotEnterConnectedMap jp OverworldLoop @@ -666,6 +684,7 @@ PlayMapChangeSound:: ; 06ef (0:06ef) jr nz, .didNotGoThroughDoor ld a, $ad ; SFX_GO_INSIDE jr .playSound + .didNotGoThroughDoor ld a, $b5 ; SFX_GO_OUTSIDE .playSound @@ -713,6 +732,7 @@ ExtraWarpCheck:: ; 071a (0:071a) .useFunction1 ld hl, IsPlayerFacingEdgeOfMap jr .doBankswitch + .useFunction2 ld hl, IsWarpTileInFrontOfPlayer .doBankswitch @@ -1073,7 +1093,7 @@ IsSpriteInFrontOfPlayer:: ; 0983 (0:0983) ld d, $10 ; talking range in pixels (normal range) IsSpriteInFrontOfPlayer2:: ; 0985 (0:0985) lb bc, $3c, $40 ; Y and X position of player sprite - ld a, [wSpriteStateData1 + 9] ; direction the player is facing + ld a, [wPlayerFacingDirection] ; direction the player is facing .checkIfPlayerFacingUp cp SPRITE_FACING_UP jr nz, .checkIfPlayerFacingDown @@ -1083,6 +1103,7 @@ IsSpriteInFrontOfPlayer2:: ; 0985 (0:0985) ld b, a ld a, PLAYER_DIR_UP jr .doneCheckingDirection + .checkIfPlayerFacingDown cp SPRITE_FACING_DOWN jr nz, .checkIfPlayerFacingRight @@ -1092,6 +1113,7 @@ IsSpriteInFrontOfPlayer2:: ; 0985 (0:0985) ld b, a ld a, PLAYER_DIR_DOWN jr .doneCheckingDirection + .checkIfPlayerFacingRight cp SPRITE_FACING_RIGHT jr nz, .playerFacingLeft @@ -1101,6 +1123,7 @@ IsSpriteInFrontOfPlayer2:: ; 0985 (0:0985) ld c, a ld a, PLAYER_DIR_RIGHT jr .doneCheckingDirection + .playerFacingLeft ; facing left ld a, c @@ -1140,6 +1163,7 @@ IsSpriteInFrontOfPlayer2:: ; 0985 (0:0985) jr nz, .spriteLoop xor a ret + .foundSpriteInFrontOfPlayer pop hl ld a, l @@ -1171,6 +1195,7 @@ SignLoop:: ; 09f2 (0:09f2) jr z, .yCoordMatched inc hl jr .retry + .yCoordMatched ld a, [hli] ; sign X cp e @@ -1189,6 +1214,7 @@ SignLoop:: ; 09f2 (0:09f2) pop hl scf ret + .retry dec b jr nz, .signLoop @@ -1248,6 +1274,7 @@ CollisionCheckOnLand:: ; 0a1c (0:0a1c) .setCarry scf ret + .noCollision and a ret @@ -1300,6 +1327,7 @@ CheckForTilePairCollisions:: ; 0aa6 (0:0aa6) .retry inc hl jr .tilePairCollisionLoop + .tilesetMatches ld a, [wTilePlayerStandingOn] ; tile the player is on ld b, a @@ -1311,12 +1339,14 @@ CheckForTilePairCollisions:: ; 0aa6 (0:0aa6) cp b jr z, .currentTileMatchesSecondInPair jr .retry + .currentTileMatchesFirstInPair inc hl ld a, [hl] cp c jr z, .foundMatch jr .tilePairCollisionLoop + .currentTileMatchesSecondInPair dec hl ld a, [hli] @@ -1326,6 +1356,7 @@ CheckForTilePairCollisions:: ; 0aa6 (0:0aa6) .foundMatch scf ret + .noMatch and a ret @@ -1666,6 +1697,7 @@ GetSimulatedInput:: ; 0cb3 (0:0cb3) pop de scf ret + .endofsimulatedinputs and a ret @@ -1708,6 +1740,7 @@ CollisionCheckOnWater:: ; 0cca (0:0cca) .setCarry scf jr .done + .checkIfVermilionDockTileset ld a, [wCurMapTileset] ; tileset cp SHIP_PORT ; Vermilion Dock tileset @@ -1715,7 +1748,7 @@ CollisionCheckOnWater:: ; 0cca (0:0cca) jr .stopSurfing ; if it is the boarding platform tile, stop surfing .stopSurfing ; based game freak ld a, $3 - ld [wd431], a + ld [wPikachuSpawnState], a ld hl, wPikachuOverworldStateFlags set 5, [hl] xor a @@ -1723,6 +1756,7 @@ CollisionCheckOnWater:: ; 0cca (0:0cca) call LoadPlayerSpriteGraphics call PlayDefaultMusic jr .noCollision + .noCollision ; ...and they do the same mistake twice and a .done @@ -1811,9 +1845,11 @@ LoadPlayerSpriteGraphicsCommon:: ; 0d8f (0:0d8f) ; function to load data from the map header LoadMapHeader:: ; 0dab (0:0dab) callba MarkTownVisitedAndLoadMissableObjects - jr .asm_0dbd + jr asm_0dbd + +Func_0db5:: ; XXX callba Func_f0a55 ; 3c:4a55 -.asm_0dbd +asm_0dbd ld a, [wCurMapTileset] ld [wUnusedD119], a ld a, [wCurMap] @@ -2005,7 +2041,7 @@ LoadScreenRelatedData:: ; 0f0c (0:0f0c) call LoadCurrentMapView ret -Func_0f16:: ; 0f16 (0:0f16) +ReloadMapAfterSurfingMinigame:: ; 0f16 (0:0f16) ld a, [H_LOADEDROMBANK] push af call DisableLCD @@ -2021,7 +2057,8 @@ Func_0f16:: ; 0f16 (0:0f16) pop af call BankswitchCommon jr asm_0f4d -Func_0f3d:: ; 0f3d (0:0f3d) + +ReloadMapAfterPrinter:: ; 0f3d (0:0f3d) ld a, [H_LOADEDROMBANK] push af ld a, [wCurMap] diff --git a/home/pikachu.asm b/home/pikachu.asm index 43c7ef99..e79fdb1b 100755 --- a/home/pikachu.asm +++ b/home/pikachu.asm @@ -2,7 +2,7 @@ Func_1510:: ; 1510 (0:1510) push hl ld hl, wPikachuOverworldStateFlags set 7, [hl] - ld hl, wSpriteStateData1 + $f2 ; pikachu data? + ld hl, wPikachuSpriteImageIdx ; pikachu data? ld [hl], $ff pop hl ret @@ -25,7 +25,7 @@ Func_152d:: ; 152d (0:152d) push hl ld hl, wPikachuOverworldStateFlags set 3, [hl] - ld hl, wSpriteStateData1 + $f2 ; pikachu data? + ld hl, wPikachuSpriteImageIdx ; pikachu data? ld [hl], $ff pop hl ret @@ -51,42 +51,43 @@ CheckPikachuFollowingPlayer:: ; 154a (0:154a) pop hl ret -Func_1552:: ; 1552 (0:1552) +SpawnPikachu:: ; 1552 (0:1552) ld a, [hl] dec a swap a ld [hTilePlayerStandingOn], a - homecall Func_fc6d5 ; 3f:46d5 + homecall SpawnPikachu_ ; 3f:46d5 ret -Func_1568:: ; 1568 (0:1568) +Pikachu_IsInArray:: ; 1568 (0:1568) ld b, $0 ld c, a -.asm_156b +.loop inc b ld a, [hli] cp $ff - jr z, .asm_1578 + jr z, .not_in_array cp c - jr nz, .asm_156b + jr nz, .loop dec b dec hl scf ret -.asm_1578 + +.not_in_array dec b dec hl and a ret -Func_157c:: ; 157c (0:157c) +GetPikachuMovementScriptByte:: ; 157c (0:157c) push hl push bc ld a, [H_LOADEDROMBANK] push af - ld a, [wd44a] + ld a, [wPikachuMovementScriptBank] call BankswitchCommon - ld hl, wd44b + ld hl, wPikachuMovementScriptAddress ld c, [hl] inc hl ld b, [hl] @@ -103,11 +104,11 @@ Func_157c:: ; 157c (0:157c) pop hl ret -Func_159b:: ; 159b (0:159b) +ApplyPikachuMovementData:: ; 159b (0:159b) ld a, [H_LOADEDROMBANK] ld b, a push af - callbs Func_fd2a1 + callbs ApplyPikachuMovementData_ pop af call BankswitchCommon ret diff --git a/home/serial.asm b/home/serial.asm index c8e64f38..c8c7cbe9 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -3,9 +3,9 @@ Serial:: ; 1f78 (0:1f78) push bc push de push hl - ld a, [wUnknownSerialFlag_d49a] - bit 0,a - jp nz,Func_2162 + ld a, [wPrinterConnectionOpen] + bit 0, a + jp nz, PrinterSerial__ ld a, [hSerialConnectionStatus] inc a jr z, .connectionNotYetEstablished @@ -314,8 +314,8 @@ Serial_TryEstablishingExternallyClockedConnection:: ; 22fa (0:22fa) ld [rSC], a ret -Func_2162:: ; 2162 (0:2162) - call Func_2fa7 +PrinterSerial__:: ; 2162 (0:2162) + call PrinterSerial pop hl pop de pop bc @@ -271,6 +271,8 @@ H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10 hItemCounter EQU $FFDB +hCanceledPrinting EQU $FFDB + hGymGateIndex EQU $FFDB hGymTrashCanRandNumMask EQU $FFDB @@ -942,3 +942,9 @@ pikapic_waitbgmap: macro ; d pikapic_ret: macro ; e db pikapic_ret_command endm + +pikapic_looptofinish: macro +.loop\@ + pikapic_waitbgmap + pikapic_jump .loop\@ + endm @@ -697,7 +697,7 @@ Func_2fd6a: ; 2fd6a (b:7d6a) callab IsThisPartymonStarterPikachu_Party ret nc ld a, $3 - ld [wd431], a + ld [wPikachuSpawnState], a ret INCLUDE "engine/battle/scale_sprites.asm" diff --git a/scripts/agatha.asm b/scripts/agatha.asm index a96b9b43..6f611071 100755 --- a/scripts/agatha.asm +++ b/scripts/agatha.asm @@ -1,4 +1,4 @@ -AgathaScript: ; 7642d (1d:642d) +AgathaScript: call AgathaShowOrHideExitBlock call EnableAutoTextBoxDrawing ld hl, AgathaTrainerHeaders @@ -8,7 +8,7 @@ AgathaScript: ; 7642d (1d:642d) ld [wAgathaCurScript], a ret -AgathaShowOrHideExitBlock: ; 76443 (1d:6443) +AgathaShowOrHideExitBlock: ; Blocks or clears the exit to the next room. ld hl, wCurrentMapScriptFlags bit 5, [hl] @@ -26,22 +26,22 @@ AgathaShowOrHideExitBlock: ; 76443 (1d:6443) lb bc, 0, 2 predef_jump ReplaceTileBlock -ResetAgathaScript: ; 76464 (1d:6464) +ResetAgathaScript: xor a ld [wAgathaCurScript], a ret -AgathaScriptPointers: ; 76469 (1d:6469) +AgathaScriptPointers: dw AgathaScript0 dw DisplayEnemyTrainerTextAndStartBattle dw AgathaScript2 dw AgathaScript3 dw AgathaScript4 -AgathaScript4: ; 76473 (1d:6473) +AgathaScript4: ret -AgathaScriptWalkIntoRoom: ; 76474 (1d:6474) +AgathaScriptWalkIntoRoom: ; Walk six steps upward. ld hl, wSimulatedJoypadStatesEnd ld a, D_UP @@ -59,7 +59,7 @@ AgathaScriptWalkIntoRoom: ; 76474 (1d:6474) ld [wCurMapScript], a ret -AgathaScript0: ; 76490 (1d:6490) +AgathaScript0: ld hl, AgathaEntranceCoords call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers @@ -87,14 +87,14 @@ AgathaScript0: ; 76490 (1d:6490) ld [wCurMapScript], a ret -AgathaEntranceCoords: ; 764d1 (1d:64d1) +AgathaEntranceCoords: db $0A,$04 db $0A,$05 db $0B,$04 db $0B,$05 db $FF -AgathaScript3: ; 764da (1d:64da) +AgathaScript3: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -105,7 +105,7 @@ AgathaScript3: ; 764da (1d:64da) ld [wCurMapScript], a ret -AgathaScript2: ; 764ed (1d:64ed) +AgathaScript2: call EndTrainerBattle ld a, [wIsInBattle] cp $ff @@ -117,12 +117,12 @@ AgathaScript2: ; 764ed (1d:64ed) ld [wGaryCurScript], a ret -AgathaTextPointers: ; 76505 (1d:6505) +AgathaTextPointers: dw AgathaText1 dw AgathaDontRunAwayText -AgathaTrainerHeaders: ; 76509 (1d:6509) -AgathaTrainerHeader0: ; 76509 (1d:6509) +AgathaTrainerHeaders: +AgathaTrainerHeader0: dbEventFlagBit EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_AGATHAS_ROOM_TRAINER_0 @@ -133,24 +133,24 @@ AgathaTrainerHeader0: ; 76509 (1d:6509) db $ff -AgathaText1: ; 76516 (1d:6516) +AgathaText1: TX_ASM ld hl, AgathaTrainerHeader0 call TalkToTrainer jp TextScriptEnd -AgathaBeforeBattleText: ; 76520 (1d:6520) +AgathaBeforeBattleText: TX_FAR _AgathaBeforeBattleText db "@" -AgathaEndBattleText: ; 76525 (1d:6525) +AgathaEndBattleText: TX_FAR _AgathaEndBattleText db "@" -AgathaAfterBattleText: ; 7652a (1d:652a) +AgathaAfterBattleText: TX_FAR _AgathaAfterBattleText db "@" -AgathaDontRunAwayText: ; 7652f (1d:652f) +AgathaDontRunAwayText: TX_FAR _AgathaDontRunAwayText db "@" diff --git a/scripts/beach_house.asm b/scripts/beach_house.asm index fb0d78f2..19554ba7 100644 --- a/scripts/beach_house.asm +++ b/scripts/beach_house.asm @@ -19,7 +19,7 @@ SurfinDudeText: call PrintText jr .done .next - ld hl, wPreventBlackout + ld hl, wd492 bit 0, [hl] set 0, [hl] jr nz, .next2 @@ -36,7 +36,7 @@ SurfinDudeText: ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a callba SurfingPikachuMinigame - ld hl, wPreventBlackout + ld hl, wd492 set 1, [hl] jr .done .asm_f226b @@ -133,7 +133,7 @@ BeachHouseSign4Text: bit 6, a jr z, .asm_f2369 - ld hl, wPreventBlackout + ld hl, wd492 bit 1, [hl] jr z, .next2 ld a, 0 @@ -141,7 +141,7 @@ BeachHouseSign4Text: .next2 ld hl, .BeachHousePrinterText2 call PrintText - ld a, [wPreventBlackout] + ld a, [wd492] bit 1, a jr z, .asm_f236f @@ -152,13 +152,13 @@ BeachHouseSign4Text: call YesNoChoice ld a, [wCurrentMenuItem] and a - jp z, Func_f23d0 ; 0xf23d0 + jp z, Func_f23d0 call SaveScreenTilesToBuffer2 ld hl, wd730 set 6, [hl] xor a ld [wUpdateSpritesEnabled], a - callab Func_e910a + callab Printer_PrepareSurfingMinigameHighScoreTileMap call WaitForTextScrollButtonPress ld hl, wd730 res 6, [hl] diff --git a/scripts/beach_house2.asm b/scripts/beach_house2.asm index a2dd2114..03e77ecb 100755 --- a/scripts/beach_house2.asm +++ b/scripts/beach_house2.asm @@ -1,10 +1,10 @@ -Func_f23d0: ; f23d0 +Func_f23d0: call SaveScreenTilesToBuffer2 xor a ld [wUpdateSpritesEnabled], a ld hl, wd730 set 6, [hl] - callab Func_e8c5c + callab PrintSurfingMinigameHighScore ld hl, wd730 res 6, [hl] call GBPalWhiteOutWithDelay3 diff --git a/scripts/bikeshop.asm b/scripts/bikeshop.asm index 5723849d..5ebd1fb6 100755 --- a/scripts/bikeshop.asm +++ b/scripts/bikeshop.asm @@ -1,13 +1,13 @@ -BikeShopScript: ; 1d73c (7:573c) +BikeShopScript: call EnableAutoTextBoxDrawing ret -BikeShopTextPointers: ; 1d73f (7:573f) +BikeShopTextPointers: dw BikeShopText1 dw BikeShopText2 dw BikeShopText3 -BikeShopText1: ; 1d745 (7:5745) +BikeShopText1: TX_ASM CheckEvent EVENT_GOT_BICYCLE jr z, .asm_260d4 @@ -82,57 +82,57 @@ BikeShopText1: ; 1d745 (7:5745) .Done jp TextScriptEnd -BikeShopMenuText: ; 1d7f8 (7:57f8) +BikeShopMenuText: db "BICYCLE" next "CANCEL@" -BikeShopMenuPrice: ; 1d807 (7:5807) +BikeShopMenuPrice: db "¥1000000@" -BikeShopText_1d810: ; 1d810 (7:5810) +BikeShopText_1d810: TX_FAR _BikeShopText_1d810 db "@" -BikeShopText_1d815: ; 1d815 (7:5815) +BikeShopText_1d815: TX_FAR _BikeShopText_1d815 db "@" -BikeShopCantAffordText: ; 1d81a (7:581a) - TX_FAR _BikeShopText_1d81a +BikeShopCantAffordText: + TX_FAR _BikeShopCantAffordText db "@" -BikeShopText_1d81f: ; 1d81f (7:581f) +BikeShopText_1d81f: TX_FAR _BikeShopText_1d81f db "@" -BikeShopText_1d824: ; 1d824 (7:5824) +BikeShopText_1d824: TX_FAR _BikeShopText_1d824 TX_SFX_KEY_ITEM db "@" -BikeShopComeAgainText: ; 1d82a (7:582a) - TX_FAR _BikeShopText_1d82a +BikeShopComeAgainText: + TX_FAR _BikeShopComeAgainText db "@" -BikeShopText_1d82f: ; 1d82f (7:582f) +BikeShopText_1d82f: TX_FAR _BikeShopText_1d82f db "@" -BikeShopText_1d834: ; 1d834 (7:5834) +BikeShopText_1d834: TX_FAR _BikeShopText_1d834 db "@" -BikeShopText2: ; 1d839 (7:5839) +BikeShopText2: TX_ASM ld hl, BikeShopText_1d843 call PrintText jp TextScriptEnd -BikeShopText_1d843: ; 1d843 (7:5843) +BikeShopText_1d843: TX_FAR _BikeShopText_1d843 db "@" -BikeShopText3: ; 1d848 (7:5848) +BikeShopText3: TX_ASM CheckEvent EVENT_GOT_BICYCLE ld hl, BikeShopText_1d861 @@ -142,10 +142,10 @@ BikeShopText3: ; 1d848 (7:5848) call PrintText jp TextScriptEnd -BikeShopText_1d85c: ; 1d85c (7:585c) +BikeShopText_1d85c: TX_FAR _BikeShopText_1d85c db "@" -BikeShopText_1d861: ; 1d861 (7:5861) +BikeShopText_1d861: TX_FAR _BikeShopText_1d861 db "@" diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index 8c800748..c7fd74f9 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -1,4 +1,4 @@ -BillsHouseScript: ; 1e76a (7:676a) +BillsHouseScript: call BillsHouseScript_1e09e call EnableAutoTextBoxDrawing ld a, [wBillsHouseCurScript] @@ -6,7 +6,7 @@ BillsHouseScript: ; 1e76a (7:676a) call JumpTable ret -BillsHouseScriptPointers: ; 1e776 (7:6776) +BillsHouseScriptPointers: dw BillsHouseScript0 dw BillsHouseScript1 dw BillsHouseScript2 @@ -19,12 +19,11 @@ BillsHouseScriptPointers: ; 1e776 (7:6776) dw BillsHouseScript9 BillsHouseScript_1e09e: - ld hl, wPreventBlackout + ld hl, wd492 bit 7, [hl] set 7, [hl] ret nz - ld hl, wd7f2 - bit 5, [hl] + CheckEventHL EVENT_MET_BILL_2 jr z, .asm_1e0af jr .asm_1e0b3 @@ -38,11 +37,11 @@ BillsHouseScript_1e09e: ld [wBillsHouseCurScript], a ret -BillsHouseScript0: ; 1e782 (7:6782) +BillsHouseScript0: ld a, [wd472] bit 7, a jr z, .asm_1e0d2 - callab Func_fce73 + callab CheckPikachuFaintedOrStatused jr c, .asm_1e0d2 callab Func_f24d5 .asm_1e0d2 @@ -52,13 +51,13 @@ BillsHouseScript0: ; 1e782 (7:6782) ld [wBillsHouseCurScript], a ret -BillsHouseScript1: ; 1e783 (7:6783) +BillsHouseScript1: ret BillsHouseScript2: ld a, $ff ld [wJoyIgnore], a - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] and a ; cp SPRITE_FACING_DOWN ld de, MovementData_1e79c jr nz, .notDown @@ -75,14 +74,14 @@ BillsHouseScript2: ld [wBillsHouseCurScript], a ret -MovementData_1e79c: ; 1e79c (7:679c) +MovementData_1e79c: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db $FF ; make Bill walk around the player -MovementData_1e7a0: ; 1e7a0 (7:67a0) +MovementData_1e7a0: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP @@ -90,7 +89,7 @@ MovementData_1e7a0: ; 1e7a0 (7:67a0) db NPC_MOVEMENT_UP db $FF -BillsHouseScript3: ; 1e7a6 (7:67a6) +BillsHouseScript3: ld a, [wd730] bit 0, a ret nz @@ -100,12 +99,12 @@ BillsHouseScript3: ; 1e7a6 (7:67a6) call CheckPikachuFollowingPlayer jr z, .asm_1e13e ld hl, PikachuMovementData_1e14d - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] and a ; cp SPRITE_FACING_DOWN jr nz, .asm_1e133 ld hl, PikachuMovementData_1e152 .asm_1e133 - call Func_159b + call ApplyPikachuMovementData callab InitializePikachuTextID .asm_1e13e xor a @@ -132,7 +131,7 @@ PikachuMovementData_1e152: db $36 db $3f -BillsHouseScript4: ; 1e7c5 (7:67c5) +BillsHouseScript4: CheckEvent EVENT_USED_CELL_SEPARATOR_ON_BILL ret z ld a, $fc @@ -169,7 +168,7 @@ BillsHouseScript5: ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld hl, PikachuMovementData_1e1a9 - call Func_159b + call ApplyPikachuMovementData ld a, $f ld [wEmotionBubbleSpriteIndex], a ld a, $0 @@ -185,7 +184,7 @@ BillsHouseScript5: ld [wBillsHouseCurScript], a ret -MovementData_1e807: ; 1e807 (7:6807) +MovementData_1e807: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT @@ -198,7 +197,7 @@ PikachuMovementData_1e1a9: db $37 db $3f -BillsHouseScript6: ; 1e80d (7:680d) +BillsHouseScript6: ld a, [wd730] bit 0, a ret nz @@ -212,7 +211,7 @@ BillsHouseScript7: xor a ld [wPlayerMovingDirection], a ld a, SPRITE_FACING_UP - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, $FF ^ (A_BUTTON | B_BUTTON) ld [wJoyIgnore], a ld de, RLE_1e219 @@ -236,7 +235,7 @@ BillsHouseScript8: xor a ld [wPlayerMovingDirection], a ld a, SPRITE_FACING_UP - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, $2 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_DOWN @@ -251,30 +250,30 @@ BillsHouseScript8: ld [wBillsHouseCurScript], a ret -BillsHouseScript9: ; 1e827 (7:6827) +BillsHouseScript9: ret -BillsHouseTextPointers: ; 1e834 (7:6834) +BillsHouseTextPointers: dw BillsHouseText1 dw BillsHouseText2 dw BillsHouseText3 dw BillsHouseText4 -BillsHouseText4: ; 1e83c (7:683c) +BillsHouseText4: TX_FAR _BillsHouseDontLeaveText db "@" -BillsHouseText1: ; 1e83d (7:683d) +BillsHouseText1: TX_ASM callba Func_f2418 jp TextScriptEnd -BillsHouseText2: ; 1e874 (7:6874) +BillsHouseText2: TX_ASM callba Func_f244a jp TextScriptEnd -BillsHouseText3: ; 1e8d0 (7:68d0) +BillsHouseText3: TX_ASM callba Func_f24a2 jp TextScriptEnd diff --git a/scripts/billshouse2.asm b/scripts/billshouse2.asm index a93f5558..87016aa8 100755 --- a/scripts/billshouse2.asm +++ b/scripts/billshouse2.asm @@ -83,7 +83,7 @@ BillsHouseText_f24a9: TX_FAR _BillsHouseText_1e8da db "@" -Func_f24ae: ; f24ae +Func_f24ae: ld a, [wCurMap] cp BILLS_HOUSE jr nz, .asm_f24d2 @@ -114,7 +114,7 @@ Func_f24d5: call UpdateSprites call UpdateSprites ld hl, Data_f2505 - call Func_159b + call ApplyPikachuMovementData ld a, $f ; pikachu ld [wEmotionBubbleSpriteIndex], a ld a, $1 @@ -135,10 +135,10 @@ Data_f2505: Func_f250b: ld hl, Data_f251c ld b, SPRITE_FACING_UP - call Func_f0a82 + call TryApplyPikachuMovementData ld hl, Data_f2521 ld b, SPRITE_FACING_RIGHT - call Func_f0a82 + call TryApplyPikachuMovementData ret Data_f251c: diff --git a/scripts/blueshouse.asm b/scripts/blueshouse.asm index baea53d0..161955c1 100755 --- a/scripts/blueshouse.asm +++ b/scripts/blueshouse.asm @@ -1,29 +1,29 @@ -BluesHouseScript: ; 19b3b (6:5b3b) +BluesHouseScript: call EnableAutoTextBoxDrawing ld hl, BluesHouseScriptPointers xor a call JumpTable ret -BluesHouseScriptPointers: ; 19b47 (6:5b47) +BluesHouseScriptPointers: dw BluesHouseScript0 dw BluesHouseScript1 -BluesHouseScript0: ; 19b4b (6:5b4b) +BluesHouseScript0: SetEvent EVENT_ENTERED_BLUES_HOUSE ; trigger the next script ld a, 1 ld [wBluesHouseCurScript], a -BluesHouseScript1: ; 19b56 (6:5b56) +BluesHouseScript1: ret -BluesHouseTextPointers: ; 19b57 (6:5b57) +BluesHouseTextPointers: dw BluesHouseText1 dw BluesHouseText2 dw BluesHouseText3 -BluesHouseText1: ; 19b5d (6:5b5d) +BluesHouseText1: TX_ASM CheckEvent EVENT_GOT_TOWN_MAP jr nz, .GotMap @@ -55,31 +55,31 @@ BluesHouseText1: ; 19b5d (6:5b5d) .done jp TextScriptEnd -DaisyInitialText: ; 19baa (6:5baa) +DaisyInitialText: TX_FAR _DaisyInitialText db "@" -DaisyOfferMapText: ; 19baf (6:5baf) +DaisyOfferMapText: TX_FAR _DaisyOfferMapText db "@" -GotMapText: ; 19bb4 (6:5bb4) +GotMapText: TX_FAR _GotMapText sound0x0A db "@" -DaisyBagFullText: ; 19bba (6:5bba) +DaisyBagFullText: TX_FAR _DaisyBagFullText db "@" -DaisyUseMapText: ; 19bbf (6:5bbf) +DaisyUseMapText: TX_FAR _DaisyUseMapText db "@" -BluesHouseText2: ; 0x19bc4 Daisy, walking around +BluesHouseText2: ; Daisy, walking around TX_FAR _BluesHouseText2 db "@" -BluesHouseText3: ; 0x19bc9 map on table +BluesHouseText3: ; map on table TX_FAR _BluesHouseText3 db "@" diff --git a/scripts/bruno.asm b/scripts/bruno.asm index 416a1757..a10a1e49 100755 --- a/scripts/bruno.asm +++ b/scripts/bruno.asm @@ -1,4 +1,4 @@ -BrunoScript: ; 762d6 (1d:62d6) +BrunoScript: call BrunoShowOrHideExitBlock call EnableAutoTextBoxDrawing ld hl, BrunoTrainerHeaders @@ -8,7 +8,7 @@ BrunoScript: ; 762d6 (1d:62d6) ld [wBrunoCurScript], a ret -BrunoShowOrHideExitBlock: ; 762ec (1d:62ec) +BrunoShowOrHideExitBlock: ; Blocks or clears the exit to the next room. ld hl, wCurrentMapScriptFlags bit 5, [hl] @@ -26,22 +26,22 @@ BrunoShowOrHideExitBlock: ; 762ec (1d:62ec) lb bc, 0, 2 predef_jump ReplaceTileBlock -ResetBrunoScript: ; 7630d (1d:630d) +ResetBrunoScript: xor a ld [wBrunoCurScript], a ret -BrunoScriptPointers: ; 76312 (1d:6312) +BrunoScriptPointers: dw BrunoScript0 dw DisplayEnemyTrainerTextAndStartBattle dw BrunoScript2 dw BrunoScript3 dw BrunoScript4 -BrunoScript4: ; 7631c (1d:631c) +BrunoScript4: ret -BrunoScriptWalkIntoRoom: ; 7631d (1d:631d) +BrunoScriptWalkIntoRoom: ; Walk six steps upward. ld hl, wSimulatedJoypadStatesEnd ld a, D_UP @@ -59,7 +59,7 @@ BrunoScriptWalkIntoRoom: ; 7631d (1d:631d) ld [wCurMapScript], a ret -BrunoScript0: ; 76339 (1d:6339) +BrunoScript0: ld hl, BrunoEntranceCoords call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers @@ -87,14 +87,14 @@ BrunoScript0: ; 76339 (1d:6339) ld [wCurMapScript], a ret -BrunoEntranceCoords: ; 7637a (1d:637a) +BrunoEntranceCoords: db $0A,$04 db $0A,$05 db $0B,$04 db $0B,$05 db $FF -BrunoScript3: ; 76383 (1d:6383) +BrunoScript3: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -105,7 +105,7 @@ BrunoScript3: ; 76383 (1d:6383) ld [wCurMapScript], a ret -BrunoScript2: ; 76396 (1d:6396) +BrunoScript2: call EndTrainerBattle ld a, [wIsInBattle] cp $ff @@ -114,12 +114,12 @@ BrunoScript2: ; 76396 (1d:6396) ld [hSpriteIndexOrTextID], a jp DisplayTextID -BrunoTextPointers: ; 763a8 (1d:63a8) +BrunoTextPointers: dw BrunoText1 dw BrunoDontRunAwayText -BrunoTrainerHeaders: ; 763ac (1d:63ac) -BrunoTrainerHeader0: ; 763ac (1d:63ac) +BrunoTrainerHeaders: +BrunoTrainerHeader0: dbEventFlagBit EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_BRUNOS_ROOM_TRAINER_0 @@ -130,24 +130,24 @@ BrunoTrainerHeader0: ; 763ac (1d:63ac) db $ff -BrunoText1: ; 763b9 (1d:63b9) +BrunoText1: TX_ASM ld hl, BrunoTrainerHeader0 call TalkToTrainer jp TextScriptEnd -BrunoBeforeBattleText: ; 763c3 (1d:63c3) +BrunoBeforeBattleText: TX_FAR _BrunoBeforeBattleText db "@" -BrunoEndBattleText: ; 763c8 (1d:63c8) +BrunoEndBattleText: TX_FAR _BrunoEndBattleText db "@" -BrunoAfterBattleText: ; 763cd (1d:63cd) +BrunoAfterBattleText: TX_FAR _BrunoAfterBattleText db "@" -BrunoDontRunAwayText: ; 763d2 (1d:63d2) +BrunoDontRunAwayText: TX_FAR _BrunoDontRunAwayText db "@" diff --git a/scripts/celadoncity.asm b/scripts/celadoncity.asm index 998be7d8..04fa0a28 100755 --- a/scripts/celadoncity.asm +++ b/scripts/celadoncity.asm @@ -1,4 +1,4 @@ -CeladonCityScript: ; 19a43 (6:5a43) +CeladonCityScript: call EnableAutoTextBoxDrawing ld hl, CeladonCityScriptPointers ld a, [wCeladonCityCurScript] @@ -13,7 +13,7 @@ CeladonCityScript1: ResetEvent EVENT_67F ret -CeladonCityTextPointers: ; 19966 (6:5966) +CeladonCityTextPointers: dw CeladonCityText1 dw CeladonCityText2 dw CeladonCityText3 @@ -33,23 +33,23 @@ CeladonCityTextPointers: ; 19966 (6:5966) dw CeladonCityText17 dw CeladonCityText18 -CeladonCityText1: ; 1998a (6:598a) +CeladonCityText1: TX_FAR _CeladonCityText1 db "@" -CeladonCityText2: ; 1998f (6:598f) +CeladonCityText2: TX_FAR _CeladonCityText2 db "@" -CeladonCityText3: ; 19994 (6:5994) +CeladonCityText3: TX_FAR _CeladonCityText3 db "@" -CeladonCityText4: ; 19999 (6:5999) +CeladonCityText4: TX_FAR _CeladonCityText4 db "@" -CeladonCityText5: ; 1999e (6:599e) +CeladonCityText5: TX_ASM CheckEvent EVENT_GOT_TM41 jr nz, .asm_7053f @@ -72,70 +72,70 @@ CeladonCityText5: ; 1999e (6:599e) .Done jp TextScriptEnd -TM41PreText: ; 199d2 (6:59d2) +TM41PreText: TX_FAR _TM41PreText db "@" -ReceivedTM41Text: ; 199d7 (6:59d7) +ReceivedTM41Text: TX_FAR _ReceivedTM41Text db $0B, "@" -TM41ExplanationText: ; 199dd (6:59dd) +TM41ExplanationText: TX_FAR _TM41ExplanationText db "@" -TM41NoRoomText: ; 199e2 (6:59e2) +TM41NoRoomText: TX_FAR _TM41NoRoomText db "@" -CeladonCityText6: ; 199e7 (6:59e7) +CeladonCityText6: TX_FAR _CeladonCityText6 db "@" -CeladonCityText7: ; 199ec (6:59ec) +CeladonCityText7: TX_FAR _CeladonCityText7 TX_ASM ld a, POLIWRATH call PlayCry jp TextScriptEnd -CeladonCityText8: ; 199f9 (6:59f9) +CeladonCityText8: TX_FAR _CeladonCityText8 db "@" -CeladonCityText9: ; 199fe (6:59fe) +CeladonCityText9: TX_FAR _CeladonCityText9 db "@" -CeladonCityText10: ; 19a03 (6:5a03) +CeladonCityText10: TX_ASM callba Func_f1ac6 jp TextScriptEnd -CeladonCityText11: ; 19a08 (6:5a08) +CeladonCityText11: TX_FAR _CeladonCityText11 db "@" -CeladonCityText13: ; 19a0d (6:5a0d) +CeladonCityText13: TX_FAR _CeladonCityText13 db "@" -CeladonCityText14: ; 19a12 (6:5a12) +CeladonCityText14: TX_FAR _CeladonCityText14 db "@" -CeladonCityText15: ; 19a17 (6:5a17) +CeladonCityText15: TX_FAR _CeladonCityText15 db "@" -CeladonCityText16: ; 19a1c (6:5a1c) +CeladonCityText16: TX_FAR _CeladonCityText16 db "@" -CeladonCityText17: ; 19a21 (6:5a21) +CeladonCityText17: TX_FAR _CeladonCityText17 db "@" -CeladonCityText18: ; 19a26 (6:5a26) +CeladonCityText18: TX_FAR _CeladonCityText18 db "@" diff --git a/scripts/celadondiner.asm b/scripts/celadondiner.asm index 944a0952..6ecada9e 100755 --- a/scripts/celadondiner.asm +++ b/scripts/celadondiner.asm @@ -1,31 +1,31 @@ -CeladonDinerScript: ; 49151 (12:5151) +CeladonDinerScript: call EnableAutoTextBoxDrawing ret -CeladonDinerTextPointers: ; 49155 (12:5155) +CeladonDinerTextPointers: dw CeladonDinerText1 dw CeladonDinerText2 dw CeladonDinerText3 dw CeladonDinerText4 dw CeladonDinerText5 -CeladonDinerText1: ; 4915f (12:515f) +CeladonDinerText1: TX_FAR _CeladonDinerText1 db "@" -CeladonDinerText2: ; 49164 (12:5164) +CeladonDinerText2: TX_FAR _CeladonDinerText2 db "@" -CeladonDinerText3: ; 49169 (12:5169) +CeladonDinerText3: TX_FAR _CeladonDinerText3 db "@" -CeladonDinerText4: ; 4916e (12:516e) +CeladonDinerText4: TX_FAR _CeladonDinerText4 db "@" -CeladonDinerText5: ; 49173 (12:5173) +CeladonDinerText5: TX_ASM callab Func_f1f31 jp TextScriptEnd diff --git a/scripts/celadondiner2.asm b/scripts/celadondiner2.asm index cfab218b..8cd66a19 100755 --- a/scripts/celadondiner2.asm +++ b/scripts/celadondiner2.asm @@ -20,19 +20,19 @@ Func_f1f31: .asm_68b61 ret -CeladonDinerText_491a7: ; 491a7 (12:51a7) +CeladonDinerText_491a7: TX_FAR _CeladonDinerText_491a7 db "@" -ReceivedCoinCaseText: ; 491ac (12:51ac) +ReceivedCoinCaseText: TX_FAR _ReceivedCoinCaseText TX_SFX_KEY_ITEM db "@" -CoinCaseNoRoomText: ; 491b2 (12:51b2) +CoinCaseNoRoomText: TX_FAR _CoinCaseNoRoomText db "@" -CeladonDinerText_491b7: ; 491b7 (12:51b7) +CeladonDinerText_491b7: TX_FAR _CeladonDinerText_491b7 db "@" diff --git a/scripts/celadongamecorner.asm b/scripts/celadongamecorner.asm index a8454dbd..43aae927 100755 --- a/scripts/celadongamecorner.asm +++ b/scripts/celadongamecorner.asm @@ -1,4 +1,4 @@ -CeladonGameCornerScript: ; 48bbd (12:4bbd) +CeladonGameCornerScript: call CeladonGameCornerScript_48bcf call CeladonGameCornerScript_48bec call EnableAutoTextBoxDrawing @@ -6,7 +6,7 @@ CeladonGameCornerScript: ; 48bbd (12:4bbd) ld a, [wCeladonGameCornerCurScript] jp JumpTable -CeladonGameCornerScript_48bcf: ; 48bcf (12:4bcf) +CeladonGameCornerScript_48bcf: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] @@ -23,7 +23,7 @@ CeladonGameCornerScript_48bcf: ; 48bcf (12:4bcf) ld [wLuckySlotHiddenObjectIndex], a ret -CeladonGameCornerScript_48bec: ; 48bec (12:4bec) +CeladonGameCornerScript_48bec: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -35,22 +35,22 @@ CeladonGameCornerScript_48bec: ; 48bec (12:4bec) lb bc, 2, 8 predef_jump ReplaceTileBlock -CeladonGameCornerScript_48c07: ; 48c07 (12:4c07) +CeladonGameCornerScript_48c07: xor a ld [wJoyIgnore], a ld [wCeladonGameCornerCurScript], a ld [wCurMapScript], a ret -CeladonGameCornerScriptPointers: ; 48c12 (12:4c12) +CeladonGameCornerScriptPointers: dw CeladonGameCornerScript0 dw CeladonGameCornerScript1 dw CeladonGameCornerScript2 -CeladonGameCornerScript0: ; 48c18 (12:4c18) +CeladonGameCornerScript0: ret -CeladonGameCornerScript1: ; 48c19 (12:4c19) +CeladonGameCornerScript1: ld a, [wIsInBattle] cp $ff jp z, CeladonGameCornerScript_48c07 @@ -85,7 +85,7 @@ CeladonGameCornerScript1: ; 48c19 (12:4c19) ld [wCeladonGameCornerCurScript], a ret -MovementData_48c5a: ; 48c5a (12:4c5a) +MovementData_48c5a: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT @@ -96,7 +96,7 @@ MovementData_48c5a: ; 48c5a (12:4c5a) db NPC_MOVEMENT_RIGHT db $FF -MovementData_48c63: ; 48c63 (12:4c63) +MovementData_48c63: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT @@ -104,7 +104,7 @@ MovementData_48c63: ; 48c63 (12:4c63) db NPC_MOVEMENT_RIGHT db $FF -CeladonGameCornerScript2: ; 48c69 (12:4c69) +CeladonGameCornerScript2: ld a, [wd730] bit 0, a ret nz @@ -120,7 +120,7 @@ CeladonGameCornerScript2: ; 48c69 (12:4c69) ld [wCeladonGameCornerCurScript], a ret -CeladonGameCornerTextPointers: ; 48c8a (12:4c8a) +CeladonGameCornerTextPointers: dw CeladonGameCornerText1 dw CeladonGameCornerText2 dw CeladonGameCornerText3 @@ -135,11 +135,11 @@ CeladonGameCornerTextPointers: ; 48c8a (12:4c8a) dw CeladonGameCornerText12 dw CeladonGameCornerText13 -CeladonGameCornerText1: ; 48ca4 (12:4ca4) +CeladonGameCornerText1: TX_FAR _CeladonGameCornerText1 db "@" -CeladonGameCornerText2: ; 48ca9 (12:4ca9) +CeladonGameCornerText2: TX_ASM call CeladonGameCornerScript_48f1e ld hl, CeladonGameCornerText_48d22 @@ -196,39 +196,39 @@ CeladonGameCornerText2: ; 48ca9 (12:4ca9) call PrintText jp TextScriptEnd -CeladonGameCornerText_48d22: ; 48d22 (12:4d22) +CeladonGameCornerText_48d22: TX_FAR _CeladonGameCornerText_48d22 db "@" -CeladonGameCornerText_48d27: ; 48d27 (12:4d27) +CeladonGameCornerText_48d27: TX_FAR _CeladonGameCornerText_48d27 db "@" -CeladonGameCornerText_48d2c: ; 48d2c (12:4d2c) +CeladonGameCornerText_48d2c: TX_FAR _CeladonGameCornerText_48d2c db "@" -CeladonGameCornerText_48d31: ; 48d31 (12:4d31) +CeladonGameCornerText_48d31: TX_FAR _CeladonGameCornerText_48d31 db "@" -CeladonGameCornerText_48d36: ; 48d36 (12:4d36) +CeladonGameCornerText_48d36: TX_FAR _CeladonGameCornerText_48d36 db "@" -CeladonGameCornerText_48d3b: ; 48d3b (12:4d3b) +CeladonGameCornerText_48d3b: TX_FAR _CeladonGameCornerText_48d3b db "@" -CeladonGameCornerText3: ; 48d40 (12:4d40) +CeladonGameCornerText3: TX_FAR _CeladonGameCornerText3 db "@" -CeladonGameCornerText4: ; 48d45 (12:4d45) +CeladonGameCornerText4: TX_FAR _CeladonGameCornerText4 db "@" -CeladonGameCornerText5: ; 48d4a (12:4d4a) +CeladonGameCornerText5: TX_ASM CheckEvent EVENT_GOT_10_COINS jr nz, .asm_48d89 @@ -265,28 +265,28 @@ CeladonGameCornerText5: ; 48d4a (12:4d4a) call PrintText jp TextScriptEnd -CeladonGameCornerText_48d9c: ; 48d9c (12:4d9c) +CeladonGameCornerText_48d9c: TX_FAR _CeladonGameCornerText_48d9c db "@" -Received10CoinsText: ; 48da1 (12:4da1) +Received10CoinsText: TX_FAR _Received10CoinsText TX_SFX_ITEM db "@" -CeladonGameCornerText_48da7: ; 48da7 (12:4da7) +CeladonGameCornerText_48da7: TX_FAR _CeladonGameCornerText_48da7 db "@" -CeladonGameCornerText_48dac: ; 48dac (12:4dac) +CeladonGameCornerText_48dac: TX_FAR _CeladonGameCornerText_48dac db "@" -CeladonGameCornerText6: ; 48db1 (12:4db1) +CeladonGameCornerText6: TX_FAR _CeladonGameCornerText6 db "@" -CeladonGameCornerText7: ; 48db6 (12:4db6) +CeladonGameCornerText7: TX_ASM CheckEvent EVENT_BEAT_ERIKA ld hl, CeladonGameCornerText_48dca @@ -296,19 +296,19 @@ CeladonGameCornerText7: ; 48db6 (12:4db6) call PrintText jp TextScriptEnd -CeladonGameCornerText_48dca: ; 48dca (12:4dca) +CeladonGameCornerText_48dca: TX_FAR _CeladonGameCornerText_48dca db "@" -CeladonGameCornerText_48dcf: ; 48dcf (12:4dcf) +CeladonGameCornerText_48dcf: TX_FAR _CeladonGameCornerText_48dcf db "@" -CeladonGameCornerText8: ; 48dd4 (12:4dd4) +CeladonGameCornerText8: TX_FAR _CeladonGameCornerText8 db "@" -CeladonGameCornerText9: ; 48dd9 (12:4dd9) +CeladonGameCornerText9: TX_ASM CheckEvent EVENT_GOT_20_COINS_2 jr nz, .asm_48e13 @@ -343,23 +343,23 @@ CeladonGameCornerText9: ; 48dd9 (12:4dd9) call PrintText jp TextScriptEnd -CeladonGameCornerText_48e26: ; 48e26 (12:4e26) +CeladonGameCornerText_48e26: TX_FAR _CeladonGameCornerText_48e26 db "@" -Received20CoinsText: ; 48e2b (12:4e2b) +Received20CoinsText: TX_FAR _Received20CoinsText db $0B, "@" -CeladonGameCornerText_48e31: ; 48e31 (12:4e31) +CeladonGameCornerText_48e31: TX_FAR _CeladonGameCornerText_48e31 db "@" -CeladonGameCornerText_48e36: ; 48e36 (12:4e36) +CeladonGameCornerText_48e36: TX_FAR _CeladonGameCornerText_48e36 db "@" -CeladonGameCornerText10: ; 48e3b (12:4e3b) +CeladonGameCornerText10: TX_ASM CheckEvent EVENT_GOT_20_COINS jr nz, .asm_48e75 @@ -394,23 +394,23 @@ CeladonGameCornerText10: ; 48e3b (12:4e3b) call PrintText jp TextScriptEnd -CeladonGameCornerText_48e88: ; 48e88 (12:4e88) +CeladonGameCornerText_48e88: TX_FAR _CeladonGameCornerText_48e88 db "@" -CeladonGameCornerText_48e8d: ; 48e8d (12:4e8d) +CeladonGameCornerText_48e8d: TX_FAR _CeladonGameCornerText_48e8d db $0B, "@" -CeladonGameCornerText_48e93: ; 48e93 (12:4e93) +CeladonGameCornerText_48e93: TX_FAR _CeladonGameCornerText_48e93 db "@" -CeladonGameCornerText_48e98: ; 48e98 (12:4e98) +CeladonGameCornerText_48e98: TX_FAR _CeladonGameCornerText_48e98 db "@" -CeladonGameCornerText11: ; 48e9d (12:4e9d) +CeladonGameCornerText11: TX_ASM ld hl, CeladonGameCornerText_48ece call PrintText @@ -432,19 +432,19 @@ CeladonGameCornerText11: ; 48e9d (12:4e9d) ld [wCeladonGameCornerCurScript], a jp TextScriptEnd -CeladonGameCornerText_48ece: ; 48ece (12:4ece) +CeladonGameCornerText_48ece: TX_FAR _CeladonGameCornerText_48ece db "@" -CeladonGameCornerText_48ed3: ; 48ed3 (12:4ed3) +CeladonGameCornerText_48ed3: TX_FAR _CeladonGameCornerText_48ed3 db "@" -CeladonGameCornerText13: ; 48ed8 (12:4ed8) +CeladonGameCornerText13: TX_FAR _CeladonGameCornerText_48ed8 db "@" -CeladonGameCornerText12: ; 48edd (12:4edd) +CeladonGameCornerText12: TX_ASM ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -461,7 +461,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd) predef ReplaceTileBlock jp TextScriptEnd -CeladonGameCornerText_48f09: ; 48f09 (12:4f09) +CeladonGameCornerText_48f09: TX_FAR _CeladonGameCornerText_48f09 TX_ASM ld a, SFX_SWITCH @@ -469,11 +469,11 @@ CeladonGameCornerText_48f09: ; 48f09 (12:4f09) call WaitForSoundToFinish jp TextScriptEnd -CeladonGameCornerText_48f19: ; 48f19 (12:4f19) +CeladonGameCornerText_48f19: TX_FAR _CeladonGameCornerText_48f19 db "@" -CeladonGameCornerScript_48f1e: ; 48f1e (12:4f1e) +CeladonGameCornerScript_48f1e: ld hl, wd730 set 6, [hl] coord hl, 11, 0 @@ -507,19 +507,19 @@ CeladonGameCornerScript_48f1e: ; 48f1e (12:4f1e) res 6, [hl] ret -GameCornerMoneyText: ; 48f7a (12:4f7a) +GameCornerMoneyText: db "MONEY@" -GameCornerCoinText: ; 48f80 (12:4f80) +GameCornerCoinText: db "COIN@" -GameCornerBlankText1: ; 48f85 (12:4f85) +GameCornerBlankText1: db " @" -GameCornerBlankText2: ; 48f8d (12:4f8d) +GameCornerBlankText2: db " @" -Has9990Coins: ; 48f95 (12:4f95) +Has9990Coins: ld a, $99 ld [hCoins], a ld a, $90 diff --git a/scripts/celadongym.asm b/scripts/celadongym.asm index a9c017d0..903ef508 100755 --- a/scripts/celadongym.asm +++ b/scripts/celadongym.asm @@ -1,4 +1,4 @@ -CeladonGymScript: ; 4890a (12:490a) +CeladonGymScript: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] @@ -11,38 +11,38 @@ CeladonGymScript: ; 4890a (12:490a) ld [wCeladonGymCurScript], a ret -CeladonGymScript_48927: ; 48927 (12:4927) +CeladonGymScript_48927: ld hl, Gym4CityName ld de, Gym4LeaderName jp LoadGymLeaderAndCityName -Gym4CityName: ; 48930 (12:4930) +Gym4CityName: db "CELADON CITY@" -Gym4LeaderName: ; 4893d (12:493d) +Gym4LeaderName: db "ERIKA@" -CeladonGymText_48943: ; 48943 (12:4943) +CeladonGymText_48943: xor a ld [wJoyIgnore], a ld [wCeladonGymCurScript], a ld [wCurMapScript], a ret -CeladonGymScriptPointers: ; 4894e (12:494e) +CeladonGymScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw CeladonGymScript3 -CeladonGymScript3: ; 48956 (12:4956) +CeladonGymScript3: ld a, [wIsInBattle] cp $ff jp z, CeladonGymText_48943 ld a, $f0 ld [wJoyIgnore], a -CeladonGymText_48963: ; 48963 (12:4963) +CeladonGymText_48963: ld a, $9 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -70,7 +70,7 @@ CeladonGymText_48963: ; 48963 (12:4963) jp CeladonGymText_48943 -CeladonGymTextPointers: ; 489a6 (12:49a6) +CeladonGymTextPointers: dw CeladonGymText1 dw CeladonGymText2 dw CeladonGymText3 @@ -83,8 +83,8 @@ CeladonGymTextPointers: ; 489a6 (12:49a6) dw TM21Text dw TM21NoRoomText -CeladonGymTrainerHeaders: ; 489bc (12:49bc) -CeladonGymTrainerHeader0: ; 489bc (12:49bc) +CeladonGymTrainerHeaders: +CeladonGymTrainerHeader0: dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_0 @@ -93,7 +93,7 @@ CeladonGymTrainerHeader0: ; 489bc (12:49bc) dw CeladonGymEndBattleText2 ; TextEndBattle dw CeladonGymEndBattleText2 ; TextEndBattle -CeladonGymTrainerHeader2: ; 489c8 (12:49c8) +CeladonGymTrainerHeader2: dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_2 @@ -102,7 +102,7 @@ CeladonGymTrainerHeader2: ; 489c8 (12:49c8) dw CeladonGymEndBattleText3 ; TextEndBattle dw CeladonGymEndBattleText3 ; TextEndBattle -CeladonGymTrainerHeader3: ; 489d4 (12:49d4) +CeladonGymTrainerHeader3: dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_3 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_3 @@ -111,7 +111,7 @@ CeladonGymTrainerHeader3: ; 489d4 (12:49d4) dw CeladonGymEndBattleText4 ; TextEndBattle dw CeladonGymEndBattleText4 ; TextEndBattle -CeladonGymTrainerHeader4: ; 489e0 (12:49e0) +CeladonGymTrainerHeader4: dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_4 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_4 @@ -120,7 +120,7 @@ CeladonGymTrainerHeader4: ; 489e0 (12:49e0) dw CeladonGymEndBattleText5 ; TextEndBattle dw CeladonGymEndBattleText5 ; TextEndBattle -CeladonGymTrainerHeader5: ; 489ec (12:49ec) +CeladonGymTrainerHeader5: dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_5 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_5 @@ -129,7 +129,7 @@ CeladonGymTrainerHeader5: ; 489ec (12:49ec) dw CeladonGymEndBattleText6 ; TextEndBattle dw CeladonGymEndBattleText6 ; TextEndBattle -CeladonGymTrainerHeader6: ; 489f8 (12:49f8) +CeladonGymTrainerHeader6: dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_6 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_6 @@ -138,7 +138,7 @@ CeladonGymTrainerHeader6: ; 489f8 (12:49f8) dw CeladonGymEndBattleText7 ; TextEndBattle dw CeladonGymEndBattleText7 ; TextEndBattle -CeladonGymTrainerHeader7: ; 48a04 (12:4a04) +CeladonGymTrainerHeader7: dbEventFlagBit EVENT_BEAT_CELADON_GYM_TRAINER_7, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_CELADON_GYM_TRAINER_7, 1 @@ -149,7 +149,7 @@ CeladonGymTrainerHeader7: ; 48a04 (12:4a04) db $ff -CeladonGymText1: ; 48a11 (12:4a11) +CeladonGymText1: TX_ASM CheckEvent EVENT_BEAT_ERIKA jr z, .asm_48a2d @@ -183,154 +183,154 @@ CeladonGymText1: ; 48a11 (12:4a11) .asm_48a5b jp TextScriptEnd -CeladonGymText_48a5e: ; 48a5e (12:4a5e) +CeladonGymText_48a5e: TX_FAR _CeladonGymText_48a5e db "@" -CeladonGymText_48a63: ; 48a63 (12:4a63) +CeladonGymText_48a63: TX_FAR _CeladonGymText_48a63 db "@" -CeladonGymText_48a68: ; 48a68 (12:4a68) +CeladonGymText_48a68: TX_FAR _CeladonGymText_48a68 db "@" -CeladonGymText9: ; 48a6d (12:4a6d) +CeladonGymText9: TX_FAR _CeladonGymText9 db "@" -TM21Text: ; 48a72 (12:4a72) +TM21Text: TX_FAR _ReceivedTM21Text db $0B TX_FAR _TM21ExplanationText db "@" -TM21NoRoomText: ; 48a7c (12:4a7c) +TM21NoRoomText: TX_FAR _TM21NoRoomText db "@" -CeladonGymText2: ; 48a81 (12:4a81) +CeladonGymText2: TX_ASM ld hl, CeladonGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd -CeladonGymBattleText2: ; 48a8b (12:4a8b) +CeladonGymBattleText2: TX_FAR _CeladonGymBattleText2 db "@" -CeladonGymEndBattleText2: ; 48a90 (12:4a90) +CeladonGymEndBattleText2: TX_FAR _CeladonGymEndBattleText2 db "@" -CeladonGymAfterBattleText2: ; 48a95 (12:4a95) +CeladonGymAfterBattleText2: TX_FAR _CeladonGymAfterBattleText2 db "@" -CeladonGymText3: ; 48a9a (12:4a9a) +CeladonGymText3: TX_ASM ld hl, CeladonGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd -CeladonGymBattleText3: ; 48aa4 (12:4aa4) +CeladonGymBattleText3: TX_FAR _CeladonGymBattleText3 db "@" -CeladonGymEndBattleText3: ; 48aa9 (12:4aa9) +CeladonGymEndBattleText3: TX_FAR _CeladonGymEndBattleText3 db "@" -CeladonGymAfterBattleText3: ; 48aae (12:4aae) +CeladonGymAfterBattleText3: TX_FAR _CeladonGymAfterBattleText3 db "@" -CeladonGymText4: ; 48ab3 (12:4ab3) +CeladonGymText4: TX_ASM ld hl, CeladonGymTrainerHeader3 call TalkToTrainer jp TextScriptEnd -CeladonGymBattleText4: ; 48abd (12:4abd) +CeladonGymBattleText4: TX_FAR _CeladonGymBattleText4 db "@" -CeladonGymEndBattleText4: ; 48ac2 (12:4ac2) +CeladonGymEndBattleText4: TX_FAR _CeladonGymEndBattleText4 db "@" -CeladonGymAfterBattleText4: ; 48ac7 (12:4ac7) +CeladonGymAfterBattleText4: TX_FAR _CeladonGymAfterBattleText4 db "@" -CeladonGymText5: ; 48acc (12:4acc) +CeladonGymText5: TX_ASM ld hl, CeladonGymTrainerHeader4 call TalkToTrainer jp TextScriptEnd -CeladonGymBattleText5: ; 48ad6 (12:4ad6) +CeladonGymBattleText5: TX_FAR _CeladonGymBattleText5 db "@" -CeladonGymEndBattleText5: ; 48adb (12:4adb) +CeladonGymEndBattleText5: TX_FAR _CeladonGymEndBattleText5 db "@" -CeladonGymAfterBattleText5: ; 48ae0 (12:4ae0) +CeladonGymAfterBattleText5: TX_FAR _CeladonGymAfterBattleText5 db "@" -CeladonGymText6: ; 48ae5 (12:4ae5) +CeladonGymText6: TX_ASM ld hl, CeladonGymTrainerHeader5 call TalkToTrainer jp TextScriptEnd -CeladonGymBattleText6: ; 48aef (12:4aef) +CeladonGymBattleText6: TX_FAR _CeladonGymBattleText6 db "@" -CeladonGymEndBattleText6: ; 48af4 (12:4af4) +CeladonGymEndBattleText6: TX_FAR _CeladonGymEndBattleText6 db "@" -CeladonGymAfterBattleText6: ; 48af9 (12:4af9) +CeladonGymAfterBattleText6: TX_FAR _CeladonGymAfterBattleText6 db "@" -CeladonGymText7: ; 48afe (12:4afe) +CeladonGymText7: TX_ASM ld hl, CeladonGymTrainerHeader6 call TalkToTrainer jp TextScriptEnd -CeladonGymBattleText7: ; 48b08 (12:4b08) +CeladonGymBattleText7: TX_FAR _CeladonGymBattleText7 db "@" -CeladonGymEndBattleText7: ; 48b0d (12:4b0d) +CeladonGymEndBattleText7: TX_FAR _CeladonGymEndBattleText7 db "@" -CeladonGymAfterBattleText7: ; 48b12 (12:4b12) +CeladonGymAfterBattleText7: TX_FAR _CeladonGymAfterBattleText7 db "@" -CeladonGymText8: ; 48b17 (12:4b17) +CeladonGymText8: TX_ASM ld hl, CeladonGymTrainerHeader7 call TalkToTrainer jp TextScriptEnd -CeladonGymBattleText8: ; 48b21 (12:4b21) +CeladonGymBattleText8: TX_FAR _CeladonGymBattleText8 db "@" -CeladonGymEndBattleText8: ; 48b26 (12:4b26) +CeladonGymEndBattleText8: TX_FAR _CeladonGymEndBattleText8 db "@" -CeladonGymAfterBattleText8: ; 48b2b (12:4b2b) +CeladonGymAfterBattleText8: TX_FAR _CeladonGymAfterBattleText8 db "@" diff --git a/scripts/celadonhotel.asm b/scripts/celadonhotel.asm index a0f80ff6..23b9eb55 100755 --- a/scripts/celadonhotel.asm +++ b/scripts/celadonhotel.asm @@ -1,19 +1,19 @@ -CeladonHotelScript: ; 49269 (12:5269) +CeladonHotelScript: jp EnableAutoTextBoxDrawing -CeladonHotelTextPointers: ; 4926c (12:526c) +CeladonHotelTextPointers: dw CeladonHotelText1 dw CeladonHotelText2 dw CeladonHotelText3 -CeladonHotelText1: ; 49272 (12:5272) +CeladonHotelText1: TX_FAR _CeladonHotelText1 db "@" -CeladonHotelText2: ; 49277 (12:5277) +CeladonHotelText2: TX_FAR _CeladonHotelText2 db "@" -CeladonHotelText3: ; 4927c (12:527c) +CeladonHotelText3: TX_FAR _CeladonHotelText3 db "@" diff --git a/scripts/celadonhouse.asm b/scripts/celadonhouse.asm index aa94f2fd..7f2778d1 100755 --- a/scripts/celadonhouse.asm +++ b/scripts/celadonhouse.asm @@ -1,20 +1,20 @@ -CeladonHouseScript: ; 4920e (12:520e) +CeladonHouseScript: call EnableAutoTextBoxDrawing ret -CeladonHouseTextPointers: ; 49212 (12:5212) +CeladonHouseTextPointers: dw CeladonHouseText1 dw CeladonHouseText2 dw CeladonHouseText3 -CeladonHouseText1: ; 49218 (12:5218) +CeladonHouseText1: TX_FAR _CeladonHouseText1 db "@" -CeladonHouseText2: ; 4921d (12:521d) +CeladonHouseText2: TX_FAR _CeladonHouseText2 db "@" -CeladonHouseText3: ; 49222 (12:5222) +CeladonHouseText3: TX_FAR _CeladonHouseText3 db "@" diff --git a/scripts/celadonmansion1.asm b/scripts/celadonmansion1.asm index b29ee196..59d9d1d8 100755 --- a/scripts/celadonmansion1.asm +++ b/scripts/celadonmansion1.asm @@ -1,22 +1,22 @@ -CeladonMansion1Script: ; 48694 (12:4694) +CeladonMansion1Script: call EnableAutoTextBoxDrawing ret -CeladonMansion1TextPointers: ; 48697 (12:4697) +CeladonMansion1TextPointers: dw CeladonMansion1Text1 dw CeladonMansion1Text2 dw CeladonMansion1Text3 dw CeladonMansion1Text4 dw CeladonMansion1Text5 -CeladonMansion1Text1: ; 486a7 (12:46a7) +CeladonMansion1Text1: TX_FAR _CeladonMansion1Text1 TX_ASM ld a, MEOWTH call PlayCry jp TextScriptEnd -CeladonMansion1Text2: ; 486b1 (12:46b1) +CeladonMansion1Text2: TX_ASM callba Func_f1e70 ld a, [wPikachuHappiness] @@ -29,20 +29,20 @@ CeladonMansion1Text2: ; 486b1 (12:46b1) .asm_485d9 jp TextScriptEnd -CeladonMansion1Text3: ; 486b6 (12:46b6) +CeladonMansion1Text3: TX_FAR _CeladonMansion1Text3 TX_ASM ld a, CLEFAIRY call PlayCry jp TextScriptEnd -CeladonMansion1Text4: ; 486c0 (12:46c0) +CeladonMansion1Text4: TX_FAR _CeladonMansion1Text4 TX_ASM ld a, NIDORAN_F call PlayCry jp TextScriptEnd -CeladonMansion1Text5: ; 486ca (12:46ca) +CeladonMansion1Text5: TX_FAR _CeladonMansion1Text5 db "@" diff --git a/scripts/celadonmansion2.asm b/scripts/celadonmansion2.asm index 7f7e5d45..520615d4 100755 --- a/scripts/celadonmansion2.asm +++ b/scripts/celadonmansion2.asm @@ -1,10 +1,10 @@ -CeladonMansion2Script: ; 4873a (12:473a) +CeladonMansion2Script: call EnableAutoTextBoxDrawing ret -CeladonMansion2TextPointers: ; 4873e (12:473e) +CeladonMansion2TextPointers: dw CeladonMansion2Text1 -CeladonMansion2Text1: ; 48740 (12:4740) +CeladonMansion2Text1: TX_FAR _CeladonMansion2Text1 db "@" diff --git a/scripts/celadonmansion3.asm b/scripts/celadonmansion3.asm index 191d9304..6693f6a6 100755 --- a/scripts/celadonmansion3.asm +++ b/scripts/celadonmansion3.asm @@ -1,4 +1,4 @@ -CeladonMansion3Script: ; 48790 (12:4790) +CeladonMansion3Script: call EnableAutoTextBoxDrawing ret @@ -9,7 +9,7 @@ CeladonMansion3_PokedexCount: ld a, [wNumSetBits] ret -CeladonMansion3TextPointers: ; 48793 (12:4793) +CeladonMansion3TextPointers: dw ProgrammerText dw GraphicArtistText dw WriterText @@ -19,7 +19,7 @@ CeladonMansion3TextPointers: ; 48793 (12:4793) dw GameFreakPCText3 dw GameFreakSignText -ProgrammerText: ; 487a3 (12:47a3) +ProgrammerText: TX_ASM call CeladonMansion3_PokedexCount cp 150 @@ -38,7 +38,7 @@ CeladonMansion3Text_486f5: TX_FAR _ProgrammerText2 db "@" -GraphicArtistText: ; 487a8 (12:47a8) +GraphicArtistText: TX_ASM call CeladonMansion3_PokedexCount cp 150 @@ -58,7 +58,7 @@ GraphicArtistText: ; 487a8 (12:47a8) ld [wUpdateSpritesEnabled], a ld hl, wd730 set 6, [hl] - callab Func_e8cb1 + callab PrintDiploma ld hl, wd730 res 6, [hl] call GBPalWhiteOutWithDelay3 @@ -100,7 +100,7 @@ CeladonMansion3Text_4876b: TX_FAR _GraphicArtistText5 db "@" -WriterText: ; 487ad (12:47ad) +WriterText: TX_ASM call CeladonMansion3_PokedexCount cp 150 @@ -119,7 +119,7 @@ CeladonMansion3Text_48789: TX_FAR _WriterText2 db "@" -DirectorText: ; 487b2 (12:47b2) +DirectorText: TX_ASM call CeladonMansion3_PokedexCount ; check pokédex @@ -138,7 +138,7 @@ DirectorText: ; 487b2 (12:47b2) call PrintText jp TextScriptEnd -.GameDesigner ; 487d0 (12:47d0) +.GameDesigner TX_FAR _GameDesignerText db "@" @@ -155,22 +155,22 @@ DirectorText: ; 487b2 (12:47b2) TX_FAR _CompletedDexText2 db "@" -GameFreakPCText1: ; 487eb (12:47eb) +GameFreakPCText1: TX_ASM callba Func_f1ef3 jp TextScriptEnd -GameFreakPCText2: ; 487f0 (12:47f0) +GameFreakPCText2: TX_ASM callba Func_f1eff jp TextScriptEnd -GameFreakPCText3: ; 487f5 (12:47f5) +GameFreakPCText3: TX_ASM callba Func_f1f0b jp TextScriptEnd -GameFreakSignText: ; 487fa (12:47fa) +GameFreakSignText: TX_ASM callba Func_f1f17 jp TextScriptEnd diff --git a/scripts/celadonmansion3_2.asm b/scripts/celadonmansion3_2.asm index 2d5069d1..3a7035ba 100755 --- a/scripts/celadonmansion3_2.asm +++ b/scripts/celadonmansion3_2.asm @@ -3,7 +3,7 @@ Func_f1ef3: call PrintText ret -CeladonMansion3Text_f1efa: ; 487eb (12:47eb) +CeladonMansion3Text_f1efa: TX_FAR _CeladonMansion3Text5 db "@" @@ -12,7 +12,7 @@ Func_f1eff: call PrintText ret -CeladonMansion3Text_f1f06: ; 487f0 (12:47f0) +CeladonMansion3Text_f1f06: TX_FAR _CeladonMansion3Text6 db "@" @@ -21,7 +21,7 @@ Func_f1f0b: call PrintText ret -CeladonMansion3Text_f1f12: ; 487f5 (12:47f5) +CeladonMansion3Text_f1f12: TX_FAR _CeladonMansion3Text7 db "@" @@ -30,6 +30,6 @@ Func_f1f17: call PrintText ret -CeladonMansion3Text_f1f1e: ; 487fa (12:47fa) +CeladonMansion3Text_f1f1e: TX_FAR _CeladonMansion3Text8 db "@" diff --git a/scripts/celadonmansion4.asm b/scripts/celadonmansion4.asm index 475baff3..483aa4fd 100755 --- a/scripts/celadonmansion4.asm +++ b/scripts/celadonmansion4.asm @@ -1,10 +1,10 @@ -CeladonMansion4Script: ; 4886b (12:486b) +CeladonMansion4Script: call EnableAutoTextBoxDrawing ret -CeladonMansion4TextPointers: ; 4886e (12:486e) +CeladonMansion4TextPointers: dw CeladonMansion4Text1 -CeladonMansion4Text1: ; 48870 (12:4870) +CeladonMansion4Text1: TX_FAR _CeladonMansion4Text1 db "@" diff --git a/scripts/celadonmansion5.asm b/scripts/celadonmansion5.asm index 346eb6bb..c2da8c6d 100755 --- a/scripts/celadonmansion5.asm +++ b/scripts/celadonmansion5.asm @@ -1,16 +1,16 @@ -CeladonMansion5Script: ; 1dd3a (7:5d3a) +CeladonMansion5Script: call EnableAutoTextBoxDrawing ret -CeladonMansion5TextPointers: ; 1dd3d (7:5d3d) +CeladonMansion5TextPointers: dw CeladonMansion5Text1 dw CeladonMansion5Text2 -CeladonMansion5Text1: ; 1dd41 (7:5d41) +CeladonMansion5Text1: TX_FAR _CeladonMansion5Text1 db "@" -CeladonMansion5Text2: ; 1dd46 (7:5d46) +CeladonMansion5Text2: TX_ASM lb bc, EEVEE, 25 call GivePokemon diff --git a/scripts/celadonmart1.asm b/scripts/celadonmart1.asm index 4f297a6e..64c4a087 100755 --- a/scripts/celadonmart1.asm +++ b/scripts/celadonmart1.asm @@ -1,20 +1,20 @@ -CeladonMart1Script: ; 60f86 (18:4f86) +CeladonMart1Script: call EnableAutoTextBoxDrawing ret -CeladonMart1TextPointers: ; 60f89 (18:4f89) +CeladonMart1TextPointers: dw CeladonMart1Text1 dw CeladonMart1Text2 dw CeladonMart1Text3 -CeladonMart1Text1: ; 60f8f (18:4f8f) +CeladonMart1Text1: TX_FAR _CeladonMart1Text1 db "@" -CeladonMart1Text2: ; 60f94 (18:4f94) +CeladonMart1Text2: TX_FAR _CeladonMart1Text2 db "@" -CeladonMart1Text3: ; 60f99 (18:4f99) +CeladonMart1Text3: TX_FAR _CeladonMart1Text3 db "@" diff --git a/scripts/celadonmart2.asm b/scripts/celadonmart2.asm index 92f04399..b8128c54 100755 --- a/scripts/celadonmart2.asm +++ b/scripts/celadonmart2.asm @@ -1,21 +1,21 @@ -CeladonMart2Script: ; 560f5 (15:60f5) +CeladonMart2Script: jp EnableAutoTextBoxDrawing -CeladonMart2TextPointers: ; 560f8 (15:60f8) +CeladonMart2TextPointers: dw CeladonMart2Text1 dw CeladonMart2Text2 dw CeladonMart2Text3 dw CeladonMart2Text4 dw CeladonMart2Text5 -CeladonMart2Text3: ; 56102 (15:6102) +CeladonMart2Text3: TX_FAR _CeladonMart2Text3 db "@" -CeladonMart2Text4: ; 56107 (15:6107) +CeladonMart2Text4: TX_FAR _CeladonMart2Text4 db "@" -CeladonMart2Text5: ; 5610c (15:610c) +CeladonMart2Text5: TX_FAR _CeladonMart2Text5 db "@" diff --git a/scripts/celadonmart3.asm b/scripts/celadonmart3.asm index 49e5e84b..25bf4e80 100755 --- a/scripts/celadonmart3.asm +++ b/scripts/celadonmart3.asm @@ -1,7 +1,7 @@ -CeladonMart3Script: ; 48225 (12:4225) +CeladonMart3Script: jp EnableAutoTextBoxDrawing -CeladonMart3TextPointers: ; 48228 (12:4228) +CeladonMart3TextPointers: dw CeladonMart3Text1 dw CeladonMart3Text2 dw CeladonMart3Text3 @@ -20,56 +20,56 @@ CeladonMart3TextPointers: ; 48228 (12:4228) dw CeladonMart3Text16 dw CeladonMart3Text17 -CeladonMart3Text1: ; 4824a (12:424a) +CeladonMart3Text1: TX_ASM callab Func_f1e30 jp TextScriptEnd -CeladonMart3Text2: ; 4828d (12:428d) +CeladonMart3Text2: TX_FAR _CeladonMart3Text2 db "@" -CeladonMart3Text3: ; 48292 (12:4292) +CeladonMart3Text3: TX_FAR _CeladonMart3Text3 db "@" -CeladonMart3Text4: ; 48297 (12:4297) +CeladonMart3Text4: TX_FAR _CeladonMart3Text4 db "@" -CeladonMart3Text5: ; 4829c (12:429c) +CeladonMart3Text5: TX_FAR _CeladonMart3Text5 db "@" CeladonMart3Text12 -CeladonMart3Text10: ; 482a1 (12:42a1) -CeladonMart3Text8: ; 482a1 (12:42a1) -CeladonMart3Text6: ; 482a1 (12:42a1) +CeladonMart3Text10: +CeladonMart3Text8: +CeladonMart3Text6: TX_FAR _CeladonMart3Text6 db "@" -CeladonMart3Text7: ; 482a6 (12:42a6) +CeladonMart3Text7: TX_FAR _CeladonMart3Text7 db "@" -CeladonMart3Text9: ; 482ab (12:42ab) +CeladonMart3Text9: TX_FAR _CeladonMart3Text9 db "@" -CeladonMart3Text11: ; 482b0 (12:42b0) +CeladonMart3Text11: TX_FAR _CeladonMart3Text11 db "@" -CeladonMart3Text13: ; 482b5 (12:42b5) +CeladonMart3Text13: TX_FAR _CeladonMart3Text13 db "@" -CeladonMart3Text14: ; 482ba (12:42ba) +CeladonMart3Text14: TX_FAR _CeladonMart3Text14 db "@" -CeladonMart3Text17: ; 482bf (12:42bf) -CeladonMart3Text16: ; 482bf (12:42bf) -CeladonMart3Text15: ; 482bf (12:42bf) +CeladonMart3Text17: +CeladonMart3Text16: +CeladonMart3Text15: TX_FAR _CeladonMart3Text15 db "@" diff --git a/scripts/celadonmart4.asm b/scripts/celadonmart4.asm index dfe2b90a..f547ca62 100755 --- a/scripts/celadonmart4.asm +++ b/scripts/celadonmart4.asm @@ -1,20 +1,20 @@ -CeladonMart4Script: ; 48356 (12:4356) +CeladonMart4Script: jp EnableAutoTextBoxDrawing -CeladonMart4TextPointers: ; 48359 (12:4359) +CeladonMart4TextPointers: dw CeladonMart4Text1 dw CeladonMart4Text2 dw CeladonMart4Text3 dw CeladonMart4Text4 -CeladonMart4Text2: ; 48361 (12:4361) +CeladonMart4Text2: TX_FAR _CeladonMart4Text2 db "@" -CeladonMart4Text3: ; 48366 (12:4366) +CeladonMart4Text3: TX_FAR _CeladonMart4Text3 db "@" -CeladonMart4Text4: ; 4836b (12:436b) +CeladonMart4Text4: TX_FAR _CeladonMart4Text4 db "@" diff --git a/scripts/celadonmart5.asm b/scripts/celadonmart5.asm index bf63a7cc..92ccb313 100755 --- a/scripts/celadonmart5.asm +++ b/scripts/celadonmart5.asm @@ -1,22 +1,22 @@ -CeladonMart5Script: ; 49069 (12:5069) +CeladonMart5Script: call EnableAutoTextBoxDrawing ret -CeladonMart5TextPointers: ; 4906c (12:506c) +CeladonMart5TextPointers: dw CeladonMart5Text1 dw CeladonMart5Text2 dw CeladonMart5Text3 dw CeladonMart5Text4 dw CeladonMart5Text5 -CeladonMart5Text1: ; 49076 (12:5076) +CeladonMart5Text1: TX_FAR _CeladonMart5Text1 db "@" -CeladonMart5Text2: ; 4907b (12:507b) +CeladonMart5Text2: TX_FAR _CeladonMart5Text2 db "@" -CeladonMart5Text5: ; 49080 (12:5080) +CeladonMart5Text5: TX_FAR _CeladonMart5Text5 db "@" diff --git a/scripts/celadonmartelevator.asm b/scripts/celadonmartelevator.asm index e693d9fe..e78d86fc 100755 --- a/scripts/celadonmartelevator.asm +++ b/scripts/celadonmartelevator.asm @@ -1,4 +1,4 @@ -CeladonMartElevatorScript: ; 48600 (12:4600) +CeladonMartElevatorScript: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -14,7 +14,7 @@ CeladonMartElevatorScript: ; 48600 (12:4600) ld [wDoNotWaitForButtonPressAfterDisplayingText], a ret -CeladonMartElevatorScript_4861c: ; 4861c (12:461c) +CeladonMartElevatorScript_4861c: ld hl, wWarpEntries ld a, [wWarpedFromWhichWarp] ld b, a @@ -22,7 +22,7 @@ CeladonMartElevatorScript_4861c: ; 4861c (12:461c) ld c, a call CeladonMartElevatorScript_4862a -CeladonMartElevatorScript_4862a: ; 4862a (12:462a) +CeladonMartElevatorScript_4862a: inc hl inc hl ld a, b @@ -31,7 +31,7 @@ CeladonMartElevatorScript_4862a: ; 4862a (12:462a) ld [hli], a ret -CeladonMartElevatorScript_48631: ; 48631 (12:4631) +CeladonMartElevatorScript_48631: ld hl, CeladonMartElavatorFloors call LoadItemList ld hl, CeldaonMartElevatorWarpMaps @@ -39,7 +39,7 @@ CeladonMartElevatorScript_48631: ; 48631 (12:4631) ld bc, CeldaonMartElevatorWarpMapsEnd - CeldaonMartElevatorWarpMaps jp CopyData -CeladonMartElavatorFloors: ; 48643 (12:4643) +CeladonMartElavatorFloors: db $05 ; num elements in list db FLOOR_1F db FLOOR_2F @@ -48,7 +48,7 @@ CeladonMartElavatorFloors: ; 48643 (12:4643) db FLOOR_5F db $FF ; terminator -CeldaonMartElevatorWarpMaps: ; 4864a (12:464a) +CeldaonMartElevatorWarpMaps: ; first byte is warp number ; second byte is map number ; These specify where the player goes after getting out of the elevator. @@ -59,13 +59,13 @@ CeldaonMartElevatorWarpMaps: ; 4864a (12:464a) db $02, CELADON_MART_5 CeldaonMartElevatorWarpMapsEnd: -CeladonMartElevatorScript_48654: ; 48654 (12:4654) +CeladonMartElevatorScript_48654: jpba ShakeElevator -CeladonMartElevatorTextPointers: ; 4865c (12:465c) +CeladonMartElevatorTextPointers: dw CeladonMartElevatorText1 -CeladonMartElevatorText1: ; 4865e (12:465e) +CeladonMartElevatorText1: TX_ASM call CeladonMartElevatorScript_48631 ld hl, CeldaonMartElevatorWarpMaps diff --git a/scripts/celadonmartroof.asm b/scripts/celadonmartroof.asm index 4d819be7..22a83780 100755 --- a/scripts/celadonmartroof.asm +++ b/scripts/celadonmartroof.asm @@ -1,8 +1,8 @@ -CeladonMartRoofScript: ; 483d5 (12:43d5) +CeladonMartRoofScript: call EnableAutoTextBoxDrawing ret -CeladonMartRoofScript_GetDrinksInBag: ; 483d8 (12:43d8) +CeladonMartRoofScript_GetDrinksInBag: ; construct a list of all drinks in the player's bag xor a ld [wFilteredBagItemsCount], a @@ -35,13 +35,13 @@ CeladonMartRoofScript_GetDrinksInBag: ; 483d8 (12:43d8) ld [de], a ret -CeladonMartRoofDrinkList: ; 48408 (12:4408) +CeladonMartRoofDrinkList: db FRESH_WATER db SODA_POP db LEMONADE db $00 -CeladonMartRoofScript_GiveDrinkToGirl: ; 4840c (12:440c) +CeladonMartRoofScript_GiveDrinkToGirl: ld hl, wd730 set 6, [hl] ld hl, CeladonMartRoofText_484ee @@ -133,61 +133,61 @@ CeladonMartRoofScript_GiveDrinkToGirl: ; 4840c (12:440c) call PrintText ret -RemoveItemByIDBank12: ; 484e6 (12:44e6) +RemoveItemByIDBank12: callba RemoveItemByID ret -CeladonMartRoofText_484ee: ; 484ee (12:44ee) +CeladonMartRoofText_484ee: TX_FAR _CeladonMartRoofText_484ee db "@" -CeladonMartRoofText_484f3: ; 484f3 (12:44f3) +CeladonMartRoofText_484f3: TX_FAR _CeladonMartRoofText_484f3 db $0d db "@" -CeladonMartRoofText_484f9: ; 484f9 (12:44f9) +CeladonMartRoofText_484f9: TX_FAR _CeladonMartRoofText_484f9 db $0b TX_FAR _CeladonMartRoofText_484fe db $0d db "@" -CeladonMartRoofText_48504: ; 48504 (12:4504) +CeladonMartRoofText_48504: TX_FAR _CeladonMartRoofText_48504 db $0d db "@" -CeladonMartRoofText_4850a: ; 4850a (12:450a) +CeladonMartRoofText_4850a: TX_FAR _CeladonMartRoofText_4850a db $0b TX_FAR _CeladonMartRoofText_4850f db $0d db "@" -CeladonMartRoofText_48515: ; 48515 (12:4515) +CeladonMartRoofText_48515: TX_FAR _CeladonMartRoofText_48515 db $0d db "@" -ReceivedTM49Text: ; 4851b (12:451b) +ReceivedTM49Text: TX_FAR _ReceivedTM49Text db $0b TX_FAR _CeladonMartRoofText_48520 db $0d db "@" -CeladonMartRoofText_48526: ; 48526 (12:4526) +CeladonMartRoofText_48526: TX_FAR _CeladonMartRoofText_48526 db $0d db "@" -CeladonMartRoofText_4852c: ; 4852c (12:452c) +CeladonMartRoofText_4852c: TX_FAR _CeladonMartRoofText_4852c db $0d db "@" -CeladonMartRoofScript_PrintDrinksInBag: ; 48532 (12:4532) +CeladonMartRoofScript_PrintDrinksInBag: ld hl, wFilteredBagItems xor a ld [hItemCounter], a @@ -209,7 +209,7 @@ CeladonMartRoofScript_PrintDrinksInBag: ; 48532 (12:4532) pop hl jr .loop -CeladonMartRoofTextPointers: ; 4855b (12:455b) +CeladonMartRoofTextPointers: dw CeladonMartRoofText1 dw CeladonMartRoofText2 dw CeladonMartRoofText5 @@ -217,11 +217,11 @@ CeladonMartRoofTextPointers: ; 4855b (12:455b) dw CeladonMartRoofText5 dw CeladonMartRoofText6 -CeladonMartRoofText1: ; 48567 (12:4567) +CeladonMartRoofText1: TX_FAR _CeladonMartRoofText1 db "@" -CeladonMartRoofText2: ; 4856c (12:456c) +CeladonMartRoofText2: TX_ASM call CeladonMartRoofScript_GetDrinksInBag ld a, [wFilteredBagItemsCount] @@ -243,17 +243,17 @@ CeladonMartRoofText2: ; 4856c (12:456c) .done jp TextScriptEnd -CeladonMartRoofText3: ; 48598 (12:4598) +CeladonMartRoofText3: TX_FAR _CeladonMartRoofText_48598 db "@" -CeladonMartRoofText4: ; 4859d (12:459d) +CeladonMartRoofText4: TX_FAR _CeladonMartRoofText4 db "@" -CeladonMartRoofText5: ; 485a2 (12:45a2) +CeladonMartRoofText5: TX_VENDING_MACHINE -CeladonMartRoofText6: ; 485a3 (12:45a3) +CeladonMartRoofText6: TX_FAR _CeladonMartRoofText6 db "@" diff --git a/scripts/celadonpokecenter.asm b/scripts/celadonpokecenter.asm index 4ff71c43..b577906a 100755 --- a/scripts/celadonpokecenter.asm +++ b/scripts/celadonpokecenter.asm @@ -1,25 +1,25 @@ -CeladonPokecenterScript: ; 488b8 (12:48b8) +CeladonPokecenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -CeladonPokecenterTextPointers: ; 488be (12:48be) +CeladonPokecenterTextPointers: dw CeladonPokecenterText1 dw CeladonPokecenterText2 dw CeladonPokecenterText3 dw CeladonPokecenterText4 dw CeladonPokecenterText5 -CeladonPokecenterText4: ; 488c6 (12:48c6) +CeladonPokecenterText4: TX_CABLE_CLUB_RECEPTIONIST -CeladonPokecenterText1: ; 488c7 (12:48c7) +CeladonPokecenterText1: TX_POKECENTER_NURSE -CeladonPokecenterText2: ; 488c8 (12:48c8) +CeladonPokecenterText2: TX_FAR _CeladonPokecenterText2 db "@" -CeladonPokecenterText3: ; 488cd (12:48cd) +CeladonPokecenterText3: TX_FAR _CeladonPokecenterText3 db "@" diff --git a/scripts/celadonprizeroom.asm b/scripts/celadonprizeroom.asm index 980778fe..a07ce162 100755 --- a/scripts/celadonprizeroom.asm +++ b/scripts/celadonprizeroom.asm @@ -1,20 +1,20 @@ -CeladonPrizeRoomScript: ; 490f0 (12:50f0) +CeladonPrizeRoomScript: jp EnableAutoTextBoxDrawing -CeladonPrizeRoomTextPointers: ; 490f3 (12:50f3) +CeladonPrizeRoomTextPointers: dw CeladonPrizeRoomText1 dw CeladonPrizeRoomText2 dw CeladonPrizeRoomText3 dw CeladonPrizeRoomText3 dw CeladonPrizeRoomText3 -CeladonPrizeRoomText1: ; 490fd (12:50fd) +CeladonPrizeRoomText1: TX_FAR _CeladonPrizeRoomText1 db "@" -CeladonPrizeRoomText2: ; 49102 (12:5102) +CeladonPrizeRoomText2: TX_FAR _CeladonPrizeRoomText2 db "@" -CeladonPrizeRoomText3: ; 49107 (12:5107) +CeladonPrizeRoomText3: TX_PRIZE_VENDOR diff --git a/scripts/ceruleancity.asm b/scripts/ceruleancity.asm index 0f4e9dce..4243d35c 100755 --- a/scripts/ceruleancity.asm +++ b/scripts/ceruleancity.asm @@ -1,10 +1,10 @@ -CeruleanCityScript: ; 19480 (6:5480) +CeruleanCityScript: call EnableAutoTextBoxDrawing ld hl, CeruleanCityScriptPointers ld a, [wCeruleanCityCurScript] jp JumpTable -CeruleanCityScript_1948c: ; 1948c (6:548c) +CeruleanCityScript_1948c: xor a ld [wJoyIgnore], a ld [wCeruleanCityCurScript], a @@ -12,14 +12,14 @@ CeruleanCityScript_1948c: ; 1948c (6:548c) ld [wMissableObjectIndex], a predef_jump HideObject -CeruleanCityScriptPointers: ; 1949d (6:549d) +CeruleanCityScriptPointers: dw CeruleanCityScript0 dw CeruleanCityScript1 dw CeruleanCityScript2 dw CeruleanCityScript3 dw CeruleanCityScript4 -CeruleanCityScript4: ; 194a7 (6:54a7) +CeruleanCityScript4: ld a, [wIsInBattle] cp $ff jp z, CeruleanCityScript_1948c @@ -34,7 +34,7 @@ CeruleanCityScript4: ; 194a7 (6:54a7) ld [wCeruleanCityCurScript], a ret -CeruleanCityScript0: ; 194c8 (6:54c8) +CeruleanCityScript0: CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF jr nz, .asm_194f7 ld hl, CeruleanCityCoords1 @@ -94,30 +94,30 @@ CeruleanCityScript0: ; 194c8 (6:54c8) ld [wCeruleanCityCurScript], a ret -CeruleanCityCoords1: ; 1954f (6:554f) +CeruleanCityCoords1: db $07,$1e db $09,$1e db $ff -CeruleanCityCoords2: ; 19554 (6:5554) +CeruleanCityCoords2: db $06,$14 db $06,$15 db $ff -CeruleanCityMovement1: ; 19559 (6:5559) +CeruleanCityMovement1: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db $FF -CeruleanCityScript_1955d: ; 1955d (6:555d) +CeruleanCityScript_1955d: ld a,1 ld [H_SPRITEINDEX],a xor a ; SPRITE_FACING_DOWN ld [hSpriteFacingDirection],a jp SetSpriteFacingDirectionAndDelay ; face object -CeruleanCityScript1: ; 19567 (6:5567) +CeruleanCityScript1: ld a, [wd730] bit 0, a ret nz @@ -143,7 +143,7 @@ CeruleanCityScript1: ; 19567 (6:5567) ld [wCeruleanCityCurScript], a ret -CeruleanCityScript2: ; 195b1 (6:55b1) +CeruleanCityScript2: ld a, [wIsInBattle] cp $ff jp z, CeruleanCityScript_1948c @@ -174,7 +174,7 @@ CeruleanCityScript2: ; 195b1 (6:55b1) ld [wCeruleanCityCurScript], a ret -CeruleanCityMovement3: ; 19600 (6:5600) +CeruleanCityMovement3: db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN @@ -184,7 +184,7 @@ CeruleanCityMovement3: ; 19600 (6:5600) db NPC_MOVEMENT_DOWN db $FF -CeruleanCityMovement4: ; 19608 (6:5608) +CeruleanCityMovement4: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN @@ -194,7 +194,7 @@ CeruleanCityMovement4: ; 19608 (6:5608) db NPC_MOVEMENT_DOWN db $FF -CeruleanCityScript3: ; 19610 (6:5610) +CeruleanCityScript3: ld a, [wd730] bit 0, a ret nz @@ -208,7 +208,7 @@ CeruleanCityScript3: ; 19610 (6:5610) ld [wCeruleanCityCurScript], a ret -CeruleanCityTextPointers: ; 1962d (6:562d) +CeruleanCityTextPointers: dw CeruleanCityText1 dw CeruleanCityText2 dw CeruleanCityText3 @@ -227,7 +227,7 @@ CeruleanCityTextPointers: ; 1962d (6:562d) dw CeruleanCityText16 dw CeruleanCityText17 -CeruleanCityText1: ; 1964f (6:564f) +CeruleanCityText1: TX_ASM CheckEvent EVENT_BEAT_CERULEAN_RIVAL ; do pre-battle text @@ -242,23 +242,23 @@ CeruleanCityText1: ; 1964f (6:564f) .end jp TextScriptEnd -CeruleanCityText_19668: ; 19668 (6:5668) +CeruleanCityText_19668: TX_FAR _CeruleanCityText_19668 db "@" -CeruleanCityText_1966d: ; 1966d (6:566d) +CeruleanCityText_1966d: TX_FAR _CeruleanCityText_1966d db "@" -CeruleanCityText_19672: ; 19672 (6:5672) +CeruleanCityText_19672: TX_FAR _CeruleanCityText_19672 db "@" -CeruleanCityText_19677: ; 19677 (6:5677) +CeruleanCityText_19677: TX_FAR _CeruleanCityText_19677 db "@" -CeruleanCityText2: ; 1967c (6:567c) +CeruleanCityText2: TX_ASM CheckEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF jr nz, .asm_4ca20 @@ -295,46 +295,46 @@ CeruleanCityText2: ; 1967c (6:567c) .Done jp TextScriptEnd -CeruleanCityText_196d9: ; 196d9 (6:56d9) +CeruleanCityText_196d9: TX_FAR _CeruleanCityText_196d9 db "@" -ReceivedTM28Text: ; 196de (6:56de) +ReceivedTM28Text: TX_FAR _ReceivedTM28Text db $0B TX_FAR _ReceivedTM28Text2 db $0D, "@" -TM28NoRoomText: ; 196e9 (6:56e9) +TM28NoRoomText: TX_FAR _TM28NoRoomText db "@" -CeruleanCityText_196ee: ; 196ee (6:56ee) +CeruleanCityText_196ee: TX_FAR _CeruleanCityText_196ee db "@" -CeruleanCityText_196f3: ; 196f3 (6:56f3) +CeruleanCityText_196f3: TX_FAR _CeruleanCityText_196f3 db "@" -CeruleanCityText3: ; 196f8 (6:56f8) +CeruleanCityText3: TX_FAR _CeruleanCityText3 db "@" -CeruleanCityText4: ; 196fd (6:56fd) +CeruleanCityText4: TX_FAR _CeruleanCityText4 db "@" -CeruleanCityText5: ; 19702 (6:5702) +CeruleanCityText5: TX_FAR _CeruleanCityText5 db "@" -CeruleanCityText11: ; 19707 (6:5707) -CeruleanCityText6: ; 19707 (6:5707) +CeruleanCityText11: +CeruleanCityText6: TX_FAR _CeruleanCityText6 db "@" -CeruleanCityText7: ; 1970c (6:570c) +CeruleanCityText7: TX_ASM ld a, [hRandomAdd] cp $b4 @@ -354,19 +354,19 @@ CeruleanCityText7: ; 1970c (6:570c) .asm_d486e jp TextScriptEnd -CeruleanCityText_19730: ; 19730 (6:5730) +CeruleanCityText_19730: TX_FAR _CeruleanCityText_19730 db "@" -CeruleanCityText_19735: ; 19735 (6:5735) +CeruleanCityText_19735: TX_FAR _CeruleanCityText_19735 db "@" -CeruleanCityText_1973a: ; 1973a (6:573a) +CeruleanCityText_1973a: TX_FAR _CeruleanCityText_1973a db "@" -CeruleanCityText8: ; 1973f (6:573f) +CeruleanCityText8: TX_ASM ld a, [hRandomAdd] cp $b4 @@ -392,42 +392,42 @@ CeruleanCityText8: ; 1973f (6:573f) .asm_f2f38 jp TextScriptEnd -CeruleanCityText_1976f: ; 1976f (6:576f) +CeruleanCityText_1976f: TX_FAR _CeruleanCityText_1976f db "@" -CeruleanCityText_19774: ; 19774 (6:5774) +CeruleanCityText_19774: TX_FAR _CeruleanCityText_19774 db "@" -CeruleanCityText_19779: ; 19779 (6:5779) +CeruleanCityText_19779: TX_FAR _CeruleanCityText_19779 db "@" -CeruleanCityText_1977e: ; 1977e (6:577e) +CeruleanCityText_1977e: TX_FAR _CeruleanCityText_1977e db "@" -CeruleanCityText9: ; 19783 (6:5783) +CeruleanCityText9: TX_FAR _CeruleanCityText9 db "@" -CeruleanCityText10: ; 19788 (6:5788) +CeruleanCityText10: TX_FAR _CeruleanCityText10 db "@" -CeruleanCityText12: ; 1978d (6:578d) +CeruleanCityText12: TX_FAR _CeruleanCityText12 db "@" -CeruleanCityText13: ; 19792 (6:5792) +CeruleanCityText13: TX_FAR _CeruleanCityText13 db "@" -CeruleanCityText16: ; 19797 (6:5797) +CeruleanCityText16: TX_FAR _CeruleanCityText16 db "@" -CeruleanCityText17: ; 1979c (6:579c) +CeruleanCityText17: TX_FAR _CeruleanCityText17 db "@" diff --git a/scripts/ceruleancity2.asm b/scripts/ceruleancity2.asm index 3dafb3f8..53ace5c8 100755 --- a/scripts/ceruleancity2.asm +++ b/scripts/ceruleancity2.asm @@ -1,4 +1,4 @@ -CeruleanHideRocket: ; 74872 (1d:4872) +CeruleanHideRocket: ; code similar to this appears in a lot of banks; this particular ; one is called after you beat the Rocket that gives you TM28 DIG. ; the screen then fades out, he disappears, and fades back in diff --git a/scripts/ceruleangym.asm b/scripts/ceruleangym.asm index d6abf4a1..448ce744 100755 --- a/scripts/ceruleangym.asm +++ b/scripts/ceruleangym.asm @@ -1,4 +1,4 @@ -CeruleanGymScript: ; 5c6b3 (17:46b3) +CeruleanGymScript: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] @@ -11,38 +11,38 @@ CeruleanGymScript: ; 5c6b3 (17:46b3) ld [wCeruleanGymCurScript], a ret -CeruleanGymScript_5c6d0: ; 5c6d0 (17:46d0) +CeruleanGymScript_5c6d0: ld hl, Gym2CityName ld de, Gym2LeaderName jp LoadGymLeaderAndCityName -Gym2CityName: ; 5c6d9 (17:46d9) +Gym2CityName: db "CERULEAN CITY@" -Gym2LeaderName: ; 5c6e7 (17:46e7) +Gym2LeaderName: db "MISTY@" -CeruleanGymScript_5c6ed: ; 5c6ed (17:46ed) +CeruleanGymScript_5c6ed: xor a ld [wJoyIgnore], a ld [wCeruleanGymCurScript], a ld [wCurMapScript], a ret -CeruleanGymScriptPointers: ; 5c6f8 (17:46f8) +CeruleanGymScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw CeruleanGymScript3 -CeruleanGymScript3: ; 5c700 (17:4700) +CeruleanGymScript3: ld a, [wIsInBattle] cp $ff jp z, CeruleanGymScript_5c6ed ld a, $f0 ld [wJoyIgnore], a -CeruleanGymScript_5c70d: ; 5c70d (17:470d) +CeruleanGymScript_5c70d: ld a, $5 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -71,7 +71,7 @@ CeruleanGymScript_5c70d: ; 5c70d (17:470d) jp CeruleanGymScript_5c6ed -CeruleanGymTextPointers: ; 5c74a (17:474a) +CeruleanGymTextPointers: dw CeruleanGymText1 dw CeruleanGymText2 dw CeruleanGymText3 @@ -80,8 +80,8 @@ CeruleanGymTextPointers: ; 5c74a (17:474a) dw CeruleanGymText6 dw CeruleanGymText7 -CeruleanGymTrainerHeaders: ; 5c758 (17:4758) -CeruleanGymTrainerHeader0: ; 5c758 (17:4758) +CeruleanGymTrainerHeaders: +CeruleanGymTrainerHeader0: dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_0 @@ -90,7 +90,7 @@ CeruleanGymTrainerHeader0: ; 5c758 (17:4758) dw CeruleanGymEndBattleText1 ; TextEndBattle dw CeruleanGymEndBattleText1 ; TextEndBattle -CeruleanGymTrainerHeader1: ; 5c764 (17:4764) +CeruleanGymTrainerHeader1: dbEventFlagBit EVENT_BEAT_CERULEAN_GYM_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_CERULEAN_GYM_TRAINER_1 @@ -101,7 +101,7 @@ CeruleanGymTrainerHeader1: ; 5c764 (17:4764) db $ff -CeruleanGymText1: ; 5c771 (17:4771) +CeruleanGymText1: TX_ASM CheckEvent EVENT_BEAT_MISTY jr z, .asm_5c78d @@ -136,68 +136,68 @@ CeruleanGymText1: ; 5c771 (17:4771) .asm_5c7bb jp TextScriptEnd -CeruleanGymText_5c7be: ; 5c7be (17:47be) +CeruleanGymText_5c7be: TX_FAR _CeruleanGymText_5c7be db "@" -CeruleanGymText_5c7c3: ; 5c7c3 (17:47c3) +CeruleanGymText_5c7c3: TX_FAR _CeruleanGymText_5c7c3 db "@" -CeruleanGymText5: ; 5c7c8 (17:47c8) +CeruleanGymText5: TX_FAR _CeruleanGymText_5c7c8 db "@" -CeruleanGymText6: ; 5c7cd (17:47cd) -ReceivedTM11Text: ; 5c7cd (17:47cd) +CeruleanGymText6: +ReceivedTM11Text: TX_FAR _ReceivedTM11Text db $0B, "@" -CeruleanGymText7: ; 5c7d3 (17:47d3) +CeruleanGymText7: TX_FAR _CeruleanGymText_5c7d3 db "@" -CeruleanGymText_5c7d8: ; 5c7d8 (17:47d8) +CeruleanGymText_5c7d8: TX_FAR _CeruleanGymText_5c7d8 db "@" -CeruleanGymText2: ; 5c7df (17:47df) +CeruleanGymText2: TX_ASM ld hl, CeruleanGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd -CeruleanGymBattleText1: ; 5c7e9 (17:47e9) +CeruleanGymBattleText1: TX_FAR _CeruleanGymBattleText1 db "@" -CeruleanGymEndBattleText1: ; 5c7ee (17:47ee) +CeruleanGymEndBattleText1: TX_FAR _CeruleanGymEndBattleText1 db "@" -CeruleanGymAfterBattleText1: ; 5c7f3 (17:47f3) +CeruleanGymAfterBattleText1: TX_FAR _CeruleanGymAfterBattleText1 db "@" -CeruleanGymText3: ; 5c7f8 (17:47f8) +CeruleanGymText3: TX_ASM ld hl, CeruleanGymTrainerHeader1 call TalkToTrainer jp TextScriptEnd -CeruleanGymBattleText2: ; 5c802 (17:4802) +CeruleanGymBattleText2: TX_FAR _CeruleanGymBattleText2 db "@" -CeruleanGymEndBattleText2: ; 5c807 (17:4807) +CeruleanGymEndBattleText2: TX_FAR _CeruleanGymEndBattleText2 db "@" -CeruleanGymAfterBattleText2: ; 5c80c (17:480c) +CeruleanGymAfterBattleText2: TX_FAR _CeruleanGymAfterBattleText2 db "@" -CeruleanGymText4: ; 5c811 (17:4811) +CeruleanGymText4: TX_ASM CheckEvent EVENT_BEAT_MISTY jr nz, .asm_5c821 @@ -210,10 +210,10 @@ CeruleanGymText4: ; 5c811 (17:4811) .asm_5c827 jp TextScriptEnd -CeruleanGymText_5c82a: ; 5c82a (17:482a) +CeruleanGymText_5c82a: TX_FAR _CeruleanGymText_5c82a db "@" -CeruleanGymText_5c82f: ; 5c82f (17:482f) +CeruleanGymText_5c82f: TX_FAR _CeruleanGymText_5c82f db "@" diff --git a/scripts/ceruleanhouse1.asm b/scripts/ceruleanhouse1.asm index 0b9a9052..ba75c240 100755 --- a/scripts/ceruleanhouse1.asm +++ b/scripts/ceruleanhouse1.asm @@ -1,14 +1,14 @@ -CeruleanHouse1Script: ; 1d6f6 (7:56f6) +CeruleanHouse1Script: call EnableAutoTextBoxDrawing ret -CeruleanHouse1TextPointers: ; 1d6f9 (7:56f9) +CeruleanHouse1TextPointers: dw CeruleanHouse1Text1 dw CeruleanHouse1Text2 dw CeruleanHouse1Text3 dw CeruleanHouse1Text4 -CeruleanHouse1Text1: ; 1d6fd (7:56fd) +CeruleanHouse1Text1: TX_ASM ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -84,21 +84,21 @@ CeruleanHouse1Text_1cfdf: TX_WAIT_BUTTON db "@" -CeruleanHouse1Text2: ; 1d702 (7:5702) +CeruleanHouse1Text2: TX_FAR MelanieBulbasaurText TX_ASM ld a, BULBASAUR call PlayCry jp TextScriptEnd -CeruleanHouse1Text3: ; 1d702 (7:5702) +CeruleanHouse1Text3: TX_FAR MelanieOddishText TX_ASM ld a, ODDISH call PlayCry jp TextScriptEnd -CeruleanHouse1Text4: ; 1d702 (7:5702) +CeruleanHouse1Text4: TX_FAR MelanieSandshrewText TX_ASM ld a, SANDSHREW diff --git a/scripts/ceruleanhouse2.asm b/scripts/ceruleanhouse2.asm index 278f3bcf..e83c2194 100755 --- a/scripts/ceruleanhouse2.asm +++ b/scripts/ceruleanhouse2.asm @@ -1,14 +1,14 @@ -CeruleanHouse2Script: ; 74e09 (1d:4e09) +CeruleanHouse2Script: ld a, $1 ld [wAutoTextBoxDrawingControl], a dec a ld [wDoNotWaitForButtonPressAfterDisplayingText], a ret -CeruleanHouse2TextPointers: ; 74e13 (1d:4e13) +CeruleanHouse2TextPointers: dw CeruleanHouse2Text1 -CeruleanHouse2Text1: ; 74e15 (1d:4e15) +CeruleanHouse2Text1: TX_ASM ld hl, CeruleanHouse2Text_74e77 call PrintText @@ -51,22 +51,22 @@ CeruleanHouse2Text1: ; 74e15 (1d:4e15) call PrintText jp TextScriptEnd -BadgeItemList: ; 74e6d (1d:4e6d) +BadgeItemList: db $8,BOULDERBADGE,CASCADEBADGE,THUNDERBADGE,RAINBOWBADGE,SOULBADGE,MARSHBADGE,VOLCANOBADGE,EARTHBADGE,$FF -CeruleanHouse2Text_74e77: ; 74e77 (1d:4e77) +CeruleanHouse2Text_74e77: TX_FAR _CeruleanHouse2Text_74e77 db "@" -CeruleanHouse2Text_74e7c: ; 74e7c (1d:4e7c) +CeruleanHouse2Text_74e7c: TX_FAR _CeruleanHouse2Text_74e7c db "@" -CeruleanHouse2Text_74e81: ; 74e81 (1d:4e81) +CeruleanHouse2Text_74e81: TX_FAR _CeruleanHouse2Text_74e81 db "@" -TextPointers_74e86: ; 74e86 (1d:4e86) +TextPointers_74e86: dw CeruleanHouse2Text_74e96 dw CeruleanHouse2Text_74e9b dw CeruleanHouse2Text_74ea0 @@ -76,34 +76,34 @@ TextPointers_74e86: ; 74e86 (1d:4e86) dw CeruleanHouse2Text_74eb4 dw CeruleanHouse2Text_74eb9 -CeruleanHouse2Text_74e96: ; 74e96 (1d:4e96) +CeruleanHouse2Text_74e96: TX_FAR _CeruleanHouse2Text_74e96 db "@" -CeruleanHouse2Text_74e9b: ; 74e9b (1d:4e9b) +CeruleanHouse2Text_74e9b: TX_FAR _CeruleanHouse2Text_74e9b db "@" -CeruleanHouse2Text_74ea0: ; 74ea0 (1d:4ea0) +CeruleanHouse2Text_74ea0: TX_FAR _CeruleanHouse2Text_74ea0 db "@" -CeruleanHouse2Text_74ea5: ; 74ea5 (1d:4ea5) +CeruleanHouse2Text_74ea5: TX_FAR _CeruleanHouse2Text_74ea5 db "@" -CeruleanHouse2Text_74eaa: ; 74eaa (1d:4eaa) +CeruleanHouse2Text_74eaa: TX_FAR _CeruleanHouse2Text_74eaa db "@" -CeruleanHouse2Text_74eaf: ; 74eaf (1d:4eaf) +CeruleanHouse2Text_74eaf: TX_FAR _CeruleanHouse2Text_74eaf db "@" -CeruleanHouse2Text_74eb4: ; 74eb4 (1d:4eb4) +CeruleanHouse2Text_74eb4: TX_FAR _CeruleanHouse2Text_74eb4 db "@" -CeruleanHouse2Text_74eb9: ; 74eb9 (1d:4eb9) +CeruleanHouse2Text_74eb9: TX_FAR _CeruleanHouse2Text_74eb9 db "@" diff --git a/scripts/ceruleanhousetrashed.asm b/scripts/ceruleanhousetrashed.asm index a1f58684..da848b7c 100755 --- a/scripts/ceruleanhousetrashed.asm +++ b/scripts/ceruleanhousetrashed.asm @@ -1,13 +1,13 @@ -CeruleanHouseTrashedScript: ; 1d685 (7:5685) +CeruleanHouseTrashedScript: call EnableAutoTextBoxDrawing ret -CeruleanHouseTrashedTextPointers: ; 1d689 (7:5689) +CeruleanHouseTrashedTextPointers: dw CeruleanHouseTrashedText1 dw CeruleanHouseTrashedText2 dw CeruleanHouseTrashedText3 -CeruleanHouseTrashedText1: ; 1d68f (7:568f) +CeruleanHouseTrashedText1: TX_ASM ld b, $e4 predef GetQuantityOfItemInBag @@ -22,18 +22,18 @@ CeruleanHouseTrashedText1: ; 1d68f (7:568f) .asm_8dfe9 jp TextScriptEnd -CeruleanHouseTrashedText_1d6ab: ; 1d6ab (7:56ab) +CeruleanHouseTrashedText_1d6ab: TX_FAR _CeruleanTrashedText_1d6ab db "@" -CeruleanHouseTrashedText_1d6b0: ; 1d6b0 (7:56b0) +CeruleanHouseTrashedText_1d6b0: TX_FAR _CeruleanTrashedText_1d6b0 db "@" -CeruleanHouseTrashedText2: ; 1d6b5 (7:56b5) +CeruleanHouseTrashedText2: TX_FAR _CeruleanHouseTrashedText2 db "@" -CeruleanHouseTrashedText3: ; 1d6ba (7:56ba) +CeruleanHouseTrashedText3: TX_FAR _CeruleanHouseTrashedText3 db "@" diff --git a/scripts/ceruleanmart.asm b/scripts/ceruleanmart.asm index 7aea6d47..1a5df5a2 100755 --- a/scripts/ceruleanmart.asm +++ b/scripts/ceruleanmart.asm @@ -1,15 +1,15 @@ -CeruleanMartScript: ; 5c895 (17:4895) +CeruleanMartScript: jp EnableAutoTextBoxDrawing -CeruleanMartTextPointers: ; 5c898 (17:4898) +CeruleanMartTextPointers: dw CeruleanMartText1 dw CeruleanMartText2 dw CeruleanMartText3 -CeruleanMartText2: ; 5c89e (17:489e) +CeruleanMartText2: TX_FAR _CeruleanMartText2 db "@" -CeruleanMartText3: ; 5c8a3 (17:48a3) +CeruleanMartText3: TX_FAR _CeruleanMartText3 db "@" diff --git a/scripts/ceruleanpokecenter.asm b/scripts/ceruleanpokecenter.asm index 5ee5d4a2..2c9d4419 100755 --- a/scripts/ceruleanpokecenter.asm +++ b/scripts/ceruleanpokecenter.asm @@ -1,25 +1,25 @@ -CeruleanPokecenterScript: ; 5c645 (17:4645) +CeruleanPokecenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -CeruleanPokecenterTextPointers: ; 5c64b (17:464b) +CeruleanPokecenterTextPointers: dw CeruleanPokecenterText1 dw CeruleanPokecenterText2 dw CeruleanPokecenterText3 dw CeruleanPokecenterText4 dw CeruleanPokecenterText5 -CeruleanPokecenterText4: ; 5c653 (17:4653) +CeruleanPokecenterText4: TX_CABLE_CLUB_RECEPTIONIST -CeruleanPokecenterText1: ; 5c654 (17:4654) +CeruleanPokecenterText1: TX_POKECENTER_NURSE -CeruleanPokecenterText2: ; 5c655 (17:4655) - TX_FAR _CeruleanPokecenterText1 +CeruleanPokecenterText2: + TX_FAR _CeruleanPokecenterText2 db "@" -CeruleanPokecenterText3: ; 5c65a (17:465a) +CeruleanPokecenterText3: TX_FAR _CeruleanPokecenterText3 db "@" diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm index 16fd7d7b..1ebf943a 100755 --- a/scripts/cinnabargym.asm +++ b/scripts/cinnabargym.asm @@ -1,11 +1,11 @@ -CinnabarGymScript: ; 7574a (1d:574a) +CinnabarGymScript: call CinnabarGymScript_75759 call EnableAutoTextBoxDrawing ld hl, CinnabarGymScriptPointers ld a, [wCinnabarGymCurScript] jp JumpTable -CinnabarGymScript_75759: ; 75759 (1d:5759) +CinnabarGymScript_75759: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] @@ -17,17 +17,17 @@ CinnabarGymScript_75759: ; 75759 (1d:5759) call nz, UpdateCinnabarGymGateTileBlocks ResetEvent EVENT_2A7 ret -CinnabarGymScript_75772: ; 75772 (1d:5772) +CinnabarGymScript_75772: ld hl, Gym7CityName ld de, Gym7LeaderName jp LoadGymLeaderAndCityName -Gym7CityName: ; 7577b (1d:577b) +Gym7CityName: db "CINNABAR ISLAND@" -Gym7LeaderName: ; 7578b (1d:578b) +Gym7LeaderName: db "BLAINE@" -CinnabarGymScript_75792: ; 75792 (1d:5792) +CinnabarGymScript_75792: xor a ld [wJoyIgnore], a ld [wCinnabarGymCurScript], a @@ -35,21 +35,21 @@ CinnabarGymScript_75792: ; 75792 (1d:5792) ld [wOpponentAfterWrongAnswer], a ret -CinnabarGymScript_74f48: ; 757a0 (1d:57a0) +CinnabarGymScript_74f48: ld a, [hSpriteIndexOrTextID] ld [wTrainerHeaderFlagBit], a ret -CinnabarGymFlagAction: ; 757f1 (1d:57f1) +CinnabarGymFlagAction: predef_jump FlagActionPredef -CinnabarGymScriptPointers: ; 757a6 (1d:57a6) +CinnabarGymScriptPointers: dw CinnabarGymScript0 dw CinnabarGymScript1 dw CinnabarGymScript2 dw CinnabarGymScript3 -CinnabarGymScript0: ; 757ae (1d:57ae) +CinnabarGymScript0: ld a, [wOpponentAfterWrongAnswer] and a ret z @@ -77,7 +77,7 @@ CinnabarGymScript0: ; 757ae (1d:57ae) ld [wCurMapScript], a ret -MovementData_757d7: ; 757d7 (1d:57d7) +MovementData_757d7: db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_UP db $FF @@ -89,7 +89,7 @@ PikachuMovementData_74f97: db $35 db $3f -MovementData_757da: ; 757da (1d:57da) +MovementData_757da: db NPC_MOVEMENT_LEFT db $FF @@ -112,10 +112,10 @@ CinnabarGymScript_74fa3: ld a, b cp e ret nz - call Func_159b + call ApplyPikachuMovementData ret -CinnabarGymScript1: ; 757dc (1d:57dc) +CinnabarGymScript1: ld a, [wd730] bit 0, a ret nz @@ -126,7 +126,7 @@ CinnabarGymScript1: ; 757dc (1d:57dc) ld [hSpriteIndexOrTextID], a jp DisplayTextID -CinnabarGymScript2: ; 757f6 (1d:57f6) +CinnabarGymScript2: call CinnabarGymScript_753e9 ld a, [wIsInBattle] cp $ff @@ -192,14 +192,14 @@ CinnabarGymScript_75041: call UpdateCinnabarGymGateTileBlocks ret -CinnabarGymScript3: ; 7584a (1d:584a) +CinnabarGymScript3: call CinnabarGymScript_753e9 ld a, [wIsInBattle] cp $ff jp z, CinnabarGymScript_75792 ld a, $f0 ld [wJoyIgnore], a -CinnabarGymScript3_75857: ; 75857 (1d:5857) +CinnabarGymScript3_75857: ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -230,7 +230,7 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857) jp CinnabarGymScript_75792 -CinnabarGymTextPointers: ; 7589f (1d:589f) +CinnabarGymTextPointers: dw CinnabarGymText1 dw CinnabarGymText2 dw CinnabarGymText3 @@ -244,7 +244,7 @@ CinnabarGymTextPointers: ; 7589f (1d:589f) dw ReceivedTM38Text dw TM38NoRoomText -CinnabarGymScript_750c3: ; 758b7 (1d:58b7) +CinnabarGymScript_750c3: ld a, [hSpriteIndexOrTextID] ld [wSpriteIndex], a call EngageMapTrainer @@ -264,7 +264,7 @@ CinnabarGymScript_750c3: ; 758b7 (1d:58b7) ld [wCurMapScript], a jp TextScriptEnd -CinnabarGymText1: ; 758df (1d:58df) +CinnabarGymText1: TX_ASM CheckEvent EVENT_BEAT_BLAINE jr z, .asm_d9332 @@ -287,35 +287,35 @@ CinnabarGymText1: ; 758df (1d:58df) ld [wGymLeaderNo], a jp CinnabarGymScript_750c3 -BlaineBattleText: ; 75914 (1d:5914) +BlaineBattleText: TX_FAR _BlaineBattleText db "@" -BlaineEndBattleText: ; 75919 (1d:5919) +BlaineEndBattleText: TX_FAR _BlaineEndBattleText db $11 db $d db "@" -BlaineFireBlastText: ; 75920 (1d:5920) +BlaineFireBlastText: TX_FAR _BlaineFireBlastText db "@" -BlaineBadgeText: ; 75925 (1d:5925) +BlaineBadgeText: TX_FAR _BlaineBadgeText db "@" -ReceivedTM38Text: ; 7592a (1d:592a) +ReceivedTM38Text: TX_FAR _ReceivedTM38Text db $0B TX_FAR _TM38ExplanationText db "@" -TM38NoRoomText: ; 75934 (1d:5934) +TM38NoRoomText: TX_FAR _TM38NoRoomText db "@" -CinnabarGymText2: ; 75939 (1d:5939) +CinnabarGymText2: TX_ASM call CinnabarGymScript_74f48 CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_0 @@ -331,19 +331,19 @@ CinnabarGymText2: ; 75939 (1d:5939) call PrintText jp TextScriptEnd -CinnabarGymText_7595f: ; 7595f (1d:595f) +CinnabarGymText_7595f: TX_FAR _CinnabarGymText_7595f db "@" -CinnabarGymText_75964: ; 75964 (1d:5964) +CinnabarGymText_75964: TX_FAR _CinnabarGymText_75964 db "@" -CinnabarGymText_75969: ; 75969 (1d:5969) +CinnabarGymText_75969: TX_FAR _CinnabarGymText_75969 db "@" -CinnabarGymText3: ; 7596e (1d:596e) +CinnabarGymText3: TX_ASM call CinnabarGymScript_74f48 CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_1 @@ -368,19 +368,19 @@ CinnabarGymText3: ; 7596e (1d:596e) call PrintText jp TextScriptEnd -CinnabarGymText_75994: ; 75994 (1d:5994) +CinnabarGymText_75994: TX_FAR _CinnabarGymText_75994 db "@" -CinnabarGymText_75999: ; 75999 (1d:5999) +CinnabarGymText_75999: TX_FAR _CinnabarGymText_75999 db "@" -CinnabarGymText_7599e: ; 7599e (1d:599e) +CinnabarGymText_7599e: TX_FAR _CinnabarGymText_7599e db "@" -CinnabarGymText4: ; 759a3 (1d:59a3) +CinnabarGymText4: TX_ASM call CinnabarGymScript_74f48 CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_2 @@ -404,19 +404,19 @@ CinnabarGymText4: ; 759a3 (1d:59a3) call PrintText jp TextScriptEnd -CinnabarGymText_759c9: ; 759c9 (1d:59c9) +CinnabarGymText_759c9: TX_FAR _CinnabarGymText_759c9 db "@" -CinnabarGymText_759ce: ; 759ce (1d:59ce) +CinnabarGymText_759ce: TX_FAR _CinnabarGymText_759ce db "@" -CinnabarGymText_759d3: ; 759d3 (1d:59d3) +CinnabarGymText_759d3: TX_FAR _CinnabarGymText_759d3 db "@" -CinnabarGymText5: ; 759d8 (1d:59d8) +CinnabarGymText5: TX_ASM call CinnabarGymScript_74f48 CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_3 @@ -440,19 +440,19 @@ CinnabarGymText5: ; 759d8 (1d:59d8) call PrintText jp TextScriptEnd -CinnabarGymText_759fe: ; 759fe (1d:59fe) +CinnabarGymText_759fe: TX_FAR _CinnabarGymText_759fe db "@" -CinnabarGymText_75a03: ; 75a03 (1d:5a03) +CinnabarGymText_75a03: TX_FAR _CinnabarGymText_75a03 db "@" -CinnabarGymText_75a08: ; 75a08 (1d:5a08) +CinnabarGymText_75a08: TX_FAR _CinnabarGymText_75a08 db "@" -CinnabarGymText6: ; 75a0d (1d:5a0d) +CinnabarGymText6: TX_ASM call CinnabarGymScript_74f48 CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_4 @@ -476,19 +476,19 @@ CinnabarGymText6: ; 75a0d (1d:5a0d) call PrintText jp TextScriptEnd -CinnabarGymText_75a33: ; 75a33 (1d:5a33) +CinnabarGymText_75a33: TX_FAR _CinnabarGymText_75a33 db "@" -CinnabarGymText_75a38: ; 75a38 (1d:5a38) +CinnabarGymText_75a38: TX_FAR _CinnabarGymText_75a38 db "@" -CinnabarGymText_75a3d: ; 75a3d (1d:5a3d) +CinnabarGymText_75a3d: TX_FAR _CinnabarGymText_75a3d db "@" -CinnabarGymText7: ; 75a42 (1d:5a42) +CinnabarGymText7: TX_ASM call CinnabarGymScript_74f48 CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_5 @@ -512,19 +512,19 @@ CinnabarGymText7: ; 75a42 (1d:5a42) call PrintText jp TextScriptEnd -CinnabarGymText_75a68: ; 75a68 (1d:5a68) +CinnabarGymText_75a68: TX_FAR _CinnabarGymText_75a68 db "@" -CinnabarGymText_75a6d: ; 75a6d (1d:5a6d) +CinnabarGymText_75a6d: TX_FAR _CinnabarGymText_75a6d db "@" -CinnabarGymText_75a72: ; 75a72 (1d:5a72) +CinnabarGymText_75a72: TX_FAR _CinnabarGymText_75a72 db "@" -CinnabarGymText8: ; 75a77 (1d:5a77) +CinnabarGymText8: TX_ASM call CinnabarGymScript_74f48 CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_6 @@ -548,19 +548,19 @@ CinnabarGymText8: ; 75a77 (1d:5a77) call PrintText jp TextScriptEnd -CinnabarGymText_75a9d: ; 75a9d (1d:5a9d) +CinnabarGymText_75a9d: TX_FAR _CinnabarGymText_75a9d db "@" -CinnabarGymText_75aa2: ; 75aa2 (1d:5aa2) +CinnabarGymText_75aa2: TX_FAR _CinnabarGymText_75aa2 db "@" -CinnabarGymText_75aa7: ; 75aa7 (1d:5aa7) +CinnabarGymText_75aa7: TX_FAR _CinnabarGymText_75aa7 db "@" -CinnabarGymText9: ; 75aac (1d:5aac) +CinnabarGymText9: TX_ASM callab Func_f2133 jp TextScriptEnd diff --git a/scripts/cinnabargym3.asm b/scripts/cinnabargym3.asm index a85a3206..9e8cad74 100755 --- a/scripts/cinnabargym3.asm +++ b/scripts/cinnabargym3.asm @@ -9,11 +9,11 @@ Func_f2133: call PrintText ret -CinnabarGymText_75ac2: ; 75ac2 (1d:5ac2) +CinnabarGymText_75ac2: TX_FAR _CinnabarGymText_75ac2 db "@" -CinnabarGymText_75ac7: ; 75ac7 (1d:5ac7) +CinnabarGymText_75ac7: TX_FAR _CinnabarGymText_75ac7 db "@" diff --git a/scripts/cinnabarisland.asm b/scripts/cinnabarisland.asm index a0fa4172..4dbec159 100755 --- a/scripts/cinnabarisland.asm +++ b/scripts/cinnabarisland.asm @@ -1,4 +1,4 @@ -CinnabarIslandScript: ; 1ca19 (7:4a19) +CinnabarIslandScript: call EnableAutoTextBoxDrawing ld hl, wCurrentMapScriptFlags set 5, [hl] @@ -8,11 +8,11 @@ CinnabarIslandScript: ; 1ca19 (7:4a19) ld a, [wCinnabarIslandCurScript] jp JumpTable -CinnabarIslandScriptPointers: ; 1ca34 (7:4a34) +CinnabarIslandScriptPointers: dw CinnabarIslandScript0 dw CinnabarIslandScript1 -CinnabarIslandScript0: ; 1ca38 (7:4a38) +CinnabarIslandScript0: ld b, SECRET_KEY call IsItemInBag ret nz @@ -35,13 +35,13 @@ CinnabarIslandScript0: ; 1ca38 (7:4a38) ld [wSimulatedJoypadStatesEnd], a call StartSimulatingJoypadStates xor a - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld [wJoyIgnore], a ld a, $1 ld [wCinnabarIslandCurScript], a ret -CinnabarIslandScript1: ; 1ca73 (7:4a73) +CinnabarIslandScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -50,7 +50,7 @@ CinnabarIslandScript1: ; 1ca73 (7:4a73) ld [wCinnabarIslandCurScript], a ret -CinnabarIslandTextPointers: ; 1ca81 (7:4a81) +CinnabarIslandTextPointers: dw CinnabarIslandText1 dw CinnabarIslandText2 dw CinnabarIslandText3 @@ -60,26 +60,26 @@ CinnabarIslandTextPointers: ; 1ca81 (7:4a81) dw CinnabarIslandText7 dw CinnabarIslandText8 -CinnabarIslandText8: ; 1ca91 (7:4a91) +CinnabarIslandText8: TX_FAR _CinnabarIslandText8 db "@" -CinnabarIslandText1: ; 1ca96 (7:4a96) +CinnabarIslandText1: TX_FAR _CinnabarIslandText1 db "@" -CinnabarIslandText2: ; 1ca9b (7:4a9b) +CinnabarIslandText2: TX_FAR _CinnabarIslandText2 db "@" -CinnabarIslandText3: ; 1caa0 (7:4aa0) +CinnabarIslandText3: TX_FAR _CinnabarIslandText3 db "@" -CinnabarIslandText6: ; 1caa5 (7:4aa5) +CinnabarIslandText6: TX_FAR _CinnabarIslandText6 db "@" -CinnabarIslandText7: ; 1caaa (7:4aaa) +CinnabarIslandText7: TX_FAR _CinnabarIslandText7 db "@" diff --git a/scripts/cinnabarmart.asm b/scripts/cinnabarmart.asm index 2abd7b67..35e9b4ce 100755 --- a/scripts/cinnabarmart.asm +++ b/scripts/cinnabarmart.asm @@ -1,15 +1,15 @@ -CinnabarMartScript: ; 75e7e (1d:5e7e) +CinnabarMartScript: jp EnableAutoTextBoxDrawing -CinnabarMartTextPointers: ; 75e81 (1d:5e81) +CinnabarMartTextPointers: dw CinnabarMartText1 dw CinnabarMartText2 dw CinnabarMartText3 -CinnabarMartText2: ; 75e87 (1d:5e87) +CinnabarMartText2: TX_FAR _CinnabarMartText2 db "@" -CinnabarMartText3: ; 75e8c (1d:5e8c) +CinnabarMartText3: TX_FAR _CinnabarMartText3 db "@" diff --git a/scripts/cinnabarpokecenter.asm b/scripts/cinnabarpokecenter.asm index fd49ae85..b4305d02 100755 --- a/scripts/cinnabarpokecenter.asm +++ b/scripts/cinnabarpokecenter.asm @@ -1,26 +1,26 @@ -CinnabarPokecenterScript: ; 75e2c (1d:5e2c) +CinnabarPokecenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -CinnabarPokecenterTextPointers: ; 75e32 (1d:5e32) +CinnabarPokecenterTextPointers: dw CinnabarPokecenterText1 dw CinnabarPokecenterText2 dw CinnabarPokecenterText3 dw CinnabarPokecenterText4 dw CinnabarPokecenterText5 -CinnabarPokecenterText1: ; 75e3a (1d:5e3a) +CinnabarPokecenterText1: TX_POKECENTER_NURSE -CinnabarPokecenterText2: ; 75e3b (1d:5e3b) +CinnabarPokecenterText2: TX_FAR _CinnabarPokecenterText1 db "@" -CinnabarPokecenterText3: ; 75e40 (1d:5e40) +CinnabarPokecenterText3: TX_FAR _CinnabarPokecenterText3 db "@" -CinnabarPokecenterText4: ; 75e45 (1d:5e45) +CinnabarPokecenterText4: TX_CABLE_CLUB_RECEPTIONIST CinnabarPokecenterText5: diff --git a/scripts/colosseum.asm b/scripts/colosseum.asm index e4ba4611..bdfa3c44 100644 --- a/scripts/colosseum.asm +++ b/scripts/colosseum.asm @@ -1,9 +1,9 @@ -ColosseumScript: ; 4fd7d (13:7d7d) +ColosseumScript: jp TradeCenterScript -ColosseumTextPointers: ; 4fd80 (13:7d80) +ColosseumTextPointers: dw ColosseumText1 -ColosseumText1: ; 4fd82 (13:7d82) +ColosseumText1: TX_FAR _ColosseumText1 db "@" diff --git a/scripts/copycatshouse1f.asm b/scripts/copycatshouse1f.asm index bc76da1a..25cd0fc2 100755 --- a/scripts/copycatshouse1f.asm +++ b/scripts/copycatshouse1f.asm @@ -1,20 +1,20 @@ -CopycatsHouse1FScript: ; 75ec3 (1d:5ec3) +CopycatsHouse1FScript: jp EnableAutoTextBoxDrawing -CopycatsHouse1FTextPointers: ; 75ec6 (1d:5ec6) +CopycatsHouse1FTextPointers: dw CopycatsHouse1FText1 dw CopycatsHouse1FText2 dw CopycatsHouse1FText3 -CopycatsHouse1FText1: ; 75ecc (1d:5ecc) +CopycatsHouse1FText1: TX_FAR _CopycatsHouse1FText1 db "@" -CopycatsHouse1FText2: ; 75ed1 (1d:5ed1) +CopycatsHouse1FText2: TX_FAR _CopycatsHouse1FText2 db "@" -CopycatsHouse1FText3: ; 75ed6 (1d:5ed6) +CopycatsHouse1FText3: TX_FAR _CopycatsHouse1FText3 TX_ASM ld a, CHANSEY diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index 74dbb1c5..7bf8d0e9 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -1,7 +1,7 @@ -CopycatsHouse2FScript: ; 5cc71 (17:4c71) +CopycatsHouse2FScript: jp EnableAutoTextBoxDrawing -CopycatsHouse2FTextPointers: ; 5cc74 (17:4c74) +CopycatsHouse2FTextPointers: dw CopycatsHouse2FText1 dw CopycatsHouse2FText2 dw CopycatsHouse2FText3 @@ -10,7 +10,7 @@ CopycatsHouse2FTextPointers: ; 5cc74 (17:4c74) dw CopycatsHouse2FText6 dw CopycatsHouse2FText7 -CopycatsHouse2FText1: ; 5cc82 (17:4c82) +CopycatsHouse2FText1: TX_ASM CheckEvent EVENT_GOT_TM31 jr nz, .asm_7ccf3 @@ -43,46 +43,46 @@ CopycatsHouse2FText1: ; 5cc82 (17:4c82) .asm_62ecd jp TextScriptEnd -CopycatsHouse2FText_5ccd4: ; 5ccd4 (17:4cd4) +CopycatsHouse2FText_5ccd4: TX_FAR _CopycatsHouse2FText_5ccd4 db "@" -TM31PreReceiveText: ; 5ccd9 (17:4cd9) +TM31PreReceiveText: TX_FAR _TM31PreReceiveText db "@" -ReceivedTM31Text: ; 5ccde (17:4cde) +ReceivedTM31Text: TX_FAR _ReceivedTM31Text db $0B -TM31ExplanationText1: ; 5cce3 (17:4ce3) +TM31ExplanationText1: TX_FAR _TM31ExplanationText1 db $d, "@" -TM31ExplanationText2: ; 5cce9 (17:4ce9) +TM31ExplanationText2: TX_FAR _TM31ExplanationText2 db "@" -TM31NoRoomText: ; 5ccee (17:4cee) +TM31NoRoomText: TX_FAR _TM31NoRoomText db $d, "@" -CopycatsHouse2FText2: ; 5ccf4 (17:4cf4) +CopycatsHouse2FText2: TX_FAR _CopycatsHouse2FText2 db "@" -CopycatsHouse2FText5: ; 5ccf9 (17:4cf9) -CopycatsHouse2FText4: ; 5ccf9 (17:4cf9) -CopycatsHouse2FText3: ; 5ccf9 (17:4cf9) +CopycatsHouse2FText5: +CopycatsHouse2FText4: +CopycatsHouse2FText3: TX_FAR _CopycatsHouse2FText3 db "@" -CopycatsHouse2FText6: ; 5ccfe (17:4cfe) +CopycatsHouse2FText6: TX_FAR _CopycatsHouse2FText6 db "@" -CopycatsHouse2FText7: ; 5cd03 (17:4d03) +CopycatsHouse2FText7: TX_ASM - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ld hl, CopycatsHouse2FText_5cd1c jr nz, .notUp @@ -91,10 +91,10 @@ CopycatsHouse2FText7: ; 5cd03 (17:4d03) call PrintText jp TextScriptEnd -CopycatsHouse2FText_5cd17: ; 5cd17 (17:4d17) +CopycatsHouse2FText_5cd17: TX_FAR _CopycatsHouse2FText_5cd17 db "@" -CopycatsHouse2FText_5cd1c: ; 5cd1c (17:4d1c) +CopycatsHouse2FText_5cd1c: TX_FAR _CopycatsHouse2FText_5cd1c db "@" diff --git a/scripts/daycarem.asm b/scripts/daycarem.asm index b80b3dac..6df2bcd6 100755 --- a/scripts/daycarem.asm +++ b/scripts/daycarem.asm @@ -1,10 +1,10 @@ -DayCareMScript: ; 5624f (15:624f) +DayCareMScript: jp EnableAutoTextBoxDrawing -DayCareMTextPointers: ; 56252 (15:6252) +DayCareMTextPointers: dw DayCareMText1 -DayCareMText1: ; 56254 (15:6254) +DayCareMText1: TX_ASM call SaveScreenTilesToBuffer2 ld a, [wDayCareInUse] @@ -218,7 +218,7 @@ DayCareMText1: ; 56254 (15:6254) .withdrewPikachuFromDayCare ld a, $6 - ld [wd431], a + ld [wPikachuSpawnState], a ; GameFreak... TriHard ld hl, Func_fc4fa @@ -239,60 +239,60 @@ DayCareMText1: ; 56254 (15:6254) call PrintText jp TextScriptEnd -DayCareIntroText: ; 5640f (15:640f) +DayCareIntroText: TX_FAR _DayCareIntroText db "@" -DayCareWhichMonText: ; 56414 (15:6414) +DayCareWhichMonText: TX_FAR _DayCareWhichMonText db "@" -DayCareWillLookAfterMonText: ; 56419 (15:6419) +DayCareWillLookAfterMonText: TX_FAR _DayCareWillLookAfterMonText db "@" -DayCareComeSeeMeInAWhileText: ; 5641e (15:641e) +DayCareComeSeeMeInAWhileText: TX_FAR _DayCareComeSeeMeInAWhileText db "@" -DayCareMonHasGrownText: ; 56423 (15:6423) +DayCareMonHasGrownText: TX_FAR _DayCareMonHasGrownText db "@" -DayCareOweMoneyText: ; 56428 (15:6428) +DayCareOweMoneyText: TX_FAR _DayCareOweMoneyText db "@" -DayCareGotMonBackText: ; 5642d (15:642d) +DayCareGotMonBackText: TX_FAR _DayCareGotMonBackText db "@" -DayCareMonNeedsMoreTimeText: ; 56432 (15:6432) +DayCareMonNeedsMoreTimeText: TX_FAR _DayCareMonNeedsMoreTimeText db "@" -DayCareAllRightThenText: ; 56437 (15:6437) +DayCareAllRightThenText: TX_FAR _DayCareAllRightThenText -DayCareComeAgainText: ; 5643b (15:643b) +DayCareComeAgainText: TX_FAR _DayCareComeAgainText db "@" -DayCareNoRoomForMonText: ; 56440 (15:6440) +DayCareNoRoomForMonText: TX_FAR _DayCareNoRoomForMonText db "@" -DayCareOnlyHaveOneMonText: ; 56445 (15:6445) +DayCareOnlyHaveOneMonText: TX_FAR _DayCareOnlyHaveOneMonText db "@" -DayCareCantAcceptMonWithHMText: ; 5644a (15:644a) +DayCareCantAcceptMonWithHMText: TX_FAR _DayCareCantAcceptMonWithHMText db "@" -DayCareHeresYourMonText: ; 5644f (15:644f) +DayCareHeresYourMonText: TX_FAR _DayCareHeresYourMonText db "@" -DayCareNotEnoughMoneyText: ; 56454 (15:6454) +DayCareNotEnoughMoneyText: TX_FAR _DayCareNotEnoughMoneyText db "@" diff --git a/scripts/diglettscave.asm b/scripts/diglettscave.asm index efbf9713..593b12a6 100755 --- a/scripts/diglettscave.asm +++ b/scripts/diglettscave.asm @@ -1,5 +1,5 @@ -DiglettsCaveScript: ; 61f6e (18:5f6e) +DiglettsCaveScript: jp EnableAutoTextBoxDrawing -DiglettsCaveTextPointers: ; 61f71 (18:5f71) +DiglettsCaveTextPointers: db "@" diff --git a/scripts/diglettscaveroute11.asm b/scripts/diglettscaveroute11.asm index 43e3f24e..d97a8446 100755 --- a/scripts/diglettscaveroute11.asm +++ b/scripts/diglettscaveroute11.asm @@ -1,12 +1,12 @@ -DiglettsCaveEntranceRoute11Script: ; 1e5ba (7:65ba) +DiglettsCaveEntranceRoute11Script: call EnableAutoTextBoxDrawing ld a, ROUTE_11 ld [wLastMap], a ret -DiglettsCaveEntranceRoute11TextPointers: ; 1e5c3 (7:65c3) +DiglettsCaveEntranceRoute11TextPointers: dw DiglettsCaveEntranceRoute11Text1 -DiglettsCaveEntranceRoute11Text1: ; 1e5c5 (7:65c5) +DiglettsCaveEntranceRoute11Text1: TX_FAR _DiglettsCaveEntRoute11Text1 db "@" diff --git a/scripts/diglettscaveroute2.asm b/scripts/diglettscaveroute2.asm index 1bee2a1c..9f061daa 100755 --- a/scripts/diglettscaveroute2.asm +++ b/scripts/diglettscaveroute2.asm @@ -1,11 +1,11 @@ -DiglettsCaveRoute2Script: ; 1deb0 (7:5eb0) +DiglettsCaveRoute2Script: ld a, ROUTE_2 ld [wLastMap], a jp EnableAutoTextBoxDrawing -DiglettsCaveRoute2TextPointers: ; 1deb8 (7:5eb8) +DiglettsCaveRoute2TextPointers: dw DiglettsCaveRoute2Text1 -DiglettsCaveRoute2Text1: ; 1deba (7:5eba) +DiglettsCaveRoute2Text1: TX_FAR _DiglettsCaveRoute2Text1 db "@" diff --git a/scripts/fanclub.asm b/scripts/fanclub.asm index 80f8247f..01d6269b 100755 --- a/scripts/fanclub.asm +++ b/scripts/fanclub.asm @@ -1,4 +1,4 @@ -FanClubScript: ; 59b70 (16:5b70) +FanClubScript: call EnableAutoTextBoxDrawing ld hl, FanClubScriptPointers ld a, [wFanClubCurScript] @@ -10,18 +10,18 @@ FanClubScriptPointers: dw FanClubScript2 FanClubScript1: - ld hl, wPreventBlackout + ld hl, wd492 bit 7, [hl] call z, FanClubScript_59a44 - ld hl, wPreventBlackout + ld hl, wd492 set 7, [hl] ret FanClubScript2: - ld hl, wPreventBlackout + ld hl, wd492 bit 7, [hl] call z, FanClubScript_59a39 - ld hl, wPreventBlackout + ld hl, wd492 set 7, [hl] ret @@ -36,7 +36,7 @@ FanClubScript_59a44: ld a, [wd472] bit 7, a ret z - callab Func_fce73 + callab CheckPikachuFaintedOrStatused ret c ld a, $1 ld [wFanClubCurScript], a @@ -50,7 +50,7 @@ FanClubScript_59a44: ld [wEmotionBubbleSpriteIndex], a predef EmotionBubble ld hl, PikachuMovementScript_59a8c - call Func_159b + call ApplyPikachuMovementData ld a, $2 ld [wSpriteStateData1 + 3 * $10 + 1], a ; Seel xor a ; SPRITE_FACING_DOWN @@ -68,7 +68,7 @@ PikachuMovementScript_59a8c: db $1e db $3f -FanClubTextPointers: ; 59b84 (16:5b84) +FanClubTextPointers: dw FanClubText1 dw FanClubText2 dw FanClubText3 @@ -244,7 +244,7 @@ FanClubText5: ld [wUpdateSpritesEnabled], a ld hl, wd730 set 6, [hl] - callab Func_e8e24 + callab PrintFanClubPortrait ld hl, wd730 res 6, [hl] call GBPalWhiteOutWithDelay3 @@ -302,6 +302,6 @@ Text_59c2e: TX_FAR FanClubChairPrintText4 db "@" -FanClubText6: ; 59c88 (16:5c88) +FanClubText6: TX_FAR _FanClubText6 db "@" diff --git a/scripts/fightingdojo.asm b/scripts/fightingdojo.asm index fb3ea5b4..9d28046f 100755 --- a/scripts/fightingdojo.asm +++ b/scripts/fightingdojo.asm @@ -1,4 +1,4 @@ -FightingDojoScript: ; 5cd5d (17:4d5d) +FightingDojoScript: call EnableAutoTextBoxDrawing ld hl, FightingDojoTrainerHeaders ld de, FightingDojoScriptPointers @@ -7,20 +7,20 @@ FightingDojoScript: ; 5cd5d (17:4d5d) ld [wFightingDojoCurScript], a ret -FightingDojoScript_5cd70: ; 5cd70 (17:4d70) +FightingDojoScript_5cd70: xor a ld [wJoyIgnore], a ld [wFightingDojoCurScript], a ld [wCurMapScript], a ret -FightingDojoScriptPointers: ; 5cd7b (17:4d7b) +FightingDojoScriptPointers: dw FightingDojoScript1 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw FightingDojoScript3 -FightingDojoScript1: ; 5cd83 (17:4d83) +FightingDojoScript1: CheckEvent EVENT_DEFEATED_FIGHTING_DOJO ret nz call CheckFightingMapTrainers @@ -52,7 +52,7 @@ FightingDojoScript1: ; 5cd83 (17:4d83) call DisplayTextID ret -FightingDojoScript3: ; 5cdc6 (17:4dc6) +FightingDojoScript3: ld a, [wIsInBattle] cp $ff jp z, FightingDojoScript_5cd70 @@ -80,7 +80,7 @@ FightingDojoScript3: ; 5cdc6 (17:4dc6) ld [wCurMapScript], a ret -FightingDojoTextPointers: ; 5ce03 (17:4e03) +FightingDojoTextPointers: dw FightingDojoText1 dw FightingDojoText2 dw FightingDojoText3 @@ -90,8 +90,8 @@ FightingDojoTextPointers: ; 5ce03 (17:4e03) dw FightingDojoText7 dw FightingDojoText8 -FightingDojoTrainerHeaders: ; 5ce13 (17:4e13) -FightingDojoTrainerHeader0: ; 5ce13 (17:4e13) +FightingDojoTrainerHeaders: +FightingDojoTrainerHeader0: dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 @@ -100,7 +100,7 @@ FightingDojoTrainerHeader0: ; 5ce13 (17:4e13) dw FightingDojoEndBattleText1 ; TextEndBattle dw FightingDojoEndBattleText1 ; TextEndBattle -FightingDojoTrainerHeader1: ; 5ce1f (17:4e1f) +FightingDojoTrainerHeader1: dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_1 @@ -109,7 +109,7 @@ FightingDojoTrainerHeader1: ; 5ce1f (17:4e1f) dw FightingDojoEndBattleText2 ; TextEndBattle dw FightingDojoEndBattleText2 ; TextEndBattle -FightingDojoTrainerHeader2: ; 5ce2b (17:4e2b) +FightingDojoTrainerHeader2: dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_2 @@ -118,7 +118,7 @@ FightingDojoTrainerHeader2: ; 5ce2b (17:4e2b) dw FightingDojoEndBattleText3 ; TextEndBattle dw FightingDojoEndBattleText3 ; TextEndBattle -FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) +FightingDojoTrainerHeader3: dbEventFlagBit EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 @@ -129,7 +129,7 @@ FightingDojoTrainerHeader3: ; 5ce37 (17:4e37) db $ff -FightingDojoText1: ; 5ce44 (17:4e44) +FightingDojoText1: TX_ASM CheckEvent EVENT_DEFEATED_FIGHTING_DOJO jp nz, .continue1 @@ -161,95 +161,95 @@ FightingDojoText1: ; 5ce44 (17:4e44) .asm_9dba4 jp TextScriptEnd -FightingDojoText_5ce8e: ; 5ce8e (17:4e8e) +FightingDojoText_5ce8e: TX_FAR _FightingDojoText_5ce8e db "@" -FightingDojoText_5ce93: ; 5ce93 (17:4e93) +FightingDojoText_5ce93: TX_FAR _FightingDojoText_5ce93 db "@" -FightingDojoText8: ; 5ce98 (17:4e98) +FightingDojoText8: TX_FAR _FightingDojoText_5ce98 db "@" -FightingDojoText_5ce9d: ; 5ce9d (17:4e9d) +FightingDojoText_5ce9d: TX_FAR _FightingDojoText_5ce9d db "@" -FightingDojoText2: ; 5cea2 (17:4ea2) +FightingDojoText2: TX_ASM ld hl, FightingDojoTrainerHeader0 call TalkToTrainer jp TextScriptEnd -FightingDojoBattleText1: ; 5ceac (17:4eac) +FightingDojoBattleText1: TX_FAR _FightingDojoBattleText1 db "@" -FightingDojoEndBattleText1: ; 5ceb1 (17:4eb1) +FightingDojoEndBattleText1: TX_FAR _FightingDojoEndBattleText1 db "@" -FightingDojoAfterBattleText1: ; 5ceb6 (17:4eb6) +FightingDojoAfterBattleText1: TX_FAR _FightingDojoAfterBattleText1 db "@" -FightingDojoText3: ; 5cebb (17:4ebb) +FightingDojoText3: TX_ASM ld hl, FightingDojoTrainerHeader1 call TalkToTrainer jp TextScriptEnd -FightingDojoBattleText2: ; 5cec5 (17:4ec5) +FightingDojoBattleText2: TX_FAR _FightingDojoBattleText2 db "@" -FightingDojoEndBattleText2: ; 5ceca (17:4eca) +FightingDojoEndBattleText2: TX_FAR _FightingDojoEndBattleText2 db "@" -FightingDojoAfterBattleText2: ; 5cecf (17:4ecf) +FightingDojoAfterBattleText2: TX_FAR _FightingDojoAfterBattleText2 db "@" -FightingDojoText4: ; 5ced4 (17:4ed4) +FightingDojoText4: TX_ASM ld hl, FightingDojoTrainerHeader2 call TalkToTrainer jp TextScriptEnd -FightingDojoBattleText3: ; 5cede (17:4ede) +FightingDojoBattleText3: TX_FAR _FightingDojoBattleText3 db "@" -FightingDojoEndBattleText3: ; 5cee3 (17:4ee3) +FightingDojoEndBattleText3: TX_FAR _FightingDojoEndBattleText3 db "@" -FightingDojoAfterBattleText3: ; 5cee8 (17:4ee8) +FightingDojoAfterBattleText3: TX_FAR _FightingDojoAfterBattleText3 db "@" -FightingDojoText5: ; 5ceed (17:4eed) +FightingDojoText5: TX_ASM ld hl, FightingDojoTrainerHeader3 call TalkToTrainer jp TextScriptEnd -FightingDojoBattleText4: ; 5cef7 (17:4ef7) +FightingDojoBattleText4: TX_FAR _FightingDojoBattleText4 db "@" -FightingDojoEndBattleText4: ; 5cefc (17:4efc) +FightingDojoEndBattleText4: TX_FAR _FightingDojoEndBattleText4 db "@" -FightingDojoAfterBattleText4: ; 5cf01 (17:4f01) +FightingDojoAfterBattleText4: TX_FAR _FightingDojoAfterBattleText4 db "@" -FightingDojoText6: ; 5cf06 (17:4f06) +FightingDojoText6: ; Hitmonlee Poké Ball TX_ASM CheckEitherEventSet EVENT_GOT_HITMONLEE, EVENT_GOT_HITMONCHAN @@ -280,11 +280,11 @@ FightingDojoText6: ; 5cf06 (17:4f06) .done jp TextScriptEnd -WantHitmonleeText: ; 5cf49 (17:4f49) +WantHitmonleeText: TX_FAR _WantHitmonleeText db "@" -FightingDojoText7: ; 5cf4e (17:4f4e) +FightingDojoText7: ; Hitmonchan Poké Ball TX_ASM CheckEitherEventSet EVENT_GOT_HITMONLEE, EVENT_GOT_HITMONCHAN @@ -315,10 +315,10 @@ FightingDojoText7: ; 5cf4e (17:4f4e) .done jp TextScriptEnd -WantHitmonchanText: ; 5cf91 (17:4f91) +WantHitmonchanText: TX_FAR _WantHitmonchanText db "@" -OtherHitmonText: ; 5cf96 (17:4f96) +OtherHitmonText: TX_FAR _OtherHitmonText db "@" diff --git a/scripts/fuchsiacity.asm b/scripts/fuchsiacity.asm index cdf8e203..74d7ee30 100755 --- a/scripts/fuchsiacity.asm +++ b/scripts/fuchsiacity.asm @@ -1,7 +1,7 @@ -FuchsiaCityScript: ; 19a2b (6:5a2b) +FuchsiaCityScript: jp EnableAutoTextBoxDrawing -FuchsiaCityTextPointers: ; 19a2e (6:5a2e) +FuchsiaCityTextPointers: dw FuchsiaCityText1 dw FuchsiaCityText2 dw FuchsiaCityText3 @@ -27,53 +27,53 @@ FuchsiaCityTextPointers: ; 19a2e (6:5a2e) dw FuchsiaCityText23 dw FuchsiaCityText24 -FuchsiaCityText1: ; 19a5e (6:5a5e) +FuchsiaCityText1: TX_FAR _FuchsiaCityText1 db "@" -FuchsiaCityText2: ; 19a63 (6:5a63) +FuchsiaCityText2: TX_FAR _FuchsiaCityText2 db "@" -FuchsiaCityText3: ; 19a68 (6:5a68) +FuchsiaCityText3: TX_FAR _FuchsiaCityText3 db "@" -FuchsiaCityText4: ; 19a6d (6:5a6d) +FuchsiaCityText4: TX_FAR _FuchsiaCityText4 db "@" -FuchsiaCityText5: ; 19a72 (6:5a72) -FuchsiaCityText6: ; 19a72 (6:5a72) -FuchsiaCityText7: ; 19a72 (6:5a72) -FuchsiaCityText8: ; 19a72 (6:5a72) -FuchsiaCityText9: ; 19a72 (6:5a72) -FuchsiaCityText10: ; 19a72 (6:5a72) +FuchsiaCityText5: +FuchsiaCityText6: +FuchsiaCityText7: +FuchsiaCityText8: +FuchsiaCityText9: +FuchsiaCityText10: TX_FAR _FuchsiaCityText5 db "@" -FuchsiaCityText12: ; 19a77 (6:5a77) -FuchsiaCityText11: ; 19a77 (6:5a77) +FuchsiaCityText12: +FuchsiaCityText11: TX_FAR _FuchsiaCityText11 db "@" -FuchsiaCityText13: ; 19a7c (6:5a7c) +FuchsiaCityText13: TX_FAR _FuchsiaCityText13 db "@" -FuchsiaCityText16: ; 19a81 (6:5a81) +FuchsiaCityText16: TX_FAR _FuchsiaCityText16 db "@" -FuchsiaCityText17: ; 19a86 (6:5a86) +FuchsiaCityText17: TX_FAR _FuchsiaCityText17 db "@" -FuchsiaCityText18: ; 19a8b (6:5a8b) +FuchsiaCityText18: TX_FAR _FuchsiaCityText18 db "@" -FuchsiaCityText19: ; 19a90 (6:5a90) +FuchsiaCityText19: TX_ASM ld hl, FuchsiaCityChanseyText call PrintText @@ -81,11 +81,11 @@ FuchsiaCityText19: ; 19a90 (6:5a90) call DisplayPokedex jp TextScriptEnd -FuchsiaCityChanseyText: ; 19a9f (6:5a9f) +FuchsiaCityChanseyText: TX_FAR _FuchsiaCityChanseyText db "@" -FuchsiaCityText20: ; 19aa4 (6:5aa4) +FuchsiaCityText20: TX_ASM ld hl, FuchsiaCityVoltorbText call PrintText @@ -93,11 +93,11 @@ FuchsiaCityText20: ; 19aa4 (6:5aa4) call DisplayPokedex jp TextScriptEnd -FuchsiaCityVoltorbText: ; 19ab3 (6:5ab3) +FuchsiaCityVoltorbText: TX_FAR _FuchsiaCityVoltorbText db "@" -FuchsiaCityText21: ; 19ab8 (6:5ab8) +FuchsiaCityText21: TX_ASM ld hl, FuchsiaCityKangaskhanText call PrintText @@ -105,11 +105,11 @@ FuchsiaCityText21: ; 19ab8 (6:5ab8) call DisplayPokedex jp TextScriptEnd -FuchsiaCityKangaskhanText: ; 19ac7 (6:5ac7) +FuchsiaCityKangaskhanText: TX_FAR _FuchsiaCityKangaskhanText db "@" -FuchsiaCityText22: ; 19acc (6:5acc) +FuchsiaCityText22: TX_ASM ld hl, FuchsiaCitySlowpokeText call PrintText @@ -117,11 +117,11 @@ FuchsiaCityText22: ; 19acc (6:5acc) call DisplayPokedex jp TextScriptEnd -FuchsiaCitySlowpokeText: ; 19adb (6:5adb) +FuchsiaCitySlowpokeText: TX_FAR _FuchsiaCitySlowpokeText db "@" -FuchsiaCityText23: ; 19ae0 (6:5ae0) +FuchsiaCityText23: TX_ASM ld hl, FuchsiaCityLaprasText call PrintText @@ -129,11 +129,11 @@ FuchsiaCityText23: ; 19ae0 (6:5ae0) call DisplayPokedex jp TextScriptEnd -FuchsiaCityLaprasText: ; 19aef (6:5aef) +FuchsiaCityLaprasText: TX_FAR _FuchsiaCityLaprasText db "@" -FuchsiaCityText24: ; 19af4 (6:5af4) +FuchsiaCityText24: TX_ASM CheckEvent EVENT_GOT_DOME_FOSSIL jr nz, .asm_3b4e8 @@ -156,14 +156,14 @@ FuchsiaCityText24: ; 19af4 (6:5af4) .asm_4343f jp TextScriptEnd -FuchsiaCityOmanyteText: ; 19b20 (6:5b20) +FuchsiaCityOmanyteText: TX_FAR _FuchsiaCityOmanyteText db "@" -FuchsiaCityKabutoText: ; 19b25 (6:5b25) +FuchsiaCityKabutoText: TX_FAR _FuchsiaCityKabutoText db "@" -FuchsiaCityText_19b2a: ; 19b2a (6:5b2a) +FuchsiaCityText_19b2a: TX_FAR _FuchsiaCityText_19b2a db "@" diff --git a/scripts/fuchsiagym.asm b/scripts/fuchsiagym.asm index 54c3ae1a..8268930d 100755 --- a/scripts/fuchsiagym.asm +++ b/scripts/fuchsiagym.asm @@ -1,4 +1,4 @@ -FuchsiaGymScript: ; 7543d (1d:543d) +FuchsiaGymScript: call FuchsiaGymScript_75453 call EnableAutoTextBoxDrawing ld hl, FuchsiaGymTrainerHeaders @@ -8,7 +8,7 @@ FuchsiaGymScript: ; 7543d (1d:543d) ld [wFuchsiaGymCurScript], a ret -FuchsiaGymScript_75453: ; 75453 (1d:5453) +FuchsiaGymScript_75453: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] @@ -18,31 +18,31 @@ FuchsiaGymScript_75453: ; 75453 (1d:5453) call LoadGymLeaderAndCityName ret -Gym5CityName: ; 75465 (1d:5465) +Gym5CityName: db "FUCHSIA CITY@" -Gym5LeaderName: ; 75472 (1d:5472) +Gym5LeaderName: db "KOGA@" -FuchsiaGymScript_75477: ; 75477 (1d:5477) +FuchsiaGymScript_75477: xor a ld [wJoyIgnore], a ld [wFuchsiaGymCurScript], a ld [wCurMapScript], a ret -FuchsiaGymScriptPointers: ; 75482 (1d:5482) +FuchsiaGymScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw FuchsiaGymScript3 -FuchsiaGymScript3: ; 7548a (1d:548a) +FuchsiaGymScript3: ld a, [wIsInBattle] cp $ff jp z, FuchsiaGymScript_75477 ld a, $f0 ld [wJoyIgnore], a -FuchsiaGymScript3_75497: ; 75497 (1d:5497) +FuchsiaGymScript3_75497: ld a, $9 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -70,7 +70,7 @@ FuchsiaGymScript3_75497: ; 75497 (1d:5497) jp FuchsiaGymScript_75477 -FuchsiaGymTextPointers: ; 754d5 (1d:54d5) +FuchsiaGymTextPointers: dw FuchsiaGymText1 dw FuchsiaGymText2 dw FuchsiaGymText3 @@ -83,8 +83,8 @@ FuchsiaGymTextPointers: ; 754d5 (1d:54d5) dw FuchsiaGymText10 dw FuchsiaGymText11 -FuchsiaGymTrainerHeaders: ; 754eb (1d:54eb) -FuchsiaGymTrainerHeader0: ; 754eb (1d:54eb) +FuchsiaGymTrainerHeaders: +FuchsiaGymTrainerHeader0: dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_0 @@ -93,7 +93,7 @@ FuchsiaGymTrainerHeader0: ; 754eb (1d:54eb) dw FuchsiaGymEndBattleText1 ; TextEndBattle dw FuchsiaGymEndBattleText1 ; TextEndBattle -FuchsiaGymTrainerHeader2: ; 754f7 (1d:54f7) +FuchsiaGymTrainerHeader2: dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_2 @@ -102,7 +102,7 @@ FuchsiaGymTrainerHeader2: ; 754f7 (1d:54f7) dw FuchsiaGymEndBattleText2 ; TextEndBattle dw FuchsiaGymEndBattleText2 ; TextEndBattle -FuchsiaGymTrainerHeader3: ; 75503 (1d:5503) +FuchsiaGymTrainerHeader3: dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_3 @@ -111,7 +111,7 @@ FuchsiaGymTrainerHeader3: ; 75503 (1d:5503) dw FuchsiaGymEndBattleText3 ; TextEndBattle dw FuchsiaGymEndBattleText3 ; TextEndBattle -FuchsiaGymTrainerHeader4: ; 7550f (1d:550f) +FuchsiaGymTrainerHeader4: dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_4 @@ -120,7 +120,7 @@ FuchsiaGymTrainerHeader4: ; 7550f (1d:550f) dw FuchsiaGymEndBattleText4 ; TextEndBattle dw FuchsiaGymEndBattleText4 ; TextEndBattle -FuchsiaGymTrainerHeader5: ; 7551b (1d:551b) +FuchsiaGymTrainerHeader5: dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_5 @@ -129,7 +129,7 @@ FuchsiaGymTrainerHeader5: ; 7551b (1d:551b) dw FuchsiaGymEndBattleText5 ; TextEndBattle dw FuchsiaGymEndBattleText5 ; TextEndBattle -FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) +FuchsiaGymTrainerHeader6: dbEventFlagBit EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_FUCHSIA_GYM_TRAINER_6 @@ -140,7 +140,7 @@ FuchsiaGymTrainerHeader6: ; 75527 (1d:5527) db $ff -FuchsiaGymText1: ; 75534 (1d:5534) +FuchsiaGymText1: TX_ASM CheckEvent EVENT_BEAT_KOGA jr z, .asm_181b6 @@ -175,143 +175,143 @@ FuchsiaGymText1: ; 75534 (1d:5534) .asm_e84c6 jp TextScriptEnd -KogaBeforeBattleText: ; 75581 (1d:5581) +KogaBeforeBattleText: TX_FAR _KogaBeforeBattleText db "@" -KogaAfterBattleText: ; 75586 (1d:5586) +KogaAfterBattleText: TX_FAR _KogaAfterBattleText db "@" -KogaExplainToxicText: ; 7558b (1d:558b) +KogaExplainToxicText: TX_FAR _KogaExplainToxicText db "@" -FuchsiaGymText9: ; 75590 (1d:5590) +FuchsiaGymText9: TX_FAR _FuchsiaGymText9 db "@" -FuchsiaGymText10: ; 75595 (1d:5595) +FuchsiaGymText10: TX_FAR _ReceivedTM06Text db $11 -TM06ExplanationText: ; 7559a (1d:559a) +TM06ExplanationText: TX_FAR _TM06ExplanationText db "@" -FuchsiaGymText11: ; 7559f (1d:559f) +FuchsiaGymText11: TX_FAR _TM06NoRoomText db "@" -FuchsiaGymText2: ; 755a4 (1d:55a4) +FuchsiaGymText2: TX_ASM ld hl, FuchsiaGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd -FuchsiaGymBattleText1: ; 755ae (1d:55ae) +FuchsiaGymBattleText1: TX_FAR _FuchsiaGymBattleText1 db "@" -FuchsiaGymEndBattleText1: ; 755b3 (1d:55b3) +FuchsiaGymEndBattleText1: TX_FAR _FuchsiaGymEndBattleText1 db "@" -FuchsiaGymAfterBattleText1: ; 755b8 (1d:55b8) +FuchsiaGymAfterBattleText1: TX_FAR _FuchsiaGymAfterBattleText1 db "@" -FuchsiaGymText3: ; 755bd (1d:55bd) +FuchsiaGymText3: TX_ASM ld hl, FuchsiaGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd -FuchsiaGymBattleText2: ; 755c7 (1d:55c7) +FuchsiaGymBattleText2: TX_FAR _FuchsiaGymBattleText2 db "@" -FuchsiaGymEndBattleText2: ; 755cc (1d:55cc) +FuchsiaGymEndBattleText2: TX_FAR _FuchsiaGymEndBattleText2 db "@" -FuchsiaGymAfterBattleText2: ; 755d1 (1d:55d1) +FuchsiaGymAfterBattleText2: TX_FAR _FuchsiaGymAfterBattleText2 db "@" -FuchsiaGymText4: ; 755d6 (1d:55d6) +FuchsiaGymText4: TX_ASM ld hl, FuchsiaGymTrainerHeader3 call TalkToTrainer jp TextScriptEnd -FuchsiaGymBattleText3: ; 755e0 (1d:55e0) +FuchsiaGymBattleText3: TX_FAR _FuchsiaGymBattleText3 db "@" -FuchsiaGymEndBattleText3: ; 755e5 (1d:55e5) +FuchsiaGymEndBattleText3: TX_FAR _FuchsiaGymEndBattleText3 db "@" -FuchsiaGymAfterBattleText3: ; 755ea (1d:55ea) +FuchsiaGymAfterBattleText3: TX_FAR _FuchsiaGymAfterBattleText3 db "@" -FuchsiaGymText5: ; 755ef (1d:55ef) +FuchsiaGymText5: TX_ASM ld hl, FuchsiaGymTrainerHeader4 call TalkToTrainer jp TextScriptEnd -FuchsiaGymBattleText4: ; 755f9 (1d:55f9) +FuchsiaGymBattleText4: TX_FAR _FuchsiaGymBattleText4 db "@" -FuchsiaGymEndBattleText4: ; 755fe (1d:55fe) +FuchsiaGymEndBattleText4: TX_FAR _FuchsiaGymEndBattleText4 db "@" -FuchsiaGymAfterBattleText4: ; 75603 (1d:5603) +FuchsiaGymAfterBattleText4: TX_FAR _FuchsiaGymAfterBattleText4 db "@" -FuchsiaGymText6: ; 75608 (1d:5608) +FuchsiaGymText6: TX_ASM ld hl, FuchsiaGymTrainerHeader5 call TalkToTrainer jp TextScriptEnd -FuchsiaGymBattleText5: ; 75612 (1d:5612) +FuchsiaGymBattleText5: TX_FAR _FuchsiaGymBattleText5 db "@" -FuchsiaGymEndBattleText5: ; 75617 (1d:5617) +FuchsiaGymEndBattleText5: TX_FAR _FuchsiaGymEndBattleText5 db "@" -FuchsiaGymAfterBattleText5: ; 7561c (1d:561c) +FuchsiaGymAfterBattleText5: TX_FAR _FuchsiaGymAfterBattleText5 db "@" -FuchsiaGymText7: ; 75621 (1d:5621) +FuchsiaGymText7: TX_ASM ld hl, FuchsiaGymTrainerHeader6 call TalkToTrainer jp TextScriptEnd -FuchsiaGymBattleText6: ; 7562b (1d:562b) +FuchsiaGymBattleText6: TX_FAR _FuchsiaGymBattleText6 db "@" -FuchsiaGymEndBattleText6: ; 75630 (1d:5630) +FuchsiaGymEndBattleText6: TX_FAR _FuchsiaGymEndBattleText6 db "@" -FuchsiaGymAfterBattleText6: ; 75635 (1d:5635) +FuchsiaGymAfterBattleText6: TX_FAR _FuchsiaGymAfterBattleText6 db "@" -FuchsiaGymText8: ; 7563a (1d:563a) +FuchsiaGymText8: TX_ASM CheckEvent EVENT_BEAT_KOGA ld hl, FuchsiaGymText_75653 @@ -321,10 +321,10 @@ FuchsiaGymText8: ; 7563a (1d:563a) call PrintText jp TextScriptEnd -FuchsiaGymText_7564e: ; 7564e (1d:564e) +FuchsiaGymText_7564e: TX_FAR _FuchsiaGymText_7564e db "@" -FuchsiaGymText_75653: ; 75653 (1d:5653) +FuchsiaGymText_75653: TX_FAR _FuchsiaGymText_75653 db "@" diff --git a/scripts/fuchsiahouse1.asm b/scripts/fuchsiahouse1.asm index 4d5e6eb1..95e59503 100755 --- a/scripts/fuchsiahouse1.asm +++ b/scripts/fuchsiahouse1.asm @@ -1,20 +1,20 @@ -FuchsiaHouse1Script: ; 75018 (1d:5018) +FuchsiaHouse1Script: call EnableAutoTextBoxDrawing ret -FuchsiaHouse1TextPointers: ; 7501c (1d:501c) +FuchsiaHouse1TextPointers: dw FuchsiaHouse1Text1 dw FuchsiaHouse1Text2 dw FuchsiaHouse1Text3 -FuchsiaHouse1Text1: ; 75022 (1d:5022) +FuchsiaHouse1Text1: TX_FAR _FuchsiaHouse1Text1 db "@" -FuchsiaHouse1Text2: ; 75027 (1d:5027) +FuchsiaHouse1Text2: TX_FAR _FuchsiaHouse1Text2 db "@" -FuchsiaHouse1Text3: ; 7502c (1d:502c) +FuchsiaHouse1Text3: TX_FAR _FuchsiaHouse1Text3 db "@" diff --git a/scripts/fuchsiahouse2.asm b/scripts/fuchsiahouse2.asm index 76b5e91f..7e90aa84 100755 --- a/scripts/fuchsiahouse2.asm +++ b/scripts/fuchsiahouse2.asm @@ -1,14 +1,14 @@ -FuchsiaHouse2Script: ; 750b5 (1d:50b5) +FuchsiaHouse2Script: jp EnableAutoTextBoxDrawing -FuchsiaHouse2TextPointers: ; 750b8 (1d:50b8) +FuchsiaHouse2TextPointers: dw FuchsiaHouse2Text1 dw PickUpItemText dw BoulderText dw FuchsiaHouse2Text4 dw FuchsiaHouse2Text5 -FuchsiaHouse2Text1: ; 750c2 (1d:50c2) +FuchsiaHouse2Text1: TX_ASM CheckEvent EVENT_GOT_HM04 jr nz, .subtract @@ -55,44 +55,44 @@ FuchsiaHouse2Text1: ; 750c2 (1d:50c2) .asm_52039 jp TextScriptEnd -WardenGibberishText1: ; 75135 (1d:5135) +WardenGibberishText1: TX_FAR _WardenGibberishText1 db "@" -WardenGibberishText2: ; 7513a (1d:513a) +WardenGibberishText2: TX_FAR _WardenGibberishText2 db "@" -WardenGibberishText3: ; 7513f (1d:513f) +WardenGibberishText3: TX_FAR _WardenGibberishText3 db "@" -WardenTeethText1: ; 75144 (1d:5144) +WardenTeethText1: TX_FAR _WardenTeethText1 db $0b -WardenTeethText2: ; 75149 (1d:5149) +WardenTeethText2: TX_FAR _WardenTeethText2 db "@" -WardenThankYouText: ; 7514e (1d:514e) +WardenThankYouText: TX_FAR _WardenThankYouText db "@" -ReceivedHM04Text: ; 75153 (1d:5153) +ReceivedHM04Text: TX_FAR _ReceivedHM04Text db $0B, "@" -HM04ExplanationText: ; 75159 (1d:5159) +HM04ExplanationText: TX_FAR _HM04ExplanationText db "@" -HM04NoRoomText: ; 7515e (1d:515e) +HM04NoRoomText: TX_FAR _HM04NoRoomText db "@" -FuchsiaHouse2Text5: ; 75163 (1d:5163) -FuchsiaHouse2Text4: ; 75163 (1d:5163) +FuchsiaHouse2Text5: +FuchsiaHouse2Text4: TX_ASM ld a, [H_SPRITEINDEX] cp $4 @@ -103,10 +103,10 @@ FuchsiaHouse2Text4: ; 75163 (1d:5163) call PrintText jp TextScriptEnd -FuchsiaHouse2Text_75176: ; 75176 (1d:5176) +FuchsiaHouse2Text_75176: TX_FAR _FuchsiaHouse2Text_75176 db "@" -FuchsiaHouse2Text_7517b: ; 7517b (1d:517b) +FuchsiaHouse2Text_7517b: TX_FAR _FuchsiaHouse2Text_7517b db "@" diff --git a/scripts/fuchsiahouse3.asm b/scripts/fuchsiahouse3.asm index 2aabb9c2..fe1da024 100755 --- a/scripts/fuchsiahouse3.asm +++ b/scripts/fuchsiahouse3.asm @@ -1,10 +1,10 @@ -FuchsiaHouse3Script: ; 5617c (15:617c) +FuchsiaHouse3Script: jp EnableAutoTextBoxDrawing -FuchsiaHouse3TextPointers: ; 5617f (15:617f) +FuchsiaHouse3TextPointers: dw FuchsiaHouse3Text1 -FuchsiaHouse3Text1: ; 56181 (15:6181) +FuchsiaHouse3Text1: TX_ASM ld a, [wd728] bit 4, a @@ -43,16 +43,16 @@ FuchsiaHouse3Text1: ; 56181 (15:6181) call PrintText jp TextScriptEnd -FuchsiaHouse3Text_561bd: ; 561bd (15:61bd) +FuchsiaHouse3Text_561bd: TX_FAR _FuchsiaHouse3Text_561bd db "@" -FuchsiaHouse3Text_561c2: ; 561c2 (15:61c2) +FuchsiaHouse3Text_561c2: TX_FAR _FuchsiaHouse3Text_561c2 db $0B db "@" -UnusedText_561c8: ; 561c8 +UnusedText_561c8: para "つり こそ" line "おとこの ロマン だ!" @@ -62,14 +62,14 @@ UnusedText_561c8: ; 561c8 line "もっと いいもんが つれるんじゃ!" done -FuchsiaHouse3Text_56212: ; 56212 (15:6212) +FuchsiaHouse3Text_56212: TX_FAR _FuchsiaHouse3Text_56212 db "@" -FuchsiaHouse3Text_56217: ; 56217 (15:6217) +FuchsiaHouse3Text_56217: TX_FAR _FuchsiaHouse3Text_56217 db "@" -FuchsiaHouse3Text_5621c: ; 5621c (15:621c) +FuchsiaHouse3Text_5621c: TX_FAR _FuchsiaHouse3Text_5621c db "@" diff --git a/scripts/fuchsiamart.asm b/scripts/fuchsiamart.asm index 41aec49a..46049163 100755 --- a/scripts/fuchsiamart.asm +++ b/scripts/fuchsiamart.asm @@ -1,16 +1,16 @@ -FuchsiaMartScript: ; 1dd88 (7:5d88) +FuchsiaMartScript: call EnableAutoTextBoxDrawing ret -FuchsiaMartTextPointers: ; 1dd8b (7:5d8b) +FuchsiaMartTextPointers: dw FuchsiaMartText1 dw FuchsiaMartText2 dw FuchsiaMartText3 -FuchsiaMartText2: ; 1dd91 (7:5d91) +FuchsiaMartText2: TX_FAR _FuchsiaMartText2 db "@" -FuchsiaMartText3: ; 1dd96 (7:5d96) +FuchsiaMartText3: TX_FAR _FuchsiaMartText3 db "@" diff --git a/scripts/fuchsiameetingroom.asm b/scripts/fuchsiameetingroom.asm index 140a5ccc..7995a49b 100755 --- a/scripts/fuchsiameetingroom.asm +++ b/scripts/fuchsiameetingroom.asm @@ -1,20 +1,20 @@ -FuchsiaMeetingRoomScript: ; 756e3 (1d:56e3) +FuchsiaMeetingRoomScript: call EnableAutoTextBoxDrawing ret -FuchsiaMeetingRoomTextPointers: ; 756e7 (1d:56e7) +FuchsiaMeetingRoomTextPointers: dw FuchsiaMeetingRoomText1 dw FuchsiaMeetingRoomText2 dw FuchsiaMeetingRoomText3 -FuchsiaMeetingRoomText1: ; 756ed (1d:56ed) +FuchsiaMeetingRoomText1: TX_FAR _FuchsiaMeetingRoomText1 db "@" -FuchsiaMeetingRoomText2: ; 756f2 (1d:56f2) +FuchsiaMeetingRoomText2: TX_FAR _FuchsiaMeetingRoomText2 db "@" -FuchsiaMeetingRoomText3: ; 756f7 (1d:56f7) +FuchsiaMeetingRoomText3: TX_FAR _FuchsiaMeetingRoomText3 db "@" diff --git a/scripts/fuchsiapokecenter.asm b/scripts/fuchsiapokecenter.asm index 2ad3ac01..5f7afeb3 100755 --- a/scripts/fuchsiapokecenter.asm +++ b/scripts/fuchsiapokecenter.asm @@ -1,26 +1,26 @@ -FuchsiaPokecenterScript: ; 75063 (1d:5063) +FuchsiaPokecenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -FuchsiaPokecenterTextPointers: ; 75069 (1d:5069) +FuchsiaPokecenterTextPointers: dw FuchsiaPokecenterText1 dw FuchsiaPokecenterText2 dw FuchsiaPokecenterText3 dw FuchsiaPokecenterText4 dw FuchsiaPokecenterText5 -FuchsiaPokecenterText1: ; 75071 (1d:5071) +FuchsiaPokecenterText1: db $ff -FuchsiaPokecenterText2: ; 75072 (1d:5072) +FuchsiaPokecenterText2: TX_FAR _FuchsiaPokecenterText1 db "@" -FuchsiaPokecenterText3: ; 75077 (1d:5077) +FuchsiaPokecenterText3: TX_FAR _FuchsiaPokecenterText3 db "@" -FuchsiaPokecenterText4: ; 7507c (1d:507c) +FuchsiaPokecenterText4: db $f6 FuchsiaPokecenterText5: diff --git a/scripts/gary.asm b/scripts/gary.asm index 7babb73d..ef1a7328 100755 --- a/scripts/gary.asm +++ b/scripts/gary.asm @@ -1,17 +1,17 @@ -GaryScript: ; 75f1d (1d:5f1d) +GaryScript: call EnableAutoTextBoxDrawing ld hl, GaryScriptPointers ld a, [wGaryCurScript] call JumpTable ret -ResetGaryScript: ; 75f29 (1d:5f29) +ResetGaryScript: xor a ld [wJoyIgnore], a ld [wGaryCurScript], a ret -GaryScriptPointers: ; 75f31 (1d:5f31) +GaryScriptPointers: dw GaryScript0 dw GaryScript1 dw GaryScript2 @@ -24,10 +24,10 @@ GaryScriptPointers: ; 75f31 (1d:5f31) dw GaryScript9 dw GaryScript10 -GaryScript0: ; 75f47 (1d:5f47) +GaryScript0: ret -GaryScript1: ; 75f48 (1d:5f48) +GaryScript1: ld a, $ff ld [wJoyIgnore], a ld hl, wSimulatedJoypadStatesEnd @@ -40,13 +40,13 @@ GaryScript1: ; 75f48 (1d:5f48) ld [wGaryCurScript], a ret -GaryEntrance_RLEMovement: ; 75f63 (1d:5f63) +GaryEntrance_RLEMovement: db D_UP, 1 db D_RIGHT, 1 db D_UP, 3 db $ff -GaryScript2: ; 75f6a (1d:5f6a) +GaryScript2: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -79,7 +79,7 @@ GaryScript2: ; 75f6a (1d:5f6a) ld [wGaryCurScript], a ret -GaryScript3: ; 75fbb (1d:5fbb) +GaryScript3: ld a, [wIsInBattle] cp $ff jp z, ResetGaryScript @@ -97,7 +97,7 @@ GaryScript3: ; 75fbb (1d:5fbb) ld [wGaryCurScript], a ret -GaryScript4: ; 75fe4 (1d:5fe4) +GaryScript4: callba Music_Cities1AlternateTempo ld a, $2 ld [hSpriteIndexOrTextID], a @@ -116,7 +116,7 @@ GaryScript4: ; 75fe4 (1d:5fe4) ld [wGaryCurScript], a ret -OakEntranceAfterVictoryMovement: ; 76014 (1d:6014) +OakEntranceAfterVictoryMovement: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP @@ -124,7 +124,7 @@ OakEntranceAfterVictoryMovement: ; 76014 (1d:6014) db NPC_MOVEMENT_UP db $FF -GaryScript5: ; 7601a (1d:601a) +GaryScript5: ld a, [wd730] bit 0, a ret nz @@ -147,7 +147,7 @@ GaryScript5: ; 7601a (1d:601a) ld [wGaryCurScript], a ret -GaryScript6: ; 76047 (1d:6047) +GaryScript6: ld a, $2 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_RIGHT @@ -160,7 +160,7 @@ GaryScript6: ; 76047 (1d:6047) ld [wGaryCurScript], a ret -GaryScript7: ; 7605f (1d:605f) +GaryScript7: ld a, $2 ld [H_SPRITEINDEX], a xor a ; SPRITE_FACING_DOWN @@ -177,12 +177,12 @@ GaryScript7: ; 7605f (1d:605f) ld [wGaryCurScript], a ret -OakExitGaryRoomMovement: ; 76080 (1d:6080) +OakExitGaryRoomMovement: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db $FF -GaryScript8: ; 76083 (1d:6083) +GaryScript8: ld a, [wd730] bit 0, a ret nz @@ -193,7 +193,7 @@ GaryScript8: ; 76083 (1d:6083) ld [wGaryCurScript], a ret -GaryScript9: ; 76099 (1d:6099) +GaryScript9: ld a, $ff ld [wJoyIgnore], a ld hl, wSimulatedJoypadStatesEnd @@ -206,12 +206,12 @@ GaryScript9: ; 76099 (1d:6099) ld [wGaryCurScript], a ret -WalkToHallOfFame_RLEMovment: ; 760b4 (1d:60b4) +WalkToHallOfFame_RLEMovment: db D_UP, 4 db D_LEFT, 1 db $ff -GaryScript10: ; 760b9 (1d:60b9) +GaryScript10: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -221,7 +221,7 @@ GaryScript10: ; 760b9 (1d:60b9) ld [wGaryCurScript], a ret -GaryScript_760c8: ; 760c8 (1d:60c8) +GaryScript_760c8: ld a, $f0 ld [wJoyIgnore], a call DisplayTextID @@ -229,14 +229,14 @@ GaryScript_760c8: ; 760c8 (1d:60c8) ld [wJoyIgnore], a ret -GaryTextPointers: ; 760d6 (1d:60d6) +GaryTextPointers: dw GaryText1 dw GaryText2 dw GaryText3 dw GaryText4 dw GaryText5 -GaryText1: ; 760e0 (1d:60e0) +GaryText1: TX_ASM CheckEvent EVENT_BEAT_CHAMPION_RIVAL ld hl, GaryChampionIntroText @@ -246,27 +246,27 @@ GaryText1: ; 760e0 (1d:60e0) call PrintText jp TextScriptEnd -GaryChampionIntroText: ; 760f4 (1d:60f4) +GaryChampionIntroText: TX_FAR _GaryChampionIntroText db "@" -GaryDefeatedText: ; 760f9 (1d:60f9) +GaryDefeatedText: TX_FAR _GaryDefeatedText db "@" -GaryVictoryText: ; 760fe (1d:60fe) +GaryVictoryText: TX_FAR _GaryVictoryText db "@" -GaryText_76103: ; 76103 (1d:6103) +GaryText_76103: TX_FAR _GaryText_76103 db "@" -GaryText2: ; 76108 (1d:6108) +GaryText2: TX_FAR _GaryText2 db "@" -GaryText3: ; 7610d (1d:610d) +GaryText3: TX_ASM ld a, [wPlayerStarter] ld [wd11e], a @@ -275,14 +275,14 @@ GaryText3: ; 7610d (1d:610d) call PrintText jp TextScriptEnd -GaryText_76120: ; 76120 (1d:6120) +GaryText_76120: TX_FAR _GaryText_76120 db "@" -GaryText4: ; 76125 (1d:6125) +GaryText4: TX_FAR _GaryText_76125 db "@" -GaryText5: ; 7612a (1d:612a) +GaryText5: TX_FAR _GaryText_7612a db "@" diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm index b5bc9ce8..1bba347b 100755 --- a/scripts/halloffameroom.asm +++ b/scripts/halloffameroom.asm @@ -1,25 +1,25 @@ -HallofFameRoomScript: ; 5a49e (16:649e) +HallofFameRoomScript: call EnableAutoTextBoxDrawing ld hl, HallofFameRoomScriptPointers ld a, [wHallOfFameRoomCurScript] jp JumpTable -HallofFameRoomScript_5a4aa: ; 5a4aa (16:64aa) +HallofFameRoomScript_5a4aa: xor a ld [wJoyIgnore], a ld [wHallOfFameRoomCurScript], a ret -HallofFameRoomScriptPointers: ; 5a4b2 (16:64b2) +HallofFameRoomScriptPointers: dw HallofFameRoomScript0 dw HallofFameRoomScript1 dw HallofFameRoomScript2 dw HallofFameRoomScript3 -HallofFameRoomScript3: ; 5a4ba (16:64ba) +HallofFameRoomScript3: ret -HallofFameRoomScript2: ; 5a4bb (16:64bb) +HallofFameRoomScript2: call Delay3 ld a, [wLetterPrintingDelayFlags] push af @@ -55,7 +55,7 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb) call WaitForTextScrollButtonPress jp Init -HallofFameRoomScript0: ; 5a50d (16:650d) +HallofFameRoomScript0: ld a, $ff ld [wJoyIgnore], a ld hl, wSimulatedJoypadStatesEnd @@ -68,11 +68,11 @@ HallofFameRoomScript0: ; 5a50d (16:650d) ld [wHallOfFameRoomCurScript], a ret -RLEMovement5a528: ; 5a528 (16:6528) +RLEMovement5a528: db D_UP,$5 db $ff -HallofFameRoomScript1: ; 5a52b (16:652b) +HallofFameRoomScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -101,9 +101,9 @@ HallofFameRoomScript1: ; 5a52b (16:652b) ld [wHallOfFameRoomCurScript], a ret -HallofFameRoomTextPointers: ; 5a56a (16:656a) +HallofFameRoomTextPointers: dw HallofFameRoomText1 -HallofFameRoomText1: ; 5a56c (16:656c) +HallofFameRoomText1: TX_FAR _HallofFameRoomText1 db "@" diff --git a/scripts/indigoplateau.asm b/scripts/indigoplateau.asm index 9e4802ba..6a6fdb6c 100755 --- a/scripts/indigoplateau.asm +++ b/scripts/indigoplateau.asm @@ -1,4 +1,4 @@ -IndigoPlateauScript: ; 50935 (14:4935) +IndigoPlateauScript: ret -IndigoPlateauTextPointers: ; 50936 (14:4936) +IndigoPlateauTextPointers: diff --git a/scripts/indigoplateaulobby.asm b/scripts/indigoplateaulobby.asm index bc82a4c6..63f228d0 100755 --- a/scripts/indigoplateaulobby.asm +++ b/scripts/indigoplateaulobby.asm @@ -1,4 +1,4 @@ -IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) +IndigoPlateauLobbyScript: call Serial_TryEstablishingExternallyClockedConnection call EnableAutoTextBoxDrawing ld hl, wCurrentMapScriptFlags @@ -14,7 +14,7 @@ IndigoPlateauLobbyScript: ; 19c5b (6:5c5b) ResetEventRange ELITE4_EVENTS_START, EVENT_LANCES_ROOM_LOCK_DOOR ret -IndigoPlateauLobbyTextPointers: ; 19c7f (6:5c7f) +IndigoPlateauLobbyTextPointers: dw IndigoPlateauLobbyText1 dw IndigoPlateauLobbyText2 dw IndigoPlateauLobbyText3 @@ -22,18 +22,18 @@ IndigoPlateauLobbyTextPointers: ; 19c7f (6:5c7f) dw IndigoPlateauLobbyText5 dw IndigoPlateauLobbyText6 -IndigoPlateauLobbyText1: ; 19c89 (6:5c89) +IndigoPlateauLobbyText1: TX_POKECENTER_NURSE -IndigoPlateauLobbyText2: ; 19c8a (6:5c8a) +IndigoPlateauLobbyText2: TX_FAR _IndigoPlateauLobbyText1 db "@" -IndigoPlateauLobbyText3: ; 19c8f (6:5c8f) +IndigoPlateauLobbyText3: TX_FAR _IndigoPlateauLobbyText3 db "@" -IndigoPlateauLobbyText5: ; 19c94 (6:5c94) +IndigoPlateauLobbyText5: TX_CABLE_CLUB_RECEPTIONIST IndigoPlateauLobbyText6: diff --git a/scripts/lab1.asm b/scripts/lab1.asm index a4ec9b41..5b08f4f2 100755 --- a/scripts/lab1.asm +++ b/scripts/lab1.asm @@ -1,30 +1,30 @@ -Lab1Script: ; 75b8c (1d:5b8c) +Lab1Script: call EnableAutoTextBoxDrawing ret -Lab1TextPointers: ; 75b90 (1d:5b90) +Lab1TextPointers: dw Lab1Text1 dw Lab1Text2 dw Lab1Text3 dw Lab1Text4 dw Lab1Text5 -Lab1Text1: ; 75b9a (1d:5b9a) +Lab1Text1: TX_FAR _Lab1Text1 db "@" -Lab1Text2: ; 75b9f (1d:5b9f) +Lab1Text2: TX_FAR _Lab1Text2 db "@" -Lab1Text3: ; 75ba4 (1d:5ba4) +Lab1Text3: TX_FAR _Lab1Text3 db "@" -Lab1Text4: ; 75ba9 (1d:5ba9) +Lab1Text4: TX_FAR _Lab1Text4 db "@" -Lab1Text5: ; 75bae (1d:5bae) +Lab1Text5: TX_FAR _Lab1Text5 db "@" diff --git a/scripts/lab2.asm b/scripts/lab2.asm index 4c3ab344..ed9ef1b4 100755 --- a/scripts/lab2.asm +++ b/scripts/lab2.asm @@ -1,25 +1,25 @@ -Lab2Script: ; 75c21 (1d:5c21) +Lab2Script: jp EnableAutoTextBoxDrawing -Lab2TextPointers: ; 75c24 (1d:5c24) +Lab2TextPointers: dw Lab2Text1 dw Lab2Text2 dw Lab2Text3 -Lab2Text1: ; 75c2a (1d:5c2a) +Lab2Text1: TX_FAR _Lab2Text1 db "@" -Lab2Text2: ; 75c2f (1d:5c2f) +Lab2Text2: TX_ASM ld a, $7 ld [wWhichTrade], a jr Lab2DoTrade -Lab2Text3: ; 75c37 (1d:5c37) +Lab2Text3: TX_ASM ld a, $8 ld [wWhichTrade], a -Lab2DoTrade: ; 75c3d (1d:5c3d) +Lab2DoTrade: predef DoInGameTradeDialogue jp TextScriptEnd diff --git a/scripts/lab3.asm b/scripts/lab3.asm index cbb5f53f..dbd0913d 100755 --- a/scripts/lab3.asm +++ b/scripts/lab3.asm @@ -1,14 +1,14 @@ -Lab3Script: ; 75c87 (1d:5c87) +Lab3Script: jp EnableAutoTextBoxDrawing -Lab3TextPointers: ; 75c8a (1d:5c8a) +Lab3TextPointers: dw Lab3Text1 dw Lab3Text2 dw Lab3Text3 dw Lab3Text4 dw Lab3Text5 -Lab3Text1: ; 75c94 (1d:5c94) +Lab3Text1: TX_ASM CheckEvent EVENT_GOT_TM35 jr nz, .asm_e551a @@ -31,31 +31,31 @@ Lab3Text1: ; 75c94 (1d:5c94) .asm_eb896 jp TextScriptEnd -TM35PreReceiveText: ; 75cc8 (1d:5cc8) +TM35PreReceiveText: TX_FAR _TM35PreReceiveText db "@" -ReceivedTM35Text: ; 75ccd (1d:5ccd) +ReceivedTM35Text: TX_FAR _ReceivedTM35Text db $0B, "@" -TM35ExplanationText: ; 75cd3 (1d:5cd3) +TM35ExplanationText: TX_FAR _TM35ExplanationText db "@" -TM35NoRoomText: ; 75cd8 (1d:5cd8) +TM35NoRoomText: TX_FAR _TM35NoRoomText db "@" -Lab3Text2: ; 75cdd (1d:5cdd) +Lab3Text2: TX_FAR _Lab3Text2 db "@" -Lab3Text4: ; 75ce2 (1d:5ce2) -Lab3Text3: ; 75ce2 (1d:5ce2) +Lab3Text4: +Lab3Text3: TX_FAR _Lab3Text3 db "@" -Lab3Text5: ; 75ce7 (1d:5ce7) +Lab3Text5: TX_FAR _Lab3Text5 db "@" diff --git a/scripts/lab4.asm b/scripts/lab4.asm index 7eb6bae8..7d0db339 100755 --- a/scripts/lab4.asm +++ b/scripts/lab4.asm @@ -1,11 +1,11 @@ -Lab4Script: ; 75d31 (1d:5d31) +Lab4Script: jp EnableAutoTextBoxDrawing -Lab4TextPointers: ; 75d34 (1d:5d34) +Lab4TextPointers: dw Lab4Text1 dw Lab4Text2 -Lab4Script_GetFossilsInBag: ; 75d38 (1d:5d38) +Lab4Script_GetFossilsInBag: ; construct a list of all fossils in the player's bag xor a ld [wFilteredBagItemsCount], a @@ -40,13 +40,13 @@ Lab4Script_GetFossilsInBag: ; 75d38 (1d:5d38) ld [de], a ret -FossilsList: ; 75d68 (1d:5d68) +FossilsList: db DOME_FOSSIL db HELIX_FOSSIL db OLD_AMBER db $00 -Lab4Text1: ; 75d6c (1d:5d6c) +Lab4Text1: TX_ASM CheckEvent EVENT_GAVE_FOSSIL_TO_LAB jr nz, .asm_75d96 @@ -82,28 +82,28 @@ Lab4Text1: ; 75d6c (1d:5d6c) ResetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL, EVENT_LAB_HANDING_OVER_FOSSIL_MON jr .asm_75d93 -Lab4Text_75dc6: ; 75dc6 (1d:5dc6) +Lab4Text_75dc6: TX_FAR _Lab4Text_75dc6 db "@" -Lab4Text_75dcb: ; 75dcb (1d:5dcb) +Lab4Text_75dcb: TX_FAR _Lab4Text_75dcb db "@" -Lab4Text_75dd0: ; 75dd0 (1d:5dd0) +Lab4Text_75dd0: TX_FAR _Lab4Text_75dd0 db "@" -Lab4Text_75dd5: ; 75dd5 (1d:5dd5) +Lab4Text_75dd5: TX_FAR _Lab4Text_75dd5 db "@" -Lab4Text2: ; 75dda (1d:5dda) +Lab4Text2: TX_ASM ld a, $3 ld [wWhichTrade], a predef DoInGameTradeDialogue jp TextScriptEnd -LoadFossilItemAndMonNameBank1D: ; 75de8 (1d:5de8) +LoadFossilItemAndMonNameBank1D: jpba LoadFossilItemAndMonName diff --git a/scripts/lance.asm b/scripts/lance.asm index 948787cc..7d67f6cd 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -1,4 +1,4 @@ -LanceScript: ; 5a2ae (16:62ae) +LanceScript: call LanceShowOrHideEntranceBlocks call EnableAutoTextBoxDrawing ld hl, LanceTrainerHeaders @@ -8,7 +8,7 @@ LanceScript: ; 5a2ae (16:62ae) ld [wLanceCurScript], a ret -LanceShowOrHideEntranceBlocks: ; 5a2c4 (16:62c4) +LanceShowOrHideEntranceBlocks: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -36,22 +36,22 @@ LanceShowOrHideEntranceBlocks: ; 5a2c4 (16:62c4) .LanceSetEntranceBlock predef_jump ReplaceTileBlock -ResetLanceScript: ; 5a2f5 (16:62f5) +ResetLanceScript: xor a ld [wLanceCurScript], a ret -LanceScriptPointers: ; 5a2fa (16:62fa) +LanceScriptPointers: dw LanceScript0 dw DisplayEnemyTrainerTextAndStartBattle dw LanceScript2 dw LanceScript3 dw LanceScript4 -LanceScript4: ; 5a304 (16:6304) +LanceScript4: ret -LanceScript0: ; 5a305 (16:6305) +LanceScript0: CheckEvent EVENT_BEAT_LANCE ret nz ld hl, LanceTriggerMovementCoords @@ -76,7 +76,7 @@ LanceScript0: ; 5a305 (16:6305) call PlaySound jp LanceShowOrHideEntranceBlocks -LanceTriggerMovementCoords: ; 5a33e (16:633e) +LanceTriggerMovementCoords: db $01,$05 db $02,$06 db $0B,$05 @@ -84,7 +84,7 @@ LanceTriggerMovementCoords: ; 5a33e (16:633e) db $10,$18 db $FF -LanceScript2: ; 5a349 (16:6349) +LanceScript2: call EndTrainerBattle ld a, [wIsInBattle] cp $ff @@ -93,7 +93,7 @@ LanceScript2: ; 5a349 (16:6349) ld [hSpriteIndexOrTextID], a jp DisplayTextID -WalkToLance: ; 5a35b (16:635b) +WalkToLance: ; Moves the player down the hallway to Lance's room. ld a, $ff ld [wJoyIgnore], a @@ -108,14 +108,14 @@ WalkToLance: ; 5a35b (16:635b) ld [wCurMapScript], a ret -WalkToLance_RLEList: ; 5a379 (16:6379) +WalkToLance_RLEList: db D_UP, $0D db D_LEFT, $0C db D_DOWN, $07 db D_LEFT, $06 db $FF -LanceScript3: ; 5a382 (16:6382) +LanceScript3: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -126,11 +126,11 @@ LanceScript3: ; 5a382 (16:6382) ld [wCurMapScript], a ret -LanceTextPointers: ; 5a395 (16:6395) +LanceTextPointers: dw LanceText1 -LanceTrainerHeaders: ; 5a397 (16:6397) -LanceTrainerHeader0: ; 5a397 (16:6397) +LanceTrainerHeaders: +LanceTrainerHeader0: dbEventFlagBit EVENT_BEAT_LANCES_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_LANCES_ROOM_TRAINER_0 @@ -141,21 +141,21 @@ LanceTrainerHeader0: ; 5a397 (16:6397) db $ff -LanceText1: ; 5a3a4 (16:63a4) +LanceText1: TX_ASM ld hl, LanceTrainerHeader0 call TalkToTrainer jp TextScriptEnd -LanceBeforeBattleText: ; 5a3ae (16:63ae) +LanceBeforeBattleText: TX_FAR _LanceBeforeBattleText db "@" -LanceEndBattleText: ; 5a3b3 (16:63b3) +LanceEndBattleText: TX_FAR _LanceEndBattleText db "@" -LanceAfterBattleText: ; 5a3b8 (16:63b8) +LanceAfterBattleText: TX_FAR _LanceAfterBattleText TX_ASM SetEvent EVENT_BEAT_LANCE diff --git a/scripts/lavenderhouse1.asm b/scripts/lavenderhouse1.asm index ccf9cef1..65637018 100755 --- a/scripts/lavenderhouse1.asm +++ b/scripts/lavenderhouse1.asm @@ -1,8 +1,8 @@ -LavenderHouse1Script: ; 1d8a8 (7:58a8) +LavenderHouse1Script: call EnableAutoTextBoxDrawing ret -LavenderHouse1TextPointers: ; 1d8ac (7:58ac) +LavenderHouse1TextPointers: dw LavenderHouse1Text1 dw LavenderHouse1Text2 dw LavenderHouse1Text3 @@ -10,7 +10,7 @@ LavenderHouse1TextPointers: ; 1d8ac (7:58ac) dw LavenderHouse1Text5 dw LavenderHouse1Text6 -LavenderHouse1Text1: ; 1d8b8 (7:58b8) +LavenderHouse1Text1: TX_ASM CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_72e5d @@ -23,15 +23,15 @@ LavenderHouse1Text1: ; 1d8b8 (7:58b8) .asm_6957f jp TextScriptEnd -LavenderHouse1Text_1d8d1: ; 1d8d1 (7:58d1) +LavenderHouse1Text_1d8d1: TX_FAR _LavenderHouse1Text_1d8d1 db "@" -LavenderHouse1Text_1d8d6: ; 1d8d6 (7:58d6) +LavenderHouse1Text_1d8d6: TX_FAR _LavenderHouse1Text_1d8d6 db "@" -LavenderHouse1Text2: ; 1d8db (7:58db) +LavenderHouse1Text2: TX_ASM CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_06470 @@ -44,29 +44,29 @@ LavenderHouse1Text2: ; 1d8db (7:58db) .asm_3d208 jp TextScriptEnd -LavenderHouse1Text_1d8f4: ; 1d8f4 (7:58f4) +LavenderHouse1Text_1d8f4: TX_FAR _LavenderHouse1Text_1d8f4 db "@" -LavenderHouse1Text_1d8f9: ; 1d8f9 (7:58f9) +LavenderHouse1Text_1d8f9: TX_FAR _LavenderHouse1Text_1d8f9 db "@" -LavenderHouse1Text3: ; 1d8fe (7:58fe) +LavenderHouse1Text3: TX_FAR _LavenderHouse1Text3 TX_ASM ld a, PSYDUCK call PlayCry jp TextScriptEnd -LavenderHouse1Text4: ; 1d90b (7:590b) +LavenderHouse1Text4: TX_FAR _LavenderHouse1Text4 TX_ASM ld a, NIDORINO call PlayCry jp TextScriptEnd -LavenderHouse1Text5: ; 1d918 (7:5918) +LavenderHouse1Text5: TX_ASM CheckEvent EVENT_GOT_POKE_FLUTE jr nz, .asm_15ac2 @@ -89,24 +89,24 @@ LavenderHouse1Text5: ; 1d918 (7:5918) .asm_da749 jp TextScriptEnd -LavenderHouse1Text_1d94c: ; 1d94c (7:594c) +LavenderHouse1Text_1d94c: TX_FAR _LavenderHouse1Text_1d94c db "@" -ReceivedFluteText: ; 1d951 (7:5951) +ReceivedFluteText: TX_FAR _ReceivedFluteText db $11 TX_FAR _FluteExplanationText db "@" -FluteNoRoomText: ; 1d95b (7:595b) +FluteNoRoomText: TX_FAR _FluteNoRoomText db "@" -MrFujiAfterFluteText: ; 1d960 (7:5960) +MrFujiAfterFluteText: TX_FAR _MrFujiAfterFluteText db "@" -LavenderHouse1Text6: ; 1d965 (7:5965) +LavenderHouse1Text6: TX_FAR _LavenderHouse1Text6 db "@" diff --git a/scripts/lavenderhouse2.asm b/scripts/lavenderhouse2.asm index fe0b3ee2..b531c047 100755 --- a/scripts/lavenderhouse2.asm +++ b/scripts/lavenderhouse2.asm @@ -1,19 +1,19 @@ -LavenderHouse2Script: ; 1d9ae (7:59ae) +LavenderHouse2Script: call EnableAutoTextBoxDrawing ret -LavenderHouse2TextPointers: ; 1d9b2 (7:59b2) +LavenderHouse2TextPointers: dw LavenderHouse2Text1 dw LavenderHouse2Text2 -LavenderHouse2Text1: ; 1d9b6 (7:59b6) +LavenderHouse2Text1: TX_FAR _LavenderHouse2Text1 TX_ASM ld a, CUBONE call PlayCry jp TextScriptEnd -LavenderHouse2Text2: ; 1d9c3 (7:59c3) +LavenderHouse2Text2: TX_ASM CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_65711 @@ -26,10 +26,10 @@ LavenderHouse2Text2: ; 1d9c3 (7:59c3) .asm_64be1 jp TextScriptEnd -LavenderHouse2Text_1d9dc: ; 1d9dc (7:59dc) +LavenderHouse2Text_1d9dc: TX_FAR _LavenderHouse2Text_1d9dc db "@" -LavenderHouse2Text_1d9e1: ; 1d9e1 (7:59e1) +LavenderHouse2Text_1d9e1: TX_FAR _LavenderHouse2Text_1d9e1 db "@" diff --git a/scripts/lavendermart.asm b/scripts/lavendermart.asm index 85518fd2..915c9662 100755 --- a/scripts/lavendermart.asm +++ b/scripts/lavendermart.asm @@ -1,16 +1,16 @@ -LavenderMartScript: ; 5c92c (17:492c) +LavenderMartScript: jp EnableAutoTextBoxDrawing -LavenderMartTextPointers: ; 5c92f (17:492f) +LavenderMartTextPointers: dw LavenderMartText1 dw LavenderMartText2 dw LavenderMartText3 -LavenderMartText2: ; 5c935 (17:4935) +LavenderMartText2: TX_FAR _LavenderMartText2 db "@" -LavenderMartText3: ; 5c93a (17:493a) +LavenderMartText3: TX_ASM CheckEvent EVENT_RESCUED_MR_FUJI jr nz, .asm_c88d4 @@ -23,10 +23,10 @@ LavenderMartText3: ; 5c93a (17:493a) .asm_6d225 jp TextScriptEnd -LavenderMart_5c953: ; 5c953 (17:4953) +LavenderMart_5c953: TX_FAR _LavenderMart_5c953 db "@" -LavenderMart_5c958: ; 5c958 (17:4958) +LavenderMart_5c958: TX_FAR _LavenderMart_5c958 db "@" diff --git a/scripts/lavenderpokecenter.asm b/scripts/lavenderpokecenter.asm index 8f9c5454..e8e23655 100755 --- a/scripts/lavenderpokecenter.asm +++ b/scripts/lavenderpokecenter.asm @@ -1,25 +1,25 @@ -LavenderPokecenterScript: ; 5c8da (17:48da) +LavenderPokecenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -LavenderPokecenterTextPointers: ; 5c8e0 (17:48e0) +LavenderPokecenterTextPointers: dw LavenderPokecenterText1 dw LavenderPokecenterText2 dw LavenderPokecenterText3 dw LavenderPokecenterText4 dw LavenderPokecenterText5 -LavenderPokecenterText4: ; 5c8e8 (17:48e8) +LavenderPokecenterText4: TX_CABLE_CLUB_RECEPTIONIST -LavenderPokecenterText1: ; 5c8e9 (17:48e9) +LavenderPokecenterText1: TX_POKECENTER_NURSE -LavenderPokecenterText2: ; 5c8ea (17:48ea) +LavenderPokecenterText2: TX_FAR _LavenderPokecenterText1 db "@" -LavenderPokecenterText3: ; 5c8ef (17:48ef) +LavenderPokecenterText3: TX_FAR _LavenderPokecenterText3 db "@" diff --git a/scripts/lavendertown.asm b/scripts/lavendertown.asm index 30c6d4e5..daf490b1 100755 --- a/scripts/lavendertown.asm +++ b/scripts/lavendertown.asm @@ -1,7 +1,7 @@ -LavenderTownScript: ; 4410b (11:410b) +LavenderTownScript: jp EnableAutoTextBoxDrawing -LavenderTownTextPointers: ; 4410e (11:410e) +LavenderTownTextPointers: dw LavenderTownText1 dw LavenderTownText2 dw LavenderTownText3 @@ -12,7 +12,7 @@ LavenderTownTextPointers: ; 4410e (11:410e) dw LavenderTownText8 dw LavenderTownText9 -LavenderTownText1: ; 44120 (11:4120) +LavenderTownText1: TX_ASM ld hl, LavenderTownText_4413c call PrintText @@ -26,38 +26,38 @@ LavenderTownText1: ; 44120 (11:4120) call PrintText jp TextScriptEnd -LavenderTownText_4413c: ; 4413c (11:413c) +LavenderTownText_4413c: TX_FAR _LavenderTownText_4413c db "@" -LavenderTownText_44141: ; 44141 (11:4141) +LavenderTownText_44141: TX_FAR _LavenderTownText_44141 db "@" -LavenderTownText_44146: ; 44146 (11:4146) +LavenderTownText_44146: TX_FAR _LavenderTownText_44146 db "@" -LavenderTownText2: ; 4414b (11:414b) +LavenderTownText2: TX_FAR _LavenderTownText2 db "@" -LavenderTownText3: ; 44150 (11:4150) +LavenderTownText3: TX_FAR _LavenderTownText3 db "@" -LavenderTownText4: ; 44155 (11:4155) +LavenderTownText4: TX_FAR _LavenderTownText4 db "@" -LavenderTownText5: ; 4415a (11:415a) +LavenderTownText5: TX_FAR _LavenderTownText5 db "@" -LavenderTownText8: ; 4415f (11:415f) +LavenderTownText8: TX_FAR _LavenderTownText8 db "@" -LavenderTownText9: ; 44164 (11:4164) +LavenderTownText9: TX_FAR _LavenderTownText9 db "@" diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm index 12784964..60be524d 100755 --- a/scripts/lorelei.asm +++ b/scripts/lorelei.asm @@ -1,4 +1,4 @@ -LoreleiScript: ; 7617b (1d:617b) +LoreleiScript: call LoreleiShowOrHideExitBlock call EnableAutoTextBoxDrawing ld hl, LoreleiTrainerHeaders @@ -8,7 +8,7 @@ LoreleiScript: ; 7617b (1d:617b) ld [wLoreleiCurScript], a ret -LoreleiShowOrHideExitBlock: ; 76191 (1d:6191) +LoreleiShowOrHideExitBlock: ; Blocks or clears the exit to the next room. ld hl, wCurrentMapScriptFlags bit 5, [hl] @@ -27,22 +27,22 @@ LoreleiShowOrHideExitBlock: ; 76191 (1d:6191) lb bc, 0, 2 predef_jump ReplaceTileBlock -ResetLoreleiScript: ; 761b6 (1d:61b6) +ResetLoreleiScript: xor a ld [wLoreleiCurScript], a ret -LoreleiScriptPointers: ; 761bb (1d:61bb) +LoreleiScriptPointers: dw LoreleiScript0 dw DisplayEnemyTrainerTextAndStartBattle dw LoreleiScript2 dw LoreleiScript3 dw LoreleiScript4 -LoreleiScript4: ; 761c5 (1d:61c5) +LoreleiScript4: ret -LoreleiScriptWalkIntoRoom: ; 761c6 (1d:61c6) +LoreleiScriptWalkIntoRoom: ; Walk six steps upward. ld hl, wSimulatedJoypadStatesEnd ld a, D_UP @@ -60,7 +60,7 @@ LoreleiScriptWalkIntoRoom: ; 761c6 (1d:61c6) ld [wCurMapScript], a ret -LoreleiScript0: ; 761e2 (1d:61e2) +LoreleiScript0: ld hl, LoreleiEntranceCoords call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers @@ -88,14 +88,14 @@ LoreleiScript0: ; 761e2 (1d:61e2) ld [wCurMapScript], a ret -LoreleiEntranceCoords: ; 76223 (1d:6223) +LoreleiEntranceCoords: db $0A,$04 db $0A,$05 db $0B,$04 db $0B,$05 db $FF -LoreleiScript3: ; 7622c (1d:622c) +LoreleiScript3: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -106,7 +106,7 @@ LoreleiScript3: ; 7622c (1d:622c) ld [wCurMapScript], a ret -LoreleiScript2: ; 7623f (1d:623f) +LoreleiScript2: call EndTrainerBattle ld a, [wIsInBattle] cp $ff @@ -115,12 +115,12 @@ LoreleiScript2: ; 7623f (1d:623f) ld [hSpriteIndexOrTextID], a jp DisplayTextID -LoreleiTextPointers: ; 76251 (1d:6251) +LoreleiTextPointers: dw LoreleiText1 dw LoreleiDontRunAwayText -LoreleiTrainerHeaders: ; 76255 (1d:6255) -LoreleiTrainerHeader0: ; 76255 (1d:6255) +LoreleiTrainerHeaders: +LoreleiTrainerHeader0: dbEventFlagBit EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 @@ -131,24 +131,24 @@ LoreleiTrainerHeader0: ; 76255 (1d:6255) db $ff -LoreleiText1: ; 76262 (1d:6262) +LoreleiText1: TX_ASM ld hl, LoreleiTrainerHeader0 call TalkToTrainer jp TextScriptEnd -LoreleiBeforeBattleText: ; 7626c (1d:626c) +LoreleiBeforeBattleText: TX_FAR _LoreleiBeforeBattleText db "@" -LoreleiEndBattleText: ; 76271 (1d:6271) +LoreleiEndBattleText: TX_FAR _LoreleiEndBattleText db "@" -LoreleiAfterBattleText: ; 76276 (1d:6276) +LoreleiAfterBattleText: TX_FAR _LoreleiAfterBattleText db "@" -LoreleiDontRunAwayText: ; 7627b (1d:627b) +LoreleiDontRunAwayText: TX_FAR _LoreleiDontRunAwayText db "@" diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index d342c295..fb0a92bc 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -1,4 +1,4 @@ -Mansion1Script: ; 442af (11:42af) +Mansion1Script: call Mansion1Subscript1 call EnableAutoTextBoxDrawing ld hl, Mansion1TrainerHeaders @@ -8,7 +8,7 @@ Mansion1Script: ; 442af (11:42af) ld [wMansion1CurScript], a ret -Mansion1Subscript1: ; 442c5 (11:42c5) +Mansion1Subscript1: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -33,20 +33,20 @@ Mansion1Subscript1: ; 442c5 (11:42c5) lb bc, 13, 13 jp Mansion1Script_4430b -Mansion1Script_44304: ; 44304 (11:4304) +Mansion1Script_44304: ld a, $2d ld [wNewTileBlockID], a jr Mansion1ReplaceBlock -Mansion1Script_4430b: ; 4430b (11:430b) +Mansion1Script_4430b: ld a, $e ld [wNewTileBlockID], a -Mansion1ReplaceBlock: ; 44310 (11:4310) +Mansion1ReplaceBlock: predef ReplaceTileBlock ret -Mansion1Script_Switches: ; 44316 (11:4316) - ld a, [wSpriteStateData1 + 9] +Mansion1Script_Switches: + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz xor a @@ -55,19 +55,19 @@ Mansion1Script_Switches: ; 44316 (11:4316) ld [hSpriteIndexOrTextID], a jp DisplayTextID -Mansion1ScriptPointers: ; 44326 (11:4326) +Mansion1ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Mansion1TextPointers: ; 4432c (11:432c) +Mansion1TextPointers: dw Mansion1Text1 dw PickUpItemText dw PickUpItemText dw Mansion1Text4 -Mansion1TrainerHeaders: ; 44334 (11:4334) -Mansion1TrainerHeader0: ; 44334 (11:4334) +Mansion1TrainerHeaders: +Mansion1TrainerHeader0: dbEventFlagBit EVENT_BEAT_MANSION_1_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MANSION_1_TRAINER_0 @@ -78,25 +78,25 @@ Mansion1TrainerHeader0: ; 44334 (11:4334) db $ff -Mansion1Text1: ; 44341 (11:4341) +Mansion1Text1: TX_ASM ld hl, Mansion1TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Mansion1BattleText2: ; 4434b (11:434b) +Mansion1BattleText2: TX_FAR _Mansion1BattleText2 db "@" -Mansion1EndBattleText2: ; 44350 (11:4350) +Mansion1EndBattleText2: TX_FAR _Mansion1EndBattleText2 db "@" -Mansion1AfterBattleText2: ; 44355 (11:4355) +Mansion1AfterBattleText2: TX_FAR _Mansion1AfterBattleText2 db "@" -Mansion1Text4: ; 4435a (11:435a) +Mansion1Text4: TX_ASM ld hl, MansionSwitchText call PrintText @@ -122,14 +122,14 @@ Mansion1Text4: ; 4435a (11:435a) .asm_44392 jp TextScriptEnd -MansionSwitchText: ; 44395 (11:4395) +MansionSwitchText: TX_FAR _MansionSwitchText db "@" -MansionSwitchPressedText: ; 4439a (11:439a) +MansionSwitchPressedText: TX_FAR _MansionSwitchPressedText db "@" -MansionSwitchNotPressedText: ; 4439f (11:439f) +MansionSwitchNotPressedText: TX_FAR _MansionSwitchNotPressedText db "@" diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index 7fe09e4b..0ba8a245 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -1,4 +1,4 @@ -Mansion2Script: ; 51fd8 (14:5fd8) +Mansion2Script: call Mansion2Script_51fee call EnableAutoTextBoxDrawing ld hl, Mansion2TrainerHeaders @@ -8,7 +8,7 @@ Mansion2Script: ; 51fd8 (14:5fd8) ld [wMansion2CurScript], a ret -Mansion2Script_51fee: ; 51fee (14:5fee) +Mansion2Script_51fee: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -37,12 +37,12 @@ Mansion2Script_51fee: ; 51fee (14:5fee) call Mansion2Script_5202f ret -Mansion2Script_5202f: ; 5202f (14:602f) +Mansion2Script_5202f: ld [wNewTileBlockID], a predef_jump ReplaceTileBlock -Mansion2Script_Switches: ; 52037 (14:6037) - ld a, [wSpriteStateData1 + 9] +Mansion2Script_Switches: + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz xor a @@ -51,20 +51,20 @@ Mansion2Script_Switches: ; 52037 (14:6037) ld [hSpriteIndexOrTextID], a jp DisplayTextID -Mansion2ScriptPointers: ; 52047 (14:6047) +Mansion2ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Mansion2TextPointers: ; 5204d (14:604d) +Mansion2TextPointers: dw Mansion2Text1 dw PickUpItemText dw Mansion2Text3 dw Mansion2Text4 dw Mansion2Text5 -Mansion2TrainerHeaders: ; 52057 (14:6057) -Mansion2TrainerHeader0: ; 52057 (14:6057) +Mansion2TrainerHeaders: +Mansion2TrainerHeader0: dbEventFlagBit EVENT_BEAT_MANSION_2_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MANSION_2_TRAINER_0 @@ -75,34 +75,34 @@ Mansion2TrainerHeader0: ; 52057 (14:6057) db $ff -Mansion2Text1: ; 52064 (14:6064) +Mansion2Text1: TX_ASM ld hl, Mansion2TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Mansion2BattleText1: ; 5206e (14:606e) +Mansion2BattleText1: TX_FAR _Mansion2BattleText1 db "@" -Mansion2EndBattleText1: ; 52073 (14:6073) +Mansion2EndBattleText1: TX_FAR _Mansion2EndBattleText1 db "@" -Mansion2AfterBattleText1: ; 52078 (14:6078) +Mansion2AfterBattleText1: TX_FAR _Mansion2AfterBattleText1 db "@" -Mansion2Text3: ; 5207d (14:607d) +Mansion2Text3: TX_FAR _Mansion2Text3 db "@" -Mansion2Text4: ; 52082 (14:6082) +Mansion2Text4: TX_FAR _Mansion2Text4 db "@" -Mansion3Text6: ; 52087 (14:6087) -Mansion2Text5: ; 52087 (14:6087) +Mansion3Text6: +Mansion2Text5: TX_ASM ld hl, Mansion2Text_520c2 call PrintText @@ -128,14 +128,14 @@ Mansion2Text5: ; 52087 (14:6087) .asm_520bf jp TextScriptEnd -Mansion2Text_520c2: ; 520c2 (14:60c2) +Mansion2Text_520c2: TX_FAR _Mansion2Text_520c2 db "@" -Mansion2Text_520c7: ; 520c7 (14:60c7) +Mansion2Text_520c7: TX_FAR _Mansion2Text_520c7 db "@" -Mansion2Text_520cc: ; 520cc (14:60cc) +Mansion2Text_520cc: TX_FAR _Mansion2Text_520cc db "@" diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index 049bfeef..c71979d5 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -1,4 +1,4 @@ -Mansion3Script: ; 521ee (14:61ee) +Mansion3Script: call Mansion3Script_52204 call EnableAutoTextBoxDrawing ld hl, Mansion3TrainerHeader0 @@ -8,7 +8,7 @@ Mansion3Script: ; 521ee (14:61ee) ld [wMansion3CurScript], a ret -Mansion3Script_52204: ; 52204 (14:6204) +Mansion3Script_52204: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -31,12 +31,12 @@ Mansion3Script_52204: ; 52204 (14:6204) call Mansion2Script_5202f ret -Mansion3ScriptPointers: ; 52235 (14:6235) +Mansion3ScriptPointers: dw Mansion3Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Mansion3Script0: ; 5223b (14:623b) +Mansion3Script0: ld hl, CoordsData_52254 call Mansion3Script_5225b ld a, [wWhichDungeonWarp] @@ -50,13 +50,13 @@ Mansion3Script0: ; 5223b (14:623b) ld [wDungeonWarpDestinationMap], a ret -CoordsData_52254: ; 52254 (14:6254) +CoordsData_52254: db $0E,$10 db $0E,$11 db $0E,$13 db $FF -Mansion3Script_5225b: ; 5225b (14:625b) +Mansion3Script_5225b: xor a ld [wWhichDungeonWarp], a ld a, [wd72d] @@ -72,8 +72,8 @@ Mansion3Script_5225b: ; 5225b (14:625b) set 4, [hl] ret -Mansion3Script_Switches: ; 5227a (14:627a) - ld a, [wSpriteStateData1 + 9] +Mansion3Script_Switches: + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz xor a @@ -82,7 +82,7 @@ Mansion3Script_Switches: ; 5227a (14:627a) ld [hSpriteIndexOrTextID], a jp DisplayTextID -Mansion3TextPointers: ; 5228a (14:628a) +Mansion3TextPointers: dw Mansion3Text1 dw Mansion3Text2 dw PickUpItemText @@ -90,8 +90,8 @@ Mansion3TextPointers: ; 5228a (14:628a) dw Mansion3Text5 dw Mansion3Text6 -Mansion3TrainerHeaders: ; 52296 (14:6296) -Mansion3TrainerHeader0: ; 52296 (14:6296) +Mansion3TrainerHeaders: +Mansion3TrainerHeader0: dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_0 @@ -100,7 +100,7 @@ Mansion3TrainerHeader0: ; 52296 (14:6296) dw Mansion3EndBattleText1 ; TextEndBattle dw Mansion3EndBattleText1 ; TextEndBattle -Mansion3TrainerHeader2: ; 522a2 (14:62a2) +Mansion3TrainerHeader2: dbEventFlagBit EVENT_BEAT_MANSION_3_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MANSION_3_TRAINER_2 @@ -111,42 +111,42 @@ Mansion3TrainerHeader2: ; 522a2 (14:62a2) db $ff -Mansion3Text1: ; 522af (14:62af) +Mansion3Text1: TX_ASM ld hl, Mansion3TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Mansion3Text2: ; 522b9 (14:62b9) +Mansion3Text2: TX_ASM ld hl, Mansion3TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Mansion3BattleText1: ; 522c3 (14:62c3) +Mansion3BattleText1: TX_FAR _Mansion3BattleText1 db "@" -Mansion3EndBattleText1: ; 522c8 (14:62c8) +Mansion3EndBattleText1: TX_FAR _Mansion3EndBattleText1 db "@" -Mansion3AfterBattleText1: ; 522cd (14:62cd) +Mansion3AfterBattleText1: TX_FAR _Mansion3AfterBattleText1 db "@" -Mansion3BattleText2: ; 522d2 (14:62d2) +Mansion3BattleText2: TX_FAR _Mansion3BattleText2 db "@" -Mansion3EndBattleText2: ; 522d7 (14:62d7) +Mansion3EndBattleText2: TX_FAR _Mansion3EndBattleText2 db "@" -Mansion3AfterBattleText2: ; 522dc (14:62dc) +Mansion3AfterBattleText2: TX_FAR _Mansion3AfterBattleText2 db "@" -Mansion3Text5: ; 522e1 (14:62e1) +Mansion3Text5: TX_FAR _Mansion3Text5 db "@" diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index c506a407..12420990 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -1,4 +1,4 @@ -Mansion4Script: ; 523b9 (14:63b9) +Mansion4Script: call Mansion4Script_523cf call EnableAutoTextBoxDrawing ld hl, Mansion4TrainerHeader0 @@ -8,7 +8,7 @@ Mansion4Script: ; 523b9 (14:63b9) ld [wMansion4CurScript], a ret -Mansion4Script_523cf: ; 523cf (14:63cf) +Mansion4Script_523cf: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -43,8 +43,8 @@ Mansion4Script_523cf: ; 523cf (14:63cf) call Mansion2Script_5202f ret -Mansion4Script_Switches: ; 52420 (14:6420) - ld a, [wSpriteStateData1 + 9] +Mansion4Script_Switches: + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP ret nz xor a @@ -53,12 +53,12 @@ Mansion4Script_Switches: ; 52420 (14:6420) ld [hSpriteIndexOrTextID], a jp DisplayTextID -Mansion4ScriptPointers: ; 52430 (14:6430) +Mansion4ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Mansion4TextPointers: ; 52436 (14:6436) +Mansion4TextPointers: dw Mansion4Text1 dw Mansion4Text2 dw PickUpItemText @@ -69,8 +69,8 @@ Mansion4TextPointers: ; 52436 (14:6436) dw PickUpItemText dw Mansion3Text6 -Mansion4TrainerHeaders: ; 52448 (14:6448) -Mansion4TrainerHeader0: ; 52448 (14:6448) +Mansion4TrainerHeaders: +Mansion4TrainerHeader0: dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_0 @@ -79,7 +79,7 @@ Mansion4TrainerHeader0: ; 52448 (14:6448) dw Mansion4EndBattleText1 ; TextEndBattle dw Mansion4EndBattleText1 ; TextEndBattle -Mansion4TrainerHeader2: ; 52454 (14:6454) +Mansion4TrainerHeader2: dbEventFlagBit EVENT_BEAT_MANSION_4_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MANSION_4_TRAINER_2 @@ -90,42 +90,42 @@ Mansion4TrainerHeader2: ; 52454 (14:6454) db $ff -Mansion4Text1: ; 52461 (14:6461) +Mansion4Text1: TX_ASM ld hl, Mansion4TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Mansion4Text2: ; 5246b (14:646b) +Mansion4Text2: TX_ASM ld hl, Mansion4TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Mansion4BattleText1: ; 52475 (14:6475) +Mansion4BattleText1: TX_FAR _Mansion4BattleText1 db "@" -Mansion4EndBattleText1: ; 5247a (14:647a) +Mansion4EndBattleText1: TX_FAR _Mansion4EndBattleText1 db "@" -Mansion4AfterBattleText1: ; 5247f (14:647f) +Mansion4AfterBattleText1: TX_FAR _Mansion4AfterBattleText1 db "@" -Mansion4BattleText2: ; 52484 (14:6484) +Mansion4BattleText2: TX_FAR _Mansion4BattleText2 db "@" -Mansion4EndBattleText2: ; 52489 (14:6489) +Mansion4EndBattleText2: TX_FAR _Mansion4EndBattleText2 db "@" -Mansion4AfterBattleText2: ; 5248e (14:648e) +Mansion4AfterBattleText2: TX_FAR _Mansion4AfterBattleText2 db "@" -Mansion4Text7: ; 52493 (14:6493) +Mansion4Text7: TX_FAR _Mansion4Text7 db "@" diff --git a/scripts/mtmoon1.asm b/scripts/mtmoon1.asm index 4c87ee21..604e490a 100755 --- a/scripts/mtmoon1.asm +++ b/scripts/mtmoon1.asm @@ -1,4 +1,4 @@ -MtMoon1Script: ; 499c8 (12:59c8) +MtMoon1Script: call EnableAutoTextBoxDrawing ld hl, MtMoon1TrainerHeader0 ld de, MtMoon1ScriptPointers @@ -7,12 +7,12 @@ MtMoon1Script: ; 499c8 (12:59c8) ld [wMtMoon1CurScript], a ret -MtMoon1ScriptPointers: ; 499db (12:59db) +MtMoon1ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -MtMoon1TextPointers: ; 499e1 (12:59e1) +MtMoon1TextPointers: dw MtMoon1Text1 dw MtMoon1Text2 dw MtMoon1Text3 @@ -28,8 +28,8 @@ MtMoon1TextPointers: ; 499e1 (12:59e1) dw PickUpItemText dw MtMoon1Text14 -MtMoon1TrainerHeaders: ; 499fd (12:59fd) -MtMoon1TrainerHeader0: ; 499fd (12:59fd) +MtMoon1TrainerHeaders: +MtMoon1TrainerHeader0: dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_0 @@ -38,7 +38,7 @@ MtMoon1TrainerHeader0: ; 499fd (12:59fd) dw MtMoon1EndBattleText2 ; TextEndBattle dw MtMoon1EndBattleText2 ; TextEndBattle -MtMoon1TrainerHeader2: ; 49a09 (12:5a09) +MtMoon1TrainerHeader2: dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_2 @@ -47,7 +47,7 @@ MtMoon1TrainerHeader2: ; 49a09 (12:5a09) dw MtMoon1EndBattleText3 ; TextEndBattle dw MtMoon1EndBattleText3 ; TextEndBattle -MtMoon1TrainerHeader3: ; 49a15 (12:5a15) +MtMoon1TrainerHeader3: dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_3 @@ -56,7 +56,7 @@ MtMoon1TrainerHeader3: ; 49a15 (12:5a15) dw MtMoon1EndBattleText4 ; TextEndBattle dw MtMoon1EndBattleText4 ; TextEndBattle -MtMoon1TrainerHeader4: ; 49a21 (12:5a21) +MtMoon1TrainerHeader4: dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_4 @@ -65,7 +65,7 @@ MtMoon1TrainerHeader4: ; 49a21 (12:5a21) dw MtMoon1EndBattleText5 ; TextEndBattle dw MtMoon1EndBattleText5 ; TextEndBattle -MtMoon1TrainerHeader5: ; 49a2d (12:5a2d) +MtMoon1TrainerHeader5: dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_5 @@ -74,7 +74,7 @@ MtMoon1TrainerHeader5: ; 49a2d (12:5a2d) dw MtMoon1EndBattleText6 ; TextEndBattle dw MtMoon1EndBattleText6 ; TextEndBattle -MtMoon1TrainerHeader6: ; 49a39 (12:5a39) +MtMoon1TrainerHeader6: dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_6 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_6 @@ -83,7 +83,7 @@ MtMoon1TrainerHeader6: ; 49a39 (12:5a39) dw MtMoon1EndBattleText7 ; TextEndBattle dw MtMoon1EndBattleText7 ; TextEndBattle -MtMoon1TrainerHeader7: ; 49a45 (12:5a45) +MtMoon1TrainerHeader7: dbEventFlagBit EVENT_BEAT_MT_MOON_1_TRAINER_7 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_MT_MOON_1_TRAINER_7 @@ -94,127 +94,127 @@ MtMoon1TrainerHeader7: ; 49a45 (12:5a45) db $ff -MtMoon1Text1: ; 49a52 (12:5a52) +MtMoon1Text1: TX_ASM ld hl, MtMoon1TrainerHeader0 jr MtMoon1TalkToTrainer -MtMoon1Text2: ; 49a5c (12:5a5c) +MtMoon1Text2: TX_ASM ld hl, MtMoon1TrainerHeader2 jr MtMoon1TalkToTrainer -MtMoon1Text3: ; 49a66 (12:5a66) +MtMoon1Text3: TX_ASM ld hl, MtMoon1TrainerHeader3 jr MtMoon1TalkToTrainer -MtMoon1Text4: ; 49a70 (12:5a70) +MtMoon1Text4: TX_ASM ld hl, MtMoon1TrainerHeader4 jr MtMoon1TalkToTrainer -MtMoon1Text5: ; 49a7a (12:5a7a) +MtMoon1Text5: TX_ASM ld hl, MtMoon1TrainerHeader5 jr MtMoon1TalkToTrainer -MtMoon1Text6: ; 49a84 (12:5a84) +MtMoon1Text6: TX_ASM ld hl, MtMoon1TrainerHeader6 jr MtMoon1TalkToTrainer -MtMoon1Text7: ; 49a8e (12:5a8e) +MtMoon1Text7: TX_ASM ld hl, MtMoon1TrainerHeader7 MtMoon1TalkToTrainer: call TalkToTrainer jp TextScriptEnd -MtMoon1BattleText2: ; 49a98 (12:5a98) +MtMoon1BattleText2: TX_FAR _MtMoon1BattleText2 db "@" -MtMoon1EndBattleText2: ; 49a9d (12:5a9d) +MtMoon1EndBattleText2: TX_FAR _MtMoon1EndBattleText2 db "@" -MtMoon1AfterBattleText2: ; 49aa2 (12:5aa2) +MtMoon1AfterBattleText2: TX_FAR _MtMoon1AfterBattleText2 db "@" -MtMoon1BattleText3: ; 49aa7 (12:5aa7) +MtMoon1BattleText3: TX_FAR _MtMoon1BattleText3 db "@" -MtMoon1EndBattleText3: ; 49aac (12:5aac) +MtMoon1EndBattleText3: TX_FAR _MtMoon1EndBattleText3 db "@" -MtMoon1AfterBattleText3: ; 49ab1 (12:5ab1) +MtMoon1AfterBattleText3: TX_FAR _MtMoon1AfterBattleText3 db "@" -MtMoon1BattleText4: ; 49ab6 (12:5ab6) +MtMoon1BattleText4: TX_FAR _MtMoon1BattleText4 db "@" -MtMoon1EndBattleText4: ; 49abb (12:5abb) +MtMoon1EndBattleText4: TX_FAR _MtMoon1EndBattleText4 db "@" -MtMoon1AfterBattleText4: ; 49ac0 (12:5ac0) +MtMoon1AfterBattleText4: TX_FAR _MtMoon1AfterBattleText4 db "@" -MtMoon1BattleText5: ; 49ac5 (12:5ac5) +MtMoon1BattleText5: TX_FAR _MtMoon1BattleText5 db "@" -MtMoon1EndBattleText5: ; 49aca (12:5aca) +MtMoon1EndBattleText5: TX_FAR _MtMoon1EndBattleText5 db "@" -MtMoon1AfterBattleText5: ; 49acf (12:5acf) +MtMoon1AfterBattleText5: TX_FAR _MtMoon1AfterBattleText5 db "@" -MtMoon1BattleText6: ; 49ad4 (12:5ad4) +MtMoon1BattleText6: TX_FAR _MtMoon1BattleText6 db "@" -MtMoon1EndBattleText6: ; 49ad9 (12:5ad9) +MtMoon1EndBattleText6: TX_FAR _MtMoon1EndBattleText6 db "@" -MtMoon1AfterBattleText6: ; 49ade (12:5ade) +MtMoon1AfterBattleText6: TX_FAR _MtMoon1AfterBattleText6 db "@" -MtMoon1BattleText7: ; 49ae3 (12:5ae3) +MtMoon1BattleText7: TX_FAR _MtMoon1BattleText7 db "@" -MtMoon1EndBattleText7: ; 49ae8 (12:5ae8) +MtMoon1EndBattleText7: TX_FAR _MtMoon1EndBattleText7 db "@" -MtMoon1AfterBattleText7: ; 49aed (12:5aed) +MtMoon1AfterBattleText7: TX_FAR _MtMoon1AfterBattleText7 db "@" -MtMoon1BattleText8: ; 49af2 (12:5af2) +MtMoon1BattleText8: TX_FAR _MtMoon1BattleText8 db "@" -MtMoon1EndBattleText8: ; 49af7 (12:5af7) +MtMoon1EndBattleText8: TX_FAR _MtMoon1EndBattleText8 db "@" -MtMoon1AfterBattleText8: ; 49afc (12:5afc) +MtMoon1AfterBattleText8: TX_FAR _MtMoon1AfterBattleText8 db "@" -MtMoon1Text14: ; 49b01 (12:5b01) +MtMoon1Text14: TX_FAR _MtMoon1Text14 db "@" diff --git a/scripts/mtmoon2.asm b/scripts/mtmoon2.asm index 03e9d9cb..6d1e5339 100755 --- a/scripts/mtmoon2.asm +++ b/scripts/mtmoon2.asm @@ -1,10 +1,10 @@ -MtMoon2Script: ; 51a42 (14:5a42) +MtMoon2Script: call EnableAutoTextBoxDrawing ret -MtMoon2TextPointers: ; 51a46 (14:5a46) +MtMoon2TextPointers: dw MtMoonText1 -MtMoonText1: ; 51a48 (14:5a48) +MtMoonText1: TX_FAR _MtMoonText1 db "@" diff --git a/scripts/mtmoon3.asm b/scripts/mtmoon3.asm index 1c9bb582..b8d14bd5 100755 --- a/scripts/mtmoon3.asm +++ b/scripts/mtmoon3.asm @@ -1,4 +1,4 @@ -MtMoon3Script: ; 49d0b (12:5d0b) +MtMoon3Script: call EnableAutoTextBoxDrawing ld hl, MtMoon3TrainerHeaders ld de, MtMoon3ScriptPointers @@ -18,7 +18,7 @@ MtMoon3Script: ; 49d0b (12:5d0b) res 4, [hl] ret -CoordsData_49d37: ; 49d37 (12:5d37) +CoordsData_49d37: db $05,$0B db $05,$0C db $05,$0D @@ -37,7 +37,7 @@ CoordsData_49d37: ; 49d37 (12:5d37) db $08,$0E db $FF -MtMoon3Script_49cd7: ; 49d58 (12:5d58) +MtMoon3Script_49cd7: CheckAndResetEvent EVENT_57E call nz, MtMoon3Script_49cec xor a @@ -54,7 +54,7 @@ MtMoon3Script_49cec: call MtMoon3Script_49f93 ret -MtMoon3ScriptPointers: ; 49d63 (12:5d63) +MtMoon3ScriptPointers: dw MtMoon3Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle @@ -72,7 +72,7 @@ MtMoon3ScriptPointers: ; 49d63 (12:5d63) dw MtMoon3Script14 dw MtMoon3Script15 -MtMoon3Script0: ; 49d6f (12:5d6f) +MtMoon3Script0: CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL call z, MtMoon3Script_49d28 CheckEvent EVENT_BEAT_MT_MOON_3_TRAINER_0 @@ -100,7 +100,7 @@ MtMoon3Script_49d28: jp z, CheckFightingMapTrainers ret -MtMoon3Script3: ; 49d9a (12:5d9a) +MtMoon3Script3: ld a, [wIsInBattle] cp $ff jp z, MtMoon3Script_49cd7 @@ -113,7 +113,7 @@ MtMoon3Script3: ; 49d9a (12:5d9a) call MtMoon3Script_49ce5 ret -MtMoon3Script4: ; 49dba (12:5dba) +MtMoon3Script4: ld a, $1 ld [H_SPRITEINDEX], a call SetSpriteMovementBytesToFF @@ -185,13 +185,13 @@ PikachuMovementData_49dd8: db $34 db $3f -MovementData_49ddc: ; 49df8 (12:5df8) +MovementData_49ddc: db NPC_MOVEMENT_RIGHT -MovementData_49ddd: ; 49df9 (12:5df9) +MovementData_49ddd: db NPC_MOVEMENT_UP db $FF -MtMoon3Script5: ; 49dfb (12:5dfb) +MtMoon3Script5: ld a, [wd730] bit 0, a ret nz @@ -408,7 +408,7 @@ MtMoon3Script_49f93: predef HideObject ret -MtMoon3TextPointers: ; 49e34 (12:5e34) +MtMoon3TextPointers: dw MtMoon3Text1 dw MtMoon3Text2 dw MtMoon3Text3 diff --git a/scripts/mtmoon3_2.asm b/scripts/mtmoon3_2.asm index bb9b25a8..c6ec92b4 100755 --- a/scripts/mtmoon3_2.asm +++ b/scripts/mtmoon3_2.asm @@ -24,5 +24,5 @@ MtMoon3Script_4a325: ; pikachu-related function? pop af ld [wUpdateSpritesEnabled], a pop hl - call Func_159b + call ApplyPikachuMovementData ret diff --git a/scripts/mtmoonpokecenter.asm b/scripts/mtmoonpokecenter.asm index 9c35686f..a2f2c82b 100755 --- a/scripts/mtmoonpokecenter.asm +++ b/scripts/mtmoonpokecenter.asm @@ -1,8 +1,8 @@ -MtMoonPokecenterScript: ; 492cf (12:52cf) +MtMoonPokecenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -MtMoonPokecenterTextPointers: ; 492d5 (12:52d5) +MtMoonPokecenterTextPointers: dw MtMoonPokecenterText1 dw MtMoonPokecenterText2 dw MtMoonPokecenterText3 @@ -11,27 +11,27 @@ MtMoonPokecenterTextPointers: ; 492d5 (12:52d5) dw MtMoonPokecenterText6 dw MtMoonPokecenterText7 -MtMoonPokecenterText1: ; 492e1 (12:52e1) +MtMoonPokecenterText1: TX_POKECENTER_NURSE -MtMoonPokecenterText2: ; 492e2 (12:52e2) +MtMoonPokecenterText2: TX_FAR _MtMoonPokecenterText1 db "@" -MtMoonPokecenterText3: ; 492e7 (12:52e7) +MtMoonPokecenterText3: TX_FAR _MtMoonPokecenterText3 db "@" -MtMoonPokecenterText4: ; 492ec (12:52ec) +MtMoonPokecenterText4: TX_ASM callab Func_f218c jp TextScriptEnd -MtMoonPokecenterText5: ; 49370 (12:5370) +MtMoonPokecenterText5: TX_FAR _MtMoonPokecenterText5 db "@" -MtMoonPokecenterText6: ; 49375 (12:5375) +MtMoonPokecenterText6: TX_CABLE_CLUB_RECEPTIONIST MtMoonPokecenterText7: diff --git a/scripts/mtmoonpokecenter2.asm b/scripts/mtmoonpokecenter2.asm index fa42f440..f01b7218 100755 --- a/scripts/mtmoonpokecenter2.asm +++ b/scripts/mtmoonpokecenter2.asm @@ -49,18 +49,18 @@ Func_f218c: .done ret -MtMoonPokecenterText_4935c: ; 4935c (12:535c) +MtMoonPokecenterText_4935c: TX_FAR _MtMoonPokecenterText_4935c db "@" -MtMoonPokecenterText_49361: ; 49361 (12:5361) +MtMoonPokecenterText_49361: TX_FAR _MtMoonPokecenterText_49361 db "@" -MtMoonPokecenterText_49366: ; 49366 (12:5366) +MtMoonPokecenterText_49366: TX_FAR _MtMoonPokecenterText_49366 db "@" -MtMoonPokecenterText_4936b: ; 4936b (12:536b) +MtMoonPokecenterText_4936b: TX_FAR _MtMoonPokecenterText_4936b db "@" diff --git a/scripts/museum1f.asm b/scripts/museum1f.asm index 8da518cf..30e6f594 100755 --- a/scripts/museum1f.asm +++ b/scripts/museum1f.asm @@ -1,4 +1,4 @@ -Museum1FScript: ; 5c0f7 (17:40f7) +Museum1FScript: ld a, $1 ld [wAutoTextBoxDrawingControl], a xor a @@ -8,11 +8,11 @@ Museum1FScript: ; 5c0f7 (17:40f7) call JumpTable ret -Museum1FScriptPointers: ; 5c109 (17:4109) +Museum1FScriptPointers: dw Museum1FScript0 dw Museum1FScript1 -Museum1FScript0: ; 5c10d (17:410d) +Museum1FScript0: ld a, [wYCoord] cp $4 ret nz @@ -29,37 +29,37 @@ Museum1FScript0: ; 5c10d (17:410d) ld [hSpriteIndexOrTextID], a jp DisplayTextID -Museum1FScript1: ; 5c12a (17:412a) +Museum1FScript1: ret -Museum1FTextPointers: ; 5c12b (17:412b) +Museum1FTextPointers: dw Museum1FText1 dw Museum1FText2 dw Museum1FText3 dw Museum1FText4 dw Museum1FText5 -Museum1FText1: ; 5c135 (17:4135) +Museum1FText1: TX_ASM callba Func_f1c1b jp TextScriptEnd -Museum1FText2: ; 5c135 (17:4135) +Museum1FText2: TX_ASM callba Func_f1d2a jp TextScriptEnd -Museum1FText3: ; 5c135 (17:4135) +Museum1FText3: TX_ASM callba Func_f1d36 jp TextScriptEnd -Museum1FText4: ; 5c135 (17:4135) +Museum1FText4: TX_ASM callba Func_f1d80 jp TextScriptEnd -Museum1FText5: ; 5c135 (17:4135) +Museum1FText5: TX_ASM callba Func_f1d8c jp TextScriptEnd diff --git a/scripts/museum2f.asm b/scripts/museum2f.asm index 56d113ae..93a8396e 100755 --- a/scripts/museum2f.asm +++ b/scripts/museum2f.asm @@ -1,8 +1,8 @@ -Museum2FScript: ; 5c317 (17:4317) +Museum2FScript: call EnableAutoTextBoxDrawing ret -Museum2FTextPointers: ; 5c31a (17:431a) +Museum2FTextPointers: dw Museum2FText1 dw Museum2FText2 dw Museum2FText3 @@ -11,23 +11,23 @@ Museum2FTextPointers: ; 5c31a (17:431a) dw Museum2FText6 dw Museum2FText7 -Museum2FText1: ; 5c328 (17:4328) +Museum2FText1: TX_FAR _Museum2FText1 db "@" -Museum2FText2: ; 5c32d (17:432d) +Museum2FText2: TX_FAR _Museum2FText2 db "@" -Museum2FText3: ; 5c332 (17:4332) +Museum2FText3: TX_FAR _Museum2FText3 db "@" -Museum2FText4: ; 5c337 (17:4337) +Museum2FText4: TX_FAR _Museum2FText4 db "@" -Museum2FText5: ; 5c33c (17:433c) +Museum2FText5: TX_ASM ld a, [wd472] bit 7, a @@ -62,10 +62,10 @@ Museum2FText_5c218: TX_FAR _Museum2FPikachuText2 db "@" -Museum2FText6: ; 5c341 (17:4341) +Museum2FText6: TX_FAR _Museum2FText6 db "@" -Museum2FText7: ; 5c346 (17:4346) +Museum2FText7: TX_FAR _Museum2FText7 db "@" diff --git a/scripts/namerater.asm b/scripts/namerater.asm index 42b82b62..160948ac 100755 --- a/scripts/namerater.asm +++ b/scripts/namerater.asm @@ -1,14 +1,14 @@ -NameRaterScript: ; 1da12 (7:5a12) +NameRaterScript: jp EnableAutoTextBoxDrawing -NameRaterScript_1da15: ; 1da15 (7:5a15) +NameRaterScript_1da15: call PrintText call YesNoChoice ld a, [wCurrentMenuItem] and a ret -NameRaterScript_1da20: ; 1da20 (7:5a20) +NameRaterScript_1da20: ld hl, wPartyMonOT ld bc, NAME_LENGTH ld a, [wWhichPokemon] @@ -37,10 +37,10 @@ NameRaterScript_1da20: ; 1da20 (7:5a20) scf ret -NameRaterTextPointers: ; 1da54 (7:5a54) +NameRaterTextPointers: dw NameRaterText1 -NameRaterText1: ; 1da56 (7:5a56) +NameRaterText1: TX_ASM call SaveScreenTilesToBuffer2 ld hl, NameRaterText_1dab3 @@ -78,30 +78,30 @@ NameRaterText1: ; 1da56 (7:5a56) ld hl, NameRaterText_1dacc jr .asm_1daa8 -NameRaterText_1dab3: ; 1dab3 (7:5ab3) +NameRaterText_1dab3: TX_FAR _NameRaterText_1dab3 db "@" -NameRaterText_1dab8: ; 1dab8 (7:5ab8) +NameRaterText_1dab8: TX_FAR _NameRaterText_1dab8 db "@" -NameRaterText_1dabd: ; 1dabd (7:5abd) +NameRaterText_1dabd: TX_FAR _NameRaterText_1dabd db "@" -NameRaterText_1dac2: ; 1dac2 (7:5ac2) +NameRaterText_1dac2: TX_FAR _NameRaterText_1dac2 db "@" -NameRaterText_1dac7: ; 1dac7 (7:5ac7) +NameRaterText_1dac7: TX_FAR _NameRaterText_1dac7 db "@" -NameRaterText_1dacc: ; 1dacc (7:5acc) +NameRaterText_1dacc: TX_FAR _NameRaterText_1dacc db "@" -NameRaterText_1dad1: ; 1dad1 (7:5ad1) +NameRaterText_1dad1: TX_FAR _NameRaterText_1dad1 db "@" diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index 5b10668e..5a6b9456 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -1,4 +1,4 @@ -OaksLabScript: ; 1cb0e (7:4b0e) +OaksLabScript: CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 call nz, OaksLabScript_1d076 ld a, $1 @@ -10,7 +10,7 @@ OaksLabScript: ; 1cb0e (7:4b0e) call JumpTable ret -OaksLabScriptPointers: ; 1cb28 (7:4b28) +OaksLabScriptPointers: dw OaksLabScript0 dw OaksLabScript1 dw OaksLabScript2 @@ -35,7 +35,7 @@ OaksLabScriptPointers: ; 1cb28 (7:4b28) dw OaksLabScript21 dw OaksLabScript22 -OaksLabScript0: ; 1cb4e (7:4b4e) +OaksLabScript0: CheckEvent EVENT_OAK_APPEARED_IN_PALLET ret z ld a, [wNPCMovementScriptFunctionNum] @@ -51,7 +51,7 @@ OaksLabScript0: ; 1cb4e (7:4b4e) ld [wOaksLabCurScript], a ret -OaksLabScript1: ; 1cb6e (7:4b6e) +OaksLabScript1: ld a, $6 ld [H_SPRITEINDEX], a ld de, OakEntryMovement @@ -61,13 +61,13 @@ OaksLabScript1: ; 1cb6e (7:4b6e) ld [wOaksLabCurScript], a ret -OakEntryMovement: ; 1cb7e (7:4b7e) +OakEntryMovement: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db $FF -OaksLabScript2: ; 1cb82 (7:4b82) +OaksLabScript2: ld a, [wd730] bit 0, a ret nz @@ -82,7 +82,7 @@ OaksLabScript2: ; 1cb82 (7:4b82) ld [wOaksLabCurScript], a ret -OaksLabScript3: ; 1cba2 (7:4ba2) +OaksLabScript3: call Delay3 ld hl, wSimulatedJoypadStatesEnd ld de, PlayerEntryMovementRLE @@ -105,11 +105,11 @@ OaksLabScript3: ; 1cba2 (7:4ba2) ld [wOaksLabCurScript], a ret -PlayerEntryMovementRLE: ; 1cbcf (7:4bcf) +PlayerEntryMovementRLE: db D_UP,$8 db $ff -OaksLabScript4: ; 1cbd2 (7:445f) +OaksLabScript4: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -128,9 +128,8 @@ OaksLabScript4: ; 1cbd2 (7:445f) ld [wOaksLabCurScript], a ret -OaksLabScript5: ; 1cbfd (7:4bfd) - ld hl, wd74b - set 1, [hl] +OaksLabScript5: + SetEvent EVENT_OAK_ASKED_TO_CHOOSE_MON ld a, $fc ld [wJoyIgnore], a ld a, $d @@ -159,7 +158,7 @@ OaksLabScript5: ; 1cbfd (7:4bfd) ld [wOaksLabCurScript], a ret -OaksLabScript6: ; 1cc36 (7:4c36) +OaksLabScript6: ld a, [wYCoord] cp $6 ret nz @@ -189,7 +188,7 @@ OaksLabScript6: ; 1cc36 (7:4c36) ld [wOaksLabCurScript], a ret -OaksLabScript7: ; 1cc72 (7:4c72) +OaksLabScript7: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -199,7 +198,7 @@ OaksLabScript7: ; 1cc72 (7:4c72) ld [wOaksLabCurScript], a ret -OaksLabScript8: ; 1cc80 (7:4c80) +OaksLabScript8: ld a, $1 ld [hSpriteIndexOrTextID], a ld de, .SonyPushesPlayerAwayFromEeveeBall @@ -215,7 +214,7 @@ OaksLabScript8: ; 1cc80 (7:4c80) db $07 db $FF -OaksLabScript9: ; 1cd00 (7:4d00) +OaksLabScript9: ld a, [wd730] bit 0, a jr nz, .asm_1c564 @@ -259,7 +258,7 @@ OaksLabScript9: ; 1cd00 (7:4d00) call StartSimulatingJoypadStates ret -OaksLabScript10: ; 1cd6d (7:4d6d) +OaksLabScript10: ld a, [wYCoord] cp $4 jr z, .asm_1c599 @@ -392,8 +391,7 @@ OaksLabScript14: xor a ld [wSpriteStateData1 + 1 * $10 + 9], a predef HealParty - ld hl, wd74b - set 3, [hl] + SetEvent EVENT_BATTLED_RIVAL_IN_OAKS_LAB ld a, $f ld [wOaksLabCurScript], a ret @@ -466,15 +464,15 @@ OaksLabScript16: ret nz xor a .asm_1c707 - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ret OaksLabScript17: ; Pikachu comes out ld a, SPRITE_FACING_UP - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, $2 - ld [wd431], a + ld [wPikachuSpawnState], a callba Func_fc4fa call Func_1525 ld a, $1a @@ -707,7 +705,7 @@ OaksLabScript_1d076: ld [wMapTextPtr + 1], a ret -OaksLabTextPointers: ; 1d082 (7:5082) +OaksLabTextPointers: dw OaksLabText1 dw OaksLabText2 dw OaksLabText3 diff --git a/scripts/oakslab2.asm b/scripts/oakslab2.asm index fef72470..5e4e98a4 100755 --- a/scripts/oakslab2.asm +++ b/scripts/oakslab2.asm @@ -4,13 +4,13 @@ Func_f1be0: jr z, .asm_f1bf0 ld b, SPRITE_FACING_DOWN ld hl, Data_f1bf9 - call Func_f0a82 + call TryApplyPikachuMovementData ret .asm_f1bf0 ld b, SPRITE_FACING_LEFT ld hl, Data_f1bfe - call Func_f0a82 + call TryApplyPikachuMovementData ret Data_f1bf9: diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm index 27bae365..803aa4f3 100755 --- a/scripts/pallettown.asm +++ b/scripts/pallettown.asm @@ -1,4 +1,4 @@ -PalletTownScript: ; 18e5b (6:4e5b) +PalletTownScript: CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK jr z, .next SetEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS @@ -8,7 +8,7 @@ PalletTownScript: ; 18e5b (6:4e5b) ld a, [wPalletTownCurScript] jp JumpTable -PalletTownScriptPointers: ; 18e73 (6:4e73) +PalletTownScriptPointers: dw PalletTownScript0 dw PalletTownScript1 dw PalletTownScript2 @@ -20,7 +20,7 @@ PalletTownScriptPointers: ; 18e73 (6:4e73) dw PalletTownScript8 dw PalletTownScript9 -PalletTownScript0: ; 18e81 (6:4e81) +PalletTownScript0: CheckEvent EVENT_FOLLOWED_OAK_INTO_LAB ret nz ld a, [wYCoord] @@ -41,7 +41,7 @@ PalletTownScript0: ; 18e81 (6:4e81) call StopAllMusic ld a, BANK(Music_MeetProfOak) ld c, a - ld a, MUSIC_MEET_PROF_OAK ; “oak appears” music + ld a, MUSIC_MEET_PROF_OAK call PlayMusic SetEvent EVENT_OAK_APPEARED_IN_PALLET @@ -50,7 +50,7 @@ PalletTownScript0: ; 18e81 (6:4e81) ld [wPalletTownCurScript], a ret -PalletTownScript1: ; 18eb2 (6:4eb2) +PalletTownScript1: ld a, $FF ^ (A_BUTTON | B_BUTTON) ld [wJoyIgnore], a xor a @@ -78,7 +78,7 @@ PalletTownScript1: ; 18eb2 (6:4eb2) ld [wPalletTownCurScript], a ret -PalletTownScript2: ; 18ed2 (6:4ed2) +PalletTownScript2: call Delay3 ld a, 0 ld [wYCoord], a @@ -101,7 +101,7 @@ PalletTownScript2: ; 18ed2 (6:4ed2) ld [wPalletTownCurScript], a ret -PalletTownScript3: ; 18f12 (6:4f12) +PalletTownScript3: ld a, [wd730] bit 0, a ret nz @@ -133,7 +133,7 @@ PalletTownScript3: ; 18f12 (6:4f12) ld [wPalletTownCurScript], a ret -PalletTownScript4: ; 18f4b (6:4f4b) +PalletTownScript4: ; start the pikachu battle ld a, $FF ^ (A_BUTTON | B_BUTTON) ld [wJoyIgnore], a @@ -151,7 +151,7 @@ PalletTownScript4: ; 18f4b (6:4f4b) ld [wPalletTownCurScript], a ret -PalletTownScript5: ; 18f56 (6:4f56) +PalletTownScript5: ld a, $2 ld [wcf0d], a ld a, $1 @@ -172,9 +172,9 @@ PalletTownScript5: ; 18f56 (6:4f56) ld [wPalletTownCurScript], a ret -PalletTownScript6: ; 18f87 (6:4f87) +PalletTownScript6: xor a - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, $1 ld [wSpriteIndex], a xor a @@ -220,7 +220,7 @@ PalletTownScript8: PalletTownScript9: ret -PalletTownTextPointers: ; 18f88 (6:4f88) +PalletTownTextPointers: dw PalletTownText1 dw PalletTownText2 dw PalletTownText3 @@ -230,7 +230,7 @@ PalletTownTextPointers: ; 18f88 (6:4f88) dw PalletTownText7 dw PalletTownText8 -PalletTownText1: ; 18f96 (6:4f96) +PalletTownText1: TX_ASM ld a, [wcf0d] and a @@ -251,7 +251,7 @@ PalletTownText1: ; 18f96 (6:4f96) call PrintText jp TextScriptEnd -OakAppearsText: ; 18fb0 (6:4fb0) +OakAppearsText: TX_FAR _OakAppearsText TX_ASM ld c, 10 @@ -265,7 +265,7 @@ OakAppearsText: ; 18fb0 (6:4fb0) predef EmotionBubble jp TextScriptEnd -OakWalksUpText: ; 18fce (6:4fce) +OakWalksUpText: TX_FAR _OakWalksUpText db "@" @@ -273,27 +273,27 @@ PalletTownText_19002: TX_FAR _OakWhewText db "@" -PalletTownText8: ; 0x18fd3 girl +PalletTownText8: ; girl TX_FAR _OakGrassText db "@" -PalletTownText2: ; 0x18fd8 fat man +PalletTownText2: ; fat man TX_FAR _PalletTownText2 db "@" -PalletTownText3: ; 0x18fdd sign by lab +PalletTownText3: ; sign by lab TX_FAR _PalletTownText3 db "@" -PalletTownText4: ; 0x18fe2 sign by fence +PalletTownText4: ; sign by fence TX_FAR _PalletTownText4 db "@" -PalletTownText5: ; 0x18fe7 sign by Red’s house +PalletTownText5: ; sign by Red’s house TX_FAR _PalletTownText5 db "@" -PalletTownText6: ; 0x18fec sign by Blue’s house +PalletTownText6: ; sign by Blue’s house TX_FAR _PalletTownText6 db "@" diff --git a/scripts/pewtercity.asm b/scripts/pewtercity.asm index cece9d38..b7271b05 100755 --- a/scripts/pewtercity.asm +++ b/scripts/pewtercity.asm @@ -1,13 +1,13 @@ -PewterCityScript: ; 192f5 (6:52f5) +PewterCityScript: call EnableAutoTextBoxDrawing - ld hl, wPreventBlackout + ld hl, wd492 res 7, [hl] ld hl, PewterCityScriptPointers ld a, [wPewterCityCurScript] call JumpTable ret -PewterCityScriptPointers: ; 19307 (6:5307) +PewterCityScriptPointers: dw PewterCityScript0 dw PewterCityScript1 dw PewterCityScript2 @@ -16,14 +16,14 @@ PewterCityScriptPointers: ; 19307 (6:5307) dw PewterCityScript5 dw PewterCityScript6 -PewterCityScript0: ; 19315 (6:5315) +PewterCityScript0: xor a ld [wMuseum1FCurScript], a ResetEvent EVENT_BOUGHT_MUSEUM_TICKET call PewterCityScript_1925e ret -PewterCityScript_1925e: ; 1925e (6:525e) +PewterCityScript_1925e: CheckEvent EVENT_BEAT_BROCK ret nz ld hl, CoordsData_19277 @@ -35,14 +35,14 @@ PewterCityScript_1925e: ; 1925e (6:525e) ld [hSpriteIndexOrTextID], a jp DisplayTextID -CoordsData_19277: ; 19277 (6:5277) +CoordsData_19277: db $11,$23 db $11,$24 db $12,$25 db $13,$25 db $ff -PewterCityScript1: ; 19280 (6:5280) +PewterCityScript1: ld a, [wNPCMovementScriptPointerTableNum] and a ret nz @@ -79,14 +79,14 @@ PewterCityScript1: ; 19280 (6:5280) ld [wPewterCityCurScript], a ret -MovementData_PewterMuseumGuyExit: ; 192ce (6:52ce) +MovementData_PewterMuseumGuyExit: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db $FF -PewterCityScript2: ; 192d3 (6:52d3) +PewterCityScript2: ld a, [wd730] bit 0, a ret nz @@ -97,7 +97,7 @@ PewterCityScript2: ; 192d3 (6:52d3) ld [wPewterCityCurScript], a ret -PewterCityScript3: ; 192e9 (6:52e9) +PewterCityScript3: ld a, $3 ld [wSpriteIndex], a call SetSpritePosition2 @@ -110,7 +110,7 @@ PewterCityScript3: ; 192e9 (6:52e9) ld [wPewterCityCurScript], a ret -PewterCityScript4: ; 19305 (6:5305) +PewterCityScript4: ld a, [wNPCMovementScriptPointerTableNum] and a ret nz @@ -144,7 +144,7 @@ PewterCityScript4: ; 19305 (6:5305) ld [wPewterCityCurScript], a ret -MovementData_PewterGymGuyExit: ; 19353 (6:5353) +MovementData_PewterGymGuyExit: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT @@ -152,7 +152,7 @@ MovementData_PewterGymGuyExit: ; 19353 (6:5353) db NPC_MOVEMENT_RIGHT db $FF -PewterCityScript5: ; 19359 (6:5359) +PewterCityScript5: ld a, [wd730] bit 0, a ret nz @@ -163,7 +163,7 @@ PewterCityScript5: ; 19359 (6:5359) ld [wPewterCityCurScript], a ret -PewterCityScript6: ; 1936f (6:536f) +PewterCityScript6: ld a, $5 ld [wSpriteIndex], a call SetSpritePosition2 @@ -176,7 +176,7 @@ PewterCityScript6: ; 1936f (6:536f) ld [wPewterCityCurScript], a ret -PewterCityTextPointers: ; 1938b (6:538b) +PewterCityTextPointers: dw PewterCityText1 dw PewterCityText2 dw PewterCityText3 @@ -192,15 +192,15 @@ PewterCityTextPointers: ; 1938b (6:538b) dw PewterCityText13 dw PewterCityText14 -PewterCityText1: ; 193a7 (6:53a7) +PewterCityText1: TX_FAR _PewterCityText1 db "@" -PewterCityText2: ; 193ac (6:53ac) +PewterCityText2: TX_FAR _PewterCityText2 db "@" -PewterCityText3: ; 193b1 (6:53b1) +PewterCityText3: TX_ASM ld hl, PewterCityText_193f1 call PrintText @@ -230,23 +230,23 @@ PewterCityText3: ; 193b1 (6:53b1) .asm_193ee jp TextScriptEnd -PewterCityText_193f1: ; 193f1 (6:53f1) +PewterCityText_193f1: TX_FAR _PewterCityText_193f1 db "@" -PewterCityText_193f6: ; 193f6 (6:53f6) +PewterCityText_193f6: TX_FAR _PewterCityText_193f6 db "@" -PewterCityText_193fb: ; 193fb (6:53fb) +PewterCityText_193fb: TX_FAR _PewterCityText_193fb db "@" -PewterCityText13: ; 19400 (6:5400) +PewterCityText13: TX_FAR _PewterCityText13 db "@" -PewterCityText4: ; 19405 (6:5405) +PewterCityText4: TX_ASM ld hl, PewterCityText_19427 call PrintText @@ -263,19 +263,19 @@ PewterCityText4: ; 19405 (6:5405) .asm_19424 jp TextScriptEnd -PewterCityText_19427: ; 19427 (6:5427) +PewterCityText_19427: TX_FAR _PewterCityText_19427 db "@" -PewterCityText_1942c: ; 1942c (6:542c) +PewterCityText_1942c: TX_FAR _PewterCityText_1942c db "@" -PewterCityText_19431: ; 19431 (6:5431) +PewterCityText_19431: TX_FAR _PewterCityText_19431 db "@" -PewterCityText5: ; 19436 (6:5436) +PewterCityText5: TX_ASM ld hl, PewterCityText_1945d call PrintText @@ -293,32 +293,32 @@ PewterCityText5: ; 19436 (6:5436) ld [wPewterCityCurScript], a jp TextScriptEnd -PewterCityText_1945d: ; 1945d (6:545d) +PewterCityText_1945d: TX_FAR _PewterCityText_1945d db "@" -PewterCityText14: ; 19462 (6:5462) +PewterCityText14: -PewterCityText_19462: ; 19462 (6:5462) +PewterCityText_19462: TX_FAR _PewterCityText_19462 db "@" -PewterCityText6: ; 19467 (6:5467) +PewterCityText6: TX_FAR _PewterCityText6 db "@" -PewterCityText7: ; 1946c (6:546c) +PewterCityText7: TX_FAR _PewterCityText7 db "@" -PewterCityText10: ; 19471 (6:5471) +PewterCityText10: TX_FAR _PewterCityText10 db "@" -PewterCityText11: ; 19476 (6:5476) +PewterCityText11: TX_FAR _PewterCityText11 db "@" -PewterCityText12: ; 1947b (6:547b) +PewterCityText12: TX_FAR _PewterCityText12 db "@" diff --git a/scripts/pewtergym.asm b/scripts/pewtergym.asm index 444f5d87..6014cf33 100755 --- a/scripts/pewtergym.asm +++ b/scripts/pewtergym.asm @@ -1,4 +1,4 @@ -PewterGymScript: ; 5c387 (17:4387) +PewterGymScript: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] @@ -11,38 +11,38 @@ PewterGymScript: ; 5c387 (17:4387) ld [wPewterGymCurScript], a ret -PewterGymScript_5c3a4: ; 5c3a4 (17:43a4) +PewterGymScript_5c3a4: ld hl, Gym1CityName ld de, Gym1LeaderName call LoadGymLeaderAndCityName ret -Gym1CityName: ; 5c3ad (17:43ad) +Gym1CityName: db "PEWTER CITY@" -Gym1LeaderName: ; 5c3b9 (17:43b9) +Gym1LeaderName: db "BROCK@" -PewterGymScript_5c3bf: ; 5c3bf (17:43bf) +PewterGymScript_5c3bf: xor a ld [wJoyIgnore], a ld [wPewterGymCurScript], a ld [wCurMapScript], a ret -PewterGymScriptPointers: ; 5c3ca (17:43ca) +PewterGymScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw PewterGymScript3 -PewterGymScript3: ; 5c3d2 (17:43d2) +PewterGymScript3: ld a, [wIsInBattle] cp $ff jp z, PewterGymScript_5c3bf ld a, $f0 ld [wJoyIgnore], a -PewterGymScript_5c3df: ; 5c3df (17:43df) +PewterGymScript_5c3df: ld a, $4 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -80,7 +80,7 @@ PewterGymScript_5c3df: ; 5c3df (17:43df) jp PewterGymScript_5c3bf -PewterGymTextPointers: ; 5c435 (17:4435) +PewterGymTextPointers: dw PewterGymText1 dw PewterGymText2 dw PewterGymText3 @@ -88,8 +88,8 @@ PewterGymTextPointers: ; 5c435 (17:4435) dw PewterGymText5 dw PewterGymText6 -PewterGymTrainerHeaders: ; 5c441 (17:4441) -PewterGymTrainerHeader0: ; 5c441 (17:4441) +PewterGymTrainerHeaders: +PewterGymTrainerHeader0: dbEventFlagBit EVENT_BEAT_PEWTER_GYM_TRAINER_0 db ($5 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_PEWTER_GYM_TRAINER_0 @@ -100,7 +100,7 @@ PewterGymTrainerHeader0: ; 5c441 (17:4441) db $ff -PewterGymText1: ; 5c44e (17:444e) +PewterGymText1: TX_ASM CheckEvent EVENT_BEAT_BROCK jr z, .asm_5c46a @@ -136,53 +136,53 @@ PewterGymText1: ; 5c44e (17:444e) .asm_5c49b jp TextScriptEnd -PewterGymText_5c49e: ; 5c49e (17:449e) +PewterGymText_5c49e: TX_FAR _PewterGymText_5c49e db "@" -PewterGymText_5c4a3: ; 5c4a3 (17:44a3) +PewterGymText_5c4a3: TX_FAR _PewterGymText_5c4a3 db "@" -PewterGymText4: ; 5c4a8 (17:44a8) +PewterGymText4: TX_FAR _TM34PreReceiveText db "@" -PewterGymText5: ; 5c4ad (17:44ad) +PewterGymText5: TX_FAR _ReceivedTM34Text TX_SFX_ITEM TX_FAR _TM34ExplanationText db "@" -PewterGymText6: ; 5c4b7 (17:44b7) +PewterGymText6: TX_FAR _TM34NoRoomText db "@" -PewterGymText_5c4bc: ; 5c4bc (17:44bc) +PewterGymText_5c4bc: TX_FAR _PewterGymText_5c4bc TX_SFX_ITEM TX_FAR _PewterGymText_5c4c1 db "@" -PewterGymText2: ; 5c4c6 (17:44c6) +PewterGymText2: TX_ASM ld hl, PewterGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd -PewterGymBattleText1: ; 5c4d0 (17:44d0) +PewterGymBattleText1: TX_FAR _PewterGymBattleText1 db "@" -PewterGymEndBattleText1: ; 5c4d5 (17:44d5) +PewterGymEndBattleText1: TX_FAR _PewterGymEndBattleText1 db "@" -PewterGymAfterBattleText1: ; 5c4da (17:44da) +PewterGymAfterBattleText1: TX_FAR _PewterGymAfterBattleText1 db "@" -PewterGymText3: ; 5c4df (17:44df) +PewterGymText3: TX_ASM ld a, [wBeatGymFlags] bit 0, a @@ -217,23 +217,23 @@ PewterGymText3: ; 5c4df (17:44df) call PrintText jp TextScriptEnd -PewterGymText_5c515: ; 5c515 (17:4515) +PewterGymText_5c515: TX_FAR _PewterGymText_5c515 db "@" -PewterGymText_5c51a: ; 5c51a (17:451a) +PewterGymText_5c51a: TX_FAR _PewterGymText_5c51a db "@" -PewterGymText_5c51f: ; 5c51f (17:451f) +PewterGymText_5c51f: TX_FAR _PewterGymText_5c51f db "@" -PewterGymText_5c524: ; 5c524 (17:4524) +PewterGymText_5c524: TX_FAR _PewterGymText_5c524 db "@" -PewterGymText_5c529: ; 5c529 (17:4529) +PewterGymText_5c529: TX_FAR _PewterGymText_5c529 db "@" diff --git a/scripts/pewterhouse1.asm b/scripts/pewterhouse1.asm index a825b303..ba0f631f 100755 --- a/scripts/pewterhouse1.asm +++ b/scripts/pewterhouse1.asm @@ -1,13 +1,13 @@ -PewterHouse1Script: ; 1d5f3 (7:55f3) +PewterHouse1Script: call EnableAutoTextBoxDrawing ret -PewterHouse1TextPointers: ; 1d5f6 (7:55f6) +PewterHouse1TextPointers: dw PewterHouse1Text1 dw PewterHouse1Text2 dw PewterHouse1Text3 -PewterHouse1Text1: ; 1d5fc (7:55fc) +PewterHouse1Text1: TX_FAR _PewterHouse1Text1 TX_ASM ld a, NIDORAN_M @@ -15,10 +15,10 @@ PewterHouse1Text1: ; 1d5fc (7:55fc) call WaitForSoundToFinish jp TextScriptEnd -PewterHouse1Text2: ; 1d60c (7:560c) +PewterHouse1Text2: TX_FAR _PewterHouse1Text2 db "@" -PewterHouse1Text3: ; 1d611 (7:5611) +PewterHouse1Text3: TX_FAR _PewterHouse1Text3 db "@" diff --git a/scripts/pewterhouse2.asm b/scripts/pewterhouse2.asm index 92e40de2..e3bbe01e 100755 --- a/scripts/pewterhouse2.asm +++ b/scripts/pewterhouse2.asm @@ -1,14 +1,14 @@ -PewterHouse2Script: ; 1d648 (7:5648) +PewterHouse2Script: jp EnableAutoTextBoxDrawing -PewterHouse2TextPointers: ; 1d64b (7:564b) +PewterHouse2TextPointers: dw PewterHouse2Text1 dw PewterHouse2Text2 -PewterHouse2Text1: ; 1d64f (7:564f) +PewterHouse2Text1: TX_FAR _PewterHouse2Text1 db "@" -PewterHouse2Text2: ; 1d654 (7:5654) +PewterHouse2Text2: TX_FAR _PewterHouse2Text2 db "@" diff --git a/scripts/pewtermart.asm b/scripts/pewtermart.asm index 62831d1b..33a0a4c2 100755 --- a/scripts/pewtermart.asm +++ b/scripts/pewtermart.asm @@ -1,30 +1,30 @@ -PewterMartScript: ; 74cad (1d:4cad) +PewterMartScript: call EnableAutoTextBoxDrawing ld a, $1 ld [wAutoTextBoxDrawingControl], a ret -PewterMartTextPointers: ; 74cb6 (1d:4cb6) +PewterMartTextPointers: dw PewterMartText1 dw PewterMartText2 dw PewterMartText3 -PewterMartText2: ; 74cbc (1d:4cbc) +PewterMartText2: TX_ASM ld hl, PewterMartText_74cc6 call PrintText jp TextScriptEnd -PewterMartText_74cc6: ; 74cc6 (1d:4cc6) +PewterMartText_74cc6: TX_FAR _PewterMartText_74cc6 db "@" -PewterMartText3: ; 74ccb (1d:4ccb) +PewterMartText3: TX_ASM ld hl, PewterMartText_74cd5 call PrintText jp TextScriptEnd -PewterMartText_74cd5: ; 74cd5 (1d:4cd5) +PewterMartText_74cd5: TX_FAR _PewterMartText_74cd5 db "@" diff --git a/scripts/pewterpokecenter.asm b/scripts/pewterpokecenter.asm index 70cf17f6..2d7f8713 100755 --- a/scripts/pewterpokecenter.asm +++ b/scripts/pewterpokecenter.asm @@ -1,11 +1,11 @@ -PewterPokecenterScript: ; 5c587 (17:4587) - ld hl, wPreventBlackout +PewterPokecenterScript: + ld hl, wd492 set 7, [hl] call Serial_TryEstablishingExternallyClockedConnection call EnableAutoTextBoxDrawing ret -PewterPokecenterTextPointers: ; 5c58d (17:458d) +PewterPokecenterTextPointers: dw PewterPokecenterText1 dw PewterPokecenterText2 dw PewterPokecenterText3 @@ -13,22 +13,22 @@ PewterPokecenterTextPointers: ; 5c58d (17:458d) dw PewterPokecenterText5 dw PewterPokecenterText6 -PewterPokecenterText1: ; 5c595 (17:4595) +PewterPokecenterText1: TX_POKECENTER_NURSE -PewterPokecenterText2: ; 5c596 (17:4596) +PewterPokecenterText2: TX_FAR _PewterPokecenterText1 db "@" -PewterPokecenterText3: ; 5c59b (17:459b) +PewterPokecenterText3: TX_ASM callba Func_f1da4 jp TextScriptEnd -PewterPokecenterText4: ; 5c60c (17:460c) +PewterPokecenterText4: TX_CABLE_CLUB_RECEPTIONIST -PewterPokecenterText5: ; 5c603 (17:4603) +PewterPokecenterText5: TX_ASM callba Func_f1d98 jp TextScriptEnd diff --git a/scripts/pewterpokecenter2.asm b/scripts/pewterpokecenter2.asm index c884ad65..e424071a 100755 --- a/scripts/pewterpokecenter2.asm +++ b/scripts/pewterpokecenter2.asm @@ -55,7 +55,7 @@ Func_f1da4: ld a, [wd472] bit 7, a ret z - callab Func_fce73 + callab CheckPikachuFaintedOrStatused ret c call DisablePikachuFollowingPlayer ret diff --git a/scripts/pokemontower1.asm b/scripts/pokemontower1.asm index 99b8efef..1209b875 100755 --- a/scripts/pokemontower1.asm +++ b/scripts/pokemontower1.asm @@ -1,30 +1,30 @@ -PokemonTower1Script: ; 6042c (18:442c) +PokemonTower1Script: call EnableAutoTextBoxDrawing ret -PokemonTower1TextPointers: ; 6042f (18:442f) +PokemonTower1TextPointers: dw PokemonTower1Text1 dw PokemonTower1Text2 dw PokemonTower1Text3 dw PokemonTower1Text4 dw PokemonTower1Text5 -PokemonTower1Text1: ; 60439 (18:4439) +PokemonTower1Text1: TX_FAR _PokemonTower1Text1 db "@" -PokemonTower1Text2: ; 6043e (18:443e) +PokemonTower1Text2: TX_FAR _PokemonTower1Text2 db "@" -PokemonTower1Text3: ; 60443 (18:4443) +PokemonTower1Text3: TX_FAR _PokemonTower1Text3 db "@" -PokemonTower1Text4: ; 60448 (18:4448) +PokemonTower1Text4: TX_FAR _PokemonTower1Text4 db "@" -PokemonTower1Text5: ; 6044d (18:444d) +PokemonTower1Text5: TX_FAR _PokemonTower1Text5 db "@" diff --git a/scripts/pokemontower2.asm b/scripts/pokemontower2.asm index 5e6a429d..0a0aa3d5 100755 --- a/scripts/pokemontower2.asm +++ b/scripts/pokemontower2.asm @@ -1,22 +1,22 @@ -PokemonTower2Script: ; 604f2 (18:44f2) +PokemonTower2Script: call EnableAutoTextBoxDrawing ld hl, PokemonTower2ScriptPointers ld a, [wPokemonTower2CurScript] jp JumpTable -PokemonTower2Script_604fe: ; 604fe (18:44fe) +PokemonTower2Script_604fe: xor a ld [wJoyIgnore], a ld [wPokemonTower2CurScript], a ld [wCurMapScript], a ret -PokemonTower2ScriptPointers: ; 60509 (18:4509) +PokemonTower2ScriptPointers: dw PokemonTower2Script0 dw PokemonTower2Script1 dw PokemonTower2Script2 -PokemonTower2Script0: ; 6050f (18:450f) +PokemonTower2Script0: CheckEvent EVENT_BEAT_POKEMON_TOWER_RIVAL ret nz ld hl, CoordsData_6055e @@ -51,12 +51,12 @@ PokemonTower2Script0: ; 6050f (18:450f) ld [hJoyPressed], a ret -CoordsData_6055e: ; 6055e (18:455e) +CoordsData_6055e: db $05,$0F db $06,$0E db $0F ; isn't this supposed to end in $ff? -PokemonTower2Script1: ; 60563 (18:4563) +PokemonTower2Script1: ld a, [wIsInBattle] cp $ff jp z, PokemonTower2Script_604fe @@ -82,7 +82,7 @@ PokemonTower2Script1: ; 60563 (18:4563) ld [wCurMapScript], a ret -MovementData_605a9: ; 605a9 (18:45a9) +MovementData_605a9: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN @@ -93,7 +93,7 @@ MovementData_605a9: ; 605a9 (18:45a9) db NPC_MOVEMENT_RIGHT db $FF -MovementData_605b2: ; 605b2 (18:45b2) +MovementData_605b2: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_RIGHT @@ -104,7 +104,7 @@ MovementData_605b2: ; 605b2 (18:45b2) db NPC_MOVEMENT_DOWN db $FF -PokemonTower2Script2: ; 605bb (18:45bb) +PokemonTower2Script2: ld a, [wd730] bit 0, a ret nz @@ -119,11 +119,11 @@ PokemonTower2Script2: ; 605bb (18:45bb) ld [wCurMapScript], a ret -PokemonTower2TextPointers: ; 605db (18:45db) +PokemonTower2TextPointers: dw PokemonTower2Text1 dw PokemonTower2Text2 -PokemonTower2Text1: ; 605df (18:45df) +PokemonTower2Text1: TX_ASM CheckEvent EVENT_BEAT_POKEMON_TOWER_RIVAL jr z, .asm_16f24 @@ -151,22 +151,22 @@ PokemonTower2Text1: ; 605df (18:45df) .asm_41852 jp TextScriptEnd -PokemonTower2Text_6062d: ; 6062d (18:462d) +PokemonTower2Text_6062d: TX_FAR _PokemonTower2Text_6062d db "@" -PokemonTower2Text_60632: ; 60632 (18:4632) +PokemonTower2Text_60632: TX_FAR _PokemonTower2Text_60632 db "@" -PokemonTower2Text_60637: ; 60637 (18:4637) +PokemonTower2Text_60637: TX_FAR _PokemonTower2Text_60637 db "@" -PokemonTower2Text_6063c: ; 6063c (18:463c) +PokemonTower2Text_6063c: TX_FAR _PokemonTower2Text_6063c db "@" -PokemonTower2Text2: ; 60641 (18:4641) +PokemonTower2Text2: TX_FAR _PokemonTower2Text2 db "@" diff --git a/scripts/pokemontower3.asm b/scripts/pokemontower3.asm index 0c3c6639..8be15c9e 100755 --- a/scripts/pokemontower3.asm +++ b/scripts/pokemontower3.asm @@ -1,4 +1,4 @@ -PokemonTower3Script: ; 606cc (18:46cc) +PokemonTower3Script: call EnableAutoTextBoxDrawing ld hl, PokemonTower3TrainerHeaders ld de, PokemonTower3ScriptPointers @@ -7,19 +7,19 @@ PokemonTower3Script: ; 606cc (18:46cc) ld [wPokemonTower3CurScript], a ret -PokemonTower3ScriptPointers: ; 606df (18:46df) +PokemonTower3ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -PokemonTower3TextPointers: ; 606e5 (18:46e5) +PokemonTower3TextPointers: dw PokemonTower3Text1 dw PokemonTower3Text2 dw PokemonTower3Text3 dw PickUpItemText -PokemonTower3TrainerHeaders: ; 606ed (18:46ed) -PokemonTower3TrainerHeader0: ; 606ed (18:46ed) +PokemonTower3TrainerHeaders: +PokemonTower3TrainerHeader0: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_0 @@ -28,7 +28,7 @@ PokemonTower3TrainerHeader0: ; 606ed (18:46ed) dw PokemonTower3EndBattleText1 ; TextEndBattle dw PokemonTower3EndBattleText1 ; TextEndBattle -PokemonTower3TrainerHeader1: ; 606f9 (18:46f9) +PokemonTower3TrainerHeader1: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_1 @@ -37,7 +37,7 @@ PokemonTower3TrainerHeader1: ; 606f9 (18:46f9) dw PokemonTower3EndBattleText2 ; TextEndBattle dw PokemonTower3EndBattleText2 ; TextEndBattle -PokemonTower3TrainerHeader2: ; 60705 (18:4705) +PokemonTower3TrainerHeader2: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_3_TRAINER_2 @@ -47,56 +47,56 @@ PokemonTower3TrainerHeader2: ; 60705 (18:4705) dw PokemonTower3EndBattleText3 ; TextEndBattle db $ff -PokemonTower3Text1: ; 60712 (18:4712) +PokemonTower3Text1: TX_ASM ld hl, PokemonTower3TrainerHeader0 call TalkToTrainer jp TextScriptEnd -PokemonTower3Text2: ; 6071c (18:471c) +PokemonTower3Text2: TX_ASM ld hl, PokemonTower3TrainerHeader1 call TalkToTrainer jp TextScriptEnd -PokemonTower3Text3: ; 60726 (18:4726) +PokemonTower3Text3: TX_ASM ld hl, PokemonTower3TrainerHeader2 call TalkToTrainer jp TextScriptEnd -PokemonTower3BattleText1: ; 60730 (18:4730) +PokemonTower3BattleText1: TX_FAR _PokemonTower3BattleText1 db "@" -PokemonTower3EndBattleText1: ; 60735 (18:4735) +PokemonTower3EndBattleText1: TX_FAR _PokemonTower3EndBattleText1 db "@" -PokemonTower3AfterBattleText1: ; 6073a (18:473a) +PokemonTower3AfterBattleText1: TX_FAR _PokemonTower3AfterBattleText1 db "@" -PokemonTower3BattleText2: ; 6073f (18:473f) +PokemonTower3BattleText2: TX_FAR _PokemonTower3BattleText2 db "@" -PokemonTower3EndBattleText2: ; 60744 (18:4744) +PokemonTower3EndBattleText2: TX_FAR _PokemonTower3EndBattleText2 db "@" -PokemonTower3AfterBattleText2: ; 60749 (18:4749) +PokemonTower3AfterBattleText2: TX_FAR _PokemonTower3AfterBattleText2 db "@" -PokemonTower3BattleText3: ; 6074e (18:474e) +PokemonTower3BattleText3: TX_FAR _PokemonTower3BattleText3 db "@" -PokemonTower3EndBattleText3: ; 60753 (18:4753) +PokemonTower3EndBattleText3: TX_FAR _PokemonTower3EndBattleText3 db "@" -PokemonTower3AfterBattleText3: ; 60758 (18:4758) +PokemonTower3AfterBattleText3: TX_FAR _PokemonTower3AfterBattleText3 db "@" diff --git a/scripts/pokemontower4.asm b/scripts/pokemontower4.asm index bd4cda11..fe7a4e08 100755 --- a/scripts/pokemontower4.asm +++ b/scripts/pokemontower4.asm @@ -1,4 +1,4 @@ -PokemonTower4Script: ; 607f6 (18:47f6) +PokemonTower4Script: call EnableAutoTextBoxDrawing ld hl, PokemonTower4TrainerHeaders ld de, PokemonTower4ScriptPointers @@ -7,12 +7,12 @@ PokemonTower4Script: ; 607f6 (18:47f6) ld [wPokemonTower4CurScript], a ret -PokemonTower4ScriptPointers: ; 60809 (18:4809) +PokemonTower4ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -PokemonTower4TextPointers: ; 6080f (18:480f) +PokemonTower4TextPointers: dw PokemonTower4Text1 dw PokemonTower4Text2 dw PokemonTower4Text3 @@ -20,8 +20,8 @@ PokemonTower4TextPointers: ; 6080f (18:480f) dw PickUpItemText dw PickUpItemText -PokemonTower4TrainerHeaders: ; 6081b (18:481b) -PokemonTower4TrainerHeader0: ; 6081b (18:481b) +PokemonTower4TrainerHeaders: +PokemonTower4TrainerHeader0: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_0 @@ -30,7 +30,7 @@ PokemonTower4TrainerHeader0: ; 6081b (18:481b) dw PokemonTower4EndBattleText1 ; TextEndBattle dw PokemonTower4EndBattleText1 ; TextEndBattle -PokemonTower4TrainerHeader1: ; 60827 (18:4827) +PokemonTower4TrainerHeader1: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_1 @@ -39,7 +39,7 @@ PokemonTower4TrainerHeader1: ; 60827 (18:4827) dw PokemonTower4EndBattleText2 ; TextEndBattle dw PokemonTower4EndBattleText2 ; TextEndBattle -PokemonTower4TrainerHeader2: ; 60833 (18:4833) +PokemonTower4TrainerHeader2: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_4_TRAINER_2 @@ -50,56 +50,56 @@ PokemonTower4TrainerHeader2: ; 60833 (18:4833) db $ff -PokemonTower4Text1: ; 60840 (18:4840) +PokemonTower4Text1: TX_ASM ld hl, PokemonTower4TrainerHeader0 call TalkToTrainer jp TextScriptEnd -PokemonTower4Text2: ; 6084a (18:484a) +PokemonTower4Text2: TX_ASM ld hl, PokemonTower4TrainerHeader1 call TalkToTrainer jp TextScriptEnd -PokemonTower4Text3: ; 60854 (18:4854) +PokemonTower4Text3: TX_ASM ld hl, PokemonTower4TrainerHeader2 call TalkToTrainer jp TextScriptEnd -PokemonTower4BattleText1: ; 6085e (18:485e) +PokemonTower4BattleText1: TX_FAR _PokemonTower4BattleText1 db "@" -PokemonTower4EndBattleText1: ; 60863 (18:4863) +PokemonTower4EndBattleText1: TX_FAR _PokemonTower4EndBattleText1 db "@" -PokemonTower4AfterBattleText1: ; 60868 (18:4868) +PokemonTower4AfterBattleText1: TX_FAR _PokemonTower4AfterBattleText1 db "@" -PokemonTower4BattleText2: ; 6086d (18:486d) +PokemonTower4BattleText2: TX_FAR _PokemonTower4BattleText2 db "@" -PokemonTower4EndBattleText2: ; 60872 (18:4872) +PokemonTower4EndBattleText2: TX_FAR _PokemonTower4EndBattleText2 db "@" -PokemonTower4AfterBattleText2: ; 60877 (18:4877) +PokemonTower4AfterBattleText2: TX_FAR _PokemonTower4AfterBattleText2 db "@" -PokemonTower4BattleText3: ; 6087c (18:487c) +PokemonTower4BattleText3: TX_FAR _PokemonTower4BattleText3 db "@" -PokemonTower4EndBattleText3: ; 60881 (18:4881) +PokemonTower4EndBattleText3: TX_FAR _PokemonTower4EndBattleText3 db "@" -PokemonTower4AfterBattleText3: ; 60886 (18:4886) +PokemonTower4AfterBattleText3: TX_FAR _PokemonTower4AfterBattleText3 db "@" diff --git a/scripts/pokemontower5.asm b/scripts/pokemontower5.asm index 6a2f5758..82b912b5 100755 --- a/scripts/pokemontower5.asm +++ b/scripts/pokemontower5.asm @@ -1,4 +1,4 @@ -PokemonTower5Script: ; 60932 (18:4932) +PokemonTower5Script: call EnableAutoTextBoxDrawing ld hl, PokemonTower5TrainerHeaders ld de, PokemonTower5ScriptPointers @@ -7,12 +7,12 @@ PokemonTower5Script: ; 60932 (18:4932) ld [wPokemonTower5CurScript], a ret -PokemonTower5ScriptPointers: ; 60945 (18:4945) +PokemonTower5ScriptPointers: dw PokemonTower5Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -PokemonTower5Script0: ; 6094b (18:494b) +PokemonTower5Script0: ld hl, CoordsData_60992 call ArePlayerCoordsInArray jr c, .asm_60960 @@ -41,14 +41,14 @@ PokemonTower5Script0: ; 6094b (18:494b) ld [wJoyIgnore], a ret -CoordsData_60992: ; 60992 (18:4992) +CoordsData_60992: db $08,$0A db $08,$0B db $09,$0A db $09,$0B db $FF -PokemonTower5TextPointers: ; 6099b (18:499b) +PokemonTower5TextPointers: dw PokemonTower5Text1 dw PokemonTower5Text2 dw PokemonTower5Text3 @@ -57,8 +57,8 @@ PokemonTower5TextPointers: ; 6099b (18:499b) dw PickUpItemText dw PokemonTower5Text7 -PokemonTower5TrainerHeaders: ; 609a9 (18:49a9) -PokemonTower5TrainerHeader0: ; 609a9 (18:49a9) +PokemonTower5TrainerHeaders: +PokemonTower5TrainerHeader0: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_0 @@ -67,7 +67,7 @@ PokemonTower5TrainerHeader0: ; 609a9 (18:49a9) dw PokemonTower5EndBattleText1 ; TextEndBattle dw PokemonTower5EndBattleText1 ; TextEndBattle -PokemonTower5TrainerHeader1: ; 609b5 (18:49b5) +PokemonTower5TrainerHeader1: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_1 @@ -76,7 +76,7 @@ PokemonTower5TrainerHeader1: ; 609b5 (18:49b5) dw PokemonTower5EndBattleText2 ; TextEndBattle dw PokemonTower5EndBattleText2 ; TextEndBattle -PokemonTower5TrainerHeader2: ; 609c1 (18:49c1) +PokemonTower5TrainerHeader2: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_2 @@ -85,7 +85,7 @@ PokemonTower5TrainerHeader2: ; 609c1 (18:49c1) dw PokemonTower5EndBattleText3 ; TextEndBattle dw PokemonTower5EndBattleText3 ; TextEndBattle -PokemonTower5TrainerHeader3: ; 609cd (18:49cd) +PokemonTower5TrainerHeader3: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_5_TRAINER_3 @@ -96,82 +96,82 @@ PokemonTower5TrainerHeader3: ; 609cd (18:49cd) db $ff -PokemonTower5Text1: ; 609da (18:49da) +PokemonTower5Text1: TX_FAR _PokemonTower5Text1 db "@" -PokemonTower5Text2: ; 609df (18:49df) +PokemonTower5Text2: TX_ASM ld hl, PokemonTower5TrainerHeader0 call TalkToTrainer jp TextScriptEnd -PokemonTower5BattleText1: ; 609e9 (18:49e9) +PokemonTower5BattleText1: TX_FAR _PokemonTower5BattleText1 db "@" -PokemonTower5EndBattleText1: ; 609ee (18:49ee) +PokemonTower5EndBattleText1: TX_FAR _PokemonTower5EndBattleText1 db "@" -PokemonTower5AfterBattleText1: ; 609f3 (18:49f3) +PokemonTower5AfterBattleText1: TX_FAR _PokemonTower5AfterBattleText1 db "@" -PokemonTower5Text3: ; 609f8 (18:49f8) +PokemonTower5Text3: TX_ASM ld hl, PokemonTower5TrainerHeader1 call TalkToTrainer jp TextScriptEnd -PokemonTower5BattleText2: ; 60a02 (18:4a02) +PokemonTower5BattleText2: TX_FAR _PokemonTower5BattleText2 db "@" -PokemonTower5EndBattleText2: ; 60a07 (18:4a07) +PokemonTower5EndBattleText2: TX_FAR _PokemonTower5EndBattleText2 db "@" -PokemonTower5AfterBattleText2: ; 60a0c (18:4a0c) +PokemonTower5AfterBattleText2: TX_FAR _PokemonTower5AfterBattleText2 db "@" -PokemonTower5Text4: ; 60a11 (18:4a11) +PokemonTower5Text4: TX_ASM ld hl, PokemonTower5TrainerHeader2 call TalkToTrainer jp TextScriptEnd -PokemonTower5BattleText3: ; 60a1b (18:4a1b) +PokemonTower5BattleText3: TX_FAR _PokemonTower5BattleText3 db "@" -PokemonTower5EndBattleText3: ; 60a20 (18:4a20) +PokemonTower5EndBattleText3: TX_FAR _PokemonTower5EndBattleText3 db "@" -PokemonTower5AfterBattleText3: ; 60a25 (18:4a25) +PokemonTower5AfterBattleText3: TX_FAR _PokemonTower5AfterBattleText3 db "@" -PokemonTower5Text5: ; 60a2a (18:4a2a) +PokemonTower5Text5: TX_ASM ld hl, PokemonTower5TrainerHeader3 call TalkToTrainer jp TextScriptEnd -PokemonTower5BattleText4: ; 60a34 (18:4a34) +PokemonTower5BattleText4: TX_FAR _PokemonTower5BattleText4 db "@" -PokemonTower5EndBattleText4: ; 60a39 (18:4a39) +PokemonTower5EndBattleText4: TX_FAR _PokemonTower5EndBattleText4 db "@" -PokemonTower5AfterBattleText4: ; 60a3e (18:4a3e) +PokemonTower5AfterBattleText4: TX_FAR _PokemonTower5AfterBattleText4 db "@" -PokemonTower5Text7: ; 60a43 (18:4a43) +PokemonTower5Text7: TX_FAR _PokemonTower5Text7 db "@" diff --git a/scripts/pokemontower6.asm b/scripts/pokemontower6.asm index 7bae81ea..82c39a41 100755 --- a/scripts/pokemontower6.asm +++ b/scripts/pokemontower6.asm @@ -1,4 +1,4 @@ -PokemonTower6Script: ; 60aef (18:4aef) +PokemonTower6Script: call EnableAutoTextBoxDrawing ld hl, PokemonTower6TrainerHeaders ld de, PokemonTower6ScriptPointers @@ -7,21 +7,21 @@ PokemonTower6Script: ; 60aef (18:4aef) ld [wPokemonTower6CurScript], a ret -PokemonTower6Script_60b02: ; 60b02 (18:4b02) +PokemonTower6Script_60b02: xor a ld [wJoyIgnore], a ld [wPokemonTower6CurScript], a ld [wCurMapScript], a ret -PokemonTower6ScriptPointers: ; 60b0d (18:4b0d) +PokemonTower6ScriptPointers: dw PokemonTower6Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw PokemonTower6Script3 dw PokemonTower6Script4 -PokemonTower6Script0: ; 60b17 (18:4b17) +PokemonTower6Script0: CheckEvent EVENT_BEAT_GHOST_MAROWAK jp nz, CheckFightingMapTrainers ld hl, CoordsData_60b45 @@ -41,10 +41,10 @@ PokemonTower6Script0: ; 60b17 (18:4b17) ld [wCurMapScript], a ret -CoordsData_60b45: ; 60b45 (18:4b45) +CoordsData_60b45: db $10,$0A,$FF -PokemonTower6Script4: ; 60b48 (18:4b48) +PokemonTower6Script4: ld a, [wIsInBattle] cp $ff jp z, PokemonTower6Script_60b02 @@ -84,7 +84,7 @@ PokemonTower6Script4: ; 60b48 (18:4b48) ld [wCurMapScript], a ret -PokemonTower6Script3: ; 60ba1 (18:4ba1) +PokemonTower6Script3: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -94,7 +94,7 @@ PokemonTower6Script3: ; 60ba1 (18:4ba1) ld [wCurMapScript], a ret -PokemonTower6TextPointers: ; 60bb1 (18:4bb1) +PokemonTower6TextPointers: dw PokemonTower6Text1 dw PokemonTower6Text2 dw PokemonTower6Text3 @@ -103,8 +103,8 @@ PokemonTower6TextPointers: ; 60bb1 (18:4bb1) dw PokemonTower6Text6 dw PokemonTower6Text7 -PokemonTower6TrainerHeaders: ; 60bbf (18:4bbf) -PokemonTower6TrainerHeader0: ; 60bbf (18:4bbf) +PokemonTower6TrainerHeaders: +PokemonTower6TrainerHeader0: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_0 @@ -113,7 +113,7 @@ PokemonTower6TrainerHeader0: ; 60bbf (18:4bbf) dw PokemonTower6EndBattleText1 ; TextEndBattle dw PokemonTower6EndBattleText1 ; TextEndBattle -PokemonTower6TrainerHeader1: ; 60bcb (18:4bcb) +PokemonTower6TrainerHeader1: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_1 @@ -122,7 +122,7 @@ PokemonTower6TrainerHeader1: ; 60bcb (18:4bcb) dw PokemonTower6EndBattleText2 ; TextEndBattle dw PokemonTower6EndBattleText2 ; TextEndBattle -PokemonTower6TrainerHeader2: ; 60bd7 (18:4bd7) +PokemonTower6TrainerHeader2: dbEventFlagBit EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_POKEMONTOWER_6_TRAINER_2 @@ -133,25 +133,25 @@ PokemonTower6TrainerHeader2: ; 60bd7 (18:4bd7) db $ff -PokemonTower6Text1: ; 60be4 (18:4be4) +PokemonTower6Text1: TX_ASM ld hl, PokemonTower6TrainerHeader0 call TalkToTrainer jp TextScriptEnd -PokemonTower6Text2: ; 60bee (18:4bee) +PokemonTower6Text2: TX_ASM ld hl, PokemonTower6TrainerHeader1 call TalkToTrainer jp TextScriptEnd -PokemonTower6Text3: ; 60bf8 (18:4bf8) +PokemonTower6Text3: TX_ASM ld hl, PokemonTower6TrainerHeader2 call TalkToTrainer jp TextScriptEnd -PokemonTower6Text7: ; 60c02 (18:4c02) +PokemonTower6Text7: TX_ASM ld hl, PokemonTower2Text_60c1f call PrintText @@ -164,50 +164,50 @@ PokemonTower6Text7: ; 60c02 (18:4c02) call PrintText jp TextScriptEnd -PokemonTower2Text_60c1f: ; 60c1f (18:4c1f) +PokemonTower2Text_60c1f: TX_FAR _PokemonTower2Text_60c1f db "@" -PokemonTower2Text_60c24: ; 60c24 (18:4c24) +PokemonTower2Text_60c24: TX_FAR _PokemonTower2Text_60c24 db "@" -PokemonTower6BattleText1: ; 60c29 (18:4c29) +PokemonTower6BattleText1: TX_FAR _PokemonTower6BattleText1 db "@" -PokemonTower6EndBattleText1: ; 60c2e (18:4c2e) +PokemonTower6EndBattleText1: TX_FAR _PokemonTower6EndBattleText1 db "@" -PokemonTower6AfterBattleText1: ; 60c33 (18:4c33) +PokemonTower6AfterBattleText1: TX_FAR _PokemonTower6AfterBattleText1 db "@" -PokemonTower6BattleText2: ; 60c38 (18:4c38) +PokemonTower6BattleText2: TX_FAR _PokemonTower6BattleText2 db "@" -PokemonTower6EndBattleText2: ; 60c3d (18:4c3d) +PokemonTower6EndBattleText2: TX_FAR _PokemonTower6EndBattleText2 db "@" -PokemonTower6AfterBattleText2: ; 60c42 (18:4c42) +PokemonTower6AfterBattleText2: TX_FAR _PokemonTower6AfterBattleText2 db "@" -PokemonTower6BattleText3: ; 60c47 (18:4c47) +PokemonTower6BattleText3: TX_FAR _PokemonTower6BattleText3 db "@" -PokemonTower6EndBattleText3: ; 60c4c (18:4c4c) +PokemonTower6EndBattleText3: TX_FAR _PokemonTower6EndBattleText3 db "@" -PokemonTower6AfterBattleText3: ; 60c51 (18:4c51) +PokemonTower6AfterBattleText3: TX_FAR _PokemonTower6AfterBattleText3 db "@" -PokemonTower6Text6: ; 60c56 (18:4c56) +PokemonTower6Text6: TX_FAR _PokemonTower6Text6 db "@" diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index 49ecd5d9..9a016d84 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -1,11 +1,11 @@ -PokemonTower7Script: ; 60d05 (18:4d05) +PokemonTower7Script: call EnableAutoTextBoxDrawing ld hl, PokemonTower7ScriptPointers ld a, [wPokemonTower7CurScript] call JumpTable ret -PokemonTower7Script_60d01: ; 60d18 (18:4d18) +PokemonTower7Script_60d01: xor a ld [wJoyIgnore], a PokemonTower7Script_60d05: @@ -13,18 +13,18 @@ PokemonTower7Script_60d05: ret PokemonTower7ScriptPointers: - dw PokemonTower7Script0 ; $4d21 - dw PokemonTower7Script1 ; $4d7f - dw PokemonTower7Script2 ; $4d9e - dw PokemonTower7Script3 ; $4da9 - dw PokemonTower7Script4 ; $4dbf - dw PokemonTower7Script5 ; $4dde - dw PokemonTower7Script6 ; $4de9 - dw PokemonTower7Script7 ; $4e0e - dw PokemonTower7Script8 ; $4e34 - dw PokemonTower7Script9 ; $4e7a - dw PokemonTower7Script10 ; $4e9b - dw PokemonTower7Script11 ; $4ec7 + dw PokemonTower7Script0 + dw PokemonTower7Script1 + dw PokemonTower7Script2 + dw PokemonTower7Script3 + dw PokemonTower7Script4 + dw PokemonTower7Script5 + dw PokemonTower7Script6 + dw PokemonTower7Script7 + dw PokemonTower7Script8 + dw PokemonTower7Script9 + dw PokemonTower7Script10 + dw PokemonTower7Script11 PokemonTower7Script0: CheckEvent EVENT_BEAT_POKEMONTOWER_7_TRAINER_0 @@ -146,8 +146,8 @@ PokemonTower7Script7: ld hl, wd72d set 6, [hl] set 7, [hl] - ld hl, PokemonTower7JessieJamesEndBattleText ; 60f2c - ld de, PokemonTower7JessieJamesEndBattleText ; 60f2c + ld hl, PokemonTower7JessieJamesEndBattleText + ld de, PokemonTower7JessieJamesEndBattleText call SaveEndBattleTextPointers ld a, OPP_ROCKET ld [wCurOpponent], a @@ -235,7 +235,7 @@ PokemonTower7Script11: ld [wMissableObjectIndex], a predef HideObject ld a, SPRITE_FACING_UP - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, LAVENDER_HOUSE_1 ld [hWarpDestinationMap], a ld a, $1 diff --git a/scripts/redshouse1f.asm b/scripts/redshouse1f.asm index 602e8ecf..c302462d 100755 --- a/scripts/redshouse1f.asm +++ b/scripts/redshouse1f.asm @@ -1,17 +1,17 @@ -RedsHouse1FScript: ; 48168 (12:4168) +RedsHouse1FScript: call EnableAutoTextBoxDrawing ret -RedsHouse1FTextPointers: ; 4816b (12:416b) +RedsHouse1FTextPointers: dw RedsHouse1FText1 dw RedsHouse1FText2 -RedsHouse1FText1: ; 4816f (12:416f) Mom +RedsHouse1FText1: ; Mom TX_ASM callab Func_f1b73 jp TextScriptEnd -RedsHouse1FText2: ; 0x481c6 TV +RedsHouse1FText2: ; TV TX_ASM callab Func_f1bc4 jp TextScriptEnd diff --git a/scripts/redshouse1f2.asm b/scripts/redshouse1f2.asm index 0ddd22d6..871f2e31 100755 --- a/scripts/redshouse1f2.asm +++ b/scripts/redshouse1f2.asm @@ -6,11 +6,11 @@ Func_f1b73: call PrintText ret -MomWakeUpText: ; 48185 (12:4185) +MomWakeUpText: TX_FAR _MomWakeUpText db "@" -MomHealPokemon: ; 4818a (12:418a) +MomHealPokemon: ld hl, MomHealText1 call PrintText call GBFadeOutToWhite @@ -31,16 +31,16 @@ MomHealPokemon: ; 4818a (12:418a) call PrintText ret -MomHealText1: ; 481bc (12:41bc) +MomHealText1: TX_FAR _MomHealText1 db "@" -MomHealText2: ; 481c1 (12:41c1) +MomHealText2: TX_FAR _MomHealText2 db "@" Func_f1bc4: ld hl, TVWrongSideText - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP jp nz, .notUp ld hl, StandByMeText @@ -48,11 +48,11 @@ Func_f1bc4: call PrintText ret -StandByMeText: ; 481da (12:41da) +StandByMeText: TX_FAR _StandByMeText db "@" -TVWrongSideText: ; 481df (12:41df) +TVWrongSideText: TX_FAR _TVWrongSideText db "@" diff --git a/scripts/redshouse2f.asm b/scripts/redshouse2f.asm index 3a0421a6..0945e901 100755 --- a/scripts/redshouse2f.asm +++ b/scripts/redshouse2f.asm @@ -1,23 +1,23 @@ -RedsHouse2FScript: ; 5c0b0 (17:40b0) +RedsHouse2FScript: call EnableAutoTextBoxDrawing ld hl, RedsHouse2FScriptPointers ld a, 0 call JumpTable ret -RedsHouse2FScriptPointers: ; 5c0bc (17:40bc) +RedsHouse2FScriptPointers: dw RedsHouse2FScript0 dw RedsHouse2FScript1 dw RedsHouse2FScript2 dw RedsHouse2FScript3 dw RedsHouse2FScript4 -RedsHouse2FScript0: ; 5c0ce (17:40ce) -RedsHouse2FScript1: ; 5c0ce (17:40ce) -RedsHouse2FScript2: ; 5c0ce (17:40ce) -RedsHouse2FScript3: ; 5c0ce (17:40ce) -RedsHouse2FScript4: ; 5c0ce (17:40ce) +RedsHouse2FScript0: +RedsHouse2FScript1: +RedsHouse2FScript2: +RedsHouse2FScript3: +RedsHouse2FScript4: ret -RedsHouse2FTextPointers: ; 5c0cf (17:40cf) +RedsHouse2FTextPointers: db "@" diff --git a/scripts/rockethideout1.asm b/scripts/rockethideout1.asm index d821434d..35c9026a 100755 --- a/scripts/rockethideout1.asm +++ b/scripts/rockethideout1.asm @@ -1,4 +1,4 @@ -RocketHideout1Script: ; 44bca (11:4bca) +RocketHideout1Script: call RocketHideout1Script_44be0 call EnableAutoTextBoxDrawing ld hl, RocketHideout1TrainerHeaders @@ -8,7 +8,7 @@ RocketHideout1Script: ; 44bca (11:4bca) ld [wRocketHideout1CurScript], a ret -RocketHideout1Script_44be0: ; 44be0 (11:4be0) +RocketHideout1Script_44be0: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -30,12 +30,12 @@ RocketHideout1Script_44be0: ; 44be0 (11:4be0) lb bc, 8, 12 predef_jump ReplaceTileBlock -RocketHideout1ScriptPointers: ; 44c0e (11:4c0e) +RocketHideout1ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -RocketHideout1TextPointers: ; 44c14 (11:4c14) +RocketHideout1TextPointers: dw RocketHideout1Text1 dw RocketHideout1Text2 dw RocketHideout1Text3 @@ -44,8 +44,8 @@ RocketHideout1TextPointers: ; 44c14 (11:4c14) dw PickUpItemText dw PickUpItemText -RocketHideout1TrainerHeaders: ; 44c22 (11:4c22) -RocketHideout1TrainerHeader0: ; 44c22 (11:4c22) +RocketHideout1TrainerHeaders: +RocketHideout1TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_0 @@ -54,7 +54,7 @@ RocketHideout1TrainerHeader0: ; 44c22 (11:4c22) dw RocketHideout1EndBattleText2 ; TextEndBattle dw RocketHideout1EndBattleText2 ; TextEndBattle -RocketHideout1TrainerHeader2: ; 44c2e (11:4c2e) +RocketHideout1TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_2 @@ -63,7 +63,7 @@ RocketHideout1TrainerHeader2: ; 44c2e (11:4c2e) dw RocketHideout1EndBattleText3 ; TextEndBattle dw RocketHideout1EndBattleText3 ; TextEndBattle -RocketHideout1TrainerHeader3: ; 44c3a (11:4c3a) +RocketHideout1TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_3 @@ -72,7 +72,7 @@ RocketHideout1TrainerHeader3: ; 44c3a (11:4c3a) dw RocketHideout1EndBattleText4 ; TextEndBattle dw RocketHideout1EndBattleText4 ; TextEndBattle -RocketHideout1TrainerHeader4: ; 44c46 (11:4c46) +RocketHideout1TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_4 @@ -81,7 +81,7 @@ RocketHideout1TrainerHeader4: ; 44c46 (11:4c46) dw RocketHideout1EndBattleText5 ; TextEndBattle dw RocketHideout1EndBattleText5 ; TextEndBattle -RocketHideout1TrainerHeader5: ; 44c52 (11:4c52) +RocketHideout1TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 @@ -92,98 +92,98 @@ RocketHideout1TrainerHeader5: ; 44c52 (11:4c52) db $ff -RocketHideout1Text1: ; 44c5f (11:4c5f) +RocketHideout1Text1: TX_ASM ld hl, RocketHideout1TrainerHeader0 call TalkToTrainer jp TextScriptEnd -RocketHideout1Text2: ; 44c69 (11:4c69) +RocketHideout1Text2: TX_ASM ld hl, RocketHideout1TrainerHeader2 call TalkToTrainer jp TextScriptEnd -RocketHideout1Text3: ; 44c73 (11:4c73) +RocketHideout1Text3: TX_ASM ld hl, RocketHideout1TrainerHeader3 call TalkToTrainer jp TextScriptEnd -RocketHideout1Text4: ; 44c7d (11:4c7d) +RocketHideout1Text4: TX_ASM ld hl, RocketHideout1TrainerHeader4 call TalkToTrainer jp TextScriptEnd -RocketHideout1Text5: ; 44c87 (11:4c87) +RocketHideout1Text5: TX_ASM ld hl, RocketHideout1TrainerHeader5 call TalkToTrainer jp TextScriptEnd -RocketHideout1EndBattleText6: ; 44c91 (11:4c91) +RocketHideout1EndBattleText6: TX_FAR _RocketHideout1EndBattleText6 TX_ASM SetEvent EVENT_BEAT_ROCKET_HIDEOUT_1_TRAINER_5 ld hl, RocketHideout1Text_44c9f ret -RocketHideout1Text_44c9f: ; 44c9f (11:4c9f) +RocketHideout1Text_44c9f: db $6, "@" -RocketHideout1BattleText2: ; 44ca1 (11:4ca1) +RocketHideout1BattleText2: TX_FAR _RocketHideout1BattleText2 db "@" -RocketHideout1EndBattleText2: ; 44ca6 (11:4ca6) +RocketHideout1EndBattleText2: TX_FAR _RocketHideout1EndBattleText2 db "@" -RocketHideout1AfterBattleTxt2: ; 44cab (11:4cab) +RocketHideout1AfterBattleTxt2: TX_FAR _RocketHideout1AfterBattleTxt2 db "@" -RocketHideout1BattleText3: ; 44cb0 (11:4cb0) +RocketHideout1BattleText3: TX_FAR _RocketHideout1BattleText3 db "@" -RocketHideout1EndBattleText3: ; 44cb5 (11:4cb5) +RocketHideout1EndBattleText3: TX_FAR _RocketHideout1EndBattleText3 db "@" -RocketHideout1AfterBattleTxt3: ; 44cba (11:4cba) +RocketHideout1AfterBattleTxt3: TX_FAR _RocketHideout1AfterBattleTxt3 db "@" -RocketHideout1BattleText4: ; 44cbf (11:4cbf) +RocketHideout1BattleText4: TX_FAR _RocketHideout1BattleText4 db "@" -RocketHideout1EndBattleText4: ; 44cc4 (11:4cc4) +RocketHideout1EndBattleText4: TX_FAR _RocketHideout1EndBattleText4 db "@" -RocketHideout1AfterBattleTxt4: ; 44cc9 (11:4cc9) +RocketHideout1AfterBattleTxt4: TX_FAR _RocketHideout1AfterBattleTxt4 db "@" -RocketHideout1BattleText5: ; 44cce (11:4cce) +RocketHideout1BattleText5: TX_FAR _RocketHideout1BattleText5 db "@" -RocketHideout1EndBattleText5: ; 44cd3 (11:4cd3) +RocketHideout1EndBattleText5: TX_FAR _RocketHideout1EndBattleText5 db "@" -RocketHideout1AfterBattleTxt5: ; 44cd8 (11:4cd8) +RocketHideout1AfterBattleTxt5: TX_FAR _RocketHideout1AfterBattleTxt5 db "@" -RocketHideout1BattleText6: ; 44cdd (11:4cdd) +RocketHideout1BattleText6: TX_FAR _RocketHideout1BattleText6 db "@" -RocketHideout1AfterBattleTxt6: ; 44ce2 (11:4ce2) +RocketHideout1AfterBattleTxt6: TX_FAR _RocketHideout1AfterBattleTxt6 db "@" diff --git a/scripts/rockethideout2.asm b/scripts/rockethideout2.asm index 58e45d53..b29e5396 100755 --- a/scripts/rockethideout2.asm +++ b/scripts/rockethideout2.asm @@ -1,4 +1,4 @@ -RocketHideout2Script: ; 44e27 (11:4e27) +RocketHideout2Script: call EnableAutoTextBoxDrawing ld hl, RocketHideout2TrainerHeaders ld de, RocketHideout2ScriptPointers @@ -7,13 +7,13 @@ RocketHideout2Script: ; 44e27 (11:4e27) ld [wRocketHideout2CurScript], a ret -RocketHideout2ScriptPointers: ; 44e3a (11:4e3a) +RocketHideout2ScriptPointers: dw RocketHideout2Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw RocketHideout2Script3 -RocketHideout2Script0: ; 44e42 (11:4e42) +RocketHideout2Script0: ld a, [wYCoord] ld b, a ld a, [wXCoord] @@ -36,7 +36,7 @@ RocketHideout2Script0: ; 44e42 (11:4e42) ;format: ;db y,x ;dw pointer to movement -RocketHideout2ArrowTilePlayerMovement: ; 44e6d (11:4e6d) +RocketHideout2ArrowTilePlayerMovement: db $9,$4 dw RocketHideout2ArrowMovement1 db $b,$4 @@ -127,181 +127,181 @@ RocketHideout2ArrowTilePlayerMovement: ; 44e6d (11:4e6d) ;format: direction, count ;each list is read starting from the $FF and working backwards -RocketHideout2ArrowMovement1: ; 44f1a (11:4f1a) +RocketHideout2ArrowMovement1: db D_LEFT,$02 db $FF -RocketHideout2ArrowMovement2: ; 44f1d (11:4f1d) +RocketHideout2ArrowMovement2: db D_RIGHT,$04 db $FF -RocketHideout2ArrowMovement3: ; 44f20 (11:4f20) +RocketHideout2ArrowMovement3: db D_UP,$04 db D_RIGHT,$04 db $FF -RocketHideout2ArrowMovement4: ; 44f25 (11:4f25) +RocketHideout2ArrowMovement4: db D_UP,$04 db D_RIGHT,$04 db D_UP,$01 db $FF -RocketHideout2ArrowMovement5: ; 44f2c (11:4f2c) +RocketHideout2ArrowMovement5: db D_LEFT,$02 db D_UP,$03 db $FF -RocketHideout2ArrowMovement6: ; 44f31 (11:4f31) +RocketHideout2ArrowMovement6: db D_DOWN,$02 db D_RIGHT,$04 db $FF -RocketHideout2ArrowMovement7: ; 44f36 (11:4f36) +RocketHideout2ArrowMovement7: db D_UP,$02 db $FF -RocketHideout2ArrowMovement8: ; 44f39 (11:4f39) +RocketHideout2ArrowMovement8: db D_UP,$04 db $FF -RocketHideout2ArrowMovement9: ; 44f3c (11:4f3c) +RocketHideout2ArrowMovement9: db D_LEFT,$06 db $FF -RocketHideout2ArrowMovement10: ; 44f3f (11:4f3f) +RocketHideout2ArrowMovement10: db D_UP,$01 db $FF -RocketHideout2ArrowMovement11: ; 44f42 (11:4f42) +RocketHideout2ArrowMovement11: db D_LEFT,$06 db D_UP,$04 db $FF -RocketHideout2ArrowMovement12: ; 44f47 (11:4f47) +RocketHideout2ArrowMovement12: db D_DOWN,$02 db $FF -RocketHideout2ArrowMovement13: ; 44f4a (11:4f4a) +RocketHideout2ArrowMovement13: db D_LEFT,$08 db $FF -RocketHideout2ArrowMovement14: ; 44f4d (11:4f4d) +RocketHideout2ArrowMovement14: db D_LEFT,$08 db D_UP,$01 db $FF -RocketHideout2ArrowMovement15: ; 44f52 (11:4f52) +RocketHideout2ArrowMovement15: db D_LEFT,$08 db D_UP,$06 db $FF -RocketHideout2ArrowMovement16: ; 44f57 (11:4f57) +RocketHideout2ArrowMovement16: db D_UP,$02 db D_RIGHT,$04 db $FF -RocketHideout2ArrowMovement17: ; 44f5c (11:4f5c) +RocketHideout2ArrowMovement17: db D_UP,$02 db D_RIGHT,$04 db D_UP,$02 db $FF -RocketHideout2ArrowMovement18: ; 44f63 (11:4f63) +RocketHideout2ArrowMovement18: db D_DOWN,$02 db D_RIGHT,$04 db D_DOWN,$02 db $FF -RocketHideout2ArrowMovement19: ; 44f6a (11:4f6a) +RocketHideout2ArrowMovement19: db D_DOWN,$02 db D_RIGHT,$04 db $FF -RocketHideout2ArrowMovement20: ; 44f6f (11:4f6f) +RocketHideout2ArrowMovement20: db D_LEFT,$0A db $FF -RocketHideout2ArrowMovement21: ; 44f72 (11:4f72) +RocketHideout2ArrowMovement21: db D_LEFT,$0A db D_UP,$02 db $FF -RocketHideout2ArrowMovement22: ; 44f77 (11:4f77) +RocketHideout2ArrowMovement22: db D_LEFT,$0A db D_UP,$04 db $FF -RocketHideout2ArrowMovement23: ; 44f7c (11:4f7c) +RocketHideout2ArrowMovement23: db D_UP,$02 db D_RIGHT,$02 db $FF -RocketHideout2ArrowMovement24: ; 44f81 (11:4f81) +RocketHideout2ArrowMovement24: db D_RIGHT,$01 db D_DOWN,$02 db $FF -RocketHideout2ArrowMovement25: ; 44f86 (11:4f86) +RocketHideout2ArrowMovement25: db D_RIGHT,$01 db $FF -RocketHideout2ArrowMovement26: ; 44f89 (11:4f89) +RocketHideout2ArrowMovement26: db D_DOWN,$02 db D_RIGHT,$02 db $FF -RocketHideout2ArrowMovement27: ; 44f8e (11:4f8e) +RocketHideout2ArrowMovement27: db D_DOWN,$02 db D_LEFT,$02 db $FF -RocketHideout2ArrowMovement28: ; 44f93 (11:4f93) +RocketHideout2ArrowMovement28: db D_UP,$02 db D_RIGHT,$04 db D_UP,$02 db D_LEFT,$03 db $FF -RocketHideout2ArrowMovement29: ; 44f9c (11:4f9c) +RocketHideout2ArrowMovement29: db D_DOWN,$02 db D_LEFT,$04 db $FF -RocketHideout2ArrowMovement30: ; 44fa1 (11:4fa1) +RocketHideout2ArrowMovement30: db D_LEFT,$06 db D_UP,$04 db D_LEFT,$05 db $FF -RocketHideout2ArrowMovement31: ; 44fa8 (11:4fa8) +RocketHideout2ArrowMovement31: db D_UP,$02 db $FF -RocketHideout2ArrowMovement32: ; 44fab (11:4fab) +RocketHideout2ArrowMovement32: db D_UP,$01 db $FF -RocketHideout2ArrowMovement33: ; 44fae (11:4fae) +RocketHideout2ArrowMovement33: db D_UP,$03 db $FF -RocketHideout2ArrowMovement34: ; 44fb1 (11:4fb1) +RocketHideout2ArrowMovement34: db D_UP,$05 db $FF -RocketHideout2ArrowMovement35: ; 44fb4 (11:4fb4) +RocketHideout2ArrowMovement35: db D_RIGHT,$01 db D_DOWN,$02 db D_LEFT,$04 db $FF -RocketHideout2ArrowMovement36: ; 44fbb (11:4fbb) +RocketHideout2ArrowMovement36: db D_LEFT,$0A db D_UP,$02 db D_LEFT,$05 db $FF -RocketHideout2Script3: ; 44fc2 (11:4fc2) +RocketHideout2Script3: ld a, [wSimulatedJoypadStatesIndex] and a jr nz, LoadSpinnerArrowTiles @@ -313,7 +313,7 @@ RocketHideout2Script3: ; 44fc2 (11:4fc2) ld [wCurMapScript], a ret -LoadSpinnerArrowTiles: ; 45077 (11:5077) +LoadSpinnerArrowTiles: ld a, [wSpriteStateData1 + 2] srl a srl a @@ -400,7 +400,7 @@ vGymSpinner EQU vTileset + GYM_SPINNER spinner Gym_GFX, GYM_SPINNER + $100, 1, vGymSpinner + $100 spinner Gym_GFX, GYM_SPINNER + $110, 1, vGymSpinner + $110 -SpinnerPlayerFacingDirections: ; 45083 (11:5083) +SpinnerPlayerFacingDirections: ; This isn't the order of the facing directions. Rather, it's a list of ; the facing directions that come next. For example, when the player is ; facing down (00), the next facing direction is left (08). @@ -410,18 +410,18 @@ SpinnerPlayerFacingDirections: ; 45083 (11:5083) db $00 ; right -> down ; these tiles are the animation for the tiles that push the player in dungeons like Rocket HQ -SpinnerArrowAnimTiles: ; 45087 (11:5087) +SpinnerArrowAnimTiles: INCBIN "gfx/spinner_arrow.2bpp" -RocketHideout2TextPointers: ; 450c7 (11:50c7) +RocketHideout2TextPointers: dw RocketHideout2Text1 dw PickUpItemText dw PickUpItemText dw PickUpItemText dw PickUpItemText -RocketHideout2TrainerHeaders: ; 450d1 (11:50d1) -RocketHideout2TrainerHeader0: ; 450d1 (11:50d1) +RocketHideout2TrainerHeaders: +RocketHideout2TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_2_TRAINER_0 @@ -432,20 +432,20 @@ RocketHideout2TrainerHeader0: ; 450d1 (11:50d1) db $ff -RocketHideout2Text1: ; 450de (11:50de) +RocketHideout2Text1: TX_ASM ld hl, RocketHideout2TrainerHeader0 call TalkToTrainer jp TextScriptEnd -RocketHideout2BattleText2: ; 450e8 (11:50e8) +RocketHideout2BattleText2: TX_FAR _RocketHideout2BattleText2 db "@" -RocketHideout2EndBattleText2: ; 450ed (11:50ed) +RocketHideout2EndBattleText2: TX_FAR _RocketHideout2EndBattleText2 db "@" -RocketHideout2AfterBattleTxt2: ; 450f2 (11:50f2) +RocketHideout2AfterBattleTxt2: TX_FAR _RocketHideout2AfterBattleTxt2 db "@" diff --git a/scripts/rockethideout3.asm b/scripts/rockethideout3.asm index 82bdd394..ac08e868 100755 --- a/scripts/rockethideout3.asm +++ b/scripts/rockethideout3.asm @@ -1,4 +1,4 @@ -RocketHideout3Script: ; 45225 (11:5225) +RocketHideout3Script: call EnableAutoTextBoxDrawing ld hl, RocketHideout3TrainerHeaders ld de, RocketHideout3ScriptPointers @@ -7,13 +7,13 @@ RocketHideout3Script: ; 45225 (11:5225) ld [wRocketHideout3CurScript], a ret -RocketHideout3ScriptPointers: ; 45238 (11:5238) +RocketHideout3ScriptPointers: dw RocketHideout3Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw RocketHideout3Script3 -RocketHideout3Script0: ; 45240 (11:5240) +RocketHideout3Script0: ld a, [wYCoord] ld b, a ld a, [wXCoord] @@ -36,7 +36,7 @@ RocketHideout3Script0: ; 45240 (11:5240) ;format: ;db y,x ;dw pointer to movement -RocketHideout3ArrowTilePlayerMovement: ; 4526b (11:526b) +RocketHideout3ArrowTilePlayerMovement: db $d,$a dw RocketHideout3ArrowMovement6 db $13,$a @@ -73,65 +73,65 @@ RocketHideout3ArrowTilePlayerMovement: ; 4526b (11:526b) ;format: direction, count ;each list is read starting from the $FF and working backwards -RocketHideout3ArrowMovement1: ; 452ac (11:52ac) +RocketHideout3ArrowMovement1: db D_RIGHT,$04 db D_UP,$04 db D_RIGHT,$04 db $FF -RocketHideout3ArrowMovement2: ; 452b3 (11:52b3) +RocketHideout3ArrowMovement2: db D_DOWN,$04 db D_RIGHT,$04 db $FF -RocketHideout3ArrowMovement3: ; 452b8 (11:52b8) +RocketHideout3ArrowMovement3: db D_LEFT,$02 db $FF -RocketHideout3ArrowMovement4: ; 452bb (11:52bb) +RocketHideout3ArrowMovement4: db D_RIGHT,$04 db D_UP,$02 db D_RIGHT,$02 db $FF -RocketHideout3ArrowMovement5: ; 452c2 (11:52c2) +RocketHideout3ArrowMovement5: db D_RIGHT,$04 db D_UP,$02 db D_RIGHT,$02 db D_UP,$03 db $FF -RocketHideout3ArrowMovement6: ; 452cb (11:52cb) +RocketHideout3ArrowMovement6: db D_RIGHT,$04 db $FF -RocketHideout3ArrowMovement7: ; 452ce (11:52ce) +RocketHideout3ArrowMovement7: db D_RIGHT,$02 db $FF -RocketHideout3ArrowMovement8: ; 452d1 (11:52d1) +RocketHideout3ArrowMovement8: db D_RIGHT,$04 db D_UP,$02 db $FF -RocketHideout3ArrowMovement9: ; 452d6 (11:52d6) +RocketHideout3ArrowMovement9: db D_RIGHT,$04 db D_UP,$04 db $FF -RocketHideout3ArrowMovement10: ; 452db (11:52db) +RocketHideout3ArrowMovement10: db D_DOWN,$04 db $FF -RocketHideout3ArrowMovement11: ; 452de (11:52de) +RocketHideout3ArrowMovement11: db D_UP,$02 db $FF -RocketHideout3ArrowMovement12: ; 452e1 (11:52e1) +RocketHideout3ArrowMovement12: db D_UP,$01 db $FF -RocketHideout3Script3: ; 452e4 (11:452e4) +RocketHideout3Script3: ld a, [wSimulatedJoypadStatesIndex] and a jp nz, LoadSpinnerArrowTiles @@ -143,14 +143,14 @@ RocketHideout3Script3: ; 452e4 (11:452e4) ld [wCurMapScript], a ret -RocketHideout3TextPointers: ; 452fa (11:52fa) +RocketHideout3TextPointers: dw RocketHideout3Text1 dw RocketHideout3Text2 dw PickUpItemText dw PickUpItemText -RocketHideout3TrainerHeaders: ; 45302 (11:5302) -RocketHideout3TrainerHeader0: ; 45302 (11:5302) +RocketHideout3TrainerHeaders: +RocketHideout3TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_0 @@ -159,7 +159,7 @@ RocketHideout3TrainerHeader0: ; 45302 (11:5302) dw RocketHideout3EndBattleText2 ; TextEndBattle dw RocketHideout3EndBattleText2 ; TextEndBattle -RocketHideout3TrainerHeader2: ; 4530e (11:530e) +RocketHideout3TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_3_TRAINER_2 @@ -170,38 +170,38 @@ RocketHideout3TrainerHeader2: ; 4530e (11:530e) db $ff -RocketHideout3Text1: ; 4531b (11:531b) +RocketHideout3Text1: TX_ASM ld hl, RocketHideout3TrainerHeader0 call TalkToTrainer jp TextScriptEnd -RocketHideout3BattleText2: ; 45325 (11:5325) +RocketHideout3BattleText2: TX_FAR _RocketHideout3BattleText2 db "@" -RocketHideout3EndBattleText2: ; 4532a (11:532a) +RocketHideout3EndBattleText2: TX_FAR _RocketHideout3EndBattleText2 db "@" -RocketHideout3AfterBattleTxt2: ; 4532f (11:532f) +RocketHideout3AfterBattleTxt2: TX_FAR _RocketHideout3AfterBattleTxt2 db "@" -RocketHideout3Text2: ; 45334 (11:5334) +RocketHideout3Text2: TX_ASM ld hl, RocketHideout3TrainerHeader2 call TalkToTrainer jp TextScriptEnd -RocketHideout3BattleTxt: ; 4533e (11:533e) +RocketHideout3BattleTxt: TX_FAR _RocketHideout3BattleTxt db "@" -RocketHideout3EndBattleText3: ; 45343 (11:5343) +RocketHideout3EndBattleText3: TX_FAR _RocketHideout3EndBattleText3 db "@" -RocketHideout3AfterBattleText3: ; 45348 (11:5348) +RocketHideout3AfterBattleText3: TX_FAR _RocketHide3AfterBattleText3 db "@" diff --git a/scripts/rockethideout4.asm b/scripts/rockethideout4.asm index c6d48852..2b3e0e89 100755 --- a/scripts/rockethideout4.asm +++ b/scripts/rockethideout4.asm @@ -1,4 +1,4 @@ -RocketHideout4Script: ; 4545d (11:545d) +RocketHideout4Script: call EnableAutoTextBoxDrawing ld hl, RocketHideout4TrainerHeader0 ld de, RocketHideout4ScriptPointers @@ -7,7 +7,7 @@ RocketHideout4Script: ; 4545d (11:545d) ld [wRocketHideout4CurScript], a ret -RocketHideout4Script_45510: ; 45510 (11:54a3) +RocketHideout4Script_45510: CheckAndResetEvent EVENT_6A0 call nz, RocketHideout4Script_45525 xor a @@ -24,7 +24,7 @@ RocketHideout4Script_45525: call RocketHideout4Script_45756 ret -RocketHideout4ScriptPointers: ; 454ae (11:54ae)c +RocketHideout4ScriptPointers: dw RocketHideout4Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle @@ -40,7 +40,7 @@ RocketHideout4ScriptPointers: ; 454ae (11:54ae)c dw RocketHideout4Script12 dw RocketHideout4Script13 -RocketHideout4Script3: ; 454b6 (11:54b6) +RocketHideout4Script3: ld a, [wIsInBattle] cp $ff jp z, RocketHideout4Script_45510 @@ -200,8 +200,8 @@ RocketHideout4Script10: ld hl, wd72d set 6, [hl] set 7, [hl] - ld hl, RocketHideout4JessieJamesEndBattleText ; 457b2 - ld de, RocketHideout4JessieJamesEndBattleText ; 457b2 + ld hl, RocketHideout4JessieJamesEndBattleText + ld de, RocketHideout4JessieJamesEndBattleText call SaveEndBattleTextPointers ld a, OPP_ROCKET ld [wCurOpponent], a @@ -266,8 +266,7 @@ RocketHideout4Script13: xor a ld [hJoyHeld], a ld [wJoyIgnore], a - ld hl, wd81b - set 2, [hl] + SetEvent EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_0 ld a, $0 call RocketHideout4Script_4551e ret @@ -284,7 +283,7 @@ RocketHideout4Script_45756: predef HideObject ret -RocketHideout4TextPointers: ; 45501 (11:5501) +RocketHideout4TextPointers: dw RocketHideout4Text0 dw RocketHideout4Text1 dw RocketHideout4Text2 @@ -304,10 +303,10 @@ RocketHideout4TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 db ($1 << 4) dwEventFlagAddress EVENT_BEAT_ROCKET_HIDEOUT_4_TRAINER_3 - dw RocketHideout4Trainer0BeforeText ; 4581d - dw RocketHideout4Trainer0AfterText ; 4583a - dw RocketHideout4Trainer0EndBattleText ; 45822 - dw RocketHideout4Trainer0EndBattleText ; 45822 + dw RocketHideout4Trainer0BeforeText + dw RocketHideout4Trainer0AfterText + dw RocketHideout4Trainer0EndBattleText + dw RocketHideout4Trainer0EndBattleText db $ff RocketHideout4Text1: diff --git a/scripts/rockethideoutelevator.asm b/scripts/rockethideoutelevator.asm index c90b0aad..526ac3cc 100755 --- a/scripts/rockethideoutelevator.asm +++ b/scripts/rockethideoutelevator.asm @@ -1,4 +1,4 @@ -RocketHideoutElevatorScript: ; 45710 (11:5710) +RocketHideoutElevatorScript: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -14,7 +14,7 @@ RocketHideoutElevatorScript: ; 45710 (11:5710) ld [wDoNotWaitForButtonPressAfterDisplayingText], a ret -RocketHideoutElevatorScript_4572c: ; 4572c (11:572c) +RocketHideoutElevatorScript_4572c: ld hl, wWarpEntries ld a, [wWarpedFromWhichWarp] ld b, a @@ -22,7 +22,7 @@ RocketHideoutElevatorScript_4572c: ; 4572c (11:572c) ld c, a call RocketHideoutElevatorScript_4573a -RocketHideoutElevatorScript_4573a: ; 4573a (11:573a) +RocketHideoutElevatorScript_4573a: inc hl inc hl ld a, b @@ -31,7 +31,7 @@ RocketHideoutElevatorScript_4573a: ; 4573a (11:573a) ld [hli], a ret -RocketHideoutElevatorScript_45741: ; 45741 (11:5741) +RocketHideoutElevatorScript_45741: ld hl, RocketHideoutElavatorFloors call LoadItemList ld hl, RocketHideoutElevatorWarpMaps @@ -40,14 +40,14 @@ RocketHideoutElevatorScript_45741: ; 45741 (11:5741) call CopyData ret -RocketHideoutElavatorFloors: ; 45754 (11:5754) +RocketHideoutElavatorFloors: db $03 ; num elements in list db FLOOR_B1F db FLOOR_B2F db FLOOR_B4F db $FF ; terminator -RocketHideoutElevatorWarpMaps: ; 45759 (11:5759) +RocketHideoutElevatorWarpMaps: ; first byte is warp number ; second byte is map number ; These specify where the player goes after getting out of the elevator. @@ -56,15 +56,15 @@ RocketHideoutElevatorWarpMaps: ; 45759 (11:5759) db $02, ROCKET_HIDEOUT_4 RocketHideoutElevatorWarpMapsEnd: -RocketHideoutElevatorScript_4575f: ; 4575f (11:575f) +RocketHideoutElevatorScript_4575f: call Delay3 callba ShakeElevator ret -RocketHideoutElevatorTextPointers: ; 4576b (11:576b) +RocketHideoutElevatorTextPointers: dw RocketHideoutElevatorText1 -RocketHideoutElevatorText1: ; 4576d (11:576d) +RocketHideoutElevatorText1: TX_ASM ld b, LIFT_KEY call IsItemInBag @@ -79,6 +79,6 @@ RocketHideoutElevatorText1: ; 4576d (11:576d) .asm_45788 jp TextScriptEnd -RocketHideoutElevatorText_4578b: ; 4578b (11:578b) +RocketHideoutElevatorText_4578b: TX_FAR _RocketElevatorText_4578b db $d, "@" diff --git a/scripts/rocktunnel1.asm b/scripts/rocktunnel1.asm index 2b917f91..2819c350 100755 --- a/scripts/rocktunnel1.asm +++ b/scripts/rocktunnel1.asm @@ -1,4 +1,4 @@ -RockTunnel1Script: ; 444dc (11:44dc) +RockTunnel1Script: call EnableAutoTextBoxDrawing ld hl, RockTunnel1TrainerHeaders ld de, RockTunnel1ScriptPointers @@ -7,12 +7,12 @@ RockTunnel1Script: ; 444dc (11:44dc) ld [wRockTunnel1CurScript], a ret -RockTunnel1ScriptPointers: ; 444ef (11:44ef) +RockTunnel1ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -RockTunnel1TextPointers: ; 444f5 (11:44f5) +RockTunnel1TextPointers: dw RockTunnel1Text1 dw RockTunnel1Text2 dw RockTunnel1Text3 @@ -22,8 +22,8 @@ RockTunnel1TextPointers: ; 444f5 (11:44f5) dw RockTunnel1Text7 dw RockTunnel1Text8 -RockTunnel1TrainerHeaders: ; 44505 (11:4505) -RockTunnel1TrainerHeader1: ; 44505 (11:4505) +RockTunnel1TrainerHeaders: +RockTunnel1TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_1 @@ -32,7 +32,7 @@ RockTunnel1TrainerHeader1: ; 44505 (11:4505) dw RockTunnel1EndBattleText1 ; TextEndBattle dw RockTunnel1EndBattleText1 ; TextEndBattle -RockTunnel1TrainerHeader2: ; 44511 (11:4511) +RockTunnel1TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_2 @@ -41,7 +41,7 @@ RockTunnel1TrainerHeader2: ; 44511 (11:4511) dw RockTunnel1EndBattleText2 ; TextEndBattle dw RockTunnel1EndBattleText2 ; TextEndBattle -RockTunnel1TrainerHeader3: ; 4451d (11:451d) +RockTunnel1TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_3 @@ -50,7 +50,7 @@ RockTunnel1TrainerHeader3: ; 4451d (11:451d) dw RockTunnel1EndBattleText3 ; TextEndBattle dw RockTunnel1EndBattleText3 ; TextEndBattle -RockTunnel1TrainerHeader4: ; 44529 (11:4529) +RockTunnel1TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_4 @@ -59,7 +59,7 @@ RockTunnel1TrainerHeader4: ; 44529 (11:4529) dw RockTunnel1EndBattleText4 ; TextEndBattle dw RockTunnel1EndBattleText4 ; TextEndBattle -RockTunnel1TrainerHeader5: ; 44535 (11:4535) +RockTunnel1TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_5 @@ -68,7 +68,7 @@ RockTunnel1TrainerHeader5: ; 44535 (11:4535) dw RockTunnel1EndBattleText5 ; TextEndBattle dw RockTunnel1EndBattleText5 ; TextEndBattle -RockTunnel1TrainerHeader6: ; 44541 (11:4541) +RockTunnel1TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_6 @@ -77,7 +77,7 @@ RockTunnel1TrainerHeader6: ; 44541 (11:4541) dw RockTunnel1EndBattleText6 ; TextEndBattle dw RockTunnel1EndBattleText6 ; TextEndBattle -RockTunnel1TrainerHeader7: ; 4454d (11:454d) +RockTunnel1TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_1_TRAINER_7 @@ -88,127 +88,127 @@ RockTunnel1TrainerHeader7: ; 4454d (11:454d) db $ff -RockTunnel1Text1: ; 4455a (11:455a) +RockTunnel1Text1: TX_ASM ld hl, RockTunnel1TrainerHeader1 jr RockTunnel1TalkToTrainer -RockTunnel1Text2: ; 44560 (11:4560) +RockTunnel1Text2: TX_ASM ld hl, RockTunnel1TrainerHeader2 jr RockTunnel1TalkToTrainer -RockTunnel1Text3: ; 44566 (11:4566) +RockTunnel1Text3: TX_ASM ld hl, RockTunnel1TrainerHeader3 jr RockTunnel1TalkToTrainer -RockTunnel1Text4: ; 4456c (11:456c) +RockTunnel1Text4: TX_ASM ld hl, RockTunnel1TrainerHeader4 jr RockTunnel1TalkToTrainer -RockTunnel1Text5: ; 44572 (11:4572) +RockTunnel1Text5: TX_ASM ld hl, RockTunnel1TrainerHeader5 jr RockTunnel1TalkToTrainer -RockTunnel1Text6: ; 44578 (11:4578) +RockTunnel1Text6: TX_ASM ld hl, RockTunnel1TrainerHeader6 jr RockTunnel1TalkToTrainer -RockTunnel1Text7: ; 4457e (11:457e) +RockTunnel1Text7: TX_ASM ld hl, RockTunnel1TrainerHeader7 -RockTunnel1TalkToTrainer: ; 44582 (11:4582) +RockTunnel1TalkToTrainer: call TalkToTrainer jp TextScriptEnd -RockTunnel1BattleText1: ; 44588 (11:4588) +RockTunnel1BattleText1: TX_FAR _RockTunnel1BattleText1 db "@" -RockTunnel1EndBattleText1: ; 4458d (11:458d) +RockTunnel1EndBattleText1: TX_FAR _RockTunnel1EndBattleText1 db "@" -RockTunnel1AfterBattleText1: ; 44592 (11:4592) +RockTunnel1AfterBattleText1: TX_FAR _RockTunnel1AfterBattleText1 db "@" -RockTunnel1BattleText2: ; 44597 (11:4597) +RockTunnel1BattleText2: TX_FAR _RockTunnel1BattleText2 db "@" -RockTunnel1EndBattleText2: ; 4459c (11:459c) +RockTunnel1EndBattleText2: TX_FAR _RockTunnel1EndBattleText2 db "@" -RockTunnel1AfterBattleText2: ; 445a1 (11:45a1) +RockTunnel1AfterBattleText2: TX_FAR _RockTunnel1AfterBattleText2 db "@" -RockTunnel1BattleText3: ; 445a6 (11:45a6) +RockTunnel1BattleText3: TX_FAR _RockTunnel1BattleText3 db "@" -RockTunnel1EndBattleText3: ; 445ab (11:45ab) +RockTunnel1EndBattleText3: TX_FAR _RockTunnel1EndBattleText3 db "@" -RockTunnel1AfterBattleText3: ; 445b0 (11:45b0) +RockTunnel1AfterBattleText3: TX_FAR _RockTunnel1AfterBattleText3 db "@" -RockTunnel1BattleText4: ; 445b5 (11:45b5) +RockTunnel1BattleText4: TX_FAR _RockTunnel1BattleText4 db "@" -RockTunnel1EndBattleText4: ; 445ba (11:45ba) +RockTunnel1EndBattleText4: TX_FAR _RockTunnel1EndBattleText4 db "@" -RockTunnel1AfterBattleText4: ; 445bf (11:45bf) +RockTunnel1AfterBattleText4: TX_FAR _RockTunnel1AfterBattleText4 db "@" -RockTunnel1BattleText5: ; 445c4 (11:45c4) +RockTunnel1BattleText5: TX_FAR _RockTunnel1BattleText5 db "@" -RockTunnel1EndBattleText5: ; 445c9 (11:45c9) +RockTunnel1EndBattleText5: TX_FAR _RockTunnel1EndBattleText5 db "@" -RockTunnel1AfterBattleText5: ; 445ce (11:45ce) +RockTunnel1AfterBattleText5: TX_FAR _RockTunnel1AfterBattleText5 db "@" -RockTunnel1BattleText6: ; 445d3 (11:45d3) +RockTunnel1BattleText6: TX_FAR _RockTunnel1BattleText6 db "@" -RockTunnel1EndBattleText6: ; 445d8 (11:45d8) +RockTunnel1EndBattleText6: TX_FAR _RockTunnel1EndBattleText6 db "@" -RockTunnel1AfterBattleText6: ; 445dd (11:45dd) +RockTunnel1AfterBattleText6: TX_FAR _RockTunnel1AfterBattleText6 db "@" -RockTunnel1BattleText7: ; 445e2 (11:45e2) +RockTunnel1BattleText7: TX_FAR _RockTunnel1BattleText7 db "@" -RockTunnel1EndBattleText7: ; 445e7 (11:45e7) +RockTunnel1EndBattleText7: TX_FAR _RockTunnel1EndBattleText7 db "@" -RockTunnel1AfterBattleText7: ; 445ec (11:45ec) +RockTunnel1AfterBattleText7: TX_FAR _RockTunnel1AfterBattleText7 db "@" -RockTunnel1Text8: ; 445f1 (11:45f1) +RockTunnel1Text8: TX_FAR _RockTunnel1Text8 db "@" diff --git a/scripts/rocktunnel2.asm b/scripts/rocktunnel2.asm index 5cc04a2d..7ac3f426 100755 --- a/scripts/rocktunnel2.asm +++ b/scripts/rocktunnel2.asm @@ -1,4 +1,4 @@ -RockTunnel2Script: ; 45feb (11:5feb) +RockTunnel2Script: call EnableAutoTextBoxDrawing ld hl, RockTunnel2TrainerHeaders ld de, RockTunnel2ScriptPointers @@ -7,12 +7,12 @@ RockTunnel2Script: ; 45feb (11:5feb) ld [wRockTunnel2CurScript], a ret -RockTunnel2ScriptPointers: ; 45ffe (11:5ffe) +RockTunnel2ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -RockTunnel2TextPointers: ; 46004 (11:6004) +RockTunnel2TextPointers: dw RockTunnel2Text1 dw RockTunnel2Text2 dw RockTunnel2Text3 @@ -22,8 +22,8 @@ RockTunnel2TextPointers: ; 46004 (11:6004) dw RockTunnel2Text7 dw RockTunnel2Text8 -RockTunnel2TrainerHeaders: ; 46014 (11:6014) -RockTunnel2TrainerHeader0: ; 46014 (11:6014) +RockTunnel2TrainerHeaders: +RockTunnel2TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_0 @@ -32,7 +32,7 @@ RockTunnel2TrainerHeader0: ; 46014 (11:6014) dw RockTunnel2EndBattleText2 ; TextEndBattle dw RockTunnel2EndBattleText2 ; TextEndBattle -RockTunnel2TrainerHeader2: ; 46020 (11:6020) +RockTunnel2TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_2 @@ -41,7 +41,7 @@ RockTunnel2TrainerHeader2: ; 46020 (11:6020) dw RockTunnel2EndBattleText3 ; TextEndBattle dw RockTunnel2EndBattleText3 ; TextEndBattle -RockTunnel2TrainerHeader3: ; 4602c (11:602c) +RockTunnel2TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_3 @@ -50,7 +50,7 @@ RockTunnel2TrainerHeader3: ; 4602c (11:602c) dw RockTunnel2EndBattleText4 ; TextEndBattle dw RockTunnel2EndBattleText4 ; TextEndBattle -RockTunnel2TrainerHeader4: ; 46038 (11:6038) +RockTunnel2TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_4 @@ -59,7 +59,7 @@ RockTunnel2TrainerHeader4: ; 46038 (11:6038) dw RockTunnel2EndBattleText5 ; TextEndBattle dw RockTunnel2EndBattleText5 ; TextEndBattle -RockTunnel2TrainerHeader5: ; 46044 (11:6044) +RockTunnel2TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_5 @@ -68,7 +68,7 @@ RockTunnel2TrainerHeader5: ; 46044 (11:6044) dw RockTunnel2EndBattleText6 ; TextEndBattle dw RockTunnel2EndBattleText6 ; TextEndBattle -RockTunnel2TrainerHeader6: ; 46050 (11:6050) +RockTunnel2TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_6 @@ -77,7 +77,7 @@ RockTunnel2TrainerHeader6: ; 46050 (11:6050) dw RockTunnel2EndBattleText7 ; TextEndBattle dw RockTunnel2EndBattleText7 ; TextEndBattle -RockTunnel2TrainerHeader7: ; 4605c (11:605c) +RockTunnel2TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_7 @@ -86,7 +86,7 @@ RockTunnel2TrainerHeader7: ; 4605c (11:605c) dw RockTunnel2EndBattleText8 ; TextEndBattle dw RockTunnel2EndBattleText8 ; TextEndBattle -RockTunnel2TrainerHeader8: ; 46068 (11:6068) +RockTunnel2TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROCK_TUNNEL_2_TRAINER_8, 1 @@ -97,146 +97,146 @@ RockTunnel2TrainerHeader8: ; 46068 (11:6068) db $ff -RockTunnel2Text1: ; 46075 (11:6075) +RockTunnel2Text1: TX_ASM ld hl, RockTunnel2TrainerHeader0 call TalkToTrainer jp TextScriptEnd -RockTunnel2Text2: ; 4607f (11:607f) +RockTunnel2Text2: TX_ASM ld hl, RockTunnel2TrainerHeader2 call TalkToTrainer jp TextScriptEnd -RockTunnel2Text3: ; 46089 (11:6089) +RockTunnel2Text3: TX_ASM ld hl, RockTunnel2TrainerHeader3 call TalkToTrainer jp TextScriptEnd -RockTunnel2Text4: ; 46093 (11:6093) +RockTunnel2Text4: TX_ASM ld hl, RockTunnel2TrainerHeader4 call TalkToTrainer jp TextScriptEnd -RockTunnel2Text5: ; 4609d (11:609d) +RockTunnel2Text5: TX_ASM ld hl, RockTunnel2TrainerHeader5 call TalkToTrainer jp TextScriptEnd -RockTunnel2Text6: ; 460a7 (11:60a7) +RockTunnel2Text6: TX_ASM ld hl, RockTunnel2TrainerHeader6 call TalkToTrainer jp TextScriptEnd -RockTunnel2Text7: ; 460b1 (11:60b1) +RockTunnel2Text7: TX_ASM ld hl, RockTunnel2TrainerHeader7 call TalkToTrainer jp TextScriptEnd -RockTunnel2Text8: ; 460bb (11:60bb) +RockTunnel2Text8: TX_ASM ld hl, RockTunnel2TrainerHeader8 call TalkToTrainer jp TextScriptEnd -RockTunnel2BattleText2: ; 460c5 (11:60c5) +RockTunnel2BattleText2: TX_FAR _RockTunnel2BattleText2 db "@" -RockTunnel2EndBattleText2: ; 460ca (11:60ca) +RockTunnel2EndBattleText2: TX_FAR _RockTunnel2EndBattleText2 db "@" -RockTunnel2AfterBattleText2: ; 460cf (11:60cf) +RockTunnel2AfterBattleText2: TX_FAR _RockTunnel2AfterBattleText2 db "@" -RockTunnel2BattleText3: ; 460d4 (11:60d4) +RockTunnel2BattleText3: TX_FAR _RockTunnel2BattleText3 db "@" -RockTunnel2EndBattleText3: ; 460d9 (11:60d9) +RockTunnel2EndBattleText3: TX_FAR _RockTunnel2EndBattleText3 db "@" -RockTunnel2AfterBattleText3: ; 460de (11:60de) +RockTunnel2AfterBattleText3: TX_FAR _RockTunnel2AfterBattleText3 db "@" -RockTunnel2BattleText4: ; 460e3 (11:60e3) +RockTunnel2BattleText4: TX_FAR _RockTunnel2BattleText4 db "@" -RockTunnel2EndBattleText4: ; 460e8 (11:60e8) +RockTunnel2EndBattleText4: TX_FAR _RockTunnel2EndBattleText4 db "@" -RockTunnel2AfterBattleText4: ; 460ed (11:60ed) +RockTunnel2AfterBattleText4: TX_FAR _RockTunnel2AfterBattleText4 db "@" -RockTunnel2BattleText5: ; 460f2 (11:60f2) +RockTunnel2BattleText5: TX_FAR _RockTunnel2BattleText5 db "@" -RockTunnel2EndBattleText5: ; 460f7 (11:60f7) +RockTunnel2EndBattleText5: TX_FAR _RockTunnel2EndBattleText5 db "@" -RockTunnel2AfterBattleText5: ; 460fc (11:60fc) +RockTunnel2AfterBattleText5: TX_FAR _RockTunnel2AfterBattleText5 db "@" -RockTunnel2BattleText6: ; 46101 (11:6101) +RockTunnel2BattleText6: TX_FAR _RockTunnel2BattleText6 db "@" -RockTunnel2EndBattleText6: ; 46106 (11:6106) +RockTunnel2EndBattleText6: TX_FAR _RockTunnel2EndBattleText6 db "@" -RockTunnel2AfterBattleText6: ; 4610b (11:610b) +RockTunnel2AfterBattleText6: TX_FAR _RockTunnel2AfterBattleText6 db "@" -RockTunnel2BattleText7: ; 46110 (11:6110) +RockTunnel2BattleText7: TX_FAR _RockTunnel2BattleText7 db "@" -RockTunnel2EndBattleText7: ; 46115 (11:6115) +RockTunnel2EndBattleText7: TX_FAR _RockTunnel2EndBattleText7 db "@" -RockTunnel2AfterBattleText7: ; 4611a (11:611a) +RockTunnel2AfterBattleText7: TX_FAR _RockTunnel2AfterBattleText7 db "@" -RockTunnel2BattleText8: ; 4611f (11:611f) +RockTunnel2BattleText8: TX_FAR _RockTunnel2BattleText8 db "@" -RockTunnel2EndBattleText8: ; 46124 (11:6124) +RockTunnel2EndBattleText8: TX_FAR _RockTunnel2EndBattleText8 db "@" -RockTunnel2AfterBattleText8: ; 46129 (11:6129) +RockTunnel2AfterBattleText8: TX_FAR _RockTunnel2AfterBattleText8 db "@" -RockTunnel2BattleText9: ; 4612e (11:612e) +RockTunnel2BattleText9: TX_FAR _RockTunnel2BattleText9 db "@" -RockTunnel2EndBattleText9: ; 46133 (11:6133) +RockTunnel2EndBattleText9: TX_FAR _RockTunnel2EndBattleText9 db "@" -RockTunnel2AfterBattleText9: ; 46138 (11:6138) +RockTunnel2AfterBattleText9: TX_FAR _RockTunnel2AfterBattleText9 db "@" diff --git a/scripts/rocktunnelpokecenter.asm b/scripts/rocktunnelpokecenter.asm index 3518bd8f..76336e5f 100755 --- a/scripts/rocktunnelpokecenter.asm +++ b/scripts/rocktunnelpokecenter.asm @@ -1,26 +1,26 @@ -RockTunnelPokecenterScript: ; 493ba (12:53ba) +RockTunnelPokecenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -RockTunnelPokecenterTextPointers: ; 493c0 (12:53c0) +RockTunnelPokecenterTextPointers: dw RockTunnelPokecenterText1 dw RockTunnelPokecenterText2 dw RockTunnelPokecenterText3 dw RockTunnelPokecenterText4 dw RockTunnelPokecenterText5 -RockTunnelPokecenterText1: ; 493c8 (12:53c8) +RockTunnelPokecenterText1: TX_POKECENTER_NURSE -RockTunnelPokecenterText2: ; 493c9 (12:53c9) +RockTunnelPokecenterText2: TX_FAR _RockTunnelPokecenterText1 db "@" -RockTunnelPokecenterText3: ; 493ce (12:53ce) +RockTunnelPokecenterText3: TX_FAR _RockTunnelPokecenterText3 db "@" -RockTunnelPokecenterText4: ; 493d3 (12:53d3) +RockTunnelPokecenterText4: TX_CABLE_CLUB_RECEPTIONIST RockTunnelPokecenterText5: diff --git a/scripts/route1.asm b/scripts/route1.asm index 8c7cc0e9..4d046124 100755 --- a/scripts/route1.asm +++ b/scripts/route1.asm @@ -1,23 +1,23 @@ -Route1Script: ; 1caaf (7:4aaf) +Route1Script: call EnableAutoTextBoxDrawing ret -Route1TextPointers: ; 1cab2 (7:4ab2) +Route1TextPointers: dw Route1Text1 dw Route1Text2 dw Route1Text3 -Route1Text1: ; 1cab8 (7:4ab8) +Route1Text1: TX_ASM callba Func_f1ad2 jp TextScriptEnd -Route1Text2: ; 1caf8 (7:4af8) +Route1Text2: TX_ASM callba Func_f1b0f jp TextScriptEnd -Route1Text3: ; 1cafd (7:4afd) +Route1Text3: TX_ASM callba Func_f1b1b jp TextScriptEnd diff --git a/scripts/route10.asm b/scripts/route10.asm index 5a501557..ca0ab190 100755 --- a/scripts/route10.asm +++ b/scripts/route10.asm @@ -1,4 +1,4 @@ -Route10Script: ; 59336 (16:5336) +Route10Script: call EnableAutoTextBoxDrawing ld hl, Route10TrainerHeaders ld de, Route10ScriptPointers @@ -7,12 +7,12 @@ Route10Script: ; 59336 (16:5336) ld [wRoute10CurScript], a ret -Route10ScriptPointers: ; 59349 (16:5349) +Route10ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route10TextPointers: ; 5934f (16:534f) +Route10TextPointers: dw Route10Text1 dw Route10Text2 dw Route10Text3 @@ -24,8 +24,8 @@ Route10TextPointers: ; 5934f (16:534f) dw Route10Text9 dw Route10Text10 -Route10TrainerHeaders: ; 59363 (16:5363) -Route10TrainerHeader0: ; 59363 (16:5363) +Route10TrainerHeaders: +Route10TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_0 @@ -34,7 +34,7 @@ Route10TrainerHeader0: ; 59363 (16:5363) dw Route10EndBattleText1 ; TextEndBattle dw Route10EndBattleText1 ; TextEndBattle -Route10TrainerHeader1: ; 5936f (16:536f) +Route10TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_1 @@ -43,7 +43,7 @@ Route10TrainerHeader1: ; 5936f (16:536f) dw Route10EndBattleText2 ; TextEndBattle dw Route10EndBattleText2 ; TextEndBattle -Route10TrainerHeader2: ; 5937b (16:537b) +Route10TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_2 @@ -52,7 +52,7 @@ Route10TrainerHeader2: ; 5937b (16:537b) dw Route10EndBattleText3 ; TextEndBattle dw Route10EndBattleText3 ; TextEndBattle -Route10TrainerHeader3: ; 59387 (16:5387) +Route10TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_3 @@ -61,7 +61,7 @@ Route10TrainerHeader3: ; 59387 (16:5387) dw Route10EndBattleText4 ; TextEndBattle dw Route10EndBattleText4 ; TextEndBattle -Route10TrainerHeader4: ; 59393 (16:5393) +Route10TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_4 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_4 @@ -70,7 +70,7 @@ Route10TrainerHeader4: ; 59393 (16:5393) dw Route10EndBattleText5 ; TextEndBattle dw Route10EndBattleText5 ; TextEndBattle -Route10TrainerHeader5: ; 5939f (16:539f) +Route10TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_10_TRAINER_5 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_10_TRAINER_5 @@ -81,119 +81,119 @@ Route10TrainerHeader5: ; 5939f (16:539f) db $ff -Route10Text1: ; 593ac (16:53ac) +Route10Text1: TX_ASM ld hl, Route10TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route10BattleText1: ; 593b6 (16:53b6) +Route10BattleText1: TX_FAR _Route10BattleText1 db "@" -Route10EndBattleText1: ; 593bb (16:53bb) +Route10EndBattleText1: TX_FAR _Route10EndBattleText1 db "@" -Route10AfterBattleText1: ; 593c0 (16:53c0) +Route10AfterBattleText1: TX_FAR _Route10AfterBattleText1 db "@" -Route10Text2: ; 593c5 (16:53c5) +Route10Text2: TX_ASM ld hl, Route10TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route10BattleText2: ; 593cf (16:53cf) +Route10BattleText2: TX_FAR _Route10BattleText2 db "@" -Route10EndBattleText2: ; 593d4 (16:53d4) +Route10EndBattleText2: TX_FAR _Route10EndBattleText2 db "@" -Route10AfterBattleText2: ; 593d9 (16:53d9) +Route10AfterBattleText2: TX_FAR _Route10AfterBattleText2 db "@" -Route10Text3: ; 593de (16:53de) +Route10Text3: TX_ASM ld hl, Route10TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route10BattleText3: ; 593e8 (16:53e8) +Route10BattleText3: TX_FAR _Route10BattleText3 db "@" -Route10EndBattleText3: ; 593ed (16:53ed) +Route10EndBattleText3: TX_FAR _Route10EndBattleText3 db "@" -Route10AfterBattleText3: ; 593f2 (16:53f2) +Route10AfterBattleText3: TX_FAR _Route10AfterBattleText3 db "@" -Route10Text4: ; 593f7 (16:53f7) +Route10Text4: TX_ASM ld hl, Route10TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route10BattleText4: ; 59401 (16:5401) +Route10BattleText4: TX_FAR _Route10BattleText4 db "@" -Route10EndBattleText4: ; 59406 (16:5406) +Route10EndBattleText4: TX_FAR _Route10EndBattleText4 db "@" -Route10AfterBattleText4: ; 5940b (16:540b) +Route10AfterBattleText4: TX_FAR _Route10AfterBattleText4 db "@" -Route10Text5: ; 59410 (16:5410) +Route10Text5: TX_ASM ld hl, Route10TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route10BattleText5: ; 5941a (16:541a) +Route10BattleText5: TX_FAR _Route10BattleText5 db "@" -Route10EndBattleText5: ; 5941f (16:541f) +Route10EndBattleText5: TX_FAR _Route10EndBattleText5 db "@" -Route10AfterBattleText5: ; 59424 (16:5424) +Route10AfterBattleText5: TX_FAR _Route10AfterBattleText5 db "@" -Route10Text6: ; 59429 (16:5429) +Route10Text6: TX_ASM ld hl, Route10TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route10BattleText6: ; 59433 (16:5433) +Route10BattleText6: TX_FAR _Route10BattleText6 db "@" -Route10EndBattleText6: ; 59438 (16:5438) +Route10EndBattleText6: TX_FAR _Route10EndBattleText6 db "@" -Route10AfterBattleText6: ; 5943d (16:543d) +Route10AfterBattleText6: TX_FAR _Route10AfterBattleText6 db "@" -Route10Text9: ; 59442 (16:5442) -Route10Text7: ; 59442 (16:5442) +Route10Text9: +Route10Text7: TX_FAR _Route10Text7 ; _Route10Text9 db "@" -Route10Text10: ; 59447 (16:5447) +Route10Text10: TX_FAR _Route10Text10 db "@" diff --git a/scripts/route11.asm b/scripts/route11.asm index d56b7730..ab3509c5 100755 --- a/scripts/route11.asm +++ b/scripts/route11.asm @@ -1,4 +1,4 @@ -Route11Script: ; 5944c (16:544c) +Route11Script: call EnableAutoTextBoxDrawing ld hl, Route11TrainerHeaders ld de, Route11ScriptPointers @@ -7,12 +7,12 @@ Route11Script: ; 5944c (16:544c) ld [wRoute11CurScript], a ret -Route11ScriptPointers: ; 5945f (16:545f) +Route11ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route11TextPointers: ; 59465 (16:5465) +Route11TextPointers: dw Route11Text1 dw Route11Text2 dw Route11Text3 @@ -25,8 +25,8 @@ Route11TextPointers: ; 59465 (16:5465) dw Route11Text10 dw Route11Text11 -Route11TrainerHeaders: ; 5947b (16:547b) -Route11TrainerHeader0: ; 5947b (16:547b) +Route11TrainerHeaders: +Route11TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_0 @@ -35,7 +35,7 @@ Route11TrainerHeader0: ; 5947b (16:547b) dw Route11EndBattleText1 ; TextEndBattle dw Route11EndBattleText1 ; TextEndBattle -Route11TrainerHeader1: ; 59487 (16:5487) +Route11TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_1 @@ -44,7 +44,7 @@ Route11TrainerHeader1: ; 59487 (16:5487) dw Route11EndBattleText2 ; TextEndBattle dw Route11EndBattleText2 ; TextEndBattle -Route11TrainerHeader2: ; 59493 (16:5493) +Route11TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_2 @@ -53,7 +53,7 @@ Route11TrainerHeader2: ; 59493 (16:5493) dw Route11EndBattleText3 ; TextEndBattle dw Route11EndBattleText3 ; TextEndBattle -Route11TrainerHeader3: ; 5949f (16:549f) +Route11TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_3 @@ -62,7 +62,7 @@ Route11TrainerHeader3: ; 5949f (16:549f) dw Route11EndBattleText4 ; TextEndBattle dw Route11EndBattleText4 ; TextEndBattle -Route11TrainerHeader4: ; 594ab (16:54ab) +Route11TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_4 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_4 @@ -71,7 +71,7 @@ Route11TrainerHeader4: ; 594ab (16:54ab) dw Route11EndBattleText5 ; TextEndBattle dw Route11EndBattleText5 ; TextEndBattle -Route11TrainerHeader5: ; 594b7 (16:54b7) +Route11TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_5 @@ -80,7 +80,7 @@ Route11TrainerHeader5: ; 594b7 (16:54b7) dw Route11EndBattleText6 ; TextEndBattle dw Route11EndBattleText6 ; TextEndBattle -Route11TrainerHeader6: ; 594c3 (16:54c3) +Route11TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_6 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_6 @@ -89,7 +89,7 @@ Route11TrainerHeader6: ; 594c3 (16:54c3) dw Route11EndBattleText7 ; TextEndBattle dw Route11EndBattleText7 ; TextEndBattle -Route11TrainerHeader7: ; 594cf (16:54cf) +Route11TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_7, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_7, 1 @@ -98,7 +98,7 @@ Route11TrainerHeader7: ; 594cf (16:54cf) dw Route11EndBattleText8 ; TextEndBattle dw Route11EndBattleText8 ; TextEndBattle -Route11TrainerHeader8: ; 594db (16:54db) +Route11TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_8, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_8, 1 @@ -107,7 +107,7 @@ Route11TrainerHeader8: ; 594db (16:54db) dw Route11EndBattleText9 ; TextEndBattle dw Route11EndBattleText9 ; TextEndBattle -Route11TrainerHeader9: ; 594e7 (16:54e7) +Route11TrainerHeader9: dbEventFlagBit EVENT_BEAT_ROUTE_11_TRAINER_9, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_11_TRAINER_9, 1 @@ -118,186 +118,186 @@ Route11TrainerHeader9: ; 594e7 (16:54e7) db $ff -Route11Text1: ; 594f4 (16:54f4) +Route11Text1: TX_ASM ld hl, Route11TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route11BattleText1: ; 594fe (16:54fe) +Route11BattleText1: TX_FAR _Route11BattleText1 db "@" -Route11EndBattleText1: ; 59503 (16:5503) +Route11EndBattleText1: TX_FAR _Route11EndBattleText1 db "@" -Route11AfterBattleText1: ; 59508 (16:5508) +Route11AfterBattleText1: TX_FAR _Route11AfterBattleText1 db "@" -Route11Text2: ; 5950d (16:550d) +Route11Text2: TX_ASM ld hl, Route11TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route11BattleText2: ; 59517 (16:5517) +Route11BattleText2: TX_FAR _Route11BattleText2 db "@" -Route11EndBattleText2: ; 5951c (16:551c) +Route11EndBattleText2: TX_FAR _Route11EndBattleText2 db "@" -Route11AfterBattleText2: ; 59521 (16:5521) +Route11AfterBattleText2: TX_FAR _Route11AfterBattleText2 db "@" -Route11Text3: ; 59526 (16:5526) +Route11Text3: TX_ASM ld hl, Route11TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route11BattleText3: ; 59530 (16:5530) +Route11BattleText3: TX_FAR _Route11BattleText3 db "@" -Route11EndBattleText3: ; 59535 (16:5535) +Route11EndBattleText3: TX_FAR _Route11EndBattleText3 db "@" -Route11AfterBattleText3: ; 5953a (16:553a) +Route11AfterBattleText3: TX_FAR _Route11AfterBattleText3 db "@" -Route11Text4: ; 5953f (16:553f) +Route11Text4: TX_ASM ld hl, Route11TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route11BattleText4: ; 59549 (16:5549) +Route11BattleText4: TX_FAR _Route11BattleText4 db "@" -Route11EndBattleText4: ; 5954e (16:554e) +Route11EndBattleText4: TX_FAR _Route11EndBattleText4 db "@" -Route11AfterBattleText4: ; 59553 (16:5553) +Route11AfterBattleText4: TX_FAR _Route11AfterBattleText4 db "@" -Route11Text5: ; 59558 (16:5558) +Route11Text5: TX_ASM ld hl, Route11TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route11BattleText5: ; 59562 (16:5562) +Route11BattleText5: TX_FAR _Route11BattleText5 db "@" -Route11EndBattleText5: ; 59567 (16:5567) +Route11EndBattleText5: TX_FAR _Route11EndBattleText5 db "@" -Route11AfterBattleText5: ; 5956c (16:556c) +Route11AfterBattleText5: TX_FAR _Route11AfterBattleText5 db "@" -Route11Text6: ; 59571 (16:5571) +Route11Text6: TX_ASM ld hl, Route11TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route11BattleText6: ; 5957b (16:557b) +Route11BattleText6: TX_FAR _Route11BattleText6 db "@" -Route11EndBattleText6: ; 59580 (16:5580) +Route11EndBattleText6: TX_FAR _Route11EndBattleText6 db "@" -Route11AfterBattleText6: ; 59585 (16:5585) +Route11AfterBattleText6: TX_FAR _Route11AfterBattleText6 db "@" -Route11Text7: ; 5958a (16:558a) +Route11Text7: TX_ASM ld hl, Route11TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route11BattleText7: ; 59594 (16:5594) +Route11BattleText7: TX_FAR _Route11BattleText7 db "@" -Route11EndBattleText7: ; 59599 (16:5599) +Route11EndBattleText7: TX_FAR _Route11EndBattleText7 db "@" -Route11AfterBattleText7: ; 5959e (16:559e) +Route11AfterBattleText7: TX_FAR _Route11AfterBattleText7 db "@" -Route11Text8: ; 595a3 (16:55a3) +Route11Text8: TX_ASM ld hl, Route11TrainerHeader7 call TalkToTrainer jp TextScriptEnd -Route11BattleText8: ; 595ad (16:55ad) +Route11BattleText8: TX_FAR _Route11BattleText8 db "@" -Route11EndBattleText8: ; 595b2 (16:55b2) +Route11EndBattleText8: TX_FAR _Route11EndBattleText8 db "@" -Route11AfterBattleText8: ; 595b7 (16:55b7) +Route11AfterBattleText8: TX_FAR _Route11AfterBattleText8 db "@" -Route11Text9: ; 595bc (16:55bc) +Route11Text9: TX_ASM ld hl, Route11TrainerHeader8 call TalkToTrainer jp TextScriptEnd -Route11BattleText9: ; 595c6 (16:55c6) +Route11BattleText9: TX_FAR _Route11BattleText9 db "@" -Route11EndBattleText9: ; 595cb (16:55cb) +Route11EndBattleText9: TX_FAR _Route11EndBattleText9 db "@" -Route11AfterBattleText9: ; 595d0 (16:55d0) +Route11AfterBattleText9: TX_FAR _Route11AfterBattleText9 db "@" -Route11Text10: ; 595d5 (16:55d5) +Route11Text10: TX_ASM ld hl, Route11TrainerHeader9 call TalkToTrainer jp TextScriptEnd -Route11BattleText10: ; 595df (16:55df) +Route11BattleText10: TX_FAR _Route11BattleText10 db "@" -Route11EndBattleText10: ; 595e4 (16:55e4) +Route11EndBattleText10: TX_FAR _Route11EndBattleText10 db "@" -Route11AfterBattleText10: ; 595e9 (16:55e9) +Route11AfterBattleText10: TX_FAR _Route11AfterBattleText10 db "@" -Route11Text11: ; 595ee (16:55ee) +Route11Text11: TX_FAR _Route11Text11 db "@" diff --git a/scripts/route11gate.asm b/scripts/route11gate.asm index e53fc63a..9ecfe0ca 100755 --- a/scripts/route11gate.asm +++ b/scripts/route11gate.asm @@ -1,9 +1,9 @@ -Route11GateScript: ; 4940c (12:540c) +Route11GateScript: jp EnableAutoTextBoxDrawing -Route11GateTextPointers: ; 4940f (12:540f) +Route11GateTextPointers: dw Route11GateText1 -Route11GateText1: ; 49411 (12:5411) +Route11GateText1: TX_FAR _Route11GateText1 db "@" diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index e41e46e5..300b299a 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -1,21 +1,21 @@ -Route11GateUpstairsScript: ; 49454 (12:5454) +Route11GateUpstairsScript: jp DisableAutoTextBoxDrawing -Route11GateUpstairsTextPointers: ; 49457 (12:5457) +Route11GateUpstairsTextPointers: dw Route11GateUpstairsText1 dw Route11GateUpstairsText2 dw Route11GateUpstairsText3 dw Route11GateUpstairsText4 -Route11GateUpstairsText1: ; 4945f (12:545f) +Route11GateUpstairsText1: TX_ASM ld a, $0 ld [wWhichTrade], a predef DoInGameTradeDialogue -Route11GateUpstairsScriptEnd: ; 49469 (12:5469) +Route11GateUpstairsScriptEnd: jp TextScriptEnd -Route11GateUpstairsText2: ; 4946c (12:546c) +Route11GateUpstairsText2: TX_ASM CheckEvent EVENT_GOT_ITEMFINDER, 1 jr c, .asm_4949b @@ -41,13 +41,13 @@ Route11GateUpstairsText2: ; 4946c (12:546c) .asm_494a1 jr Route11GateUpstairsScriptEnd -Route11GateUpstairsText_494a3: ; 494a3 (12:54a3) +Route11GateUpstairsText_494a3: TX_FAR _Route11GateUpstairsText_494a3 db "@" -Route11GateUpstairsText3: ; 494a8 (12:54a8) +Route11GateUpstairsText3: TX_ASM - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP jp nz, GateUpstairsScript_PrintIfFacingUp CheckEvent EVENT_BEAT_ROUTE12_SNORLAX @@ -66,11 +66,11 @@ BinocularsNoSnorlaxText: TX_FAR _BinocularsNoSnorlaxText db "@" -Route11GateUpstairsText4: ; 494ce (12:54ce) +Route11GateUpstairsText4: TX_ASM ld hl, Route11GateUpstairsText_494d5 jp GateUpstairsScript_PrintIfFacingUp -Route11GateUpstairsText_494d5: ; 494d5 (12:54d5) +Route11GateUpstairsText_494d5: TX_FAR _Route11GateUpstairsText_494d5 db "@" diff --git a/scripts/route12.asm b/scripts/route12.asm index 882e687a..e61f41c0 100755 --- a/scripts/route12.asm +++ b/scripts/route12.asm @@ -1,4 +1,4 @@ -Route12Script: ; 595f3 (16:55f3) +Route12Script: call EnableAutoTextBoxDrawing ld hl, Route12TrainerHeaders ld de, Route12ScriptPointers @@ -7,20 +7,20 @@ Route12Script: ; 595f3 (16:55f3) ld [wRoute12CurScript], a ret -Route12Script_59606: ; 59606 (16:5606) +Route12Script_59606: xor a ld [wJoyIgnore], a ld [wRoute12CurScript], a ld [wCurMapScript], a ret -Route12ScriptPointers: ; 59611 (16:5611) +Route12ScriptPointers: dw Route12Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw Route12Script3 -Route12Script0: ; 59619 (16:5619) +Route12Script0: CheckEventHL EVENT_BEAT_ROUTE12_SNORLAX jp nz, CheckFightingMapTrainers CheckEventReuseHL EVENT_FIGHT_ROUTE12_SNORLAX @@ -41,7 +41,7 @@ Route12Script0: ; 59619 (16:5619) ld [wCurMapScript], a ret -Route12Script3: ; 5964c (16:564c) +Route12Script3: ld a, [wIsInBattle] cp $ff jr z, Route12Script_59606 @@ -60,7 +60,7 @@ Route12Script3: ; 5964c (16:564c) ld [wCurMapScript], a ret -Route12TextPointers: ; 59675 (16:5675) +Route12TextPointers: dw Route12Text1 dw Route12Text2 dw Route12Text3 @@ -76,8 +76,8 @@ Route12TextPointers: ; 59675 (16:5675) dw Route12Text13 dw Route12Text14 -Route12TrainerHeaders: ; 59691 (16:5691) -Route12TrainerHeader0: ; 59691 (16:5691) +Route12TrainerHeaders: +Route12TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_0 @@ -86,7 +86,7 @@ Route12TrainerHeader0: ; 59691 (16:5691) dw Route12EndBattleText1 ; TextEndBattle dw Route12EndBattleText1 ; TextEndBattle -Route12TrainerHeader1: ; 5969d (16:569d) +Route12TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_1 @@ -95,7 +95,7 @@ Route12TrainerHeader1: ; 5969d (16:569d) dw Route12EndBattleText2 ; TextEndBattle dw Route12EndBattleText2 ; TextEndBattle -Route12TrainerHeader2: ; 596a9 (16:56a9) +Route12TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_2 @@ -104,7 +104,7 @@ Route12TrainerHeader2: ; 596a9 (16:56a9) dw Route12EndBattleText3 ; TextEndBattle dw Route12EndBattleText3 ; TextEndBattle -Route12TrainerHeader3: ; 596b5 (16:56b5) +Route12TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_3 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_3 @@ -113,7 +113,7 @@ Route12TrainerHeader3: ; 596b5 (16:56b5) dw Route12EndBattleText4 ; TextEndBattle dw Route12EndBattleText4 ; TextEndBattle -Route12TrainerHeader4: ; 596c1 (16:56c1) +Route12TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_4 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_4 @@ -122,7 +122,7 @@ Route12TrainerHeader4: ; 596c1 (16:56c1) dw Route12EndBattleText5 ; TextEndBattle dw Route12EndBattleText5 ; TextEndBattle -Route12TrainerHeader5: ; 596cd (16:56cd) +Route12TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_5 @@ -131,7 +131,7 @@ Route12TrainerHeader5: ; 596cd (16:56cd) dw Route12EndBattleText6 ; TextEndBattle dw Route12EndBattleText6 ; TextEndBattle -Route12TrainerHeader6: ; 596d9 (16:56d9) +Route12TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_12_TRAINER_6, 1 db ($1 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_12_TRAINER_6, 1 @@ -142,148 +142,148 @@ Route12TrainerHeader6: ; 596d9 (16:56d9) db $ff -Route12Text1: ; 596e6 (16:56e6) +Route12Text1: TX_FAR _Route12Text1 db "@" -Route12Text13: ; 596eb (16:56eb) +Route12Text13: TX_FAR _Route12Text13 db "@" -Route12Text14: ; 596f0 (16:56f0) +Route12Text14: TX_FAR _Route12Text14 db "@" -Route12Text2: ; 596f5 (16:56f5) +Route12Text2: TX_ASM ld hl, Route12TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route12BattleText1: ; 596ff (16:56ff) +Route12BattleText1: TX_FAR _Route12BattleText1 db "@" -Route12EndBattleText1: ; 59704 (16:5704) +Route12EndBattleText1: TX_FAR _Route12EndBattleText1 db "@" -Route12AfterBattleText1: ; 59709 (16:5709) +Route12AfterBattleText1: TX_FAR _Route12AfterBattleText1 db "@" -Route12Text3: ; 5970e (16:570e) +Route12Text3: TX_ASM ld hl, Route12TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route12BattleText2: ; 59718 (16:5718) +Route12BattleText2: TX_FAR _Route12BattleText2 db "@" -Route12EndBattleText2: ; 5971d (16:571d) +Route12EndBattleText2: TX_FAR _Route12EndBattleText2 db "@" -Route12AfterBattleText2: ; 59722 (16:5722) +Route12AfterBattleText2: TX_FAR _Route12AfterBattleText2 db "@" -Route12Text4: ; 59727 (16:5727) +Route12Text4: TX_ASM ld hl, Route12TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route12BattleText3: ; 59731 (16:5731) +Route12BattleText3: TX_FAR _Route12BattleText3 db "@" -Route12EndBattleText3: ; 59736 (16:5736) +Route12EndBattleText3: TX_FAR _Route12EndBattleText3 db "@" -Route12AfterBattleText3: ; 5973b (16:573b) +Route12AfterBattleText3: TX_FAR _Route12AfterBattleText3 db "@" -Route12Text5: ; 59740 (16:5740) +Route12Text5: TX_ASM ld hl, Route12TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route12BattleText4: ; 5974a (16:574a) +Route12BattleText4: TX_FAR _Route12BattleText4 db "@" -Route12EndBattleText4: ; 5974f (16:574f) +Route12EndBattleText4: TX_FAR _Route12EndBattleText4 db "@" -Route12AfterBattleText4: ; 59754 (16:5754) +Route12AfterBattleText4: TX_FAR _Route12AfterBattleText4 db "@" -Route12Text6: ; 59759 (16:5759) +Route12Text6: TX_ASM ld hl, Route12TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route12BattleText5: ; 59763 (16:5763) +Route12BattleText5: TX_FAR _Route12BattleText5 db "@" -Route12EndBattleText5: ; 59768 (16:5768) +Route12EndBattleText5: TX_FAR _Route12EndBattleText5 db "@" -Route12AfterBattleText5: ; 5976d (16:576d) +Route12AfterBattleText5: TX_FAR _Route12AfterBattleText5 db "@" -Route12Text7: ; 59772 (16:5772) +Route12Text7: TX_ASM ld hl, Route12TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route12BattleText6: ; 5977c (16:577c) +Route12BattleText6: TX_FAR _Route12BattleText6 db "@" -Route12EndBattleText6: ; 59781 (16:5781) +Route12EndBattleText6: TX_FAR _Route12EndBattleText6 db "@" -Route12AfterBattleText6: ; 59786 (16:5786) +Route12AfterBattleText6: TX_FAR _Route12AfterBattleText6 db "@" -Route12Text8: ; 5978b (16:578b) +Route12Text8: TX_ASM ld hl, Route12TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route12BattleText7: ; 59795 (16:5795) +Route12BattleText7: TX_FAR _Route12BattleText7 db "@" -Route12EndBattleText7: ; 5979a (16:579a) +Route12EndBattleText7: TX_FAR _Route12EndBattleText7 db "@" -Route12AfterBattleText7: ; 5979f (16:579f) +Route12AfterBattleText7: TX_FAR _Route12AfterBattleText7 db "@" -Route12Text11: ; 597a4 (16:57a4) +Route12Text11: TX_FAR _Route12Text11 db "@" -Route12Text12: ; 597a9 (16:57a9) +Route12Text12: TX_FAR _Route12Text12 db "@" diff --git a/scripts/route12gate.asm b/scripts/route12gate.asm index d8f09c92..8474100d 100755 --- a/scripts/route12gate.asm +++ b/scripts/route12gate.asm @@ -1,9 +1,9 @@ -Route12GateScript: ; 49504 (12:5504) +Route12GateScript: jp EnableAutoTextBoxDrawing -Route12GateTextPointers: ; 49507 (12:5507) +Route12GateTextPointers: dw Route12GateText1 -Route12GateText1: ; 49509 (12:5509) +Route12GateText1: TX_FAR _Route12GateText1 db "@" diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index e7ad5cbf..bdbbf526 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -1,12 +1,12 @@ -Route12GateUpstairsScript: ; 49560 (12:5560) +Route12GateUpstairsScript: jp DisableAutoTextBoxDrawing -Route12GateUpstairsTextPointers: ; 49563 (12:5563) +Route12GateUpstairsTextPointers: dw Route12GateUpstairsText1 dw Route12GateUpstairsText2 dw Route12GateUpstairsText3 -Route12GateUpstairsText1: ; 49569 (12:5569) +Route12GateUpstairsText1: TX_ASM CheckEvent EVENT_GOT_TM39, 1 jr c, .asm_0ad3c @@ -29,42 +29,42 @@ Route12GateUpstairsText1: ; 49569 (12:5569) .asm_4ba56 jp TextScriptEnd -TM39PreReceiveText: ; 4959c (12:559c) +TM39PreReceiveText: TX_FAR _TM39PreReceiveText db "@" -ReceivedTM39Text: ; 495a1 (12:55a1) +ReceivedTM39Text: TX_FAR _ReceivedTM39Text db $0B, "@" -TM39ExplanationText: ; 495a7 (12:55a7) +TM39ExplanationText: TX_FAR _TM39ExplanationText db "@" -TM39NoRoomText: ; 495ac (12:55ac) +TM39NoRoomText: TX_FAR _TM39NoRoomText db "@" -Route12GateUpstairsText2: ; 495b1 (12:55b1) +Route12GateUpstairsText2: TX_ASM ld hl, Route12GateUpstairsText_495b8 jp GateUpstairsScript_PrintIfFacingUp -Route12GateUpstairsText_495b8: ; 495b8 (12:55b8) +Route12GateUpstairsText_495b8: TX_FAR _Route12GateUpstairsText_495b8 db "@" -Route12GateUpstairsText3: ; 495bd (12:55bd) +Route12GateUpstairsText3: TX_ASM ld hl, Route12GateUpstairsText_495c4 jp GateUpstairsScript_PrintIfFacingUp -Route12GateUpstairsText_495c4: ; 495c4 (12:55c4) +Route12GateUpstairsText_495c4: TX_FAR _Route12GateUpstairsText_495c4 db "@" -GateUpstairsScript_PrintIfFacingUp: ; 495c9 (12:55c9) - ld a, [wSpriteStateData1 + 9] +GateUpstairsScript_PrintIfFacingUp: + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_UP jr z, .up ld a, $1 diff --git a/scripts/route12house.asm b/scripts/route12house.asm index bb065f1c..7ee86731 100755 --- a/scripts/route12house.asm +++ b/scripts/route12house.asm @@ -1,10 +1,10 @@ -Route12HouseScript: ; 5647f (15:647f) +Route12HouseScript: jp EnableAutoTextBoxDrawing -Route12HouseTextPointers: ; 56482 (15:6482) +Route12HouseTextPointers: dw Route12HouseText1 -Route12HouseText1: ; 56484 (15:6484) +Route12HouseText1: TX_ASM ld a, [wd728] bit 5, a @@ -34,24 +34,24 @@ Route12HouseText1: ; 56484 (15:6484) call PrintText jp TextScriptEnd -Route12HouseText_564c0: ; 564c0 (15:64c0) +Route12HouseText_564c0: TX_FAR _Route12HouseText_564c0 db "@" -Route12HouseText_564c5: ; 564c5 (15:64c5) +Route12HouseText_564c5: TX_FAR _Route12HouseText_564c5 db $0B TX_FAR _Route12HouseText_564ca db "@" -Route12HouseText_564cf: ; 564cf (15:64cf) +Route12HouseText_564cf: TX_FAR _Route12HouseText_564cf db "@" -Route12HouseText_564d4: ; 564d4 (15:64d4) +Route12HouseText_564d4: TX_FAR _Route12HouseText_564d4 db "@" -Route12HouseText_564d9: ; 564d9 (15:64d9) +Route12HouseText_564d9: TX_FAR _Route12HouseText_564d9 db "@" diff --git a/scripts/route13.asm b/scripts/route13.asm index 911c15af..61f43ee9 100755 --- a/scripts/route13.asm +++ b/scripts/route13.asm @@ -1,4 +1,4 @@ -Route13Script: ; 5581e (15:581e) +Route13Script: call EnableAutoTextBoxDrawing ld hl, Route13TrainerHeaders ld de, Route13ScriptPointers @@ -7,12 +7,12 @@ Route13Script: ; 5581e (15:581e) ld [wRoute13CurScript], a ret -Route13ScriptPointers: ; 55831 (15:5831) +Route13ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route13TextPointers: ; 55837 (15:5837) +Route13TextPointers: dw Route13Text1 dw Route13Text2 dw Route13Text3 @@ -27,8 +27,8 @@ Route13TextPointers: ; 55837 (15:5837) dw Route13Text12 dw Route13Text13 -Route13TrainerHeaders: ; 55851 (15:5851) -Route13TrainerHeader0: ; 55851 (15:5851) +Route13TrainerHeaders: +Route13TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_0 @@ -37,7 +37,7 @@ Route13TrainerHeader0: ; 55851 (15:5851) dw Route13EndBattleText2 ; TextEndBattle dw Route13EndBattleText2 ; TextEndBattle -Route13TrainerHeader2: ; 5585d (15:585d) +Route13TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_2 @@ -46,7 +46,7 @@ Route13TrainerHeader2: ; 5585d (15:585d) dw Route13EndBattleText3 ; TextEndBattle dw Route13EndBattleText3 ; TextEndBattle -Route13TrainerHeader3: ; 55869 (15:5869) +Route13TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_3 @@ -55,7 +55,7 @@ Route13TrainerHeader3: ; 55869 (15:5869) dw Route13EndBattleText4 ; TextEndBattle dw Route13EndBattleText4 ; TextEndBattle -Route13TrainerHeader4: ; 55875 (15:5875) +Route13TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_4 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_4 @@ -64,7 +64,7 @@ Route13TrainerHeader4: ; 55875 (15:5875) dw Route13EndBattleText5 ; TextEndBattle dw Route13EndBattleText5 ; TextEndBattle -Route13TrainerHeader5: ; 55881 (15:5881) +Route13TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_5 @@ -73,7 +73,7 @@ Route13TrainerHeader5: ; 55881 (15:5881) dw Route13EndBattleText6 ; TextEndBattle dw Route13EndBattleText6 ; TextEndBattle -Route13TrainerHeader6: ; 5588d (15:588d) +Route13TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_6 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_6 @@ -82,7 +82,7 @@ Route13TrainerHeader6: ; 5588d (15:588d) dw Route13EndBattleText7 ; TextEndBattle dw Route13EndBattleText7 ; TextEndBattle -Route13TrainerHeader7: ; 55899 (15:5899) +Route13TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_7 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_7 @@ -91,7 +91,7 @@ Route13TrainerHeader7: ; 55899 (15:5899) dw Route13EndBattleText8 ; TextEndBattle dw Route13EndBattleText8 ; TextEndBattle -Route13TrainerHeader8: ; 558a5 (15:58a5) +Route13TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_8, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_8, 1 @@ -100,7 +100,7 @@ Route13TrainerHeader8: ; 558a5 (15:58a5) dw Route13EndBattleText9 ; TextEndBattle dw Route13EndBattleText9 ; TextEndBattle -Route13TrainerHeader9: ; 558b1 (15:58b1) +Route13TrainerHeader9: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_9, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_9, 1 @@ -109,7 +109,7 @@ Route13TrainerHeader9: ; 558b1 (15:58b1) dw Route13EndBattleText10 ; TextEndBattle dw Route13EndBattleText10 ; TextEndBattle -Route13TrainerHeader10: ; 558bd (15:58bd) +Route13TrainerHeader10: dbEventFlagBit EVENT_BEAT_ROUTE_13_TRAINER_10, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_13_TRAINER_10, 1 @@ -120,194 +120,194 @@ Route13TrainerHeader10: ; 558bd (15:58bd) db $ff -Route13Text1: ; 558ca (15:58ca) +Route13Text1: TX_ASM ld hl, Route13TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route13BattleText2: ; 558d4 (15:58d4) +Route13BattleText2: TX_FAR _Route13BattleText2 db "@" -Route13EndBattleText2: ; 558d9 (15:58d9) +Route13EndBattleText2: TX_FAR _Route13EndBattleText2 db "@" -Route13AfterBattleText2: ; 558de (15:58de) +Route13AfterBattleText2: TX_FAR _Route13AfterBattleText2 db "@" -Route13Text2: ; 558e3 (15:58e3) +Route13Text2: TX_ASM ld hl, Route13TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route13BattleText3: ; 558ed (15:58ed) +Route13BattleText3: TX_FAR _Route13BattleText3 db "@" -Route13EndBattleText3: ; 558f2 (15:58f2) +Route13EndBattleText3: TX_FAR _Route13EndBattleText3 db "@" -Route13AfterBattleText3: ; 558f7 (15:58f7) +Route13AfterBattleText3: TX_FAR _Route13AfterBattleText3 db "@" -Route13Text3: ; 558fc (15:58fc) +Route13Text3: TX_ASM ld hl, Route13TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route13BattleText4: ; 55906 (15:5906) +Route13BattleText4: TX_FAR _Route13BattleText4 db "@" -Route13EndBattleText4: ; 5590b (15:590b) +Route13EndBattleText4: TX_FAR _Route13EndBattleText4 db "@" -Route13AfterBattleText4: ; 55910 (15:5910) +Route13AfterBattleText4: TX_FAR _Route13AfterBattleText4 db "@" -Route13Text4: ; 55915 (15:5915) +Route13Text4: TX_ASM ld hl, Route13TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route13BattleText5: ; 5591f (15:591f) +Route13BattleText5: TX_FAR _Route13BattleText5 db "@" -Route13EndBattleText5: ; 55924 (15:5924) +Route13EndBattleText5: TX_FAR _Route13EndBattleText5 db "@" -Route13AfterBattleText5: ; 55929 (15:5929) +Route13AfterBattleText5: TX_FAR _Route13AfterBattleText5 db "@" -Route13Text5: ; 5592e (15:592e) +Route13Text5: TX_ASM ld hl, Route13TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route13BattleText6: ; 55938 (15:5938) +Route13BattleText6: TX_FAR _Route13BattleText6 db "@" -Route13EndBattleText6: ; 5593d (15:593d) +Route13EndBattleText6: TX_FAR _Route13EndBattleText6 db "@" -Route13AfterBattleText6: ; 55942 (15:5942) +Route13AfterBattleText6: TX_FAR _Route13AfterBattleText6 db "@" -Route13Text6: ; 55947 (15:5947) +Route13Text6: TX_ASM ld hl, Route13TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route13BattleText7: ; 55951 (15:5951) +Route13BattleText7: TX_FAR _Route13BattleText7 db "@" -Route13EndBattleText7: ; 55956 (15:5956) +Route13EndBattleText7: TX_FAR _Route13EndBattleText7 db "@" -Route13AfterBattleText7: ; 5595b (15:595b) +Route13AfterBattleText7: TX_FAR _Route13AfterBattleText7 db "@" -Route13Text7: ; 55960 (15:5960) +Route13Text7: TX_ASM ld hl, Route13TrainerHeader7 call TalkToTrainer jp TextScriptEnd -Route13BattleText8: ; 5596a (15:596a) +Route13BattleText8: TX_FAR _Route13BattleText8 db "@" -Route13EndBattleText8: ; 5596f (15:596f) +Route13EndBattleText8: TX_FAR _Route13EndBattleText8 db "@" -Route13AfterBattleText8: ; 55974 (15:5974) +Route13AfterBattleText8: TX_FAR _Route13AfterBattleText8 db "@" -Route13Text8: ; 55979 (15:5979) +Route13Text8: TX_ASM ld hl, Route13TrainerHeader8 call TalkToTrainer jp TextScriptEnd -Route13BattleText9: ; 55983 (15:5983) +Route13BattleText9: TX_FAR _Route13BattleText9 db "@" -Route13EndBattleText9: ; 55988 (15:5988) +Route13EndBattleText9: TX_FAR _Route13EndBattleText9 db "@" -Route13AfterBattleText9: ; 5598d (15:598d) +Route13AfterBattleText9: TX_FAR _Route13AfterBattleText9 db "@" -Route13Text9: ; 55992 (15:5992) +Route13Text9: TX_ASM ld hl, Route13TrainerHeader9 call TalkToTrainer jp TextScriptEnd -Route13BattleText10: ; 5599c (15:599c) +Route13BattleText10: TX_FAR _Route13BattleText10 db "@" -Route13EndBattleText10: ; 559a1 (15:59a1) +Route13EndBattleText10: TX_FAR _Route13EndBattleText10 db "@" -Route13AfterBattleText10: ; 559a6 (15:59a6) +Route13AfterBattleText10: TX_FAR _Route13AfterBattleText10 db "@" -Route13Text10: ; 559ab (15:59ab) +Route13Text10: TX_ASM ld hl, Route13TrainerHeader10 call TalkToTrainer jp TextScriptEnd -Route13BattleText11: ; 559b5 (15:59b5) +Route13BattleText11: TX_FAR _Route13BattleText11 db "@" -Route13EndBattleText11: ; 559ba (15:59ba) +Route13EndBattleText11: TX_FAR _Route13EndBattleText11 db "@" -Route13AfterBattleText11: ; 559bf (15:59bf) +Route13AfterBattleText11: TX_FAR _Route13AfterBattleText11 db "@" -Route13Text11: ; 559c4 (15:59c4) +Route13Text11: TX_FAR _Route13Text11 db "@" -Route13Text12: ; 559c9 (15:59c9) +Route13Text12: TX_FAR _Route13Text12 db "@" -Route13Text13: ; 559ce (15:59ce) +Route13Text13: TX_FAR _Route13Text13 db "@" diff --git a/scripts/route14.asm b/scripts/route14.asm index 9970b817..70f747c5 100755 --- a/scripts/route14.asm +++ b/scripts/route14.asm @@ -1,4 +1,4 @@ -Route14Script: ; 559d3 (15:59d3) +Route14Script: call EnableAutoTextBoxDrawing ld hl, Route14TrainerHeaders ld de, Route14ScriptPointers @@ -7,12 +7,12 @@ Route14Script: ; 559d3 (15:59d3) ld [wRoute14CurScript], a ret -Route14ScriptPointers: ; 559e6 (15:59e6) +Route14ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route14TextPointers: ; 559ec (15:59ec) +Route14TextPointers: dw Route14Text1 dw Route14Text2 dw Route14Text3 @@ -25,8 +25,8 @@ Route14TextPointers: ; 559ec (15:59ec) dw Route14Text10 dw Route14Text11 -Route14TrainerHeaders: ; 55a02 (15:5a02) -Route14TrainerHeader0: ; 55a02 (15:5a02) +Route14TrainerHeaders: +Route14TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_0 @@ -35,7 +35,7 @@ Route14TrainerHeader0: ; 55a02 (15:5a02) dw Route14EndBattleText1 ; TextEndBattle dw Route14EndBattleText1 ; TextEndBattle -Route14TrainerHeader1: ; 55a0e (15:5a0e) +Route14TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_1 @@ -44,7 +44,7 @@ Route14TrainerHeader1: ; 55a0e (15:5a0e) dw Route14EndBattleText2 ; TextEndBattle dw Route14EndBattleText2 ; TextEndBattle -Route14TrainerHeader2: ; 55a1a (15:5a1a) +Route14TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_2 @@ -53,7 +53,7 @@ Route14TrainerHeader2: ; 55a1a (15:5a1a) dw Route14EndBattleText3 ; TextEndBattle dw Route14EndBattleText3 ; TextEndBattle -Route14TrainerHeader3: ; 55a26 (15:5a26) +Route14TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_3 @@ -62,7 +62,7 @@ Route14TrainerHeader3: ; 55a26 (15:5a26) dw Route14EndBattleText4 ; TextEndBattle dw Route14EndBattleText4 ; TextEndBattle -Route14TrainerHeader4: ; 55a32 (15:5a32) +Route14TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_4 @@ -71,7 +71,7 @@ Route14TrainerHeader4: ; 55a32 (15:5a32) dw Route14EndBattleText5 ; TextEndBattle dw Route14EndBattleText5 ; TextEndBattle -Route14TrainerHeader5: ; 55a3e (15:5a3e) +Route14TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_5 @@ -80,7 +80,7 @@ Route14TrainerHeader5: ; 55a3e (15:5a3e) dw Route14EndBattleText6 ; TextEndBattle dw Route14EndBattleText6 ; TextEndBattle -Route14TrainerHeader6: ; 55a4a (15:5a4a) +Route14TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_6 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_6 @@ -89,7 +89,7 @@ Route14TrainerHeader6: ; 55a4a (15:5a4a) dw Route14EndBattleText7 ; TextEndBattle dw Route14EndBattleText7 ; TextEndBattle -Route14TrainerHeader7: ; 55a56 (15:5a56) +Route14TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_7, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_7, 1 @@ -98,7 +98,7 @@ Route14TrainerHeader7: ; 55a56 (15:5a56) dw Route14EndBattleText8 ; TextEndBattle dw Route14EndBattleText8 ; TextEndBattle -Route14TrainerHeader8: ; 55a62 (15:5a62) +Route14TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_8, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_8, 1 @@ -107,7 +107,7 @@ Route14TrainerHeader8: ; 55a62 (15:5a62) dw Route14EndBattleText9 ; TextEndBattle dw Route14EndBattleText9 ; TextEndBattle -Route14TrainerHeader9: ; 55a6e (15:5a6e) +Route14TrainerHeader9: dbEventFlagBit EVENT_BEAT_ROUTE_14_TRAINER_9, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_14_TRAINER_9, 1 @@ -118,186 +118,186 @@ Route14TrainerHeader9: ; 55a6e (15:5a6e) db $ff -Route14Text1: ; 55a7b (15:5a7b) +Route14Text1: TX_ASM ld hl, Route14TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route14BattleText1: ; 55a85 (15:5a85) +Route14BattleText1: TX_FAR _Route14BattleText1 db "@" -Route14EndBattleText1: ; 55a8a (15:5a8a) +Route14EndBattleText1: TX_FAR _Route14EndBattleText1 db "@" -Route14AfterBattleText1: ; 55a8f (15:5a8f) +Route14AfterBattleText1: TX_FAR _Route14AfterBattleText1 db "@" -Route14Text2: ; 55a94 (15:5a94) +Route14Text2: TX_ASM ld hl, Route14TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route14BattleText2: ; 55a9e (15:5a9e) +Route14BattleText2: TX_FAR _Route14BattleText2 db "@" -Route14EndBattleText2: ; 55aa3 (15:5aa3) +Route14EndBattleText2: TX_FAR _Route14EndBattleText2 db "@" -Route14AfterBattleText2: ; 55aa8 (15:5aa8) +Route14AfterBattleText2: TX_FAR _Route14AfterBattleText2 db "@" -Route14Text3: ; 55aad (15:5aad) +Route14Text3: TX_ASM ld hl, Route14TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route14BattleText3: ; 55ab7 (15:5ab7) +Route14BattleText3: TX_FAR _Route14BattleText3 db "@" -Route14EndBattleText3: ; 55abc (15:5abc) +Route14EndBattleText3: TX_FAR _Route14EndBattleText3 db "@" -Route14AfterBattleText3: ; 55ac1 (15:5ac1) +Route14AfterBattleText3: TX_FAR _Route14AfterBattleText3 db "@" -Route14Text4: ; 55ac6 (15:5ac6) +Route14Text4: TX_ASM ld hl, Route14TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route14BattleText4: ; 55ad0 (15:5ad0) +Route14BattleText4: TX_FAR _Route14BattleText4 db "@" -Route14EndBattleText4: ; 55ad5 (15:5ad5) +Route14EndBattleText4: TX_FAR _Route14EndBattleText4 db "@" -Route14AfterBattleText4: ; 55ada (15:5ada) +Route14AfterBattleText4: TX_FAR _Route14AfterBattleText4 db "@" -Route14Text5: ; 55adf (15:5adf) +Route14Text5: TX_ASM ld hl, Route14TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route14BattleText5: ; 55ae9 (15:5ae9) +Route14BattleText5: TX_FAR _Route14BattleText5 db "@" -Route14EndBattleText5: ; 55aee (15:5aee) +Route14EndBattleText5: TX_FAR _Route14EndBattleText5 db "@" -Route14AfterBattleText5: ; 55af3 (15:5af3) +Route14AfterBattleText5: TX_FAR _Route14AfterBattleText5 db "@" -Route14Text6: ; 55af8 (15:5af8) +Route14Text6: TX_ASM ld hl, Route14TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route14BattleText6: ; 55b02 (15:5b02) +Route14BattleText6: TX_FAR _Route14BattleText6 db "@" -Route14EndBattleText6: ; 55b07 (15:5b07) +Route14EndBattleText6: TX_FAR _Route14EndBattleText6 db "@" -Route14AfterBattleText6: ; 55b0c (15:5b0c) +Route14AfterBattleText6: TX_FAR _Route14AfterBattleText6 db "@" -Route14Text7: ; 55b11 (15:5b11) +Route14Text7: TX_ASM ld hl, Route14TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route14BattleText7: ; 55b1b (15:5b1b) +Route14BattleText7: TX_FAR _Route14BattleText7 db "@" -Route14EndBattleText7: ; 55b20 (15:5b20) +Route14EndBattleText7: TX_FAR _Route14EndBattleText7 db "@" -Route14AfterBattleText7: ; 55b25 (15:5b25) +Route14AfterBattleText7: TX_FAR _Route14AfterBattleText7 db "@" -Route14Text8: ; 55b2a (15:5b2a) +Route14Text8: TX_ASM ld hl, Route14TrainerHeader7 call TalkToTrainer jp TextScriptEnd -Route14BattleText8: ; 55b34 (15:5b34) +Route14BattleText8: TX_FAR _Route14BattleText8 db "@" -Route14EndBattleText8: ; 55b39 (15:5b39) +Route14EndBattleText8: TX_FAR _Route14EndBattleText8 db "@" -Route14AfterBattleText8: ; 55b3e (15:5b3e) +Route14AfterBattleText8: TX_FAR _Route14AfterBattleText8 db "@" -Route14Text9: ; 55b43 (15:5b43) +Route14Text9: TX_ASM ld hl, Route14TrainerHeader8 call TalkToTrainer jp TextScriptEnd -Route14BattleText9: ; 55b4d (15:5b4d) +Route14BattleText9: TX_FAR _Route14BattleText9 db "@" -Route14EndBattleText9: ; 55b52 (15:5b52) +Route14EndBattleText9: TX_FAR _Route14EndBattleText9 db "@" -Route14AfterBattleText9: ; 55b57 (15:5b57) +Route14AfterBattleText9: TX_FAR _Route14AfterBattleText9 db "@" -Route14Text10: ; 55b5c (15:5b5c) +Route14Text10: TX_ASM ld hl, Route14TrainerHeader9 call TalkToTrainer jp TextScriptEnd -Route14BattleText10: ; 55b66 (15:5b66) +Route14BattleText10: TX_FAR _Route14BattleText10 db "@" -Route14EndBattleText10: ; 55b6b (15:5b6b) +Route14EndBattleText10: TX_FAR _Route14EndBattleText10 db "@" -Route14AfterBattleText10: ; 55b70 (15:5b70) +Route14AfterBattleText10: TX_FAR _Route14AfterBattleText10 db "@" -Route14Text11: ; 55b75 (15:5b75) +Route14Text11: TX_FAR _Route14Text11 db "@" diff --git a/scripts/route15.asm b/scripts/route15.asm index 5f58b996..e3329ab4 100755 --- a/scripts/route15.asm +++ b/scripts/route15.asm @@ -1,4 +1,4 @@ -Route15Script: ; 597ae (16:57ae) +Route15Script: call EnableAutoTextBoxDrawing ld hl, Route15TrainerHeaders ld de, Route15ScriptPointers @@ -7,12 +7,12 @@ Route15Script: ; 597ae (16:57ae) ld [wRoute15CurScript], a ret -Route15ScriptPointers: ; 597c1 (16:57c1) +Route15ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route15TextPointers: ; 597c7 (16:57c7) +Route15TextPointers: dw Route15Text1 dw Route15Text2 dw Route15Text3 @@ -26,8 +26,8 @@ Route15TextPointers: ; 597c7 (16:57c7) dw PickUpItemText dw Route15Text12 -Route15TrainerHeaders: ; 597df (16:57df) -Route15TrainerHeader0: ; 597df (16:57df) +Route15TrainerHeaders: +Route15TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_0 @@ -36,7 +36,7 @@ Route15TrainerHeader0: ; 597df (16:57df) dw Route15EndBattleText1 ; TextEndBattle dw Route15EndBattleText1 ; TextEndBattle -Route15TrainerHeader1: ; 597eb (16:57eb) +Route15TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_1 @@ -45,7 +45,7 @@ Route15TrainerHeader1: ; 597eb (16:57eb) dw Route15EndBattleText2 ; TextEndBattle dw Route15EndBattleText2 ; TextEndBattle -Route15TrainerHeader2: ; 597f7 (16:57f7) +Route15TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_2 @@ -54,7 +54,7 @@ Route15TrainerHeader2: ; 597f7 (16:57f7) dw Route15EndBattleText3 ; TextEndBattle dw Route15EndBattleText3 ; TextEndBattle -Route15TrainerHeader3: ; 59803 (16:5803) +Route15TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_3 @@ -63,7 +63,7 @@ Route15TrainerHeader3: ; 59803 (16:5803) dw Route15EndBattleText4 ; TextEndBattle dw Route15EndBattleText4 ; TextEndBattle -Route15TrainerHeader4: ; 5980f (16:580f) +Route15TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_4 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_4 @@ -72,7 +72,7 @@ Route15TrainerHeader4: ; 5980f (16:580f) dw Route15EndBattleText5 ; TextEndBattle dw Route15EndBattleText5 ; TextEndBattle -Route15TrainerHeader5: ; 5981b (16:581b) +Route15TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_5 @@ -81,7 +81,7 @@ Route15TrainerHeader5: ; 5981b (16:581b) dw Route15EndBattleText6 ; TextEndBattle dw Route15EndBattleText6 ; TextEndBattle -Route15TrainerHeader6: ; 59827 (16:5827) +Route15TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_6 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_6 @@ -90,7 +90,7 @@ Route15TrainerHeader6: ; 59827 (16:5827) dw Route15EndBattleText7 ; TextEndBattle dw Route15EndBattleText7 ; TextEndBattle -Route15TrainerHeader7: ; 59833 (16:5833) +Route15TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_7, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_7, 1 @@ -99,7 +99,7 @@ Route15TrainerHeader7: ; 59833 (16:5833) dw Route15EndBattleText8 ; TextEndBattle dw Route15EndBattleText8 ; TextEndBattle -Route15TrainerHeader8: ; 5983f (16:583f) +Route15TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_8, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_8, 1 @@ -108,7 +108,7 @@ Route15TrainerHeader8: ; 5983f (16:583f) dw Route15EndBattleText9 ; TextEndBattle dw Route15EndBattleText9 ; TextEndBattle -Route15TrainerHeader9: ; 5984b (16:584b) +Route15TrainerHeader9: dbEventFlagBit EVENT_BEAT_ROUTE_15_TRAINER_9, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_15_TRAINER_9, 1 @@ -119,178 +119,178 @@ Route15TrainerHeader9: ; 5984b (16:584b) db $ff -Route15Text1: ; 59858 (16:5858) +Route15Text1: TX_ASM ld hl, Route15TrainerHeader0 jr Route15TalkToTrainer -Route15Text2: ; 5985e (16:585e) +Route15Text2: TX_ASM ld hl, Route15TrainerHeader1 jr Route15TalkToTrainer -Route15Text3: ; 59864 (16:5864) +Route15Text3: TX_ASM ld hl, Route15TrainerHeader2 jr Route15TalkToTrainer -Route15Text4: ; 5986a (16:586a) +Route15Text4: TX_ASM ld hl, Route15TrainerHeader3 jr Route15TalkToTrainer -Route15Text5: ; 59870 (16:5870) +Route15Text5: TX_ASM ld hl, Route15TrainerHeader4 jr Route15TalkToTrainer -Route15Text6: ; 59876 (16:5876) +Route15Text6: TX_ASM ld hl, Route15TrainerHeader5 jr Route15TalkToTrainer -Route15Text7: ; 5987c (16:587c) +Route15Text7: TX_ASM ld hl, Route15TrainerHeader6 jr Route15TalkToTrainer -Route15Text8: ; 59882 (16:5882) +Route15Text8: TX_ASM ld hl, Route15TrainerHeader7 jr Route15TalkToTrainer -Route15Text9: ; 59888 (16:5888) +Route15Text9: TX_ASM ld hl, Route15TrainerHeader8 jr Route15TalkToTrainer -Route15Text10: ; 5988e (16:588e) +Route15Text10: TX_ASM ld hl, Route15TrainerHeader9 -Route15TalkToTrainer: ; 59892 (16:5892) +Route15TalkToTrainer: call TalkToTrainer jp TextScriptEnd -Route15BattleText1: ; 59898 (16:5898) +Route15BattleText1: TX_FAR _Route15BattleText1 db "@" -Route15EndBattleText1: ; 5989d (16:589d) +Route15EndBattleText1: TX_FAR _Route15EndBattleText1 db "@" -Route15AfterBattleText1: ; 598a2 (16:58a2) +Route15AfterBattleText1: TX_FAR _Route15AfterBattleText1 db "@" -Route15BattleText2: ; 598a7 (16:58a7) +Route15BattleText2: TX_FAR _Route15BattleText2 db "@" -Route15EndBattleText2: ; 598ac (16:58ac) +Route15EndBattleText2: TX_FAR _Route15EndBattleText2 db "@" -Route15AfterBattleText2: ; 598b1 (16:58b1) +Route15AfterBattleText2: TX_FAR _Route15AfterBattleText2 db "@" -Route15BattleText3: ; 598b6 (16:58b6) +Route15BattleText3: TX_FAR _Route15BattleText3 db "@" -Route15EndBattleText3: ; 598bb (16:58bb) +Route15EndBattleText3: TX_FAR _Route15EndBattleText3 db "@" -Route15AfterBattleText3: ; 598c0 (16:58c0) +Route15AfterBattleText3: TX_FAR _Route15AfterBattleText3 db "@" -Route15BattleText4: ; 598c5 (16:58c5) +Route15BattleText4: TX_FAR _Route15BattleText4 db "@" -Route15EndBattleText4: ; 598ca (16:58ca) +Route15EndBattleText4: TX_FAR _Route15EndBattleText4 db "@" -Route15AfterBattleText4: ; 598cf (16:58cf) +Route15AfterBattleText4: TX_FAR _Route15AfterBattleText4 db "@" -Route15BattleText5: ; 598d4 (16:58d4) +Route15BattleText5: TX_FAR _Route15BattleText5 db "@" -Route15EndBattleText5: ; 598d9 (16:58d9) +Route15EndBattleText5: TX_FAR _Route15EndBattleText5 db "@" -Route15AfterBattleText5: ; 598de (16:58de) +Route15AfterBattleText5: TX_FAR _Route15AfterBattleText5 db "@" -Route15BattleText6: ; 598e3 (16:58e3) +Route15BattleText6: TX_FAR _Route15BattleText6 db "@" -Route15EndBattleText6: ; 598e8 (16:58e8) +Route15EndBattleText6: TX_FAR _Route15EndBattleText6 db "@" -Route15AfterBattleText6: ; 598ed (16:58ed) +Route15AfterBattleText6: TX_FAR _Route15AfterBattleText6 db "@" -Route15BattleText7: ; 598f2 (16:58f2) +Route15BattleText7: TX_FAR _Route15BattleText7 db "@" -Route15EndBattleText7: ; 598f7 (16:58f7) +Route15EndBattleText7: TX_FAR _Route15EndBattleText7 db "@" -Route15AfterBattleText7: ; 598fc (16:58fc) +Route15AfterBattleText7: TX_FAR _Route15AfterBattleText7 db "@" -Route15BattleText8: ; 59901 (16:5901) +Route15BattleText8: TX_FAR _Route15BattleText8 db "@" -Route15EndBattleText8: ; 59906 (16:5906) +Route15EndBattleText8: TX_FAR _Route15EndBattleText8 db "@" -Route15AfterBattleText8: ; 5990b (16:590b) +Route15AfterBattleText8: TX_FAR _Route15AfterBattleText8 db "@" -Route15BattleText9: ; 59910 (16:5910) +Route15BattleText9: TX_FAR _Route15BattleText9 db "@" -Route15EndBattleText9: ; 59915 (16:5915) +Route15EndBattleText9: TX_FAR _Route15EndBattleText9 db "@" -Route15AfterBattleText9: ; 5991a (16:591a) +Route15AfterBattleText9: TX_FAR _Route15AfterBattleText9 db "@" -Route15BattleText10: ; 5991f (16:591f) +Route15BattleText10: TX_FAR _Route15BattleText10 db "@" -Route15EndBattleText10: ; 59924 (16:5924) +Route15EndBattleText10: TX_FAR _Route15EndBattleText10 db "@" -Route15AfterBattleText10: ; 59929 (16:5929) +Route15AfterBattleText10: TX_FAR _Route15AfterBattleText10 db "@" -Route15Text12: ; 5992e (16:592e) +Route15Text12: TX_FAR _Route15Text12 db "@" diff --git a/scripts/route15gate.asm b/scripts/route15gate.asm index 76e9aadf..40db02dd 100755 --- a/scripts/route15gate.asm +++ b/scripts/route15gate.asm @@ -1,9 +1,9 @@ -Route15GateScript: ; 49602 (12:5602) +Route15GateScript: jp EnableAutoTextBoxDrawing -Route15GateTextPointers: ; 49605 (12:5605) +Route15GateTextPointers: dw Route15GateText1 -Route15GateText1: ; 49607 (12:5607) +Route15GateText1: TX_FAR _Route15GateText1 db "@" diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index 14e3bc5d..c7f6a2ad 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -1,11 +1,11 @@ -Route15GateUpstairsScript: ; 4964a (12:564a) +Route15GateUpstairsScript: jp DisableAutoTextBoxDrawing -Route15GateUpstairsTextPointers: ; 4964d (12:564d) +Route15GateUpstairsTextPointers: dw Route15GateUpstairsText1 dw Route15GateUpstairsText2 -Route15GateUpstairsText1: ; 49651 (12:5651) +Route15GateUpstairsText1: TX_ASM CheckEvent EVENT_GOT_EXP_ALL jr nz, .asm_49683 @@ -30,15 +30,15 @@ Route15GateUpstairsText1: ; 49651 (12:5651) .asm_49689 jp TextScriptEnd -Route15GateUpstairsText_4968c: ; 4968c (12:568c) +Route15GateUpstairsText_4968c: TX_FAR _Route15GateUpstairsText_4968c db "@" -Route15GateUpstairsText2: ; 49691 (12:5691) +Route15GateUpstairsText2: TX_ASM ld hl, Route15GateUpstairsText_49698 jp GateUpstairsScript_PrintIfFacingUp -Route15GateUpstairsText_49698: ; 49698 (12:5698) +Route15GateUpstairsText_49698: TX_FAR _Route15GateUpstairsText_49698 db "@" diff --git a/scripts/route16.asm b/scripts/route16.asm index 1f6ba9a3..fe38fac4 100755 --- a/scripts/route16.asm +++ b/scripts/route16.asm @@ -1,4 +1,4 @@ -Route16Script: ; 59933 (16:5933) +Route16Script: call EnableAutoTextBoxDrawing ld hl, Route16TrainerHeaders ld de, Route16ScriptPointers @@ -7,20 +7,20 @@ Route16Script: ; 59933 (16:5933) ld [wRoute16CurScript], a ret -Route16Script_59946: ; 59946 (16:5946) +Route16Script_59946: xor a ld [wJoyIgnore], a ld [wRoute16CurScript], a ld [wCurMapScript], a ret -Route16ScriptPointers: ; 59951 (16:5951) +Route16ScriptPointers: dw Route16Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw Route16Script3 -Route16Script0: ; 59959 (16:5959) +Route16Script0: CheckEventHL EVENT_BEAT_ROUTE16_SNORLAX jp nz, CheckFightingMapTrainers CheckEventReuseHL EVENT_FIGHT_ROUTE16_SNORLAX @@ -42,7 +42,7 @@ Route16Script0: ; 59959 (16:5959) ld [wCurMapScript], a ret -Route16Script3: ; 5998f (16:598f) +Route16Script3: ld a, [wIsInBattle] cp $ff jp z, Route16Script_59946 @@ -61,7 +61,7 @@ Route16Script3: ; 5998f (16:598f) ld [wCurMapScript], a ret -Route16TextPointers: ; 599b9 (16:59b9) +Route16TextPointers: dw Route16Text1 dw Route16Text2 dw Route16Text3 @@ -74,8 +74,8 @@ Route16TextPointers: ; 599b9 (16:59b9) dw Route16Text10 dw Route16Text11 -Route16TrainerHeaders: ; 599cf (16:59cf) -Route16TrainerHeader0: ; 599cf (16:59cf) +Route16TrainerHeaders: +Route16TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_0 @@ -84,7 +84,7 @@ Route16TrainerHeader0: ; 599cf (16:59cf) dw Route16EndBattleText1 ; TextEndBattle dw Route16EndBattleText1 ; TextEndBattle -Route16TrainerHeader1: ; 599db (16:59db) +Route16TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_1 @@ -93,7 +93,7 @@ Route16TrainerHeader1: ; 599db (16:59db) dw Route16EndBattleText2 ; TextEndBattle dw Route16EndBattleText2 ; TextEndBattle -Route16TrainerHeader2: ; 599e7 (16:59e7) +Route16TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_2 @@ -102,7 +102,7 @@ Route16TrainerHeader2: ; 599e7 (16:59e7) dw Route16EndBattleText3 ; TextEndBattle dw Route16EndBattleText3 ; TextEndBattle -Route16TrainerHeader3: ; 599f3 (16:59f3) +Route16TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_3 @@ -111,7 +111,7 @@ Route16TrainerHeader3: ; 599f3 (16:59f3) dw Route16EndBattleText4 ; TextEndBattle dw Route16EndBattleText4 ; TextEndBattle -Route16TrainerHeader4: ; 599ff (16:59ff) +Route16TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_4 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_4 @@ -120,7 +120,7 @@ Route16TrainerHeader4: ; 599ff (16:59ff) dw Route16EndBattleText5 ; TextEndBattle dw Route16EndBattleText5 ; TextEndBattle -Route16TrainerHeader5: ; 59a0b (16:5a0b) +Route16TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_16_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_16_TRAINER_5 @@ -131,130 +131,130 @@ Route16TrainerHeader5: ; 59a0b (16:5a0b) db $ff -Route16Text1: ; 59a18 (16:5a18) +Route16Text1: TX_ASM ld hl, Route16TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route16BattleText1: ; 59a22 (16:5a22) +Route16BattleText1: TX_FAR _Route16BattleText1 db "@" -Route16EndBattleText1: ; 59a27 (16:5a27) +Route16EndBattleText1: TX_FAR _Route16EndBattleText1 db "@" -Route16AfterBattleText1: ; 59a2c (16:5a2c) +Route16AfterBattleText1: TX_FAR _Route16AfterBattleText1 db "@" -Route16Text2: ; 59a31 (16:5a31) +Route16Text2: TX_ASM ld hl, Route16TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route16BattleText2: ; 59a3b (16:5a3b) +Route16BattleText2: TX_FAR _Route16BattleText2 db "@" -Route16EndBattleText2: ; 59a40 (16:5a40) +Route16EndBattleText2: TX_FAR _Route16EndBattleText2 db "@" -Route16AfterBattleText2: ; 59a45 (16:5a45) +Route16AfterBattleText2: TX_FAR _Route16AfterBattleText2 db "@" -Route16Text3: ; 59a4a (16:5a4a) +Route16Text3: TX_ASM ld hl, Route16TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route16BattleText3: ; 59a54 (16:5a54) +Route16BattleText3: TX_FAR _Route16BattleText3 db "@" -Route16EndBattleText3: ; 59a59 (16:5a59) +Route16EndBattleText3: TX_FAR _Route16EndBattleText3 db "@" -Route16AfterBattleText3: ; 59a5e (16:5a5e) +Route16AfterBattleText3: TX_FAR _Route16AfterBattleText3 db "@" -Route16Text4: ; 59a63 (16:5a63) +Route16Text4: TX_ASM ld hl, Route16TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route16BattleText4: ; 59a6d (16:5a6d) +Route16BattleText4: TX_FAR _Route16BattleText4 db "@" -Route16EndBattleText4: ; 59a72 (16:5a72) +Route16EndBattleText4: TX_FAR _Route16EndBattleText4 db "@" -Route16AfterBattleText4: ; 59a77 (16:5a77) +Route16AfterBattleText4: TX_FAR _Route16AfterBattleText4 db "@" -Route16Text5: ; 59a7c (16:5a7c) +Route16Text5: TX_ASM ld hl, Route16TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route16BattleText5: ; 59a86 (16:5a86) +Route16BattleText5: TX_FAR _Route16BattleText5 db "@" -Route16EndBattleText5: ; 59a8b (16:5a8b) +Route16EndBattleText5: TX_FAR _Route16EndBattleText5 db "@" -Route16AfterBattleText5: ; 59a90 (16:5a90) +Route16AfterBattleText5: TX_FAR _Route16AfterBattleText5 db "@" -Route16Text6: ; 59a95 (16:5a95) +Route16Text6: TX_ASM ld hl, Route16TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route16BattleText6: ; 59a9f (16:5a9f) +Route16BattleText6: TX_FAR _Route16BattleText6 db "@" -Route16EndBattleText6: ; 59aa4 (16:5aa4) +Route16EndBattleText6: TX_FAR _Route16EndBattleText6 db "@" -Route16AfterBattleText6: ; 59aa9 (16:5aa9) +Route16AfterBattleText6: TX_FAR _Route16AfterBattleText6 db "@" -Route16Text7: ; 59aae (16:5aae) +Route16Text7: TX_FAR _Route16Text7 db "@" -Route16Text10: ; 59ab3 (16:5ab3) +Route16Text10: TX_FAR _Route16Text10 db "@" -Route16Text11: ; 59ab8 (16:5ab8) +Route16Text11: TX_FAR _Route16Text11 db "@" -Route16Text8: ; 59abd (16:5abd) +Route16Text8: TX_FAR _Route16Text8 db "@" -Route16Text9: ; 59ac2 (16:5ac2) +Route16Text9: TX_FAR _Route16Text9 db "@" diff --git a/scripts/route16gate.asm b/scripts/route16gate.asm index 12be6b91..df478b1f 100755 --- a/scripts/route16gate.asm +++ b/scripts/route16gate.asm @@ -1,4 +1,4 @@ -Route16GateScript: ; 496be (12:56be) +Route16GateScript: ld hl, wd732 res 5, [hl] call EnableAutoTextBoxDrawing @@ -6,13 +6,13 @@ Route16GateScript: ; 496be (12:56be) ld hl, Route16GateScriptPointers jp JumpTable -Route16GateScriptPointers: ; 496cf (12:56cf) +Route16GateScriptPointers: dw Route16GateScript0 dw Route16GateScript1 dw Route16GateScript2 dw Route16GateScript3 -Route16GateScript0: ; 496d7 (12:56d7) +Route16GateScript0: call Route16GateScript_49755 ret nz ld hl, CoordsData_49714 @@ -43,21 +43,21 @@ Route16GateScript0: ; 496d7 (12:56d7) ld [wRoute16GateCurScript], a ret -CoordsData_49714: ; 49714 (12:5714) +CoordsData_49714: db $07,$04 db $08,$04 db $09,$04 db $0A,$04 db $FF -Route16GateScript1: ; 4971d (12:571d) +Route16GateScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz ld a, $f0 ld [wJoyIgnore], a -Route16GateScript2: ; 49727 (12:5727) +Route16GateScript2: ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -70,7 +70,7 @@ Route16GateScript2: ; 49727 (12:5727) ld [wRoute16GateCurScript], a ret -Route16GateScript3: ; 49741 (12:5741) +Route16GateScript3: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -82,16 +82,16 @@ Route16GateScript3: ; 49741 (12:5741) ld [wRoute16GateCurScript], a ret -Route16GateScript_49755: ; 49755 (12:5755) +Route16GateScript_49755: ld b, BICYCLE jp IsItemInBag -Route16GateTextPointers: ; 4975a (12:575a) +Route16GateTextPointers: dw Route16GateText1 dw Route16GateText2 dw Route16GateText3 -Route16GateText1: ; 49760 (12:5760) +Route16GateText1: TX_ASM call Route16GateScript_49755 jr z, .asm_0bdf3 @@ -104,18 +104,18 @@ Route16GateText1: ; 49760 (12:5760) .asm_56c9d jp TextScriptEnd -Route16GateText_49777: ; 49777 (12:5777) +Route16GateText_49777: TX_FAR _Route16GateText_49777 db "@" -Route16GateText_4977c: ; 4977c (12:577c) +Route16GateText_4977c: TX_FAR _Route16GateText_4977c db "@" -Route16GateText3: ; 49781 (12:5781) +Route16GateText3: TX_FAR _Route16GateText_49781 db "@" -Route16GateText2: ; 49786 (12:5786) +Route16GateText2: TX_FAR _Route16GateText2 db "@" diff --git a/scripts/route16gateupstairs.asm b/scripts/route16gateupstairs.asm index 64b43e10..664976a2 100755 --- a/scripts/route16gateupstairs.asm +++ b/scripts/route16gateupstairs.asm @@ -1,46 +1,46 @@ -Route16GateUpstairsScript: ; 4980b (12:580b) +Route16GateUpstairsScript: jp DisableAutoTextBoxDrawing -Route16GateUpstairsTextPointers: ; 4980e (12:580e) +Route16GateUpstairsTextPointers: dw Route16GateUpstairsText1 dw Route16GateUpstairsText2 dw Route16GateUpstairsText3 dw Route16GateUpstairsText4 -Route16GateUpstairsText1: ; 49816 (12:5816) +Route16GateUpstairsText1: TX_ASM ld hl, Route16GateUpstairsText_49820 call PrintText jp TextScriptEnd -Route16GateUpstairsText_49820: ; 49820 (12:5820) +Route16GateUpstairsText_49820: TX_FAR _Route16GateUpstairsText_49820 db "@" -Route16GateUpstairsText2: ; 49825 (12:5825) +Route16GateUpstairsText2: TX_ASM ld hl, Route16GateUpstairsText_4982f call PrintText jp TextScriptEnd -Route16GateUpstairsText_4982f: ; 4982f (12:582f) +Route16GateUpstairsText_4982f: TX_FAR _Route16GateUpstairsText_4982f db "@" -Route16GateUpstairsText3: ; 49834 (12:5834) +Route16GateUpstairsText3: TX_ASM ld hl, Route16GateUpstairsText_4983b jp GateUpstairsScript_PrintIfFacingUp -Route16GateUpstairsText_4983b: ; 4983b (12:583b) +Route16GateUpstairsText_4983b: TX_FAR _Route16GateUpstairsText_4983b db "@" -Route16GateUpstairsText4: ; 49840 (12:5840) +Route16GateUpstairsText4: TX_ASM ld hl, Route16GateUpstairsText_49847 jp GateUpstairsScript_PrintIfFacingUp -Route16GateUpstairsText_49847: ; 49847 (12:5847) +Route16GateUpstairsText_49847: TX_FAR _Route16GateUpstairsText_49847 db "@" diff --git a/scripts/route16house.asm b/scripts/route16house.asm index ee23fd89..d8c9d5ed 100755 --- a/scripts/route16house.asm +++ b/scripts/route16house.asm @@ -1,11 +1,11 @@ -Route16HouseScript: ; 1e5f8 (7:65f8) +Route16HouseScript: jp EnableAutoTextBoxDrawing -Route16HouseTextPointers: ; 1e5fb (7:65fb) +Route16HouseTextPointers: dw Route16HouseText1 dw Route16HouseText2 -Route16HouseText1: ; 1e5ff (7:65ff) +Route16HouseText1: TX_ASM CheckEvent EVENT_GOT_HM02 ld hl, HM02ExplanationText @@ -24,23 +24,23 @@ Route16HouseText1: ; 1e5ff (7:65ff) call PrintText jp TextScriptEnd -Route16HouseText3: ; 1e62b (7:662b) +Route16HouseText3: TX_FAR _Route16HouseText3 db "@" -ReceivedHM02Text: ; 1e630 (7:6630) +ReceivedHM02Text: TX_FAR _ReceivedHM02Text db $11, "@" -HM02ExplanationText: ; 1e636 (7:6636) +HM02ExplanationText: TX_FAR _HM02ExplanationText db "@" -HM02NoRoomText: ; 1e63b (7:663b) +HM02NoRoomText: TX_FAR _HM02NoRoomText db "@" -Route16HouseText2: ; 1e640 (7:6640) +Route16HouseText2: TX_ASM ld hl, Route16HouseText_1e652 call PrintText @@ -49,6 +49,6 @@ Route16HouseText2: ; 1e640 (7:6640) call WaitForSoundToFinish jp TextScriptEnd -Route16HouseText_1e652: ; 1e652 (7:6652) +Route16HouseText_1e652: TX_FAR _Route16HouseText_1e652 db "@" diff --git a/scripts/route17.asm b/scripts/route17.asm index f2a021a7..ddf92c2d 100755 --- a/scripts/route17.asm +++ b/scripts/route17.asm @@ -1,4 +1,4 @@ -Route17Script: ; 55b7a (15:5b7a) +Route17Script: call EnableAutoTextBoxDrawing ld hl, Route17TrainerHeaders ld de, Route17ScriptPointers @@ -7,12 +7,12 @@ Route17Script: ; 55b7a (15:5b7a) ld [wRoute17CurScript], a ret -Route17ScriptPointers: ; 55b8d (15:5b8d) +Route17ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route17TextPointers: ; 55b93 (15:5b93) +Route17TextPointers: dw Route17Text1 dw Route17Text2 dw Route17Text3 @@ -30,8 +30,8 @@ Route17TextPointers: ; 55b93 (15:5b93) dw Route17Text15 dw Route17Text16 -Route17TrainerHeaders: ; 55bb3 (15:5bb3) -Route17TrainerHeader0: ; 55bb3 (15:5bb3) +Route17TrainerHeaders: +Route17TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_0 @@ -40,7 +40,7 @@ Route17TrainerHeader0: ; 55bb3 (15:5bb3) dw Route17EndBattleText1 ; TextEndBattle dw Route17EndBattleText1 ; TextEndBattle -Route17TrainerHeader1: ; 55bbf (15:5bbf) +Route17TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_1 @@ -49,7 +49,7 @@ Route17TrainerHeader1: ; 55bbf (15:5bbf) dw Route17EndBattleText2 ; TextEndBattle dw Route17EndBattleText2 ; TextEndBattle -Route17TrainerHeader2: ; 55bcb (15:5bcb) +Route17TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_2 @@ -58,7 +58,7 @@ Route17TrainerHeader2: ; 55bcb (15:5bcb) dw Route17EndBattleText3 ; TextEndBattle dw Route17EndBattleText3 ; TextEndBattle -Route17TrainerHeader3: ; 55bd7 (15:5bd7) +Route17TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_3 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_3 @@ -67,7 +67,7 @@ Route17TrainerHeader3: ; 55bd7 (15:5bd7) dw Route17EndBattleText4 ; TextEndBattle dw Route17EndBattleText4 ; TextEndBattle -Route17TrainerHeader4: ; 55be3 (15:5be3) +Route17TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_4 @@ -76,7 +76,7 @@ Route17TrainerHeader4: ; 55be3 (15:5be3) dw Route17EndBattleText5 ; TextEndBattle dw Route17EndBattleText5 ; TextEndBattle -Route17TrainerHeader5: ; 55bef (15:5bef) +Route17TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_5 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_5 @@ -85,7 +85,7 @@ Route17TrainerHeader5: ; 55bef (15:5bef) dw Route17EndBattleText6 ; TextEndBattle dw Route17EndBattleText6 ; TextEndBattle -Route17TrainerHeader6: ; 55bfb (15:5bfb) +Route17TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_6 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_6 @@ -94,7 +94,7 @@ Route17TrainerHeader6: ; 55bfb (15:5bfb) dw Route17EndBattleText7 ; TextEndBattle dw Route17EndBattleText7 ; TextEndBattle -Route17TrainerHeader7: ; 55c07 (15:5c07) +Route17TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_7, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_7, 1 @@ -103,7 +103,7 @@ Route17TrainerHeader7: ; 55c07 (15:5c07) dw Route17EndBattleText8 ; TextEndBattle dw Route17EndBattleText8 ; TextEndBattle -Route17TrainerHeader8: ; 55c13 (15:5c13) +Route17TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_8, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_8, 1 @@ -112,7 +112,7 @@ Route17TrainerHeader8: ; 55c13 (15:5c13) dw Route17EndBattleText9 ; TextEndBattle dw Route17EndBattleText9 ; TextEndBattle -Route17TrainerHeader9: ; 55c1f (15:5c1f) +Route17TrainerHeader9: dbEventFlagBit EVENT_BEAT_ROUTE_17_TRAINER_9, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_17_TRAINER_9, 1 @@ -123,206 +123,206 @@ Route17TrainerHeader9: ; 55c1f (15:5c1f) db $ff -Route17Text1: ; 55c2c (15:5c2c) +Route17Text1: TX_ASM ld hl, Route17TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route17BattleText1: ; 55c36 (15:5c36) +Route17BattleText1: TX_FAR _Route17BattleText1 db "@" -Route17EndBattleText1: ; 55c3b (15:5c3b) +Route17EndBattleText1: TX_FAR _Route17EndBattleText1 db "@" -Route17AfterBattleText1: ; 55c40 (15:5c40) +Route17AfterBattleText1: TX_FAR _Route17AfterBattleText1 db "@" -Route17Text2: ; 55c45 (15:5c45) +Route17Text2: TX_ASM ld hl, Route17TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route17BattleText2: ; 55c4f (15:5c4f) +Route17BattleText2: TX_FAR _Route17BattleText2 db "@" -Route17EndBattleText2: ; 55c54 (15:5c54) +Route17EndBattleText2: TX_FAR _Route17EndBattleText2 db "@" -Route17AfterBattleText2: ; 55c59 (15:5c59) +Route17AfterBattleText2: TX_FAR _Route17AfterBattleText2 db "@" -Route17Text3: ; 55c5e (15:5c5e) +Route17Text3: TX_ASM ld hl, Route17TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route17BattleText3: ; 55c68 (15:5c68) +Route17BattleText3: TX_FAR _Route17BattleText3 db "@" -Route17EndBattleText3: ; 55c6d (15:5c6d) +Route17EndBattleText3: TX_FAR _Route17EndBattleText3 db "@" -Route17AfterBattleText3: ; 55c72 (15:5c72) +Route17AfterBattleText3: TX_FAR _Route17AfterBattleText3 db "@" -Route17Text4: ; 55c77 (15:5c77) +Route17Text4: TX_ASM ld hl, Route17TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route17BattleText4: ; 55c81 (15:5c81) +Route17BattleText4: TX_FAR _Route17BattleText4 db "@" -Route17EndBattleText4: ; 55c86 (15:5c86) +Route17EndBattleText4: TX_FAR _Route17EndBattleText4 db "@" -Route17AfterBattleText4: ; 55c8b (15:5c8b) +Route17AfterBattleText4: TX_FAR _Route17AfterBattleText4 db "@" -Route17Text5: ; 55c90 (15:5c90) +Route17Text5: TX_ASM ld hl, Route17TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route17BattleText5: ; 55c9a (15:5c9a) +Route17BattleText5: TX_FAR _Route17BattleText5 db "@" -Route17EndBattleText5: ; 55c9f (15:5c9f) +Route17EndBattleText5: TX_FAR _Route17EndBattleText5 db "@" -Route17AfterBattleText5: ; 55ca4 (15:5ca4) +Route17AfterBattleText5: TX_FAR _Route17AfterBattleText5 db "@" -Route17Text6: ; 55ca9 (15:5ca9) +Route17Text6: TX_ASM ld hl, Route17TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route17BattleText6: ; 55cb3 (15:5cb3) +Route17BattleText6: TX_FAR _Route17BattleText6 db "@" -Route17EndBattleText6: ; 55cb8 (15:5cb8) +Route17EndBattleText6: TX_FAR _Route17EndBattleText6 db "@" -Route17AfterBattleText6: ; 55cbd (15:5cbd) +Route17AfterBattleText6: TX_FAR _Route17AfterBattleText6 db "@" -Route17Text7: ; 55cc2 (15:5cc2) +Route17Text7: TX_ASM ld hl, Route17TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route17BattleText7: ; 55ccc (15:5ccc) +Route17BattleText7: TX_FAR _Route17BattleText7 db "@" -Route17EndBattleText7: ; 55cd1 (15:5cd1) +Route17EndBattleText7: TX_FAR _Route17EndBattleText7 db "@" -Route17AfterBattleText7: ; 55cd6 (15:5cd6) +Route17AfterBattleText7: TX_FAR _Route17AfterBattleText7 db "@" -Route17Text8: ; 55cdb (15:5cdb) +Route17Text8: TX_ASM ld hl, Route17TrainerHeader7 call TalkToTrainer jp TextScriptEnd -Route17BattleText8: ; 55ce5 (15:5ce5) +Route17BattleText8: TX_FAR _Route17BattleText8 db "@" -Route17EndBattleText8: ; 55cea (15:5cea) +Route17EndBattleText8: TX_FAR _Route17EndBattleText8 db "@" -Route17AfterBattleText8: ; 55cef (15:5cef) +Route17AfterBattleText8: TX_FAR _Route17AfterBattleText8 db "@" -Route17Text9: ; 55cf4 (15:5cf4) +Route17Text9: TX_ASM ld hl, Route17TrainerHeader8 call TalkToTrainer jp TextScriptEnd -Route17BattleText9: ; 55cfe (15:5cfe) +Route17BattleText9: TX_FAR _Route17BattleText9 db "@" -Route17EndBattleText9: ; 55d03 (15:5d03) +Route17EndBattleText9: TX_FAR _Route17EndBattleText9 db "@" -Route17AfterBattleText9: ; 55d08 (15:5d08) +Route17AfterBattleText9: TX_FAR _Route17AfterBattleText9 db "@" -Route17Text10: ; 55d0d (15:5d0d) +Route17Text10: TX_ASM ld hl, Route17TrainerHeader9 call TalkToTrainer jp TextScriptEnd -Route17BattleText10: ; 55d17 (15:5d17) +Route17BattleText10: TX_FAR _Route17BattleText10 db "@" -Route17EndBattleText10: ; 55d1c (15:5d1c) +Route17EndBattleText10: TX_FAR _Route17EndBattleText10 db "@" -Route17AfterBattleText10: ; 55d21 (15:5d21) +Route17AfterBattleText10: TX_FAR _Route17AfterBattleText10 db "@" -Route17Text11: ; 55d26 (15:5d26) +Route17Text11: TX_FAR _Route17Text11 db "@" -Route17Text12: ; 55d2b (15:5d2b) +Route17Text12: TX_FAR _Route17Text12 db "@" -Route17Text13: ; 55d30 (15:5d30) +Route17Text13: TX_FAR _Route17Text13 db "@" -Route17Text14: ; 55d35 (15:5d35) +Route17Text14: TX_FAR _Route17Text14 db "@" -Route17Text15: ; 55d3a (15:5d3a) +Route17Text15: TX_FAR _Route17Text15 db "@" -Route17Text16: ; 55d3f (15:5d3f) +Route17Text16: TX_FAR _Route17Text16 db "@" diff --git a/scripts/route18.asm b/scripts/route18.asm index 1f0c651a..7b654e7c 100755 --- a/scripts/route18.asm +++ b/scripts/route18.asm @@ -1,4 +1,4 @@ -Route18Script: ; 59ac7 (16:5ac7) +Route18Script: call EnableAutoTextBoxDrawing ld hl, Route18TrainerHeaders ld de, Route18ScriptPointers @@ -7,20 +7,20 @@ Route18Script: ; 59ac7 (16:5ac7) ld [wRoute18CurScript], a ret -Route18ScriptPointers: ; 59ada (16:5ada) +Route18ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route18TextPointers: ; 59ae0 (16:5ae0) +Route18TextPointers: dw Route18Text1 dw Route18Text2 dw Route18Text3 dw Route18Text4 dw Route18Text5 -Route18TrainerHeaders: ; 59aea (16:5aea) -Route18TrainerHeader0: ; 59aea (16:5aea) +Route18TrainerHeaders: +Route18TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_0 @@ -29,7 +29,7 @@ Route18TrainerHeader0: ; 59aea (16:5aea) dw Route18EndBattleText1 ; TextEndBattle dw Route18EndBattleText1 ; TextEndBattle -Route18TrainerHeader1: ; 59af6 (16:5af6) +Route18TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_1 @@ -38,7 +38,7 @@ Route18TrainerHeader1: ; 59af6 (16:5af6) dw Route18EndBattleText2 ; TextEndBattle dw Route18EndBattleText2 ; TextEndBattle -Route18TrainerHeader2: ; 59b02 (16:5b02) +Route18TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_18_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_18_TRAINER_2 @@ -49,65 +49,65 @@ Route18TrainerHeader2: ; 59b02 (16:5b02) db $ff -Route18Text1: ; 59b0f (16:5b0f) +Route18Text1: TX_ASM ld hl, Route18TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route18BattleText1: ; 59b19 (16:5b19) +Route18BattleText1: TX_FAR _Route18BattleText1 db "@" -Route18EndBattleText1: ; 59b1e (16:5b1e) +Route18EndBattleText1: TX_FAR _Route18EndBattleText1 db "@" -Route18AfterBattleText1: ; 59b23 (16:5b23) +Route18AfterBattleText1: TX_FAR _Route18AfterBattleText1 db "@" -Route18Text2: ; 59b28 (16:5b28) +Route18Text2: TX_ASM ld hl, Route18TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route18BattleText2: ; 59b32 (16:5b32) +Route18BattleText2: TX_FAR _Route18BattleText2 db "@" -Route18EndBattleText2: ; 59b37 (16:5b37) +Route18EndBattleText2: TX_FAR _Route18EndBattleText2 db "@" -Route18AfterBattleText2: ; 59b3c (16:5b3c) +Route18AfterBattleText2: TX_FAR _Route18AfterBattleText2 db "@" -Route18Text3: ; 59b41 (16:5b41) +Route18Text3: TX_ASM ld hl, Route18TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route18BattleText3: ; 59b4b (16:5b4b) +Route18BattleText3: TX_FAR _Route18BattleText3 db "@" -Route18EndBattleText3: ; 59b50 (16:5b50) +Route18EndBattleText3: TX_FAR _Route18EndBattleText3 db "@" -Route18AfterBattleText3: ; 59b55 (16:5b55) +Route18AfterBattleText3: TX_FAR _Route18AfterBattleText3 db "@" -Route18Text4: ; 59b5a (16:5b5a) +Route18Text4: TX_FAR _Route18Text4 db "@" -Route18Text5: ; 59b5f (16:5b5f) +Route18Text5: TX_FAR _Route18Text5 db "@" ; 59b64 diff --git a/scripts/route18gate.asm b/scripts/route18gate.asm index 7067064b..186ea61b 100755 --- a/scripts/route18gate.asm +++ b/scripts/route18gate.asm @@ -1,4 +1,4 @@ -Route18GateScript: ; 49876 (12:5876) +Route18GateScript: ld hl, wd732 res 5, [hl] call EnableAutoTextBoxDrawing @@ -6,13 +6,13 @@ Route18GateScript: ; 49876 (12:5876) ld hl, Route18GateScriptPointers jp JumpTable -Route18GateScriptPointers: ; 49887 (12:5887) +Route18GateScriptPointers: dw Route18GateScript0 dw Route18GateScript1 dw Route18GateScript2 dw Route18GateScript3 -Route18GateScript0: ; 4988f (12:588f) +Route18GateScript0: call Route16GateScript_49755 ret nz ld hl, CoordsData_498cc @@ -43,21 +43,21 @@ Route18GateScript0: ; 4988f (12:588f) ld [wRoute18GateCurScript], a ret -CoordsData_498cc: ; 498cc (12:58cc) +CoordsData_498cc: db $03,$04 db $04,$04 db $05,$04 db $06,$04 db $FF -Route18GateScript1: ; 498d5 (12:58d5) +Route18GateScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz ld a, $f0 ld [wJoyIgnore], a -Route18GateScript2: ; 498df (12:58df) +Route18GateScript2: ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -70,7 +70,7 @@ Route18GateScript2: ; 498df (12:58df) ld [wRoute18GateCurScript], a ret -Route18GateScript3: ; 498f9 (12:58f9) +Route18GateScript3: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -82,11 +82,11 @@ Route18GateScript3: ; 498f9 (12:58f9) ld [wRoute18GateCurScript], a ret -Route18GateTextPointers: ; 4990d (12:590d) +Route18GateTextPointers: dw Route18GateText1 dw Route18GateText2 -Route18GateText1: ; 49911 (12:5911) +Route18GateText1: TX_ASM call Route16GateScript_49755 jr z, .asm_3c84d @@ -99,14 +99,14 @@ Route18GateText1: ; 49911 (12:5911) .asm_a8410 jp TextScriptEnd -Route18GateText_49928: ; 49928 (12:5928) +Route18GateText_49928: TX_FAR _Route18GateText_49928 db "@" -Route18GateText_4992d: ; 4992d (12:592d) +Route18GateText_4992d: TX_FAR _Route18GateText_4992d db "@" -Route18GateText2: ; 49932 (12:5932) +Route18GateText2: TX_FAR _Route18GateText_49932 db "@" diff --git a/scripts/route18gateupstairs.asm b/scripts/route18gateupstairs.asm index 4e1014e0..3d623142 100755 --- a/scripts/route18gateupstairs.asm +++ b/scripts/route18gateupstairs.asm @@ -1,32 +1,32 @@ -Route18GateUpstairsScript: ; 49975 (12:5975) +Route18GateUpstairsScript: jp DisableAutoTextBoxDrawing -Route18GateUpstairsTextPointers: ; 49978 (12:5978) +Route18GateUpstairsTextPointers: dw Route18GateUpstairsText1 dw Route18GateUpstairsText2 dw Route18GateUpstairsText3 -Route18GateUpstairsText1: ; 4997e (12:597e) +Route18GateUpstairsText1: TX_ASM ld a, $5 ld [wWhichTrade], a predef DoInGameTradeDialogue jp TextScriptEnd -Route18GateUpstairsText2: ; 4998c (12:598c) +Route18GateUpstairsText2: TX_ASM ld hl, Route18GateUpstairsText_49993 jp GateUpstairsScript_PrintIfFacingUp -Route18GateUpstairsText_49993: ; 49993 (12:5993) +Route18GateUpstairsText_49993: TX_FAR _Route18GateUpstairsText_49993 db "@" -Route18GateUpstairsText3: ; 49998 (12:5998) +Route18GateUpstairsText3: TX_ASM ld hl, Route18GateUpstairsText_4999f jp GateUpstairsScript_PrintIfFacingUp -Route18GateUpstairsText_4999f: ; 4999f (12:599f) +Route18GateUpstairsText_4999f: TX_FAR _Route18GateUpstairsText_4999f db "@" diff --git a/scripts/route19.asm b/scripts/route19.asm index dd8a2e76..162c4548 100755 --- a/scripts/route19.asm +++ b/scripts/route19.asm @@ -1,4 +1,4 @@ -Route19Script: ; 55d44 (15:5d44) +Route19Script: call EnableAutoTextBoxDrawing ld hl, Route19TrainerHeaders ld de, Route19ScriptPointers @@ -7,12 +7,12 @@ Route19Script: ; 55d44 (15:5d44) ld [wRoute19CurScript], a ret -Route19ScriptPointers: ; 55d57 (15:5d57) +Route19ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route19TextPointers: ; 55d5d (15:5d5d) +Route19TextPointers: dw Route19Text1 dw Route19Text2 dw Route19Text3 @@ -25,8 +25,8 @@ Route19TextPointers: ; 55d5d (15:5d5d) dw Route19Text10 dw Route19Text11 -Route19TrainerHeaders: ; 55d73 (15:5d73) -Route19TrainerHeader0: ; 55d73 (15:5d73) +Route19TrainerHeaders: +Route19TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_0 @@ -35,7 +35,7 @@ Route19TrainerHeader0: ; 55d73 (15:5d73) dw Route19EndBattleText1 ; TextEndBattle dw Route19EndBattleText1 ; TextEndBattle -Route19TrainerHeader1: ; 55d7f (15:5d7f) +Route19TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_1 @@ -44,7 +44,7 @@ Route19TrainerHeader1: ; 55d7f (15:5d7f) dw Route19EndBattleText2 ; TextEndBattle dw Route19EndBattleText2 ; TextEndBattle -Route19TrainerHeader2: ; 55d8b (15:5d8b) +Route19TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_2 @@ -53,7 +53,7 @@ Route19TrainerHeader2: ; 55d8b (15:5d8b) dw Route19EndBattleText3 ; TextEndBattle dw Route19EndBattleText3 ; TextEndBattle -Route19TrainerHeader3: ; 55d97 (15:5d97) +Route19TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_3 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_3 @@ -62,7 +62,7 @@ Route19TrainerHeader3: ; 55d97 (15:5d97) dw Route19EndBattleText4 ; TextEndBattle dw Route19EndBattleText4 ; TextEndBattle -Route19TrainerHeader4: ; 55da3 (15:5da3) +Route19TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_4 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_4 @@ -71,7 +71,7 @@ Route19TrainerHeader4: ; 55da3 (15:5da3) dw Route19EndBattleText5 ; TextEndBattle dw Route19EndBattleText5 ; TextEndBattle -Route19TrainerHeader5: ; 55daf (15:5daf) +Route19TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_5 @@ -80,7 +80,7 @@ Route19TrainerHeader5: ; 55daf (15:5daf) dw Route19EndBattleText6 ; TextEndBattle dw Route19EndBattleText6 ; TextEndBattle -Route19TrainerHeader6: ; 55dbb (15:5dbb) +Route19TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_6 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_6 @@ -89,7 +89,7 @@ Route19TrainerHeader6: ; 55dbb (15:5dbb) dw Route19EndBattleText7 ; TextEndBattle dw Route19EndBattleText7 ; TextEndBattle -Route19TrainerHeader7: ; 55dc7 (15:5dc7) +Route19TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_7, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_7, 1 @@ -98,7 +98,7 @@ Route19TrainerHeader7: ; 55dc7 (15:5dc7) dw Route19EndBattleText8 ; TextEndBattle dw Route19EndBattleText8 ; TextEndBattle -Route19TrainerHeader8: ; 55dd3 (15:5dd3) +Route19TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_8, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_8, 1 @@ -107,7 +107,7 @@ Route19TrainerHeader8: ; 55dd3 (15:5dd3) dw Route19EndBattleText9 ; TextEndBattle dw Route19EndBattleText9 ; TextEndBattle -Route19TrainerHeader9: ; 55ddf (15:5ddf) +Route19TrainerHeader9: dbEventFlagBit EVENT_BEAT_ROUTE_19_TRAINER_9, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_19_TRAINER_9, 1 @@ -118,178 +118,178 @@ Route19TrainerHeader9: ; 55ddf (15:5ddf) db $ff -Route19Text1: ; 55dec (15:5dec) +Route19Text1: TX_ASM ld hl, Route19TrainerHeader0 jr Route19_TalkToTrainer -Route19Text2: ; 55df6 (15:5df6) +Route19Text2: TX_ASM ld hl, Route19TrainerHeader1 jr Route19_TalkToTrainer -Route19Text3: ; 55e00 (15:5e00) +Route19Text3: TX_ASM ld hl, Route19TrainerHeader2 jr Route19_TalkToTrainer -Route19Text4: ; 55e0a (15:5e0a) +Route19Text4: TX_ASM ld hl, Route19TrainerHeader3 jr Route19_TalkToTrainer -Route19Text5: ; 55e14 (15:5e14) +Route19Text5: TX_ASM ld hl, Route19TrainerHeader4 jr Route19_TalkToTrainer -Route19Text6: ; 55e1e (15:5e1e) +Route19Text6: TX_ASM ld hl, Route19TrainerHeader5 jr Route19_TalkToTrainer -Route19Text7: ; 55e28 (15:5e28) +Route19Text7: TX_ASM ld hl, Route19TrainerHeader6 jr Route19_TalkToTrainer -Route19Text8: ; 55e32 (15:5e32) +Route19Text8: TX_ASM ld hl, Route19TrainerHeader7 jr Route19_TalkToTrainer -Route19Text9: ; 55e3c (15:5e3c) +Route19Text9: TX_ASM ld hl, Route19TrainerHeader8 jr Route19_TalkToTrainer -Route19Text10: ; 55e46 (15:5e46) +Route19Text10: TX_ASM ld hl, Route19TrainerHeader9 Route19_TalkToTrainer: call TalkToTrainer jp TextScriptEnd -Route19BattleText1: ; 55e50 (15:5e50) +Route19BattleText1: TX_FAR _Route19BattleText1 db "@" -Route19EndBattleText1: ; 55e55 (15:5e55) +Route19EndBattleText1: TX_FAR _Route19EndBattleText1 db "@" -Route19AfterBattleText1: ; 55e5a (15:5e5a) +Route19AfterBattleText1: TX_FAR _Route19AfterBattleText1 db "@" -Route19BattleText2: ; 55e5f (15:5e5f) +Route19BattleText2: TX_FAR _Route19BattleText2 db "@" -Route19EndBattleText2: ; 55e64 (15:5e64) +Route19EndBattleText2: TX_FAR _Route19EndBattleText2 db "@" -Route19AfterBattleText2: ; 55e69 (15:5e69) +Route19AfterBattleText2: TX_FAR _Route19AfterBattleText2 db "@" -Route19BattleText3: ; 55e6e (15:5e6e) +Route19BattleText3: TX_FAR _Route19BattleText3 db "@" -Route19EndBattleText3: ; 55e73 (15:5e73) +Route19EndBattleText3: TX_FAR _Route19EndBattleText3 db "@" -Route19AfterBattleText3: ; 55e78 (15:5e78) +Route19AfterBattleText3: TX_FAR _Route19AfterBattleText3 db "@" -Route19BattleText4: ; 55e7d (15:5e7d) +Route19BattleText4: TX_FAR _Route19BattleText4 db "@" -Route19EndBattleText4: ; 55e82 (15:5e82) +Route19EndBattleText4: TX_FAR _Route19EndBattleText4 db "@" -Route19AfterBattleText4: ; 55e87 (15:5e87) +Route19AfterBattleText4: TX_FAR _Route19AfterBattleText4 db "@" -Route19BattleText5: ; 55e8c (15:5e8c) +Route19BattleText5: TX_FAR _Route19BattleText5 db "@" -Route19EndBattleText5: ; 55e91 (15:5e91) +Route19EndBattleText5: TX_FAR _Route19EndBattleText5 db "@" -Route19AfterBattleText5: ; 55e96 (15:5e96) +Route19AfterBattleText5: TX_FAR _Route19AfterBattleText5 db "@" -Route19BattleText6: ; 55e9b (15:5e9b) +Route19BattleText6: TX_FAR _Route19BattleText6 db "@" -Route19EndBattleText6: ; 55ea0 (15:5ea0) +Route19EndBattleText6: TX_FAR _Route19EndBattleText6 db "@" -Route19AfterBattleText6: ; 55ea5 (15:5ea5) +Route19AfterBattleText6: TX_FAR _Route19AfterBattleText6 db "@" -Route19BattleText7: ; 55eaa (15:5eaa) +Route19BattleText7: TX_FAR _Route19BattleText7 db "@" -Route19EndBattleText7: ; 55eaf (15:5eaf) +Route19EndBattleText7: TX_FAR _Route19EndBattleText7 db "@" -Route19AfterBattleText7: ; 55eb4 (15:5eb4) +Route19AfterBattleText7: TX_FAR _Route19AfterBattleText7 db "@" -Route19BattleText8: ; 55eb9 (15:5eb9) +Route19BattleText8: TX_FAR _Route19BattleText8 db "@" -Route19EndBattleText8: ; 55ebe (15:5ebe) +Route19EndBattleText8: TX_FAR _Route19EndBattleText8 db "@" -Route19AfterBattleText8: ; 55ec3 (15:5ec3) +Route19AfterBattleText8: TX_FAR _Route19AfterBattleText8 db "@" -Route19BattleText9: ; 55ec8 (15:5ec8) +Route19BattleText9: TX_FAR _Route19BattleText9 db "@" -Route19EndBattleText9: ; 55ecd (15:5ecd) +Route19EndBattleText9: TX_FAR _Route19EndBattleText9 db "@" -Route19AfterBattleText9: ; 55ed2 (15:5ed2) +Route19AfterBattleText9: TX_FAR _Route19AfterBattleText9 db "@" -Route19BattleText10: ; 55ed7 (15:5ed7) +Route19BattleText10: TX_FAR _Route19BattleText10 db "@" -Route19EndBattleText10: ; 55edc (15:5edc) +Route19EndBattleText10: TX_FAR _Route19EndBattleText10 db "@" -Route19AfterBattleText10: ; 55ee1 (15:5ee1) +Route19AfterBattleText10: TX_FAR _Route19AfterBattleText10 db "@" -Route19Text11: ; 55ee6 (15:5ee6) +Route19Text11: TX_FAR _Route19Text11 db "@" diff --git a/scripts/route1_2.asm b/scripts/route1_2.asm index 35ffb137..6e9b472e 100755 --- a/scripts/route1_2.asm +++ b/scripts/route1_2.asm @@ -17,24 +17,24 @@ Func_f1ad2: call PrintText ret -Route1ViridianMartSampleText: ; 1cae3 (7:4ae3) +Route1ViridianMartSampleText: TX_FAR _Route1ViridianMartSampleText db "@" -Route1Text_f1aff: ; 1cae8 (7:4ae8) +Route1Text_f1aff: TX_FAR _Route1Text_1cae8 TX_SFX_ITEM db "@" -Route1Text_f1b05: ; 1caee (7:4aee) +Route1Text_f1b05: TX_FAR _Route1Text_1caee db "@" -Route1Text_f1b0a: ; 1caf3 (7:4af3) +Route1Text_f1b0a: TX_FAR _Route1Text_1caf3 db "@" -Func_f1b0f: ; 1caf8 (7:4af8) +Func_f1b0f: ld hl, Route1Text_f1b16 call PrintText ret @@ -43,7 +43,7 @@ Route1Text_f1b16: TX_FAR _Route1Text2 db "@" -Func_f1b1b: ; 1cafd (7:4afd) +Func_f1b1b: ld hl, Route1Text_f1b22 call PrintText ret diff --git a/scripts/route2.asm b/scripts/route2.asm index 62ef3050..810792ef 100755 --- a/scripts/route2.asm +++ b/scripts/route2.asm @@ -1,16 +1,16 @@ -Route2Script: ; 554e3 (15:54e3) +Route2Script: jp EnableAutoTextBoxDrawing -Route2TextPointers: ; 554e6 (15:54e6) +Route2TextPointers: dw PickUpItemText dw PickUpItemText dw Route2Text3 dw Route2Text4 -Route2Text3: ; 554ee (15:54ee) +Route2Text3: TX_FAR _Route2Text3 db "@" -Route2Text4: ; 554f3 (15:54f3) +Route2Text4: TX_FAR _Route2Text4 db "@" diff --git a/scripts/route20.asm b/scripts/route20.asm index 9c5fc387..012c9c53 100755 --- a/scripts/route20.asm +++ b/scripts/route20.asm @@ -1,4 +1,4 @@ -Route20Script: ; 50ca9 (14:4ca9) +Route20Script: CheckAndResetEvent EVENT_IN_SEAFOAM_ISLANDS call nz, Route20Script_50cc6 call EnableAutoTextBoxDrawing @@ -9,7 +9,7 @@ Route20Script: ; 50ca9 (14:4ca9) ld [wRoute20CurScript], a ret -Route20Script_50cc6: ; 50cc6 (14:4cc6) +Route20Script_50cc6: CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE jr z, .asm_50cef ld a, HS_SEAFOAM_ISLANDS_1_BOULDER_1 @@ -26,7 +26,7 @@ Route20Script_50cc6: ; 50cc6 (14:4cc6) pop hl jr .asm_50cdc -.MissableObjectIDs: ; 50ce8 (14:4ce8) +.MissableObjectIDs: db HS_SEAFOAM_ISLANDS_2_BOULDER_1 db HS_SEAFOAM_ISLANDS_2_BOULDER_2 db HS_SEAFOAM_ISLANDS_3_BOULDER_1 @@ -48,20 +48,20 @@ Route20Script_50cc6: ; 50cc6 (14:4cc6) call Route20Script_50d14 ret -Route20Script_50d0c: ; 50d0c (14:4d0c) +Route20Script_50d0c: ld [wMissableObjectIndex], a predef_jump ShowObject -Route20Script_50d14: ; 50d14 (14:4d14) +Route20Script_50d14: ld [wMissableObjectIndex], a predef_jump HideObject -Route20ScriptPointers: ; 50d1c (14:4d1c) +Route20ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route20TextPointers: ; 50d22 (14:4d22) +Route20TextPointers: dw Route20Text1 dw Route20Text2 dw Route20Text3 @@ -75,8 +75,8 @@ Route20TextPointers: ; 50d22 (14:4d22) dw Route20Text11 dw Route20Text12 -Route20TrainerHeaders: ; 50d3a (14:4d3a) -Route20TrainerHeader0: ; 50d3a (14:4d3a) +Route20TrainerHeaders: +Route20TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_0 @@ -85,7 +85,7 @@ Route20TrainerHeader0: ; 50d3a (14:4d3a) dw Route20EndBattleText1 ; TextEndBattle dw Route20EndBattleText1 ; TextEndBattle -Route20TrainerHeader2: ; 50d46 (14:4d46) +Route20TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_2 @@ -94,7 +94,7 @@ Route20TrainerHeader2: ; 50d46 (14:4d46) dw Route20EndBattleText2 ; TextEndBattle dw Route20EndBattleText2 ; TextEndBattle -Route20TrainerHeader3: ; 50d52 (14:4d52) +Route20TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_3 @@ -103,7 +103,7 @@ Route20TrainerHeader3: ; 50d52 (14:4d52) dw Route20EndBattleText3 ; TextEndBattle dw Route20EndBattleText3 ; TextEndBattle -Route20TrainerHeader4: ; 50d5e (14:4d5e) +Route20TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_4 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_4 @@ -112,7 +112,7 @@ Route20TrainerHeader4: ; 50d5e (14:4d5e) dw Route20EndBattleText4 ; TextEndBattle dw Route20EndBattleText4 ; TextEndBattle -Route20TrainerHeader5: ; 50d6a (14:4d6a) +Route20TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_5 @@ -121,7 +121,7 @@ Route20TrainerHeader5: ; 50d6a (14:4d6a) dw Route20EndBattleText5 ; TextEndBattle dw Route20EndBattleText5 ; TextEndBattle -Route20TrainerHeader6: ; 50d76 (14:4d76) +Route20TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_6 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_6 @@ -130,7 +130,7 @@ Route20TrainerHeader6: ; 50d76 (14:4d76) dw Route20EndBattleText6 ; TextEndBattle dw Route20EndBattleText6 ; TextEndBattle -Route20TrainerHeader7: ; 50d82 (14:4d82) +Route20TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_7 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_7 @@ -139,7 +139,7 @@ Route20TrainerHeader7: ; 50d82 (14:4d82) dw Route20EndBattleText7 ; TextEndBattle dw Route20EndBattleText7 ; TextEndBattle -Route20TrainerHeader8: ; 50d8e (14:4d8e) +Route20TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_8, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_8, 1 @@ -148,7 +148,7 @@ Route20TrainerHeader8: ; 50d8e (14:4d8e) dw Route20EndBattleText8 ; TextEndBattle dw Route20EndBattleText8 ; TextEndBattle -Route20TrainerHeader9: ; 50d9a (14:4d9a) +Route20TrainerHeader9: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_9, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_9, 1 @@ -157,7 +157,7 @@ Route20TrainerHeader9: ; 50d9a (14:4d9a) dw Route20EndBattleText9 ; TextEndBattle dw Route20EndBattleText9 ; TextEndBattle -Route20TrainerHeader10: ; 50da6 (14:4da6) +Route20TrainerHeader10: dbEventFlagBit EVENT_BEAT_ROUTE_20_TRAINER_10, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_20_TRAINER_10, 1 @@ -168,187 +168,187 @@ Route20TrainerHeader10: ; 50da6 (14:4da6) db $ff -Route20Text1: ; 50db3 (14:4db3) +Route20Text1: TX_ASM ld hl, Route20TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route20Text2: ; 50dbd (14:4dbd) +Route20Text2: TX_ASM ld hl, Route20TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route20Text3: ; 50dc7 (14:4dc7) +Route20Text3: TX_ASM ld hl, Route20TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route20Text4: ; 50dd1 (14:4dd1) +Route20Text4: TX_ASM ld hl, Route20TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route20Text5: ; 50ddb (14:4ddb) +Route20Text5: TX_ASM ld hl, Route20TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route20Text6: ; 50de5 (14:4de5) +Route20Text6: TX_ASM ld hl, Route20TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route20Text7: ; 50def (14:4def) +Route20Text7: TX_ASM ld hl, Route20TrainerHeader7 call TalkToTrainer jp TextScriptEnd -Route20Text8: ; 50df9 (14:4df9) +Route20Text8: TX_ASM ld hl, Route20TrainerHeader8 call TalkToTrainer jp TextScriptEnd -Route20Text9: ; 50e03 (14:4e03) +Route20Text9: TX_ASM ld hl, Route20TrainerHeader9 call TalkToTrainer jp TextScriptEnd -Route20Text10: ; 50e0d (14:4e0d) +Route20Text10: TX_ASM ld hl, Route20TrainerHeader10 call TalkToTrainer jp TextScriptEnd -Route20BattleText1: ; 50e17 (14:4e17) +Route20BattleText1: TX_FAR _Route20BattleText1 db "@" -Route20EndBattleText1: ; 50e1c (14:4e1c) +Route20EndBattleText1: TX_FAR _Route20EndBattleText1 db "@" -Route20AfterBattleText1: ; 50e21 (14:4e21) +Route20AfterBattleText1: TX_FAR _Route20AfterBattleText1 db "@" -Route20BattleText2: ; 50e26 (14:4e26) +Route20BattleText2: TX_FAR _Route20BattleText2 db "@" -Route20EndBattleText2: ; 50e2b (14:4e2b) +Route20EndBattleText2: TX_FAR _Route20EndBattleText2 db "@" -Route20AfterBattleText2: ; 50e30 (14:4e30) +Route20AfterBattleText2: TX_FAR _Route20AfterBattleText2 db "@" -Route20BattleText3: ; 50e35 (14:4e35) +Route20BattleText3: TX_FAR _Route20BattleText3 db "@" -Route20EndBattleText3: ; 50e3a (14:4e3a) +Route20EndBattleText3: TX_FAR _Route20EndBattleText3 db "@" -Route20AfterBattleText3: ; 50e3f (14:4e3f) +Route20AfterBattleText3: TX_FAR _Route20AfterBattleText3 db "@" -Route20BattleText4: ; 50e44 (14:4e44) +Route20BattleText4: TX_FAR _Route20BattleText4 db "@" -Route20EndBattleText4: ; 50e49 (14:4e49) +Route20EndBattleText4: TX_FAR _Route20EndBattleText4 db "@" -Route20AfterBattleText4: ; 50e4e (14:4e4e) +Route20AfterBattleText4: TX_FAR _Route20AfterBattleText4 db "@" -Route20BattleText5: ; 50e53 (14:4e53) +Route20BattleText5: TX_FAR _Route20BattleText5 db "@" -Route20EndBattleText5: ; 50e58 (14:4e58) +Route20EndBattleText5: TX_FAR _Route20EndBattleText5 db "@" -Route20AfterBattleText5: ; 50e5d (14:4e5d) +Route20AfterBattleText5: TX_FAR _Route20AfterBattleText5 db "@" -Route20BattleText6: ; 50e62 (14:4e62) +Route20BattleText6: TX_FAR _Route20BattleText6 db "@" -Route20EndBattleText6: ; 50e67 (14:4e67) +Route20EndBattleText6: TX_FAR _Route20EndBattleText6 db "@" -Route20AfterBattleText6: ; 50e6c (14:4e6c) +Route20AfterBattleText6: TX_FAR _Route20AfterBattleText6 db "@" -Route20BattleText7: ; 50e71 (14:4e71) +Route20BattleText7: TX_FAR _Route20BattleText7 db "@" -Route20EndBattleText7: ; 50e76 (14:4e76) +Route20EndBattleText7: TX_FAR _Route20EndBattleText7 db "@" -Route20AfterBattleText7: ; 50e7b (14:4e7b) +Route20AfterBattleText7: TX_FAR _Route20AfterBattleText7 db "@" -Route20BattleText8: ; 50e80 (14:4e80) +Route20BattleText8: TX_FAR _Route20BattleText8 db "@" -Route20EndBattleText8: ; 50e85 (14:4e85) +Route20EndBattleText8: TX_FAR _Route20EndBattleText8 db "@" -Route20AfterBattleText8: ; 50e8a (14:4e8a) +Route20AfterBattleText8: TX_FAR _Route20AfterBattleText8 db "@" -Route20BattleText9: ; 50e8f (14:4e8f) +Route20BattleText9: TX_FAR _Route20BattleText9 db "@" -Route20EndBattleText9: ; 50e94 (14:4e94) +Route20EndBattleText9: TX_FAR _Route20EndBattleText9 db "@" -Route20AfterBattleText9: ; 50e99 (14:4e99) +Route20AfterBattleText9: TX_FAR _Route20AfterBattleText9 db "@" -Route20BattleText10: ; 50e9e (14:4e9e) +Route20BattleText10: TX_FAR _Route20BattleText10 db "@" -Route20EndBattleText10: ; 50ea3 (14:4ea3) +Route20EndBattleText10: TX_FAR _Route20EndBattleText10 db "@" -Route20AfterBattleText10: ; 50ea8 (14:4ea8) +Route20AfterBattleText10: TX_FAR _Route20AfterBattleText10 db "@" -Route20Text12: ; 50ead (14:4ead) -Route20Text11: ; 50ead (14:4ead) +Route20Text12: +Route20Text11: TX_FAR _Route20Text11 db "@" diff --git a/scripts/route21.asm b/scripts/route21.asm index 821cea39..89874e58 100755 --- a/scripts/route21.asm +++ b/scripts/route21.asm @@ -1,4 +1,4 @@ -Route21Script: ; 55eeb (15:5eeb) +Route21Script: call EnableAutoTextBoxDrawing ld hl, Route21TrainerHeaders ld de, Route21ScriptPointers @@ -7,12 +7,12 @@ Route21Script: ; 55eeb (15:5eeb) ld [wRoute21CurScript], a ret -Route21ScriptPointers: ; 55efe (15:5efe) +Route21ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route21TextPointers: ; 55f04 (15:5f04) +Route21TextPointers: dw Route21Text1 dw Route21Text2 dw Route21Text3 @@ -23,8 +23,8 @@ Route21TextPointers: ; 55f04 (15:5f04) dw Route21Text8 dw Route21Text9 -Route21TrainerHeaders: ; 55f16 (15:5f16) -Route21TrainerHeader0: ; 55f16 (15:5f16) +Route21TrainerHeaders: +Route21TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_0 @@ -33,7 +33,7 @@ Route21TrainerHeader0: ; 55f16 (15:5f16) dw Route21EndBattleText1 ; TextEndBattle dw Route21EndBattleText1 ; TextEndBattle -Route21TrainerHeader1: ; 55f22 (15:5f22) +Route21TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_1 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_1 @@ -42,7 +42,7 @@ Route21TrainerHeader1: ; 55f22 (15:5f22) dw Route21EndBattleText2 ; TextEndBattle dw Route21EndBattleText2 ; TextEndBattle -Route21TrainerHeader2: ; 55f2e (15:5f2e) +Route21TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_2 @@ -51,7 +51,7 @@ Route21TrainerHeader2: ; 55f2e (15:5f2e) dw Route21EndBattleText3 ; TextEndBattle dw Route21EndBattleText3 ; TextEndBattle -Route21TrainerHeader3: ; 55f3a (15:5f3a) +Route21TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_3 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_3 @@ -60,7 +60,7 @@ Route21TrainerHeader3: ; 55f3a (15:5f3a) dw Route21EndBattleText4 ; TextEndBattle dw Route21EndBattleText4 ; TextEndBattle -Route21TrainerHeader4: ; 55f46 (15:5f46) +Route21TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_4 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_4 @@ -69,7 +69,7 @@ Route21TrainerHeader4: ; 55f46 (15:5f46) dw Route21EndBattleText5 ; TextEndBattle dw Route21EndBattleText5 ; TextEndBattle -Route21TrainerHeader5: ; 55f52 (15:5f52) +Route21TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_5 @@ -78,7 +78,7 @@ Route21TrainerHeader5: ; 55f52 (15:5f52) dw Route21EndBattleText6 ; TextEndBattle dw Route21EndBattleText6 ; TextEndBattle -Route21TrainerHeader6: ; 55f5e (15:5f5e) +Route21TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_6 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_6 @@ -87,7 +87,7 @@ Route21TrainerHeader6: ; 55f5e (15:5f5e) dw Route21EndBattleText7 ; TextEndBattle dw Route21EndBattleText7 ; TextEndBattle -Route21TrainerHeader7: ; 55f6a (15:5f6a) +Route21TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_7, 1 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_7, 1 @@ -96,7 +96,7 @@ Route21TrainerHeader7: ; 55f6a (15:5f6a) dw Route21EndBattleText8 ; TextEndBattle dw Route21EndBattleText8 ; TextEndBattle -Route21TrainerHeader8: ; 55f76 (15:5f76) +Route21TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_21_TRAINER_8, 1 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_21_TRAINER_8, 1 @@ -107,164 +107,164 @@ Route21TrainerHeader8: ; 55f76 (15:5f76) db $ff -Route21Text1: ; 55f83 (15:5f83) +Route21Text1: TX_ASM ld hl, Route21TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route21Text2: ; 55f8d (15:5f8d) +Route21Text2: TX_ASM ld hl, Route21TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route21Text3: ; 55f97 (15:5f97) +Route21Text3: TX_ASM ld hl, Route21TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route21Text4: ; 55fa1 (15:5fa1) +Route21Text4: TX_ASM ld hl, Route21TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route21Text5: ; 55fab (15:5fab) +Route21Text5: TX_ASM ld hl, Route21TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route21Text6: ; 55fb5 (15:5fb5) +Route21Text6: TX_ASM ld hl, Route21TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route21Text7: ; 55fbf (15:5fbf) +Route21Text7: TX_ASM ld hl, Route21TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route21Text8: ; 55fc9 (15:5fc9) +Route21Text8: TX_ASM ld hl, Route21TrainerHeader7 call TalkToTrainer jp TextScriptEnd -Route21Text9: ; 55fd3 (15:5fd3) +Route21Text9: TX_ASM ld hl, Route21TrainerHeader8 call TalkToTrainer jp TextScriptEnd -Route21BattleText1: ; 55fdd (15:5fdd) +Route21BattleText1: TX_FAR _Route21BattleText1 db "@" -Route21EndBattleText1: ; 55fe2 (15:5fe2) +Route21EndBattleText1: TX_FAR _Route21EndBattleText1 db "@" -Route21AfterBattleText1: ; 55fe7 (15:5fe7) +Route21AfterBattleText1: TX_FAR _Route21AfterBattleText1 db "@" -Route21BattleText2: ; 55fec (15:5fec) +Route21BattleText2: TX_FAR _Route21BattleText2 db "@" -Route21EndBattleText2: ; 55ff1 (15:5ff1) +Route21EndBattleText2: TX_FAR _Route21EndBattleText2 db "@" -Route21AfterBattleText2: ; 55ff6 (15:5ff6) +Route21AfterBattleText2: TX_FAR _Route21AfterBattleText2 db "@" -Route21BattleText3: ; 55ffb (15:5ffb) +Route21BattleText3: TX_FAR _Route21BattleText3 db "@" -Route21EndBattleText3: ; 56000 (15:6000) +Route21EndBattleText3: TX_FAR _Route21EndBattleText3 db "@" -Route21AfterBattleText3: ; 56005 (15:6005) +Route21AfterBattleText3: TX_FAR _Route21AfterBattleText3 db "@" -Route21BattleText4: ; 5600a (15:600a) +Route21BattleText4: TX_FAR _Route21BattleText4 db "@" -Route21EndBattleText4: ; 5600f (15:600f) +Route21EndBattleText4: TX_FAR _Route21EndBattleText4 db "@" -Route21AfterBattleText4: ; 56014 (15:6014) +Route21AfterBattleText4: TX_FAR _Route21AfterBattleText4 db "@" -Route21BattleText5: ; 56019 (15:6019) +Route21BattleText5: TX_FAR _Route21BattleText5 db "@" -Route21EndBattleText5: ; 5601e (15:601e) +Route21EndBattleText5: TX_FAR _Route21EndBattleText5 db "@" -Route21AfterBattleText5: ; 56023 (15:6023) +Route21AfterBattleText5: TX_FAR _Route21AfterBattleText5 db "@" -Route21BattleText6: ; 56028 (15:6028) +Route21BattleText6: TX_FAR _Route21BattleText6 db "@" -Route21EndBattleText6: ; 5602d (15:602d) +Route21EndBattleText6: TX_FAR _Route21EndBattleText6 db "@" -Route21AfterBattleText6: ; 56032 (15:6032) +Route21AfterBattleText6: TX_FAR _Route21AfterBattleText6 db "@" -Route21BattleText7: ; 56037 (15:6037) +Route21BattleText7: TX_FAR _Route21BattleText7 db "@" -Route21EndBattleText7: ; 5603c (15:603c) +Route21EndBattleText7: TX_FAR _Route21EndBattleText7 db "@" -Route21AfterBattleText7: ; 56041 (15:6041) +Route21AfterBattleText7: TX_FAR _Route21AfterBattleText7 db "@" -Route21BattleText8: ; 56046 (15:6046) +Route21BattleText8: TX_FAR _Route21BattleText8 db "@" -Route21EndBattleText8: ; 5604b (15:604b) +Route21EndBattleText8: TX_FAR _Route21EndBattleText8 db "@" -Route21AfterBattleText8: ; 56050 (15:6050) +Route21AfterBattleText8: TX_FAR _Route21AfterBattleText8 db "@" -Route21BattleText9: ; 56055 (15:6055) +Route21BattleText9: TX_FAR _Route21BattleText9 db "@" -Route21EndBattleText9: ; 5605a (15:605a) +Route21EndBattleText9: TX_FAR _Route21EndBattleText9 db "@" -Route21AfterBattleText9: ; 5605f (15:605f) +Route21AfterBattleText9: TX_FAR _Route21AfterBattleText9 db "@" diff --git a/scripts/route22.asm b/scripts/route22.asm index 18dc36ac..fe881366 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -1,10 +1,10 @@ -Route22Script: ; 50eb2 (14:4eb2) +Route22Script: call EnableAutoTextBoxDrawing ld hl, Route22ScriptPointers ld a, [wRoute22CurScript] jp JumpTable -Route22ScriptPointers: ; 50ebe (14:4ebe) +Route22ScriptPointers: dw Route22Script0 dw Route22Script1 dw Route22Script2 @@ -14,14 +14,14 @@ Route22ScriptPointers: ; 50ebe (14:4ebe) dw Route22Script6 dw Route22Script7 -Route22Script_50ece: ; 50ece (14:4ece) +Route22Script_50ece: xor a ld [wJoyIgnore], a ld [wRoute22CurScript], a -Route22Script7: ; 50ed5 (14:4ed5) +Route22Script7: ret -Route22Script_50ed6: ; 50ed6 (14:4ed6) +Route22Script_50ed6: ld a, OPP_SONY1 ld [wCurOpponent], a ld a, $2 @@ -36,7 +36,7 @@ Route22Script_50ee1: ld [wTrainerNo], a ret -Route22MoveRivalSprite: ; 50ee6 (14:4ee6) +Route22MoveRivalSprite: ld de, Route22RivalMovementData ld a, [wcf0d] cp $1 @@ -48,14 +48,14 @@ Route22MoveRivalSprite: ; 50ee6 (14:4ee6) ld [hSpriteFacingDirection], a jp SetSpriteFacingDirectionAndDelay -Route22RivalMovementData: ; 50efb (14:4efb) +Route22RivalMovementData: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db $FF -Route22Script0: ; 50f00 (14:4f00) +Route22Script0: CheckEvent EVENT_ROUTE22_RIVAL_WANTS_BATTLE ret z ld hl, .Route22RivalBattleCoords @@ -101,7 +101,7 @@ Route22Script0: ; 50f00 (14:4f00) ld [wRoute22CurScript], a ret -Route22Script1: ; 50f62 (14:4f62) +Route22Script1: ld a, [wd730] bit 0, a ret nz @@ -135,15 +135,15 @@ Route22Script1: ; 50f62 (14:4f62) ld [wRoute22CurScript], a ret -Route22RivalDefeatedText1: ; 511b7 (14:51b7) +Route22RivalDefeatedText1: TX_FAR _Route22RivalDefeatedText1 db "@" -Route22Text_511bc: ; 511bc (14:51bc) +Route22Text_511bc: TX_FAR _Route22Text_511bc db "@" -Route22Script2: ; 50fb5 (14:4fb5) +Route22Script2: ld a, [wIsInBattle] cp $ff jp z, Route22Script_50ece @@ -153,7 +153,7 @@ Route22Script2: ; 50fb5 (14:4fb5) ld a, $1 ld [wRivalStarter], a .asm_50fc9 - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] and a ; cp SPRITE_FACING_DOWN jr nz, .notDown ld a, SPRITE_FACING_UP @@ -185,18 +185,18 @@ Route22Script2: ; 50fb5 (14:4fb5) ld [wRoute22CurScript], a ret -Route22Script_51008: ; 51008 (14:5008) +Route22Script_51008: ld de, Route22RivalExitMovementData1 jr Route22MoveRival1 -Route22Script_5100d: ; 5100d (14:500d) +Route22Script_5100d: ld de, Route22RivalExitMovementData2 -Route22MoveRival1: ; 51010 (14:5010) +Route22MoveRival1: ld a, $1 ld [H_SPRITEINDEX], a jp MoveSprite -Route22RivalExitMovementData1: ; 51017 (14:5017) +Route22RivalExitMovementData1: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_DOWN @@ -206,7 +206,7 @@ Route22RivalExitMovementData1: ; 51017 (14:5017) db NPC_MOVEMENT_DOWN db $FF -Route22RivalExitMovementData2: ; 5101f (14:501f) +Route22RivalExitMovementData2: db NPC_MOVEMENT_UP db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT @@ -219,7 +219,7 @@ Route22RivalExitMovementData2: ; 5101f (14:501f) db NPC_MOVEMENT_DOWN db $FF -Route22Script3: ; 5102a (14:502a) +Route22Script3: ld a, [wd730] bit 0, a ret nz @@ -234,7 +234,7 @@ Route22Script3: ; 5102a (14:502a) ld [wRoute22CurScript], a ret -Route22Script_5104e: ; 5104e (14:504e) +Route22Script_5104e: ld a, $2 ld [wEmotionBubbleSpriteIndex], a xor a ; EXCLAMATION_BUBBLE @@ -254,7 +254,7 @@ Route22Script_5104e: ; 5104e (14:504e) ld [wRoute22CurScript], a ret -Route22Script4: ; 51087 (14:5087) +Route22Script4: ld a, [wd730] bit 0, a ret nz @@ -290,15 +290,15 @@ Route22Script4: ; 51087 (14:5087) ld [wRoute22CurScript], a ret -Route22RivalDefeatedText2: ; 511cb (14:51cb) +Route22RivalDefeatedText2: TX_FAR _Route22RivalDefeatedText2 db "@" -Route22Text_511d0: ; 511d0 (14:51d0) +Route22Text_511d0: TX_FAR _Route22Text_511d0 db "@" -Route22Script5: ; 510df (14:50df) +Route22Script5: ld a, [wIsInBattle] cp $ff jp z, Route22Script_50ece @@ -338,27 +338,27 @@ Route22Script5: ; 510df (14:50df) ld [wRoute22CurScript], a ret -Route22Script_5113d: ; 5113d (14:513d) +Route22Script_5113d: ld de, MovementData_5114c jr Route22MoveRival2 -Route22Script_51142: ; 51142 (14:5142) +Route22Script_51142: ld de, MovementData_5114d -Route22MoveRival2: ; 51145 (14:5145) +Route22MoveRival2: ld a, $2 ld [H_SPRITEINDEX], a jp MoveSprite -MovementData_5114c: ; 5114c (14:514c) +MovementData_5114c: db NPC_MOVEMENT_LEFT -MovementData_5114d: ; 5114d (14:514d) +MovementData_5114d: db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_LEFT db $FF -Route22Script6: ; 51151 (14:5151) +Route22Script6: ld a, [wd730] bit 0, a ret nz @@ -373,22 +373,22 @@ Route22Script6: ; 51151 (14:5151) ld [wRoute22CurScript], a ret -Route22TextPointers: ; 51175 (14:5175) +Route22TextPointers: dw Route22Text1 dw Route22Text2 dw Route22FrontGateText -Route22Text1: ; 5117b (14:517b) +Route22Text1: TX_ASM callba Func_f1b27 jp TextScriptEnd -Route22Text2: ; 51194 (14:5194) +Route22Text2: TX_ASM callba Func_f1b47 jp TextScriptEnd -Route22FrontGateText: ; 511d5 (14:51d5) +Route22FrontGateText: TX_ASM callba Func_f1b67 jp TextScriptEnd diff --git a/scripts/route22_2.asm b/scripts/route22_2.asm index 89ecdcf3..1cd23ed2 100755 --- a/scripts/route22_2.asm +++ b/scripts/route22_2.asm @@ -11,11 +11,11 @@ Func_f1b27: .asm_51191 ret -Route22RivalBeforeBattleText1: ; 511ad (14:51ad) +Route22RivalBeforeBattleText1: TX_FAR _Route22RivalBeforeBattleText1 db "@" -Route22RivalAfterBattleText1: ; 511b2 (14:51b2) +Route22RivalAfterBattleText1: TX_FAR _Route22RivalAfterBattleText1 db "@" @@ -32,11 +32,11 @@ Func_f1b47: .asm_511aa ret -Route22RivalBeforeBattleText2: ; 511c1 (14:51c1) +Route22RivalBeforeBattleText2: TX_FAR _Route22RivalBeforeBattleText2 db "@" -Route22RivalAfterBattleText2: ; 511c6 (14:51c6) +Route22RivalAfterBattleText2: TX_FAR _Route22RivalAfterBattleText2 db "@" diff --git a/scripts/route22gate.asm b/scripts/route22gate.asm index c3581206..05fbc7e9 100755 --- a/scripts/route22gate.asm +++ b/scripts/route22gate.asm @@ -1,4 +1,4 @@ -Route22GateScript: ; 1e683 (7:6683) +Route22GateScript: call EnableAutoTextBoxDrawing ld hl, Route22GateScriptPointers ld a, [wRoute22GateCurScript] @@ -12,12 +12,12 @@ Route22GateScript: ; 1e683 (7:6683) ld [wLastMap], a ret -Route22GateScriptPointers: ; 1e69e (7:669e) +Route22GateScriptPointers: dw Route22GateScript0 dw Route22GateScript1 dw Route22GateScript2 -Route22GateScript0: ; 1e6a4 (7:66a4) +Route22GateScript0: ld hl, Route22GateScriptCoords call ArePlayerCoordsInArray ret nc @@ -30,21 +30,21 @@ Route22GateScript0: ; 1e6a4 (7:66a4) call DisplayTextID ret -Route22GateScriptCoords: ; 1e6b5 (7:66b5) +Route22GateScriptCoords: db 2,4 db 2,5 db $ff -Route22GateScript_1e6ba: ; 1e6ba (7:66ba) +Route22GateScript_1e6ba: ld a, $1 ld [wSimulatedJoypadStatesIndex], a ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld [wJoyIgnore], a jp StartSimulatingJoypadStates -Route22GateScript1: ; 1e6cd (7:66cd) +Route22GateScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -53,13 +53,13 @@ Route22GateScript1: ; 1e6cd (7:66cd) call Delay3 ld a, $0 ld [wRoute22GateCurScript], a -Route22GateScript2: ; 1e6de (7:66de) +Route22GateScript2: ret -Route22GateTextPointers: ; 1e6df (7:66df) +Route22GateTextPointers: dw Route22GateText1 -Route22GateText1: ; 1e6e1 (7:66e1) +Route22GateText1: TX_ASM ld a, [wObtainedBadges] bit 0, a ; BOULDERBADGE @@ -77,7 +77,7 @@ Route22GateText1: ; 1e6e1 (7:66e1) ld [wRoute22GateCurScript], a jp TextScriptEnd -Route22GateText_1e704: ; 1e704 (7:6704) +Route22GateText_1e704: TX_FAR _Route22GateText_1e704 TX_ASM ld a, SFX_DENIED @@ -86,11 +86,11 @@ Route22GateText_1e704: ; 1e704 (7:6704) ld hl, Route22GateText_1e715 ret -Route22GateText_1e715: ; 1e715 (7:6715) +Route22GateText_1e715: TX_FAR _Route22GateText_1e715 db "@" -Route22GateText_1e71a: ; 1e71a (7:671a) +Route22GateText_1e71a: TX_FAR _Route22GateText_1e71a TX_SFX_ITEM db "@" diff --git a/scripts/route23.asm b/scripts/route23.asm index 6af5c082..b82ab505 100755 --- a/scripts/route23.asm +++ b/scripts/route23.asm @@ -1,11 +1,11 @@ -Route23Script: ; 511da (14:51da) +Route23Script: call Route23Script_511e9 call EnableAutoTextBoxDrawing ld hl, Route23ScriptPointers ld a, [wRoute23CurScript] jp JumpTable -Route23Script_511e9: ; 511e9 (14:51e9) +Route23Script_511e9: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] @@ -19,12 +19,12 @@ Route23Script_511e9: ; 511e9 (14:51e9) ld [wMissableObjectIndex], a predef_jump HideObject -Route23ScriptPointers: ; 51213 (14:5213) +Route23ScriptPointers: dw Route23Script0 dw Route23Script1 dw Route23Script2 -Route23Script0: ; 51219 (14:5219) +Route23Script0: ld hl, YCoordsData_51255 ld a, [wYCoord] ld b, a @@ -60,10 +60,10 @@ Route23Script0: ; 51219 (14:5219) ld [hJoyHeld], a ret -YCoordsData_51255: ; 51255 (14:5255) +YCoordsData_51255: db $23,$38,$55,$60,$69,$77,$88,$FF -Route23Script_5125d: ; 5125d (14:525d) +Route23Script_5125d: ld hl, BadgeTextPointers ld a, [wWhichBadge] ld c, a @@ -82,7 +82,7 @@ Route23Script_5125d: ; 5125d (14:525d) jr nz, .copyTextLoop ret -BadgeTextPointers: ; 51276 (14:5276) +BadgeTextPointers: dw CascadeBadgeText dw ThunderBadgeText dw RainbowBadgeText @@ -91,47 +91,47 @@ BadgeTextPointers: ; 51276 (14:5276) dw VolcanoBadgeText dw EarthBadgeText -EarthBadgeText: ; 51284 (14:5284) +EarthBadgeText: db "EARTHBADGE@" -VolcanoBadgeText: ; 5128f (14:528f) +VolcanoBadgeText: db "VOLCANOBADGE@" -MarshBadgeText: ; 5129c (14:529c) +MarshBadgeText: db "MARSHBADGE@" -SoulBadgeText: ; 512a7 (14:52a7) +SoulBadgeText: db "SOULBADGE@" -RainbowBadgeText: ; 512b1 (14:52b1) +RainbowBadgeText: db "RAINBOWBADGE@" -ThunderBadgeText: ; 512be (14:52be) +ThunderBadgeText: db "THUNDERBADGE@" -CascadeBadgeText: ; 512cb (14:52cb) +CascadeBadgeText: db "CASCADEBADGE@" -Route23Script_512d8: ; 512d8 (14:52d8) +Route23Script_512d8: ld a, $1 ld [wSimulatedJoypadStatesIndex], a ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a xor a - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld [wJoyIgnore], a jp StartSimulatingJoypadStates -Route23Script1: ; 512ec (14:52ec) +Route23Script1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz -Route23Script2: ; 512f1 (14:52f1) +Route23Script2: ld a, $0 ld [wRoute23CurScript], a ret -Route23TextPointers: ; 512f7 (14:52f7) +Route23TextPointers: dw Route23Text1 dw Route23Text2 dw Route23Text3 @@ -141,49 +141,49 @@ Route23TextPointers: ; 512f7 (14:52f7) dw Route23Text7 dw Route23Text8 -Route23Text1: ; 51307 (14:5307) +Route23Text1: TX_ASM EventFlagBit a, EVENT_PASSED_EARTHBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd -Route23Text2: ; 51310 (14:5310) +Route23Text2: TX_ASM EventFlagBit a, EVENT_PASSED_VOLCANOBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd -Route23Text3: ; 51319 (14:5319) +Route23Text3: TX_ASM EventFlagBit a, EVENT_PASSED_MARSHBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd -Route23Text4: ; 51322 (14:5322) +Route23Text4: TX_ASM EventFlagBit a, EVENT_PASSED_SOULBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd -Route23Text5: ; 5132b (14:532b) +Route23Text5: TX_ASM EventFlagBit a, EVENT_PASSED_RAINBOWBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd -Route23Text6: ; 51334 (14:5334) +Route23Text6: TX_ASM EventFlagBit a, EVENT_PASSED_THUNDERBADGE_CHECK, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd -Route23Text7: ; 5133d (14:533d) +Route23Text7: TX_ASM EventFlagBit a, EVENT_PASSED_CASCADEBADGE_CHECK call Route23Script_51346 jp TextScriptEnd -Route23Script_51346: ; 51346 (14:5346) +Route23Script_51346: ld [wWhichBadge], a call Route23Script_5125d ld a, [wWhichBadge] @@ -213,11 +213,11 @@ Route23Script_51346: ; 51346 (14:5346) ld [wRoute23CurScript], a ret -Route23Script_51388: ; 51388 (14:5388) +Route23Script_51388: ld hl, VictoryRoadGuardText2 jp PrintText -VictoryRoadGuardText1: ; 5138e (14:538e) +VictoryRoadGuardText1: TX_FAR _VictoryRoadGuardText1 TX_ASM ld a, SFX_DENIED @@ -225,12 +225,12 @@ VictoryRoadGuardText1: ; 5138e (14:538e) call WaitForSoundToFinish jp TextScriptEnd -VictoryRoadGuardText2: ; 5139e (14:539e) +VictoryRoadGuardText2: TX_FAR _VictoryRoadGuardText2 db $b TX_FAR _VictoryRoadGuardText_513a3 db "@" -Route23Text8: ; 513a8 (14:53a8) +Route23Text8: TX_FAR _Route23Text8 db "@" diff --git a/scripts/route24.asm b/scripts/route24.asm index 84107ddd..d2872ccc 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -1,4 +1,4 @@ -Route24Script: ; 51366 (14:5366) +Route24Script: call EnableAutoTextBoxDrawing ld hl, Route24TrainerHeaders ld de, Route24ScriptPointers @@ -7,21 +7,21 @@ Route24Script: ; 51366 (14:5366) ld [wRoute24CurScript], a ret -Route24Script_513c0: ; 513c0 (14:53c0) +Route24Script_513c0: xor a ld [wJoyIgnore], a ld [wRoute24CurScript], a ld [wCurMapScript], a ret -Route24ScriptPointers: ; 513cb (14:53cb) +Route24ScriptPointers: dw Route24Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw Route24Script3 dw Route24Script4 -Route24Script0: ; 513d5 (14:53d5) +Route24Script0: CheckEvent EVENT_GOT_NUGGET jp nz, CheckFightingMapTrainers ld hl, CoordsData_5140e @@ -44,10 +44,10 @@ Route24Script0: ; 513d5 (14:53d5) ld [wCurMapScript], a ret -CoordsData_5140e: ; 5140e (14:540e) +CoordsData_5140e: db $0F,$0A,$FF -Route24Script4: ; 51411 (14:5411) +Route24Script4: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -57,7 +57,7 @@ Route24Script4: ; 51411 (14:5411) ld [wCurMapScript], a ret -Route24Script3: ; 51422 (14:5422) +Route24Script3: ld a, [wIsInBattle] cp $ff jp z, Route24Script_513c0 @@ -75,7 +75,7 @@ Route24Script3: ; 51422 (14:5422) ld [wCurMapScript], a ret -Route24TextPointers: ; 5144b (14:544b) +Route24TextPointers: dw Route24Text1 dw Route24Text2 dw Route24Text3 @@ -86,8 +86,8 @@ Route24TextPointers: ; 5144b (14:544b) dw PickUpItemText dw Route24Text8 -Route24TrainerHeaders: ; 5145b (14:545b) -Route24TrainerHeader0: ; 5145b (14:545b) +Route24TrainerHeaders: +Route24TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_0 @@ -96,7 +96,7 @@ Route24TrainerHeader0: ; 5145b (14:545b) dw Route24EndBattleText1 ; TextEndBattle dw Route24EndBattleText1 ; TextEndBattle -Route24TrainerHeader2: ; 51467 (14:5467) +Route24TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_2 db ($1 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_2 @@ -105,7 +105,7 @@ Route24TrainerHeader2: ; 51467 (14:5467) dw Route24EndBattleText2 ; TextEndBattle dw Route24EndBattleText2 ; TextEndBattle -Route24TrainerHeader3: ; 51473 (14:5473) +Route24TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_3 db ($1 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_3 @@ -114,7 +114,7 @@ Route24TrainerHeader3: ; 51473 (14:5473) dw Route24EndBattleText3 ; TextEndBattle dw Route24EndBattleText3 ; TextEndBattle -Route24TrainerHeader4: ; 5147f (14:547f) +Route24TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_4 db ($1 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_4 @@ -123,7 +123,7 @@ Route24TrainerHeader4: ; 5147f (14:547f) dw Route24EndBattleText4 ; TextEndBattle dw Route24EndBattleText4 ; TextEndBattle -Route24TrainerHeader5: ; 5148b (14:548b) +Route24TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_5 db ($1 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_5 @@ -132,7 +132,7 @@ Route24TrainerHeader5: ; 5148b (14:548b) dw Route24EndBattleText5 ; TextEndBattle dw Route24EndBattleText5 ; TextEndBattle -Route24TrainerHeader6: ; 51497 (14:5497) +Route24TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_6 db ($1 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_6 @@ -143,7 +143,7 @@ Route24TrainerHeader6: ; 51497 (14:5497) db $ff -Route24Text1: ; 514a4 (14:54a4) +Route24Text1: TX_ASM ResetEvent EVENT_NUGGET_REWARD_AVAILABLE CheckEvent EVENT_GOT_NUGGET @@ -184,139 +184,139 @@ Route24Text1: ; 514a4 (14:54a4) SetEvent EVENT_NUGGET_REWARD_AVAILABLE jp TextScriptEnd -Route24Text_51510: ; 51510 (14:5510) +Route24Text_51510: TX_FAR _Route24Text_51510 db $0B TX_FAR _Route24Text_51515 db "@" -Route24Text_5151a: ; 5151a (14:551a) +Route24Text_5151a: TX_FAR _Route24Text_5151a TX_SFX_KEY_ITEM TX_BUTTON_SOUND db "@" -Route24Text_51521: ; 51521 (14:5521) +Route24Text_51521: TX_FAR _Route24Text_51521 db "@" -Route24Text_51526: ; 51526 (14:5526) +Route24Text_51526: TX_FAR _Route24Text_51526 db "@" -Route24Text_5152b: ; 5152b (14:552b) +Route24Text_5152b: TX_FAR _Route24Text_5152b db "@" -Route24Text_51530: ; 51530 (14:5530) +Route24Text_51530: TX_FAR _Route24Text_51530 db "@" -Route24Text2: ; 51535 (14:5535) +Route24Text2: TX_ASM ld hl, Route24TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route24Text3: ; 5153f (14:553f) +Route24Text3: TX_ASM ld hl, Route24TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route24Text4: ; 51549 (14:5549) +Route24Text4: TX_ASM ld hl, Route24TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route24Text5: ; 51553 (14:5553) +Route24Text5: TX_ASM ld hl, Route24TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route24Text6: ; 5155d (14:555d) +Route24Text6: TX_ASM ld hl, Route24TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route24Text7: ; 51567 (14:5567) +Route24Text7: TX_ASM ld hl, Route24TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route24BattleText1: ; 51571 (14:5571) +Route24BattleText1: TX_FAR _Route24BattleText1 db "@" -Route24EndBattleText1: ; 51576 (14:5576) +Route24EndBattleText1: TX_FAR _Route24EndBattleText1 db "@" -Route24AfterBattleText1: ; 5157b (14:557b) +Route24AfterBattleText1: TX_FAR _Route24AfterBattleText1 db "@" -Route24BattleText2: ; 51580 (14:5580) +Route24BattleText2: TX_FAR _Route24BattleText2 db "@" -Route24EndBattleText2: ; 51585 (14:5585) +Route24EndBattleText2: TX_FAR _Route24EndBattleText2 db "@" -Route24AfterBattleText2: ; 5158a (14:558a) +Route24AfterBattleText2: TX_FAR _Route24AfterBattleText2 db "@" -Route24BattleText3: ; 5158f (14:558f) +Route24BattleText3: TX_FAR _Route24BattleText3 db "@" -Route24EndBattleText3: ; 51594 (14:5594) +Route24EndBattleText3: TX_FAR _Route24EndBattleText3 db "@" -Route24AfterBattleText3: ; 51599 (14:5599) +Route24AfterBattleText3: TX_FAR _Route24AfterBattleText3 db "@" -Route24BattleText4: ; 5159e (14:559e) +Route24BattleText4: TX_FAR _Route24BattleText4 db "@" -Route24EndBattleText4: ; 515a3 (14:55a3) +Route24EndBattleText4: TX_FAR _Route24EndBattleText4 db "@" -Route24AfterBattleText4: ; 515a8 (14:55a8) +Route24AfterBattleText4: TX_FAR _Route24AfterBattleText4 db "@" -Route24BattleText5: ; 515ad (14:55ad) +Route24BattleText5: TX_FAR _Route24BattleText5 db "@" -Route24EndBattleText5: ; 515b2 (14:55b2) +Route24EndBattleText5: TX_FAR _Route24EndBattleText5 db "@" -Route24AfterBattleText5: ; 515b7 (14:55b7) +Route24AfterBattleText5: TX_FAR _Route24AfterBattleText5 db "@" -Route24BattleText6: ; 515bc (14:55bc) +Route24BattleText6: TX_FAR _Route24BattleText6 db "@" -Route24EndBattleText6: ; 515c1 (14:55c1) +Route24EndBattleText6: TX_FAR _Route24EndBattleText6 db "@" -Route24AfterBattleText6: ; 515c6 (14:55c6) +Route24AfterBattleText6: TX_FAR _Route24AfterBattleText6 db "@" diff --git a/scripts/route25.asm b/scripts/route25.asm index 8df84d95..cc2e1d9d 100755 --- a/scripts/route25.asm +++ b/scripts/route25.asm @@ -1,4 +1,4 @@ -Route25Script: ; 515cb (14:55cb) +Route25Script: call EnableAutoTextBoxDrawing ld hl, Route25TrainerHeaders ld de, Route25ScriptPointers @@ -8,8 +8,8 @@ Route25Script: ; 515cb (14:55cb) call Route25Script_515e1 ret -Route25Script_515e1: ; 515e1 (14:55e1) - ld hl, wPreventBlackout +Route25Script_515e1: + ld hl, wd492 res 2, [hl] res 3, [hl] res 4, [hl] @@ -46,12 +46,12 @@ Route25Script_515e1: ; 515e1 (14:55e1) .asm_5165c ret -Route25ScriptPointers: ; 51622 (14:5622) +Route25ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route25TextPointers: ; 51628 (14:5628) +Route25TextPointers: dw Route25Text1 dw Route25Text2 dw Route25Text3 @@ -64,8 +64,8 @@ Route25TextPointers: ; 51628 (14:5628) dw PickUpItemText dw Route25Text11 -Route25TrainerHeaders: ; 5163e (14:563e) -Route25TrainerHeader0: ; 5163e (14:563e) +Route25TrainerHeaders: +Route25TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_0 @@ -74,7 +74,7 @@ Route25TrainerHeader0: ; 5163e (14:563e) dw Route25EndBattleText1 ; TextEndBattle dw Route25EndBattleText1 ; TextEndBattle -Route25TrainerHeader2: ; 5164a (14:564a) +Route25TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_2 @@ -83,7 +83,7 @@ Route25TrainerHeader2: ; 5164a (14:564a) dw Route25EndBattleText2 ; TextEndBattle dw Route25EndBattleText2 ; TextEndBattle -Route25TrainerHeader3: ; 51656 (14:5656) +Route25TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_3 @@ -92,7 +92,7 @@ Route25TrainerHeader3: ; 51656 (14:5656) dw Route25EndBattleText3 ; TextEndBattle dw Route25EndBattleText3 ; TextEndBattle -Route25TrainerHeader4: ; 51662 (14:5662) +Route25TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_4 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_4 @@ -101,7 +101,7 @@ Route25TrainerHeader4: ; 51662 (14:5662) dw Route25EndBattleText4 ; TextEndBattle dw Route25EndBattleText4 ; TextEndBattle -Route25TrainerHeader5: ; 5166e (14:566e) +Route25TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_5 @@ -110,7 +110,7 @@ Route25TrainerHeader5: ; 5166e (14:566e) dw Route25EndBattleText5 ; TextEndBattle dw Route25EndBattleText5 ; TextEndBattle -Route25TrainerHeader6: ; 5167a (14:567a) +Route25TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_6 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_6 @@ -119,7 +119,7 @@ Route25TrainerHeader6: ; 5167a (14:567a) dw Route25EndBattleText6 ; TextEndBattle dw Route25EndBattleText6 ; TextEndBattle -Route25TrainerHeader7: ; 51686 (14:5686) +Route25TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_7 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_7 @@ -128,7 +128,7 @@ Route25TrainerHeader7: ; 51686 (14:5686) dw Route25EndBattleText7 ; TextEndBattle dw Route25EndBattleText7 ; TextEndBattle -Route25TrainerHeader8: ; 51692 (14:5692) +Route25TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_8, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_8, 1 @@ -137,7 +137,7 @@ Route25TrainerHeader8: ; 51692 (14:5692) dw Route25EndBattleText8 ; TextEndBattle dw Route25EndBattleText8 ; TextEndBattle -Route25TrainerHeader9: ; 5169e (14:569e) +Route25TrainerHeader9: dbEventFlagBit EVENT_BEAT_ROUTE_25_TRAINER_9, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_25_TRAINER_9, 1 @@ -148,168 +148,168 @@ Route25TrainerHeader9: ; 5169e (14:569e) db $ff -Route25Text1: ; 516ab (14:56ab) +Route25Text1: TX_ASM ld hl, Route25TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route25Text2: ; 516b5 (14:56b5) +Route25Text2: TX_ASM ld hl, Route25TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route25Text3: ; 516bf (14:56bf) +Route25Text3: TX_ASM ld hl, Route25TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route25Text4: ; 516c9 (14:56c9) +Route25Text4: TX_ASM ld hl, Route25TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route25Text5: ; 516d3 (14:56d3) +Route25Text5: TX_ASM ld hl, Route25TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route25Text6: ; 516dd (14:56dd) +Route25Text6: TX_ASM ld hl, Route25TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route25Text7: ; 516e7 (14:56e7) +Route25Text7: TX_ASM ld hl, Route25TrainerHeader7 call TalkToTrainer jp TextScriptEnd -Route25Text8: ; 516f1 (14:56f1) +Route25Text8: TX_ASM ld hl, Route25TrainerHeader8 call TalkToTrainer jp TextScriptEnd -Route25Text9: ; 516fb (14:56fb) +Route25Text9: TX_ASM ld hl, Route25TrainerHeader9 call TalkToTrainer jp TextScriptEnd -Route25BattleText1: ; 51705 (14:5705) +Route25BattleText1: TX_FAR _Route25BattleText1 db "@" -Route25EndBattleText1: ; 5170a (14:570a) +Route25EndBattleText1: TX_FAR _Route25EndBattleText1 db "@" -Route25AfterBattleText1: ; 5170f (14:570f) +Route25AfterBattleText1: TX_FAR _Route25AfterBattleText1 db "@" -Route25BattleText2: ; 51714 (14:5714) +Route25BattleText2: TX_FAR _Route25BattleText2 db "@" -Route25EndBattleText2: ; 51719 (14:5719) +Route25EndBattleText2: TX_FAR _Route25EndBattleText2 db "@" -Route25AfterBattleText2: ; 5171e (14:571e) +Route25AfterBattleText2: TX_FAR _Route25AfterBattleText2 db "@" -Route25BattleText3: ; 51723 (14:5723) +Route25BattleText3: TX_FAR _Route25BattleText3 db "@" -Route25EndBattleText3: ; 51728 (14:5728) +Route25EndBattleText3: TX_FAR _Route25EndBattleText3 db "@" -Route25AfterBattleText3: ; 5172d (14:572d) +Route25AfterBattleText3: TX_FAR _Route25AfterBattleText3 db "@" -Route25BattleText4: ; 51732 (14:5732) +Route25BattleText4: TX_FAR _Route25BattleText4 db "@" -Route25EndBattleText4: ; 51737 (14:5737) +Route25EndBattleText4: TX_FAR _Route25EndBattleText4 db "@" -Route25AfterBattleText4: ; 5173c (14:573c) +Route25AfterBattleText4: TX_FAR _Route25AfterBattleText4 db "@" -Route25BattleText5: ; 51741 (14:5741) +Route25BattleText5: TX_FAR _Route25BattleText5 db "@" -Route25EndBattleText5: ; 51746 (14:5746) +Route25EndBattleText5: TX_FAR _Route25EndBattleText5 db "@" -Route25AfterBattleText5: ; 5174b (14:574b) +Route25AfterBattleText5: TX_FAR _Route25AfterBattleText5 db "@" -Route25BattleText6: ; 51750 (14:5750) +Route25BattleText6: TX_FAR _Route25BattleText6 db "@" -Route25EndBattleText6: ; 51755 (14:5755) +Route25EndBattleText6: TX_FAR _Route25EndBattleText6 db "@" -Route25AfterBattleText6: ; 5175a (14:575a) +Route25AfterBattleText6: TX_FAR _Route25AfterBattleText6 db "@" -Route25BattleText7: ; 5175f (14:575f) +Route25BattleText7: TX_FAR _Route25BattleText7 db "@" -Route25EndBattleText7: ; 51764 (14:5764) +Route25EndBattleText7: TX_FAR _Route25EndBattleText7 db "@" -Route25AfterBattleText7: ; 51769 (14:5769) +Route25AfterBattleText7: TX_FAR _Route25AfterBattleText7 db "@" -Route25BattleText8: ; 5176e (14:576e) +Route25BattleText8: TX_FAR _Route25BattleText8 db "@" -Route25EndBattleText8: ; 51773 (14:5773) +Route25EndBattleText8: TX_FAR _Route25EndBattleText8 db "@" -Route25AfterBattleText8: ; 51778 (14:5778) +Route25AfterBattleText8: TX_FAR _Route25AfterBattleText8 db "@" -Route25BattleText9: ; 5177d (14:577d) +Route25BattleText9: TX_FAR _Route25BattleText9 db "@" -Route25EndBattleText9: ; 51782 (14:5782) +Route25EndBattleText9: TX_FAR _Route25EndBattleText9 db "@" -Route25AfterBattleText9: ; 51787 (14:5787) +Route25AfterBattleText9: TX_FAR _Route25AfterBattleText9 db "@" -Route25Text11: ; 5178c (14:578c) +Route25Text11: TX_FAR _Route25Text11 db "@" diff --git a/scripts/route2gate.asm b/scripts/route2gate.asm index 133d0e7c..34f1aa35 100755 --- a/scripts/route2gate.asm +++ b/scripts/route2gate.asm @@ -1,11 +1,11 @@ -Route2GateScript: ; 5d5d4 (17:55d4) +Route2GateScript: jp EnableAutoTextBoxDrawing -Route2GateTextPointers: ; 5d5d7 (17:55d7) +Route2GateTextPointers: dw Route2GateText1 dw Route2GateText2 -Route2GateText1: ; 5d5db (17:55db) +Route2GateText1: TX_ASM CheckEvent EVENT_GOT_HM05 jr nz, .asm_5d60d @@ -30,10 +30,10 @@ Route2GateText1: ; 5d5db (17:55db) .asm_5d613 jp TextScriptEnd -Route2GateText_5d616: ; 5d616 (17:5616) +Route2GateText_5d616: TX_FAR _Route2GateText_5d616 db "@" -Route2GateText2: ; 5d61b (17:561b) +Route2GateText2: TX_FAR _Route2GateText2 db "@" diff --git a/scripts/route2house.asm b/scripts/route2house.asm index d1312c91..95055aec 100755 --- a/scripts/route2house.asm +++ b/scripts/route2house.asm @@ -1,15 +1,15 @@ -Route2HouseScript: ; 1deed (7:5eed) +Route2HouseScript: jp EnableAutoTextBoxDrawing -Route2HouseTextPointers: ; 1def0 (7:5ef0) +Route2HouseTextPointers: dw Route2HouseText1 dw Route2HouseText2 -Route2HouseText1: ; 1def4 (7:5ef4) +Route2HouseText1: TX_FAR _Route2HouseText1 db "@" -Route2HouseText2: ; 1def9 (7:5ef9) +Route2HouseText2: TX_ASM ld a, $1 ld [wWhichTrade], a diff --git a/scripts/route3.asm b/scripts/route3.asm index 4640d767..b2c5de3e 100755 --- a/scripts/route3.asm +++ b/scripts/route3.asm @@ -1,4 +1,4 @@ -Route3Script: ; 554f8 (15:54f8) +Route3Script: call EnableAutoTextBoxDrawing ld hl, Route3TrainerHeader0 ld de, Route3ScriptPointers @@ -7,12 +7,12 @@ Route3Script: ; 554f8 (15:54f8) ld [wRoute3CurScript], a ret -Route3ScriptPointers: ; 5550b (15:550b) +Route3ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route3TextPointers: ; 55511 (15:5511) +Route3TextPointers: dw Route3Text1 dw Route3Text2 dw Route3Text3 @@ -24,8 +24,8 @@ Route3TextPointers: ; 55511 (15:5511) dw Route3Text9 dw Route3Text10 -Route3TrainerHeaders: ; 55525 (15:5525) -Route3TrainerHeader0: ; 55525 (15:5525) +Route3TrainerHeaders: +Route3TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_0 @@ -34,7 +34,7 @@ Route3TrainerHeader0: ; 55525 (15:5525) dw Route3EndBattleText1 ; TextEndBattle dw Route3EndBattleText1 ; TextEndBattle -Route3TrainerHeader2: ; 55531 (15:5531) +Route3TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_2 @@ -43,7 +43,7 @@ Route3TrainerHeader2: ; 55531 (15:5531) dw Route3EndBattleText2 ; TextEndBattle dw Route3EndBattleText2 ; TextEndBattle -Route3TrainerHeader3: ; 5553d (15:553d) +Route3TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_3 @@ -52,7 +52,7 @@ Route3TrainerHeader3: ; 5553d (15:553d) dw Route3EndBattleText3 ; TextEndBattle dw Route3EndBattleText3 ; TextEndBattle -Route3TrainerHeader4: ; 55549 (15:5549) +Route3TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_4 db ($1 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_4 @@ -61,7 +61,7 @@ Route3TrainerHeader4: ; 55549 (15:5549) dw Route3EndBattleText4 ; TextEndBattle dw Route3EndBattleText4 ; TextEndBattle -Route3TrainerHeader5: ; 55555 (15:5555) +Route3TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_5 @@ -70,7 +70,7 @@ Route3TrainerHeader5: ; 55555 (15:5555) dw Route3EndBattleText5 ; TextEndBattle dw Route3EndBattleText5 ; TextEndBattle -Route3TrainerHeader6: ; 55561 (15:5561) +Route3TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_6 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_6 @@ -79,7 +79,7 @@ Route3TrainerHeader6: ; 55561 (15:5561) dw Route3EndBattleText6 ; TextEndBattle dw Route3EndBattleText6 ; TextEndBattle -Route3TrainerHeader7: ; 5556d (15:556d) +Route3TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_7, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_7, 1 @@ -88,7 +88,7 @@ Route3TrainerHeader7: ; 5556d (15:556d) dw Route3EndBattleText7 ; TextEndBattle dw Route3EndBattleText7 ; TextEndBattle -Route3TrainerHeader8: ; 55579 (15:5579) +Route3TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_3_TRAINER_8, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_3_TRAINER_8, 1 @@ -99,154 +99,154 @@ Route3TrainerHeader8: ; 55579 (15:5579) db $ff -Route3Text1: ; 55586 (15:5586) +Route3Text1: TX_FAR _Route3Text1 db "@" -Route3Text2: ; 5558b (15:558b) +Route3Text2: TX_ASM ld hl, Route3TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route3BattleText1: ; 55595 (15:5595) +Route3BattleText1: TX_FAR _Route3BattleText1 db "@" -Route3EndBattleText1: ; 5559a (15:559a) +Route3EndBattleText1: TX_FAR _Route3EndBattleText1 db "@" -Route3AfterBattleText1: ; 5559f (15:559f) +Route3AfterBattleText1: TX_FAR _Route3AfterBattleText1 db "@" -Route3Text3: ; 555a4 (15:55a4) +Route3Text3: TX_ASM ld hl, Route3TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route3BattleText2: ; 555ae (15:55ae) +Route3BattleText2: TX_FAR _Route3BattleText2 db "@" -Route3EndBattleText2: ; 555b3 (15:55b3) +Route3EndBattleText2: TX_FAR _Route3EndBattleText2 db "@" -Route3AfterBattleText2: ; 555b8 (15:55b8) +Route3AfterBattleText2: TX_FAR _Route3AfterBattleText2 db "@" -Route3Text4: ; 555bd (15:55bd) +Route3Text4: TX_ASM ld hl, Route3TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route3BattleText3: ; 555c7 (15:55c7) +Route3BattleText3: TX_FAR _Route3BattleText3 db "@" -Route3EndBattleText3: ; 555cc (15:55cc) +Route3EndBattleText3: TX_FAR _Route3EndBattleText3 db "@" -Route3AfterBattleText3: ; 555d1 (15:55d1) +Route3AfterBattleText3: TX_FAR _Route3AfterBattleText3 db "@" -Route3Text5: ; 555d6 (15:55d6) +Route3Text5: TX_ASM ld hl, Route3TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route3BattleText4: ; 555e0 (15:55e0) +Route3BattleText4: TX_FAR _Route3BattleText4 db "@" -Route3EndBattleText4: ; 555e5 (15:55e5) +Route3EndBattleText4: TX_FAR _Route3EndBattleText4 db "@" -Route3AfterBattleText4: ; 555ea (15:55ea) +Route3AfterBattleText4: TX_FAR _Route3AfterBattleText4 db "@" -Route3Text6: ; 555ef (15:55ef) +Route3Text6: TX_ASM ld hl, Route3TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route3BattleText5: ; 555f9 (15:55f9) +Route3BattleText5: TX_FAR _Route3BattleText5 db "@" -Route3EndBattleText5: ; 555fe (15:55fe) +Route3EndBattleText5: TX_FAR _Route3EndBattleText5 db "@" -Route3AfterBattleText5: ; 55603 (15:5603) +Route3AfterBattleText5: TX_FAR _Route3AfterBattleText5 db "@" -Route3Text7: ; 55608 (15:5608) +Route3Text7: TX_ASM ld hl, Route3TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route3BattleText6: ; 55612 (15:5612) +Route3BattleText6: TX_FAR _Route3BattleText6 db "@" -Route3EndBattleText6: ; 55617 (15:5617) +Route3EndBattleText6: TX_FAR _Route3EndBattleText6 db "@" -Route3AfterBattleText6: ; 5561c (15:561c) +Route3AfterBattleText6: TX_FAR _Route3AfterBattleText6 db "@" -Route3Text8: ; 55621 (15:5621) +Route3Text8: TX_ASM ld hl, Route3TrainerHeader7 call TalkToTrainer jp TextScriptEnd -Route3BattleText7: ; 5562b (15:562b) +Route3BattleText7: TX_FAR _Route3BattleText7 db "@" -Route3EndBattleText7: ; 55630 (15:5630) +Route3EndBattleText7: TX_FAR _Route3EndBattleText7 db "@" -Route3AfterBattleText7: ; 55635 (15:5635) +Route3AfterBattleText7: TX_FAR _Route3AfterBattleText7 db "@" -Route3Text9: ; 5563a (15:563a) +Route3Text9: TX_ASM ld hl, Route3TrainerHeader8 call TalkToTrainer jp TextScriptEnd -Route3BattleText8: ; 55644 (15:5644) +Route3BattleText8: TX_FAR _Route3BattleText8 db "@" -Route3EndBattleText8: ; 55649 (15:5649) +Route3EndBattleText8: TX_FAR _Route3EndBattleText8 db "@" -Route3AfterBattleText8: ; 5564e (15:564e) +Route3AfterBattleText8: TX_FAR _Route3AfterBattleText8 db "@" -Route3Text10: ; 55653 (15:5653) +Route3Text10: TX_FAR _Route3Text10 db "@" diff --git a/scripts/route4.asm b/scripts/route4.asm index 019d5582..559f2006 100755 --- a/scripts/route4.asm +++ b/scripts/route4.asm @@ -1,4 +1,4 @@ -Route4Script: ; 55658 (15:5658) +Route4Script: call EnableAutoTextBoxDrawing ld hl, Route4TrainerHeaders ld de, Route4ScriptPointers @@ -7,12 +7,12 @@ Route4Script: ; 55658 (15:5658) ld [wRoute4CurScript], a ret -Route4ScriptPointers: ; 5566b (15:566b) +Route4ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route4TextPointers: ; 55671 (15:5671) +Route4TextPointers: dw Route4Text1 dw Route4Text2 dw PickUpItemText @@ -20,8 +20,8 @@ Route4TextPointers: ; 55671 (15:5671) dw Route4Text5 dw Route4Text6 -Route4TrainerHeaders: ; 5567d (15:567d) -Route4TrainerHeader0: ; 5567d (15:567d) +Route4TrainerHeaders: +Route4TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_4_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_4_TRAINER_0 @@ -32,32 +32,32 @@ Route4TrainerHeader0: ; 5567d (15:567d) db $ff -Route4Text1: ; 5568a (15:568a) +Route4Text1: TX_FAR _Route4Text1 db "@" -Route4Text2: ; 5568f (15:568f) +Route4Text2: TX_ASM ld hl, Route4TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route4BattleText1: ; 55699 (15:5699) +Route4BattleText1: TX_FAR _Route4BattleText1 db "@" -Route4EndBattleText1: ; 5569e (15:569e) +Route4EndBattleText1: TX_FAR _Route4EndBattleText1 db "@" -Route4AfterBattleText1: ; 556a3 (15:56a3) +Route4AfterBattleText1: TX_FAR _Route4AfterBattleText1 db "@" -Route4Text5: ; 556a8 (15:56a8) +Route4Text5: TX_FAR _Route4Text5 db "@" -Route4Text6: ; 556ad (15:56ad) +Route4Text6: TX_FAR _Route4Text6 db "@" diff --git a/scripts/route5.asm b/scripts/route5.asm index 1f42bc4e..113212a4 100755 --- a/scripts/route5.asm +++ b/scripts/route5.asm @@ -1,9 +1,9 @@ -Route5Script: ; 556c6 (15:56c6) +Route5Script: jp EnableAutoTextBoxDrawing -Route5TextPointers: ; 556c9 (15:56c9) +Route5TextPointers: dw Route5Text1 -Route5Text1: ; 556cb (15:56cb) +Route5Text1: TX_FAR _Route5Text1 db "@" diff --git a/scripts/route5gate.asm b/scripts/route5gate.asm index f35e5dea..b3ad0aa3 100755 --- a/scripts/route5gate.asm +++ b/scripts/route5gate.asm @@ -1,21 +1,21 @@ -Route5GateScript: ; 1df33 (7:5f33) +Route5GateScript: call EnableAutoTextBoxDrawing ld a, [wRoute5GateCurScript] ld hl, Route5GateScriptPointers jp JumpTable -Route5GateScriptPointers: ; 1df3f (7:5f3f) +Route5GateScriptPointers: dw Route5GateScript0 dw Route5GateScript1 -Route5GateScript_1df43: ; 1df43 (7:5f43) +Route5GateScript_1df43: ld a, D_UP ld [wSimulatedJoypadStatesEnd], a ld a, $1 ld [wSimulatedJoypadStatesIndex], a jp StartSimulatingJoypadStates -Route5GateScript0: ; 1df50 (7:5f50) +Route5GateScript0: ld a, [wd728] bit 6, a ret nz @@ -45,12 +45,12 @@ Route5GateScript0: ; 1df50 (7:5f50) set 6, [hl] ret -CoordsData_1df8f: ; 1df8f (7:5f8f) +CoordsData_1df8f: db 3,3 db 3,4 db $ff -Route5GateScript1: ; 1df94 (7:5f94) +Route5GateScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -60,15 +60,15 @@ Route5GateScript1: ; 1df94 (7:5f94) ld [wRoute5GateCurScript], a ret -Route5GateTextPointers: ; 1dfa4 (7:5fa4) +Route5GateTextPointers: dw Route5GateText1 dw Route5GateText2 dw Route5GateText3 -Route8GateText1: ; 1dfaa (7:5faa) -Route7GateText1: ; 1dfaa (7:5faa) -Route6GateText1: ; 1dfaa (7:5faa) -Route5GateText1: ; 1dfaa (7:5faa) +Route8GateText1: +Route7GateText1: +Route6GateText1: +Route5GateText1: TX_ASM ld a, [wd728] bit 6, a @@ -94,23 +94,23 @@ Route5GateText1: ; 1dfaa (7:5faa) call PrintText jp TextScriptEnd -Route8GateText2: ; 1dfe7 (7:5fe7) -Route7GateText2: ; 1dfe7 (7:5fe7) -Route6GateText2: ; 1dfe7 (7:5fe7) -Route5GateText2: ; 1dfe7 (7:5fe7) +Route8GateText2: +Route7GateText2: +Route6GateText2: +Route5GateText2: TX_FAR _SaffronGateText_1dfe7 db "@" -Route8GateText3: ; 1dfec (7:5fec) -Route7GateText3: ; 1dfec (7:5fec) -Route6GateText3: ; 1dfec (7:5fec) -Route5GateText3: ; 1dfec (7:5fec) +Route8GateText3: +Route7GateText3: +Route6GateText3: +Route5GateText3: TX_FAR _SaffronGateText_8aaa9 db $11 TX_FAR _SaffronGateText_1dff1 db "@" -SaffronGateText_1dff6: ; 1dff6 (7:5ff6) +SaffronGateText_1dff6: TX_FAR _SaffronGateText_1dff6 db "@" diff --git a/scripts/route6.asm b/scripts/route6.asm index 85b7cb63..7f3a5dda 100755 --- a/scripts/route6.asm +++ b/scripts/route6.asm @@ -1,4 +1,4 @@ -Route6Script: ; 590b0 (16:50b0) +Route6Script: call EnableAutoTextBoxDrawing ld hl, Route6TrainerHeaders ld de, Route6ScriptPointers @@ -7,12 +7,12 @@ Route6Script: ; 590b0 (16:50b0) ld [wRoute6CurScript], a ret -Route6ScriptPointers: ; 590c3 (16:50c3) +Route6ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route6TextPointers: ; 590c9 (16:50c9) +Route6TextPointers: dw Route6Text1 dw Route6Text2 dw Route6Text3 @@ -21,8 +21,8 @@ Route6TextPointers: ; 590c9 (16:50c9) dw Route6Text6 dw Route6Text7 -Route6TrainerHeaders: ; 590d7 (16:50d7) -Route6TrainerHeader0: ; 590d7 (16:50d7) +Route6TrainerHeaders: +Route6TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_0 @@ -31,7 +31,7 @@ Route6TrainerHeader0: ; 590d7 (16:50d7) dw Route6EndBattleText1 ; TextEndBattle dw Route6EndBattleText1 ; TextEndBattle -Route6TrainerHeader1: ; 590e3 (16:50e3) +Route6TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_1 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_1 @@ -40,7 +40,7 @@ Route6TrainerHeader1: ; 590e3 (16:50e3) dw Route6EndBattleText2 ; TextEndBattle dw Route6EndBattleText2 ; TextEndBattle -Route6TrainerHeader2: ; 590ef (16:50ef) +Route6TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_2 @@ -49,7 +49,7 @@ Route6TrainerHeader2: ; 590ef (16:50ef) dw Route6EndBattleText3 ; TextEndBattle dw Route6EndBattleText3 ; TextEndBattle -Route6TrainerHeader3: ; 590fb (16:50fb) +Route6TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_3 @@ -58,7 +58,7 @@ Route6TrainerHeader3: ; 590fb (16:50fb) dw Route6EndBattleText4 ; TextEndBattle dw Route6EndBattleText4 ; TextEndBattle -Route6TrainerHeader4: ; 59107 (16:5107) +Route6TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_4 @@ -67,7 +67,7 @@ Route6TrainerHeader4: ; 59107 (16:5107) dw Route6EndBattleText5 ; TextEndBattle dw Route6EndBattleText5 ; TextEndBattle -Route6TrainerHeader5: ; 59113 (16:5113) +Route6TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_6_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_6_TRAINER_5 @@ -78,35 +78,35 @@ Route6TrainerHeader5: ; 59113 (16:5113) db $ff -Route6Text1: ; 59120 (16:5120) +Route6Text1: TX_ASM ld hl, Route6TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route6BattleText1: ; 5912a (16:512a) +Route6BattleText1: TX_FAR _Route6BattleText1 db "@" -Route6EndBattleText1: ; 5912f (16:512f) +Route6EndBattleText1: TX_FAR _Route6EndBattleText1 db "@" -Route6AfterBattleText1: ; 59134 (16:5134) +Route6AfterBattleText1: TX_FAR _Route6AfterBattleText1 db "@" -Route6Text2: ; 59139 (16:5139) +Route6Text2: TX_ASM ld hl, Route6TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route6BattleText2: ; 59143 (16:5143) +Route6BattleText2: TX_FAR _Route6BattleText2 db "@" -Route6EndBattleText2: ; 59148 (16:5148) +Route6EndBattleText2: TX_FAR _Route6EndBattleText2 db "@" @@ -114,78 +114,78 @@ Route6AfterBattleText2: TX_FAR _Route6AfterBattleText2 db "@" -Route6Text3: ; 5914d (16:514d) +Route6Text3: TX_ASM ld hl, Route6TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route6BattleText3: ; 59157 (16:5157) +Route6BattleText3: TX_FAR _Route6BattleText3 db "@" -Route6EndBattleText3: ; 5915c (16:515c) +Route6EndBattleText3: TX_FAR _Route6EndBattleText3 db "@" -Route6AfterBattleText3: ; 59161 (16:5161) +Route6AfterBattleText3: TX_FAR _Route6AfterBattleText3 db "@" -Route6Text4: ; 59166 (16:5166) +Route6Text4: TX_ASM ld hl, Route6TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route6BattleText4: ; 59170 (16:5170) +Route6BattleText4: TX_FAR _Route6BattleText4 db "@" -Route6EndBattleText4: ; 59175 (16:5175) +Route6EndBattleText4: TX_FAR _Route6EndBattleText4 db "@" -Route6AfterBattleText4: ; 5917a (16:517a) +Route6AfterBattleText4: TX_FAR _Route6AfterBattleText4 db "@" -Route6Text5: ; 5917f (16:517f) +Route6Text5: TX_ASM ld hl, Route6TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route6BattleText5: ; 59189 (16:5189) +Route6BattleText5: TX_FAR _Route6BattleText5 db "@" -Route6EndBattleText5: ; 5918e (16:518e) +Route6EndBattleText5: TX_FAR _Route6EndBattleText5 db "@" -Route6AfterBattleText5: ; 59193 (16:5193) +Route6AfterBattleText5: TX_FAR _Route6AfterBattleText5 db "@" -Route6Text6: ; 59198 (16:5198) +Route6Text6: TX_ASM ld hl, Route6TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route6BattleText6: ; 591a2 (16:51a2) +Route6BattleText6: TX_FAR _Route6BattleText6 db "@" -Route6EndBattleText6: ; 591a7 (16:51a7) +Route6EndBattleText6: TX_FAR _Route6EndBattleText6 db "@" -Route6AfterBattleText6: ; 591ac (16:51ac) +Route6AfterBattleText6: TX_FAR _Route6AfterBattleText6 db "@" -Route6Text7: ; 591b1 (16:51b1) +Route6Text7: TX_FAR _Route6Text7 db "@" diff --git a/scripts/route6gate.asm b/scripts/route6gate.asm index c0c19021..001a295c 100755 --- a/scripts/route6gate.asm +++ b/scripts/route6gate.asm @@ -1,15 +1,15 @@ -Route6GateScript: ; 1e03d (7:603d) +Route6GateScript: call EnableAutoTextBoxDrawing ld hl, Route6GateScriptPointers ld a, [wRoute6GateCurScript] call JumpTable ret -Route6GateScriptPointers: ; 1e04a (7:604a) +Route6GateScriptPointers: dw Route6GateScript0 dw Route6GateScript1 -Route6GateScript0: ; 1e04e (7:604e) +Route6GateScript0: ld a, [wd728] bit 6, a ret nz @@ -38,11 +38,11 @@ Route6GateScript0: ; 1e04e (7:604e) ld [hSpriteIndexOrTextID], a jp DisplayTextID -CoordsData_1e08c: ; 1e08c (7:608c) +CoordsData_1e08c: db $02,$03 db $02,$04,$FF -Route6GateScript1: ; 1e091 (7:6091) +Route6GateScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -52,7 +52,7 @@ Route6GateScript1: ; 1e091 (7:6091) ld [wRoute6GateCurScript], a ret -Route6GateScript_1e0a1: ; 1e0a1 (7:60a1) +Route6GateScript_1e0a1: ld hl, wd730 set 7, [hl] ld a, $80 @@ -64,7 +64,7 @@ Route6GateScript_1e0a1: ; 1e0a1 (7:60a1) ld [wOverrideSimulatedJoypadStatesMask], a ret -Route6GateTextPointers: ; 1e0b8 (7:60b8) +Route6GateTextPointers: dw Route6GateText1 dw Route6GateText2 dw Route6GateText3 diff --git a/scripts/route7.asm b/scripts/route7.asm index 55183d16..af353821 100755 --- a/scripts/route7.asm +++ b/scripts/route7.asm @@ -1,10 +1,10 @@ -Route7Script: ; 480eb (12:40eb) +Route7Script: call EnableAutoTextBoxDrawing ret -Route7TextPointers: ; 480ef (12:40ef) +Route7TextPointers: dw Route7Text1 -Route7Text1: ; 480f1 (12:40f1) +Route7Text1: TX_FAR _Route7Text1 db "@" diff --git a/scripts/route7gate.asm b/scripts/route7gate.asm index fdb94d4a..6e62c73c 100755 --- a/scripts/route7gate.asm +++ b/scripts/route7gate.asm @@ -1,15 +1,15 @@ -Route7GateScript: ; 1e100 (7:6100) +Route7GateScript: call EnableAutoTextBoxDrawing ld a, [wRoute7GateCurScript] ld hl, Route7GateScriptPointers call JumpTable ret -Route7GateScriptPointers: ; 1e10d (7:610d) +Route7GateScriptPointers: dw Route7GateScript0 dw Route7GateScript1 -Route7GateScript_1e111: ; 1e111 (7:6111) +Route7GateScript_1e111: ld hl, wd730 set 7, [hl] ld a, $20 @@ -21,7 +21,7 @@ Route7GateScript_1e111: ; 1e111 (7:6111) ld [wOverrideSimulatedJoypadStatesMask], a ret -Route7GateScript0: ; 1e128 (7:6128) +Route7GateScript0: ld a, [wd728] bit 6, a ret nz @@ -51,12 +51,12 @@ Route7GateScript0: ; 1e128 (7:6128) set 6, [hl] ret -CoordsData_1e167: ; 1e167 (7:6167) +CoordsData_1e167: db 3,3 db 4,3 db $ff -Route7GateScript1: ; 1e16c (7:616c) +Route7GateScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -67,7 +67,7 @@ Route7GateScript1: ; 1e16c (7:616c) ld [wCurMapScript], a ret -Route7GateTextPointers: ; 1e17f (7:617f) +Route7GateTextPointers: dw Route7GateText1 dw Route7GateText2 dw Route7GateText3 diff --git a/scripts/route8.asm b/scripts/route8.asm index cfb4f433..34e6aba4 100755 --- a/scripts/route8.asm +++ b/scripts/route8.asm @@ -1,4 +1,4 @@ -Route8Script: ; 591b6 (16:51b6) +Route8Script: call EnableAutoTextBoxDrawing ld hl, Route8TrainerHeaders ld de, Route8ScriptPointers @@ -7,12 +7,12 @@ Route8Script: ; 591b6 (16:51b6) ld [wRoute8CurScript], a ret -Route8ScriptPointers: ; 591c9 (16:51c9) +Route8ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route8TextPointers: ; 591cf (16:51cf) +Route8TextPointers: dw Route8Text1 dw Route8Text2 dw Route8Text3 @@ -24,8 +24,8 @@ Route8TextPointers: ; 591cf (16:51cf) dw Route8Text9 dw Route8Text10 -Route8TrainerHeaders: ; 591e3 (16:51e3) -Route8TrainerHeader0: ; 591e3 (16:51e3) +Route8TrainerHeaders: +Route8TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_0 @@ -34,7 +34,7 @@ Route8TrainerHeader0: ; 591e3 (16:51e3) dw Route8EndBattleText1 ; TextEndBattle dw Route8EndBattleText1 ; TextEndBattle -Route8TrainerHeader1: ; 591ef (16:51ef) +Route8TrainerHeader1: dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_1 @@ -43,7 +43,7 @@ Route8TrainerHeader1: ; 591ef (16:51ef) dw Route8EndBattleText2 ; TextEndBattle dw Route8EndBattleText2 ; TextEndBattle -Route8TrainerHeader2: ; 591fb (16:51fb) +Route8TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_2 @@ -52,7 +52,7 @@ Route8TrainerHeader2: ; 591fb (16:51fb) dw Route8EndBattleText3 ; TextEndBattle dw Route8EndBattleText3 ; TextEndBattle -Route8TrainerHeader3: ; 59207 (16:5207) +Route8TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_3 @@ -61,7 +61,7 @@ Route8TrainerHeader3: ; 59207 (16:5207) dw Route8EndBattleText4 ; TextEndBattle dw Route8EndBattleText4 ; TextEndBattle -Route8TrainerHeader4: ; 59213 (16:5213) +Route8TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_4 @@ -70,7 +70,7 @@ Route8TrainerHeader4: ; 59213 (16:5213) dw Route8EndBattleText5 ; TextEndBattle dw Route8EndBattleText5 ; TextEndBattle -Route8TrainerHeader5: ; 5921f (16:521f) +Route8TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_5 @@ -79,7 +79,7 @@ Route8TrainerHeader5: ; 5921f (16:521f) dw Route8EndBattleText6 ; TextEndBattle dw Route8EndBattleText6 ; TextEndBattle -Route8TrainerHeader6: ; 5922b (16:522b) +Route8TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_6 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_6 @@ -88,7 +88,7 @@ Route8TrainerHeader6: ; 5922b (16:522b) dw Route8EndBattleText7 ; TextEndBattle dw Route8EndBattleText7 ; TextEndBattle -Route8TrainerHeader7: ; 59237 (16:5237) +Route8TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_7, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_7, 1 @@ -97,7 +97,7 @@ Route8TrainerHeader7: ; 59237 (16:5237) dw Route8EndBattleText8 ; TextEndBattle dw Route8EndBattleText8 ; TextEndBattle -Route8TrainerHeader8: ; 59243 (16:5243) +Route8TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_8_TRAINER_8, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_8_TRAINER_8, 1 @@ -108,168 +108,168 @@ Route8TrainerHeader8: ; 59243 (16:5243) db $ff -Route8Text1: ; 59250 (16:5250) +Route8Text1: TX_ASM ld hl, Route8TrainerHeader0 call TalkToTrainer jp TextScriptEnd -Route8BattleText1: ; 5925a (16:525a) +Route8BattleText1: TX_FAR _Route8BattleText1 db "@" -Route8EndBattleText1: ; 5925f (16:525f) +Route8EndBattleText1: TX_FAR _Route8EndBattleText1 db "@" -Route8AfterBattleText1: ; 59264 (16:5264) +Route8AfterBattleText1: TX_FAR _Route8AfterBattleText1 db "@" -Route8Text2: ; 59269 (16:5269) +Route8Text2: TX_ASM ld hl, Route8TrainerHeader1 call TalkToTrainer jp TextScriptEnd -Route8BattleText2: ; 59273 (16:5273) +Route8BattleText2: TX_FAR _Route8BattleText2 db "@" -Route8EndBattleText2: ; 59278 (16:5278) +Route8EndBattleText2: TX_FAR _Route8EndBattleText2 db "@" -Route8AfterBattleText2: ; 5927d (16:527d) +Route8AfterBattleText2: TX_FAR _Route8AfterBattleText2 db "@" -Route8Text3: ; 59282 (16:5282) +Route8Text3: TX_ASM ld hl, Route8TrainerHeader2 call TalkToTrainer jp TextScriptEnd -Route8BattleText3: ; 5928c (16:528c) +Route8BattleText3: TX_FAR _Route8BattleText3 db "@" -Route8EndBattleText3: ; 59291 (16:5291) +Route8EndBattleText3: TX_FAR _Route8EndBattleText3 db "@" -Route8AfterBattleText3: ; 59296 (16:5296) +Route8AfterBattleText3: TX_FAR _Route8AfterBattleText3 db "@" -Route8Text4: ; 5929b (16:529b) +Route8Text4: TX_ASM ld hl, Route8TrainerHeader3 call TalkToTrainer jp TextScriptEnd -Route8BattleText4: ; 592a5 (16:52a5) +Route8BattleText4: TX_FAR _Route8BattleText4 db "@" -Route8EndBattleText4: ; 592aa (16:52aa) +Route8EndBattleText4: TX_FAR _Route8EndBattleText4 db "@" -Route8AfterBattleText4: ; 592af (16:52af) +Route8AfterBattleText4: TX_FAR _Route8AfterBattleText4 db "@" -Route8Text5: ; 592b4 (16:52b4) +Route8Text5: TX_ASM ld hl, Route8TrainerHeader4 call TalkToTrainer jp TextScriptEnd -Route8BattleText5: ; 592be (16:52be) +Route8BattleText5: TX_FAR _Route8BattleText5 db "@" -Route8EndBattleText5: ; 592c3 (16:52c3) +Route8EndBattleText5: TX_FAR _Route8EndBattleText5 db "@" -Route8AfterBattleText5: ; 592c8 (16:52c8) +Route8AfterBattleText5: TX_FAR _Route8AfterBattleText5 db "@" -Route8Text6: ; 592cd (16:52cd) +Route8Text6: TX_ASM ld hl, Route8TrainerHeader5 call TalkToTrainer jp TextScriptEnd -Route8BattleText6: ; 592d7 (16:52d7) +Route8BattleText6: TX_FAR _Route8BattleText6 db "@" -Route8EndBattleText6: ; 592dc (16:52dc) +Route8EndBattleText6: TX_FAR _Route8EndBattleText6 db "@" -Route8AfterBattleText6: ; 592e1 (16:52e1) +Route8AfterBattleText6: TX_FAR _Route8AfterBattleText6 db "@" -Route8Text7: ; 592e6 (16:52e6) +Route8Text7: TX_ASM ld hl, Route8TrainerHeader6 call TalkToTrainer jp TextScriptEnd -Route8BattleText7: ; 592f0 (16:52f0) +Route8BattleText7: TX_FAR _Route8BattleText7 db "@" -Route8EndBattleText7: ; 592f5 (16:52f5) +Route8EndBattleText7: TX_FAR _Route8EndBattleText7 db "@" -Route8AfterBattleText7: ; 592fa (16:52fa) +Route8AfterBattleText7: TX_FAR _Route8AfterBattleText7 db "@" -Route8Text8: ; 592ff (16:52ff) +Route8Text8: TX_ASM ld hl, Route8TrainerHeader7 call TalkToTrainer jp TextScriptEnd -Route8BattleText8: ; 59309 (16:5309) +Route8BattleText8: TX_FAR _Route8BattleText8 db "@" -Route8EndBattleText8: ; 5930e (16:530e) +Route8EndBattleText8: TX_FAR _Route8EndBattleText8 db "@" -Route8AfterBattleText8: ; 59313 (16:5313) +Route8AfterBattleText8: TX_FAR _Route8AfterBattleText8 db "@" -Route8Text9: ; 59318 (16:5318) +Route8Text9: TX_ASM ld hl, Route8TrainerHeader8 call TalkToTrainer jp TextScriptEnd -Route8BattleText9: ; 59322 (16:5322) +Route8BattleText9: TX_FAR _Route8BattleText9 db "@" -Route8EndBattleText9: ; 59327 (16:5327) +Route8EndBattleText9: TX_FAR _Route8EndBattleText9 db "@" -Route8AfterBattleText9: ; 5932c (16:532c) +Route8AfterBattleText9: TX_FAR _Route8AfterBattleText9 db "@" -Route8Text10: ; 59331 (16:5331) +Route8Text10: TX_FAR _Route8Text10 db "@" diff --git a/scripts/route8gate.asm b/scripts/route8gate.asm index 8068f153..b86458d8 100755 --- a/scripts/route8gate.asm +++ b/scripts/route8gate.asm @@ -1,14 +1,14 @@ -Route8GateScript: ; 1e1c7 (7:61c7) +Route8GateScript: call EnableAutoTextBoxDrawing ld hl, Route8GateScriptPointers ld a, [wRoute8GateCurScript] jp JumpTable -Route8GateScriptPointers: ; 1e1d3 (7:61d3) +Route8GateScriptPointers: dw Route8GateScript0 dw Route8GateScript1 -Route8GateScript_1e1d7: ; 1e1d7 (7:61d7) +Route8GateScript_1e1d7: ld hl, wd730 set 7, [hl] ld a, $10 @@ -20,7 +20,7 @@ Route8GateScript_1e1d7: ; 1e1d7 (7:61d7) ld [wOverrideSimulatedJoypadStatesMask], a ret -Route8GateScript0: ; 1e1ee (7:61ee) +Route8GateScript0: ld a, [wd728] bit 6, a ret nz @@ -49,12 +49,12 @@ Route8GateScript0: ; 1e1ee (7:61ee) ld [hSpriteIndexOrTextID], a jp DisplayTextID -CoordsData_1e22c: ; 1e22c (7:622c) +CoordsData_1e22c: db 3,2 db 4,2 db $ff -Route8GateScript1: ; 1e231 (7:6231) +Route8GateScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -64,7 +64,7 @@ Route8GateScript1: ; 1e231 (7:6231) ld [wRoute8GateCurScript], a ret -Route8GateTextPointers: ; 1e241 (7:6241) +Route8GateTextPointers: dw Route8GateText1 dw Route8GateText2 dw Route8GateText3 diff --git a/scripts/route9.asm b/scripts/route9.asm index fd9949eb..f08e9790 100755 --- a/scripts/route9.asm +++ b/scripts/route9.asm @@ -1,4 +1,4 @@ -Route9Script: ; 556bc (15:56bc) +Route9Script: call EnableAutoTextBoxDrawing ld hl, Route9TrainerHeaders ld de, Route9ScriptPointers @@ -7,12 +7,12 @@ Route9Script: ; 556bc (15:56bc) ld [wRoute9CurScript], a ret -Route9ScriptPointers: ; 556cf (15:56cf) +Route9ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -Route9TextPointers: ; 556d5 (15:56d5) +Route9TextPointers: dw Route9Text1 dw Route9TextAJ dw Route9Text3 @@ -25,8 +25,8 @@ Route9TextPointers: ; 556d5 (15:56d5) dw PickUpItemText dw Route9Text11 -Route9TrainerHeaders: ; 556eb (15:56eb) -Route9TrainerHeader0: ; 556eb (15:56eb) +Route9TrainerHeaders: +Route9TrainerHeader0: dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_0 @@ -35,7 +35,7 @@ Route9TrainerHeader0: ; 556eb (15:56eb) dw Route9EndBattleText1 ; TextEndBattle dw Route9EndBattleText1 ; TextEndBattle -Route9TrainerHeader2: ; 556f7 (15:56f7) +Route9TrainerHeader2: dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_2 @@ -44,7 +44,7 @@ Route9TrainerHeader2: ; 556f7 (15:56f7) dw Route9EndBattleTextAJ ; TextEndBattle dw Route9EndBattleTextAJ ; TextEndBattle -Route9TrainerHeader3: ; 55703 (15:5703) +Route9TrainerHeader3: dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_3 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_3 @@ -53,7 +53,7 @@ Route9TrainerHeader3: ; 55703 (15:5703) dw Route9EndBattleText3 ; TextEndBattle dw Route9EndBattleText3 ; TextEndBattle -Route9TrainerHeader4: ; 5570f (15:570f) +Route9TrainerHeader4: dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_4 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_4 @@ -62,7 +62,7 @@ Route9TrainerHeader4: ; 5570f (15:570f) dw Route9EndBattleText4 ; TextEndBattle dw Route9EndBattleText4 ; TextEndBattle -Route9TrainerHeader5: ; 5571b (15:571b) +Route9TrainerHeader5: dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_5 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_5 @@ -71,7 +71,7 @@ Route9TrainerHeader5: ; 5571b (15:571b) dw Route9EndBattleText5 ; TextEndBattle dw Route9EndBattleText5 ; TextEndBattle -Route9TrainerHeader6: ; 55727 (15:5727) +Route9TrainerHeader6: dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_6 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_6 @@ -80,7 +80,7 @@ Route9TrainerHeader6: ; 55727 (15:5727) dw Route9EndBattleText6 ; TextEndBattle dw Route9EndBattleText6 ; TextEndBattle -Route9TrainerHeader7: ; 55733 (15:5733) +Route9TrainerHeader7: dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_7 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_7 @@ -89,7 +89,7 @@ Route9TrainerHeader7: ; 55733 (15:5733) dw Route9EndBattleText7 ; TextEndBattle dw Route9EndBattleText7 ; TextEndBattle -Route9TrainerHeader8: ; 5573f (15:573f) +Route9TrainerHeader8: dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_8, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_8, 1 @@ -98,7 +98,7 @@ Route9TrainerHeader8: ; 5573f (15:573f) dw Route9EndBattleText8 ; TextEndBattle dw Route9EndBattleText8 ; TextEndBattle -Route9TrainerHeader9: ; 5574b (15:574b) +Route9TrainerHeader9: dbEventFlagBit EVENT_BEAT_ROUTE_9_TRAINER_9, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_ROUTE_9_TRAINER_9, 1 @@ -109,161 +109,161 @@ Route9TrainerHeader9: ; 5574b (15:574b) db $ff -Route9Text1: ; 55758 (15:5758) +Route9Text1: TX_ASM ld hl, Route9TrainerHeader0 jr Route9TalkToTrainer -Route9TextAJ: ; 5575e (15:575e) +Route9TextAJ: TX_ASM ld hl, Route9TrainerHeader2 jr Route9TalkToTrainer -Route9Text3: ; 55764 (15:5764) +Route9Text3: TX_ASM ld hl, Route9TrainerHeader3 jr Route9TalkToTrainer -Route9Text4: ; 5576a (15:576a) +Route9Text4: TX_ASM ld hl, Route9TrainerHeader4 jr Route9TalkToTrainer -Route9Text5: ; 55770 (15:5770) +Route9Text5: TX_ASM ld hl, Route9TrainerHeader5 jr Route9TalkToTrainer -Route9Text6: ; 55776 (15:5776) +Route9Text6: TX_ASM ld hl, Route9TrainerHeader6 jr Route9TalkToTrainer -Route9Text7: ; 5577c (15:577c) +Route9Text7: TX_ASM ld hl, Route9TrainerHeader7 jr Route9TalkToTrainer -Route9Text8: ; 55782 (15:5782) +Route9Text8: TX_ASM ld hl, Route9TrainerHeader8 jr Route9TalkToTrainer -Route9Text9: ; 55788 (15:5788) +Route9Text9: TX_ASM ld hl, Route9TrainerHeader9 -Route9TalkToTrainer: ; 5578c (15:578c) +Route9TalkToTrainer: call TalkToTrainer jp TextScriptEnd -Route9BattleText1: ; 55792 (15:5792) +Route9BattleText1: TX_FAR _Route9BattleText1 db "@" -Route9EndBattleText1: ; 55797 (15:5797) +Route9EndBattleText1: TX_FAR _Route9EndBattleText1 db "@" -Route9AfterBattleText1: ; 5579c (15:579c) +Route9AfterBattleText1: TX_FAR _Route9AfterBattleText1 db "@" -Route9BattleTextAJ: ; 557a1 (15:57a1) +Route9BattleTextAJ: TX_FAR _Route9BattleTextAJ db "@" -Route9EndBattleTextAJ: ; 557a6 (15:57a6) +Route9EndBattleTextAJ: TX_FAR _Route9EndBattleTextAJ db "@" -Route9AfterBattleTextAJ: ; 557ab (15:57ab) +Route9AfterBattleTextAJ: TX_FAR _Route9AfterBattleTextAJ db "@" -Route9BattleText3: ; 557b0 (15:57b0) +Route9BattleText3: TX_FAR _Route9BattleText3 db "@" -Route9EndBattleText3: ; 557b5 (15:57b5) +Route9EndBattleText3: TX_FAR _Route9EndBattleText3 db "@" -Route9AfterBattleText3: ; 557ba (15:57ba) +Route9AfterBattleText3: TX_FAR _Route9AfterBattleText3 db "@" -Route9BattleText4: ; 557bf (15:57bf) +Route9BattleText4: TX_FAR _Route9BattleText4 db "@" -Route9EndBattleText4: ; 557c4 (15:57c4) +Route9EndBattleText4: TX_FAR _Route9EndBattleText4 db "@" -Route9AfterBattleText4: ; 557c9 (15:57c9) +Route9AfterBattleText4: TX_FAR _Route9AfterBattleText4 db "@" -Route9BattleText5: ; 557ce (15:57ce) +Route9BattleText5: TX_FAR _Route9BattleText5 db "@" -Route9EndBattleText5: ; 557d3 (15:57d3) +Route9EndBattleText5: TX_FAR _Route9EndBattleText5 db "@" -Route9AfterBattleText5: ; 557d8 (15:57d8) +Route9AfterBattleText5: TX_FAR _Route9AfterBattleText5 db "@" -Route9BattleText6: ; 557dd (15:57dd) +Route9BattleText6: TX_FAR _Route9BattleText6 db "@" -Route9EndBattleText6: ; 557e2 (15:57e2) +Route9EndBattleText6: TX_FAR _Route9EndBattleText6 db "@" -Route9AfterBattleText6: ; 557e7 (15:57e7) +Route9AfterBattleText6: TX_FAR _Route9AfterBattleText6 db "@" -Route9BattleText7: ; 557ec (15:57ec) +Route9BattleText7: TX_FAR _Route9BattleText7 db "@" -Route9EndBattleText7: ; 557f1 (15:57f1) +Route9EndBattleText7: TX_FAR _Route9EndBattleText7 db "@" -Route9AfterBattleText7: ; 557f6 (15:57f6) +Route9AfterBattleText7: TX_FAR _Route9AfterBattleText7 db "@" -Route9BattleText8: ; 557fb (15:57fb) +Route9BattleText8: TX_FAR _Route9BattleText8 db "@" -Route9EndBattleText8: ; 55800 (15:5800) +Route9EndBattleText8: TX_FAR _Route9EndBattleText8 db "@" -Route9AfterBattleText8: ; 55805 (15:5805) +Route9AfterBattleText8: TX_FAR _Route9AfterBattleText8 db "@" -Route9BattleText9: ; 5580a (15:580a) +Route9BattleText9: TX_FAR _Route9BattleText9 db "@" -Route9EndBattleText9: ; 5580f (15:580f) +Route9EndBattleText9: TX_FAR _Route9EndBattleText9 db "@" -Route9AfterBattleText9: ; 55814 (15:5814) +Route9AfterBattleText9: TX_FAR _Route9AfterBattleText9 db "@" -Route9Text11: ; 55819 (15:5819) +Route9Text11: TX_FAR _Route9Text11 db "@" diff --git a/scripts/safarizonecenter.asm b/scripts/safarizonecenter.asm index 40042038..d796c403 100755 --- a/scripts/safarizonecenter.asm +++ b/scripts/safarizonecenter.asm @@ -1,15 +1,15 @@ -SafariZoneCenterScript: ; 45bb2 (11:5bb2) +SafariZoneCenterScript: jp EnableAutoTextBoxDrawing -SafariZoneCenterTextPointers: ; 45bb5 (11:5bb5) +SafariZoneCenterTextPointers: dw PickUpItemText dw SafariZoneCenterText2 dw SafariZoneCenterText3 -SafariZoneCenterText2: ; 45bbb (11:5bbb) +SafariZoneCenterText2: TX_FAR _SafariZoneCenterText2 db "@" -SafariZoneCenterText3: ; 45bc0 (11:5bc0) +SafariZoneCenterText3: TX_FAR _SafariZoneCenterText3 db "@" diff --git a/scripts/safarizoneeast.asm b/scripts/safarizoneeast.asm index 55ea5aa6..25d0ee30 100755 --- a/scripts/safarizoneeast.asm +++ b/scripts/safarizoneeast.asm @@ -1,7 +1,7 @@ -SafariZoneEastScript: ; 4586b (11:586b) +SafariZoneEastScript: jp EnableAutoTextBoxDrawing -SafariZoneEastTextPointers: ; 4586e (11:586e) +SafariZoneEastTextPointers: dw PickUpItemText dw PickUpItemText dw PickUpItemText @@ -10,14 +10,14 @@ SafariZoneEastTextPointers: ; 4586e (11:586e) dw SafariZoneEastText6 dw SafariZoneEastText7 -SafariZoneEastText5: ; 4587c (11:587c) +SafariZoneEastText5: TX_FAR _SafariZoneEastText5 db "@" -SafariZoneEastText6: ; 45881 (11:5881) +SafariZoneEastText6: TX_FAR _SafariZoneEastText6 db "@" -SafariZoneEastText7: ; 45886 (11:5886) +SafariZoneEastText7: TX_FAR _SafariZoneEastText7 db "@" diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index df80f4e1..97578475 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -1,11 +1,11 @@ -SafariZoneEntranceScript: ; 751cd (1d:51cd) +SafariZoneEntranceScript: call EnableAutoTextBoxDrawing ld hl, SafariZoneEntranceScriptPointers ld a, [wSafariZoneEntranceCurScript] call JumpTable ret -SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) +SafariZoneEntranceScriptPointers: dw .SafariZoneEntranceScript0 dw .SafariZoneEntranceScript1 dw .SafariZoneEntranceScript2 @@ -26,7 +26,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) xor a ld [hJoyHeld], a ld a, SPRITE_FACING_RIGHT - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, [wCoordIndex] cp $1 jr z, .asm_7520f @@ -43,7 +43,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) ld [wSafariZoneEntranceCurScript], a ret -.CoordsData_75221: ; 75221 (1d:5221) +.CoordsData_75221: db $02, $03 db $02, $04 db $FF @@ -133,7 +133,7 @@ SafariZoneEntranceScript_752b4: and a ret -SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) +SafariZoneEntranceTextPointers: dw .SafariZoneEntranceText1 dw .SafariZoneEntranceText2 dw .SafariZoneEntranceText1 @@ -160,7 +160,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) ld hl, .SafariZoneEntranceText_753bb call PrintText xor a - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, D_DOWN ld c, $3 call SafariZoneEntranceAutoWalk @@ -172,7 +172,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) ld hl, .SafariZoneEntranceText_753c0 call PrintText ld a, SPRITE_FACING_UP - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, D_UP ld c, $1 call SafariZoneEntranceAutoWalk diff --git a/scripts/safarizonenorth.asm b/scripts/safarizonenorth.asm index 6ea5f902..b870c99e 100755 --- a/scripts/safarizonenorth.asm +++ b/scripts/safarizonenorth.asm @@ -1,7 +1,7 @@ -SafariZoneNorthScript: ; 459ab (11:59ab) +SafariZoneNorthScript: jp EnableAutoTextBoxDrawing -SafariZoneNorthTextPointers: ; 459ae (11:59ae) +SafariZoneNorthTextPointers: dw PickUpItemText dw PickUpItemText dw SafariZoneNorthText3 @@ -10,22 +10,22 @@ SafariZoneNorthTextPointers: ; 459ae (11:59ae) dw SafariZoneNorthText6 dw SafariZoneNorthText7 -SafariZoneNorthText3: ; 459bc (11:59bc) +SafariZoneNorthText3: TX_FAR _SafariZoneNorthText3 db "@" -SafariZoneNorthText4: ; 459c1 (11:59c1) +SafariZoneNorthText4: TX_FAR _SafariZoneNorthText4 db "@" -SafariZoneNorthText5: ; 459c6 (11:59c6) +SafariZoneNorthText5: TX_FAR _SafariZoneNorthText5 db "@" -SafariZoneNorthText6: ; 459cb (11:59cb) +SafariZoneNorthText6: TX_FAR _SafariZoneNorthText6 db "@" -SafariZoneNorthText7: ; 459d0 (11:59d0) +SafariZoneNorthText7: TX_FAR _SafariZoneNorthText7 db "@" diff --git a/scripts/safarizoneresthouse1.asm b/scripts/safarizoneresthouse1.asm index 424714e4..1d43890d 100755 --- a/scripts/safarizoneresthouse1.asm +++ b/scripts/safarizoneresthouse1.asm @@ -1,14 +1,14 @@ -SafariZoneRestHouse1Script: ; 45ced (11:5ced) +SafariZoneRestHouse1Script: jp EnableAutoTextBoxDrawing -SafariZoneRestHouse1TextPointers: ; 45cf0 (11:5cf0) +SafariZoneRestHouse1TextPointers: dw SafariZoneRestHouse1Text1 dw SafariZoneRestHouse1Text2 -SafariZoneRestHouse1Text1: ; 45cf4 (11:5cf4) +SafariZoneRestHouse1Text1: TX_FAR _SafariZoneRestHouse1Text1 db "@" -SafariZoneRestHouse1Text2: ; 45cf9 (11:5cf9) +SafariZoneRestHouse1Text2: TX_FAR _SafariZoneRestHouse1Text2 db "@" diff --git a/scripts/safarizoneresthouse2.asm b/scripts/safarizoneresthouse2.asm index 23cd53b2..4cd512f2 100755 --- a/scripts/safarizoneresthouse2.asm +++ b/scripts/safarizoneresthouse2.asm @@ -1,20 +1,20 @@ -SafariZoneRestHouse2Script: ; 45d2a (11:5d2a) +SafariZoneRestHouse2Script: call EnableAutoTextBoxDrawing ret -SafariZoneRestHouse2TextPointers: ; 45d2e (11:5d2e) +SafariZoneRestHouse2TextPointers: dw SafariZoneRestHouse2Text1 dw SafariZoneRestHouse2Text2 dw SafariZoneRestHouse2Text3 -SafariZoneRestHouse2Text1: ; 45d34 (11:5d34) +SafariZoneRestHouse2Text1: TX_FAR _SafariZoneRestHouse2Text1 db "@" -SafariZoneRestHouse2Text2: ; 45d39 (11:5d39) +SafariZoneRestHouse2Text2: TX_FAR _SafariZoneRestHouse2Text2 db "@" -SafariZoneRestHouse2Text3: ; 45d3e (11:5d3e) +SafariZoneRestHouse2Text3: TX_FAR _SafariZoneRestHouse2Text3 db "@" diff --git a/scripts/safarizoneresthouse3.asm b/scripts/safarizoneresthouse3.asm index 2faa1fbb..18c4770f 100755 --- a/scripts/safarizoneresthouse3.asm +++ b/scripts/safarizoneresthouse3.asm @@ -1,20 +1,20 @@ -SafariZoneRestHouse3Script: ; 45d75 (11:5d75) +SafariZoneRestHouse3Script: call EnableAutoTextBoxDrawing ret -SafariZoneRestHouse3TextPointers: ; 45d79 (11:5d79) +SafariZoneRestHouse3TextPointers: dw SafariZoneRestHouse3Text1 dw SafariZoneRestHouse3Text2 dw SafariZoneRestHouse3Text3 -SafariZoneRestHouse3Text1: ; 45d7f (11:5d7f) +SafariZoneRestHouse3Text1: TX_FAR _SafariZoneRestHouse3Text1 db "@" -SafariZoneRestHouse3Text2: ; 45d84 (11:5d84) +SafariZoneRestHouse3Text2: TX_FAR _SafariZoneRestHouse3Text2 db "@" -SafariZoneRestHouse3Text3: ; 45d89 (11:5d89) +SafariZoneRestHouse3Text3: TX_FAR _SafariZoneRestHouse3Text3 db "@" diff --git a/scripts/safarizoneresthouse4.asm b/scripts/safarizoneresthouse4.asm index b645431f..3ff3fa48 100755 --- a/scripts/safarizoneresthouse4.asm +++ b/scripts/safarizoneresthouse4.asm @@ -1,20 +1,20 @@ -SafariZoneRestHouse4Script: ; 45dc0 (11:5dc0) +SafariZoneRestHouse4Script: call EnableAutoTextBoxDrawing ret -SafariZoneRestHouse4TextPointers: ; 45dc4 (11:5dc4) +SafariZoneRestHouse4TextPointers: dw SafariZoneRestHouse4Text1 dw SafariZoneRestHouse4Text2 dw SafariZoneRestHouse4Text3 -SafariZoneRestHouse4Text1: ; 45dca (11:5dca) +SafariZoneRestHouse4Text1: TX_FAR _SafariZoneRestHouse4Text1 db "@" -SafariZoneRestHouse4Text2: ; 45dcf (11:5dcf) +SafariZoneRestHouse4Text2: TX_FAR _SafariZoneRestHouse4Text2 db "@" -SafariZoneRestHouse4Text3: ; 45dd4 (11:5dd4) +SafariZoneRestHouse4Text3: TX_FAR _SafariZoneRestHouse4Text3 db "@" diff --git a/scripts/safarizonesecrethouse.asm b/scripts/safarizonesecrethouse.asm index 8881472b..37013b3b 100755 --- a/scripts/safarizonesecrethouse.asm +++ b/scripts/safarizonesecrethouse.asm @@ -1,10 +1,10 @@ -SafariZoneSecretHouseScript: ; 4a317 (12:6317) +SafariZoneSecretHouseScript: jp EnableAutoTextBoxDrawing -SafariZoneSecretHouseTextPointers: ; 4a31a (12:631a) +SafariZoneSecretHouseTextPointers: dw SafariZoneSecretHouseText1 -SafariZoneSecretHouseText1: ; 4a31c (12:631c) +SafariZoneSecretHouseText1: TX_ASM CheckEvent EVENT_GOT_HM03 jr nz, .asm_20a9b @@ -27,18 +27,18 @@ SafariZoneSecretHouseText1: ; 4a31c (12:631c) .asm_8f1fc jp TextScriptEnd -SafariZoneSecretHouseText_4a350: ; 4a350 (12:6350) +SafariZoneSecretHouseText_4a350: TX_FAR _SecretHouseText_4a350 db "@" -ReceivedHM03Text: ; 4a355 (12:6355) +ReceivedHM03Text: TX_FAR _ReceivedHM03Text db $0B, "@" -HM03ExplanationText: ; 4a35b (12:635b) +HM03ExplanationText: TX_FAR _HM03ExplanationText db "@" -HM03NoRoomText: ; 4a360 (12:6360) +HM03NoRoomText: TX_FAR _HM03NoRoomText db "@" diff --git a/scripts/safarizonewest.asm b/scripts/safarizonewest.asm index db2c6427..81190c4c 100755 --- a/scripts/safarizonewest.asm +++ b/scripts/safarizonewest.asm @@ -1,7 +1,7 @@ -SafariZoneWestScript: ; 4a1b5 (12:61b5) +SafariZoneWestScript: jp EnableAutoTextBoxDrawing -SafariZoneWestTextPointers: ; 4a1b8 (12:61b8) +SafariZoneWestTextPointers: dw PickUpItemText dw PickUpItemText dw PickUpItemText @@ -11,18 +11,18 @@ SafariZoneWestTextPointers: ; 4a1b8 (12:61b8) dw SafariZoneWestText7 dw SafariZoneWestText8 -SafariZoneWestText5: ; 4a1c8 (12:61c8) +SafariZoneWestText5: TX_FAR _SafariZoneWestText5 db "@" -SafariZoneWestText6: ; 4a1cd (12:61cd) +SafariZoneWestText6: TX_FAR _SafariZoneWestText6 db "@" -SafariZoneWestText7: ; 4a1d2 (12:61d2) +SafariZoneWestText7: TX_FAR _SafariZoneWestText7 db "@" -SafariZoneWestText8: ; 4a1d7 (12:61d7) +SafariZoneWestText8: TX_FAR _SafariZoneWestText8 db "@" diff --git a/scripts/saffroncity.asm b/scripts/saffroncity.asm index 93bb2c88..4653f150 100755 --- a/scripts/saffroncity.asm +++ b/scripts/saffroncity.asm @@ -1,7 +1,7 @@ -SaffronCityScript: ; 50c00 (14:4c00) +SaffronCityScript: jp EnableAutoTextBoxDrawing -SaffronCityTextPointers: ; 50c03 (14:4c03) +SaffronCityTextPointers: dw SaffronCityText1 dw SaffronCityText2 dw SaffronCityText3 @@ -28,94 +28,94 @@ SaffronCityTextPointers: ; 50c03 (14:4c03) dw SaffronCityText24 dw SaffronCityText25 -SaffronCityText1: ; 50c35 (14:4c35) +SaffronCityText1: TX_FAR _SaffronCityText1 db "@" -SaffronCityText2: ; 50c3a (14:4c3a) +SaffronCityText2: TX_FAR _SaffronCityText2 db "@" -SaffronCityText3: ; 50c3f (14:4c3f) +SaffronCityText3: TX_FAR _SaffronCityText3 db "@" -SaffronCityText4: ; 50c44 (14:4c44) +SaffronCityText4: TX_FAR _SaffronCityText4 db "@" -SaffronCityText5: ; 50c49 (14:4c49) +SaffronCityText5: TX_FAR _SaffronCityText5 db "@" -SaffronCityText6: ; 50c4e (14:4c4e) +SaffronCityText6: TX_FAR _SaffronCityText6 db "@" -SaffronCityText7: ; 50c53 (14:4c53) +SaffronCityText7: TX_FAR _SaffronCityText7 db "@" -SaffronCityText8: ; 50c58 (14:4c58) +SaffronCityText8: TX_FAR _SaffronCityText8 db "@" -SaffronCityText9: ; 50c5d (14:4c5d) +SaffronCityText9: TX_FAR _SaffronCityText9 db "@" -SaffronCityText10: ; 50c62 (14:4c62) +SaffronCityText10: TX_FAR _SaffronCityText10 db "@" -SaffronCityText11: ; 50c67 (14:4c67) +SaffronCityText11: TX_FAR _SaffronCityText11 db "@" -SaffronCityText12: ; 50c6c (14:4c6c) +SaffronCityText12: TX_FAR _SaffronCityText12 db $15, "@" ; play PIDGEOT cry from TextCommandSounds -SaffronCityText13: ; 50c72 (14:4c72) +SaffronCityText13: TX_FAR _SaffronCityText13 db "@" -SaffronCityText14: ; 50c77 (14:4c77) +SaffronCityText14: TX_FAR _SaffronCityText14 db "@" -SaffronCityText15: ; 50c7c (14:4c7c) +SaffronCityText15: TX_FAR _SaffronCityText15 db "@" -SaffronCityText16: ; 50c81 (14:4c81) +SaffronCityText16: TX_FAR _SaffronCityText16 db "@" -SaffronCityText17: ; 50c86 (14:4c86) +SaffronCityText17: TX_FAR _SaffronCityText17 db "@" -SaffronCityText18: ; 50c8b (14:4c8b) +SaffronCityText18: TX_FAR _SaffronCityText18 db "@" -SaffronCityText20: ; 50c90 (14:4c90) +SaffronCityText20: TX_FAR _SaffronCityText20 db "@" -SaffronCityText21: ; 50c95 (14:4c95) +SaffronCityText21: TX_FAR _SaffronCityText21 db "@" -SaffronCityText22: ; 50c9a (14:4c9a) +SaffronCityText22: TX_FAR _SaffronCityText22 db "@" -SaffronCityText24: ; 50c9f (14:4c9f) +SaffronCityText24: TX_FAR _SaffronCityText24 db "@" -SaffronCityText25: ; 50ca4 (14:4ca4) +SaffronCityText25: TX_FAR _SaffronCityText25 db "@" diff --git a/scripts/saffrongym.asm b/scripts/saffrongym.asm index aae06103..146d31f9 100755 --- a/scripts/saffrongym.asm +++ b/scripts/saffrongym.asm @@ -1,4 +1,4 @@ -SaffronGymScript: ; 5d00d (17:500d) +SaffronGymScript: ld hl, wCurrentMapScriptFlags bit 6, [hl] res 6, [hl] @@ -16,33 +16,33 @@ SaffronGymScript: ; 5d00d (17:500d) ld de, Gym6LeaderName jp LoadGymLeaderAndCityName -Gym6CityName: ; 5d033 (17:5033) +Gym6CityName: db "SAFFRON CITY@" -Gym6LeaderName: ; 5d040 (17:5040) +Gym6LeaderName: db "SABRINA@" -SaffronGymText_5d048: ; 5d048 (17:5048) +SaffronGymText_5d048: xor a ld [wJoyIgnore], a ld [wSaffronGymCurScript], a ld [wCurMapScript], a ret -SaffronGymScriptPointers: ; 5d053 (17:5053) +SaffronGymScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw SaffronGymScript3 -SaffronGymScript3: ; 5d05b (17:505b) +SaffronGymScript3: ld a, [wIsInBattle] cp $ff jp z, SaffronGymText_5d048 ld a, $f0 ld [wJoyIgnore], a -SaffronGymText_5d068: ; 5d068 (17:5068) +SaffronGymText_5d068: ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -70,7 +70,7 @@ SaffronGymText_5d068: ; 5d068 (17:5068) jp SaffronGymText_5d048 -SaffronGymTextPointers: ; 5d0ab (17:50ab) +SaffronGymTextPointers: dw SaffronGymText1 dw SaffronGymText2 dw SaffronGymText3 @@ -84,8 +84,8 @@ SaffronGymTextPointers: ; 5d0ab (17:50ab) dw SaffronGymText11 dw SaffronGymText12 -SaffronGymTrainerHeaders: ; 5d0c3 (17:50c3) -SaffronGymTrainerHeader0: ; 5d0c3 (17:50c3) +SaffronGymTrainerHeaders: +SaffronGymTrainerHeader0: dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_0 @@ -94,7 +94,7 @@ SaffronGymTrainerHeader0: ; 5d0c3 (17:50c3) dw SaffronGymEndBattleText1 ; TextEndBattle dw SaffronGymEndBattleText1 ; TextEndBattle -SaffronGymTrainerHeader1: ; 5d0cf (17:50cf) +SaffronGymTrainerHeader1: dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_1 @@ -103,7 +103,7 @@ SaffronGymTrainerHeader1: ; 5d0cf (17:50cf) dw SaffronGymEndBattleText2 ; TextEndBattle dw SaffronGymEndBattleText2 ; TextEndBattle -SaffronGymTrainerHeader2: ; 5d0db (17:50db) +SaffronGymTrainerHeader2: dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_2 @@ -112,7 +112,7 @@ SaffronGymTrainerHeader2: ; 5d0db (17:50db) dw SaffronGymEndBattleText3 ; TextEndBattle dw SaffronGymEndBattleText3 ; TextEndBattle -SaffronGymTrainerHeader3: ; 5d0e7 (17:50e7) +SaffronGymTrainerHeader3: dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_3 @@ -121,7 +121,7 @@ SaffronGymTrainerHeader3: ; 5d0e7 (17:50e7) dw SaffronGymEndBattleText4 ; TextEndBattle dw SaffronGymEndBattleText4 ; TextEndBattle -SaffronGymTrainerHeader4: ; 5d0f3 (17:50f3) +SaffronGymTrainerHeader4: dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_4 @@ -130,7 +130,7 @@ SaffronGymTrainerHeader4: ; 5d0f3 (17:50f3) dw SaffronGymEndBattleText5 ; TextEndBattle dw SaffronGymEndBattleText5 ; TextEndBattle -SaffronGymTrainerHeader5: ; 5d0ff (17:50ff) +SaffronGymTrainerHeader5: dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_5 @@ -139,7 +139,7 @@ SaffronGymTrainerHeader5: ; 5d0ff (17:50ff) dw SaffronGymEndBattleText6 ; TextEndBattle dw SaffronGymEndBattleText6 ; TextEndBattle -SaffronGymTrainerHeader6: ; 5d10b (17:510b) +SaffronGymTrainerHeader6: dbEventFlagBit EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SAFFRON_GYM_TRAINER_6, 1 @@ -150,7 +150,7 @@ SaffronGymTrainerHeader6: ; 5d10b (17:510b) db $ff -SaffronGymText1: ; 5d118 (17:5118) +SaffronGymText1: TX_ASM CheckEvent EVENT_BEAT_SABRINA jr z, .asm_5d134 @@ -183,77 +183,77 @@ SaffronGymText1: ; 5d118 (17:5118) .asm_5d15f jp TextScriptEnd -SaffronGymText_5d162: ; 5d162 (17:5162) +SaffronGymText_5d162: TX_FAR _SaffronGymText_5d162 db "@" -SaffronGymText_5d167: ; 5d167 (17:5167) +SaffronGymText_5d167: TX_FAR _SaffronGymText_5d167 db $11 ; play same sound as red giving oak parcel db $6 ; wait for keypress db "@" -SaffronGymText_5d16e: ; 5d16e (17:516e) +SaffronGymText_5d16e: TX_FAR _SaffronGymText_5d16e db "@" -SaffronGymText10: ; 5d173 (17:5173) +SaffronGymText10: TX_FAR _SaffronGymText_5d173 db "@" -SaffronGymText11: ; 5d178 (17:5178) +SaffronGymText11: TX_FAR ReceivedTM46Text db $b TX_FAR _TM46ExplanationText db "@" -SaffronGymText12: ; 5d182 (17:5182) +SaffronGymText12: TX_FAR _TM46NoRoomText db "@" -SaffronGymText2: ; 5d187 (17:5187) +SaffronGymText2: TX_ASM ld hl, SaffronGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd -SaffronGymText3: ; 5d191 (17:5191) +SaffronGymText3: TX_ASM ld hl, SaffronGymTrainerHeader1 call TalkToTrainer jp TextScriptEnd -SaffronGymText4: ; 5d19b (17:519b) +SaffronGymText4: TX_ASM ld hl, SaffronGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd -SaffronGymText5: ; 5d1a5 (17:51a5) +SaffronGymText5: TX_ASM ld hl, SaffronGymTrainerHeader3 call TalkToTrainer jp TextScriptEnd -SaffronGymText6: ; 5d1af (17:51af) +SaffronGymText6: TX_ASM ld hl, SaffronGymTrainerHeader4 call TalkToTrainer jp TextScriptEnd -SaffronGymText7: ; 5d1b9 (17:51b9) +SaffronGymText7: TX_ASM ld hl, SaffronGymTrainerHeader5 call TalkToTrainer jp TextScriptEnd -SaffronGymText8: ; 5d1c3 (17:51c3) +SaffronGymText8: TX_ASM ld hl, SaffronGymTrainerHeader6 call TalkToTrainer jp TextScriptEnd -SaffronGymText9: ; 5d1cd (17:51cd) +SaffronGymText9: TX_ASM CheckEvent EVENT_BEAT_SABRINA jr nz, .asm_5d1dd @@ -266,94 +266,94 @@ SaffronGymText9: ; 5d1cd (17:51cd) .asm_5d1e3 jp TextScriptEnd -SaffronGymText_5d1e6: ; 5d1e6 (17:51e6) +SaffronGymText_5d1e6: TX_FAR _SaffronGymText_5d1e6 db "@" -SaffronGymText_5d1eb: ; 5d1eb (17:51eb) +SaffronGymText_5d1eb: TX_FAR _SaffronGymText_5d1eb db "@" -SaffronGymBattleText1: ; 5d1f0 (17:51f0) +SaffronGymBattleText1: TX_FAR _SaffronGymBattleText1 db "@" -SaffronGymEndBattleText1: ; 5d1f5 (17:51f5) +SaffronGymEndBattleText1: TX_FAR _SaffronGymEndBattleText1 db "@" -SaffronGymAfterBattleText1: ; 5d1fa (17:51fa) +SaffronGymAfterBattleText1: TX_FAR _SaffronGymAfterBattleText1 db "@" -SaffronGymBattleText2: ; 5d1ff (17:51ff) +SaffronGymBattleText2: TX_FAR _SaffronGymBattleText2 db "@" -SaffronGymEndBattleText2: ; 5d204 (17:5204) +SaffronGymEndBattleText2: TX_FAR _SaffronGymEndBattleText2 db "@" -SaffronGymAfterBattleText2: ; 5d209 (17:5209) +SaffronGymAfterBattleText2: TX_FAR _SaffronGymAfterBattleText2 db "@" -SaffronGymBattleText3: ; 5d20e (17:520e) +SaffronGymBattleText3: TX_FAR _SaffronGymBattleText3 db "@" -SaffronGymEndBattleText3: ; 5d213 (17:5213) +SaffronGymEndBattleText3: TX_FAR _SaffronGymEndBattleText3 db "@" -SaffronGymAfterBattleText3: ; 5d218 (17:5218) +SaffronGymAfterBattleText3: TX_FAR _SaffronGymAfterBattleText3 db "@" -SaffronGymBattleText4: ; 5d21d (17:521d) +SaffronGymBattleText4: TX_FAR _SaffronGymBattleText4 db "@" -SaffronGymEndBattleText4: ; 5d222 (17:5222) +SaffronGymEndBattleText4: TX_FAR _SaffronGymEndBattleText4 db "@" -SaffronGymAfterBattleText4: ; 5d227 (17:5227) +SaffronGymAfterBattleText4: TX_FAR _SaffronGymAfterBattleText4 db "@" -SaffronGymBattleText5: ; 5d22c (17:522c) +SaffronGymBattleText5: TX_FAR _SaffronGymBattleText5 db "@" -SaffronGymEndBattleText5: ; 5d231 (17:5231) +SaffronGymEndBattleText5: TX_FAR _SaffronGymEndBattleText5 db "@" -SaffronGymAfterBattleText5: ; 5d236 (17:5236) +SaffronGymAfterBattleText5: TX_FAR _SaffronGymAfterBattleText5 db "@" -SaffronGymBattleText6: ; 5d23b (17:523b) +SaffronGymBattleText6: TX_FAR _SaffronGymBattleText6 db "@" -SaffronGymEndBattleText6: ; 5d240 (17:5240) +SaffronGymEndBattleText6: TX_FAR _SaffronGymEndBattleText6 db "@" -SaffronGymAfterBattleText6: ; 5d245 (17:5245) +SaffronGymAfterBattleText6: TX_FAR _SaffronGymAfterBattleText6 db "@" -SaffronGymBattleText7: ; 5d24a (17:524a) +SaffronGymBattleText7: TX_FAR _SaffronGymBattleText7 db "@" -SaffronGymEndBattleText7: ; 5d24f (17:524f) +SaffronGymEndBattleText7: TX_FAR _SaffronGymEndBattleText7 db "@" -SaffronGymAfterBattleText7: ; 5d254 (17:5254) +SaffronGymAfterBattleText7: TX_FAR _SaffronGymAfterBattleText7 db "@" diff --git a/scripts/saffronhouse1.asm b/scripts/saffronhouse1.asm index 3aced3c5..5f417978 100755 --- a/scripts/saffronhouse1.asm +++ b/scripts/saffronhouse1.asm @@ -1,27 +1,27 @@ -SaffronHouse1Script: ; 1dddd (7:5ddd) +SaffronHouse1Script: jp EnableAutoTextBoxDrawing -SaffronHouse1TextPointers: ; 1dde0 (7:5de0) +SaffronHouse1TextPointers: dw SaffronHouse1Text1 dw SaffronHouse1Text2 dw SaffronHouse1Text3 dw SaffronHouse1Text4 -SaffronHouse1Text1: ; 1dde8 (7:5de8) +SaffronHouse1Text1: TX_FAR _SaffronHouse1Text1 db "@" -SaffronHouse1Text2: ; 1dded (7:5ded) +SaffronHouse1Text2: TX_FAR _SaffronHouse1Text2 TX_ASM ld a, PIDGEY call PlayCry jp TextScriptEnd -SaffronHouse1Text3: ; 1ddfa (7:5dfa) +SaffronHouse1Text3: TX_FAR _SaffronHouse1Text3 db "@" -SaffronHouse1Text4: ; 1ddff (7:5dff) +SaffronHouse1Text4: TX_FAR _SaffronHouse1Text4 db "@" diff --git a/scripts/saffronhouse2.asm b/scripts/saffronhouse2.asm index 2c159190..b4f6e31c 100755 --- a/scripts/saffronhouse2.asm +++ b/scripts/saffronhouse2.asm @@ -1,10 +1,10 @@ -SaffronHouse2Script: ; 1de3c (7:5e3c) +SaffronHouse2Script: jp EnableAutoTextBoxDrawing -SaffronHouse2TextPointers: ; 1de3f (7:5e3f) +SaffronHouse2TextPointers: dw SaffronHouse2Text1 -SaffronHouse2Text1: ; 1de41 (7:5e41) +SaffronHouse2Text1: TX_ASM CheckEvent EVENT_GOT_TM29 jr nz, .asm_9e72b @@ -27,18 +27,18 @@ SaffronHouse2Text1: ; 1de41 (7:5e41) .asm_fe4e1 jp TextScriptEnd -TM29PreReceiveText: ; 1de75 (7:5e75) +TM29PreReceiveText: TX_FAR _TM29PreReceiveText db "@" -ReceivedTM29Text: ; 1de7a (7:5e7a) +ReceivedTM29Text: TX_FAR _ReceivedTM29Text db $0B, "@" -TM29ExplanationText: ; 1de80 (7:5e80) +TM29ExplanationText: TX_FAR _TM29ExplanationText db "@" -TM29NoRoomText: ; 1de85 (7:5e85) +TM29NoRoomText: TX_FAR _TM29NoRoomText db "@" diff --git a/scripts/saffronmart.asm b/scripts/saffronmart.asm index 9ee1db0e..0bc03362 100755 --- a/scripts/saffronmart.asm +++ b/scripts/saffronmart.asm @@ -1,15 +1,15 @@ -SaffronMartScript: ; 5d409 (17:5409) +SaffronMartScript: jp EnableAutoTextBoxDrawing -SaffronMartTextPointers: ; 5d40c (17:540c) +SaffronMartTextPointers: dw SaffronMartText1 dw SaffronMartText2 dw SaffronMartText3 -SaffronMartText2: ; 5d412 (17:5412) +SaffronMartText2: TX_FAR _SaffronMartText2 db "@" -SaffronMartText3: ; 5d417 (17:5417) +SaffronMartText3: TX_FAR _SaffronMartText3 db "@" diff --git a/scripts/saffronpokecenter.asm b/scripts/saffronpokecenter.asm index 05420812..7fde0502 100755 --- a/scripts/saffronpokecenter.asm +++ b/scripts/saffronpokecenter.asm @@ -1,26 +1,26 @@ -SaffronPokecenterScript: ; 5d535 (17:5535) +SaffronPokecenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -SaffronPokecenterTextPointers: ; 5d53b (17:553b) +SaffronPokecenterTextPointers: dw SaffronPokecenterText1 dw SaffronPokecenterText2 dw SaffronPokecenterText3 dw SaffronPokecenterText4 dw SaffronPokecenterText5 -SaffronPokecenterText1: ; 5d543 (17:5543) +SaffronPokecenterText1: TX_POKECENTER_NURSE -SaffronPokecenterText2: ; 5d544 (17:5544) +SaffronPokecenterText2: TX_FAR _SaffronPokecenterText1 db "@" -SaffronPokecenterText3: ; 5d549 (17:5549) +SaffronPokecenterText3: TX_FAR _SaffronPokecenterText3 db "@" -SaffronPokecenterText4: ; 5d54e (17:554e) +SaffronPokecenterText4: TX_CABLE_CLUB_RECEPTIONIST SaffronPokecenterText5: diff --git a/scripts/school.asm b/scripts/school.asm index 6ee0d36e..a64189e3 100755 --- a/scripts/school.asm +++ b/scripts/school.asm @@ -1,22 +1,22 @@ -SchoolScript: ; 1d54c (7:554c) +SchoolScript: call EnableAutoTextBoxDrawing ret -SchoolTextPointers: ; 1d54f (7:554f) +SchoolTextPointers: dw SchoolText1 dw SchoolText2 dw SchoolText3 -SchoolText1: ; 1d553 (7:5553) +SchoolText1: TX_FAR _SchoolText1 db "@" -SchoolText2: ; 1d558 (7:5558) +SchoolText2: TX_ASM callba Func_f1c0f jp TextScriptEnd -SchoolText3: ; 1d558 (7:5558) +SchoolText3: TX_ASM callba Func_f1c03 jp TextScriptEnd diff --git a/scripts/silphco1.asm b/scripts/silphco1.asm index cfd51dc1..c0cb169b 100755 --- a/scripts/silphco1.asm +++ b/scripts/silphco1.asm @@ -1,4 +1,4 @@ -SilphCo1Script: ; 5d44e (17:544e) +SilphCo1Script: call EnableAutoTextBoxDrawing CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ret z @@ -8,9 +8,9 @@ SilphCo1Script: ; 5d44e (17:544e) ld [wMissableObjectIndex], a predef_jump ShowObject -SilphCo1TextPointers: ; 5d469 (17:5469) +SilphCo1TextPointers: dw SilphCo1Text1 -SilphCo1Text1: ; 5d46b (17:546b) +SilphCo1Text1: TX_FAR _SilphCo1Text1 db "@" diff --git a/scripts/silphco10.asm b/scripts/silphco10.asm index e254765d..6b35a05a 100755 --- a/scripts/silphco10.asm +++ b/scripts/silphco10.asm @@ -1,4 +1,4 @@ -SilphCo10Script: ; 5a139 (16:6139) +SilphCo10Script: call SilphCo10Script_5a14f call EnableAutoTextBoxDrawing ld hl, SilphCo10TrainerHeaders @@ -8,7 +8,7 @@ SilphCo10Script: ; 5a139 (16:6139) ld [wSilphCo10CurScript], a ret -SilphCo10Script_5a14f: ; 5a14f (16:614f) +SilphCo10Script_5a14f: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -23,23 +23,23 @@ SilphCo10Script_5a14f: ; 5a14f (16:614f) lb bc, 4, 5 predef_jump ReplaceTileBlock -SilphCo10GateCoords: ; 5a173 (16:6173) +SilphCo10GateCoords: db $04,$05 db $FF -SilphCo10Text_5a176: ; 5a176 (16:6176) +SilphCo10Text_5a176: ld a, [$ffe0] and a ret z SetEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR ret -SilphCo10ScriptPointers: ; 5a180 (16:6180) +SilphCo10ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SilphCo10TextPointers: ; 5a186 (16:6186) +SilphCo10TextPointers: dw SilphCo10Text1 dw SilphCo10Text2 dw SilphCo10Text3 @@ -47,8 +47,8 @@ SilphCo10TextPointers: ; 5a186 (16:6186) dw PickUpItemText dw PickUpItemText -SilphCo10TrainerHeaders: ; 5a192 (16:6192) -SilphCo10TrainerHeader0: ; 5a192 (16:6192) +SilphCo10TrainerHeaders: +SilphCo10TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_0 @@ -57,7 +57,7 @@ SilphCo10TrainerHeader0: ; 5a192 (16:6192) dw SilphCo10EndBattleText1 ; TextEndBattle dw SilphCo10EndBattleText1 ; TextEndBattle -SilphCo10TrainerHeader1: ; 5a19e (16:619e) +SilphCo10TrainerHeader1: dbEventFlagBit EVENT_BEAT_SILPH_CO_10F_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_10F_TRAINER_1 @@ -68,19 +68,19 @@ SilphCo10TrainerHeader1: ; 5a19e (16:619e) db $ff -SilphCo10Text1: ; 5a1ab (16:61ab) +SilphCo10Text1: TX_ASM ld hl, SilphCo10TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo10Text2: ; 5a1b5 (16:61b5) +SilphCo10Text2: TX_ASM ld hl, SilphCo10TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SilphCo10Text3: ; 5a1bf (16:61bf) +SilphCo10Text3: TX_ASM CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo10Text_5a1d8 @@ -90,34 +90,34 @@ SilphCo10Text3: ; 5a1bf (16:61bf) call PrintText jp TextScriptEnd -SilphCo10Text_5a1d3: ; 5a1d3 (16:61d3) +SilphCo10Text_5a1d3: TX_FAR _SilphCo10Text_5a1d3 db "@" -SilphCo10Text_5a1d8: ; 5a1d8 (16:61d8) +SilphCo10Text_5a1d8: TX_FAR _SilphCo10Text_5a1d8 db "@" -SilphCo10BattleText1: ; 5a1dd (16:61dd) +SilphCo10BattleText1: TX_FAR _SilphCo10BattleText1 db "@" -SilphCo10EndBattleText1: ; 5a1e2 (16:61e2) +SilphCo10EndBattleText1: TX_FAR _SilphCo10EndBattleText1 db "@" -SilphCo10AfterBattleText1: ; 5a1e7 (16:61e7) +SilphCo10AfterBattleText1: TX_FAR _SilphCo10AfterBattleText1 db "@" -SilphCo10BattleText2: ; 5a1ec (16:61ec) +SilphCo10BattleText2: TX_FAR _SilphCo10BattleText2 db "@" -SilphCo10EndBattleText2: ; 5a1f1 (16:61f1) +SilphCo10EndBattleText2: TX_FAR _SilphCo10EndBattleText2 db "@" -SilphCo10AfterBattleText2: ; 5a1f6 (16:61f6) +SilphCo10AfterBattleText2: TX_FAR _SilphCo10AfterBattleText2 db "@" diff --git a/scripts/silphco11.asm b/scripts/silphco11.asm index fb341105..cd5a818d 100755 --- a/scripts/silphco11.asm +++ b/scripts/silphco11.asm @@ -1,4 +1,4 @@ -SilphCo11Script: ; 62111 (18:60fa) +SilphCo11Script: call SilphCo11Script_62127 call EnableAutoTextBoxDrawing ld hl, SilphCo11TrainerHeaders @@ -8,7 +8,7 @@ SilphCo11Script: ; 62111 (18:60fa) ld [wSilphCo11CurScript], a ret -SilphCo11Script_62127: ; 62127 (18:6110) +SilphCo11Script_62127: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -24,11 +24,11 @@ SilphCo11Script_62127: ; 62127 (18:6110) predef ReplaceTileBlock ret -SilphCo11GateCoords: ; 62134 (18:6134) +SilphCo11GateCoords: db $06,$03 db $FF -SilphCo11Script_6214f: ; 6214f (18:6137) +SilphCo11Script_6214f: push hl ld hl, wCardKeyDoorY ld a, [hli] @@ -64,39 +64,39 @@ SilphCo11Script_6214f: ; 6214f (18:6137) ld [$ffe0], a ret -SilphCo11Script_6217b: ; 6217b (18:6163) +SilphCo11Script_6217b: ld a, [$ffe0] and a ret z SetEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR ret -SilphCo11Script_62185: ; 62185 (18:61c4) +SilphCo11Script_62185: xor a ld [wJoyIgnore], a -SilphCo11Script_62189: ; 62189 (18:61c8) +SilphCo11Script_62189: ld [wSilphCo11CurScript], a ld [wCurMapScript], a ret -SilphCo11ScriptPointers: ; 62190 (18:6190) - dw SilphCo11Script0 ; 61ae +SilphCo11ScriptPointers: + dw SilphCo11Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle - dw SilphCo11Script3 ; 620c - dw SilphCo11Script4 ; 6254 - dw SilphCo11Script5 ; 6318 - dw SilphCo11Script6 ; 633f - dw SilphCo11Script7 ; 634a - dw SilphCo11Script8 ; 6366 - dw SilphCo11Script9 ; 638d - dw SilphCo11Script10 ; 639d - dw SilphCo11Script11 ; 63bb - dw SilphCo11Script12 ; 63e1 - dw SilphCo11Script13 ; 6427 - dw SilphCo11Script14 ; 6448 - -SilphCo11Script0: ; 621db (18:61db) + dw SilphCo11Script3 + dw SilphCo11Script4 + dw SilphCo11Script5 + dw SilphCo11Script6 + dw SilphCo11Script7 + dw SilphCo11Script8 + dw SilphCo11Script9 + dw SilphCo11Script10 + dw SilphCo11Script11 + dw SilphCo11Script12 + dw SilphCo11Script13 + dw SilphCo11Script14 + +SilphCo11Script0: CheckEvent EVENT_BEAT_SILPH_CO_11F_TRAINER_0 call z, SilphCo11Script_6229c CheckEvent EVENT_782 @@ -127,12 +127,12 @@ SilphCo11Script_621c5: call SilphCo11Script_62189 ret -CoordsData_62211: ; 62211 (18:6211) +CoordsData_62211: db $0D,$06 db $0C,$07 db $FF -MovementData_62216: ; 62216 (18:6216) +MovementData_62216: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN @@ -146,7 +146,7 @@ SilphCo11Script_621ff: ld [wSpriteStateData1 + 3 * $10 + 1], a ret -SilphCo11Script3: ; 62227 (18:6227) +SilphCo11Script3: ld a, [wIsInBattle] cp $ff jp z, SilphCo11Script_62185 @@ -176,7 +176,7 @@ SilphCo11Script3: ; 62227 (18:6227) ld [wJoyIgnore], a jp SilphCo11Script_62189 -SilphCo11Script4: ; 62254 (18:626a) +SilphCo11Script4: ld a, [wd730] bit 0, a ret nz @@ -464,7 +464,7 @@ SilphCo11Script_6246d: predef HideObject ret -SilphCo11TextPointers: ; 62476 (18:62b7) +SilphCo11TextPointers: dw SilphCo11Text1 dw SilphCo11Text2 dw SilphCo11Text3 @@ -476,8 +476,8 @@ SilphCo11TextPointers: ; 62476 (18:62b7) dw SilphCo11Text9 dw SilphCo11Text10 -SilphCo11TrainerHeaders: ; 6248a -SilphCo11TrainerHeader0: ; 6248a +SilphCo11TrainerHeaders: +SilphCo11TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_11F_TRAINER_1 db ($3 << 4) dwEventFlagAddress EVENT_BEAT_SILPH_CO_11F_TRAINER_1 diff --git a/scripts/silphco2.asm b/scripts/silphco2.asm index 42a5f3c0..3a5d3650 100755 --- a/scripts/silphco2.asm +++ b/scripts/silphco2.asm @@ -1,4 +1,4 @@ -SilphCo2Script: ; 59cf1 (16:5cf1) +SilphCo2Script: call SilphCo2Script_59d07 call EnableAutoTextBoxDrawing ld hl, SilphCo2TrainerHeaders @@ -8,7 +8,7 @@ SilphCo2Script: ; 59cf1 (16:5cf1) ld [wSilphCo2CurScript], a ret -SilphCo2Script_59d07: ; 59d07 (16:5d07) +SilphCo2Script_59d07: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -32,12 +32,12 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07) lb bc, 5, 2 predef_jump ReplaceTileBlock -SilphCo2GateCoords: ; 59d3e (16:5d3e) +SilphCo2GateCoords: db $02,$02 db $05,$02 db $FF -SilphCo2Script_59d43: ; 59d43 (16:5d43) +SilphCo2Script_59d43: push hl ld hl, wCardKeyDoorY ld a, [hli] @@ -73,7 +73,7 @@ SilphCo2Script_59d43: ; 59d43 (16:5d43) ld [$ffe0], a ret -SilphCo2Script_59d6f: ; 59d6f (16:5d6f) +SilphCo2Script_59d6f: EventFlagAddress hl, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ld a, [$ffe0] and a @@ -86,20 +86,20 @@ SilphCo2Script_59d6f: ; 59d6f (16:5d6f) SetEventAfterBranchReuseHL EVENT_SILPH_CO_2_UNLOCKED_DOOR2, EVENT_SILPH_CO_2_UNLOCKED_DOOR1 ret -SilphCo2ScriptPointers: ; 59d80 (16:5d80) +SilphCo2ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SilphCo2TextPointers: ; 59d86 (16:5d86) +SilphCo2TextPointers: dw SilphCo2Text1 dw SilphCo2Text2 dw SilphCo2Text3 dw SilphCo2Text4 dw SilphCo2Text5 -SilphCo2TrainerHeaders: ; 59d90 (16:5d90) -SilphCo2TrainerHeader0: ; 59d90 (16:5d90) +SilphCo2TrainerHeaders: +SilphCo2TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_0 @@ -108,7 +108,7 @@ SilphCo2TrainerHeader0: ; 59d90 (16:5d90) dw SilphCo2EndBattleText1 ; TextEndBattle dw SilphCo2EndBattleText1 ; TextEndBattle -SilphCo2TrainerHeader1: ; 59d9c (16:5d9c) +SilphCo2TrainerHeader1: dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_1 @@ -117,7 +117,7 @@ SilphCo2TrainerHeader1: ; 59d9c (16:5d9c) dw SilphCo2EndBattleText2 ; TextEndBattle dw SilphCo2EndBattleText2 ; TextEndBattle -SilphCo2TrainerHeader2: ; 59da8 (16:5da8) +SilphCo2TrainerHeader2: dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_2 @@ -126,7 +126,7 @@ SilphCo2TrainerHeader2: ; 59da8 (16:5da8) dw SilphCo2EndBattleText3 ; TextEndBattle dw SilphCo2EndBattleText3 ; TextEndBattle -SilphCo2TrainerHeader3: ; 59db4 (16:5db4) +SilphCo2TrainerHeader3: dbEventFlagBit EVENT_BEAT_SILPH_CO_2F_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_2F_TRAINER_3 @@ -137,7 +137,7 @@ SilphCo2TrainerHeader3: ; 59db4 (16:5db4) db $ff -SilphCo2Text1: ; 59dc1 (16:5dc1) +SilphCo2Text1: TX_ASM CheckEvent EVENT_GOT_TM36 jr nz, .asm_59de4 @@ -156,90 +156,90 @@ SilphCo2Text1: ; 59dc1 (16:5dc1) call PrintText jp TextScriptEnd -SilphCo2Text_59ded: ; 59ded (16:5ded) +SilphCo2Text_59ded: TX_FAR _SilphCo2Text_59ded db "@" -ReceivedTM36Text: ; 59df2 (16:5df2) +ReceivedTM36Text: TX_FAR _ReceivedTM36Text db $0B, "@" -TM36ExplanationText: ; 59df8 (16:5df8) +TM36ExplanationText: TX_FAR _TM36ExplanationText db "@" -TM36NoRoomText: ; 59dfd (16:5dfd) +TM36NoRoomText: TX_FAR _TM36NoRoomText db "@" -SilphCo2Text2: ; 59e02 (16:5e02) +SilphCo2Text2: TX_ASM ld hl, SilphCo2TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo2Text3: ; 59e0c (16:5e0c) +SilphCo2Text3: TX_ASM ld hl, SilphCo2TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SilphCo2Text4: ; 59e16 (16:5e16) +SilphCo2Text4: TX_ASM ld hl, SilphCo2TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SilphCo2Text5: ; 59e20 (16:5e20) +SilphCo2Text5: TX_ASM ld hl, SilphCo2TrainerHeader3 call TalkToTrainer jp TextScriptEnd -SilphCo2BattleText1: ; 59e2a (16:5e2a) +SilphCo2BattleText1: TX_FAR _SilphCo2BattleText1 db "@" -SilphCo2EndBattleText1: ; 59e2f (16:5e2f) +SilphCo2EndBattleText1: TX_FAR _SilphCo2EndBattleText1 db "@" -SilphCo2AfterBattleText1: ; 59e34 (16:5e34) +SilphCo2AfterBattleText1: TX_FAR _SilphCo2AfterBattleText1 db "@" -SilphCo2BattleText2: ; 59e39 (16:5e39) +SilphCo2BattleText2: TX_FAR _SilphCo2BattleText2 db "@" -SilphCo2EndBattleText2: ; 59e3e (16:5e3e) +SilphCo2EndBattleText2: TX_FAR _SilphCo2EndBattleText2 db "@" -SilphCo2AfterBattleText2: ; 59e43 (16:5e43) +SilphCo2AfterBattleText2: TX_FAR _SilphCo2AfterBattleText2 db "@" -SilphCo2BattleText3: ; 59e48 (16:5e48) +SilphCo2BattleText3: TX_FAR _SilphCo2BattleText3 db "@" -SilphCo2EndBattleText3: ; 59e4d (16:5e4d) +SilphCo2EndBattleText3: TX_FAR _SilphCo2EndBattleText3 db "@" -SilphCo2AfterBattleText3: ; 59e52 (16:5e52) +SilphCo2AfterBattleText3: TX_FAR _SilphCo2AfterBattleText3 db "@" -SilphCo2BattleText4: ; 59e57 (16:5e57) +SilphCo2BattleText4: TX_FAR _SilphCo2BattleText4 db "@" -SilphCo2EndBattleText4: ; 59e5c (16:5e5c) +SilphCo2EndBattleText4: TX_FAR _SilphCo2EndBattleText4 db "@" -SilphCo2AfterBattleText4: ; 59e61 (16:5e61) +SilphCo2AfterBattleText4: TX_FAR _SilphCo2AfterBattleText4 db "@" diff --git a/scripts/silphco3.asm b/scripts/silphco3.asm index 68ae7ed2..b8dfb7fb 100755 --- a/scripts/silphco3.asm +++ b/scripts/silphco3.asm @@ -1,4 +1,4 @@ -SilphCo3Script: ; 59f5b (16:5f5b) +SilphCo3Script: call SilphCo3Script_59f71 call EnableAutoTextBoxDrawing ld hl, SilphCo3TrainerHeaders @@ -8,7 +8,7 @@ SilphCo3Script: ; 59f5b (16:5f5b) ld [wSilphCo3CurScript], a ret -SilphCo3Script_59f71: ; 59f71 (16:5f71) +SilphCo3Script_59f71: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -32,12 +32,12 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71) lb bc, 4, 8 predef_jump ReplaceTileBlock -SilphCo3GateCoords: ; 59fa8 (16:5fa8) +SilphCo3GateCoords: db $04,$04 db $04,$08 db $FF -SilphCo3Script_59fad: ; 59fad (16:5fad) +SilphCo3Script_59fad: EventFlagAddress hl, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ld a, [$ffe0] and a @@ -50,19 +50,19 @@ SilphCo3Script_59fad: ; 59fad (16:5fad) SetEventAfterBranchReuseHL EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1 ret -SilphCo3ScriptPointers: ; 59fbe (16:5fbe) +SilphCo3ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SilphCo3TextPointers: ; 59fc4 (16:5fc4) +SilphCo3TextPointers: dw SilphCo3Text1 dw SilphCo3Text2 dw SilphCo3Text3 dw PickUpItemText -SilphCo3TrainerHeaders: ; 59fcc (16:5fcc) -SilphCo3TrainerHeader0: ; 59fcc (16:5fcc) +SilphCo3TrainerHeaders: +SilphCo3TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_0 @@ -71,7 +71,7 @@ SilphCo3TrainerHeader0: ; 59fcc (16:5fcc) dw SilphCo3EndBattleText1 ; TextEndBattle dw SilphCo3EndBattleText1 ; TextEndBattle -SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) +SilphCo3TrainerHeader1: dbEventFlagBit EVENT_BEAT_SILPH_CO_3F_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_3F_TRAINER_1 @@ -82,7 +82,7 @@ SilphCo3TrainerHeader1: ; 59fd8 (16:5fd8) db $ff -SilphCo3Text1: ; 59fe5 (16:5fe5) +SilphCo3Text1: TX_ASM CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo3Text_59ffe @@ -92,46 +92,46 @@ SilphCo3Text1: ; 59fe5 (16:5fe5) call PrintText jp TextScriptEnd -SilphCo3Text_59ff9: ; 59ff9 (16:5ff9) +SilphCo3Text_59ff9: TX_FAR _SilphCo3Text_59ff9 db "@" -SilphCo3Text_59ffe: ; 59ffe (16:5ffe) +SilphCo3Text_59ffe: TX_FAR _SilphCo3Text_59ffe db "@" -SilphCo3Text2: ; 5a003 (16:6003) +SilphCo3Text2: TX_ASM ld hl, SilphCo3TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo3BattleText1: ; 5a00d (16:600d) +SilphCo3BattleText1: TX_FAR _SilphCo3BattleText1 db "@" -SilphCo3EndBattleText1: ; 5a012 (16:6012) +SilphCo3EndBattleText1: TX_FAR _SilphCo3EndBattleText1 db "@" -SilphCo3AfterBattleText1: ; 5a017 (16:6017) +SilphCo3AfterBattleText1: TX_FAR _SilphCo3AfterBattleText1 db "@" -SilphCo3Text3: ; 5a01c (16:601c) +SilphCo3Text3: TX_ASM ld hl, SilphCo3TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SilphCo3BattleText2: ; 5a026 (16:6026) +SilphCo3BattleText2: TX_FAR _SilphCo3BattleText2 db "@" -SilphCo3EndBattleText2: ; 5a02b (16:602b) +SilphCo3EndBattleText2: TX_FAR _SilphCo3EndBattleText2 db "@" -SilphCo3AfterBattleText2: ; 5a030 (16:6030) +SilphCo3AfterBattleText2: TX_FAR _SilphCo3AfterBattleText2 db "@" diff --git a/scripts/silphco4.asm b/scripts/silphco4.asm index 12e04f69..a0682c8d 100755 --- a/scripts/silphco4.asm +++ b/scripts/silphco4.asm @@ -1,4 +1,4 @@ -SilphCo4Script: ; 19d0b (6:5d0b) +SilphCo4Script: call SilphCo4Script_19d21 call EnableAutoTextBoxDrawing ld hl, SilphCo4TrainerHeaders @@ -8,7 +8,7 @@ SilphCo4Script: ; 19d0b (6:5d0b) ld [wSilphCo4CurScript], a ret -SilphCo4Script_19d21: ; 19d21 (6:5d21) +SilphCo4Script_19d21: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -32,12 +32,12 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21) lb bc, 4, 6 predef_jump ReplaceTileBlock -SilphCo4GateCoords: ; 19d58 (6:5d58) +SilphCo4GateCoords: db $06,$02 db $04,$06 db $FF -SilphCo4Script_19d5d: ; 19d5d (6:5d5d) +SilphCo4Script_19d5d: push hl ld hl, wCardKeyDoorY ld a, [hli] @@ -73,7 +73,7 @@ SilphCo4Script_19d5d: ; 19d5d (6:5d5d) ld [$ffe0], a ret -SilphCo4Script_19d89: ; 19d89 (6:5d89) +SilphCo4Script_19d89: EventFlagAddress hl, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ld a, [$ffe0] and a @@ -86,12 +86,12 @@ SilphCo4Script_19d89: ; 19d89 (6:5d89) SetEventAfterBranchReuseHL EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1 ret -SilphCo4ScriptPointers: ; 19d9a (6:5d9a) +SilphCo4ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SilphCo4TextPointers: ; 19da0 (6:5da0) +SilphCo4TextPointers: dw SilphCo4Text1 dw SilphCo4Text2 dw SilphCo4Text3 @@ -100,8 +100,8 @@ SilphCo4TextPointers: ; 19da0 (6:5da0) dw PickUpItemText dw PickUpItemText -SilphCo4TrainerHeaders: ; 19dae (6:5dae) -SilphCo4TrainerHeader0: ; 19dae (6:5dae) +SilphCo4TrainerHeaders: +SilphCo4TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_0 @@ -110,7 +110,7 @@ SilphCo4TrainerHeader0: ; 19dae (6:5dae) dw SilphCo4EndBattleText2 ; TextEndBattle dw SilphCo4EndBattleText2 ; TextEndBattle -SilphCo4TrainerHeader2: ; 19dba (6:5dba) +SilphCo4TrainerHeader2: dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_2 @@ -119,7 +119,7 @@ SilphCo4TrainerHeader2: ; 19dba (6:5dba) dw SilphCo4EndBattleText3 ; TextEndBattle dw SilphCo4EndBattleText3 ; TextEndBattle -SilphCo4TrainerHeader3: ; 19dc6 (6:5dc6) +SilphCo4TrainerHeader3: dbEventFlagBit EVENT_BEAT_SILPH_CO_4F_TRAINER_3 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_4F_TRAINER_3 @@ -130,71 +130,71 @@ SilphCo4TrainerHeader3: ; 19dc6 (6:5dc6) db $ff -SilphCo4Text1: ; 19dd3 (6:5dd3) +SilphCo4Text1: TX_ASM ld hl, SilphCo4Text_19de0 ld de, SilphCo4Text_19de5 call SilphCo6Script_1a22f jp TextScriptEnd -SilphCo4Text_19de0: ; 19de0 (6:5de0) +SilphCo4Text_19de0: TX_FAR _SilphCo4Text_19de0 db "@" -SilphCo4Text_19de5: ; 19de5 (6:5de5) +SilphCo4Text_19de5: TX_FAR _SilphCo4Text_19de5 db "@" -SilphCo4Text2: ; 19dea (6:5dea) +SilphCo4Text2: TX_ASM ld hl, SilphCo4TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo4BattleText2: ; 19df4 (6:5df4) +SilphCo4BattleText2: TX_FAR _SilphCo4BattleText2 db "@" -SilphCo4EndBattleText2: ; 19df9 (6:5df9) +SilphCo4EndBattleText2: TX_FAR _SilphCo4EndBattleText2 db "@" -SilphCo4AfterBattleText2: ; 19dfe (6:5dfe) +SilphCo4AfterBattleText2: TX_FAR _SilphCo4AfterBattleText2 db "@" -SilphCo4Text3: ; 19e03 (6:5e03) +SilphCo4Text3: TX_ASM ld hl, SilphCo4TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SilphCo4BattleText3: ; 19e0d (6:5e0d) +SilphCo4BattleText3: TX_FAR _SilphCo4BattleText3 db "@" -SilphCo4EndBattleText3: ; 19e12 (6:5e12) +SilphCo4EndBattleText3: TX_FAR _SilphCo4EndBattleText3 db "@" -SilphCo4AfterBattleText3: ; 19e17 (6:5e17) +SilphCo4AfterBattleText3: TX_FAR _SilphCo4AfterBattleText3 db "@" -SilphCo4Text4: ; 19e1c (6:5e1c) +SilphCo4Text4: TX_ASM ld hl, SilphCo4TrainerHeader3 call TalkToTrainer jp TextScriptEnd -SilphCo4BattleText4: ; 19e26 (6:5e26) +SilphCo4BattleText4: TX_FAR _SilphCo4BattleText4 db "@" -SilphCo4EndBattleText4: ; 19e2b (6:5e2b) +SilphCo4EndBattleText4: TX_FAR _SilphCo4EndBattleText4 db "@" -SilphCo4AfterBattleText4: ; 19e30 (6:5e30) +SilphCo4AfterBattleText4: TX_FAR _SilphCo4AfterBattleText4 db "@" diff --git a/scripts/silphco5.asm b/scripts/silphco5.asm index d09848ba..42577498 100755 --- a/scripts/silphco5.asm +++ b/scripts/silphco5.asm @@ -1,4 +1,4 @@ -SilphCo5Script: ; 19f37 (6:5f37) +SilphCo5Script: call SilphCo5Script_19f4d call EnableAutoTextBoxDrawing ld hl, SilphCo5TrainerHeaders @@ -8,7 +8,7 @@ SilphCo5Script: ; 19f37 (6:5f37) ld [wSilphCo5CurScript], a ret -SilphCo5Script_19f4d: ; 19f4d (6:5f4d) +SilphCo5Script_19f4d: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -41,13 +41,13 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d) lb bc, 5, 7 predef_jump ReplaceTileBlock -SilphCo5GateCoords: ; 19f97 (6:5f97) +SilphCo5GateCoords: db $02,$03 db $06,$03 db $05,$07 db $FF -SilphCo5Script_19f9e: ; 19f9e (6:5f9e) +SilphCo5Script_19f9e: EventFlagAddress hl, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ld a, [$ffe0] and a @@ -65,12 +65,12 @@ SilphCo5Script_19f9e: ; 19f9e (6:5f9e) SetEventAfterBranchReuseHL EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR1 ret -SilphCo5ScriptPointers: ; 19fb6 (6:5fb6) +SilphCo5ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SilphCo5TextPointers: ; 19fbc (6:5fbc) +SilphCo5TextPointers: dw SilphCo5Text1 dw SilphCo5Text2 dw SilphCo5Text3 @@ -83,8 +83,8 @@ SilphCo5TextPointers: ; 19fbc (6:5fbc) dw SilphCo5Text10 dw SilphCo5Text11 -SilphCo5TrainerHeaders: ; 19fd2 (6:5fd2) -Silphco5TrainerHeader0: ; 19fd2 (6:5fd2) +SilphCo5TrainerHeaders: +Silphco5TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_0 db ($1 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_0 @@ -93,7 +93,7 @@ Silphco5TrainerHeader0: ; 19fd2 (6:5fd2) dw SilphCo5EndBattleText2 ; TextEndBattle dw SilphCo5EndBattleText2 ; TextEndBattle -Silphco5TrainerHeader2: ; 19fde (6:5fde) +Silphco5TrainerHeader2: dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_2 @@ -102,7 +102,7 @@ Silphco5TrainerHeader2: ; 19fde (6:5fde) dw SilphCo5EndBattleText3 ; TextEndBattle dw SilphCo5EndBattleText3 ; TextEndBattle -Silphco5TrainerHeader3: ; 19fea (6:5fea) +Silphco5TrainerHeader3: dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_3 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_3 @@ -111,7 +111,7 @@ Silphco5TrainerHeader3: ; 19fea (6:5fea) dw SilphCo5EndBattleText4 ; TextEndBattle dw SilphCo5EndBattleText4 ; TextEndBattle -Silphco5TrainerHeader4: ; 19ff6 (6:5ff6) +Silphco5TrainerHeader4: dbEventFlagBit EVENT_BEAT_SILPH_CO_5F_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_5F_TRAINER_4 @@ -122,101 +122,101 @@ Silphco5TrainerHeader4: ; 19ff6 (6:5ff6) db $ff -SilphCo5Text1: ; 1a003 (6:6003) +SilphCo5Text1: TX_ASM ld hl, SilphCo5Text_1a010 ld de, SilphCo5Text_1a015 call SilphCo6Script_1a22f jp TextScriptEnd -SilphCo5Text_1a010: ; 1a010 (6:6010) +SilphCo5Text_1a010: TX_FAR _SilphCo5Text_1a010 db "@" -SilphCo5Text_1a015: ; 1a015 (6:6015) +SilphCo5Text_1a015: TX_FAR _SilphCo5Text_1a015 db "@" -SilphCo5Text2: ; 1a01a (6:601a) +SilphCo5Text2: TX_ASM ld hl, Silphco5TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo5BattleText2: ; 1a024 (6:6024) +SilphCo5BattleText2: TX_FAR _SilphCo5BattleText2 db "@" -SilphCo5EndBattleText2: ; 1a029 (6:6029) +SilphCo5EndBattleText2: TX_FAR _SilphCo5EndBattleText2 db "@" -SilphCo5AfterBattleText2: ; 1a02e (6:602e) +SilphCo5AfterBattleText2: TX_FAR _SilphCo5AfterBattleText2 db "@" -SilphCo5Text3: ; 1a033 (6:6033) +SilphCo5Text3: TX_ASM ld hl, Silphco5TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SilphCo5BattleText3: ; 1a03d (6:603d) +SilphCo5BattleText3: TX_FAR _SilphCo5BattleText3 db "@" -SilphCo5EndBattleText3: ; 1a042 (6:6042) +SilphCo5EndBattleText3: TX_FAR _SilphCo5EndBattleText3 db "@" -SilphCo5AfterBattleText3: ; 1a047 (6:6047) +SilphCo5AfterBattleText3: TX_FAR _SilphCo5AfterBattleText3 db "@" -SilphCo5Text4: ; 1a04c (6:604c) +SilphCo5Text4: TX_ASM ld hl, Silphco5TrainerHeader3 call TalkToTrainer jp TextScriptEnd -SilphCo5BattleText4: ; 1a056 (6:6056) +SilphCo5BattleText4: TX_FAR _SilphCo5BattleText4 db "@" -SilphCo5EndBattleText4: ; 1a05b (6:605b) +SilphCo5EndBattleText4: TX_FAR _SilphCo5EndBattleText4 db "@" -SilphCo5AfterBattleText4: ; 1a060 (6:6060) +SilphCo5AfterBattleText4: TX_FAR _SilphCo5AfterBattleText4 db "@" -SilphCo5Text5: ; 1a065 (6:6065) +SilphCo5Text5: TX_ASM ld hl, Silphco5TrainerHeader4 call TalkToTrainer jp TextScriptEnd -SilphCo5BattleText5: ; 1a06f (6:606f) +SilphCo5BattleText5: TX_FAR _SilphCo5BattleText5 db "@" -SilphCo5EndBattleText5: ; 1a074 (6:6074) +SilphCo5EndBattleText5: TX_FAR _SilphCo5EndBattleText5 db "@" -SilphCo5AfterBattleText5: ; 1a079 (6:6079) +SilphCo5AfterBattleText5: TX_FAR _SilphCo5AfterBattleText5 db "@" -SilphCo5Text9: ; 1a07e (6:607e) +SilphCo5Text9: TX_FAR _SilphCo5Text9 db "@" -SilphCo5Text10: ; 1a083 (6:6083) +SilphCo5Text10: TX_FAR _SilphCo5Text10 db "@" -SilphCo5Text11: ; 1a088 (6:6088) +SilphCo5Text11: TX_FAR _SilphCo5Text11 db "@" diff --git a/scripts/silphco6.asm b/scripts/silphco6.asm index 406bc373..c40c7d70 100755 --- a/scripts/silphco6.asm +++ b/scripts/silphco6.asm @@ -1,4 +1,4 @@ -SilphCo6Script: ; 1a1a9 (6:61a9) +SilphCo6Script: call SilphCo6Script_1a1bf call EnableAutoTextBoxDrawing ld hl, SilphCo6TrainerHeaders @@ -8,7 +8,7 @@ SilphCo6Script: ; 1a1a9 (6:61a9) ld [wSilphCo6CurScript], a ret -SilphCo6Script_1a1bf: ; 1a1bf (6:61bf) +SilphCo6Script_1a1bf: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -23,23 +23,23 @@ SilphCo6Script_1a1bf: ; 1a1bf (6:61bf) lb bc, 6, 2 predef_jump ReplaceTileBlock -SilphCo6GateCoords: ; 1a1e3 (6:61e3) +SilphCo6GateCoords: db $06,$02 db $FF -SilphCo6Script_1a1e6: ; 1a1e6 (6:61e6) +SilphCo6Script_1a1e6: ld a, [$ffe0] and a ret z SetEvent EVENT_SILPH_CO_6_UNLOCKED_DOOR ret -SilphCo6ScriptPointers: ; 1a1f0 (6:61f0) +SilphCo6ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SilphCo6TextPointers: ; 1a1f6 (6:61f6) +SilphCo6TextPointers: dw SilphCo6Text1 dw SilphCo6Text2 dw SilphCo6Text3 @@ -51,8 +51,8 @@ SilphCo6TextPointers: ; 1a1f6 (6:61f6) dw PickUpItemText dw PickUpItemText -SilphCo6TrainerHeaders: ; 1a20a (6:620a) -SilphCo6TrainerHeader0: ; 1a20a (6:620a) +SilphCo6TrainerHeaders: +SilphCo6TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_0 @@ -61,7 +61,7 @@ SilphCo6TrainerHeader0: ; 1a20a (6:620a) dw SilphCo6EndBattleText2 ; TextEndBattle dw SilphCo6EndBattleText2 ; TextEndBattle -SilphCo6TrainerHeader2: ; 1a216 (6:6216) +SilphCo6TrainerHeader2: dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_2 @@ -70,7 +70,7 @@ SilphCo6TrainerHeader2: ; 1a216 (6:6216) dw SilphCo6EndBattleText3 ; TextEndBattle dw SilphCo6EndBattleText3 ; TextEndBattle -SilphCo6TrainerHeader3: ; 1a222 (6:6222) +SilphCo6TrainerHeader3: dbEventFlagBit EVENT_BEAT_SILPH_CO_6F_TRAINER_3, 1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_6F_TRAINER_3, 1 @@ -81,7 +81,7 @@ SilphCo6TrainerHeader3: ; 1a222 (6:6222) db $ff -SilphCo6Script_1a22f: ; 1a22f (6:622f) +SilphCo6Script_1a22f: CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .asm_1a238 jr .asm_1a23a @@ -91,131 +91,131 @@ SilphCo6Script_1a22f: ; 1a22f (6:622f) .asm_1a23a jp PrintText -SilphCo6Text1: ; 1a23d (6:623d) +SilphCo6Text1: TX_ASM ld hl, SilphCo6Text_1a24a ld de, SilphCo6Text_1a24f call SilphCo6Script_1a22f jp TextScriptEnd -SilphCo6Text_1a24a: ; 1a24a (6:624a) +SilphCo6Text_1a24a: TX_FAR _SilphCo6Text_1a24a db "@" -SilphCo6Text_1a24f: ; 1a24f (6:624f) +SilphCo6Text_1a24f: TX_FAR _SilphCo6Text_1a24f db "@" -SilphCo6Text2: ; 1a254 (6:6254) +SilphCo6Text2: TX_ASM ld hl, SilphCo6Text_1a261 ld de, SilphCo6Text_1a266 call SilphCo6Script_1a22f jp TextScriptEnd -SilphCo6Text_1a261: ; 1a261 (6:6261) +SilphCo6Text_1a261: TX_FAR _SilphCo6Text_1a261 db "@" -SilphCo6Text_1a266: ; 1a266 (6:6266) +SilphCo6Text_1a266: TX_FAR _SilphCo6Text_1a266 db "@" -SilphCo6Text3: ; 1a26b (6:626b) +SilphCo6Text3: TX_ASM ld hl, SilphCo6Text_1a278 ld de, SilphCo6Text_1a27d call SilphCo6Script_1a22f jp TextScriptEnd -SilphCo6Text_1a278: ; 1a278 (6:6278) +SilphCo6Text_1a278: TX_FAR _SilphCo6Text_1a278 db "@" -SilphCo6Text_1a27d: ; 1a27d (6:627d) +SilphCo6Text_1a27d: TX_FAR _SilphCo6Text_1a27d db "@" -SilphCo6Text4: ; 1a282 (6:6282) +SilphCo6Text4: TX_ASM ld hl, SilphCo6Text_1a28f ld de, SilphCo6Text_1a294 call SilphCo6Script_1a22f jp TextScriptEnd -SilphCo6Text_1a28f: ; 1a28f (6:628f) +SilphCo6Text_1a28f: TX_FAR _SilphCo6Text_1a28f db "@" -SilphCo6Text_1a294: ; 1a294 (6:6294) +SilphCo6Text_1a294: TX_FAR _SilphCo6Text_1a294 db "@" -SilphCo6Text5: ; 1a299 (6:6299) +SilphCo6Text5: TX_ASM ld hl, SilphCo6Text_1a2a6 ld de, SilphCo6Text_1a2ab call SilphCo6Script_1a22f jp TextScriptEnd -SilphCo6Text_1a2a6: ; 1a2a6 (6:62a6) +SilphCo6Text_1a2a6: TX_FAR _SilphCo6Text_1a2a6 db "@" -SilphCo6Text_1a2ab: ; 1a2ab (6:62ab) +SilphCo6Text_1a2ab: TX_FAR _SilphCo6Text_1a2ab db "@" -SilphCo6Text6: ; 1a2b0 (6:62b0) +SilphCo6Text6: TX_ASM ld hl, SilphCo6TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo6BattleText2: ; 1a2ba (6:62ba) +SilphCo6BattleText2: TX_FAR _SilphCo6BattleText2 db "@" -SilphCo6EndBattleText2: ; 1a2bf (6:62bf) +SilphCo6EndBattleText2: TX_FAR _SilphCo6EndBattleText2 db "@" -SilphCo6AfterBattleText2: ; 1a2c4 (6:62c4) +SilphCo6AfterBattleText2: TX_FAR _SilphCo6AfterBattleText2 db "@" -SilphCo6Text7: ; 1a2c9 (6:62c9) +SilphCo6Text7: TX_ASM ld hl, SilphCo6TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SilphCo6BattleText3: ; 1a2d3 (6:62d3) +SilphCo6BattleText3: TX_FAR _SilphCo6BattleText3 db "@" -SilphCo6EndBattleText3: ; 1a2d8 (6:62d8) +SilphCo6EndBattleText3: TX_FAR _SilphCo6EndBattleText3 db "@" -SilphCo6AfterBattleText3: ; 1a2dd (6:62dd) +SilphCo6AfterBattleText3: TX_FAR _SilphCo6AfterBattleText3 db "@" -SilphCo6Text8: ; 1a2e2 (6:62e2) +SilphCo6Text8: TX_ASM ld hl, SilphCo6TrainerHeader3 call TalkToTrainer jp TextScriptEnd -SilphCo6BattleText4: ; 1a2ec (6:62ec) +SilphCo6BattleText4: TX_FAR _SilphCo6BattleText4 db "@" -SilphCo6EndBattleText4: ; 1a2f1 (6:62f1) +SilphCo6EndBattleText4: TX_FAR _SilphCo6EndBattleText4 db "@" -SilphCo6AfterBattleText4: ; 1a2f6 (6:62f6) +SilphCo6AfterBattleText4: TX_FAR _SilphCo6AfterBattleText4 db "@" diff --git a/scripts/silphco7.asm b/scripts/silphco7.asm index cc26d117..2e93d92a 100755 --- a/scripts/silphco7.asm +++ b/scripts/silphco7.asm @@ -1,4 +1,4 @@ -SilphCo7Script: ; 51b61 (14:5b61) +SilphCo7Script: call SilphCo7Script_51b77 call EnableAutoTextBoxDrawing ld hl, SilphCo7TrainerHeaders @@ -8,7 +8,7 @@ SilphCo7Script: ; 51b61 (14:5b61) ld [wSilphCo7CurScript], a ret -SilphCo7Script_51b77: ; 51b77 (14:5b77) +SilphCo7Script_51b77: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -41,13 +41,13 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77) lb bc, 6, 10 predef_jump ReplaceTileBlock -SilphCo7GateCoords: ; 51bc1 (14:5bc1) +SilphCo7GateCoords: db $03,$05 db $02,$0A db $06,$0A db $FF -SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) +SilphCo7Text_51bc8: push hl ld hl, wCardKeyDoorY ld a, [hli] @@ -83,7 +83,7 @@ SilphCo7Text_51bc8: ; 51bc8 (14:5bc8) ld [$ffe0], a ret -SilphCo7Text_51bf4: ; 51bf4 (14:5bf4) +SilphCo7Text_51bf4: EventFlagAddress hl, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ld a, [$ffe0] and a @@ -101,16 +101,16 @@ SilphCo7Text_51bf4: ; 51bf4 (14:5bf4) SetEventAfterBranchReuseHL EVENT_SILPH_CO_7_UNLOCKED_DOOR3, EVENT_SILPH_CO_7_UNLOCKED_DOOR1 ret -SilphCo7Text_51c0c: ; 51c0c (14:5c0c) +SilphCo7Text_51c0c: xor a ld [wJoyIgnore], a -SilphCo7Text_51c10: ; 51c10 (14:5c10) +SilphCo7Text_51c10: ld [wSilphCo7CurScript], a ld [wCurMapScript], a ret -SilphCo7ScriptPointers: ; 51c17 (14:5c17) +SilphCo7ScriptPointers: dw SilphCo7Script0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle @@ -118,7 +118,7 @@ SilphCo7ScriptPointers: ; 51c17 (14:5c17) dw SilphCo7Script4 dw SilphCo7Script5 -SilphCo7Script0: ; 51c23 (14:5c23) +SilphCo7Script0: CheckEvent EVENT_BEAT_SILPH_CO_RIVAL jp nz, CheckFightingMapTrainers ld hl, CoordsData_51c78 @@ -153,19 +153,19 @@ SilphCo7Script0: ; 51c23 (14:5c23) ld a, $3 jp SilphCo7Text_51c10 -CoordsData_51c78: ; 51c78 (14:5c78) +CoordsData_51c78: db $02,$03 db $03,$03 db $FF -MovementData_51c7d: ; 51c7d (14:5c7d) +MovementData_51c7d: db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP db $FF -SilphCo7Script3: ; 51c82 (14:5c82) +SilphCo7Script3: ld a, [wd730] bit 0, a ret nz @@ -190,7 +190,7 @@ SilphCo7Script3: ; 51c82 (14:5c82) call SilphCo7Text_51c10 ret -SilphCo7Script4: ; 51cc8 (14:5cc8) +SilphCo7Script4: ld a, [wIsInBattle] cp $ff jp z, SilphCo7Text_51c0c @@ -221,12 +221,12 @@ SilphCo7Script4: ; 51cc8 (14:5cc8) ld a, $5 jp SilphCo7Text_51c10 -MovementData_51d1a: ; 51d1a (14:5d1a) +MovementData_51d1a: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_RIGHT db $FF -MovementData_51d1d: ; 51d1d (14:5d1d) +MovementData_51d1d: db NPC_MOVEMENT_LEFT db NPC_MOVEMENT_UP db NPC_MOVEMENT_UP @@ -236,7 +236,7 @@ MovementData_51d1d: ; 51d1d (14:5d1d) db NPC_MOVEMENT_DOWN db $FF -SilphCo7Script5: ; 51d25 (14:5d25) +SilphCo7Script5: ld a, [wd730] bit 0, a ret nz @@ -248,7 +248,7 @@ SilphCo7Script5: ; 51d25 (14:5d25) ld [wJoyIgnore], a jp SilphCo7Text_51c10 -SilphCo7TextPointers: ; 51d3f (14:5d3f) +SilphCo7TextPointers: dw SilphCo7Text1 dw SilphCo7Text2 dw SilphCo7Text3 @@ -265,8 +265,8 @@ SilphCo7TextPointers: ; 51d3f (14:5d3f) dw SilphCo7Text14 dw SilphCo7Text15 -SilphCo7TrainerHeaders: ; 51d5d (14:5d5d) -SilphCo7TrainerHeader0: ; 51d5d (14:5d5d) +SilphCo7TrainerHeaders: +SilphCo7TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_0 @@ -275,7 +275,7 @@ SilphCo7TrainerHeader0: ; 51d5d (14:5d5d) dw SilphCo7EndBattleText1 ; TextEndBattle dw SilphCo7EndBattleText1 ; TextEndBattle -SilphCo7TrainerHeader2: ; 51d69 (14:5d69) +SilphCo7TrainerHeader2: dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_2 @@ -284,7 +284,7 @@ SilphCo7TrainerHeader2: ; 51d69 (14:5d69) dw SilphCo7EndBattleText2 ; TextEndBattle dw SilphCo7EndBattleText2 ; TextEndBattle -SilphCo7TrainerHeader3: ; 51d75 (14:5d75) +SilphCo7TrainerHeader3: dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_3 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_3 @@ -293,7 +293,7 @@ SilphCo7TrainerHeader3: ; 51d75 (14:5d75) dw SilphCo7EndBattleText3 ; TextEndBattle dw SilphCo7EndBattleText3 ; TextEndBattle -SilphCo7TrainerHeader4: ; 51d81 (14:5d81) +SilphCo7TrainerHeader4: dbEventFlagBit EVENT_BEAT_SILPH_CO_7F_TRAINER_4, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_7F_TRAINER_4, 1 @@ -415,100 +415,100 @@ SilphCo7Text4: TX_FAR _SilphCo7Text_51e4b db "@" -SilphCo7Text5: ; 51e50 (14:5e50) +SilphCo7Text5: TX_ASM ld hl, SilphCo7TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo7BattleText1: ; 51e5a (14:5e5a) +SilphCo7BattleText1: TX_FAR _SilphCo7BattleText1 db "@" -SilphCo7EndBattleText1: ; 51e5f (14:5e5f) +SilphCo7EndBattleText1: TX_FAR _SilphCo7EndBattleText1 db "@" -SilphCo7AfterBattleText1: ; 51e64 (14:5e64) +SilphCo7AfterBattleText1: TX_FAR _SilphCo7AfterBattleText1 db "@" -SilphCo7Text6: ; 51e69 (14:5e69) +SilphCo7Text6: TX_ASM ld hl, SilphCo7TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SilphCo7BattleText2: ; 51e73 (14:5e73) +SilphCo7BattleText2: TX_FAR _SilphCo7BattleText2 db "@" -SilphCo7EndBattleText2: ; 51e78 (14:5e78) +SilphCo7EndBattleText2: TX_FAR _SilphCo7EndBattleText2 db "@" -SilphCo7AfterBattleText2: ; 51e7d (14:5e7d) +SilphCo7AfterBattleText2: TX_FAR _SilphCo7AfterBattleText2 db "@" -SilphCo7Text7: ; 51e82 (14:5e82) +SilphCo7Text7: TX_ASM ld hl, SilphCo7TrainerHeader3 call TalkToTrainer jp TextScriptEnd -SilphCo7BattleText3: ; 51e8c (14:5e8c) +SilphCo7BattleText3: TX_FAR _SilphCo7BattleText3 db "@" -SilphCo7EndBattleText3: ; 51e91 (14:5e91) +SilphCo7EndBattleText3: TX_FAR _SilphCo7EndBattleText3 db "@" -SilphCo7AfterBattleText3: ; 51e96 (14:5e96) +SilphCo7AfterBattleText3: TX_FAR _SilphCo7AfterBattleText3 db "@" -SilphCo7Text8: ; 51e9b (14:5e9b) +SilphCo7Text8: TX_ASM ld hl, SilphCo7TrainerHeader4 call TalkToTrainer jp TextScriptEnd -SilphCo7BattleText4: ; 51ea5 (14:5ea5) +SilphCo7BattleText4: TX_FAR _SilphCo7BattleText4 db "@" -SilphCo7EndBattleText4: ; 51eaa (14:5eaa) +SilphCo7EndBattleText4: TX_FAR _SilphCo7EndBattleText4 db "@" -SilphCo7AfterBattleText4: ; 51eaf (14:5eaf) +SilphCo7AfterBattleText4: TX_FAR _SilphCo7AfterBattleText4 db "@" -SilphCo7Text9: ; 51eb4 (14:5eb4) +SilphCo7Text9: TX_ASM ld hl, SilphCo7Text_51ebe call PrintText jp TextScriptEnd -SilphCo7Text_51ebe: ; 51ebe (14:5ebe) +SilphCo7Text_51ebe: TX_FAR _SilphCo7Text_51ebe db "@" -SilphCo7Text13: ; 51ec3 (14:5ec3) +SilphCo7Text13: TX_FAR _SilphCo7Text_51ec3 db "@" -SilphCo7Text14: ; 51ec8 (14:5ec8) +SilphCo7Text14: TX_FAR _SilphCo7Text_51ec8 db "@" -SilphCo7Text_51ecd: ; 51ecd (14:5ecd) +SilphCo7Text_51ecd: TX_FAR _SilphCo7Text_51ecd db "@" -SilphCo7Text15: ; 51ed2 (14:5ed2) +SilphCo7Text15: TX_FAR _SilphCo7Text_51ed2 db "@" diff --git a/scripts/silphco8.asm b/scripts/silphco8.asm index 86f02b60..399f7bd5 100755 --- a/scripts/silphco8.asm +++ b/scripts/silphco8.asm @@ -1,4 +1,4 @@ -SilphCo8Script: ; 56504 (15:6504) +SilphCo8Script: call SilphCo8Script_5651a call EnableAutoTextBoxDrawing ld hl, SilphCo8TrainerHeader0 @@ -8,7 +8,7 @@ SilphCo8Script: ; 56504 (15:6504) ld [wSilphCo8CurScript], a ret -SilphCo8Script_5651a: ; 5651a (15:651a) +SilphCo8Script_5651a: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -23,11 +23,11 @@ SilphCo8Script_5651a: ; 5651a (15:651a) lb bc, 4, 3 predef_jump ReplaceTileBlock -SilphCo8GateCoords: ; 5653e (15:653e) +SilphCo8GateCoords: db $04,$03 db $FF -SilphCo8Script_56541: ; 56541 (15:6541) +SilphCo8Script_56541: push hl ld hl, wCardKeyDoorY ld a, [hli] @@ -63,26 +63,26 @@ SilphCo8Script_56541: ; 56541 (15:6541) ld [$ffe0], a ret -SilphCo8Script_5656d: ; 5656d (15:656d) +SilphCo8Script_5656d: ld a, [$ffe0] and a ret z SetEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR ret -SilphCo8ScriptPointers: ; 56577 (15:6577) +SilphCo8ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SilphCo8TextPointers: ; 5657d (15:657d) +SilphCo8TextPointers: dw SilphCo8Text1 dw SilphCo8Text2 dw SilphCo8Text3 dw SilphCo8Text4 -SilphCo8TrainerHeaders: ; 56585 (15:6585) -SilphCo8TrainerHeader0: ; 56585 (15:6585) +SilphCo8TrainerHeaders: +SilphCo8TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_0 @@ -91,7 +91,7 @@ SilphCo8TrainerHeader0: ; 56585 (15:6585) dw SilphCo8EndBattleText1 ; TextEndBattle dw SilphCo8EndBattleText1 ; TextEndBattle -SilphCo8TrainerHeader1: ; 56591 (15:6591) +SilphCo8TrainerHeader1: dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_1 @@ -100,7 +100,7 @@ SilphCo8TrainerHeader1: ; 56591 (15:6591) dw SilphCo8EndBattleText2 ; TextEndBattle dw SilphCo8EndBattleText2 ; TextEndBattle -SilphCo8TrainerHeader2: ; 5659d (15:659d) +SilphCo8TrainerHeader2: dbEventFlagBit EVENT_BEAT_SILPH_CO_8F_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_8F_TRAINER_2 @@ -111,7 +111,7 @@ SilphCo8TrainerHeader2: ; 5659d (15:659d) db $ff -SilphCo8Text1: ; 565aa (15:65aa) +SilphCo8Text1: TX_ASM CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SilphCo8Text_565c3 @@ -121,64 +121,64 @@ SilphCo8Text1: ; 565aa (15:65aa) call PrintText jp TextScriptEnd -SilphCo8Text_565be: ; 565be (15:65be) +SilphCo8Text_565be: TX_FAR _SilphCo8Text_565be db "@" -SilphCo8Text_565c3: ; 565c3 (15:65c3) +SilphCo8Text_565c3: TX_FAR _SilphCo8Text_565c3 db "@" -SilphCo8Text2: ; 565c8 (15:65c8) +SilphCo8Text2: TX_ASM ld hl, SilphCo8TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo8Text3: ; 565d2 (15:65d2) +SilphCo8Text3: TX_ASM ld hl, SilphCo8TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SilphCo8Text4: ; 565dc (15:65dc) +SilphCo8Text4: TX_ASM ld hl, SilphCo8TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SilphCo8BattleText1: ; 565e6 (15:65e6) +SilphCo8BattleText1: TX_FAR _SilphCo8BattleText1 db "@" -SilphCo8EndBattleText1: ; 565eb (15:65eb) +SilphCo8EndBattleText1: TX_FAR _SilphCo8EndBattleText1 db "@" -SilphCo8AfterBattleText1: ; 565f0 (15:65f0) +SilphCo8AfterBattleText1: TX_FAR _SilphCo8AfterBattleText1 db "@" -SilphCo8BattleText2: ; 565f5 (15:65f5) +SilphCo8BattleText2: TX_FAR _SilphCo8BattleText2 db "@" -SilphCo8EndBattleText2: ; 565fa (15:65fa) +SilphCo8EndBattleText2: TX_FAR _SilphCo8EndBattleText2 db "@" -SilphCo8AfterBattleText2: ; 565ff (15:65ff) +SilphCo8AfterBattleText2: TX_FAR _SilphCo8AfterBattleText2 db "@" -SilphCo8BattleText3: ; 56604 (15:6604) +SilphCo8BattleText3: TX_FAR _SilphCo8BattleText3 db "@" -SilphCo8EndBattleText3: ; 56609 (15:6609) +SilphCo8EndBattleText3: TX_FAR _SilphCo8EndBattleText3 db "@" -SilphCo8AfterBattleText3: ; 5660e (15:660e) +SilphCo8AfterBattleText3: TX_FAR _SilphCo8AfterBattleText3 db "@" diff --git a/scripts/silphco9.asm b/scripts/silphco9.asm index 589a086e..6757eb49 100755 --- a/scripts/silphco9.asm +++ b/scripts/silphco9.asm @@ -1,4 +1,4 @@ -SilphCo9Script: ; 5d7bb (17:57bb) +SilphCo9Script: call SilphCo9Script_5d7d1 call EnableAutoTextBoxDrawing ld hl, SilphCo9TrainerHeaders @@ -8,7 +8,7 @@ SilphCo9Script: ; 5d7bb (17:57bb) ld [wSilphCo9CurScript], a ret -SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) +SilphCo9Script_5d7d1: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -50,14 +50,14 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1) lb bc, 6, 5 predef_jump ReplaceTileBlock -SilphCo9GateCoords: ; 5d82e (17:582e) +SilphCo9GateCoords: db $04,$01 db $02,$09 db $05,$09 db $06,$05 db $FF -SilphCo9Script_5d837: ; 5d837 (17:5837) +SilphCo9Script_5d837: push hl ld hl, wCardKeyDoorY ld a, [hli] @@ -93,7 +93,7 @@ SilphCo9Script_5d837: ; 5d837 (17:5837) ld [$ffe0], a ret -SilphCo9Script_5d863: ; 5d863 (17:5863) +SilphCo9Script_5d863: EventFlagAddress hl, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ld a, [$ffe0] and a @@ -118,19 +118,19 @@ SilphCo9Script_5d863: ; 5d863 (17:5863) SetEventAfterBranchReuseHL EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR1 ret -SilphCo9ScriptPointers: ; 5d885 (17:5885) +SilphCo9ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SilphCo9TextPointers: ; 5d88b (17:588b) +SilphCo9TextPointers: dw SilphCo9Text1 dw SilphCo9Text2 dw SilphCo9Text3 dw SilphCo9Text4 -SilphCo9TrainerHeaders: ; 5d893 (17:5893) -SilphCo9TrainerHeader0: ; 5d893 (17:5893) +SilphCo9TrainerHeaders: +SilphCo9TrainerHeader0: dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_0 @@ -139,7 +139,7 @@ SilphCo9TrainerHeader0: ; 5d893 (17:5893) dw SilphCo9EndBattleText1 ; TextEndBattle dw SilphCo9EndBattleText1 ; TextEndBattle -SilphCo9TrainerHeader1: ; 5d89f (17:589f) +SilphCo9TrainerHeader1: dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_1 @@ -148,7 +148,7 @@ SilphCo9TrainerHeader1: ; 5d89f (17:589f) dw SilphCo9EndBattleText2 ; TextEndBattle dw SilphCo9EndBattleText2 ; TextEndBattle -SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) +SilphCo9TrainerHeader2: dbEventFlagBit EVENT_BEAT_SILPH_CO_9F_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SILPH_CO_9F_TRAINER_2 @@ -159,7 +159,7 @@ SilphCo9TrainerHeader2: ; 5d8ab (17:58ab) db $ff -SilphCo9Text1: ; 5d8b8 (17:58b8) +SilphCo9Text1: TX_ASM CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .asm_5d8dc @@ -178,68 +178,68 @@ SilphCo9Text1: ; 5d8b8 (17:58b8) .asm_5d8e2 jp TextScriptEnd -SilphCo9Text_5d8e5: ; 5d8e5 (17:58e5) +SilphCo9Text_5d8e5: TX_FAR _SilphCo9Text_5d8e5 db "@" -SilphCo9Text_5d8ea: ; 5d8ea (17:58ea) +SilphCo9Text_5d8ea: TX_FAR _SilphCo9Text_5d8ea db "@" -SilphCo9Text_5d8ef: ; 5d8ef (17:58ef) +SilphCo9Text_5d8ef: TX_FAR _SilphCo9Text_5d8ef db "@" -SilphCo9Text2: ; 5d8f4 (17:58f4) +SilphCo9Text2: TX_ASM ld hl, SilphCo9TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SilphCo9Text3: ; 5d8fe (17:58fe) +SilphCo9Text3: TX_ASM ld hl, SilphCo9TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SilphCo9Text4: ; 5d908 (17:5908) +SilphCo9Text4: TX_ASM ld hl, SilphCo9TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SilphCo9BattleText1: ; 5d912 (17:5912) +SilphCo9BattleText1: TX_FAR _SilphCo9BattleText1 db "@" -SilphCo9EndBattleText1: ; 5d917 (17:5917) +SilphCo9EndBattleText1: TX_FAR _SilphCo9EndBattleText1 db "@" -SilphCo9AfterBattleText1: ; 5d91c (17:591c) +SilphCo9AfterBattleText1: TX_FAR _SilphCo9AfterBattleText1 db "@" -SilphCo9BattleText2: ; 5d921 (17:5921) +SilphCo9BattleText2: TX_FAR _SilphCo9BattleText2 db "@" -SilphCo9EndBattleText2: ; 5d926 (17:5926) +SilphCo9EndBattleText2: TX_FAR _SilphCo9EndBattleText2 db "@" -SilphCo9AfterBattleText2: ; 5d92b (17:592b) +SilphCo9AfterBattleText2: TX_FAR _SilphCo9AfterBattleText2 db "@" -SilphCo9BattleText3: ; 5d930 (17:5930) +SilphCo9BattleText3: TX_FAR _SilphCo9BattleText3 db "@" -SilphCo9EndBattleText3: ; 5d935 (17:5935) +SilphCo9EndBattleText3: TX_FAR _SilphCo9EndBattleText3 db "@" -SilphCo9AfterBattleText3: ; 5d93a (17:593a) +SilphCo9AfterBattleText3: TX_FAR _SilphCo9AfterBattleText3 db "@" diff --git a/scripts/silphcoelevator.asm b/scripts/silphcoelevator.asm index 386cd2e8..df4d08c7 100755 --- a/scripts/silphcoelevator.asm +++ b/scripts/silphcoelevator.asm @@ -1,4 +1,4 @@ -SilphCoElevatorScript: ; 457c0 (11:57c0) +SilphCoElevatorScript: ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] @@ -14,7 +14,7 @@ SilphCoElevatorScript: ; 457c0 (11:57c0) ld [wDoNotWaitForButtonPressAfterDisplayingText], a ret -SilphCoElevatorScript_457dc: ; 457dc (11:57dc) +SilphCoElevatorScript_457dc: ld hl, wWarpEntries ld a, [wWarpedFromWhichWarp] ld b, a @@ -22,7 +22,7 @@ SilphCoElevatorScript_457dc: ; 457dc (11:57dc) ld c, a call SilphCoElevatorScript_457ea -SilphCoElevatorScript_457ea: ; 457ea (11:57ea) +SilphCoElevatorScript_457ea: inc hl inc hl ld a, b @@ -31,7 +31,7 @@ SilphCoElevatorScript_457ea: ; 457ea (11:57ea) ld [hli], a ret -SilphCoElevatorScript_457f1: ; 457f1 (11:57f1) +SilphCoElevatorScript_457f1: ld hl, SilphCoElavatorFloors call LoadItemList ld hl, SilphCoElevatorWarpMaps @@ -40,7 +40,7 @@ SilphCoElevatorScript_457f1: ; 457f1 (11:57f1) call CopyData ret -SilphCoElavatorFloors: ; 45804 (11:45804) +SilphCoElavatorFloors: db $0B ; num elements in list db FLOOR_1F db FLOOR_2F @@ -55,7 +55,7 @@ SilphCoElavatorFloors: ; 45804 (11:45804) db FLOOR_11F db $FF ; terminator -SilphCoElevatorWarpMaps: ; 45811 (11:45811) +SilphCoElevatorWarpMaps: ; first byte is warp number ; second byte is map number ; These specify where the player goes after getting out of the elevator. @@ -72,15 +72,15 @@ SilphCoElevatorWarpMaps: ; 45811 (11:45811) db $01, SILPH_CO_11F SilphCoElevatorWarpMapsEnd: -SilphCoElevatorScript_45827: ; 45827 (11:5827) +SilphCoElevatorScript_45827: call Delay3 callba ShakeElevator ret -SilphCoElevatorTextPointers: ; 45833 (11:5833) +SilphCoElevatorTextPointers: dw SilphCoElevatorText1 -SilphCoElevatorText1: ; 45835 (11:5835) +SilphCoElevatorText1: TX_ASM call SilphCoElevatorScript_457f1 ld hl, SilphCoElevatorWarpMaps diff --git a/scripts/ssanne1.asm b/scripts/ssanne1.asm index 4814dfe9..3f8861d5 100755 --- a/scripts/ssanne1.asm +++ b/scripts/ssanne1.asm @@ -1,15 +1,15 @@ -SSAnne1Script: ; 61265 (18:5265) +SSAnne1Script: call EnableAutoTextBoxDrawing ret -SSAnne1TextPointers: ; 61269 (18:5269) +SSAnne1TextPointers: dw SSAnne1Text1 dw SSAnne1Text2 -SSAnne1Text1: ; 6126d (18:526d) +SSAnne1Text1: TX_FAR _SSAnne1Text1 db "@" -SSAnne1Text2: ; 61272 (18:5272) +SSAnne1Text2: TX_FAR _SSAnne1Text2 db "@" diff --git a/scripts/ssanne10.asm b/scripts/ssanne10.asm index d39b902f..45c8dba5 100755 --- a/scripts/ssanne10.asm +++ b/scripts/ssanne10.asm @@ -1,4 +1,4 @@ -SSAnne10Script: ; 61d55 (18:5d55) +SSAnne10Script: call EnableAutoTextBoxDrawing ld hl, SSAnne10TrainerHeaders ld de, SSAnne10ScriptPointers @@ -7,12 +7,12 @@ SSAnne10Script: ; 61d55 (18:5d55) ld [wSSAnne10CurScript], a ret -SSAnne10ScriptPointers: ; 61d68 (18:5d68) +SSAnne10ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SSAnne10TextPointers: ; 61d6e (18:5d6e) +SSAnne10TextPointers: dw SSAnne10Text1 dw SSAnne10Text2 dw SSAnne10Text3 @@ -25,8 +25,8 @@ SSAnne10TextPointers: ; 61d6e (18:5d6e) dw PickUpItemText dw PickUpItemText -SSAnne10TrainerHeaders: ; 61d84 (18:5d84) -SSAnne10TrainerHeader0: ; 61d84 (18:5d84) +SSAnne10TrainerHeaders: +SSAnne10TrainerHeader0: dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_0 @@ -35,7 +35,7 @@ SSAnne10TrainerHeader0: ; 61d84 (18:5d84) dw SSAnne10EndBattleText1 ; TextEndBattle dw SSAnne10EndBattleText1 ; TextEndBattle -SSAnne10TrainerHeader1: ; 61d90 (18:5d90) +SSAnne10TrainerHeader1: dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_1 @@ -44,7 +44,7 @@ SSAnne10TrainerHeader1: ; 61d90 (18:5d90) dw SSAnne10EndBattleText2 ; TextEndBattle dw SSAnne10EndBattleText2 ; TextEndBattle -SSAnne10TrainerHeader2: ; 61d9c (18:5d9c) +SSAnne10TrainerHeader2: dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_2 @@ -53,7 +53,7 @@ SSAnne10TrainerHeader2: ; 61d9c (18:5d9c) dw SSAnne10EndBattleText3 ; TextEndBattle dw SSAnne10EndBattleText3 ; TextEndBattle -SSAnne10TrainerHeader3: ; 61da8 (18:5da8) +SSAnne10TrainerHeader3: dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_3 @@ -62,7 +62,7 @@ SSAnne10TrainerHeader3: ; 61da8 (18:5da8) dw SSAnne10EndBattleText4 ; TextEndBattle dw SSAnne10EndBattleText4 ; TextEndBattle -SSAnne10TrainerHeader4: ; 61db4 (18:5db4) +SSAnne10TrainerHeader4: dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_4 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_4 @@ -71,7 +71,7 @@ SSAnne10TrainerHeader4: ; 61db4 (18:5db4) dw SSAnne10EndBattleText5 ; TextEndBattle dw SSAnne10EndBattleText5 ; TextEndBattle -SSAnne10TrainerHeader5: ; 61dc0 (18:5dc0) +SSAnne10TrainerHeader5: dbEventFlagBit EVENT_BEAT_SS_ANNE_10_TRAINER_5 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_10_TRAINER_5 @@ -82,121 +82,121 @@ SSAnne10TrainerHeader5: ; 61dc0 (18:5dc0) db $ff -SSAnne10Text1: ; 61dcd (18:5dcd) +SSAnne10Text1: TX_ASM ld hl, SSAnne10TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SSAnne10Text2: ; 61dd7 (18:5dd7) +SSAnne10Text2: TX_ASM ld hl, SSAnne10TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SSAnne10Text3: ; 61de1 (18:5de1) +SSAnne10Text3: TX_ASM ld hl, SSAnne10TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SSAnne10Text4: ; 61deb (18:5deb) +SSAnne10Text4: TX_ASM ld hl, SSAnne10TrainerHeader3 call TalkToTrainer jp TextScriptEnd -SSAnne10Text5: ; 61df5 (18:5df5) +SSAnne10Text5: TX_ASM ld hl, SSAnne10TrainerHeader4 call TalkToTrainer jp TextScriptEnd -SSAnne10Text6: ; 61dff (18:5dff) +SSAnne10Text6: TX_ASM ld hl, SSAnne10TrainerHeader5 call TalkToTrainer jp TextScriptEnd -SSAnne10Text8: ; 61e09 (18:5e09) +SSAnne10Text8: TX_FAR _SSAnne10Text8 TX_ASM ld a, MACHOKE call PlayCry jp TextScriptEnd -SSAnne10BattleText1: ; 61e16 (18:5e16) +SSAnne10BattleText1: TX_FAR _SSAnne10BattleText1 db "@" -SSAnne10EndBattleText1: ; 61e1b (18:5e1b) +SSAnne10EndBattleText1: TX_FAR _SSAnne10EndBattleText1 db "@" -SSAnne10AfterBattleText1: ; 61e20 (18:5e20) +SSAnne10AfterBattleText1: TX_FAR _SSAnne10AfterBattleText1 db "@" -SSAnne10BattleText2: ; 61e25 (18:5e25) +SSAnne10BattleText2: TX_FAR _SSAnne10BattleText2 db "@" -SSAnne10EndBattleText2: ; 61e2a (18:5e2a) +SSAnne10EndBattleText2: TX_FAR _SSAnne10EndBattleText2 db "@" -SSAnne10AfterBattleText2: ; 61e2f (18:5e2f) +SSAnne10AfterBattleText2: TX_FAR _SSAnne10AfterBattleText2 db "@" -SSAnne10BattleText3: ; 61e34 (18:5e34) +SSAnne10BattleText3: TX_FAR _SSAnne10BattleText3 db "@" -SSAnne10EndBattleText3: ; 61e39 (18:5e39) +SSAnne10EndBattleText3: TX_FAR _SSAnne10EndBattleText3 db "@" -SSAnne10AfterBattleText3: ; 61e3e (18:5e3e) +SSAnne10AfterBattleText3: TX_FAR _SSAnne10AfterBattleText3 db "@" -SSAnne10BattleText4: ; 61e43 (18:5e43) +SSAnne10BattleText4: TX_FAR _SSAnne10BattleText4 db "@" -SSAnne10EndBattleText4: ; 61e48 (18:5e48) +SSAnne10EndBattleText4: TX_FAR _SSAnne10EndBattleText4 db "@" -SSAnne10AfterBattleText4: ; 61e4d (18:5e4d) +SSAnne10AfterBattleText4: TX_FAR _SSAnne10AfterBattleText4 db "@" -SSAnne10BattleText5: ; 61e52 (18:5e52) +SSAnne10BattleText5: TX_FAR _SSAnne10BattleText5 db "@" -SSAnne10EndBattleText5: ; 61e57 (18:5e57) +SSAnne10EndBattleText5: TX_FAR _SSAnne10EndBattleText5 db "@" -SSAnne10AfterBattleText5: ; 61e5c (18:5e5c) +SSAnne10AfterBattleText5: TX_FAR _SSAnne10AfterBattleText5 db "@" -SSAnne10BattleText6: ; 61e61 (18:5e61) +SSAnne10BattleText6: TX_FAR _SSAnne10BattleText6 db "@" -SSAnne10EndBattleText6: ; 61e66 (18:5e66) +SSAnne10EndBattleText6: TX_FAR _SSAnne10EndBattleText6 db "@" -SSAnne10AfterBattleText6: ; 61e6b (18:5e6b) +SSAnne10AfterBattleText6: TX_FAR _SSAnne10AfterBattleText6 db "@" -SSAnne10Text7: ; 61e70 (18:5e70) +SSAnne10Text7: TX_FAR _SSAnne10Text7 db "@" diff --git a/scripts/ssanne2.asm b/scripts/ssanne2.asm index fdd6067e..4f0ffa2f 100755 --- a/scripts/ssanne2.asm +++ b/scripts/ssanne2.asm @@ -1,26 +1,26 @@ -SSAnne2Script: ; 6139f (18:539f) +SSAnne2Script: call EnableAutoTextBoxDrawing ld hl, SSAnne2ScriptPointers ld a, [wSSAnne2CurScript] jp JumpTable -SSAnne2Script_613ab: ; 613ab (18:53ab) +SSAnne2Script_613ab: xor a ld [wJoyIgnore], a ld [wSSAnne2CurScript], a ret -SSAnne2ScriptPointers: ; 613b3 (18:53b3) +SSAnne2ScriptPointers: dw SSAnne2Script0 dw SSAnne2Script1 dw SSAnne2Script2 dw SSAnne2Script3 dw SSAnne2Script4 -SSAnne2Script4: ; 613bd (18:53bd) +SSAnne2Script4: ret -SSAnne2Script0: ; 613be (18:53be) +SSAnne2Script0: ld hl, CoordsData_61411 call ArePlayerCoordsInArray ret nc @@ -54,21 +54,21 @@ SSAnne2Script0: ; 613be (18:53be) ld [wSSAnne2CurScript], a ret -MovementData_6140c: ; 6140c (18:540c) +MovementData_6140c: db NPC_MOVEMENT_DOWN -MovementData_6140d: ; 6140d (18:540d) +MovementData_6140d: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db $FF -CoordsData_61411: ; 61411 (18:5411) +CoordsData_61411: db $08,$24 db $08,$25 db $FF -SSAnne2Script_61416: ; 61416 (18:5416) +SSAnne2Script_61416: ld a, [wXCoord] cp $25 jr nz, .asm_61426 @@ -84,7 +84,7 @@ SSAnne2Script_61416: ; 61416 (18:5416) ld [H_SPRITEINDEX], a jp SetSpriteFacingDirectionAndDelay -SSAnne2Script1: ; 61430 (18:5430) +SSAnne2Script1: ld a, [wd730] bit 0, a ret nz @@ -104,7 +104,7 @@ SSAnne2Script1: ; 61430 (18:5430) ld [wSSAnne2CurScript], a ret -SSAnne2Script2: ; 6146d (18:546d) +SSAnne2Script2: ld a, [wIsInBattle] cp $ff jp z, SSAnne2Script_613ab @@ -134,18 +134,18 @@ SSAnne2Script2: ; 6146d (18:546d) ld [wSSAnne2CurScript], a ret -MovementData_614b7: ; 614b7 (18:54b7) +MovementData_614b7: db NPC_MOVEMENT_RIGHT db NPC_MOVEMENT_DOWN -MovementData_614b9: ; 614b9 (18:54b9) +MovementData_614b9: db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db NPC_MOVEMENT_DOWN db $FF -SSAnne2Script3: ; 614be (18:54be) +SSAnne2Script3: ld a, [wd730] bit 0, a ret nz @@ -159,16 +159,16 @@ SSAnne2Script3: ; 614be (18:54be) ld [wSSAnne2CurScript], a ret -SSAnne2TextPointers: ; 614db (18:54db) +SSAnne2TextPointers: dw SSAnne2Text1 dw SSAnne2Text2 dw SSAnne2Text3 -SSAnne2Text1: ; 614e1 (18:54e1) +SSAnne2Text1: TX_FAR _SSAnne2Text1 db "@" -SSAnne2Text2: ; 614e6 (18:54e6) +SSAnne2Text2: TX_ASM ld hl, SSAnneRivalBeforeBattleText call PrintText @@ -180,18 +180,18 @@ SSAnne2Text2: ; 614e6 (18:54e6) call SaveEndBattleTextPointers jp TextScriptEnd -SSAnneRivalBeforeBattleText: ; 61500 (18:5500) +SSAnneRivalBeforeBattleText: TX_FAR _SSAnneRivalBeforeBattleText db "@" -SSAnneRivalDefeatedText: ; 61505 (18:5505) +SSAnneRivalDefeatedText: TX_FAR _SSAnneRivalDefeatedText db "@" -SSAnneRivalWonText: ; 6150a (18:550a) +SSAnneRivalWonText: TX_FAR _SSAnneRivalWonText db "@" -SSAnne2Text3: ; 6150f (18:550f) +SSAnne2Text3: TX_FAR _SSAnneRivalCaptainText db "@" diff --git a/scripts/ssanne3.asm b/scripts/ssanne3.asm index 56cbdd9c..e681591a 100755 --- a/scripts/ssanne3.asm +++ b/scripts/ssanne3.asm @@ -1,9 +1,9 @@ -SSAnne3Script: ; 44932 (11:4932) +SSAnne3Script: jp EnableAutoTextBoxDrawing -SSAnne3TextPointers: ; 44935 (11:4935) +SSAnne3TextPointers: dw SSAnne3Text1 -SSAnne3Text1: ; 44937 (11:4937) +SSAnne3Text1: TX_FAR _SSAnne3Text1 db "@" diff --git a/scripts/ssanne4.asm b/scripts/ssanne4.asm index 6cc0e7b9..c9411717 100755 --- a/scripts/ssanne4.asm +++ b/scripts/ssanne4.asm @@ -1,5 +1,5 @@ -SSAnne4Script: ; 6162e (18:562e) +SSAnne4Script: jp EnableAutoTextBoxDrawing -SSAnne4TextPointers: ; 61631 (18:5631) +SSAnne4TextPointers: db "@" diff --git a/scripts/ssanne5.asm b/scripts/ssanne5.asm index 698e9f14..a398a381 100755 --- a/scripts/ssanne5.asm +++ b/scripts/ssanne5.asm @@ -1,4 +1,4 @@ -SSAnne5Script: ; 616ae (18:56ae) +SSAnne5Script: call EnableAutoTextBoxDrawing ld hl, SSAnne5TrainerHeader0 ld de, SSAnne5ScriptPointers @@ -7,20 +7,20 @@ SSAnne5Script: ; 616ae (18:56ae) ld [wSSAnne5CurScript], a ret -SSAnne5ScriptPointers: ; 616c1 (18:56c1) +SSAnne5ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SSAnne5TextPointers: ; 616c7 (18:56c7) +SSAnne5TextPointers: dw SSAnne5Text1 dw SSAnne5Text2 dw SSAnne5Text3 dw SSAnne5Text4 dw SSAnne5Text5 -SSAnne5TrainerHeaders: ; 616d1 (18:56d1) -SSAnne5TrainerHeader0: ; 616d1 (18:56d1) +SSAnne5TrainerHeaders: +SSAnne5TrainerHeader0: dbEventFlagBit EVENT_BEAT_SS_ANNE_5_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_5_TRAINER_0 @@ -29,7 +29,7 @@ SSAnne5TrainerHeader0: ; 616d1 (18:56d1) dw SSAnne5EndBattleText1 ; TextEndBattle dw SSAnne5EndBattleText1 ; TextEndBattle -SSAnne5TrainerHeader1: ; 616dd (18:56dd) +SSAnne5TrainerHeader1: dbEventFlagBit EVENT_BEAT_SS_ANNE_5_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_5_TRAINER_1 @@ -40,50 +40,50 @@ SSAnne5TrainerHeader1: ; 616dd (18:56dd) db $ff -SSAnne5Text1: ; 616ea (18:56ea) +SSAnne5Text1: TX_FAR _SSAnne5Text1 db "@" -SSAnne5Text2: ; 616ef (18:56ef) +SSAnne5Text2: TX_FAR _SSAnne5Text2 db "@" -SSAnne5Text3: ; 616f4 (18:56f4) +SSAnne5Text3: TX_FAR _SSAnne5Text3 db "@" -SSAnne5Text4: ; 616f9 (18:56f9) +SSAnne5Text4: TX_ASM ld hl, SSAnne5TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SSAnne5BattleText1: ; 61703 (18:5703) +SSAnne5BattleText1: TX_FAR _SSAnne5BattleText1 db "@" -SSAnne5EndBattleText1: ; 61708 (18:5708) +SSAnne5EndBattleText1: TX_FAR _SSAnne5EndBattleText1 db "@" -SSAnne5AfterBattleText1: ; 6170d (18:570d) +SSAnne5AfterBattleText1: TX_FAR _SSAnne5AfterBattleText1 db "@" -SSAnne5Text5: ; 61712 (18:5712) +SSAnne5Text5: TX_ASM ld hl, SSAnne5TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SSAnne5BattleText2: ; 6171c (18:571c) +SSAnne5BattleText2: TX_FAR _SSAnne5BattleText2 db "@" -SSAnne5EndBattleText2: ; 61721 (18:5721) +SSAnne5EndBattleText2: TX_FAR _SSAnne5EndBattleText2 db "@" -SSAnne5AfterBattleText2: ; 61726 (18:5726) +SSAnne5AfterBattleText2: TX_FAR _SSAnne5AfterBattleText2 db "@" diff --git a/scripts/ssanne6.asm b/scripts/ssanne6.asm index fbe8176d..e1998858 100755 --- a/scripts/ssanne6.asm +++ b/scripts/ssanne6.asm @@ -1,8 +1,8 @@ -SSAnne6Script: ; 617b3 (18:57b3) +SSAnne6Script: call EnableAutoTextBoxDrawing ret -SSAnne6TextPointers: ; 617b7 (18:57b7) +SSAnne6TextPointers: dw SSAnne6Text1 dw SSAnne6Text2 dw SSAnne6Text3 @@ -11,31 +11,31 @@ SSAnne6TextPointers: ; 617b7 (18:57b7) dw SSAnne6Text6 dw SSAnne6Text7 -SSAnne6Text1: ; 617c5 (18:57c5) +SSAnne6Text1: TX_FAR _SSAnne6Text1 db "@" -SSAnne6Text2: ; 617ca (18:57ca) +SSAnne6Text2: TX_FAR _SSAnne6Text2 db "@" -SSAnne6Text3: ; 617cf (18:57cf) +SSAnne6Text3: TX_FAR _SSAnne6Text3 db "@" -SSAnne6Text4: ; 617d4 (18:57d4) +SSAnne6Text4: TX_FAR _SSAnne6Text4 db "@" -SSAnne6Text5: ; 617d9 (18:57d9) +SSAnne6Text5: TX_FAR _SSAnne6Text5 db "@" -SSAnne6Text6: ; 617de (18:57de) +SSAnne6Text6: TX_FAR _SSAnne6Text6 db "@" -SSAnne6Text7: ; 617e3 (18:57e3) +SSAnne6Text7: TX_ASM ld hl, SSAnne6Text_61807 call PrintText @@ -55,18 +55,18 @@ SSAnne6Text7: ; 617e3 (18:57e3) call PrintText jp TextScriptEnd -SSAnne6Text_61807: ; 61807 (18:5807) +SSAnne6Text_61807: TX_FAR _SSAnne6Text_61807 db "@" -SSAnne6Text_6180c: ; 6180c (18:580c) +SSAnne6Text_6180c: TX_FAR _SSAnne6Text_6180c db "@" -SSAnne6Text_61811: ; 61811 (18:5811) +SSAnne6Text_61811: TX_FAR _SSAnne6Text_61811 db "@" -SSAnne6Text_61816: ; 61816 (18:5816) +SSAnne6Text_61816: TX_FAR _SSAnne6Text_61816 db "@" diff --git a/scripts/ssanne7.asm b/scripts/ssanne7.asm index 6d07d308..06789cd5 100755 --- a/scripts/ssanne7.asm +++ b/scripts/ssanne7.asm @@ -1,20 +1,20 @@ -SSAnne7Script: ; 61895 (18:5895) +SSAnne7Script: call SSAnne7Script_6189b jp EnableAutoTextBoxDrawing -SSAnne7Script_6189b: ; 6189b (18:589b) +SSAnne7Script_6189b: CheckEvent EVENT_GOT_HM01 ret nz ld hl, wd72d set 5, [hl] ret -SSAnne7TextPointers: ; 618a7 (18:58a7) +SSAnne7TextPointers: dw SSAnne7Text1 dw SSAnne7Text2 dw SSAnne7Text3 -SSAnne7Text1: ; 618ad (18:58ad) +SSAnne7Text1: TX_ASM CheckEvent EVENT_GOT_HM01 jr nz, .asm_797c4 @@ -41,7 +41,7 @@ SSAnne7Text1: ; 618ad (18:58ad) .asm_0faf5 jp TextScriptEnd -SSAnne7RubText: ; 618ec (18:58ec) +SSAnne7RubText: TX_FAR _SSAnne7RubText TX_ASM ld a, [wAudioROMBank] @@ -65,26 +65,26 @@ SSAnne7RubText: ; 618ec (18:58ec) res 5, [hl] jp TextScriptEnd -ReceivingHM01Text: ; 61927 (18:5927) +ReceivingHM01Text: TX_FAR _ReceivingHM01Text db "@" -ReceivedHM01Text: ; 6192c (18:592c) +ReceivedHM01Text: TX_FAR _ReceivedHM01Text db $11, "@" -SSAnne7Text_61932: ; 61932 (18:5932) +SSAnne7Text_61932: TX_FAR _SSAnne7Text_61932 db "@" -HM01NoRoomText: ; 61937 (18:5937) +HM01NoRoomText: TX_FAR _HM01NoRoomText db "@" -SSAnne7Text2: ; 6193c (18:593c) +SSAnne7Text2: TX_FAR _SSAnne7Text2 db "@" -SSAnne7Text3: ; 61941 (18:5941) +SSAnne7Text3: TX_FAR _SSAnne7Text3 db "@" diff --git a/scripts/ssanne8.asm b/scripts/ssanne8.asm index 2e7dcf67..e7cbef3e 100755 --- a/scripts/ssanne8.asm +++ b/scripts/ssanne8.asm @@ -1,4 +1,4 @@ -SSAnne8Script: ; 61976 (18:5976) +SSAnne8Script: call EnableAutoTextBoxDrawing ld hl, SSAnne8TrainerHeaders ld de, SSAnne8ScriptPointers @@ -7,12 +7,12 @@ SSAnne8Script: ; 61976 (18:5976) ld [wSSAnne8CurScript], a ret -SSAnne8ScriptPointers: ; 61989 (18:5989) +SSAnne8ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SSAnne8TextPointers: ; 6198f (18:598f) +SSAnne8TextPointers: dw SSAnne8Text1 dw SSAnne8Text2 dw SSAnne8Text3 @@ -25,8 +25,8 @@ SSAnne8TextPointers: ; 6198f (18:598f) dw PickUpItemText dw SSAnne8Text11 -SSAnne8TrainerHeaders: ; 619a5 (18:59a5) -SSAnne8TrainerHeader0: ; 619a5 (18:59a5) +SSAnne8TrainerHeaders: +SSAnne8TrainerHeader0: dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_0 @@ -35,7 +35,7 @@ SSAnne8TrainerHeader0: ; 619a5 (18:59a5) dw SSAnne8EndBattleText1 ; TextEndBattle dw SSAnne8EndBattleText1 ; TextEndBattle -SSAnne8TrainerHeader1: ; 619b1 (18:59b1) +SSAnne8TrainerHeader1: dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_1 @@ -44,7 +44,7 @@ SSAnne8TrainerHeader1: ; 619b1 (18:59b1) dw SSAnne8EndBattleText2 ; TextEndBattle dw SSAnne8EndBattleText2 ; TextEndBattle -SSAnne8TrainerHeader2: ; 619bd (18:59bd) +SSAnne8TrainerHeader2: dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_2 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_2 @@ -53,7 +53,7 @@ SSAnne8TrainerHeader2: ; 619bd (18:59bd) dw SSAnne8EndBattleText3 ; TextEndBattle dw SSAnne8EndBattleText3 ; TextEndBattle -SSAnne8TrainerHeader3: ; 619c9 (18:59c9) +SSAnne8TrainerHeader3: dbEventFlagBit EVENT_BEAT_SS_ANNE_8_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_8_TRAINER_3 @@ -64,101 +64,101 @@ SSAnne8TrainerHeader3: ; 619c9 (18:59c9) db $ff -SSAnne8Text1: ; 619d6 (18:59d6) +SSAnne8Text1: TX_ASM ld hl, SSAnne8TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SSAnne8Text2: ; 619e0 (18:59e0) +SSAnne8Text2: TX_ASM ld hl, SSAnne8TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SSAnne8Text3: ; 619ea (18:59ea) +SSAnne8Text3: TX_ASM ld hl, SSAnne8TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SSAnne8Text4: ; 619f4 (18:59f4) +SSAnne8Text4: TX_ASM ld hl, SSAnne8TrainerHeader3 call TalkToTrainer jp TextScriptEnd -SSAnne8Text8: ; 619fe (18:59fe) +SSAnne8Text8: TX_FAR _SSAnne8Text8 TX_ASM ld a, WIGGLYTUFF call PlayCry jp TextScriptEnd -SSAnne8BattleText1: ; 61a0b (18:5a0b) +SSAnne8BattleText1: TX_FAR _SSAnne8BattleText1 db "@" -SSAnne8EndBattleText1: ; 61a10 (18:5a10) +SSAnne8EndBattleText1: TX_FAR _SSAnne8EndBattleText1 db "@" -SSAnne8AfterBattleText1: ; 61a15 (18:5a15) +SSAnne8AfterBattleText1: TX_FAR _SSAnne8AfterBattleText1 db "@" -SSAnne8BattleText2: ; 61a1a (18:5a1a) +SSAnne8BattleText2: TX_FAR _SSAnne8BattleText2 db "@" -SSAnne8EndBattleText2: ; 61a1f (18:5a1f) +SSAnne8EndBattleText2: TX_FAR _SSAnne8EndBattleText2 db "@" -SSAnne8AfterBattleText2: ; 61a24 (18:5a24) +SSAnne8AfterBattleText2: TX_FAR _SSAnne8AfterBattleText2 db "@" -SSAnne8BattleText3: ; 61a29 (18:5a29) +SSAnne8BattleText3: TX_FAR _SSAnne8BattleText3 db "@" -SSAnne8EndBattleText3: ; 61a2e (18:5a2e) +SSAnne8EndBattleText3: TX_FAR _SSAnne8EndBattleText3 db "@" -SSAnne8AfterBattleText3: ; 61a33 (18:5a33) +SSAnne8AfterBattleText3: TX_FAR _SSAnne8AfterBattleText3 db "@" -SSAnne8BattleText4: ; 61a38 (18:5a38) +SSAnne8BattleText4: TX_FAR _SSAnne8BattleText4 db "@" -SSAnne8EndBattleText4: ; 61a3d (18:5a3d) +SSAnne8EndBattleText4: TX_FAR _SSAnne8EndBattleText4 db "@" -SSAnne8AfterBattleText4: ; 61a42 (18:5a42) +SSAnne8AfterBattleText4: TX_FAR _SSAnne8AfterBattleText4 db "@" -SSAnne8Text5: ; 61a47 (18:5a47) +SSAnne8Text5: TX_FAR _SSAnne8Text5 db "@" -SSAnne8Text6: ; 61a4c (18:5a4c) +SSAnne8Text6: TX_FAR _SSAnne8Text6 db "@" -SSAnne8Text7: ; 61a51 (18:5a51) +SSAnne8Text7: TX_FAR _SSAnne8Text7 db "@" -SSAnne8Text9: ; 61a56 (18:5a56) +SSAnne8Text9: TX_FAR _SSAnne8Text9 db "@" -SSAnne8Text11: ; 61a5b (18:5a5b) +SSAnne8Text11: TX_FAR _SSAnne8Text11 db "@" diff --git a/scripts/ssanne9.asm b/scripts/ssanne9.asm index e7350562..6e658e5f 100755 --- a/scripts/ssanne9.asm +++ b/scripts/ssanne9.asm @@ -1,4 +1,4 @@ -SSAnne9Script: ; 61b4b (18:5b4b) +SSAnne9Script: call DisableAutoTextBoxDrawing ld hl, SSAnne9TrainerHeaders ld de, SSAnne9ScriptPointers @@ -7,12 +7,12 @@ SSAnne9Script: ; 61b4b (18:5b4b) ld [wSSAnne9CurScript], a ret -SSAnne9ScriptPointers: ; 61b64 (18:5b64) +SSAnne9ScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -SSAnne9TextPointers: ; 61b6a (18:5b6a) +SSAnne9TextPointers: dw SSAnne9Text1 dw SSAnne9Text2 dw SSAnne9Text3 @@ -27,8 +27,8 @@ SSAnne9TextPointers: ; 61b6a (18:5b6a) dw SSAnne9Text12 dw SSAnne9Text13 -SSAnne9TrainerHeaders: ; 61b84 (18:5b84) -SSAnne9TrainerHeader0: ; 61b84 (18:5b84) +SSAnne9TrainerHeaders: +SSAnne9TrainerHeader0: dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_0 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_0 @@ -37,7 +37,7 @@ SSAnne9TrainerHeader0: ; 61b84 (18:5b84) dw SSAnne9EndBattleText1 ; TextEndBattle dw SSAnne9EndBattleText1 ; TextEndBattle -SSAnne9TrainerHeader1: ; 61b90 (18:5b90) +SSAnne9TrainerHeader1: dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_1 @@ -46,7 +46,7 @@ SSAnne9TrainerHeader1: ; 61b90 (18:5b90) dw SSAnne9EndBattleText2 ; TextEndBattle dw SSAnne9EndBattleText2 ; TextEndBattle -SSAnne9TrainerHeader2: ; 61b9c (18:5b9c) +SSAnne9TrainerHeader2: dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_2 @@ -55,7 +55,7 @@ SSAnne9TrainerHeader2: ; 61b9c (18:5b9c) dw SSAnne9EndBattleText3 ; TextEndBattle dw SSAnne9EndBattleText3 ; TextEndBattle -SSAnne9TrainerHeader3: ; 61ba8 (18:5ba8) +SSAnne9TrainerHeader3: dbEventFlagBit EVENT_BEAT_SS_ANNE_9_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_SS_ANNE_9_TRAINER_3 @@ -66,31 +66,31 @@ SSAnne9TrainerHeader3: ; 61ba8 (18:5ba8) db $ff -SSAnne9Text1: ; 61bb5 (18:5bb5) +SSAnne9Text1: TX_ASM ld hl, SSAnne9TrainerHeader0 call TalkToTrainer jp TextScriptEnd -SSAnne9Text2: ; 61bbf (18:5bbf) +SSAnne9Text2: TX_ASM ld hl, SSAnne9TrainerHeader1 call TalkToTrainer jp TextScriptEnd -SSAnne9Text3: ; 61bc9 (18:5bc9) +SSAnne9Text3: TX_ASM ld hl, SSAnne9TrainerHeader2 call TalkToTrainer jp TextScriptEnd -SSAnne9Text4: ; 61bd3 (18:5bd3) +SSAnne9Text4: TX_ASM ld hl, SSAnne9TrainerHeader3 call TalkToTrainer jp TextScriptEnd -SSAnne9Text5: ; 61bdd (18:5bdd) +SSAnne9Text5: TX_ASM call SaveScreenTilesToBuffer1 ld hl, SSAnne9Text_61bf2 @@ -100,94 +100,94 @@ SSAnne9Text5: ; 61bdd (18:5bdd) call DisplayPokedex jp TextScriptEnd -SSAnne9Text_61bf2: ; 61bf2 (18:5bf2) +SSAnne9Text_61bf2: TX_FAR _SSAnne9Text_61bf2 db "@" -SSAnne9Text7: ; 61bf7 (18:5bf7) +SSAnne9Text7: TX_ASM ld hl, SSAnne9Text_61c01 call PrintText jp TextScriptEnd -SSAnne9Text_61c01: ; 61c01 (18:5c01) +SSAnne9Text_61c01: TX_FAR _SSAnne9Text_61c01 db "@" -SSAnne9Text8: ; 61c06 (18:5c06) +SSAnne9Text8: TX_ASM ld hl, SSAnne9Text_61c10 call PrintText jp TextScriptEnd -SSAnne9Text_61c10: ; 61c10 (18:5c10) +SSAnne9Text_61c10: TX_FAR _SSAnne9Text_61c10 db "@" -SSAnne9Text10: ; 61c15 (18:5c15) +SSAnne9Text10: TX_ASM callba Func_f2570 jp TextScriptEnd -SSAnne9Text11: ; 61c24 (18:5c24) +SSAnne9Text11: TX_ASM callba Func_f257c jp TextScriptEnd -SSAnne9Text12: ; 61c33 (18:5c33) +SSAnne9Text12: TX_ASM callba Func_f2588 jp TextScriptEnd -SSAnne9Text13: ; 61c42 (18:5c42) +SSAnne9Text13: TX_ASM callba Func_f2594 jp TextScriptEnd -SSAnne9BattleText1: ; 61c51 (18:5c51) +SSAnne9BattleText1: TX_FAR _SSAnne9BattleText1 db "@" -SSAnne9EndBattleText1: ; 61c56 (18:5c56) +SSAnne9EndBattleText1: TX_FAR _SSAnne9EndBattleText1 db "@" -SSAnne9AfterBattleText1: ; 61c5b (18:5c5b) +SSAnne9AfterBattleText1: TX_FAR _SSAnne9AfterBattleText1 db "@" -SSAnne9BattleText2: ; 61c60 (18:5c60) +SSAnne9BattleText2: TX_FAR _SSAnne9BattleText2 db "@" -SSAnne9EndBattleText2: ; 61c65 (18:5c65) +SSAnne9EndBattleText2: TX_FAR _SSAnne9EndBattleText2 db "@" -SSAnne9AfterBattleText2: ; 61c6a (18:5c6a) +SSAnne9AfterBattleText2: TX_FAR _SSAnne9AfterBattleText2 db "@" -SSAnne9BattleText3: ; 61c6f (18:5c6f) +SSAnne9BattleText3: TX_FAR _SSAnne9BattleText3 db "@" -SSAnne9EndBattleText3: ; 61c74 (18:5c74) +SSAnne9EndBattleText3: TX_FAR _SSAnne9EndBattleText3 db "@" -SSAnne9AfterBattleText3: ; 61c79 (18:5c79) +SSAnne9AfterBattleText3: TX_FAR _SSAnne9AfterBattleText3 db "@" -SSAnne9BattleText4: ; 61c7e (18:5c7e) +SSAnne9BattleText4: TX_FAR _SSAnne9BattleText4 db "@" -SSAnne9EndBattleText4: ; 61c83 (18:5c83) +SSAnne9EndBattleText4: TX_FAR _SSAnne9EndBattleText4 db "@" -SSAnne9AfterBattleText4: ; 61c88 (18:5c88) +SSAnne9AfterBattleText4: TX_FAR _SSAnne9AfterBattleText4 db "@" diff --git a/scripts/tradecenter.asm b/scripts/tradecenter.asm index 22a61095..a200e719 100644 --- a/scripts/tradecenter.asm +++ b/scripts/tradecenter.asm @@ -1,4 +1,4 @@ -TradeCenterScript: ; 4fd10 (13:7d10) +TradeCenterScript: call EnableAutoTextBoxDrawing ld a, [$ffaa] cp $2 @@ -30,9 +30,9 @@ TradeCenterScript: ; 4fd10 (13:7d10) ld [wSpriteStateData1 + $19], a ret -TradeCenterTextPointers: ; 4fd4c (13:7d4c) +TradeCenterTextPointers: dw TradeCenterText1 -TradeCenterText1: ; 4fd4e (13:7d4e) +TradeCenterText1: TX_FAR _TradeCenterText1 db "@" diff --git a/scripts/undergroundpathentranceroute5.asm b/scripts/undergroundpathentranceroute5.asm index c93ab7b5..18707c4a 100755 --- a/scripts/undergroundpathentranceroute5.asm +++ b/scripts/undergroundpathentranceroute5.asm @@ -1,15 +1,15 @@ -UndergroundPathEntranceRoute5Script: ; 5d6a9 (17:56a9) +UndergroundPathEntranceRoute5Script: ld a, ROUTE_5 ld [wLastMap], a ret -UndergroundPathEntranceRoute5_5d6af: ; 5d6af (17:56af) +UndergroundPathEntranceRoute5_5d6af: db "@" -UndergroundPathEntranceRoute5TextPointers: ; 5d6b0 (17:56b0) +UndergroundPathEntranceRoute5TextPointers: dw UndergroundPathEntranceRoute5Text1 -UndergroundPathEntranceRoute5Text1: ; 5d6b2 (17:56b2) +UndergroundPathEntranceRoute5Text1: TX_ASM ld a, $9 ld [wWhichTrade], a diff --git a/scripts/undergroundpathentranceroute6.asm b/scripts/undergroundpathentranceroute6.asm index 6d356fec..c6dfdcc9 100755 --- a/scripts/undergroundpathentranceroute6.asm +++ b/scripts/undergroundpathentranceroute6.asm @@ -1,11 +1,11 @@ -UndergroundPathEntranceRoute6Script: ; 5d6ef (17:56ef) +UndergroundPathEntranceRoute6Script: ld a, ROUTE_6 ld [wLastMap], a jp EnableAutoTextBoxDrawing -UndergroundPathEntranceRoute6TextPointers: ; 5d6f7 (17:56f7) +UndergroundPathEntranceRoute6TextPointers: dw UndergroundPathEntranceRoute6Text1 -UndergroundPathEntranceRoute6Text1: ; 5d6f9 (17:56f9) +UndergroundPathEntranceRoute6Text1: TX_FAR _UndergrdTunnelEntRoute6Text1 db "@" diff --git a/scripts/undergroundpathentranceroute7.asm b/scripts/undergroundpathentranceroute7.asm index c188a823..84c8e4d5 100755 --- a/scripts/undergroundpathentranceroute7.asm +++ b/scripts/undergroundpathentranceroute7.asm @@ -1,11 +1,11 @@ -UndergroundPathEntranceRoute7Script: ; 5d72c (17:572c) +UndergroundPathEntranceRoute7Script: ld a, ROUTE_7 ld [wLastMap], a jp EnableAutoTextBoxDrawing -UndergroundPathEntranceRoute7TextPointers: ; 5d734 (17:5734) +UndergroundPathEntranceRoute7TextPointers: dw UndergroundPathEntranceRoute7Text1 -UndergroundPathEntranceRoute7Text1: ; 5d736 (17:5736) +UndergroundPathEntranceRoute7Text1: TX_FAR _UndergroundPathEntRoute7Text1 db "@" diff --git a/scripts/undergroundpathentranceroute7copy.asm b/scripts/undergroundpathentranceroute7copy.asm index d94c9f37..c623eeec 100755 --- a/scripts/undergroundpathentranceroute7copy.asm +++ b/scripts/undergroundpathentranceroute7copy.asm @@ -1,24 +1,24 @@ -UndergroundPathEntranceRoute7CopyScript: ; 5d769 (17:5769) +UndergroundPathEntranceRoute7CopyScript: ld a, ROUTE_7 ld [wLastMap], a ret -UndergroundPathEntranceRoute7CopyTextPointers: ; 5d76f (17:576f) +UndergroundPathEntranceRoute7CopyTextPointers: dw UGPathRoute7EntranceUnusedText_5d773 dw UGPathRoute7EntranceUnusedText_5d77d -UGPathRoute7EntranceUnusedText_5d773: ; 5d773 (17:5773) +UGPathRoute7EntranceUnusedText_5d773: TX_FAR _UGPathRoute7EntranceUnusedText_5d773 db "@" -UGPathRoute7EntranceUnusedText_5d778: ; 5d778 (17:5778) +UGPathRoute7EntranceUnusedText_5d778: TX_FAR _UGPathRoute7EntranceUnusedText_5d778 db "@" -UGPathRoute7EntranceUnusedText_5d77d: ; 5d77d (17:577d) +UGPathRoute7EntranceUnusedText_5d77d: TX_FAR _UGPathRoute7EntranceUnusedText_5d77d db "@" -UGPathRoute7EntranceUnusedText_5d782: ; 5d782 (17:5782) +UGPathRoute7EntranceUnusedText_5d782: TX_FAR _UGPathRoute7EntranceUnusedText_5d782 db "@" diff --git a/scripts/undergroundpathentranceroute8.asm b/scripts/undergroundpathentranceroute8.asm index 873cf902..ad0b60ab 100755 --- a/scripts/undergroundpathentranceroute8.asm +++ b/scripts/undergroundpathentranceroute8.asm @@ -1,11 +1,11 @@ -UndergroundPathEntranceRoute8Script: ; 1e289 (7:6289) +UndergroundPathEntranceRoute8Script: ld a, ROUTE_8 ld [wLastMap], a jp EnableAutoTextBoxDrawing -UndergroundPathEntranceRoute8TextPointers: ; 1e291 (7:6291) +UndergroundPathEntranceRoute8TextPointers: dw UndergroundPathEntranceRoute8Text1 -UndergroundPathEntranceRoute8Text1: ; 1e293 (7:6293) +UndergroundPathEntranceRoute8Text1: TX_FAR _UndergroundPathEntRoute8Text1 db "@" diff --git a/scripts/undergroundpathns.asm b/scripts/undergroundpathns.asm index 96bf82a6..8c744740 100755 --- a/scripts/undergroundpathns.asm +++ b/scripts/undergroundpathns.asm @@ -1,5 +1,5 @@ -UndergroundPathNSScript: ; 61f26 (18:5f26) +UndergroundPathNSScript: jp EnableAutoTextBoxDrawing -UndergroundPathNSTextPointers: ; 61f29 (18:5f29) +UndergroundPathNSTextPointers: db "@" diff --git a/scripts/undergroundpathwe.asm b/scripts/undergroundpathwe.asm index f7e3755e..921d3dab 100755 --- a/scripts/undergroundpathwe.asm +++ b/scripts/undergroundpathwe.asm @@ -1,5 +1,5 @@ -UndergroundPathWEScript: ; 61f4a (18:5f4a) +UndergroundPathWEScript: jp EnableAutoTextBoxDrawing -UndergroundPathWETextPointers: ; 61f4d (18:5f4d) +UndergroundPathWETextPointers: db "@" diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index 0e33efb9..b73797bb 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -1,6 +1,6 @@ -VermilionCityScript: ; 197a1 (6:57a1) +VermilionCityScript: call EnableAutoTextBoxDrawing - ld hl, wPreventBlackout + ld hl, wd492 res 7, [hl] ld hl, wCurrentMapScriptFlags bit 6, [hl] @@ -25,7 +25,7 @@ VermilionCityScript_19869: SetEventReuseHL EVENT_152 ret -VermilionCityScript_197c0: ; 197c0 (6:57c0) +VermilionCityScript_197c0: call Random ld a, [hRandomAdd] ld b, a @@ -35,7 +35,7 @@ VermilionCityScript_197c0: ; 197c0 (6:57c0) ld [wFirstLockTrashCanIndex], a ret -VermilionCityScript_197cb: ; 197cb (6:57cb) +VermilionCityScript_197cb: CheckEventHL EVENT_SS_ANNE_LEFT ret z CheckEventReuseHL EVENT_WALKED_PAST_GUARD_AFTER_SS_ANNE_LEFT @@ -45,15 +45,15 @@ VermilionCityScript_197cb: ; 197cb (6:57cb) ld [wVermilionCityCurScript], a ret -VermilionCityScriptPointers: ; 197dc (6:57dc) +VermilionCityScriptPointers: dw VermilionCityScript0 dw VermilionCityScript1 dw VermilionCityScript2 dw VermilionCityScript3 dw VermilionCityScript4 -VermilionCityScript0: ; 197e6 (6:57e6) - ld a, [wSpriteStateData1 + 9] +VermilionCityScript0: + ld a, [wPlayerFacingDirection] and a ; cp SPRITE_FACING_DOWN jr nz, .asm_198de ld hl, CoordsData_19823 @@ -85,11 +85,11 @@ VermilionCityScript0: ; 197e6 (6:57e6) .asm_198de ret -CoordsData_19823: ; 19823 (6:5823) +CoordsData_19823: db $1e,$12 db $ff -VermilionCityScript4: ; 19826 (6:5826) +VermilionCityScript4: ld hl, CoordsData_19823 call ArePlayerCoordsInArray ret c @@ -97,7 +97,7 @@ VermilionCityScript4: ; 19826 (6:5826) ld [wVermilionCityCurScript], a ret -VermilionCityScript2: ; 19833 (6:5833) +VermilionCityScript2: ld a, $ff ld [wJoyIgnore], a ld a, D_UP @@ -110,7 +110,7 @@ VermilionCityScript2: ; 19833 (6:5833) ld [wVermilionCityCurScript], a ret -VermilionCityScript3: ; 1984e (6:584e) +VermilionCityScript3: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -121,7 +121,7 @@ VermilionCityScript3: ; 1984e (6:584e) ld [wVermilionCityCurScript], a ret -VermilionCityScript1: ; 1985f (6:585f) +VermilionCityScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -131,7 +131,7 @@ VermilionCityScript1: ; 1985f (6:585f) ld [wVermilionCityCurScript], a ret -VermilionCityTextPointers: ; 1986f (6:586f) +VermilionCityTextPointers: dw VermilionCityText1 dw VermilionCityText2 dw VermilionCityText3 @@ -147,11 +147,11 @@ VermilionCityTextPointers: ; 1986f (6:586f) dw VermilionCityText13 dw VermilionCityText14 -VermilionCityText1: ; 19889 (6:5889) +VermilionCityText1: TX_FAR _VermilionCityText1 db "@" -VermilionCityText2: ; 1988e (6:588e) +VermilionCityText2: TX_ASM CheckEvent EVENT_SS_ANNE_LEFT jr nz, .asm_1989e @@ -164,19 +164,19 @@ VermilionCityText2: ; 1988e (6:588e) .asm_198a4 jp TextScriptEnd -VermilionCityText_198a7: ; 198a7 (6:58a7) +VermilionCityText_198a7: TX_FAR _VermilionCityText_198a7 db "@" -VermilionCityText_198ac: ; 198ac (6:58ac) +VermilionCityText_198ac: TX_FAR _VermilionCityText_198ac db "@" -VermilionCityText3: ; 198b1 (6:58b1) +VermilionCityText3: TX_ASM CheckEvent EVENT_SS_ANNE_LEFT jr nz, .asm_198f6 - ld a, [wSpriteStateData1 + 9] + ld a, [wPlayerFacingDirection] cp SPRITE_FACING_RIGHT jr z, .asm_198c8 ld hl, VermilionCityCoords1 @@ -209,36 +209,36 @@ VermilionCityText3: ; 198b1 (6:58b1) .asm_198fc jp TextScriptEnd -VermilionCityCoords1: ; 198ff (6:58ff) +VermilionCityCoords1: db $1d,$13 db $1f,$13 db $ff -SSAnneWelcomeText4: ; 19904 (6:5904) +SSAnneWelcomeText4: TX_FAR _SSAnneWelcomeText4 db "@" -SSAnneWelcomeText9: ; 19909 (6:5909) +SSAnneWelcomeText9: TX_FAR _SSAnneWelcomeText9 db "@" -SSAnneFlashedTicketText: ; 1990e (6:590e) +SSAnneFlashedTicketText: TX_FAR _SSAnneFlashedTicketText db "@" -SSAnneNoTicketText: ; 19913 (6:5913) +SSAnneNoTicketText: TX_FAR _SSAnneNoTicketText db "@" -SSAnneNotHereText: ; 19918 (6:5918) +SSAnneNotHereText: TX_FAR _SSAnneNotHereText db "@" -VermilionCityText4: ; 1991d (6:591d) +VermilionCityText4: TX_FAR _VermilionCityText4 db "@" -VermilionCityText5: ; 19922 (6:5922) +VermilionCityText5: TX_FAR _VermilionCityText5 TX_ASM ld a, MACHOP @@ -247,20 +247,20 @@ VermilionCityText5: ; 19922 (6:5922) ld hl, VermilionCityText15 ret -VermilionCityText15: ; 19933 (6:5933) +VermilionCityText15: TX_FAR _VermilionCityText15 db "@" -VermilionCityText6: ; 19938 (6:5938) +VermilionCityText6: TX_FAR _VermilionCityText6 db "@" -VermilionCityText8: ; 1993d (6:593d) +VermilionCityText8: TX_ASM callba Func_f1a8a jp TextScriptEnd -VermilionCityText9: ; 19942 (6:5942) +VermilionCityText9: TX_ASM callba Func_f1a96 jp TextScriptEnd @@ -270,17 +270,17 @@ VermilionCityText12: callba Func_f1aa2 jp TextScriptEnd -VermilionCityText13: ; 19947 (6:5947) +VermilionCityText13: TX_ASM callba Func_f1aae jp TextScriptEnd -VermilionCityText14: ; 1994c (6:594c) +VermilionCityText14: TX_ASM callba Func_f1aba jp TextScriptEnd -VermilionCityText7: ; 19951 (6:5951) +VermilionCityText7: TX_ASM callba Func_f1a0f jp TextScriptEnd diff --git a/scripts/vermiliondock.asm b/scripts/vermiliondock.asm index cef1766e..e1378db3 100755 --- a/scripts/vermiliondock.asm +++ b/scripts/vermiliondock.asm @@ -1,4 +1,4 @@ -VermilionDockScript: ; 1db52 (7:5b52) +VermilionDockScript: call EnableAutoTextBoxDrawing CheckEventHL EVENT_STARTED_WALKING_OUT_OF_DOCK jr nz, .asm_1db8d @@ -36,7 +36,7 @@ VermilionDockScript: ; 1db52 (7:5b52) SetEventReuseHL EVENT_WALKED_OUT_OF_DOCK ret -VermilionDock_1db9b: ; 1db9b (7:5b9b) +VermilionDock_1db9b: SetEventForceReuseHL EVENT_SS_ANNE_LEFT ld a, $ff ld [wJoyIgnore], a @@ -121,7 +121,7 @@ VermilionDock_1db9b: ; 1db9b (7:5b9b) dec [hl] ret -VermilionDock_AnimSmokePuffDriftRight: ; 1dc42 (7:5c42) +VermilionDock_AnimSmokePuffDriftRight: push bc push de ld hl, wOAMBuffer + 4 * $4 + 1 ; x coord @@ -139,7 +139,7 @@ VermilionDock_AnimSmokePuffDriftRight: ; 1dc42 (7:5c42) pop bc ret -VermilionDock_EmitSmokePuff: ; 1dc59 (7:5c59) +VermilionDock_EmitSmokePuff: ; new smoke puff above the S.S. Anne's front smokestack ld a, [wSSAnneSmokeX] sub 16 @@ -154,13 +154,13 @@ VermilionDock_EmitSmokePuff: ; 1dc59 (7:5c59) call WriteOAMBlock ret -VermilionDockOAMBlock: ; 1dc74 (7:5c74) +VermilionDockOAMBlock: db $fc, $10 db $fd, $10 db $fe, $10 db $ff, $10 -VermilionDock_1dc7c: ; 1dc7c (7:5c7c) +VermilionDock_1dc7c: ld h, d ld l, $50 call .asm_1dc86 @@ -178,7 +178,7 @@ VermilionDock_1dc7c: ; 1dc7c (7:5c7c) jr z, .asm_1dc8e ret -VermilionDock_EraseSSAnne: ; 1dc94 (7:5c94) +VermilionDock_EraseSSAnne: ; Fill the area the S.S. Anne occupies in BG map 0 with water tiles. ld hl, wVermilionDockTileMapBuffer ld bc, (5 * BG_MAP_WIDTH) + SCREEN_WIDTH @@ -207,9 +207,9 @@ VermilionDock_EraseSSAnne: ; 1dc94 (7:5c94) call DelayFrames ret -VermilionDockTextPointers: ; 1dcbf (7:5cbf) +VermilionDockTextPointers: dw VermilionDockText1 -VermilionDockText1: ; 1dcc1 (7:5cc1) +VermilionDockText1: TX_FAR _VermilionDockText1 db "@" diff --git a/scripts/vermiliongym.asm b/scripts/vermiliongym.asm index cd2b5b3c..41ca1e53 100755 --- a/scripts/vermiliongym.asm +++ b/scripts/vermiliongym.asm @@ -16,18 +16,18 @@ VermilionGymScript: ; 5ca26 (17:4a26) ld [wVermilionGymCurScript], a ret -VermilionGymScript_5ca4c: ; 5ca4c (17:4a4c) +VermilionGymScript_5ca4c: ld hl, Gym3CityName ld de, Gym3LeaderName jp LoadGymLeaderAndCityName -Gym3CityName: ; 5ca55 (17:4a55) +Gym3CityName: db "VERMILION CITY@" -Gym3LeaderName: ; 5ca64 (17:4a64) +Gym3LeaderName: db "LT.SURGE@" -VermilionGymScript_5ca6d: ; 5ca6d (17:4a6d) +VermilionGymScript_5ca6d: CheckEvent EVENT_2ND_LOCK_OPENED jr nz, .asm_5ca78 ld a, $24 @@ -41,27 +41,27 @@ VermilionGymScript_5ca6d: ; 5ca6d (17:4a6d) lb bc, 2, 2 predef_jump ReplaceTileBlock -VermilionGymScript_5ca8a: ; 5ca8a (17:4a8a) +VermilionGymScript_5ca8a: xor a ld [wJoyIgnore], a ld [wVermilionGymCurScript], a ld [wCurMapScript], a ret -VermilionGymScriptPointers: ; 5ca95 (17:4a95) +VermilionGymScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw VermilionGymScript3 -VermilionGymScript3: ; 5ca9d (17:4a9d) +VermilionGymScript3: ld a, [wIsInBattle] cp $ff jp z, VermilionGymScript_5ca8a ld a, $f0 ld [wJoyIgnore], a -VermilionGymScript_5caaa: ; 5caaa (17:4aaa) +VermilionGymScript_5caaa: ld a, $6 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -89,7 +89,7 @@ VermilionGymScript_5caaa: ; 5caaa (17:4aaa) jp VermilionGymScript_5ca8a -VermilionGymTextPointers: ; 5cae8 (17:4ae8) +VermilionGymTextPointers: dw VermilionGymText1 dw VermilionGymText2 dw VermilionGymText3 @@ -99,8 +99,8 @@ VermilionGymTextPointers: ; 5cae8 (17:4ae8) dw VermilionGymText7 dw VermilionGymText8 -VermilionGymTrainerHeaders: ; 5caf8 (17:4af8) -VermilionGymTrainerHeader0: ; 5caf8 (17:4af8) +VermilionGymTrainerHeaders: +VermilionGymTrainerHeader0: dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_0 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_0 @@ -109,7 +109,7 @@ VermilionGymTrainerHeader0: ; 5caf8 (17:4af8) dw VermilionGymEndBattleText1 ; TextEndBattle dw VermilionGymEndBattleText1 ; TextEndBattle -VermilionGymTrainerHeader1: ; 5cb04 (17:4b04) +VermilionGymTrainerHeader1: dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_1 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_1 @@ -118,7 +118,7 @@ VermilionGymTrainerHeader1: ; 5cb04 (17:4b04) dw VermilionGymEndBattleText2 ; TextEndBattle dw VermilionGymEndBattleText2 ; TextEndBattle -VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) +VermilionGymTrainerHeader2: dbEventFlagBit EVENT_BEAT_VERMILION_GYM_TRAINER_2 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VERMILION_GYM_TRAINER_2 @@ -129,7 +129,7 @@ VermilionGymTrainerHeader2: ; 5cb10 (17:4b10) db $ff -VermilionGymText1: ; 5cb1d (17:4b1d) +VermilionGymText1: TX_ASM CheckEvent EVENT_BEAT_LT_SURGE jr z, .asm_5cb39 @@ -165,87 +165,87 @@ VermilionGymText1: ; 5cb1d (17:4b1d) .asm_5cb6a jp TextScriptEnd -VermilionGymText_5cb6d: ; 5cb6d (17:4b6d) +VermilionGymText_5cb6d: TX_FAR _VermilionGymText_5cb6d db "@" -VermilionGymText_5cb72: ; 5cb72 (17:4b72) +VermilionGymText_5cb72: TX_FAR _VermilionGymText_5cb72 db "@" -VermilionGymText6: ; 5cb77 (17:4b77) +VermilionGymText6: TX_FAR _VermilionGymText_5cb77 db "@" -VermilionGymText7: ; 5cb7c (17:4b7c) +VermilionGymText7: TX_FAR _ReceivedTM24Text db $11 TX_FAR _TM24ExplanationText db "@" -VermilionGymText8: ; 5cb86 (17:4b86) +VermilionGymText8: TX_FAR _TM24NoRoomText db "@" -ReceivedThunderbadgeText: ; 5cb8b (17:4b8b) +ReceivedThunderbadgeText: TX_FAR _ReceivedThunderbadgeText db "@" -VermilionGymText2: ; 5cb90 (17:4b90) +VermilionGymText2: TX_ASM ld hl, VermilionGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd -VermilionGymBattleText1: ; 5cb9a (17:4b9a) +VermilionGymBattleText1: TX_FAR _VermilionGymBattleText1 db "@" -VermilionGymEndBattleText1: ; 5cb9f (17:4b9f) +VermilionGymEndBattleText1: TX_FAR _VermilionGymEndBattleText1 db "@" -VermilionGymAfterBattleText1: ; 5cba4 (17:4ba4) +VermilionGymAfterBattleText1: TX_FAR _VermilionGymAfterBattleText1 db "@" -VermilionGymText3: ; 5cba9 (17:4ba9) +VermilionGymText3: TX_ASM ld hl, VermilionGymTrainerHeader1 call TalkToTrainer jp TextScriptEnd -VermilionGymBattleText2: ; 5cbb3 (17:4bb3) +VermilionGymBattleText2: TX_FAR _VermilionGymBattleText2 db "@" -VermilionGymEndBattleText2: ; 5cbb8 (17:4bb8) +VermilionGymEndBattleText2: TX_FAR _VermilionGymEndBattleText2 db "@" -VermilionGymAfterBattleText2: ; 5cbbd (17:4bbd) +VermilionGymAfterBattleText2: TX_FAR _VermilionGymAfterBattleText2 db "@" -VermilionGymText4: ; 5cbc2 (17:4bc2) +VermilionGymText4: TX_ASM ld hl, VermilionGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd -VermilionGymBattleText3: ; 5cbcc (17:4bcc) +VermilionGymBattleText3: TX_FAR _VermilionGymBattleText3 db "@" -VermilionGymEndBattleText3: ; 5cbd1 (17:4bd1) +VermilionGymEndBattleText3: TX_FAR _VermilionGymEndBattleText3 db "@" -VermilionGymAfterBattleText3: ; 5cbd6 (17:4bd6) +VermilionGymAfterBattleText3: TX_FAR _VermilionGymAfterBattleText3 db "@" -VermilionGymText5: ; 5cbdb (17:4bdb) +VermilionGymText5: TX_ASM ld a, [wBeatGymFlags] bit 2, a @@ -259,10 +259,10 @@ VermilionGymText5: ; 5cbdb (17:4bdb) .asm_5cbf1 jp TextScriptEnd -VermilionGymText_5cbf4: ; 5cbf4 (17:4bf4) +VermilionGymText_5cbf4: TX_FAR _VermilionGymText_5cbf4 db "@" -VermilionGymText_5cbf9: ; 5cbf9 (17:4bf9) +VermilionGymText_5cbf9: TX_FAR _VermilionGymText_5cbf9 db "@" diff --git a/scripts/vermilionhouse1.asm b/scripts/vermilionhouse1.asm index bfb3da5f..d2dac4ca 100755 --- a/scripts/vermilionhouse1.asm +++ b/scripts/vermilionhouse1.asm @@ -1,17 +1,17 @@ -VermilionHouse1Script: ; 1dafc (7:5afc) +VermilionHouse1Script: call EnableAutoTextBoxDrawing ret -VermilionHouse1TextPointers: ; 1db00 (7:5b00) +VermilionHouse1TextPointers: dw VermilionHouse1Text1 dw VermilionHouse1Text2 dw VermilionHouse1Text3 -VermilionHouse1Text1: ; 1db06 (7:5b06) +VermilionHouse1Text1: TX_FAR _VermilionHouse1Text1 db "@" -VermilionHouse1Text2: ; 1db0b (7:5b0b) +VermilionHouse1Text2: TX_FAR _VermilionHouse1Text2 TX_ASM ld a, PIDGEY @@ -19,6 +19,6 @@ VermilionHouse1Text2: ; 1db0b (7:5b0b) call WaitForSoundToFinish jp TextScriptEnd -VermilionHouse1Text3: ; 1db1b (7:5b1b) +VermilionHouse1Text3: TX_FAR _VermilionHouse1Text3 db "@" diff --git a/scripts/vermilionhouse2.asm b/scripts/vermilionhouse2.asm index f166ebb8..007df5ec 100755 --- a/scripts/vermilionhouse2.asm +++ b/scripts/vermilionhouse2.asm @@ -1,10 +1,10 @@ -VermilionHouse2Script: ; 56070 (15:6070) +VermilionHouse2Script: jp EnableAutoTextBoxDrawing -VermilionHouse2TextPointers: ; 56073 (15:6073) +VermilionHouse2TextPointers: dw VermilionHouse2Text1 -VermilionHouse2Text1: ; 56075 (15:6075) +VermilionHouse2Text1: TX_ASM ld a, [wd728] bit 3, a @@ -34,24 +34,24 @@ VermilionHouse2Text1: ; 56075 (15:6075) call PrintText jp TextScriptEnd -VermilionHouse2Text_560b1: ; 560b1 (15:60b1) +VermilionHouse2Text_560b1: TX_FAR _VermilionHouse2Text_560b1 db "@" -VermilionHouse2Text_560b6: ; 560b6 (15:60b6) +VermilionHouse2Text_560b6: TX_FAR _VermilionHouse2Text_560b6 db $0B TX_FAR _VermilionHouse2Text_560bb db "@" -VermilionHouse2Text_560c0: ; 560c0 (15:60c0) +VermilionHouse2Text_560c0: TX_FAR _VermilionHouse2Text_560c0 db "@" -VermilionHouse2Text_560c5: ; 560c5 (15:60c5) +VermilionHouse2Text_560c5: TX_FAR _VermilionHouse2Text_560c5 db "@" -VermilionHouse2Text_560ca: ; 560ca (15:60ca) +VermilionHouse2Text_560ca: TX_FAR _VermilionHouse2Text_560ca db "@" diff --git a/scripts/vermilionhouse3.asm b/scripts/vermilionhouse3.asm index fef07152..aeada0d0 100755 --- a/scripts/vermilionhouse3.asm +++ b/scripts/vermilionhouse3.asm @@ -1,9 +1,9 @@ -VermilionHouse3Script: ; 19c12 (6:5c12) +VermilionHouse3Script: jp EnableAutoTextBoxDrawing -VermilionHouse3TextPointers: ; 19c15 (6:5c15) +VermilionHouse3TextPointers: dw VermilionHouse3Text1 -VermilionHouse3Text1: ; 19c17 (6:5c17) +VermilionHouse3Text1: TX_FAR TeachingHMsText db "@" diff --git a/scripts/vermilionmart.asm b/scripts/vermilionmart.asm index 921e7852..ec9f7f18 100755 --- a/scripts/vermilionmart.asm +++ b/scripts/vermilionmart.asm @@ -1,15 +1,15 @@ -VermilionMartScript: ; 5c9e1 (17:49e1) +VermilionMartScript: jp EnableAutoTextBoxDrawing -VermilionMartTextPointers: ; 5c9e4 (17:49e4) +VermilionMartTextPointers: dw VermilionMartText1 dw VermilionMartText2 dw VermilionMartText3 -VermilionMartText2: ; 5c9ea (17:49ea) +VermilionMartText2: TX_FAR _VermilionMartText2 db "@" -VermilionMartText3: ; 5c9ef (17:49ef) +VermilionMartText3: TX_FAR _VermilionMartText3 db "@" diff --git a/scripts/vermilionpokecenter.asm b/scripts/vermilionpokecenter.asm index 72c232b7..15d9dbd9 100755 --- a/scripts/vermilionpokecenter.asm +++ b/scripts/vermilionpokecenter.asm @@ -1,26 +1,26 @@ -VermilionPokecenterScript: ; 5c98f (17:498f) +VermilionPokecenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -VermilionPokecenterTextPointers: ; 5c995 (17:4995) +VermilionPokecenterTextPointers: dw VermilionPokecenterText1 dw VermilionPokecenterText2 dw VermilionPokecenterText3 dw VermilionPokecenterText4 dw VermilionPokecenterText5 -VermilionPokecenterText1: ; 5c99d (17:499d) +VermilionPokecenterText1: TX_POKECENTER_NURSE -VermilionPokecenterText2: ; 5c99e (17:499e) +VermilionPokecenterText2: TX_FAR _VermilionPokecenterText1 db "@" -VermilionPokecenterText3: ; 5c9a3 (17:49a3) +VermilionPokecenterText3: TX_FAR _VermilionPokecenterText3 db "@" -VermilionPokecenterText4: ; 5c9a8 (17:49a8) +VermilionPokecenterText4: TX_CABLE_CLUB_RECEPTIONIST VermilionPokecenterText5: diff --git a/scripts/viridiancity.asm b/scripts/viridiancity.asm index b062111f..5aa1dbbc 100755 --- a/scripts/viridiancity.asm +++ b/scripts/viridiancity.asm @@ -1,31 +1,31 @@ -ViridianCityScript: ; 1902a (6:502a) +ViridianCityScript: call EnableAutoTextBoxDrawing ld hl, ViridianCityScriptPointers ld a, [wViridianCityCurScript] call JumpTable ret -ViridianCityScriptPointers: ; 19037 (6:5037) - dw ViridianCityScript0 ; 1904d - dw ViridianCityScript1 ; 19054 - dw ViridianCityScript2 ; 19057 - dw ViridianCityScript3 ; 190ca - dw ViridianCityScript4 ; 19104 - dw ViridianCityScript5 ; 1913f - dw ViridianCityScript6 ; 1909d - dw ViridianCityScript7 ; 19191 - dw ViridianCityScript8 ; 191a7 - dw ViridianCityScript9 ; 191cf - dw ViridianCityScript10 ; 191f9 +ViridianCityScriptPointers: + dw ViridianCityScript0 + dw ViridianCityScript1 + dw ViridianCityScript2 + dw ViridianCityScript3 + dw ViridianCityScript4 + dw ViridianCityScript5 + dw ViridianCityScript6 + dw ViridianCityScript7 + dw ViridianCityScript8 + dw ViridianCityScript9 + dw ViridianCityScript10 ViridianCityScript0: call ViridianCityScript_1905b call ViridianCityScript_190ab ret -ViridianCityScript1: ; 19054 +ViridianCityScript1: call ViridianCityScript_19162 -ViridianCityScript2: ; 19057 +ViridianCityScript2: call ViridianCityScript_1905b ret @@ -54,14 +54,14 @@ ViridianCityScript_1905b: ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a xor a - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld [wJoyIgnore], a ld [hJoyHeld], a ld a, $6 ld [wViridianCityCurScript], a ret -ViridianCityScript6: ; 1909d +ViridianCityScript6: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -87,7 +87,7 @@ ViridianCityScript_190ab: ld [wViridianCityCurScript], a ret -ViridianCityScript3: ; 190ca +ViridianCityScript3: call ViridianCityScript_190ef call ViridianCityScript_190db ResetEvent EVENT_02F @@ -117,7 +117,7 @@ ViridianCityScript_190ef: ld [$ffee], a ret -ViridianCityScript4: ; 19104 +ViridianCityScript4: call ViridianCityScript_1912a call UpdateSprites call Delay3 @@ -145,7 +145,7 @@ ViridianCityScript_1912a: ld [wSpriteStateData2 + 3 * $10 + 5], a ret -ViridianCityScript5: ; 1913f +ViridianCityScript5: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -161,7 +161,7 @@ ViridianCityScript_1914d: ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a xor a - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld [wJoyIgnore], a ret @@ -180,7 +180,7 @@ ViridianCityScript_19162: ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $8 - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, $8 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -188,7 +188,7 @@ ViridianCityScript_19162: ld [wJoyIgnore], a ret -ViridianCityScript7: ; 19191 +ViridianCityScript7: call ViridianCityScript_190ef call ViridianCityScript_190db SetEvent EVENT_02F @@ -198,7 +198,7 @@ ViridianCityScript7: ; 19191 ld [wViridianCityCurScript], a ret -ViridianCityScript8: ; 191a7 +ViridianCityScript8: call ViridianCityScript_1912a call UpdateSprites call Delay3 @@ -216,7 +216,7 @@ ViridianCityScript8: ; 191a7 ld [wViridianCityCurScript], a ret -ViridianCityScript9: ; 191cf +ViridianCityScript9: ld de, ViridianCityOldManMovementData2 ld a, [wXCoord] cp 19 @@ -242,7 +242,7 @@ ViridianCityOldManMovementData2: db NPC_MOVEMENT_DOWN db $ff -ViridianCityScript10: ; 191f9 +ViridianCityScript10: ld a, [wd730] bit 0, a ret nz @@ -256,22 +256,22 @@ ViridianCityScript10: ; 191f9 ret ViridianCityTextPointers: - dw ViridianCityText_0 ; 19233 - dw ViridianCityText_1 ; 1923f - dw ViridianCityText_2 ; 1924b - dw ViridianCityText_3 ; 19257 - dw ViridianCityText_4 ; 19263 - dw ViridianCityText_5 ; 1926f - dw ViridianCityText_6 ; 1927b - dw ViridianCityText_7 ; 1928c - dw ViridianCityText_8 ; 192b9 - dw ViridianCityText_9 ; 192c5 - dw ViridianCityText_10 ; 192d1 - dw MartSignText ; 23e5 - dw PokeCenterSignText ; 23ea - dw ViridianCityText_11 ; 192dd - dw ViridianCityText_12 ; 192e9 - dw ViridianCityText_13 ; 19287 + dw ViridianCityText_0 + dw ViridianCityText_1 + dw ViridianCityText_2 + dw ViridianCityText_3 + dw ViridianCityText_4 + dw ViridianCityText_5 + dw ViridianCityText_6 + dw ViridianCityText_7 + dw ViridianCityText_8 + dw ViridianCityText_9 + dw ViridianCityText_10 + dw MartSignText + dw PokeCenterSignText + dw ViridianCityText_11 + dw ViridianCityText_12 + dw ViridianCityText_13 ViridianCityText_0: TX_ASM diff --git a/scripts/viridiancity2.asm b/scripts/viridiancity2.asm index 33f4ee2c..532d57d7 100755 --- a/scripts/viridiancity2.asm +++ b/scripts/viridiancity2.asm @@ -207,7 +207,7 @@ ViridianCityText_f19fc: Func_f1a01: ld hl, Data_f1a0a ld b, SPRITE_FACING_RIGHT - call Func_f0a82 + call TryApplyPikachuMovementData ret Data_f1a0a: diff --git a/scripts/viridianforest.asm b/scripts/viridianforest.asm index e0e022dd..b1b2f951 100755 --- a/scripts/viridianforest.asm +++ b/scripts/viridianforest.asm @@ -1,4 +1,4 @@ -ViridianForestScript: ; 6110d (18:510d) +ViridianForestScript: call EnableAutoTextBoxDrawing ld hl, ViridianForestTrainerHeaders ld de, ViridianForestScriptPointers @@ -7,12 +7,12 @@ ViridianForestScript: ; 6110d (18:510d) ld [wViridianForestCurScript], a ret -ViridianForestScriptPointers: ; 61120 (18:5120) +ViridianForestScriptPointers: dw CheckFightingMapTrainers dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle -ViridianForestTextPointers: ; 61126 (18:5126) +ViridianForestTextPointers: dw ViridianForestText1 dw ViridianForestText2 dw ViridianForestText3 @@ -30,8 +30,8 @@ ViridianForestTextPointers: ; 61126 (18:5126) dw ViridianForestText15 dw ViridianForestText16 -ViridianForestTrainerHeaders: ; 61142 (18:5142) -ViridianForestTrainerHeader0: ; 61142 (18:5142) +ViridianForestTrainerHeaders: +ViridianForestTrainerHeader0: dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_0 @@ -40,7 +40,7 @@ ViridianForestTrainerHeader0: ; 61142 (18:5142) dw ViridianForestEndBattleText1 ; TextEndBattle dw ViridianForestEndBattleText1 ; TextEndBattle -ViridianForestTrainerHeader1: ; 6114e (18:514e) +ViridianForestTrainerHeader1: dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_1 @@ -49,7 +49,7 @@ ViridianForestTrainerHeader1: ; 6114e (18:514e) dw ViridianForestEndBattleText2 ; TextEndBattle dw ViridianForestEndBattleText2 ; TextEndBattle -ViridianForestTrainerHeader2: ; 6115a (18:515a) +ViridianForestTrainerHeader2: dbEventFlagBit EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 db ($1 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_FOREST_TRAINER_2 @@ -78,21 +78,21 @@ ViridianForestTrainerHeader4: db $ff -ViridianForestText1: ; 61167 (18:5167) +ViridianForestText1: TX_FAR _ViridianForestText1 db "@" -ViridianForestText2: ; 6116c (18:516c) +ViridianForestText2: TX_ASM ld hl, ViridianForestTrainerHeader0 jr ViridianForestTalkToTrainer -ViridianForestText3: ; 61176 (18:5176) +ViridianForestText3: TX_ASM ld hl, ViridianForestTrainerHeader1 jr ViridianForestTalkToTrainer -ViridianForestText4: ; 61180 (18:5180) +ViridianForestText4: TX_ASM ld hl, ViridianForestTrainerHeader2 jr ViridianForestTalkToTrainer @@ -109,96 +109,96 @@ ViridianForestTalkToTrainer: call TalkToTrainer jp TextScriptEnd -ViridianForestBattleText1: ; 6118a (18:518a) +ViridianForestBattleText1: TX_FAR _ViridianForestBattleText1 db "@" -ViridianForestEndBattleText1: ; 6118f (18:518f) +ViridianForestEndBattleText1: TX_FAR _ViridianForestEndBattleText1 db "@" -ViridianForestAfterBattleText1: ; 61194 (18:5194) +ViridianForestAfterBattleText1: TX_FAR _ViridianFrstAfterBattleText1 db "@" -ViridianForestBattleText2: ; 61199 (18:5199) +ViridianForestBattleText2: TX_FAR _ViridianForestBattleText2 db "@" -ViridianForestEndBattleText2: ; 6119e (18:519e) +ViridianForestEndBattleText2: TX_FAR _ViridianForestEndBattleText2 db "@" -ViridianForestAfterBattleText2: ; 611a3 (18:51a3) +ViridianForestAfterBattleText2: TX_FAR _ViridianFrstAfterBattleText2 db "@" -ViridianForestBattleText3: ; 611a8 (18:51a8) +ViridianForestBattleText3: TX_FAR _ViridianForestBattleText3 db "@" -ViridianForestEndBattleText3: ; 611ad (18:51ad) +ViridianForestEndBattleText3: TX_FAR _ViridianForestEndBattleText3 db "@" -ViridianForestAfterBattleText3: ; 611b2 (18:51b2) +ViridianForestAfterBattleText3: TX_FAR _ViridianFrstAfterBattleText3 db "@" -ViridianForestBattleText4: ; 611a8 (18:51a8) +ViridianForestBattleText4: TX_FAR _ViridianForestBattleTextPikaGirl db "@" -ViridianForestEndBattleText4: ; 611ad (18:51ad) +ViridianForestEndBattleText4: TX_FAR _ViridianForestEndBattleTextPikaGirl db "@" -ViridianForestAfterBattleText4: ; 611b2 (18:51b2) +ViridianForestAfterBattleText4: TX_FAR _ViridianForestAfterBattleTextPikaGirl db "@" -ViridianForestBattleText5: ; 611a8 (18:51a8) +ViridianForestBattleText5: TX_FAR _ViridianForestBattleTextSamurai db "@" -ViridianForestEndBattleText5: ; 611ad (18:51ad) +ViridianForestEndBattleText5: TX_FAR _ViridianForestEndBattleTextSamurai db "@" -ViridianForestAfterBattleText5: ; 611b2 (18:51b2) +ViridianForestAfterBattleText5: TX_FAR _ViridianForestAfterBattleTextSamurai db "@" -ViridianForestText10: ; 611b7 (18:51b7) +ViridianForestText10: TX_FAR _ViridianForestText8 db "@" -ViridianForestText11: ; 611bc (18:51bc) +ViridianForestText11: TX_ASM ld hl, Func_f2528 jp ViridianForestScript_6120d -ViridianForestText12: ; 611c1 (18:51c1) +ViridianForestText12: TX_ASM ld hl, Func_f2534 jp ViridianForestScript_6120d -ViridianForestText13: ; 611c6 (18:51c6) +ViridianForestText13: TX_ASM ld hl, Func_f2540 jp ViridianForestScript_6120d -ViridianForestText14: ; 611cb (18:51cb) +ViridianForestText14: TX_ASM ld hl, Func_f254c jp ViridianForestScript_6120d -ViridianForestText15: ; 611d0 (18:51d0) +ViridianForestText15: TX_ASM ld hl, Func_f2558 jp ViridianForestScript_6120d -ViridianForestText16: ; 611d5 (18:51d5) +ViridianForestText16: TX_ASM ld hl, Func_f2528 ViridianForestScript_6120d diff --git a/scripts/viridianforestentrance.asm b/scripts/viridianforestentrance.asm index dcfa03ba..95db8bbc 100755 --- a/scripts/viridianforestentrance.asm +++ b/scripts/viridianforestentrance.asm @@ -1,15 +1,15 @@ -ViridianForestEntranceScript: ; 5d65c (17:565c) +ViridianForestEntranceScript: call EnableAutoTextBoxDrawing ret -ViridianForestEntranceTextPointers: ; 5d65f (17:565f) +ViridianForestEntranceTextPointers: dw ViridianForestEntranceText1 dw ViridianForestEntranceText2 -ViridianForestEntranceText1: ; 5d663 (17:5663) +ViridianForestEntranceText1: TX_FAR _ViridianForestEntranceText1 db "@" -ViridianForestEntranceText2: ; 5d668 (17:5668) +ViridianForestEntranceText2: TX_FAR _ViridianForestEntranceText2 db "@" diff --git a/scripts/viridianforestexit.asm b/scripts/viridianforestexit.asm index 0d4d4b29..af7a8523 100755 --- a/scripts/viridianforestexit.asm +++ b/scripts/viridianforestexit.asm @@ -1,14 +1,14 @@ -ViridianForestExitScript: ; 5d587 (17:5587) +ViridianForestExitScript: jp EnableAutoTextBoxDrawing -ViridianForestExitTextPointers: ; 5d58a (17:558a) +ViridianForestExitTextPointers: dw ViridianForestExitText1 dw ViridianForestExitText2 -ViridianForestExitText1: ; 5d58e (17:558e) +ViridianForestExitText1: TX_FAR _ViridianForestExitText1 db "@" -ViridianForestExitText2: ; 5d593 (17:5593) +ViridianForestExitText2: TX_FAR _ViridianForestExitText2 db "@" diff --git a/scripts/viridiangym.asm b/scripts/viridiangym.asm index cdbe939b..1557f68a 100755 --- a/scripts/viridiangym.asm +++ b/scripts/viridiangym.asm @@ -1,4 +1,4 @@ -ViridianGymScript: ; 748a3 (1d:48a3) +ViridianGymScript: ld hl, Gym8CityName ld de, Gym8LeaderName call LoadGymLeaderAndCityName @@ -10,26 +10,26 @@ ViridianGymScript: ; 748a3 (1d:48a3) ld [wViridianGymCurScript], a ret -Gym8CityName: ; 748bf (1d:48bf) +Gym8CityName: db "VIRIDIAN CITY@" -Gym8LeaderName: ; 748cd (1d:48cd) +Gym8LeaderName: db "GIOVANNI@" -ViridianGymScript_748d6: ; 748d6 (1d:48d6) +ViridianGymScript_748d6: xor a ld [wJoyIgnore], a ld [wViridianGymCurScript], a ld [wCurMapScript], a ret -ViridianGymScriptPointers: ; 748e1 (1d:48e1) +ViridianGymScriptPointers: dw ViridianGymScript0 dw DisplayEnemyTrainerTextAndStartBattle dw EndTrainerBattle dw ViridianGymScript3 dw ViridianGymScript4 -ViridianGymScript0: ; 748eb (1d:48eb) +ViridianGymScript0: ld a, [wYCoord] ld b, a ld a, [wXCoord] @@ -52,7 +52,7 @@ ViridianGymScript0: ; 748eb (1d:48eb) ;format: ;db y,x ;dw pointer to movement -ViridianGymArrowTilePlayerMovement: ; 74916 (1d:4916) +ViridianGymArrowTilePlayerMovement: db $b,$13 dw ViridianGymArrowMovement1 db $1,$13 @@ -80,43 +80,43 @@ ViridianGymArrowTilePlayerMovement: ; 74916 (1d:4916) db $FF ;format: direction, count -ViridianGymArrowMovement1: ; 74947 (1d:4947) +ViridianGymArrowMovement1: db D_UP,$09,$FF -ViridianGymArrowMovement2: ; 7494a (1d:494a) +ViridianGymArrowMovement2: db D_LEFT,$08,$FF -ViridianGymArrowMovement3: ; 7494d (1d:494d) +ViridianGymArrowMovement3: db D_DOWN,$09,$FF -ViridianGymArrowMovement4: ; 74950 (1d:4950) +ViridianGymArrowMovement4: db D_RIGHT,$06,$FF -ViridianGymArrowMovement5: ; 74953 (1d:4953) +ViridianGymArrowMovement5: db D_DOWN,$02,$FF -ViridianGymArrowMovement6: ; 74956 (1d:4956) +ViridianGymArrowMovement6: db D_DOWN,$07,$FF -ViridianGymArrowMovement7: ; 74959 (1d:4959) +ViridianGymArrowMovement7: db D_RIGHT,$08,$FF -ViridianGymArrowMovement8: ; 7495c (1d:495c) +ViridianGymArrowMovement8: db D_RIGHT,$09,$FF -ViridianGymArrowMovement9: ; 7495f (1d:495f) +ViridianGymArrowMovement9: db D_UP,$08,$FF -ViridianGymArrowMovement10: ; 74962 (1d:4962) +ViridianGymArrowMovement10: db D_UP,$06,$FF -ViridianGymArrowMovement11: ; 74965 (1d:4965) +ViridianGymArrowMovement11: db D_LEFT,$06,$FF -ViridianGymArrowMovement12: ; 74968 (1d:4968) +ViridianGymArrowMovement12: db D_LEFT,$0C,$FF -ViridianGymScript4: ; 7496b (1d:496b) +ViridianGymScript4: ld a, [wSimulatedJoypadStatesIndex] and a jr nz, .asm_74980 @@ -130,13 +130,13 @@ ViridianGymScript4: ; 7496b (1d:496b) .asm_74980 jpba LoadSpinnerArrowTiles -ViridianGymScript3: ; 74988 (1d:4988) +ViridianGymScript3: ld a, [wIsInBattle] cp $ff jp z, ViridianGymScript_748d6 ld a, $f0 ld [wJoyIgnore], a -ViridianGymScript3_74995: ; 74995 (1d:4995) +ViridianGymScript3_74995: ld a, $c ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -168,7 +168,7 @@ ViridianGymScript3_74995: ; 74995 (1d:4995) SetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_BATTLE jp ViridianGymScript_748d6 -ViridianGymTextPointers: ; 749ec (1d:49ec) +ViridianGymTextPointers: dw ViridianGymText1 dw ViridianGymText2 dw ViridianGymText3 @@ -184,8 +184,8 @@ ViridianGymTextPointers: ; 749ec (1d:49ec) dw ViridianGymText13 dw ViridianGymText14 -ViridianGymTrainerHeaders: ; 74a08 (1d:4a08) -ViridianGymTrainerHeader0: ; 74a08 (1d:4a08) +ViridianGymTrainerHeaders: +ViridianGymTrainerHeader0: dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0 @@ -194,7 +194,7 @@ ViridianGymTrainerHeader0: ; 74a08 (1d:4a08) dw ViridianGymEndBattleText1 ; TextEndBattle dw ViridianGymEndBattleText1 ; TextEndBattle -ViridianGymTrainerHeader1: ; 74a14 (1d:4a14) +ViridianGymTrainerHeader1: dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1 @@ -203,7 +203,7 @@ ViridianGymTrainerHeader1: ; 74a14 (1d:4a14) dw ViridianGymEndBattleText2 ; TextEndBattle dw ViridianGymEndBattleText2 ; TextEndBattle -ViridianGymTrainerHeader2: ; 74a20 (1d:4a20) +ViridianGymTrainerHeader2: dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2 @@ -212,7 +212,7 @@ ViridianGymTrainerHeader2: ; 74a20 (1d:4a20) dw ViridianGymEndBattleText3 ; TextEndBattle dw ViridianGymEndBattleText3 ; TextEndBattle -ViridianGymTrainerHeader3: ; 74a2c (1d:4a2c) +ViridianGymTrainerHeader3: dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 db ($2 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_3 @@ -221,7 +221,7 @@ ViridianGymTrainerHeader3: ; 74a2c (1d:4a2c) dw ViridianGymEndBattleText4 ; TextEndBattle dw ViridianGymEndBattleText4 ; TextEndBattle -ViridianGymTrainerHeader4: ; 74a38 (1d:4a38) +ViridianGymTrainerHeader4: dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_4 @@ -230,7 +230,7 @@ ViridianGymTrainerHeader4: ; 74a38 (1d:4a38) dw ViridianGymEndBattleText5 ; TextEndBattle dw ViridianGymEndBattleText5 ; TextEndBattle -ViridianGymTrainerHeader5: ; 74a44 (1d:4a44) +ViridianGymTrainerHeader5: dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_5 @@ -239,7 +239,7 @@ ViridianGymTrainerHeader5: ; 74a44 (1d:4a44) dw ViridianGymEndBattleText6 ; TextEndBattle dw ViridianGymEndBattleText6 ; TextEndBattle -ViridianGymTrainerHeader6: ; 74a50 (1d:4a50) +ViridianGymTrainerHeader6: dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6, 1 db ($3 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_6, 1 @@ -248,7 +248,7 @@ ViridianGymTrainerHeader6: ; 74a50 (1d:4a50) dw ViridianGymEndBattleText7 ; TextEndBattle dw ViridianGymEndBattleText7 ; TextEndBattle -ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) +ViridianGymTrainerHeader7: dbEventFlagBit EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 1 db ($4 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_VIRIDIAN_GYM_TRAINER_7, 1 @@ -259,7 +259,7 @@ ViridianGymTrainerHeader7: ; 74a5c (1d:4a5c) db $ff -ViridianGymText1: ; 74a69 (1d:4a69) +ViridianGymText1: TX_ASM CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI jr z, .asm_6de66 @@ -301,179 +301,179 @@ ViridianGymText1: ; 74a69 (1d:4a69) .asm_6dff7 jp TextScriptEnd -ViridianGymText_74ace: ; 74ace (1d:4ace) +ViridianGymText_74ace: TX_FAR _ViridianGymText_74ace db "@" -ViridianGymText_74ad3: ; 74ad3 (1d:4ad3) +ViridianGymText_74ad3: TX_FAR _ViridianGymText_74ad3 db $0b, "@" -ViridianGymText_74ad9: ; 74ad9 (1d:4ad9) +ViridianGymText_74ad9: TX_FAR _ViridianGymText_74ad9 db $0d, "@" -ViridianGymText12: ; 74adf (1d:4adf) +ViridianGymText12: TX_FAR _ViridianGymText12 db "@" -ViridianGymText13: ; 74ae4 (1d:4ae4) +ViridianGymText13: TX_FAR _ReceivedTM27Text db $0b -TM27ExplanationText: ; 74ae9 (1d:4ae9) +TM27ExplanationText: TX_FAR _TM27ExplanationText db "@" -ViridianGymText14: ; 74aee (1d:4aee) +ViridianGymText14: TX_FAR _TM27NoRoomText db "@" -ViridianGymText2: ; 74af3 (1d:4af3) +ViridianGymText2: TX_ASM ld hl, ViridianGymTrainerHeader0 call TalkToTrainer jp TextScriptEnd -ViridianGymBattleText1: ; 74afd (1d:4afd) +ViridianGymBattleText1: TX_FAR _ViridianGymBattleText1 db "@" -ViridianGymEndBattleText1: ; 74b02 (1d:4b02) +ViridianGymEndBattleText1: TX_FAR _ViridianGymEndBattleText1 db "@" -ViridianGymAfterBattleText1: ; 74b07 (1d:4b07) +ViridianGymAfterBattleText1: TX_FAR _ViridianGymAfterBattleText1 db "@" -ViridianGymText3: ; 74b0c (1d:4b0c) +ViridianGymText3: TX_ASM ld hl, ViridianGymTrainerHeader1 call TalkToTrainer jp TextScriptEnd -ViridianGymBattleText2: ; 74b16 (1d:4b16) +ViridianGymBattleText2: TX_FAR _ViridianGymBattleText2 db "@" -ViridianGymEndBattleText2: ; 74b1b (1d:4b1b) +ViridianGymEndBattleText2: TX_FAR _ViridianGymEndBattleText2 db "@" -ViridianGymAfterBattleText2: ; 74b20 (1d:4b20) +ViridianGymAfterBattleText2: TX_FAR _ViridianGymAfterBattleText2 db "@" -ViridianGymText4: ; 74b25 (1d:4b25) +ViridianGymText4: TX_ASM ld hl, ViridianGymTrainerHeader2 call TalkToTrainer jp TextScriptEnd -ViridianGymBattleText3: ; 74b2f (1d:4b2f) +ViridianGymBattleText3: TX_FAR _ViridianGymBattleText3 db "@" -ViridianGymEndBattleText3: ; 74b34 (1d:4b34) +ViridianGymEndBattleText3: TX_FAR _ViridianGymEndBattleText3 db "@" -ViridianGymAfterBattleText3: ; 74b39 (1d:4b39) +ViridianGymAfterBattleText3: TX_FAR _ViridianGymAfterBattleText3 db "@" -ViridianGymText5: ; 74b3e (1d:4b3e) +ViridianGymText5: TX_ASM ld hl, ViridianGymTrainerHeader3 call TalkToTrainer jp TextScriptEnd -ViridianGymBattleText4: ; 74b48 (1d:4b48) +ViridianGymBattleText4: TX_FAR _ViridianGymBattleText4 db "@" -ViridianGymEndBattleText4: ; 74b4d (1d:4b4d) +ViridianGymEndBattleText4: TX_FAR _ViridianGymEndBattleText4 db "@" -ViridianGymAfterBattleText4: ; 74b52 (1d:4b52) +ViridianGymAfterBattleText4: TX_FAR _ViridianGymAfterBattleText4 db "@" -ViridianGymText6: ; 74b57 (1d:4b57) +ViridianGymText6: TX_ASM ld hl, ViridianGymTrainerHeader4 call TalkToTrainer jp TextScriptEnd -ViridianGymBattleText5: ; 74b61 (1d:4b61) +ViridianGymBattleText5: TX_FAR _ViridianGymBattleText5 db "@" -ViridianGymEndBattleText5: ; 74b66 (1d:4b66) +ViridianGymEndBattleText5: TX_FAR _ViridianGymEndBattleText5 db "@" -ViridianGymAfterBattleText5: ; 74b6b (1d:4b6b) +ViridianGymAfterBattleText5: TX_FAR _ViridianGymAfterBattleText5 db "@" -ViridianGymText7: ; 74b70 (1d:4b70) +ViridianGymText7: TX_ASM ld hl, ViridianGymTrainerHeader5 call TalkToTrainer jp TextScriptEnd -ViridianGymBattleText6: ; 74b7a (1d:4b7a) +ViridianGymBattleText6: TX_FAR _ViridianGymBattleText6 db "@" -ViridianGymEndBattleText6: ; 74b7f (1d:4b7f) +ViridianGymEndBattleText6: TX_FAR _ViridianGymEndBattleText6 db "@" -ViridianGymAfterBattleText6: ; 74b84 (1d:4b84) +ViridianGymAfterBattleText6: TX_FAR _ViridianGymAfterBattleText6 db "@" -ViridianGymText8: ; 74b89 (1d:4b89) +ViridianGymText8: TX_ASM ld hl, ViridianGymTrainerHeader6 call TalkToTrainer jp TextScriptEnd -ViridianGymBattleText7: ; 74b93 (1d:4b93) +ViridianGymBattleText7: TX_FAR _ViridianGymBattleText7 db "@" -ViridianGymEndBattleText7: ; 74b98 (1d:4b98) +ViridianGymEndBattleText7: TX_FAR _ViridianGymEndBattleText7 db "@" -ViridianGymAfterBattleText7: ; 74b9d (1d:4b9d) +ViridianGymAfterBattleText7: TX_FAR _ViridianGymAfterBattleText7 db "@" -ViridianGymText9: ; 74ba2 (1d:4ba2) +ViridianGymText9: TX_ASM ld hl, ViridianGymTrainerHeader7 call TalkToTrainer jp TextScriptEnd -ViridianGymBattleText8: ; 74bac (1d:4bac) +ViridianGymBattleText8: TX_FAR _ViridianGymBattleText8 db "@" -ViridianGymEndBattleText8: ; 74bb1 (1d:4bb1) +ViridianGymEndBattleText8: TX_FAR _ViridianGymEndBattleText8 db "@" -ViridianGymAfterBattleText8: ; 74bb6 (1d:4bb6) +ViridianGymAfterBattleText8: TX_FAR _ViridianGymAfterBattleText8 db "@" -ViridianGymText10: ; 74bbb (1d:4bbb) +ViridianGymText10: TX_ASM CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI jr nz, .asm_1abd1 @@ -486,10 +486,10 @@ ViridianGymText10: ; 74bbb (1d:4bbb) .asm_6064d jp TextScriptEnd -ViridianGymText_74bd4: ; 74bd4 (1d:4bd4) +ViridianGymText_74bd4: TX_FAR _ViridianGymText_74bd4 db "@" -ViridianGymText_74bd9: ; 74bd9 (1d:4bd9) +ViridianGymText_74bd9: TX_FAR _ViridianGymText_74bd9 db "@" diff --git a/scripts/viridianhouse.asm b/scripts/viridianhouse.asm index 61920489..105c8fb6 100755 --- a/scripts/viridianhouse.asm +++ b/scripts/viridianhouse.asm @@ -1,21 +1,21 @@ -ViridianHouseScript: ; 1d58a (7:558a) +ViridianHouseScript: jp EnableAutoTextBoxDrawing -ViridianHouseTextPointers: ; 1d58d (7:558d) +ViridianHouseTextPointers: dw ViridianHouseText1 dw ViridianHouseText2 dw ViridianHouseText3 dw ViridianHouseText4 -ViridianHouseText1: ; 1d595 (7:5595) +ViridianHouseText1: TX_FAR _ViridianHouseText1 db "@" -ViridianHouseText2: ; 1d59a (7:559a) +ViridianHouseText2: TX_FAR _ViridianHouseText2 db "@" -ViridianHouseText3: ; 1d59f (7:559f) +ViridianHouseText3: TX_ASM ld hl, ViridianHouseText_1d5b1 call PrintText @@ -24,10 +24,10 @@ ViridianHouseText3: ; 1d59f (7:559f) call WaitForSoundToFinish jp TextScriptEnd -ViridianHouseText_1d5b1: ; 1d5b1 (7:55b1) +ViridianHouseText_1d5b1: TX_FAR _ViridianHouseText_1d5b1 db "@" -ViridianHouseText4: ; 1d5b6 (7:55b6) +ViridianHouseText4: TX_FAR _ViridianHouseText4 db "@" diff --git a/scripts/viridianmart.asm b/scripts/viridianmart.asm index 18832353..64c0eda0 100755 --- a/scripts/viridianmart.asm +++ b/scripts/viridianmart.asm @@ -1,4 +1,4 @@ -ViridianMartScript: ; 1d46e (7:546e) +ViridianMartScript: call ViridianMartScript_1d47d call EnableAutoTextBoxDrawing ld hl, ViridianMartScriptPointers @@ -6,7 +6,7 @@ ViridianMartScript: ; 1d46e (7:546e) call JumpTable ret -ViridianMartScript_1d47d: ; 1d47d (7:547d) +ViridianMartScript_1d47d: CheckEvent EVENT_OAK_GOT_PARCEL jr nz, .asm_1d489 ld hl, ViridianMartTextPointers @@ -20,12 +20,12 @@ ViridianMartScript_1d47d: ; 1d47d (7:547d) ld [wMapTextPtr+1], a ret -ViridianMartScriptPointers: ; 1d495 (7:5495) +ViridianMartScriptPointers: dw ViridianMartScript0 dw ViridianMartScript1 dw ViridianMartScript2 -ViridianMartScript0: ; 1d49b (7:549b) +ViridianMartScript0: call UpdateSprites ld a, $4 ld [hSpriteIndexOrTextID], a @@ -40,12 +40,12 @@ ViridianMartScript0: ; 1d49b (7:549b) ld [wViridianMarketCurScript], a ret -RLEMovement1d4bb: ; 1d4bb (7:54bb) +RLEMovement1d4bb: db D_LEFT, $01 db D_UP, $02 db $ff -ViridianMartScript1: ; 1d4c0 (7:54c0) +ViridianMartScript1: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -60,7 +60,7 @@ ViridianMartScript1: ; 1d4c0 (7:54c0) ld [wViridianMarketCurScript], a ret -ViridianMartScript2: ; 1d4df (7:54df) +ViridianMartScript2: CheckEventHL EVENT_02D ret z CheckAndSetEventReuseHL EVENT_02C @@ -73,7 +73,7 @@ ViridianMartScript2: ; 1d4df (7:54df) predef ShowObject ret -ViridianMartTextPointers: ; 1d4e0 (7:54e0) +ViridianMartTextPointers: dw ViridianMartText1 dw ViridianMartText2 dw ViridianMartText3 @@ -83,23 +83,23 @@ ViridianMartTextPointers: ; 1d4e0 (7:54e0) dw ViridianMartText2 dw ViridianMartText3 -ViridianMartText1: ; 1d4f0 (7:54f0) +ViridianMartText1: TX_FAR _ViridianMartText1 db "@" -ViridianMartText4: ; 1d4f5 (7:54f5) +ViridianMartText4: TX_FAR _ViridianMartText4 db "@" -ViridianMartText5: ; 1d4fa (7:54fa) +ViridianMartText5: TX_FAR ViridianMartParcelQuestText TX_SFX_KEY_ITEM db "@" -ViridianMartText2: ; 1d500 (7:5500) +ViridianMartText2: TX_FAR _ViridianMartText2 db "@" -ViridianMartText3: ; 1d505 (7:5505) +ViridianMartText3: TX_FAR _ViridianMartText3 db "@" diff --git a/scripts/viridianpokecenter.asm b/scripts/viridianpokecenter.asm index c2e2d283..3bbedf8d 100755 --- a/scripts/viridianpokecenter.asm +++ b/scripts/viridianpokecenter.asm @@ -1,26 +1,26 @@ -ViridianPokeCenterScript: ; 4425d (11:425d) +ViridianPokeCenterScript: call Serial_TryEstablishingExternallyClockedConnection jp EnableAutoTextBoxDrawing -ViridianPokecenterTextPointers: ; 44263 (11:4263) +ViridianPokecenterTextPointers: dw ViridianPokeCenterText1 dw ViridianPokeCenterText2 dw ViridianPokeCenterText3 dw ViridianPokeCenterText4 dw ViridianPokeCenterText5 -ViridianPokeCenterText1: ; 4426b (11:426b) +ViridianPokeCenterText1: TX_POKECENTER_NURSE -ViridianPokeCenterText2: ; 4426c (11:426c) +ViridianPokeCenterText2: TX_FAR _ViridianPokeCenterText1 db "@" -ViridianPokeCenterText3: ; 44271 (11:4271) +ViridianPokeCenterText3: TX_FAR _ViridianPokeCenterText3 db "@" -ViridianPokeCenterText4: ; 44276 (11:4276) +ViridianPokeCenterText4: TX_CABLE_CLUB_RECEPTIONIST ViridianPokeCenterText5: @@ -176,7 +176,6 @@ INCLUDE "text/maps/mt_moon_b2f.asm" INCLUDE "text/maps/ss_anne_1.asm" INCLUDE "text/maps/ss_anne_2.asm" INCLUDE "text/maps/ss_anne_3.asm" -INCLUDE "text/maps/ss_anne_4.asm" INCLUDE "text/maps/ss_anne_5.asm" INCLUDE "text/maps/ss_anne_6.asm" INCLUDE "text/maps/ss_anne_7.asm" @@ -215,8 +214,6 @@ INCLUDE "text/maps/safari_zone_secret_house.asm" INCLUDE "text/maps/safari_zone_rest_house_2.asm" INCLUDE "text/maps/safari_zone_rest_house_3.asm" INCLUDE "text/maps/safari_zone_rest_house_4.asm" -INCLUDE "text/maps/unknown_dungeon_1f.asm" -INCLUDE "text/maps/unknown_dungeon_2f.asm" INCLUDE "text/maps/unknown_dungeon_b1f.asm" INCLUDE "text/maps/victory_road_1f.asm" INCLUDE "text/maps/lance.asm" @@ -226,10 +223,6 @@ INCLUDE "text/maps/lorelei.asm" INCLUDE "text/maps/bruno.asm" INCLUDE "text/maps/agatha.asm" INCLUDE "text/maps/rock_tunnel_b2f.asm" -INCLUDE "text/maps/seafoam_islands_1f.asm" -INCLUDE "text/maps/seafoam_islands_b1f.asm" -INCLUDE "text/maps/seafoam_islands_b2f.asm" -INCLUDE "text/maps/seafoam_islands_b3f.asm" INCLUDE "text/maps/seafoam_islands_b4f.asm" _AIBattleWithdrawText:: @@ -2113,7 +2106,6 @@ INCLUDE "text/maps/viridian_forest_entrance.asm" INCLUDE "text/maps/mt_moon_pokecenter.asm" INCLUDE "text/maps/saffron_gates.asm" INCLUDE "text/maps/daycare.asm" -INCLUDE "text/maps/underground_path_route_5_entrance.asm" INCLUDE "text/maps/underground_path_route_6_entrance.asm" INCLUDE "text/maps/underground_path_route_7_entrance.asm" INCLUDE "text/maps/underground_path_route_7_entrance_unused.asm" diff --git a/text/maps/agatha.asm b/text/maps/agatha.asm index 95b455c8..45a4692d 100644 --- a/text/maps/agatha.asm +++ b/text/maps/agatha.asm @@ -42,4 +42,3 @@ _AgathaDontRunAwayText:: text "Someone's voice:" line "Don't run away!" done - diff --git a/text/maps/bike_shop.asm b/text/maps/bike_shop.asm index 723021a1..1717c552 100644 --- a/text/maps/bike_shop.asm +++ b/text/maps/bike_shop.asm @@ -11,7 +11,7 @@ _BikeShopText_1d815:: line "Do you want it?" done -_BikeShopText_1d81a:: +_BikeShopCantAffordText:: text "Sorry! You can't" line "afford it!" prompt @@ -29,7 +29,7 @@ _BikeShopText_1d824:: line "the BIKE VOUCHER" cont "for a BICYCLE.@@" -_BikeShopText_1d82a:: +_BikeShopComeAgainText:: text "Come back again" line "sometime!" done @@ -68,4 +68,3 @@ _BikeShopText_1d861:: text "Wow. Your BIKE is" line "really cool!" done - diff --git a/text/maps/bills_house.asm b/text/maps/bills_house.asm index 5403ce1a..dd556a7b 100644 --- a/text/maps/bills_house.asm +++ b/text/maps/bills_house.asm @@ -90,4 +90,3 @@ _BillsHouseText_1e8da:: cont "some of my rare" cont "#MON on my PC!" done - diff --git a/text/maps/blues_house.asm b/text/maps/blues_house.asm index 9891ce26..c7db0b2c 100644 --- a/text/maps/blues_house.asm +++ b/text/maps/blues_house.asm @@ -39,4 +39,3 @@ _BluesHouseText3:: text "It's a big map!" line "This is useful!" done - diff --git a/text/maps/bruno.asm b/text/maps/bruno.asm index ddcbdb59..39898eb5 100644 --- a/text/maps/bruno.asm +++ b/text/maps/bruno.asm @@ -35,4 +35,3 @@ _BrunoDontRunAwayText:: text "Someone's voice:" line "Don't run away!" done - diff --git a/text/maps/celadon_city.asm b/text/maps/celadon_city.asm index e126980f..908fcbb4 100644 --- a/text/maps/celadon_city.asm +++ b/text/maps/celadon_city.asm @@ -150,4 +150,3 @@ _CeladonCityText10:: line "CELADON DEPT." cont "STORE!" done - diff --git a/text/maps/celadon_dept_store_1f.asm b/text/maps/celadon_dept_store_1f.asm index cf343206..8d805edc 100644 --- a/text/maps/celadon_dept_store_1f.asm +++ b/text/maps/celadon_dept_store_1f.asm @@ -29,4 +29,3 @@ _CeladonMart1Text3:: text "1F: SERVICE" line " COUNTER" done - diff --git a/text/maps/celadon_dept_store_2f.asm b/text/maps/celadon_dept_store_2f.asm index b1345a05..74869902 100644 --- a/text/maps/celadon_dept_store_2f.asm +++ b/text/maps/celadon_dept_store_2f.asm @@ -20,4 +20,3 @@ _CeladonMart2Text5:: para "2F: TRAINER'S" line " MARKET" done - diff --git a/text/maps/celadon_dept_store_3f.asm b/text/maps/celadon_dept_store_3f.asm index 42c46591..4006a3bb 100644 --- a/text/maps/celadon_dept_store_3f.asm +++ b/text/maps/celadon_dept_store_3f.asm @@ -96,4 +96,3 @@ _TM18NoRoomText:: text "Your pack is full" line "of items!" done - diff --git a/text/maps/celadon_dept_store_4f.asm b/text/maps/celadon_dept_store_4f.asm index 3124e46f..c17483c1 100644 --- a/text/maps/celadon_dept_store_4f.asm +++ b/text/maps/celadon_dept_store_4f.asm @@ -28,4 +28,3 @@ _CeladonMart4Text4:: line "Element STONEs on" cont "sale now!" done - diff --git a/text/maps/celadon_dept_store_5f.asm b/text/maps/celadon_dept_store_5f.asm index a2bb97f6..1871194b 100644 --- a/text/maps/celadon_dept_store_5f.asm +++ b/text/maps/celadon_dept_store_5f.asm @@ -26,4 +26,3 @@ _CeladonMart5Text2:: _CeladonMart5Text5:: text "5F: DRUG STORE" done - diff --git a/text/maps/celadon_dept_store_roof.asm b/text/maps/celadon_dept_store_roof.asm index 0c91b773..319ca3f0 100644 --- a/text/maps/celadon_dept_store_roof.asm +++ b/text/maps/celadon_dept_store_roof.asm @@ -133,4 +133,3 @@ _VendingMachineText6:: _VendingMachineText7:: text "Not thirsty!" done - diff --git a/text/maps/celadon_diner.asm b/text/maps/celadon_diner.asm index 7f69e67f..fd31eb20 100644 --- a/text/maps/celadon_diner.asm +++ b/text/maps/celadon_diner.asm @@ -57,4 +57,3 @@ _CeladonDinerText_491b7:: line "I was going to" cont "win it back..." done - diff --git a/text/maps/celadon_game_corner_1.asm b/text/maps/celadon_game_corner_1.asm index c5108c2e..ad8a82b2 100644 --- a/text/maps/celadon_game_corner_1.asm +++ b/text/maps/celadon_game_corner_1.asm @@ -179,4 +179,3 @@ _CeladonGameCornerText_48f09:: para "A switch behind" line "the poster!?" cont "Let's push it!@@" - diff --git a/text/maps/celadon_game_corner_2.asm b/text/maps/celadon_game_corner_2.asm index 7ee54725..c288464d 100755 --- a/text/maps/celadon_game_corner_2.asm +++ b/text/maps/celadon_game_corner_2.asm @@ -2,4 +2,3 @@ _CeladonGameCornerText_48f19:: text "Oops! Forgot the" line "COIN CASE!" done - diff --git a/text/maps/celadon_gym.asm b/text/maps/celadon_gym.asm index c076196f..99833ee1 100644 --- a/text/maps/celadon_gym.asm +++ b/text/maps/celadon_gym.asm @@ -216,4 +216,3 @@ _CeladonGymAfterBattleText8:: para "Wait 'til next" line "time!" done - diff --git a/text/maps/celadon_hotel.asm b/text/maps/celadon_hotel.asm index c9e8bd8b..f2eb059e 100644 --- a/text/maps/celadon_hotel.asm +++ b/text/maps/celadon_hotel.asm @@ -19,4 +19,3 @@ _CeladonHotelText3:: text "Why did she bring" line "her brother?" done - diff --git a/text/maps/celadon_house.asm b/text/maps/celadon_house.asm index c0bb9532..19e59bd6 100644 --- a/text/maps/celadon_house.asm +++ b/text/maps/celadon_house.asm @@ -20,4 +20,3 @@ _CeladonHouseText3:: para "There's no secret" line "switch behind it!" done - diff --git a/text/maps/celadon_mansion_1f.asm b/text/maps/celadon_mansion_1f.asm index e106eb1c..23123892 100644 --- a/text/maps/celadon_mansion_1f.asm +++ b/text/maps/celadon_mansion_1f.asm @@ -62,4 +62,3 @@ _CeladonMansion1Text12:: para "You're making me" line "jealous!" done - diff --git a/text/maps/celadon_mansion_2f.asm b/text/maps/celadon_mansion_2f.asm index ecb46da6..b2ecb4fa 100644 --- a/text/maps/celadon_mansion_2f.asm +++ b/text/maps/celadon_mansion_2f.asm @@ -2,4 +2,3 @@ _CeladonMansion2Text1:: text "GAME FREAK" line "Meeting Room" done - diff --git a/text/maps/celadon_mansion_3f.asm b/text/maps/celadon_mansion_3f.asm index d4cc4caa..baf86186 100644 --- a/text/maps/celadon_mansion_3f.asm +++ b/text/maps/celadon_mansion_3f.asm @@ -115,4 +115,3 @@ _CeladonMansion3Text8:: text "GAME FREAK" line "Development Room" done - diff --git a/text/maps/celadon_mansion_4f_inside.asm b/text/maps/celadon_mansion_4f_inside.asm index 9749774f..dab81a8d 100644 --- a/text/maps/celadon_mansion_4f_inside.asm +++ b/text/maps/celadon_mansion_4f_inside.asm @@ -8,4 +8,3 @@ _CeladonMansion5Text1:: line "your friends and" cont "trade #MON!" done - diff --git a/text/maps/celadon_mansion_4f_outside.asm b/text/maps/celadon_mansion_4f_outside.asm index 7053d74a..c8fd7ec8 100644 --- a/text/maps/celadon_mansion_4f_outside.asm +++ b/text/maps/celadon_mansion_4f_outside.asm @@ -1,4 +1,3 @@ _CeladonMansion4Text1:: text "I KNOW EVERYTHING!" done - diff --git a/text/maps/celadon_pokecenter.asm b/text/maps/celadon_pokecenter.asm index 32fa7a6a..a04f51c9 100644 --- a/text/maps/celadon_pokecenter.asm +++ b/text/maps/celadon_pokecenter.asm @@ -10,4 +10,3 @@ _CeladonPokecenterText3:: line "CYCLING ROAD from" cont "FUCHSIA!" done - diff --git a/text/maps/celadon_prize_room.asm b/text/maps/celadon_prize_room.asm index 3f96fdfb..6b2bb537 100644 --- a/text/maps/celadon_prize_room.asm +++ b/text/maps/celadon_prize_room.asm @@ -10,4 +10,3 @@ _CeladonPrizeRoomText2:: text "I had a major" line "haul today!" done - diff --git a/text/maps/cerulean_badge_house_1.asm b/text/maps/cerulean_badge_house_1.asm index 9b0066a1..4bba10cd 100644 --- a/text/maps/cerulean_badge_house_1.asm +++ b/text/maps/cerulean_badge_house_1.asm @@ -66,4 +66,3 @@ _CeruleanHouse2Text_74ea5:: line "use STRENGTH out-" cont "side of battle." prompt - diff --git a/text/maps/cerulean_badge_house_2.asm b/text/maps/cerulean_badge_house_2.asm index 69ea9ca2..e5da0622 100755 --- a/text/maps/cerulean_badge_house_2.asm +++ b/text/maps/cerulean_badge_house_2.asm @@ -26,4 +26,3 @@ _CeruleanHouse2Text_74eb9:: text "All #MON will" line "obey you!" prompt - diff --git a/text/maps/cerulean_city.asm b/text/maps/cerulean_city.asm index 712b332f..4c51c5e0 100644 --- a/text/maps/cerulean_city.asm +++ b/text/maps/cerulean_city.asm @@ -230,4 +230,3 @@ _CeruleanCityText17:: para "The Tomboyish" line "Mermaid!" done - diff --git a/text/maps/cerulean_gym.asm b/text/maps/cerulean_gym.asm index b77831b4..70cbdf0d 100644 --- a/text/maps/cerulean_gym.asm +++ b/text/maps/cerulean_gym.asm @@ -132,4 +132,3 @@ _CeruleanGymText_5c82f:: line "we make a pretty" cont "darn good team!" done - diff --git a/text/maps/cerulean_mart.asm b/text/maps/cerulean_mart.asm index 8ebe0c32..86a74588 100644 --- a/text/maps/cerulean_mart.asm +++ b/text/maps/cerulean_mart.asm @@ -17,4 +17,3 @@ _CeruleanMartText3:: line "make #MON go" cont "up one level!" done - diff --git a/text/maps/cerulean_pokecenter.asm b/text/maps/cerulean_pokecenter.asm index e7933988..497fbce3 100644 --- a/text/maps/cerulean_pokecenter.asm +++ b/text/maps/cerulean_pokecenter.asm @@ -1,4 +1,4 @@ -_CeruleanPokecenterText1:: +_CeruleanPokecenterText2:: text "That BILL!" para "I heard that" @@ -22,4 +22,3 @@ _CeruleanPokecenterText3:: line "to boast about" cont "their #MON?" done - diff --git a/text/maps/cerulean_trashed_house.asm b/text/maps/cerulean_trashed_house.asm index b23f4507..f79540ae 100644 --- a/text/maps/cerulean_trashed_house.asm +++ b/text/maps/cerulean_trashed_house.asm @@ -34,4 +34,3 @@ _CeruleanHouseTrashedText3:: text "TEAM ROCKET left" line "a way out!" done - diff --git a/text/maps/champion.asm b/text/maps/champion.asm index 51258818..3ca7aadf 100644 --- a/text/maps/champion.asm +++ b/text/maps/champion.asm @@ -144,4 +144,3 @@ _GaryText_7612a:: para $52, "!" line "Come with me!" done - diff --git a/text/maps/cinnabar_gym.asm b/text/maps/cinnabar_gym.asm index e795aca4..58873c2a 100644 --- a/text/maps/cinnabar_gym.asm +++ b/text/maps/cinnabar_gym.asm @@ -250,4 +250,3 @@ _CinnabarGymText_7:: text "Come on, answer" line "the question!" done - diff --git a/text/maps/cinnabar_island.asm b/text/maps/cinnabar_island.asm index bd11ff49..54552a46 100644 --- a/text/maps/cinnabar_island.asm +++ b/text/maps/cinnabar_island.asm @@ -35,4 +35,3 @@ _CinnabarIslandText7:: para "The Hot-Headed" line "Quiz Master!" done - diff --git a/text/maps/cinnabar_lab.asm b/text/maps/cinnabar_lab.asm index 74161166..a93a484d 100644 --- a/text/maps/cinnabar_lab.asm +++ b/text/maps/cinnabar_lab.asm @@ -27,4 +27,3 @@ _Lab1Text5:: text "#MON LAB" line "Testing Room" done - diff --git a/text/maps/cinnabar_lab_fossil_room.asm b/text/maps/cinnabar_lab_fossil_room.asm index 38deb1ee..565104b3 100644 --- a/text/maps/cinnabar_lab_fossil_room.asm +++ b/text/maps/cinnabar_lab_fossil_room.asm @@ -76,4 +76,3 @@ _Lab4Text_610bd:: text "Aiyah! You come" line "again!" done - diff --git a/text/maps/cinnabar_lab_metronome_room.asm b/text/maps/cinnabar_lab_metronome_room.asm index b8034889..e2fbb558 100644 --- a/text/maps/cinnabar_lab_metronome_room.asm +++ b/text/maps/cinnabar_lab_metronome_room.asm @@ -61,4 +61,3 @@ _Lab3Text3:: _Lab3Text5:: text "An amber pipe!" done - diff --git a/text/maps/cinnabar_lab_trade_room.asm b/text/maps/cinnabar_lab_trade_room.asm index 3c0a4bfe..196124e7 100644 --- a/text/maps/cinnabar_lab_trade_room.asm +++ b/text/maps/cinnabar_lab_trade_room.asm @@ -7,4 +7,3 @@ _Lab2Text1:: line "rare, prehistoric" cont "#MON!" done - diff --git a/text/maps/cinnabar_mart.asm b/text/maps/cinnabar_mart.asm index 44292ca8..42a41d06 100644 --- a/text/maps/cinnabar_mart.asm +++ b/text/maps/cinnabar_mart.asm @@ -8,4 +8,3 @@ _CinnabarMartText3:: text "It never hurts to" line "have extra items!" done - diff --git a/text/maps/cinnabar_pokecenter.asm b/text/maps/cinnabar_pokecenter.asm index e3e6cca9..301c9740 100644 --- a/text/maps/cinnabar_pokecenter.asm +++ b/text/maps/cinnabar_pokecenter.asm @@ -20,4 +20,3 @@ _CinnabarPokecenterText3:: para "I think it's" line "worth a try!" done - diff --git a/text/maps/copycats_house_2f.asm b/text/maps/copycats_house_2f.asm index 8f59f22f..90833127 100644 --- a/text/maps/copycats_house_2f.asm +++ b/text/maps/copycats_house_2f.asm @@ -94,4 +94,3 @@ _CopycatsHouse2FText_5cd17:: _CopycatsHouse2FText_5cd1c:: text "Huh? Can't see!" done - diff --git a/text/maps/digletts_cave_route_11_entrance.asm b/text/maps/digletts_cave_route_11_entrance.asm index 16cdb562..ecd3225e 100644 --- a/text/maps/digletts_cave_route_11_entrance.asm +++ b/text/maps/digletts_cave_route_11_entrance.asm @@ -6,4 +6,3 @@ _DiglettsCaveEntRoute11Text1:: para "It goes right to" line "VIRIDIAN CITY!" done - diff --git a/text/maps/digletts_cave_route_2_entrance.asm b/text/maps/digletts_cave_route_2_entrance.asm index f6d5589c..a04bbef7 100644 --- a/text/maps/digletts_cave_route_2_entrance.asm +++ b/text/maps/digletts_cave_route_2_entrance.asm @@ -7,4 +7,3 @@ _DiglettsCaveRoute2Text1:: line "FLASH could light" cont "it up..." done - diff --git a/text/maps/fan_club.asm b/text/maps/fan_club.asm index 33d3ca53..5fcd469d 100644 --- a/text/maps/fan_club.asm +++ b/text/maps/fan_club.asm @@ -176,4 +176,3 @@ _FanClubText6:: line "very vocal about" cont "#MON." done - diff --git a/text/maps/fighting_dojo.asm b/text/maps/fighting_dojo.asm index f5cd5101..a6ccc8c3 100644 --- a/text/maps/fighting_dojo.asm +++ b/text/maps/fighting_dojo.asm @@ -128,4 +128,3 @@ _OtherHitmonText:: text "Better not get" line "greedy..." done - diff --git a/text/maps/fuchsia_city.asm b/text/maps/fuchsia_city.asm index a3cec8c4..0392a1ed 100644 --- a/text/maps/fuchsia_city.asm +++ b/text/maps/fuchsia_city.asm @@ -117,4 +117,3 @@ _FuchsiaCityKabutoText:: _FuchsiaCityText_19b2a:: text "..." done - diff --git a/text/maps/fuchsia_fishing_house.asm b/text/maps/fuchsia_fishing_house.asm index 4f0c98b5..195dc8ef 100644 --- a/text/maps/fuchsia_fishing_house.asm +++ b/text/maps/fuchsia_fishing_house.asm @@ -41,4 +41,3 @@ _FuchsiaHouse3Text_5621c:: para "You have no room" line "for my gift!" done - diff --git a/text/maps/fuchsia_house.asm b/text/maps/fuchsia_house.asm index a4b14eb6..7b6556b1 100644 --- a/text/maps/fuchsia_house.asm +++ b/text/maps/fuchsia_house.asm @@ -25,4 +25,3 @@ _FuchsiaHouse1Text3:: para "Did he show you?" done - diff --git a/text/maps/fuchsia_mart.asm b/text/maps/fuchsia_mart.asm index 6764e3a8..574898ce 100644 --- a/text/maps/fuchsia_mart.asm +++ b/text/maps/fuchsia_mart.asm @@ -12,4 +12,3 @@ _FuchsiaMartText3:: cont "up a #MON in" cont "battle!" done - diff --git a/text/maps/fuchsia_meeting_room.asm b/text/maps/fuchsia_meeting_room.asm index 1fa81344..10675ead 100644 --- a/text/maps/fuchsia_meeting_room.asm +++ b/text/maps/fuchsia_meeting_room.asm @@ -24,4 +24,3 @@ _FuchsiaMeetingRoomText3:: para "I think he's got" line "a speech problem!" done - diff --git a/text/maps/fuchsia_pokecenter.asm b/text/maps/fuchsia_pokecenter.asm index 617c3b84..a0def7eb 100644 --- a/text/maps/fuchsia_pokecenter.asm +++ b/text/maps/fuchsia_pokecenter.asm @@ -18,4 +18,3 @@ _FuchsiaPokecenterText3:: cont "The HQ governs" cont "all trainers." done - diff --git a/text/maps/fujis_house.asm b/text/maps/fujis_house.asm index e75d46ea..7c61d1ed 100644 --- a/text/maps/fujis_house.asm +++ b/text/maps/fujis_house.asm @@ -83,4 +83,3 @@ _LavenderHouse1Text6:: para "Gone! It's been" line "clipped out!" done - diff --git a/text/maps/hall_of_fame.asm b/text/maps/hall_of_fame.asm index cbb0e52b..8faefd3f 100644 --- a/text/maps/hall_of_fame.asm +++ b/text/maps/hall_of_fame.asm @@ -26,4 +26,3 @@ _HallofFameRoomText1:: cont "your #MON are" cont "HALL OF FAMERs!" done - diff --git a/text/maps/indigo_plateau_lobby.asm b/text/maps/indigo_plateau_lobby.asm index bfac25c3..86cfb562 100644 --- a/text/maps/indigo_plateau_lobby.asm +++ b/text/maps/indigo_plateau_lobby.asm @@ -23,4 +23,3 @@ _IndigoPlateauLobbyText3:: cont "next trainer!" cont "Good luck!" done - diff --git a/text/maps/lance.asm b/text/maps/lance.asm index beedd955..9c7bd677 100644 --- a/text/maps/lance.asm +++ b/text/maps/lance.asm @@ -61,4 +61,3 @@ _LanceAfterBattleText:: para "He is the real" line "#MON LEAGUE" cont "champion!@@" - diff --git a/text/maps/lavender_house.asm b/text/maps/lavender_house.asm index d92f0c68..66cc85a5 100644 --- a/text/maps/lavender_house.asm +++ b/text/maps/lavender_house.asm @@ -22,4 +22,3 @@ _LavenderHouse2Text_1d9e1:: line "soothed its" cont "restless soul!" done - diff --git a/text/maps/lavender_mart.asm b/text/maps/lavender_mart.asm index 69b8096f..54519890 100644 --- a/text/maps/lavender_mart.asm +++ b/text/maps/lavender_mart.asm @@ -28,4 +28,3 @@ _LavenderMart_5c958:: line "useless, but it" cont "sold for ¥5000!" done - diff --git a/text/maps/lavender_pokecenter.asm b/text/maps/lavender_pokecenter.asm index d982fa75..5ee5b2f5 100644 --- a/text/maps/lavender_pokecenter.asm +++ b/text/maps/lavender_pokecenter.asm @@ -12,4 +12,3 @@ _LavenderPokecenterText3:: cont "to escape from" cont "TEAM ROCKET!" done - diff --git a/text/maps/lavender_town.asm b/text/maps/lavender_town.asm index d3b41ffa..19b6c8c8 100644 --- a/text/maps/lavender_town.asm +++ b/text/maps/lavender_town.asm @@ -62,4 +62,3 @@ _LavenderTownText9:: line "#MON Rest Easy" cont "#MON TOWER" done - diff --git a/text/maps/mansion_1f.asm b/text/maps/mansion_1f.asm index 3ddd5660..a3c517fb 100644 --- a/text/maps/mansion_1f.asm +++ b/text/maps/mansion_1f.asm @@ -27,4 +27,3 @@ _MansionSwitchPressedText:: _MansionSwitchNotPressedText:: text "Not quite yet!" done - diff --git a/text/maps/mansion_2f.asm b/text/maps/mansion_2f.asm index c7e12408..378efb30 100644 --- a/text/maps/mansion_2f.asm +++ b/text/maps/mansion_2f.asm @@ -45,4 +45,3 @@ _Mansion2Text_520c7:: _Mansion2Text_520cc:: text "Not quite yet!" done - diff --git a/text/maps/mansion_3f.asm b/text/maps/mansion_3f.asm index 7e48a844..70331fdf 100644 --- a/text/maps/mansion_3f.asm +++ b/text/maps/mansion_3f.asm @@ -35,4 +35,3 @@ _Mansion3Text5:: para "We named the" line "newborn MEWTWO." done - diff --git a/text/maps/mansion_b1f.asm b/text/maps/mansion_b1f.asm index 78de2abb..1bc1ef89 100644 --- a/text/maps/mansion_b1f.asm +++ b/text/maps/mansion_b1f.asm @@ -37,4 +37,3 @@ _Mansion4Text7:: line "curb its vicious" cont "tendencies..." done - diff --git a/text/maps/mr_psychics_house.asm b/text/maps/mr_psychics_house.asm index 78257980..8c37383d 100644 --- a/text/maps/mr_psychics_house.asm +++ b/text/maps/mr_psychics_house.asm @@ -23,4 +23,3 @@ _TM29NoRoomText:: text "Where do you plan" line "to put this?" done - diff --git a/text/maps/mt_moon_b1f.asm b/text/maps/mt_moon_b1f.asm index 85cdee66..cd995ed5 100644 --- a/text/maps/mt_moon_b1f.asm +++ b/text/maps/mt_moon_b1f.asm @@ -1,4 +1,3 @@ _MtMoonText1:: db $0 done - diff --git a/text/maps/mt_moon_pokecenter.asm b/text/maps/mt_moon_pokecenter.asm index 610ff254..f45c5598 100644 --- a/text/maps/mt_moon_pokecenter.asm +++ b/text/maps/mt_moon_pokecenter.asm @@ -46,4 +46,3 @@ _MtMoonPokecenterText_4936b:: text "MAN: Well, I don't" line "give refunds!" done - diff --git a/text/maps/museum_1f.asm b/text/maps/museum_1f.asm index 71aeee3c..ecb511aa 100644 --- a/text/maps/museum_1f.asm +++ b/text/maps/museum_1f.asm @@ -105,4 +105,3 @@ _Museum1FText_5c2bc:: text "The AMBER is" line "clear and gold!" done - diff --git a/text/maps/name_rater.asm b/text/maps/name_rater.asm index 09878dca..7194a927 100644 --- a/text/maps/name_rater.asm +++ b/text/maps/name_rater.asm @@ -58,4 +58,3 @@ _NameRaterText_1dad1:: TX_RAM wcd6d text "!" done - diff --git a/text/maps/pallet_town.asm b/text/maps/pallet_town.asm index 6eb603a3..741ad529 100644 --- a/text/maps/pallet_town.asm +++ b/text/maps/pallet_town.asm @@ -65,4 +65,3 @@ _PalletTownText6:: _PalletTownText7:: text $53,"'s house " done - diff --git a/text/maps/pewter_city.asm b/text/maps/pewter_city.asm index 0d7c7de7..03dfcc91 100644 --- a/text/maps/pewter_city.asm +++ b/text/maps/pewter_city.asm @@ -115,4 +115,3 @@ _PewterCityText12:: line "A Stone Gray" cont "City" done - diff --git a/text/maps/pewter_house_1.asm b/text/maps/pewter_house_1.asm index 0fe3e165..450e8372 100644 --- a/text/maps/pewter_house_1.asm +++ b/text/maps/pewter_house_1.asm @@ -22,4 +22,3 @@ _PewterHouse1Text3:: para "If only we had" line "some BADGEs..." done - diff --git a/text/maps/pewter_house_2.asm b/text/maps/pewter_house_2.asm index 34ebc90d..615536f7 100644 --- a/text/maps/pewter_house_2.asm +++ b/text/maps/pewter_house_2.asm @@ -17,4 +17,3 @@ _PewterHouse2Text2:: para "But, it's not a" line "sure thing!" done - diff --git a/text/maps/pewter_mart.asm b/text/maps/pewter_mart.asm index 6eda0d88..29a1f597 100644 --- a/text/maps/pewter_mart.asm +++ b/text/maps/pewter_mart.asm @@ -15,4 +15,3 @@ _PewterMartText_74cd5:: cont "diligently, even" cont "the weak ones!" done - diff --git a/text/maps/pokemon_league_gate.asm b/text/maps/pokemon_league_gate.asm index b817ef81..ac92f4b0 100644 --- a/text/maps/pokemon_league_gate.asm +++ b/text/maps/pokemon_league_gate.asm @@ -17,4 +17,3 @@ _Route22GateText_1e71a:: text "Oh! That is the" line "BOULDERBADGE!" cont "Go right ahead!@@" - diff --git a/text/maps/pokemon_tower_1f.asm b/text/maps/pokemon_tower_1f.asm index b9570d18..50a2cd29 100644 --- a/text/maps/pokemon_tower_1f.asm +++ b/text/maps/pokemon_tower_1f.asm @@ -29,4 +29,3 @@ _PokemonTower1Text5:: line "There are spirits" cont "up to mischief!" done - diff --git a/text/maps/pokemon_tower_2f.asm b/text/maps/pokemon_tower_2f.asm index e41112a4..ec2281fd 100644 --- a/text/maps/pokemon_tower_2f.asm +++ b/text/maps/pokemon_tower_2f.asm @@ -55,4 +55,3 @@ _PokemonTower2Text2:: line "might be able to" cont "unmask them." done - diff --git a/text/maps/pokemon_tower_3f.asm b/text/maps/pokemon_tower_3f.asm index 443aecd5..67098e6b 100644 --- a/text/maps/pokemon_tower_3f.asm +++ b/text/maps/pokemon_tower_3f.asm @@ -43,4 +43,3 @@ _PokemonTower3AfterBattleText3:: text "My friends were" line "possessed too!" done - diff --git a/text/maps/pokemon_tower_4f.asm b/text/maps/pokemon_tower_4f.asm index e8fa75b6..771325a0 100644 --- a/text/maps/pokemon_tower_4f.asm +++ b/text/maps/pokemon_tower_4f.asm @@ -43,4 +43,3 @@ _PokemonTower4AfterBattleText3:: line "souls of #MON" cont "rest in peace..." done - diff --git a/text/maps/pokemon_tower_5f.asm b/text/maps/pokemon_tower_5f.asm index bbdc3d84..f2cadfcb 100644 --- a/text/maps/pokemon_tower_5f.asm +++ b/text/maps/pokemon_tower_5f.asm @@ -69,4 +69,3 @@ _PokemonTower5Text7:: para $52, "'s #MON" line "are fully healed!" done - diff --git a/text/maps/pokemon_tower_6f.asm b/text/maps/pokemon_tower_6f.asm index ff8bc73c..7532d56d 100644 --- a/text/maps/pokemon_tower_6f.asm +++ b/text/maps/pokemon_tower_6f.asm @@ -59,4 +59,3 @@ _PokemonTower6Text6:: text "Be gone..." line "Intruders..." done - diff --git a/text/maps/pokemon_tower_7f.asm b/text/maps/pokemon_tower_7f.asm index 31ec248b..652cf37a 100644 --- a/text/maps/pokemon_tower_7f.asm +++ b/text/maps/pokemon_tower_7f.asm @@ -47,4 +47,3 @@ _TowerRescueFujiText:: cont "HOUSE at the foot" cont "of this tower." done - diff --git a/text/maps/power_plant.asm b/text/maps/power_plant.asm index 2ea387d7..e5df6674 100644 --- a/text/maps/power_plant.asm +++ b/text/maps/power_plant.asm @@ -4,4 +4,3 @@ _VoltorbBattleText:: _ZapdosBattleText:: text "Gyaoo!@@" - diff --git a/text/maps/reds_house_1f.asm b/text/maps/reds_house_1f.asm index 9d03f166..e93450da 100644 --- a/text/maps/reds_house_1f.asm +++ b/text/maps/reds_house_1f.asm @@ -40,4 +40,3 @@ _StandByMeText:: _TVWrongSideText:: text "Oops, wrong side." done - diff --git a/text/maps/rock_tunnel_b1f.asm b/text/maps/rock_tunnel_b1f.asm index 88659e8e..472c52f8 100644 --- a/text/maps/rock_tunnel_b1f.asm +++ b/text/maps/rock_tunnel_b1f.asm @@ -113,4 +113,3 @@ _RockTunnel1Text8:: line "CERULEAN CITY -" cont "LAVENDER TOWN" done - diff --git a/text/maps/rock_tunnel_b2f.asm b/text/maps/rock_tunnel_b2f.asm index 82151475..d0437de7 100644 --- a/text/maps/rock_tunnel_b2f.asm +++ b/text/maps/rock_tunnel_b2f.asm @@ -127,4 +127,3 @@ _RockTunnel2AfterBattleText9:: text "I'm an artist," line "not a fighter." done - diff --git a/text/maps/rock_tunnel_pokecenter.asm b/text/maps/rock_tunnel_pokecenter.asm index a5268dd2..ec625e95 100644 --- a/text/maps/rock_tunnel_pokecenter.asm +++ b/text/maps/rock_tunnel_pokecenter.asm @@ -11,4 +11,3 @@ _RockTunnelPokecenterText3:: text "I sold a useless" line "NUGGET for ¥5000!" done - diff --git a/text/maps/rocket_hideout_b1f.asm b/text/maps/rocket_hideout_b1f.asm index 66ac1fbd..36117804 100644 --- a/text/maps/rocket_hideout_b1f.asm +++ b/text/maps/rocket_hideout_b1f.asm @@ -71,4 +71,3 @@ _RocketHideout1AfterBattleTxt6:: text "Uh-oh, that fight" line "opened the door!" done - diff --git a/text/maps/rocket_hideout_b2f.asm b/text/maps/rocket_hideout_b2f.asm index 1b0e9439..c13c3593 100644 --- a/text/maps/rocket_hideout_b2f.asm +++ b/text/maps/rocket_hideout_b2f.asm @@ -15,4 +15,3 @@ _RocketHideout2AfterBattleTxt2:: cont "floors. Can you" cont "reach the BOSS?" done - diff --git a/text/maps/rocket_hideout_b3f.asm b/text/maps/rocket_hideout_b3f.asm index 67bc9c24..a146a383 100644 --- a/text/maps/rocket_hideout_b3f.asm +++ b/text/maps/rocket_hideout_b3f.asm @@ -33,4 +33,3 @@ _RocketHide3AfterBattleText3:: cont "LIFT KEY to run" cont "the elevator!" done - diff --git a/text/maps/rocket_hideout_b4f.asm b/text/maps/rocket_hideout_b4f.asm index 6ff48e6e..d9e13457 100644 --- a/text/maps/rocket_hideout_b4f.asm +++ b/text/maps/rocket_hideout_b4f.asm @@ -63,4 +63,3 @@ _RocketHideout4Text_455ec:: text "Oh no! I dropped" line "the LIFT KEY!" done - diff --git a/text/maps/rocket_hideout_elevator.asm b/text/maps/rocket_hideout_elevator.asm index c2ce930b..6f2aa638 100644 --- a/text/maps/rocket_hideout_elevator.asm +++ b/text/maps/rocket_hideout_elevator.asm @@ -1,4 +1,3 @@ _RocketElevatorText_4578b:: text "It appears to" line "need a key.@@" - diff --git a/text/maps/route_1.asm b/text/maps/route_1.asm index e343ea6f..adffd705 100644 --- a/text/maps/route_1.asm +++ b/text/maps/route_1.asm @@ -47,4 +47,3 @@ _Route1Text3:: line "PALLET TOWN -" cont "VIRIDIAN CITY" done - diff --git a/text/maps/route_10.asm b/text/maps/route_10.asm index c78f6068..a56018f0 100644 --- a/text/maps/route_10.asm +++ b/text/maps/route_10.asm @@ -107,4 +107,3 @@ _Route10Text7:: _Route10Text10:: text "POWER PLANT" done - diff --git a/text/maps/route_11.asm b/text/maps/route_11.asm index 1db6066f..451d2bec 100644 --- a/text/maps/route_11.asm +++ b/text/maps/route_11.asm @@ -160,5 +160,3 @@ _Route11AfterBattleText10:: _Route11Text11:: text "DIGLETT's CAVE" done - - diff --git a/text/maps/route_11_gate.asm b/text/maps/route_11_gate.asm index db9ad871..ef371d06 100644 --- a/text/maps/route_11_gate.asm +++ b/text/maps/route_11_gate.asm @@ -12,4 +12,3 @@ _Route11GateText1:: para "He'll help you" line "rename them too!" done - diff --git a/text/maps/route_11_gate_upstairs.asm b/text/maps/route_11_gate_upstairs.asm index 92eea2fb..10236081 100644 --- a/text/maps/route_11_gate_upstairs.asm +++ b/text/maps/route_11_gate_upstairs.asm @@ -38,4 +38,3 @@ _Route11GateUpstairsText_494d5:: cont "is by way of the" cont "ROCK TUNNEL." done - diff --git a/text/maps/route_12.asm b/text/maps/route_12.asm index cb6479dc..27befda5 100644 --- a/text/maps/route_12.asm +++ b/text/maps/route_12.asm @@ -137,4 +137,3 @@ _Route12Text11:: _Route12Text12:: text "SPORT FISHING AREA" done - diff --git a/text/maps/route_12_gate.asm b/text/maps/route_12_gate.asm index 246c3eac..51d75539 100644 --- a/text/maps/route_12_gate.asm +++ b/text/maps/route_12_gate.asm @@ -2,4 +2,3 @@ _Route12GateText1:: text "There's a lookout" line "spot upstairs." done - diff --git a/text/maps/route_12_gate_upstairs.asm b/text/maps/route_12_gate_upstairs.asm index 6413bc42..a18e3d57 100644 --- a/text/maps/route_12_gate_upstairs.asm +++ b/text/maps/route_12_gate_upstairs.asm @@ -40,4 +40,3 @@ _Route12GateUpstairsText_495c4:: para "It's #MON TOWER!" done - diff --git a/text/maps/route_12_house.asm b/text/maps/route_12_house.asm index 97046b75..4cb4beee 100644 --- a/text/maps/route_12_house.asm +++ b/text/maps/route_12_house.asm @@ -58,4 +58,3 @@ _Route12HouseText_564d9:: line "you, but you have" cont "no room for it!" done - diff --git a/text/maps/route_13.asm b/text/maps/route_13.asm index c7034eb5..e2718919 100644 --- a/text/maps/route_13.asm +++ b/text/maps/route_13.asm @@ -177,4 +177,3 @@ _Route13Text13:: line "North to SILENCE" cont "BRIDGE" done - diff --git a/text/maps/route_14.asm b/text/maps/route_14.asm index 774f3f99..9a9de78c 100644 --- a/text/maps/route_14.asm +++ b/text/maps/route_14.asm @@ -171,4 +171,3 @@ _Route14Text11:: line "West to FUCHSIA" cont "CITY" done - diff --git a/text/maps/route_15.asm b/text/maps/route_15.asm index 1368b3d5..a23b8500 100644 --- a/text/maps/route_15.asm +++ b/text/maps/route_15.asm @@ -169,4 +169,3 @@ _Route15Text12:: line "West to FUCHSIA" cont "CITY" done - diff --git a/text/maps/route_15_gate.asm b/text/maps/route_15_gate.asm index eb4ca6d3..0a526142 100644 --- a/text/maps/route_15_gate.asm +++ b/text/maps/route_15_gate.asm @@ -5,4 +5,3 @@ _Route15GateText1:: para "PROF.OAK's AIDE" line "came by here." done - diff --git a/text/maps/route_15_gate_upstairs.asm b/text/maps/route_15_gate_upstairs.asm index 310ecdba..ade4a358 100644 --- a/text/maps/route_15_gate_upstairs.asm +++ b/text/maps/route_15_gate_upstairs.asm @@ -22,4 +22,3 @@ _Route15GateUpstairsText_49698:: para "It looks like a" line "small island!" done - diff --git a/text/maps/route_16.asm b/text/maps/route_16.asm index 87c26232..2ef6b02a 100644 --- a/text/maps/route_16.asm +++ b/text/maps/route_16.asm @@ -118,4 +118,3 @@ _Route16Text9:: line "CELADON CITY -" cont "FUCHSIA CITY" done - diff --git a/text/maps/route_16_gate.asm b/text/maps/route_16_gate.asm index f4f03e2f..f548977f 100644 --- a/text/maps/route_16_gate.asm +++ b/text/maps/route_16_gate.asm @@ -20,4 +20,3 @@ _Route16GateText2:: text "How'd you get in?" line "Good effort!" done - diff --git a/text/maps/route_16_gate_upstairs.asm b/text/maps/route_16_gate_upstairs.asm index 55a49274..d76b70ca 100644 --- a/text/maps/route_16_gate_upstairs.asm +++ b/text/maps/route_16_gate_upstairs.asm @@ -24,4 +24,3 @@ _Route16GateUpstairsText_49847:: para "There's a long" line "path over water!" done - diff --git a/text/maps/route_16_house.asm b/text/maps/route_16_house.asm index d84faf38..534cee08 100644 --- a/text/maps/route_16_house.asm +++ b/text/maps/route_16_house.asm @@ -29,4 +29,3 @@ _HM02NoRoomText:: _Route16HouseText_1e652:: text "FEAROW: Kyueen!" done - diff --git a/text/maps/route_17.asm b/text/maps/route_17.asm index da774494..f7f59683 100644 --- a/text/maps/route_17.asm +++ b/text/maps/route_17.asm @@ -193,4 +193,3 @@ _Route17Text16:: text "CYCLING ROAD" line "Slope ends here!" done - diff --git a/text/maps/route_18.asm b/text/maps/route_18.asm index 31e921bd..d09caf82 100644 --- a/text/maps/route_18.asm +++ b/text/maps/route_18.asm @@ -56,4 +56,3 @@ _Route18Text5:: line "No pedestrians" cont "permitted!" done - diff --git a/text/maps/route_18_gate.asm b/text/maps/route_18_gate.asm index 964a32e5..f2f51039 100644 --- a/text/maps/route_18_gate.asm +++ b/text/maps/route_18_gate.asm @@ -12,4 +12,3 @@ _Route18GateText_4992d:: _Route18GateText_49932:: text "Excuse me!" done - diff --git a/text/maps/route_18_gate_upstairs.asm b/text/maps/route_18_gate_upstairs.asm index a1778cb6..0fd2de09 100644 --- a/text/maps/route_18_gate_upstairs.asm +++ b/text/maps/route_18_gate_upstairs.asm @@ -13,5 +13,3 @@ _Route18GateUpstairsText_4999f:: para "There are people" line "swimming!" done - - diff --git a/text/maps/route_19.asm b/text/maps/route_19.asm index ae6e7334..244e31d0 100644 --- a/text/maps/route_19.asm +++ b/text/maps/route_19.asm @@ -155,4 +155,3 @@ _Route19Text11:: line "FUCHSIA CITY -" cont "SEAFOAM ISLANDS" done - diff --git a/text/maps/route_2.asm b/text/maps/route_2.asm index 2419abbe..dd7becc0 100644 --- a/text/maps/route_2.asm +++ b/text/maps/route_2.asm @@ -7,4 +7,3 @@ _Route2Text3:: _Route2Text4:: text "DIGLETT's CAVE" done - diff --git a/text/maps/route_20.asm b/text/maps/route_20.asm index c69dec51..1ccf0b6c 100644 --- a/text/maps/route_20.asm +++ b/text/maps/route_20.asm @@ -154,4 +154,3 @@ _Route20Text12:: _Route20Text11:: text "SEAFOAM ISLANDS" done - diff --git a/text/maps/route_21.asm b/text/maps/route_21.asm index d94bdfac..3451953f 100644 --- a/text/maps/route_21.asm +++ b/text/maps/route_21.asm @@ -135,4 +135,3 @@ _Route21AfterBattleText9:: text "Oh wait! I got a" line "bite! Yeah!" done - diff --git a/text/maps/route_22.asm b/text/maps/route_22.asm index f14c8db5..52d1a4c7 100644 --- a/text/maps/route_22.asm +++ b/text/maps/route_22.asm @@ -102,4 +102,3 @@ _Route22FrontGateText:: text "#MON LEAGUE" line "Front Gate" done - diff --git a/text/maps/route_23.asm b/text/maps/route_23.asm index 0807cc91..2ecb020e 100644 --- a/text/maps/route_23.asm +++ b/text/maps/route_23.asm @@ -36,4 +36,3 @@ _Route23Text8:: text "VICTORY ROAD GATE" line "- #MON LEAGUE" done - diff --git a/text/maps/route_25.asm b/text/maps/route_25.asm index f9f0c8ff..4786d830 100644 --- a/text/maps/route_25.asm +++ b/text/maps/route_25.asm @@ -154,4 +154,3 @@ _Route25Text11:: text "SEA COTTAGE" line "BILL lives here!" done - diff --git a/text/maps/route_2_gate.asm b/text/maps/route_2_gate.asm index 6be23d54..566830f8 100644 --- a/text/maps/route_2_gate.asm +++ b/text/maps/route_2_gate.asm @@ -10,4 +10,3 @@ _Route2GateText2:: cont "can get through" cont "ROCK TUNNEL." done - diff --git a/text/maps/route_2_house.asm b/text/maps/route_2_house.asm index 098a8f3e..46fc1062 100644 --- a/text/maps/route_2_house.asm +++ b/text/maps/route_2_house.asm @@ -4,4 +4,3 @@ _Route2HouseText1:: cont "it can still use " cont "moves like CUT!" done - diff --git a/text/maps/route_3.asm b/text/maps/route_3.asm index 049ba9c5..14d44e64 100644 --- a/text/maps/route_3.asm +++ b/text/maps/route_3.asm @@ -143,4 +143,3 @@ _Route3Text10:: text "ROUTE 3" line "MT.MOON AHEAD" done - diff --git a/text/maps/route_4.asm b/text/maps/route_4.asm index e49f1b7a..0a36f4cd 100644 --- a/text/maps/route_4.asm +++ b/text/maps/route_4.asm @@ -33,4 +33,3 @@ _Route4Text6:: line "MT.MOON -" cont "CERULEAN CITY" done - diff --git a/text/maps/route_5.asm b/text/maps/route_5.asm index 4fced687..54ff0f84 100644 --- a/text/maps/route_5.asm +++ b/text/maps/route_5.asm @@ -3,4 +3,3 @@ _Route5Text1:: line "CERULEAN CITY -" cont "VERMILION CITY" done - diff --git a/text/maps/route_6.asm b/text/maps/route_6.asm index 4237fb7d..71760449 100644 --- a/text/maps/route_6.asm +++ b/text/maps/route_6.asm @@ -102,4 +102,3 @@ _Route6Text7:: line "CERULEAN CITY -" cont "VERMILION CITY" done - diff --git a/text/maps/route_7.asm b/text/maps/route_7.asm index 24645b90..6500be96 100644 --- a/text/maps/route_7.asm +++ b/text/maps/route_7.asm @@ -3,4 +3,3 @@ _Route7Text1:: line "CELADON CITY -" cont "LAVENDER TOWN" done - diff --git a/text/maps/route_8.asm b/text/maps/route_8.asm index dc26e193..c0988d70 100644 --- a/text/maps/route_8.asm +++ b/text/maps/route_8.asm @@ -152,4 +152,3 @@ _Route8Text10:: line "CELADON CITY -" cont "LAVENDER TOWN" done - diff --git a/text/maps/safari_zone_center.asm b/text/maps/safari_zone_center.asm index 50ed1e1e..09918f93 100644 --- a/text/maps/safari_zone_center.asm +++ b/text/maps/safari_zone_center.asm @@ -9,4 +9,3 @@ _SafariZoneCenterText3:: line "Button to check" cont "remaining time!" done - diff --git a/text/maps/safari_zone_east.asm b/text/maps/safari_zone_east.asm index 78634e4a..eebe5de7 100644 --- a/text/maps/safari_zone_east.asm +++ b/text/maps/safari_zone_east.asm @@ -14,4 +14,3 @@ _SafariZoneEastText7:: text "CENTER AREA" line "NORTH: AREA 2" done - diff --git a/text/maps/safari_zone_north.asm b/text/maps/safari_zone_north.asm index fdf8b5e8..1e148f0b 100644 --- a/text/maps/safari_zone_north.asm +++ b/text/maps/safari_zone_north.asm @@ -31,4 +31,3 @@ _SafariZoneNorthText7:: line "finding the" cont "SECRET HOUSE!" done - diff --git a/text/maps/safari_zone_rest_house_1.asm b/text/maps/safari_zone_rest_house_1.asm index 2731bdb4..b6c87818 100644 --- a/text/maps/safari_zone_rest_house_1.asm +++ b/text/maps/safari_zone_rest_house_1.asm @@ -9,4 +9,3 @@ _SafariZoneRestHouse1Text2:: line "#MON to take" cont "home as gifts!" done - diff --git a/text/maps/safari_zone_rest_house_2.asm b/text/maps/safari_zone_rest_house_2.asm index 6cdca9c0..94802b13 100644 --- a/text/maps/safari_zone_rest_house_2.asm +++ b/text/maps/safari_zone_rest_house_2.asm @@ -17,4 +17,3 @@ _SafariZoneRestHouse2Text3:: line "I didn't see any" cont "#MON I wanted." done - diff --git a/text/maps/safari_zone_rest_house_3.asm b/text/maps/safari_zone_rest_house_3.asm index f40c3009..d5f7abc8 100644 --- a/text/maps/safari_zone_rest_house_3.asm +++ b/text/maps/safari_zone_rest_house_3.asm @@ -16,4 +16,3 @@ _SafariZoneRestHouse3Text3:: text "Whew! I'm tired" line "from all the fun!" done - diff --git a/text/maps/safari_zone_rest_house_4.asm b/text/maps/safari_zone_rest_house_4.asm index e50c4522..93f02c8f 100644 --- a/text/maps/safari_zone_rest_house_4.asm +++ b/text/maps/safari_zone_rest_house_4.asm @@ -25,4 +25,3 @@ _SafariZoneRestHouse4Text3:: cont "a VAPOREON!" cont "I wonder why?" done - diff --git a/text/maps/safari_zone_secret_house.asm b/text/maps/safari_zone_secret_house.asm index f285a697..1bbe89fd 100644 --- a/text/maps/safari_zone_secret_house.asm +++ b/text/maps/safari_zone_secret_house.asm @@ -42,4 +42,3 @@ _HM03NoRoomText:: line "room for this" cont "fabulous prize!" done - diff --git a/text/maps/safari_zone_west.asm b/text/maps/safari_zone_west.asm index e10df2a3..dcb2fe6c 100644 --- a/text/maps/safari_zone_west.asm +++ b/text/maps/safari_zone_west.asm @@ -29,4 +29,3 @@ _SafariZoneWestText8:: text "AREA 3" line "EAST: CENTER AREA" done - diff --git a/text/maps/saffron_city.asm b/text/maps/saffron_city.asm index 82687181..a0422c8c 100644 --- a/text/maps/saffron_city.asm +++ b/text/maps/saffron_city.asm @@ -149,4 +149,3 @@ _SaffronCityText25:: para "Release to be" line "determined..." done - diff --git a/text/maps/saffron_gates.asm b/text/maps/saffron_gates.asm index 629ec433..0fd11d88 100644 --- a/text/maps/saffron_gates.asm +++ b/text/maps/saffron_gates.asm @@ -34,4 +34,3 @@ _SaffronGateText_1dff6:: text "Hi, thanks for" line "the cool drinks!" done - diff --git a/text/maps/saffron_gym.asm b/text/maps/saffron_gym.asm index ab1497bf..23cc211b 100644 --- a/text/maps/saffron_gym.asm +++ b/text/maps/saffron_gym.asm @@ -233,4 +233,3 @@ _SaffronGymAfterBattleText7:: line "used telepathy to" cont "read your mind!" done - diff --git a/text/maps/saffron_house.asm b/text/maps/saffron_house.asm index 21ed3b89..214bf089 100644 --- a/text/maps/saffron_house.asm +++ b/text/maps/saffron_house.asm @@ -24,4 +24,3 @@ _SaffronHouse1Text4:: line "increasing the PP" cont "of techniques!" done - diff --git a/text/maps/saffron_mart.asm b/text/maps/saffron_mart.asm index 29c34a1c..a43b0d94 100644 --- a/text/maps/saffron_mart.asm +++ b/text/maps/saffron_mart.asm @@ -11,4 +11,3 @@ _SaffronMartText3:: line "but it revives" cont "fainted #MON!" done - diff --git a/text/maps/saffron_pokecenter.asm b/text/maps/saffron_pokecenter.asm index 9202af9b..8fd47e4f 100644 --- a/text/maps/saffron_pokecenter.asm +++ b/text/maps/saffron_pokecenter.asm @@ -10,4 +10,3 @@ _SaffronPokecenterText3:: cont "why it attracted" cont "TEAM ROCKET!" done - diff --git a/text/maps/seafoam_islands_1f.asm b/text/maps/seafoam_islands_1f.asm deleted file mode 100644 index 139597f9..00000000 --- a/text/maps/seafoam_islands_1f.asm +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/text/maps/seafoam_islands_b1f.asm b/text/maps/seafoam_islands_b1f.asm deleted file mode 100644 index 139597f9..00000000 --- a/text/maps/seafoam_islands_b1f.asm +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/text/maps/seafoam_islands_b2f.asm b/text/maps/seafoam_islands_b2f.asm deleted file mode 100644 index 139597f9..00000000 --- a/text/maps/seafoam_islands_b2f.asm +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/text/maps/seafoam_islands_b3f.asm b/text/maps/seafoam_islands_b3f.asm deleted file mode 100644 index 139597f9..00000000 --- a/text/maps/seafoam_islands_b3f.asm +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/text/maps/seafoam_islands_b4f.asm b/text/maps/seafoam_islands_b4f.asm index dccb43c0..608d165f 100644 --- a/text/maps/seafoam_islands_b4f.asm +++ b/text/maps/seafoam_islands_b4f.asm @@ -11,4 +11,3 @@ _SeafoamIslands5Text5:: text "DANGER" line "Fast current!" done - diff --git a/text/maps/silph_co_11f.asm b/text/maps/silph_co_11f.asm index 3051fc76..6be83c5d 100644 --- a/text/maps/silph_co_11f.asm +++ b/text/maps/silph_co_11f.asm @@ -112,4 +112,3 @@ _SilphCo11AfterBattleText2:: line "my BOSS likes his" cont "#MON tough!" done - diff --git a/text/maps/silph_co_1f.asm b/text/maps/silph_co_1f.asm index ca166d31..1ef80189 100644 --- a/text/maps/silph_co_1f.asm +++ b/text/maps/silph_co_1f.asm @@ -5,4 +5,3 @@ _SilphCo1Text1:: line "in the boardroom" cont "on 11F!" done - diff --git a/text/maps/silph_co_2f.asm b/text/maps/silph_co_2f.asm index 5993bafe..5ef349d5 100644 --- a/text/maps/silph_co_2f.asm +++ b/text/maps/silph_co_2f.asm @@ -94,4 +94,3 @@ _SilphCo2AfterBattleText4:: line "be merged with" cont "TEAM ROCKET!" done - diff --git a/text/maps/silph_co_3f.asm b/text/maps/silph_co_3f.asm index 0374482d..a514d3ef 100644 --- a/text/maps/silph_co_3f.asm +++ b/text/maps/silph_co_3f.asm @@ -44,4 +44,3 @@ _SilphCo3AfterBattleText2:: cont "them, they'd let" cont "me study #MON!" done - diff --git a/text/maps/silph_co_4f.asm b/text/maps/silph_co_4f.asm index 19494482..5b484ec7 100644 --- a/text/maps/silph_co_4f.asm +++ b/text/maps/silph_co_4f.asm @@ -54,4 +54,3 @@ _SilphCo4AfterBattleText4:: text "I better tell the" line "BOSS on 11F!" done - diff --git a/text/maps/silph_co_5f.asm b/text/maps/silph_co_5f.asm index 78bb8f9e..9c8bfd41 100644 --- a/text/maps/silph_co_5f.asm +++ b/text/maps/silph_co_5f.asm @@ -105,4 +105,3 @@ _SilphCo5Text11:: line "only when traded" cont "by link-cable." done - diff --git a/text/maps/silph_co_6f.asm b/text/maps/silph_co_6f.asm index b3a38aa0..90456b5c 100644 --- a/text/maps/silph_co_6f.asm +++ b/text/maps/silph_co_6f.asm @@ -105,4 +105,3 @@ _SilphCo6AfterBattleText4:: line "justice, you" cont "betray evil!" done - diff --git a/text/maps/silph_co_7f.asm b/text/maps/silph_co_7f.asm index 3eba2f1e..0373355a 100644 --- a/text/maps/silph_co_7f.asm +++ b/text/maps/silph_co_7f.asm @@ -207,4 +207,3 @@ _SilphCo7Text_51ed2:: cont "Don't sweat it!" cont "Smell ya!" done - diff --git a/text/maps/silph_co_8f.asm b/text/maps/silph_co_8f.asm index 898c0600..fabae5e6 100644 --- a/text/maps/silph_co_8f.asm +++ b/text/maps/silph_co_8f.asm @@ -54,4 +54,3 @@ _SilphCo8AfterBattleText3:: text "I'll leave you up" line "to my brothers!" done - diff --git a/text/maps/silph_co_9f.asm b/text/maps/silph_co_9f.asm index f01ffb7b..fd1aa91c 100644 --- a/text/maps/silph_co_9f.asm +++ b/text/maps/silph_co_9f.asm @@ -60,4 +60,3 @@ _SilphCo9AfterBattleText3:: text "My brothers will" line "avenge me!" done - diff --git a/text/maps/ss_anne_1.asm b/text/maps/ss_anne_1.asm index 6032b770..2bbdcbac 100644 --- a/text/maps/ss_anne_1.asm +++ b/text/maps/ss_anne_1.asm @@ -19,4 +19,3 @@ _SSAnne1Text2:: line "challenged by the" cont "more bored ones!" done - diff --git a/text/maps/ss_anne_10.asm b/text/maps/ss_anne_10.asm index f1eb8a77..7df629b5 100644 --- a/text/maps/ss_anne_10.asm +++ b/text/maps/ss_anne_10.asm @@ -110,4 +110,3 @@ _SSAnne10Text7:: line "STRENGTH to move" cont "big rocks!" done - diff --git a/text/maps/ss_anne_2.asm b/text/maps/ss_anne_2.asm index bd33b9d3..ba231ac5 100644 --- a/text/maps/ss_anne_2.asm +++ b/text/maps/ss_anne_2.asm @@ -61,4 +61,3 @@ _SSAnneRivalCaptainText:: para "You should go see" line "him! Smell ya!" done - diff --git a/text/maps/ss_anne_3.asm b/text/maps/ss_anne_3.asm index 8ac96d88..76490594 100644 --- a/text/maps/ss_anne_3.asm +++ b/text/maps/ss_anne_3.asm @@ -5,4 +5,3 @@ _SSAnne3Text1:: para "He even teaches" line "CUT to #MON!" done - diff --git a/text/maps/ss_anne_4.asm b/text/maps/ss_anne_4.asm deleted file mode 100644 index 139597f9..00000000 --- a/text/maps/ss_anne_4.asm +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/text/maps/ss_anne_5.asm b/text/maps/ss_anne_5.asm index b4935f5b..76cd5631 100644 --- a/text/maps/ss_anne_5.asm +++ b/text/maps/ss_anne_5.asm @@ -50,4 +50,3 @@ _SSAnne5AfterBattleText2:: cont "#MON. I think" cont "there are more." done - diff --git a/text/maps/ss_anne_6.asm b/text/maps/ss_anne_6.asm index 4256eb47..b7784019 100644 --- a/text/maps/ss_anne_6.asm +++ b/text/maps/ss_anne_6.asm @@ -67,4 +67,3 @@ _SSAnne6Text_61816:: para "But, have I enough" line "fillets du beef?" done - diff --git a/text/maps/ss_anne_7.asm b/text/maps/ss_anne_7.asm index cffb4add..a046e600 100644 --- a/text/maps/ss_anne_7.asm +++ b/text/maps/ss_anne_7.asm @@ -60,4 +60,3 @@ _SSAnne7Text3:: cont "The CAPTAIN's" cont "reading this!" done - diff --git a/text/maps/ss_anne_8.asm b/text/maps/ss_anne_8.asm index 393633e3..7a09303e 100644 --- a/text/maps/ss_anne_8.asm +++ b/text/maps/ss_anne_8.asm @@ -102,4 +102,3 @@ _SSAnne8Text11:: para "I'm on the trail" line "of TEAM ROCKET!" done - diff --git a/text/maps/ss_anne_9.asm b/text/maps/ss_anne_9.asm index 68973b09..c9b29119 100644 --- a/text/maps/ss_anne_9.asm +++ b/text/maps/ss_anne_9.asm @@ -111,4 +111,3 @@ _SSAnne9Text_61c4c:: text "I hear many people" line "get seasick!" done - diff --git a/text/maps/underground_path_route_5_entrance.asm b/text/maps/underground_path_route_5_entrance.asm deleted file mode 100644 index 139597f9..00000000 --- a/text/maps/underground_path_route_5_entrance.asm +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/text/maps/underground_path_route_6_entrance.asm b/text/maps/underground_path_route_6_entrance.asm index c898d199..dacc44f7 100644 --- a/text/maps/underground_path_route_6_entrance.asm +++ b/text/maps/underground_path_route_6_entrance.asm @@ -3,4 +3,3 @@ _UndergrdTunnelEntRoute6Text1:: line "things in that" cont "UNDERGROUND PATH." done - diff --git a/text/maps/underground_path_route_7_entrance.asm b/text/maps/underground_path_route_7_entrance.asm index dee62853..5cde3614 100644 --- a/text/maps/underground_path_route_7_entrance.asm +++ b/text/maps/underground_path_route_7_entrance.asm @@ -3,4 +3,3 @@ _UndergroundPathEntRoute7Text1:: line "#MON appeared" cont "near CELADON CITY." done - diff --git a/text/maps/underground_path_route_8_entrance.asm b/text/maps/underground_path_route_8_entrance.asm index 0df1dec9..da785c8e 100644 --- a/text/maps/underground_path_route_8_entrance.asm +++ b/text/maps/underground_path_route_8_entrance.asm @@ -3,4 +3,3 @@ _UndergroundPathEntRoute8Text1:: line "in CELADON has a" cont "great selection!" done - diff --git a/text/maps/unknown_dungeon_1f.asm b/text/maps/unknown_dungeon_1f.asm deleted file mode 100644 index 139597f9..00000000 --- a/text/maps/unknown_dungeon_1f.asm +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/text/maps/unknown_dungeon_2f.asm b/text/maps/unknown_dungeon_2f.asm deleted file mode 100644 index 139597f9..00000000 --- a/text/maps/unknown_dungeon_2f.asm +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/text/maps/unknown_dungeon_b1f.asm b/text/maps/unknown_dungeon_b1f.asm index 4db8467f..0918a3ce 100644 --- a/text/maps/unknown_dungeon_b1f.asm +++ b/text/maps/unknown_dungeon_b1f.asm @@ -1,3 +1,2 @@ _MewtwoBattleText:: text "Mew!@@" - diff --git a/text/maps/vermilion_city.asm b/text/maps/vermilion_city.asm index f5e0adba..2b2d125f 100644 --- a/text/maps/vermilion_city.asm +++ b/text/maps/vermilion_city.asm @@ -165,4 +165,3 @@ _VermilionCityText13:: _VermilionCityText14:: text "VERMILION HARBOR" done - diff --git a/text/maps/vermilion_dock.asm b/text/maps/vermilion_dock.asm index 26c556a7..034de399 100644 --- a/text/maps/vermilion_dock.asm +++ b/text/maps/vermilion_dock.asm @@ -1,3 +1,2 @@ _VermilionDockText1:: db $0, $57 - diff --git a/text/maps/vermilion_fishing_house.asm b/text/maps/vermilion_fishing_house.asm index 59f730db..0fa28cae 100644 --- a/text/maps/vermilion_fishing_house.asm +++ b/text/maps/vermilion_fishing_house.asm @@ -51,4 +51,3 @@ _VermilionHouse2Text_560ca:: para "You have no room" line "for my gift!" done - diff --git a/text/maps/vermilion_gym.asm b/text/maps/vermilion_gym.asm index 47895757..a7cce733 100644 --- a/text/maps/vermilion_gym.asm +++ b/text/maps/vermilion_gym.asm @@ -163,4 +163,3 @@ _VermilionGymText_5cbf9:: text "Whew! That match" line "was electric!" done - diff --git a/text/maps/vermilion_house.asm b/text/maps/vermilion_house.asm index 806a4b8a..91c18708 100644 --- a/text/maps/vermilion_house.asm +++ b/text/maps/vermilion_house.asm @@ -19,4 +19,3 @@ _VermilionHouse1Text3:: para "VERMILION appears" line "to be safe." done - diff --git a/text/maps/vermilion_mart.asm b/text/maps/vermilion_mart.asm index 9acdf905..10743989 100644 --- a/text/maps/vermilion_mart.asm +++ b/text/maps/vermilion_mart.asm @@ -21,4 +21,3 @@ _VermilionMartText3:: cont "evil. It depends" cont "on the trainer." done - diff --git a/text/maps/vermilion_pokecenter.asm b/text/maps/vermilion_pokecenter.asm index 8ba563dc..bbd8842f 100644 --- a/text/maps/vermilion_pokecenter.asm +++ b/text/maps/vermilion_pokecenter.asm @@ -18,4 +18,3 @@ _VermilionPokecenterText3:: cont "fainted while we" cont "were walking!" done - diff --git a/text/maps/victory_road_1f.asm b/text/maps/victory_road_1f.asm index ded9afd6..1523db88 100644 --- a/text/maps/victory_road_1f.asm +++ b/text/maps/victory_road_1f.asm @@ -29,4 +29,3 @@ _VictoryRoad1AfterBattleText2:: text "I concede, you're" line "better than me!" done - diff --git a/text/maps/victory_road_2f.asm b/text/maps/victory_road_2f.asm index bc1b6cd9..cdcf6e36 100644 --- a/text/maps/victory_road_2f.asm +++ b/text/maps/victory_road_2f.asm @@ -83,4 +83,3 @@ _VictoryRoad2AfterBattleText5:: line "up the challenge" cont "here." done - diff --git a/text/maps/victory_road_3f.asm b/text/maps/victory_road_3f.asm index 66364190..07e0be70 100644 --- a/text/maps/victory_road_3f.asm +++ b/text/maps/victory_road_3f.asm @@ -61,4 +61,3 @@ _VictoryRoad3AfterBattleText5:: line "battles, you get" cont "stronger!" done - diff --git a/text/maps/viridian_city.asm b/text/maps/viridian_city.asm index a9a2184e..0cfd1fe8 100644 --- a/text/maps/viridian_city.asm +++ b/text/maps/viridian_city.asm @@ -192,4 +192,3 @@ _ViridianCityText14:: text "The GYM's doors" line "are locked..." done - diff --git a/text/maps/viridian_forest.asm b/text/maps/viridian_forest.asm index d3a66091..f88a484c 100644 --- a/text/maps/viridian_forest.asm +++ b/text/maps/viridian_forest.asm @@ -155,4 +155,3 @@ _ViridianForestText14:: line "VIRIDIAN FOREST" cont "PEWTER CITY AHEAD" done - diff --git a/text/maps/viridian_forest_exit.asm b/text/maps/viridian_forest_exit.asm index 04dea7e5..ab6a5a1d 100644 --- a/text/maps/viridian_forest_exit.asm +++ b/text/maps/viridian_forest_exit.asm @@ -17,4 +17,3 @@ _ViridianForestExitText2:: line "down by a special" cont "#MON move." done - diff --git a/text/maps/viridian_gym.asm b/text/maps/viridian_gym.asm index 2df76aec..795447a5 100644 --- a/text/maps/viridian_gym.asm +++ b/text/maps/viridian_gym.asm @@ -234,4 +234,3 @@ _ViridianGymText_74bd9:: line "GIOVANNI was the" cont "GYM LEADER here?" done - diff --git a/text/maps/viridian_house.asm b/text/maps/viridian_house.asm index 5adf059b..757f597a 100644 --- a/text/maps/viridian_house.asm +++ b/text/maps/viridian_house.asm @@ -21,4 +21,3 @@ _ViridianHouseText4:: text "SPEAROW" line "Name: SPEARY" done - diff --git a/text/maps/wardens_house.asm b/text/maps/wardens_house.asm index 09ab1443..d4da3781 100644 --- a/text/maps/wardens_house.asm +++ b/text/maps/wardens_house.asm @@ -81,4 +81,3 @@ _FuchsiaHouse2Text_7517b:: text "Old #MON" line "merchandise." done - @@ -230,19 +230,19 @@ wSpriteStateData1:: ; c100 ; C1xE ; C1xF spritestatedata1: MACRO -\1SpriteStateData1:: -\1PictureID:: db -\1MovementStatus:: db -\1SpriteImageIdx:: db -\1YStepVector:: db -\1YPixels:: db -\1XStepVector:: db -\1XPixels:: db -\1IntraAnimFrameCounter:: db -\1AnimFrameCounter:: db -\1FacingDirection:: db +w\1SpriteStateData1:: +w\1PictureID:: db +w\1MovementStatus:: db +w\1SpriteImageIdx:: db +w\1YStepVector:: db +w\1YPixels:: db +w\1XStepVector:: db +w\1XPixels:: db +w\1IntraAnimFrameCounter:: db +w\1AnimFrameCounter:: db +w\1FacingDirection:: db ds 6 -\1SpriteStateData1End:: +w\1SpriteStateData1End:: endm spritestatedata1 Player @@ -260,7 +260,7 @@ endm spritestatedata1 Sprite12 spritestatedata1 Sprite13 spritestatedata1 Sprite14 - spritestatedata1 Sprite15 + spritestatedata1 Pikachu ; ds $10 * $10 @@ -287,20 +287,20 @@ wSpriteStateData2:: ; c200 ; C2xE: sprite image base offset (in video ram, player always has value 1, used to compute c1x2) ; C2xF spritestatedata2: MACRO -\1SpriteStateData2:: -\1WalkAnimationCounter:: db - ds 1 -\1YDisplacement:: db -\1XDisplacement:: db -\1MapY:: db -\1MapX:: db -\1MovementByte1:: db -\1GrassPriority:: db -\1MovementDelay:: db +w\1SpriteStateData2:: +w\1WalkAnimationCounter:: db + ds 1 +w\1YDisplacement:: db +w\1XDisplacement:: db +w\1MapY:: db +w\1MapX:: db +w\1MovementByte1:: db +w\1GrassPriority:: db +w\1MovementDelay:: db ds 5 -\1SpriteImageBaseOffset:: db +w\1SpriteImageBaseOffset:: db ds 1 -\1SpriteStateData2End:: +w\1SpriteStateData2End:: endm spritestatedata2 Player @@ -318,7 +318,7 @@ endm spritestatedata2 Sprite12 spritestatedata2 Sprite13 spritestatedata2 Sprite14 - spritestatedata2 Sprite15 + spritestatedata2 Pikachu ; ds $10 * $10 wSpriteDataEnd:: @@ -470,11 +470,14 @@ wc632:: ; c632 ds 1 wc633:: ; c633 ds 1 + +wYellowIntroCurrentScene:: ; c634 wc634:: ; c634 ds 1 +wYellowIntroSceneTimer:: ; c635 wc635:: ; c635 ds 1 -wc636:: ; c636 +wYellowIntroAnimatedObjectStructPointer:: ; c636 ds 2 ; c638 @@ -483,21 +486,98 @@ wc636:: ; c636 ; c698 ds 80 -wTempPic:: +wTempPic:: ; c6e8 +wPrinterData:: ; c6e8 wOverworldMap:: ; c6e8 ; ds 1300 - ds $18 +wPrinterSendState:: ; c6e8 + ds 1 +wPrinterRowIndex:: ; c6e9 + ds 1 + +; Printer data header +wPrinterDataHeader:: ; c6ea +wc6ea:: ; c6ea + ds 1 +wc6eb:: ; c6eb + ds 1 +wc6ec:: ; c6ec + ds 1 +wc6ed:: ; c6ed + ds 1 +wPrinterChecksum:: ; c6ee + dw + +wPrinterSendDataSource:: ; c6f0 +; a 40-tile buffer +; ds $280 +wPrinterSerialReceived:: ; c6f0 + ds 1 +wPrinterStatusReceived:: ; c6f1 +; bit 7: set if error 1 (battery low) +; bit 6: set if error 4 (too hot or cold) +; bit 5: set if error 3 (paper jammed or empty) +; if this and the previous byte are both $ff: error 2 (connection error) + ds 1 + +wc6f2:: ; c6f2 + ds 1 +wc6f3:: ; c6f3 + ds 13 wc700:: ; c700 ds $10 wc710:: ; c710 ds $f0 -wc800:: ; c800 - ds $178 +wYellowIntroSurfingPikaSineWaveBuffer:: ; c800 + ; ds $100 + ds $10 +wc810:: ; c810 + ds $20 +wc830:: ; c830 + ds $d0 +; c900 + ds $70 +wPrinterSendDataSourceEnd:: ; c970 + +wPrinterHandshake:: ; c970 + ds 1 +wPrinterStatusFlags:: ; c971 + ds 1 +wHandshakeFrameDelay:: ; c972 + ds 1 +wPrinterSerialFrameDelay:: ; c973 + ds 1 +wPrinterSendByteOffset:: ; c974 + dw +wPrinterDataSize:: ; c976 + dw wPrinterTileBuffer:: ; c978 ds SCREEN_HEIGHT * SCREEN_WIDTH -wcae0:: ; cae0 - ds 284 +wPrinterStatusIndicator:: ; cae0 + ds 2 +wcae2:: ; cae2 + ds 1 +wPrinterSettingsTempCopy:: ; cae3 + ds 17 +wPrinterQueueLength:: ; caf4 + ds 1 +wPrinterDataEnd:: ; caf5 + +wPrinterPokedexEntryTextPointer:: ; caf5 + dw + ds 2 +wPrinterPokedexMonIsOwned:: ; caf9 + ds 227 + +wcbdc:: ; cbdc + ds 14 + +wcbea:: ; cbea + ds 2 + +wcbec:: ; cbec + ds 16 wRedrawRowOrColumnSrcTiles:: ; cbfc ; the tiles of the row or column to be redrawn by RedrawRowOrColumn @@ -719,8 +799,11 @@ wAnimationType:: ; cc5b ; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon... wNPCMovementDirections:: ; cc5b + +wPikaPicUsedGFXCount:: ; cc5b ds 1 +wPikaPicUsedGFX:: ; cc5c wDexRatingNumMonsOwned:: ; cc5c ds 1 @@ -733,7 +816,9 @@ wSlotMachineSavedROMBank:: ; cc5e ; ROM back to return to when the player is done with the slot machine ds 1 - ds 26 + ds 13 +wPikaPicUsedGFXEnd:: ; cc6c + ds 13 wAnimPalette:: ; cc79 ds 1 @@ -762,7 +847,9 @@ wPikaPicAnimObjectDataBuffer:: ; cc98 wNumStepsToTake:: ; cca1 ; used in Pallet Town scripted movement - ds 49 + ds 23 +wPikaPicAnimObjectDataBufferEnd:: ;ccb8 + ds 26 wRLEByteCount:: ; ccd2 ds 1 @@ -1055,7 +1142,7 @@ wWhichBadge:: ; cd3d wPriceTemp:: ; cd3d ; 3-byte BCD number -wTitleMonSpecies:: ; cd3d +wTitleScreenScene:: ; cd3d wPlayerCharacterOAMTile:: ; cd3d @@ -1118,6 +1205,8 @@ wTrainerSpriteOffset:: ; cd3d wUnusedCD3D:: ; cd3d ds 1 +wTitleScreenTimer:: ; cd3e + wHUDPokeballGfxOffsetX:: ; cd3e ; difference in X between the next ball and the current one @@ -1548,26 +1637,26 @@ wScriptedNPCWalkCounter:: ; cf18 ds 1 -wOnSGB:: ; cf1b +wOnSGB:: ; cf1a ; if running on SGB, it's 1, else it's 0 ds 1 -wDefaultPaletteCommand:: ; cf1c +wDefaultPaletteCommand:: ; cf1b ds 1 -wPlayerHPBarColor:: ; cf1d +wPlayerHPBarColor:: ; cf1c -wWholeScreenPaletteMonSpecies:: ; cf1d +wWholeScreenPaletteMonSpecies:: ; cf1c ; species of the mon whose palette is used for the whole screen ds 1 -wEnemyHPBarColor:: ; cf1e +wEnemyHPBarColor:: ; cf1d ds 1 ; 0: green ; 1: yellow ; 2: red -wPartyMenuHPBarColors:: ; cf1f +wPartyMenuHPBarColors:: ; cf1e ds 6 wStatusScreenHPBarColor:: ; cf25 @@ -1588,93 +1677,93 @@ wPartyMenuBlkPacket:: ; cf2e wPartyHPBarAttributes:: ; cf36 ds 20 -wExpAmountGained:: ; cf4b +wExpAmountGained:: ; cf4a ; 2-byte big-endian number ; the total amount of exp a mon gained wcf4b:: ds 2 ; storage buffer for various strings -wGainBoostedExp:: ; cf4d +wGainBoostedExp:: ; cf4c ds 1 ds 17 -wGymCityName:: ; cf5f +wGymCityName:: ; cf5e ds 17 -wGymLeaderName:: ; cf70 +wGymLeaderName:: ; cf6f ds NAME_LENGTH -wItemList:: ; cf7b +wItemList:: ; cf7a ds 16 -wListPointer:: ; cf8b +wListPointer:: ; cf8a ds 2 -wUnusedCF8D:: ; cf8d +wUnusedCF8D:: ; cf8c ; 2 bytes ; used to store pointers, but never read ds 2 -wItemPrices:: ; cf8f +wItemPrices:: ; cf8e ds 2 -wcf91:: ds 1 ; used with a lot of things (too much to list here) +wcf91:: ds 1 ; used with a lot of things (too much to list here) ; cf90 -wWhichPokemon:: ; cf92 +wWhichPokemon:: ; cf91 ; which pokemon you selected ds 1 -wPrintItemPrices:: ; cf93 +wPrintItemPrices:: ; cf92 ; if non-zero, then print item prices when displaying lists ds 1 -wHPBarType:: ; cf94 +wHPBarType:: ; cf93 ; type of HP bar ; $00 = enemy HUD in battle ; $01 = player HUD in battle / status screen ; $02 = party menu -wListMenuID:: ; cf94 +wListMenuID:: ; cf93 ; ID used by DisplayListMenuID ds 1 -wRemoveMonFromBox:: ; cf95 +wRemoveMonFromBox:: ; cf94 ; if non-zero, RemovePokemon will remove the mon from the current box, ; else it will remove the mon from the party -wMoveMonType:: ; cf95 +wMoveMonType:: ; cf94 ; 0 = move from box to party ; 1 = move from party to box ; 2 = move from daycare to party ; 3 = move from party to daycare ds 1 -wItemQuantity:: ; cf96 +wItemQuantity:: ; cf95 ds 1 -wMaxItemQuantity:: ; cf97 +wMaxItemQuantity:: ; cf96 ds 1 ; LoadMonData copies mon data here -wLoadedMon:: party_struct wLoadedMon ; cf98 +wLoadedMon:: party_struct wLoadedMon ; cf97 -wFontLoaded:: ; cfc4 +wFontLoaded:: ; cfc3 ; bit 0: The space in VRAM that is used to store walk animation tile patterns ; for the player and NPCs is in use for font tile patterns. ; This means that NPC movement must be disabled. ; The other bits are unused. ds 1 -wWalkCounter:: ; cfc5 +wWalkCounter:: ; cfc4 ; walk animation counter ds 1 -wTileInFrontOfPlayer:: ; cfc6 +wTileInFrontOfPlayer:: ; cfc5 ; background tile number in front of the player (either 1 or 2 steps ahead) ds 1 -wAudioFadeOutControl:: ; cfc7 +wAudioFadeOutControl:: ; cfc6 ; The desired fade counter reload value is stored here prior to calling ; PlaySound in order to cause the current music to fade out before the new ; music begins playing. Storing 0 causes no fade out to occur and the new music @@ -1686,13 +1775,13 @@ wAudioFadeOutControl:: ; cfc7 ; audio, it zeroes this variable and starts playing the sound ID stored in it. ds 1 -wAudioFadeOutCounterReloadValue:: ; cfc8 +wAudioFadeOutCounterReloadValue:: ; cfc7 ds 1 -wAudioFadeOutCounter:: ; cfc9 +wAudioFadeOutCounter:: ; cfc8 ds 1 -wLastMusicSoundID:: ; cfca +wLastMusicSoundID:: ; cfc9 ; This is used to determine whether the default music is already playing when ; attempting to play the default music (in order to avoid restarting the same ; music) and whether the music has already been stopped when attempting to @@ -1704,47 +1793,47 @@ wLastMusicSoundID:: ; cfca ; the music). ds 1 -wUpdateSpritesEnabled:: ; cfcb +wUpdateSpritesEnabled:: ; cfca ; $00 = causes sprites to be hidden and the value to change to $ff ; $01 = enabled ; $ff = disabled ; other values aren't used ds 1 -wEnemyMoveNum:: ; cfcc +wEnemyMoveNum:: ; cfcb ds 1 -wEnemyMoveEffect:: ; cfcd +wEnemyMoveEffect:: ; cfcc ds 1 -wEnemyMovePower:: ; cfce +wEnemyMovePower:: ; cfcd ds 1 -wEnemyMoveType:: ; cfcf +wEnemyMoveType:: ; cfce ds 1 -wEnemyMoveAccuracy:: ; cfd0 +wEnemyMoveAccuracy:: ; cfcf ds 1 -wEnemyMoveMaxPP:: ; cfd1 +wEnemyMoveMaxPP:: ; cfd0 ds 1 -wPlayerMoveNum:: ; cfd2 +wPlayerMoveNum:: ; cfd1 ds 1 -wPlayerMoveEffect:: ; cfd3 +wPlayerMoveEffect:: ; cfd2 ds 1 -wPlayerMovePower:: ; cfd4 +wPlayerMovePower:: ; cfd3 ds 1 -wPlayerMoveType:: ; cfd5 +wPlayerMoveType:: ; cfd4 ds 1 -wPlayerMoveAccuracy:: ; cfd6 +wPlayerMoveAccuracy:: ; cfd5 ds 1 -wPlayerMoveMaxPP:: ; cfd7 +wPlayerMoveMaxPP:: ; cfd6 ds 1 -wEnemyMonSpecies2:: ; cfd8 +wEnemyMonSpecies2:: ; cfd7 ds 1 -wBattleMonSpecies2:: ; cfd9 +wBattleMonSpecies2:: ; cfd8 ds 1 -wEnemyMonNick:: ds NAME_LENGTH ; cfda +wEnemyMonNick:: ds NAME_LENGTH ; cfd9 -wEnemyMon:: ; cfe5 +wEnemyMon:: ; cfe4 ; The wEnemyMon struct reaches past 0xcfff, ; the end of wram bank 0 on cgb. ; This has no significance on dmg, where wram @@ -1772,72 +1861,72 @@ wEnemyMonAttack:: dw wEnemyMonDefense:: dw wEnemyMonSpeed:: dw wEnemyMonSpecial:: dw -wEnemyMonPP:: ds 3 ; NUM_MOVES - 2 +wEnemyMonPP:: ds 3 ; NUM_MOVES - 1 SECTION "WRAM Bank 1", WRAMX, BANK[1] - ds 1 ; NUM_MOVES - 2 + ds 1 ; NUM_MOVES - 3 wEnemyMonBaseStats:: ds 5 wEnemyMonCatchRate:: ds 1 wEnemyMonBaseExp:: ds 1 -wBattleMonNick:: ds NAME_LENGTH ; d009 -wBattleMon:: battle_struct wBattleMon ; d014 +wBattleMonNick:: ds NAME_LENGTH ; d008 +wBattleMon:: battle_struct wBattleMon ; d013 -wTrainerClass:: ; d031 +wTrainerClass:: ; d030 ds 1 ds 1 -wTrainerPicPointer:: ; d033 +wTrainerPicPointer:: ; d032 ds 2 ds 1 -wTempMoveNameBuffer:: ; d036 +wTempMoveNameBuffer:: ; d035 -wLearnMoveMonName:: ; d036 +wLearnMoveMonName:: ; d035 ; The name of the mon that is learning a move. ds 16 -wTrainerBaseMoney:: ; d046 +wTrainerBaseMoney:: ; d045 ; 2-byte BCD number ; money received after battle = base money × level of highest-level enemy mon ds 2 -wMissableObjectCounter:: ; d048 +wMissableObjectCounter:: ; d047 ds 1 ds 1 -wTrainerName:: ; d04a +wTrainerName:: ; d049 ; 13 bytes for the letters of the opposing trainer ; the name is terminated with $50 with possible ; unused trailing letters ds 13 -wIsInBattle:: ; d057 +wIsInBattle:: ; d056 ; lost battle, this is -1 ; no battle, this is 0 ; wild battle, this is 1 ; trainer battle, this is 2 ds 1 -wPartyGainExpFlags:: ; d058 +wPartyGainExpFlags:: ; d057 ; flags that indicate which party members should be be given exp when GainExperience is called flag_array 6 -wCurOpponent:: ; d059 +wCurOpponent:: ; d058 ; in a wild battle, this is the species of pokemon ; in a trainer battle, this is the trainer class + 200 ds 1 -wBattleType:: ; d05a +wBattleType:: ; d059 ; in normal battle, this is 0 ; in old man battle, this is 1 ; in safari battle, this is 2 ds 1 -wDamageMultipliers:: ; d05b +wDamageMultipliers:: ; d05a ; bits 0-6: Effectiveness ; $0 = immune ; $5 = not very effective @@ -1846,34 +1935,34 @@ wDamageMultipliers:: ; d05b ; bit 7: STAB ds 1 -wLoneAttackNo:: ; d05c +wLoneAttackNo:: ; d05b ; which entry in LoneAttacks to use -wGymLeaderNo:: ; d05c +wGymLeaderNo:: ; d05b ; it's actually the same thing as ^ ds 1 -wTrainerNo:: ; d05d +wTrainerNo:: ; d05c ; which instance of [youngster, lass, etc] is this? ds 1 -wCriticalHitOrOHKO:: ; d05e +wCriticalHitOrOHKO:: ; d05d ; $00 = normal attack ; $01 = critical hit ; $02 = successful OHKO ; $ff = failed OHKO ds 1 -wMoveMissed:: ; d05f +wMoveMissed:: ; d05e ds 1 -wPlayerStatsToDouble:: ; d060 +wPlayerStatsToDouble:: ; d05f ; always 0 ds 1 -wPlayerStatsToHalve:: ; d061 +wPlayerStatsToHalve:: ; d060 ; always 0 ds 1 -wPlayerBattleStatus1:: ; d062 +wPlayerBattleStatus1:: ; d061 ; bit 0 - bide ; bit 1 - thrash / petal dance ; bit 2 - attacking multiple times (e.g. double kick) @@ -1884,7 +1973,7 @@ wPlayerBattleStatus1:: ; d062 ; bit 7 - confusion ds 1 -wPlayerBattleStatus2:: ; d063 +wPlayerBattleStatus2:: ; d062 ; bit 0 - X Accuracy effect ; bit 1 - protected by "mist" ; bit 2 - focus energy effect @@ -1894,104 +1983,104 @@ wPlayerBattleStatus2:: ; d063 ; bit 7 - leech seeded ds 1 -wPlayerBattleStatus3:: ; d064 +wPlayerBattleStatus3:: ; d063 ; bit 0 - toxic ; bit 1 - light screen ; bit 2 - reflect ; bit 3 - tranformed ds 1 -wEnemyStatsToDouble:: ; d065 +wEnemyStatsToDouble:: ; d064 ; always 0 ds 1 -wEnemyStatsToHalve:: ; d066 +wEnemyStatsToHalve:: ; d065 ; always 0 ds 1 -wEnemyBattleStatus1:: ; d067 +wEnemyBattleStatus1:: ; d066 ds 1 -wEnemyBattleStatus2:: ; d068 +wEnemyBattleStatus2:: ; d067 ds 1 -wEnemyBattleStatus3:: ; d069 +wEnemyBattleStatus3:: ; d068 ds 1 -wPlayerNumAttacksLeft:: +wPlayerNumAttacksLeft:: ; d069 ; when the player is attacking multiple times, the number of attacks left ds 1 -wPlayerConfusedCounter:: ; d06b +wPlayerConfusedCounter:: ; d06a ds 1 -wPlayerToxicCounter:: ; d06c +wPlayerToxicCounter:: ; d06b ds 1 -wPlayerDisabledMove:: ; d06d +wPlayerDisabledMove:: ; d06c ; high nibble: which move is disabled (1-4) ; low nibble: disable turns left ds 1 ds 1 -wEnemyNumAttacksLeft:: ; d06f +wEnemyNumAttacksLeft:: ; d06e ; when the enemy is attacking multiple times, the number of attacks left ds 1 -wEnemyConfusedCounter:: ; d070 +wEnemyConfusedCounter:: ; d06f ds 1 -wEnemyToxicCounter:: ; d071 +wEnemyToxicCounter:: ; d070 ds 1 -wEnemyDisabledMove:: ; d072 +wEnemyDisabledMove:: ; d071 ; high nibble: which move is disabled (1-4) ; low nibble: disable turns left ds 1 ds 1 -wPlayerNumHits:: ; d074 +wPlayerNumHits:: ; d073 ; number of hits by player in attacks like Double Slap, etc. -wPlayerBideAccumulatedDamage:: ; d074 +wPlayerBideAccumulatedDamage:: ; d073 ; the amount of damage accumulated by the player while biding (2 bytes) -wUnknownSerialCounter2:: ; d075 +wUnknownSerialCounter2:: ; d073 ; 2 bytes ds 4 -wEscapedFromBattle:: +wEscapedFromBattle:: ; d077 ; non-zero when an item or move that allows escape from battle was used ds 1 -wAmountMoneyWon:: ; d079 +wAmountMoneyWon:: ; d078 ; 3-byte BCD number -wObjectToHide:: ; d079 +wObjectToHide:: ; d078 ds 1 -wObjectToShow:: ; d07a +wObjectToShow:: ; d079 ds 1 ds 1 -wDefaultMap:: ; d07c +wDefaultMap:: ; d07b ; the map you will start at when the debug bit is set -wMenuItemOffset:: ; d07c +wMenuItemOffset:: ; d07b -wAnimationID:: ; d07c +wAnimationID:: ; d07b ; ID number of the current battle animation ds 1 -wNamingScreenType:: ; d07d +wNamingScreenType:: ; d07c -wPartyMenuTypeOrMessageID:: ; d07d +wPartyMenuTypeOrMessageID:: ; d07c -wTempTilesetNumTiles:: ; d07d +wTempTilesetNumTiles:: ; d07c ; temporary storage for the number of tiles in a tileset ds 1 -wSavedListScrollOffset:: ; d07e +wSavedListScrollOffset:: ; d07d ; used by the pokemart code to save the existing value of wListScrollOffset ; so that it can be restored when the player is done with the pokemart NPC ds 1 @@ -1999,71 +2088,71 @@ wSavedListScrollOffset:: ; d07e ds 2 ; base coordinates of frame block -wBaseCoordX:: ; d081 +wBaseCoordX:: ; d080 ds 1 -wBaseCoordY:: ; d082 +wBaseCoordY:: ; d081 ds 1 ; low health alarm counter/enable ; high bit = enable, others = timer to cycle frequencies -wLowHealthAlarm:: ds 1 ; d083 +wLowHealthAlarm:: ds 1 ; d082 -wFBTileCounter:: ; d084 +wFBTileCounter:: ; d083 ; counts how many tiles of the current frame block have been drawn ds 1 -wMovingBGTilesCounter2:: ; d085 +wMovingBGTilesCounter2:: ; d084 ds 1 -wSubAnimFrameDelay:: ; d086 +wSubAnimFrameDelay:: ; d085 ; duration of each frame of the current subanimation in terms of screen refreshes ds 1 -wSubAnimCounter:: ; d087 +wSubAnimCounter:: ; d086 ; counts the number of subentries left in the current subanimation ds 1 -wSaveFileStatus:: ; d088 +wSaveFileStatus:: ; d087 ; 1 = no save file or save file is corrupted ; 2 = save file exists and no corruption has been detected ds 1 -wNumFBTiles:: ; d089 +wNumFBTiles:: ; d088 ; number of tiles in current battle animation frame block ds 1 -wFlashScreenLongCounter:: ; d08a +wFlashScreenLongCounter:: ; d089 -wSpiralBallsBaseY:: ; d08a +wSpiralBallsBaseY:: ; d089 -wFallingObjectMovementByte:: ; d08a +wFallingObjectMovementByte:: ; d089 ; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8) ; bit 7: direction; 0 = right, 1 = left -wNumShootingBalls:: ; d08a +wNumShootingBalls:: ; d089 -wTradedMonMovingRight:: ; d08a +wTradedMonMovingRight:: ; d089 ; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa -wOptionsInitialized:: ; d08a +wOptionsInitialized:: ; d089 -wNewSlotMachineBallTile:: ; d08a +wNewSlotMachineBallTile:: ; d089 -wCoordAdjustmentAmount:: ; d08a +wCoordAdjustmentAmount:: ; d089 ; how much to add to the X/Y coord -wUnusedD08A:: ; d08a +wUnusedD08A:: ; d089 ds 1 -wSpiralBallsBaseX:: ; d08b +wSpiralBallsBaseX:: ; d08a -wNumFallingObjects:: ; d08b +wNumFallingObjects:: ; d08a -wSlideMonDelay:: ; d08b +wSlideMonDelay:: ; d08a -wAnimCounter:: ; d08b +wAnimCounter:: ; d08a ; generic counter variable for various animations -wSubAnimTransform:: ; d08b +wSubAnimTransform:: ; d08a ; controls what transformations are applied to the subanimation ; 01: flip horizontally and vertically ; 02: flip horizontally and translate downwards 40 pixels @@ -2071,52 +2160,52 @@ wSubAnimTransform:: ; d08b ; 04: reverse the subanimation ds 1 -wEndBattleWinTextPointer:: ; d08c +wEndBattleWinTextPointer:: ; d08b ds 2 -wEndBattleLoseTextPointer:: ; d08e +wEndBattleLoseTextPointer:: ; d08d ds 2 ds 2 -wEndBattleTextRomBank:: ; d092 +wEndBattleTextRomBank:: ; d091 ds 1 ds 1 -wSubAnimAddrPtr:: ; d094 +wSubAnimAddrPtr:: ; d093 ; the address _of the address_ of the current subanimation entry ds 2 -wSlotMachineAllowMatchesCounter:: ; d096 +wSlotMachineAllowMatchesCounter:: ; d095 ; If non-zero, the allow matches flag is always set. ; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is ; the only way it can increase. Winning certain payout amounts will decrement it ; or zero it. -wSubAnimSubEntryAddr:: ; d096 +wSubAnimSubEntryAddr:: ; d095 ; the address of the current subentry of the current subanimation ds 2 ds 2 -wOutwardSpiralTileMapPointer:: ; d09a +wOutwardSpiralTileMapPointer:: ; d099 ds 1 -wPartyMenuAnimMonEnabled:: ; d09b +wPartyMenuAnimMonEnabled:: ; d09a -wTownMapSpriteBlinkingEnabled:: ; d09b +wTownMapSpriteBlinkingEnabled:: ; d09a ; non-zero when enabled. causes nest locations to blink on and off. ; the town selection cursor will blink regardless of what this value is -wUnusedD09B:: ; d09b +wUnusedD09B:: ; d09a ds 1 -wFBDestAddr:: ; d09c +wFBDestAddr:: ; d09b ; current destination address in OAM for frame blocks (big endian) ds 2 -wFBMode:: ; d09e +wFBMode:: ; d09d ; controls how the frame blocks are put together to form frames ; specifically, after finishing drawing the frame block, the frame block's mode determines what happens ; 00: clean OAM buffer and delay @@ -2125,172 +2214,172 @@ wFBMode:: ; d09e ; 04: delay, without cleaning OAM buffer, and do not advance [wFBDestAddr], so that the next frame block will overwrite this one ds 1 -wLinkCableAnimBulgeToggle:: ; d09f +wLinkCableAnimBulgeToggle:: ; d09e ; 0 = small ; 1 = big -wIntroNidorinoBaseTile:: ; d09f +wIntroNidorinoBaseTile:: ; d09e -wOutwardSpiralCurrentDirection:: ; d09f +wOutwardSpiralCurrentDirection:: ; d09e -wDropletTile:: ; d09f +wDropletTile:: ; d09e -wNewTileBlockID:: ; d09f +wNewTileBlockID:: ; d09e -wWhichBattleAnimTileset:: ; d09f +wWhichBattleAnimTileset:: ; d09e -wSquishMonCurrentDirection:: ; d09f +wSquishMonCurrentDirection:: ; d09e ; 0 = left ; 1 = right -wSlideMonUpBottomRowLeftTile:: ; d09f +wSlideMonUpBottomRowLeftTile:: ; d09e ; the tile ID of the leftmost tile in the bottom row in AnimationSlideMonUp_ ds 1 -wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank +wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank ; d09f -wSpriteCurPosX:: ; d0a1 +wSpriteCurPosX:: ; d0a0 ds 1 -wSpriteCurPosY:: ; d0a2 +wSpriteCurPosY:: ; d0a1 ds 1 -wSpriteWidth:: ; d0a3 +wSpriteWidth:: ; d0a2 ds 1 -wSpriteHeight:: ; d0a4 +wSpriteHeight:: ; d0a3 ds 1 -wSpriteInputCurByte:: ; d0a5 +wSpriteInputCurByte:: ; d0a4 ; current input byte ds 1 -wSpriteInputBitCounter:: ; d0a6 +wSpriteInputBitCounter:: ; d0a5 ; bit offset of last read input bit ds 1 -wSpriteOutputBitOffset:: ; d0a7; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data) +wSpriteOutputBitOffset:: ; d0a6; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data) ; 3 -> XX000000 1st column ; 2 -> 00XX0000 2nd column ; 1 -> 0000XX00 3rd column ; 0 -> 000000XX 4th column ds 1 -wSpriteLoadFlags:: ; d0a8 +wSpriteLoadFlags:: ; d0a7 ; bit 0 determines used buffer (0 -> $a188, 1 -> $a310) ; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation) ds 1 -wSpriteUnpackMode:: ; d0a9 +wSpriteUnpackMode:: ; d0a8 ds 1 -wSpriteFlipped:: ; d0aa +wSpriteFlipped:: ; d0a9 ds 1 -wSpriteInputPtr:: ; d0ab +wSpriteInputPtr:: ; d0aa ; pointer to next input byte ds 2 -wSpriteOutputPtr:: ; d0ad +wSpriteOutputPtr:: ; d0ac ; pointer to current output byte ds 2 -wSpriteOutputPtrCached:: ; d0af +wSpriteOutputPtrCached:: ; d0ae ; used to revert pointer for different bit offsets ds 2 -wSpriteDecodeTable0Ptr:: ; d0b1 +wSpriteDecodeTable0Ptr:: ; d0b0 ; pointer to differential decoding table (assuming initial value 0) ds 2 -wSpriteDecodeTable1Ptr:: ; d0b3 +wSpriteDecodeTable1Ptr:: ; d0b2 ; pointer to differential decoding table (assuming initial value 1) ds 2 -wd0b5:: ds 1 ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things +wd0b5:: ds 1 ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things ; d0b4 -wNameListType:: ; d0b6 +wNameListType:: ; d0b5 ds 1 -wPredefBank:: ; d0b7 +wPredefBank:: ; d0b6 ds 1 -wMonHeader:: ; d0b8 +wMonHeader:: ; d0b7 -wMonHIndex:: ; d0b8 +wMonHIndex:: ; d0b7 ; In the ROM base stats data stucture, this is the dex number, but it is ; overwritten with the internal index number after the header is copied to WRAM. ds 1 -wMonHBaseStats:: ; d0b9 -wMonHBaseHP:: ; d0b9 +wMonHBaseStats:: ; d0b8 +wMonHBaseHP:: ; d0b8 ds 1 -wMonHBaseAttack:: ; d0ba +wMonHBaseAttack:: ; d0b9 ds 1 -wMonHBaseDefense:: ; d0bb +wMonHBaseDefense:: ; d0ba ds 1 -wMonHBaseSpeed:: ; d0bc +wMonHBaseSpeed:: ; d0bb ds 1 -wMonHBaseSpecial:: ; d0bd +wMonHBaseSpecial:: ; d0bc ds 1 -wMonHTypes:: ; d0be -wMonHType1:: ; d0be +wMonHTypes:: ; d0bd +wMonHType1:: ; d0bd ds 1 -wMonHType2:: ; d0bf +wMonHType2:: ; d0be ds 1 -wMonHCatchRate:: ; d0c0 +wMonHCatchRate:: ; d0bf ds 1 -wMonHBaseEXP:: ; d0c1 +wMonHBaseEXP:: ; d0c0 ds 1 -wMonHSpriteDim:: ; d0c2 +wMonHSpriteDim:: ; d0c1 ds 1 -wMonHFrontSprite:: ; d0c3 +wMonHFrontSprite:: ; d0c2 ds 2 -wMonHBackSprite:: ; d0c5 +wMonHBackSprite:: ; d0c4 ds 2 -wMonHMoves:: ; d0c7 +wMonHMoves:: ; d0c6 ds 4 -wMonHGrowthRate:: ; d0cb +wMonHGrowthRate:: ; d0ca ds 1 -wMonHLearnset:: ; d0cc +wMonHLearnset:: ; d0cb ; bit field flag_array 50 + 5 ds 1 -wSavedTilesetType:: ; d0d4 +wSavedTilesetType:: ; d0d3 ; saved at the start of a battle and then written back at the end of the battle ds 1 ds 2 -wDamage:: ; d0d7 +wDamage:: ; d0d6 ds 2 ds 2 -wRepelRemainingSteps:: ; d0db +wRepelRemainingSteps:: ; d0da ds 1 -wMoves:: ; d0dc +wMoves:: ; d0db ; list of moves for FormatMovesString ds 4 -wMoveNum:: ; d0e0 +wMoveNum:: ; d0df ds 1 -wMovesString:: ; d0e1 +wMovesString:: ; d0e0 ds 56 -wUnusedD119:: ; d119 +wUnusedD119:: ; d118 ds 1 -wWalkBikeSurfStateCopy:: ; d11a +wWalkBikeSurfStateCopy:: ; d119 ; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything ds 1 -wInitListType:: ; d11b +wInitListType:: ; d11a ; the type of list for InitList to init ds 1 -wCapturedMonSpecies:: ; d11c +wCapturedMonSpecies:: ; d11b ; 0 if no mon was captured ds 1 -wFirstMonsNotOutYet:: ; d11d +wFirstMonsNotOutYet:: ; d11c ; Non-zero when the first player mon and enemy mon haven't been sent out yet. ; It prevents the game from asking if the player wants to choose another mon ; when the enemy sends out their first mon and suppresses the "no will to fight" @@ -2302,74 +2391,74 @@ wPokeBallCaptureCalcTemp:: ; d11e ; lower nybble: number of shakes ; upper nybble: number of animations to play -wPokeBallAnimData:: ; d11e +wPokeBallAnimData:: ; d11d -wUsingPPUp:: ; d11e +wUsingPPUp:: ; d11d -wMaxPP:: ; d11e +wMaxPP:: ; d11d ; 0 for player, non-zero for enemy -wCalculateWhoseStats:: ; d11e +wCalculateWhoseStats:: ; d11d -wTypeEffectiveness:: ; d11e +wTypeEffectiveness:: ; d11d -wMoveType:: ; d11e +wMoveType:: ; d11d -wNumSetBits:: ; d11e +wNumSetBits:: ; d11d wd11e:: ds 1 ; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits -wForcePlayerToChooseMon:: ; d11f +wForcePlayerToChooseMon:: ; d11e ; When this value is non-zero, the player isn't allowed to exit the party menu ; by pressing B and not choosing a mon. ds 1 -wNumRunAttempts:: +wNumRunAttempts:: ; d11f ; number of times the player has tried to run from battle ds 1 -wEvolutionOccurred:: ; d121 +wEvolutionOccurred:: ; d120 ds 1 -wVBlankSavedROMBank:: ; d122 +wVBlankSavedROMBank:: ; d121 ds 1 -wFarCopyDataSavedROMBank:: ; d123 +wFarCopyDataSavedROMBank:: ; d122 ds 1 -wIsKeyItem:: ; d124 +wIsKeyItem:: ; d123 ds 1 -wTextBoxID:: ; d125 +wTextBoxID:: ; d124 ds 1 -wCurrentMapScriptFlags:: ds 1 ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value +wCurrentMapScriptFlags:: ds 1 ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value ; d125 -wCurEnemyLVL:: ; d127 +wCurEnemyLVL:: ; d126 ds 1 -wItemListPointer:: ; d128 +wItemListPointer:: ; d127 ; pointer to list of items terminated by $FF ds 2 -wListCount:: +wListCount:: ; d129 ; number of entries in a list ds 1 -wLinkState:: ; d12b +wLinkState:: ; d12a ds 1 -wTwoOptionMenuID:: ; d12c +wTwoOptionMenuID:: ; d12b ds 1 -wChosenMenuItem:: ; d12d +wChosenMenuItem:: ; d12c ; the id of the menu item the player ultimately chose -wOutOfBattleBlackout:: ; d12d +wOutOfBattleBlackout:: ; d12c ; non-zero when the whole party has fainted due to out-of-battle poison damage ds 1 -wMenuExitMethod:: ; d12e +wMenuExitMethod:: ; d12d ; the way the user exited a menu ; for list menus and the buy/sell/quit menu: ; $01 = the user pressed A to choose a menu item @@ -2379,118 +2468,118 @@ wMenuExitMethod:: ; d12e ; $02 = the user pressed B or pressed A with the second menu item selected ds 1 -wDungeonWarpDataEntrySize:: ; d12f +wDungeonWarpDataEntrySize:: ; d12e ; the size is always 6, so they didn't need a variable in RAM for this -wWhichPewterGuy:: ; d12f +wWhichPewterGuy:: ; d12e ; 0 = museum guy ; 1 = gym guy -wWhichPrizeWindow:: ; d12f +wWhichPrizeWindow:: ; d12e ; there are 3 windows, from 0 to 2 -wGymGateTileBlock:: ; d12f +wGymGateTileBlock:: ; d12e ; a horizontal or vertical gate block ds 1 -wSavedSpriteScreenY:: ; d130 +wSavedSpriteScreenY:: ; d12f ds 1 -wSavedSpriteScreenX:: ; d131 +wSavedSpriteScreenX:: ; d130 ds 1 -wSavedSpriteMapY:: ; d132 +wSavedSpriteMapY:: ; d131 ds 1 -wSavedSpriteMapX:: ; d133 +wSavedSpriteMapX:: ; d132 ds 1 ds 5 -wWhichPrize:: ; d139 +wWhichPrize:: ; d138 ds 1 -wIgnoreInputCounter:: ; d13a +wIgnoreInputCounter:: ; d139 ; counts downward each frame ; when it hits 0, bit 5 (ignore input bit) of wd730 is reset ds 1 -wStepCounter:: ; d13b +wStepCounter:: ; d13a ; counts down once every step ds 1 -wNumberOfNoRandomBattleStepsLeft:: ; d13c +wNumberOfNoRandomBattleStepsLeft:: ; d13b ; after a battle, you have at least 3 steps before a random battle can occur ds 1 -wPrize1:: ; d13d +wPrize1:: ; d13c ds 1 -wPrize2:: ; d13e +wPrize2:: ; d13d ds 1 -wPrize3:: ; d13f +wPrize3:: ; d13e ds 1 ds 1 -wSerialRandomNumberListBlock:: ; d141 +wSerialRandomNumberListBlock:: ; d140 ; the first 7 bytes are the preamble -wPrize1Price:: ; d141 +wPrize1Price:: ; d140 ds 2 -wPrize2Price:: ; d143 +wPrize2Price:: ; d142 ds 2 -wPrize3Price:: ; d145 +wPrize3Price:: ; d144 ds 2 ds 1 -wLinkBattleRandomNumberList:: ; d148 +wLinkBattleRandomNumberList:: ; d147 ; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex ds 10 -wSerialPlayerDataBlock:: ; d152 +wSerialPlayerDataBlock:: ; d151 ; the first 6 bytes are the preamble -wPseudoItemID:: ; d152 +wPseudoItemID:: ; d151 ; When a real item is being used, this is 0. ; When a move is acting as an item, this is the ID of the item it's acting as. ; For example, out-of-battle Dig is executed using a fake Escape Rope item. In ; that case, this would be ESCAPE_ROPE. ds 1 -wUnusedD153:: ; d153 +wUnusedD153:: ; d152 ds 1 ds 2 -wEvoStoneItemID:: ; d156 +wEvoStoneItemID:: ; d155 ds 1 -wSavedNPCMovementDirections2Index:: ; d157 +wSavedNPCMovementDirections2Index:: ; d156 ds 1 -wPlayerName:: ; d158 +wPlayerName:: ; d157 ds NAME_LENGTH wPartyDataStart:: -wPartyCount:: ds 1 ; d163 -wPartySpecies:: ds PARTY_LENGTH ; d164 -wPartyEnd:: ds 1 ; d16a +wPartyCount:: ds 1 ; d162 +wPartySpecies:: ds PARTY_LENGTH ; d163 +wPartyEnd:: ds 1 ; d169 wPartyMons:: -wPartyMon1:: party_struct wPartyMon1 ; d16b -wPartyMon2:: party_struct wPartyMon2 ; d197 -wPartyMon3:: party_struct wPartyMon3 ; d1c3 -wPartyMon4:: party_struct wPartyMon4 ; d1ef -wPartyMon5:: party_struct wPartyMon5 ; d21b -wPartyMon6:: party_struct wPartyMon6 ; d247 +wPartyMon1:: party_struct wPartyMon1 ; d16a +wPartyMon2:: party_struct wPartyMon2 ; d196 +wPartyMon3:: party_struct wPartyMon3 ; d1c2 +wPartyMon4:: party_struct wPartyMon4 ; d1ee +wPartyMon5:: party_struct wPartyMon5 ; d21a +wPartyMon6:: party_struct wPartyMon6 ; d246 -wPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d273 -wPartyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d2b5 +wPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d272 +wPartyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d2b4 wPartyMonNicksEnd:: wPartyDataEnd:: @@ -2498,29 +2587,29 @@ wPartyDataEnd:: wMainDataStart:: -wPokedexOwned:: ; d2f6 +wPokedexOwned:: ; d2f5 flag_array NUM_POKEMON wPokedexOwnedEnd:: -wPokedexSeen:: ; d30a +wPokedexSeen:: ; d309 flag_array NUM_POKEMON wPokedexSeenEnd:: -wNumBagItems:: ; d31d +wNumBagItems:: ; d31c ds 1 -wBagItems:: ; d31e +wBagItems:: ; d31d ; item, quantity ds BAG_ITEM_CAPACITY * 2 ds 1 ; end -wPlayerMoney:: ; d347 +wPlayerMoney:: ; d346 ds 3 ; BCD -wRivalName:: ; d34a +wRivalName:: ; d349 ds NAME_LENGTH -wOptions:: ; d355 +wOptions:: ; d354 ; bit 7 = battle animation ; 0: On ; 1: Off @@ -2533,228 +2622,229 @@ wOptions:: ; d355 ; 5: Slow ds 1 -wObtainedBadges:: ; d356 +wObtainedBadges:: ; d355 flag_array 8 ds 1 -wLetterPrintingDelayFlags:: ; d358 +wLetterPrintingDelayFlags:: ; d357 ; bit 0: If 0, limit the delay to 1 frame. Note that this has no effect if ; the delay has been disabled entirely through bit 1 of this variable ; or bit 6 of wd730. ; bit 1: If 0, no delay. ds 1 -wPlayerID:: ; d359 +wPlayerID:: ; d358 ds 2 -wMapMusicSoundID:: ; d35b +wMapMusicSoundID:: ; d35a ds 1 -wMapMusicROMBank:: ; d35c +wMapMusicROMBank:: ; d35b ds 1 -wMapPalOffset:: ; d35d +wMapPalOffset:: ; d35c ; offset subtracted from FadePal4 to get the background and object palettes for the current map ; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4 ds 1 -wCurMap:: ; d35e +wCurMap:: ; d35d ds 1 -wCurrentTileBlockMapViewPointer:: ; d35f +wCurrentTileBlockMapViewPointer:: ; d35e ; pointer to the upper left corner of the current view in the tile block map ds 2 -wYCoord:: ; d361 +wYCoord:: ; d360 ; player’s position on the current map ds 1 -wXCoord:: ; d362 +wXCoord:: ; d361 ds 1 -wYBlockCoord:: ; d363 +wYBlockCoord:: ; d362 ; player's y position (by block) ds 1 -wXBlockCoord:: ; d364 +wXBlockCoord:: ; d363 ds 1 -wLastMap:: ; d365 +wLastMap:: ; d364 ds 1 -wUnusedD366:: ; d366 +wUnusedD366:: ; d365 ds 1 -wCurMapTileset:: ; d367 +wCurMapTileset:: ; d366 ds 1 -wCurMapHeight:: ; d368 +wCurMapHeight:: ; d367 ; blocks ds 1 -wCurMapWidth:: ; d369 +wCurMapWidth:: ; d368 ; blocks ds 1 -wMapDataPtr:: ; d36a +wMapDataPtr:: ; d369 ds 2 -wMapTextPtr:: ; d36c +wMapTextPtr:: ; d36b ds 2 -wMapScriptPtr:: ; d36e +wMapScriptPtr:: ; d36d ds 2 -wMapConnections:: ; d370 +wMapConnections:: ; d36f ; connection byte ds 1 -wMapConn1Ptr:: ; d371 +wMapConn1Ptr:: ; d370 ds 1 -wNorthConnectionStripSrc:: ; d372 +wNorthConnectionStripSrc:: ; d371 ds 2 -wNorthConnectionStripDest:: ; d374 +wNorthConnectionStripDest:: ; d373 ds 2 -wNorthConnectionStripWidth:: ; d376 +wNorthConnectionStripWidth:: ; d375 ds 1 -wNorthConnectedMapWidth:: ; d377 +wNorthConnectedMapWidth:: ; d376 ds 1 -wNorthConnectedMapYAlignment:: ; d378 +wNorthConnectedMapYAlignment:: ; d377 ds 1 -wNorthConnectedMapXAlignment:: ; d379 +wNorthConnectedMapXAlignment:: ; d378 ds 1 -wNorthConnectedMapViewPointer:: ; d37a +wNorthConnectedMapViewPointer:: ; d379 ds 2 -wMapConn2Ptr:: ; d37c +wMapConn2Ptr:: ; d37b ds 1 -wSouthConnectionStripSrc:: ; d37d +wSouthConnectionStripSrc:: ; d37c ds 2 -wSouthConnectionStripDest:: ; d37f: +wSouthConnectionStripDest:: ; d37e ds 2 -wSouthConnectionStripWidth:: ; d381 +wSouthConnectionStripWidth:: ; d380 ds 1 -wSouthConnectedMapWidth:: ; d382 +wSouthConnectedMapWidth:: ; d381 ds 1 -wSouthConnectedMapYAlignment:: ; d383 +wSouthConnectedMapYAlignment:: ; d382 ds 1 -wSouthConnectedMapXAlignment:: ; d384 +wSouthConnectedMapXAlignment:: ; d383 ds 1 -wSouthConnectedMapViewPointer:: ; d385 +wSouthConnectedMapViewPointer:: ; d384 ds 2 -wMapConn3Ptr:: ; d387 +wMapConn3Ptr:: ; d386 ds 1 -wWestConnectionStripSrc:: ; d388 +wWestConnectionStripSrc:: ; d387 ds 2 -wWestConnectionStripDest:: ; d38a +wWestConnectionStripDest:: ; d389 ds 2 -wWestConnectionStripHeight:: ; d38c +wWestConnectionStripHeight:: ; d38b ds 1 -wWestConnectedMapWidth:: ; d38d +wWestConnectedMapWidth:: ; d38c ds 1 -wWestConnectedMapYAlignment:: ; d38e +wWestConnectedMapYAlignment:: ; d38d ds 1 -wWestConnectedMapXAlignment:: ; d38f +wWestConnectedMapXAlignment:: ; d38e ds 1 -wWestConnectedMapViewPointer:: ; d390 +wWestConnectedMapViewPointer:: ; d38f ds 2 -wMapConn4Ptr:: ; d392 +wMapConn4Ptr:: ; d391 ds 1 -wEastConnectionStripSrc:: ; d393 +wEastConnectionStripSrc:: ; d392 ds 2 -wEastConnectionStripDest:: ; d395 +wEastConnectionStripDest:: ; d394 ds 2 -wEastConnectionStripHeight:: ; d397 +wEastConnectionStripHeight:: ; d396 ds 1 -wEastConnectedMapWidth:: ; d398 +wEastConnectedMapWidth:: ; d397 ds 1 -wEastConnectedMapYAlignment:: ; d399 +wEastConnectedMapYAlignment:: ; d398 ds 1 -wEastConnectedMapXAlignment:: ; d39a +wEastConnectedMapXAlignment:: ; d399 ds 1 -wEastConnectedMapViewPointer:: ; d39b +wEastConnectedMapViewPointer:: ; d39a ds 2 -wSpriteSet:: ; d39d +wSpriteSet:: ; d39c ; sprite set for the current map (11 sprite picture ID's) ds 11 -wSpriteSetID:: ; d3a8 +wSpriteSetID:: ; d3a7 ; sprite set ID for the current map ds 1 -wObjectDataPointerTemp:: ; d3a9 +wObjectDataPointerTemp:: ; d3a8 ds 2 ds 2 -wMapBackgroundTile:: ; d3ad +wMapBackgroundTile:: ; d3ac ; the tile shown outside the boundaries of the map ds 1 -wNumberOfWarps:: ; d3ae +wNumberOfWarps:: ; d3ad ; number of warps in current map ds 1 -wWarpEntries:: ; d3af +wWarpEntries:: ; d3ae ; current map warp entries ds 128 -wDestinationWarpID:: ; d42f +wDestinationWarpID:: ; d42e ; if $ff, the player's coordinates are not updated when entering the map ds 1 wPikachuOverworldStateFlags:: ds 1 ; d42f -wd431:: ds 1 ; d430 +wPikachuSpawnState:: ds 1 ; d430 wd432:: ds 1 ; d431 wd433:: ds 1 ; d432 -wd434:: ds 1 -wd435:: ds 1 -wd436:: ds 1 -wPikachuFollowCommandBufferSize:: ds 1 -wPikachuFollowCommandBuffer:: ds 16 +wd434:: ds 1 ; d433 +wd435:: ds 1 ; d434 +wd436:: ds 1 ; d435 +wPikachuFollowCommandBufferSize:: ds 1 ; d436 +wPikachuFollowCommandBuffer:: ds 16 ; d437 wExpressionNumber:: ; d447 ds 1 -wExpressionNumber2:: +wExpressionNumber2:: ; d448 ds 1 + +wPikachuMovementScriptBank:: ds 1 ; d449 +wPikachuMovementScriptAddress:: dw ; d44a +wd44d:: ds 1 ; d44c -wd44a:: ds 1 ; d449 -wd44b:: ds 1 -wd44c:: ds 1 -wd44d:: ds 1 -wPikaPicAnimPointer:: dw ; d44d +wCurPikaMovementData:: ; +wPikaPicAnimPointer:: dw ; d44d wPikaPicAnimPointerSetupFinished:: ds 1 ; d44f wPikaPicAnimCurGraphicID:: ds 1 wPikaPicAnimTimer:: ds 2 ; d451 @@ -2767,156 +2857,157 @@ wd456:: ds 1 ; d456 wd457:: ds 1 ; d457 wd458:: ds 1 ; d458 wCurPikaPicAnimObject:: ; d459 -wCurPikaPicAnimObjectIndex:: ds 1 -wCurPikaPicAnimObjectGraphicID:: dw - ds 19 +wCurPikaPicAnimObjectIndex:: ds 1 ; d459 +wCurPikaPicAnimObjectGraphicID:: dw ; d45a + ds 2 +wCurPikaMovementDataEnd:: ; d45e + ds 17 wPikachuHappiness:: ds 1 ; d46f wPikachuMood:: ds 1 ; d470 -wd472:: ds 1 -wd473:: ds 1 +wd472:: ds 1 ; d471 +wd473:: ds 1 ; d472 ds 1 -wd475:: ds 1 +wd475:: ds 1 ; d474 ds 4 -wd47a:: ds 1 +wd47a:: ds 1 ; d479 ds 24 - -wPreventBlackout:: ds 1 ; d492 - + +wd492:: ds 1 ; d492 + + ds 1 + +wSurfingMinigameHiScore:: ds 2 ; 4-digit BCD little-endian ds 1 -wd495:: ds 1 -wd496:: ds 1 -wd497:: ds 1 -wd498:: ds 1 - +wPrinterSettings:: ds 1 wUnknownSerialFlag_d499:: ds 1 ; d498 -wUnknownSerialFlag_d49a:: ds 1 ; d499 -wUnknownSerialFlag_d49b:: ds 1 ; d49a +wPrinterConnectionOpen:: ds 1 ; d499 +wPrinterOpcode:: ds 1 ; d49a wd49c:: ds 1 ; d49b ds 19 -wNumSigns:: ; d4b0 +wNumSigns:: ; d4af ; number of signs in the current map (up to 16) ds 1 -wSignCoords:: ; d4b1 +wSignCoords:: ; d4b0 ; 2 bytes each ; Y, X ds 32 -wSignTextIDs:: ; d4d1 +wSignTextIDs:: ; d4d0 ds 16 -wNumSprites:: ; d4e1 +wNumSprites:: ; d4e0 ; number of sprites on the current map ds 1 ; these two variables track the X and Y offset in blocks from the last special warp used ; they don't seem to be used for anything -wYOffsetSinceLastSpecialWarp:: ; d4e2 +wYOffsetSinceLastSpecialWarp:: ; d4e1 ds 1 -wXOffsetSinceLastSpecialWarp:: ; d4e3 +wXOffsetSinceLastSpecialWarp:: ; d4e2 ds 1 -wMapSpriteData:: ; d4e4 +wMapSpriteData:: ; d4e3 ; two bytes per sprite (movement byte 2, text ID) ds 32 -wMapSpriteExtraData:: ; d504 +wMapSpriteExtraData:: ; d503 ; two bytes per sprite (trainer class/item ID, trainer set ID) ds 32 -wCurrentMapHeight2:: ; d524 +wCurrentMapHeight2:: ; d523 ; map height in 2x2 meta-tiles ds 1 -wCurrentMapWidth2:: ; d525 +wCurrentMapWidth2:: ; d524 ; map width in 2x2 meta-tiles ds 1 -wMapViewVRAMPointer:: ; d526 +wMapViewVRAMPointer:: ; d525 ; the address of the upper left corner of the visible portion of the BG tile map in VRAM ds 2 ; In the comments for the player direction variables below, "moving" refers to ; both walking and changing facing direction without taking a step. -wPlayerMovingDirection:: ; d528 +wPlayerMovingDirection:: ; d527 ; if the player is moving, the current direction ; if the player is not moving, zero ; map scripts write to this in order to change the player's facing direction ds 1 -wPlayerLastStopDirection:: ; d529 +wPlayerLastStopDirection:: ; d528 ; the direction in which the player was moving before the player last stopped ds 1 -wPlayerDirection:: ; d52a +wPlayerDirection:: ; d529 ; if the player is moving, the current direction ; if the player is not moving, the last the direction in which the player moved ds 1 -wTilesetBank:: ; d52b +wTilesetBank:: ; d52a ds 1 -wTileSetBlocksPtr:: ; d52c +wTileSetBlocksPtr:: ; d52b ; maps blocks (4x4 tiles) to tiles ds 2 -wTilesetGFXPtr:: ; d52e +wTilesetGFXPtr:: ; d52d ds 2 -wTilesetCollisionPtr:: ; d530 +wTilesetCollisionPtr:: ; d52f ; list of all walkable tiles ds 2 -wTileSetTalkingOverTiles:: ; d532 +wTileSetTalkingOverTiles:: ; d531 ds 3 -wGrassTile:: ; d535 +wGrassTile:: ; d534 ds 1 ds 4 -wNumBoxItems:: ; d53a +wNumBoxItems:: ; d539 ds 1 -wBoxItems:: ; d53b +wBoxItems:: ; d53a ; item, quantity ds PC_ITEM_CAPACITY * 2 ds 1 ; end -wCurrentBoxNum:: ; d5a0 +wCurrentBoxNum:: ; d59f ; bits 0-6: box number ; bit 7: whether the player has changed boxes before ds 2 -wNumHoFTeams:: ; d5a2 +wNumHoFTeams:: ; d5a1 ; number of HOF teams ds 1 -wUnusedD5A3:: ; d5a3 +wUnusedD5A3:: ; d5a2 ds 1 -wPlayerCoins:: ; d5a4 +wPlayerCoins:: ; d5a3 ds 2 ; BCD -wMissableObjectFlags:: ; d5a6 +wMissableObjectFlags:: ; d5a5 ; bit array of missable objects. set = removed ds 32 -wMissableObjectFlagsEnd:: +wMissableObjectFlagsEnd:: ; d5c5 ds 7 -wd5cd:: ds 1 ; temp copy of c1x2 (sprite facing/anim) +wd5cd:: ds 1 ; temp copy of c1x2 (sprite facing/anim) ; d5cc -wMissableObjectList:: ; d5ce +wMissableObjectList:: ; d5cd ; each entry consists of 2 bytes ; * the sprite ID (depending on the current map) ; * the missable object index (global, used for wMissableObjectFlags) @@ -3140,17 +3231,17 @@ wRoute18GateCurScript:: ; d668 ds 1 ds 78 -wGameProgressFlagsEnd:: +wGameProgressFlagsEnd:: ; d6b7 ds 56 -wObtainedHiddenItemsFlags:: +wObtainedHiddenItemsFlags:: ; d6ef ds 14 -wObtainedHiddenCoinsFlags:: +wObtainedHiddenCoinsFlags:: ; d6fd ds 2 -wWalkBikeSurfState:: ; d700 +wWalkBikeSurfState:: ; d6ff ; $00 = walking ; $01 = biking ; $02 = surfing @@ -3158,71 +3249,71 @@ wWalkBikeSurfState:: ; d700 ds 10 -wTownVisitedFlag:: ; d70b +wTownVisitedFlag:: ; d70a flag_array 13 -wSafariSteps:: ; d70d +wSafariSteps:: ; d70c ; starts at 502 ds 2 -wFossilItem:: ; d70f +wFossilItem:: ; d70e ; item given to cinnabar lab ds 1 -wFossilMon:: ; d710 +wFossilMon:: ; d70f ; mon that will result from the item ds 1 ds 2 -wEnemyMonOrTrainerClass:: ; d713 +wEnemyMonOrTrainerClass:: ; d712 ; trainer classes start at 200 ds 1 -wPlayerJumpingYScreenCoordsIndex:: ; d714 +wPlayerJumpingYScreenCoordsIndex:: ; d713 ds 1 -wRivalStarter:: ; d715 +wRivalStarter:: ; d714 ds 1 ds 1 -wPlayerStarter:: ; d717 +wPlayerStarter:: ; d716 ds 1 -wBoulderSpriteIndex:: ; d718 +wBoulderSpriteIndex:: ; d717 ; sprite index of the boulder the player is trying to push ds 1 -wLastBlackoutMap:: ; d719 +wLastBlackoutMap:: ; d718 ds 1 -wDestinationMap:: ; d71a +wDestinationMap:: ; d719 ; destination map (for certain types of special warps, not ordinary walking) ds 1 -wUnusedD71B:: ; d71b +wUnusedD71B:: ; d71a ds 1 -wTileInFrontOfBoulderAndBoulderCollisionResult:: ; d71c +wTileInFrontOfBoulderAndBoulderCollisionResult:: ; d71b ; used to store the tile in front of the boulder when trying to push a boulder ; also used to store the result of the collision check ($ff for a collision and $00 for no collision) ds 1 -wDungeonWarpDestinationMap:: ; d71d +wDungeonWarpDestinationMap:: ; d71c ; destination map for dungeon warps ds 1 -wWhichDungeonWarp:: ; d71e +wWhichDungeonWarp:: ; d71d ; which dungeon warp within the source map was used ds 1 -wUnusedD71F:: ; d71f +wUnusedD71F:: ; d71e ds 1 ds 8 -wd728:: ; d728 +wd728:: ; d727 ; bit 0: using Strength outside of battle ; bit 1: set by IsSurfingAllowed when surfing's allowed, but the caller resets it after checking the result ; bit 3: received Old Rod @@ -3234,19 +3325,19 @@ wd728:: ; d728 ds 1 -wBeatGymFlags:: ; d72a +wBeatGymFlags:: ; d729 ; redundant because it matches wObtainedBadges ; used to determine whether to show name on statue and in two NPC text scripts ds 1 ds 1 -wd72c:: ; d72c +wd72c:: ; d72b ; bit 0: if not set, the 3 minimum steps between random battles have passed ; bit 1: prevent audio fade out ds 1 -wd72d:: ; d72d +wd72d:: ; d72c ; This variable is used for temporary flags and as the destination map when ; warping to the Trade Center or Colosseum. ; bit 0: sprite facing directions have been initialised in the Trade Center @@ -3259,7 +3350,7 @@ wd72d:: ; d72d ; battles anyway). ds 1 -wd72e:: ; d72e +wd72e:: ; d72d ; bit 0: the player has received Lapras in the Silph Co. building ; bit 1: set in various places, but doesn't appear to have an effect ; bit 2: the player has healed pokemon at a pokemon center at least once @@ -3272,7 +3363,7 @@ wd72e:: ; d72e ds 1 -wd730:: ; d730 +wd730:: ; d72f ; bit 0: NPC sprite being moved by script ; bit 5: ignore joypad input ; bit 6: print text with no delay between each letter @@ -3281,7 +3372,7 @@ wd730:: ; d730 ds 1 -wd732:: ; d732 +wd732:: ; d731 ; bit 0: play time being counted ; bit 1: remnant of debug mode? not set by the game code. ; if it is set @@ -3295,7 +3386,7 @@ wd732:: ; d732 ; bit 6: map destination is [wLastBlackoutMap] (usually the last used pokemon center, but could be the player's house) ds 1 -wFlags_D733:: ; d733 +wFlags_D733:: ; d732 ; bit 0: running a test battle ; bit 1: prevent music from changing when entering new map ; bit 2: skip the joypad check in CheckWarpsNoCollision (used for the forced warp down the waterfall in the Seafoam Islands) @@ -3304,15 +3395,15 @@ wFlags_D733:: ; d733 ; bit 7: used fly out of battle ds 1 -wBeatLorelei:: ; d734 +wBeatLorelei:: ; d733 ; bit 1: set when you beat Lorelei and reset in Indigo Plateau lobby ; the game uses this to tell when Elite 4 events need to be reset ds 1 -wd735:: ; d735 +wd735:: ; d734 ds 1 -wd736:: ; d736 +wd736:: ; d735 ; bit 0: check if the player is standing on a door and make him walk down a step if so ; bit 1: the player is currently stepping down from a door ; bit 2: standing on a warp @@ -3320,196 +3411,70 @@ wd736:: ; d736 ; bit 7: player sprite spinning due to spin tiles (Rocket hidehout / Viridian Gym) ds 1 -wCompletedInGameTradeFlags:: ; d737 +wCompletedInGameTradeFlags:: ; d736 ds 2 ds 2 -wWarpedFromWhichWarp:: ; d73b +wWarpedFromWhichWarp:: ; d73a ds 1 -wWarpedFromWhichMap:: ; d73c +wWarpedFromWhichMap:: ; d73b ds 1 ds 2 -wCardKeyDoorY:: ; d73f +wCardKeyDoorY:: ; d73e ds 1 -wCardKeyDoorX:: ; d740 +wCardKeyDoorX:: ; d73f ds 1 ds 2 -wFirstLockTrashCanIndex:: ; d743 +wFirstLockTrashCanIndex:: ; d742 ds 1 -wSecondLockTrashCanIndex:: ; d744 +wSecondLockTrashCanIndex:: ; d743 ds 1 ds 2 -wEventFlags:: -wd747:: ds 3 ; below here are mostly in game flags -wd74a:: ds 1 +wEventFlags:: ; d746 +; below here are mostly in game flags -wd74b:: ; d74b +; d74b ; bit 0: Prof. Oak has lead the player to the north end of his lab ; bit 1: Prof. Oak has asked the player to choose a pokemon ; bit 2: the player and the rival have received their pokemon ; bit 3: the player has battled the rival in Oak's lab ; bit 4: Prof. Oak has given the player 5 pokeballs ; bit 5: received pokedex - ds 1 + flag_array NUM_EVENT_FLAGS -wd74c:: ds 2 -wd74e:: ds 3 -wd751:: ds 1 -wd752:: ds 2 -wd754:: ds 1 -wd755:: ds 5 -wd75a:: ds 1 -wd75b:: ds 3 -wd75e:: ds 1 -wd75f:: ds 5 -wd764:: ds 1 -wd765:: ds 1 -wd766:: ds 1 -wd767:: ds 1 -wd768:: ds 1 -wd769:: ds 3 -wd76c:: ds 5 -wd771:: ds 2 -wd773:: ds 4 -wd777:: ds 1 -wd778:: ds 4 -wd77c:: ds 1 -wd77d:: ds 1 -wd77e:: ds 5 -wd783:: ds 11 -wd78e:: ds 2 -wd790:: ds 2 -wd792:: ds 4 -wd796:: ds 2 -wd798:: ds 2 -wd79a:: ds 1 -wd79b:: ds 1 -wd79c:: ds 5 -wd7a1:: ds 2 -wd7a3:: ds 12 -wd7af:: ds 2 -wd7b1:: ds 2 -wd7b3:: ds 1 -wd7b4:: ds 5 -wd7b9:: ds 4 -wd7bd:: ds 2 -wd7bf:: ds 3 -wd7c2:: ds 1 -wd7c3:: ds 2 -wd7c5:: ds 1 -wd7c6:: ds 3 -wd7c9:: ds 4 -wd7cd:: ds 2 -wd7cf:: ds 2 -wd7d1:: ds 1 -wd7d2:: ds 1 -wd7d3:: ds 2 -wd7d5:: ds 1 -wd7d6:: ds 1 -wd7d7:: ds 1 -wd7d8:: ds 1 -wd7d9:: ds 2 -wd7db:: ds 2 -wd7dd:: ds 2 -wd7df:: ds 1 -wd7e0:: ds 1 -wd7e1:: ds 2 -wd7e3:: ds 2 -wd7e5:: ds 2 -wd7e7:: ds 1 -wd7e8:: ds 1 -wd7e9:: ds 2 -wd7eb:: ds 2 -wd7ed:: ds 1 -wd7ee:: ds 1 -wd7ef:: ds 1 -wd7f0:: ds 1 -wd7f1:: ds 1 -wd7f2:: ds 1 -wd7f3:: ds 2 -wd7f5:: ds 1 -wd7f6:: ds 9 -wd7ff:: ds 4 -wd803:: ds 2 -wd805:: ds 2 -wd807:: ds 2 -wd809:: ds 10 -wd813:: ds 2 -wd815:: ds 1 -wd816:: ds 1 -wd817:: ds 2 -wd819:: ds 2 -wd81b:: ds 10 -wd825:: ds 1 -wd826:: ds 1 -wd827:: ds 1 -wd828:: ds 1 -wd829:: ds 1 -wd82a:: ds 1 -wd82b:: ds 1 -wd82c:: ds 1 -wd82d:: ds 1 -wd82e:: ds 1 -wd82f:: ds 1 -wd830:: ds 1 -wd831:: ds 1 -wd832:: ds 1 -wd833:: ds 1 -wd834:: ds 1 -wd835:: ds 1 -wd836:: ds 1 -wd837:: ds 1 -wd838:: ds 15 -wd847:: ds 2 -wd849:: ds 2 -wd84b:: ds 12 -wd857:: ds 8 -wd85f:: ds 4 -wd863:: ds 1 -wd864:: ds 1 -wd865:: ds 1 -wd866:: ds 1 -wd867:: ds 2 -wd869:: ds 20 -wd87d:: ds 2 -wd87f:: ds 1 -wd880:: ds 1 -wd881:: ds 1 -wd882:: ds 5 - -wLinkEnemyTrainerName:: ; d887 +wLinkEnemyTrainerName:: ; d886 ; linked game's trainer name -wGrassRate:: ; d887 +wGrassRate:: ; d886 ds 1 -wGrassMons:: ; d888 +wGrassMons:: ; d887 ; ds 20 ds 11 ; Overload wGrassMons -wSerialEnemyDataBlock:: ; d893 +wSerialEnemyDataBlock:: ; d892 ds 9 -wEnemyPartyCount:: ds 1 ; d89c -wEnemyPartyMons:: ds PARTY_LENGTH + 1 ; d89d +wEnemyPartyCount:: ds 1 ; d89b +wEnemyPartyMons:: ds PARTY_LENGTH + 1 ; d89c -wWaterRate:: db ; d8a4 -wWaterMons:: db ; d8a5 +wWaterRate:: db ; d8a3 +wWaterMons:: db ; d8a4 ds wWaterRate - @ -wEnemyMons:: ; d8a4 +wEnemyMons:: ; d8a3 wEnemyMon1:: party_struct wEnemyMon1 wEnemyMon2:: party_struct wEnemyMon2 wEnemyMon3:: party_struct wEnemyMon3 @@ -3517,71 +3482,71 @@ wEnemyMon4:: party_struct wEnemyMon4 wEnemyMon5:: party_struct wEnemyMon5 wEnemyMon6:: party_struct wEnemyMon6 -wEnemyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d9ac -wEnemyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d9ee +wEnemyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d9ab +wEnemyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d9ed -wTrainerHeaderPtr:: ; da30 +wTrainerHeaderPtr:: ; da2f ds 2 ds 6 -wOpponentAfterWrongAnswer:: ; da38 +wOpponentAfterWrongAnswer:: ; da37 ; the trainer the player must face after getting a wrong answer in the Cinnabar ; gym quiz -wUnusedDA38:: ; da38 +wUnusedDA38:: ; da37 ds 1 -wCurMapScript:: ; da39 +wCurMapScript:: ; da38 ; index of current map script, mostly used as index for function pointer array ; mostly copied from map-specific map script pointer and wirtten back later ds 1 ds 7 -wPlayTimeHours:: ; da41 +wPlayTimeHours:: ; da40 ds 1 -wPlayTimeMaxed:: ; da42 +wPlayTimeMaxed:: ; da41 ds 1 -wPlayTimeMinutes:: ; da43 +wPlayTimeMinutes:: ; da42 ds 1 -wPlayTimeSeconds:: ; da44 +wPlayTimeSeconds:: ; da43 ds 1 -wPlayTimeFrames:: ; da45 +wPlayTimeFrames:: ; da44 ds 1 -wSafariZoneGameOver:: ; da46 +wSafariZoneGameOver:: ; da45 ds 1 -wNumSafariBalls:: ; da47 +wNumSafariBalls:: ; da46 ds 1 -wDayCareInUse:: ; da48 +wDayCareInUse:: ; da47 ; 0 if no pokemon is in the daycare ; 1 if pokemon is in the daycare ds 1 -wDayCareMonName:: ds NAME_LENGTH ; da49 -wDayCareMonOT:: ds NAME_LENGTH ; da54 +wDayCareMonName:: ds NAME_LENGTH ; da48 +wDayCareMonOT:: ds NAME_LENGTH ; da53 -wDayCareMon:: box_struct wDayCareMon ; da5f +wDayCareMon:: box_struct wDayCareMon ; da5e wMainDataEnd:: wBoxDataStart:: -wNumInBox:: ds 1 ; da80 -wBoxSpecies:: ds MONS_PER_BOX + 1 +wNumInBox:: ds 1 ; da7f +wBoxSpecies:: ds MONS_PER_BOX + 1 ; da80 wBoxMons:: -wBoxMon1:: box_struct wBoxMon1 ; da96 -wBoxMon2:: ds box_struct_length * (MONS_PER_BOX + -1) ; dab7 +wBoxMon1:: box_struct wBoxMon1 ; da95 +wBoxMon2:: ds box_struct_length * (MONS_PER_BOX + -1) ; dab6 -wBoxMonOT:: ds NAME_LENGTH * MONS_PER_BOX ; dd2a -wBoxMonNicks:: ds NAME_LENGTH * MONS_PER_BOX ; de06 +wBoxMonOT:: ds NAME_LENGTH * MONS_PER_BOX ; dd29 +wBoxMonNicks:: ds NAME_LENGTH * MONS_PER_BOX ; de05 wBoxMonNicksEnd:: ; dee1 wBoxDataEnd:: |