From cd649184f556db777d592671a7274bfa4a8423d7 Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 3 Jul 2015 14:37:53 -0500 Subject: Rename/organize part 1 of 4 rename functions, clean up address/wram comments, other misc only broken up so that all changes are viewable on github --- engine/hidden_object_functions18.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engine/hidden_object_functions18.asm') diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index 7696626f..a378adcc 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -14,16 +14,16 @@ GymStatues: ; 62419 (18:6419) cp $ff ret z cp b - jr z, .asm_62433 ; 0x6242e $3 + jr z, .asm_62433 inc hl - jr .asm_62429 ; 0x62431 $f6 + jr .asm_62429 .asm_62433 ld b, [hl] ld a, [wd72a] and b cp b ld a, $d - jr z, .asm_6243f ; 0x6243b $2 + jr z, .asm_6243f ld a, $c .asm_6243f jp PrintPredefTextID @@ -143,7 +143,7 @@ SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) ld a, [wd838] bit 7, a ld hl, SaffronCityPokecenterBenchGuyText2 - jr nz, .asm_624f2 ; 0x624ed $3 + jr nz, .asm_624f2 ld hl, SaffronCityPokecenterBenchGuyText1 .asm_624f2 call PrintText -- cgit v1.2.3 From 8431fa7756dace97413f4c35aaa44cd92cf5b6df Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 3 Jul 2015 14:58:50 -0500 Subject: TX_ASM --- engine/hidden_object_functions18.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/hidden_object_functions18.asm') diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index a378adcc..44be4c31 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -139,7 +139,7 @@ CinnabarIslandPokecenterBenchGuyText: ; 624df (18:64df) db "@" SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) - db $8 ; asm + TX_ASM ld a, [wd838] bit 7, a ld hl, SaffronCityPokecenterBenchGuyText2 -- cgit v1.2.3 From f702fc7840e30f00c840ce619a1ea15d763438de Mon Sep 17 00:00:00 2001 From: dannye Date: Sat, 4 Jul 2015 00:44:12 -0500 Subject: Start using text predef macros also sprite direction constants --- engine/hidden_object_functions18.asm | 86 ++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 38 deletions(-) (limited to 'engine/hidden_object_functions18.asm') diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index 44be4c31..e293b0a0 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -1,31 +1,31 @@ GymStatues: ; 62419 (18:6419) -; if in a gym and have the corresponding badge, a = $D and jp PrintPredefTextID -; if in a gym and don’t have the corresponding badge, a = $C and jp PrintPredefTextID +; if in a gym and have the corresponding badge, a = GymStatueText2_id and jp PrintPredefTextID +; 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] - cp $4 + cp SPRITE_FACING_UP ret nz ld hl, .BadgeFlags ld a, [W_CURMAP] ld b, a -.asm_62429 +.loop ld a, [hli] cp $ff ret z cp b - jr z, .asm_62433 + jr z, .match inc hl - jr .asm_62429 -.asm_62433 + jr .loop +.match ld b, [hl] ld a, [wd72a] and b cp b - ld a, $d - jr z, .asm_6243f - ld a, $c -.asm_6243f + tx_pre_id GymStatueText2 + jr z, .haveBadge + tx_pre_id GymStatueText1 +.haveBadge jp PrintPredefTextID .BadgeFlags: ; 62442 (18:6442) @@ -49,41 +49,53 @@ GymStatueText2: ; 62458 (18:6458) PrintBenchGuyText: ; 6245d (18:645d) call EnableAutoTextBoxDrawing - ld hl, PokeCenterMapIDList + ld hl, BenchGuyTextPointers ld a, [W_CURMAP] ld b, a -.asm_62467 +.loop ld a, [hli] cp $ff ret z cp b - jr z, .asm_62472 + jr z, .match inc hl inc hl - jr .asm_62467 -.asm_62472 + jr .loop +.match ld a, [hli] ld b, a ld a, [wSpriteStateData1 + 9] cp b - jr nz, .asm_62467 + jr nz, .loop ; player isn't facing left at the bench guy ld a, [hl] jp PrintPredefTextID -; format: db map id, 08, text id of PredefTextIDPointerTable -PokeCenterMapIDList: ; 6247e (18:647e) - db VIRIDIAN_POKECENTER,$08,$0F - db PEWTER_POKECENTER,$08,$10 - db CERULEAN_POKECENTER,$08,$11 - db LAVENDER_POKECENTER,$08,$12 - db VERMILION_POKECENTER,$08,$13 - db CELADON_POKECENTER,$08,$14 - db CELADON_HOTEL,$08,$15 - db FUCHSIA_POKECENTER,$08,$16 - db CINNABAR_POKECENTER,$08,$17 - db SAFFRON_POKECENTER,$08,$18 - db MT_MOON_POKECENTER,$08,$19 - db ROCK_TUNNEL_POKECENTER,$08,$1A +; format: db map id, player sprite facing direction, text id of PredefTextIDPointerTable +BenchGuyTextPointers: ; 6247e (18:647e) + db VIRIDIAN_POKECENTER, SPRITE_FACING_LEFT + db (ViridianCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db PEWTER_POKECENTER, SPRITE_FACING_LEFT + db (PewterCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db CERULEAN_POKECENTER, SPRITE_FACING_LEFT + db (CeruleanCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db LAVENDER_POKECENTER, SPRITE_FACING_LEFT + db (LavenderCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db VERMILION_POKECENTER, SPRITE_FACING_LEFT + db (VermilionCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db CELADON_POKECENTER, SPRITE_FACING_LEFT + db (CeladonCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db CELADON_HOTEL, SPRITE_FACING_LEFT + db (CeladonCityHotelText_id - TextPredefs) / 2 + 1 + db FUCHSIA_POKECENTER, SPRITE_FACING_LEFT + db (FuchsiaCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db CINNABAR_POKECENTER, SPRITE_FACING_LEFT + db (CinnabarIslandPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db SAFFRON_POKECENTER, SPRITE_FACING_LEFT + db (SaffronCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db MT_MOON_POKECENTER, SPRITE_FACING_LEFT + db (MtMoonPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db ROCK_TUNNEL_POKECENTER,SPRITE_FACING_LEFT + db (RockTunnelPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 db $FF ViridianCityPokecenterBenchGuyText: ; 624a3 (18:64a3) @@ -163,13 +175,12 @@ CeladonCityHotelText: ; 62502 (18:6502) ret -TerminatorText_62508: ; 62508 (18:6508) +UnusedPredefText: ; 62508 (18:6508) db "@" PrintBookcaseText: ; 6509 (18:6509) call EnableAutoTextBoxDrawing - ld a, $e ; BookcaseText - jp PrintPredefTextID + tx_pre_jump BookcaseText BookcaseText: ; 62511 (18:6511) TX_FAR _BookcaseText @@ -177,13 +188,12 @@ BookcaseText: ; 62511 (18:6511) OpenPokemonCenterPC: ; 62516 (18:6516) ld a, [wSpriteStateData1 + 9] - cp $4 ; check to see if player is facing up + cp SPRITE_FACING_UP ; check to see if player is facing up ret nz call EnableAutoTextBoxDrawing ld a, $1 ld [wAutoTextBoxDrawingControl], a - ld a, $1f ; PredefText1f - jp PrintPredefTextID + tx_pre_jump PokemonCenterPCText -PredefText1f: ; 62529 (18:6529) +PokemonCenterPCText: ; 62529 (18:6529) db $F9 ; FuncTX_PokemonCenterPC -- cgit v1.2.3 From fcab935a0f449246380480613ac0896e0b90a0d8 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Mon, 20 Jul 2015 18:32:02 -0700 Subject: enumerate events --- engine/hidden_object_functions18.asm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engine/hidden_object_functions18.asm') diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index e293b0a0..cf18799d 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -152,8 +152,7 @@ CinnabarIslandPokecenterBenchGuyText: ; 624df (18:64df) SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) TX_ASM - ld a, [wd838] - bit 7, a + CheckEvent EVENT_78F ld hl, SaffronCityPokecenterBenchGuyText2 jr nz, .asm_624f2 ld hl, SaffronCityPokecenterBenchGuyText1 -- cgit v1.2.3 From 73171bfff573fa8900563319c014f3e626db6b3e Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 10:36:03 -0700 Subject: named most of the used events --- engine/hidden_object_functions18.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/hidden_object_functions18.asm') diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index cf18799d..00744c5d 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -152,7 +152,7 @@ CinnabarIslandPokecenterBenchGuyText: ; 624df (18:64df) SaffronCityPokecenterBenchGuyText: ; 624e4 (18:64e4) TX_ASM - CheckEvent EVENT_78F + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI ld hl, SaffronCityPokecenterBenchGuyText2 jr nz, .asm_624f2 ld hl, SaffronCityPokecenterBenchGuyText1 -- cgit v1.2.3 From 93255d6d17fbb3702a0f8670d7ecc2ed627af2a7 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 25 Jul 2015 19:26:54 -0700 Subject: yet more naming --- engine/hidden_object_functions18.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/hidden_object_functions18.asm') diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index 00744c5d..0a93fd44 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -19,7 +19,7 @@ GymStatues: ; 62419 (18:6419) jr .loop .match ld b, [hl] - ld a, [wd72a] + ld a, [wBeatGymFlags] and b cp b tx_pre_id GymStatueText2 -- cgit v1.2.3