From a99a205b28b65a36a382142668850c972c001a4e Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 12 Nov 2013 00:29:26 -0600 Subject: [PATCH 1/4] labels for some battle menus --- main.asm | 55 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/main.asm b/main.asm index 1db558ecc..32a42fea0 100644 --- a/main.asm +++ b/main.asm @@ -33795,29 +33795,34 @@ MenuData2_0x24edc: ; 24edc ; 24ef2 -Function24ef2: ; 4ef2 - ld hl, MenuDataHeader_0x24f2c +LoadBattleMenuDataHeader: ; 4ef2 + ld hl, BattleMenuDataHeader call LoadMenuDataHeader + + ; store a ld a, [$d0d2] ld [$cf88], a + call Function2039 + + ; restore a ld a, [$cf88] ld [$d0d2], a + call Function1c07 ret ; 24f0b -Function24f0b: ; 24f0b +LoadSafariBattleMenuDataHeader: ; 24f0b ; Safari battle menu (untranslated). - ld hl, MenuDataHeader_0x24f4e + ld hl, SafariBattleMenuDataHeader call LoadMenuDataHeader jr Function24f19 ; 24f13 -Function24f13: ; 24f13 -; Park battle menu. - ld hl, MenuDataHeader_0x24f89 +LoadParkBattleMenuDataHeader: ; 24f13 + ld hl, ParkBattleMenuDataHeader call LoadMenuDataHeader ; 24f19 @@ -33832,23 +33837,23 @@ Function24f19: ; 24f19 ; 24f2c -MenuDataHeader_0x24f2c: ; 24f2c +BattleMenuDataHeader: ; 24f2c db $40 ; flags db 12, 08 ; start coords db 17, 19 ; end coords - dw MenuData_0x24f34 + dw BattleMenuData db 1 ; default option ; 24f34 -MenuData_0x24f34: ; 0x24f34 +BattleMenuData: ; 0x24f34 db $81 ; flags dn 2, 2 ; rows, columns db 6 ; spacing - dbw BANK(Strings24f3d), Strings24f3d + dbw BANK(BattleMenuStrings), BattleMenuStrings dbw $09, $0000 ; 0x24f3d -Strings24f3d: ; 0x24f3d +BattleMenuStrings: ; 0x24f3d db "FIGHT@" db $4a, "@" db "PACK@" @@ -33856,23 +33861,23 @@ Strings24f3d: ; 0x24f3d ; 24f4e -MenuDataHeader_0x24f4e: ; 24f4e +SafariBattleMenuDataHeader: ; 24f4e db $40 ; flags db 12, 00 ; start coords db 17, 19 ; end coords - dw MenuData_0x24f56 + dw SafariBattleMenuData db 1 ; default option ; 24f56 -MenuData_0x24f56: ; 24f56 +SafariBattleMenuData: ; 24f56 db $81 ; flags dn 2, 2 ; rows, columns db 11 ; spacing - dbw BANK(Strings24f5f), Strings24f5f + dbw BANK(SafariBattleMenuStrings), SafariBattleMenuStrings dbw BANK(Function24f7c), Function24f7c ; 24f5f -Strings24f5f: ; 24f5f +SafariBattleMenuStrings: ; 24f5f db "サファりボール× @" ; "SAFARI BALL× @" db "エサをなげる@" ; "THROW BAIT" db "いしをなげる@" ; "THROW ROCK" @@ -33888,23 +33893,23 @@ Function24f7c: ; 24f7c ; 24f89 -MenuDataHeader_0x24f89: ; 24f89 +ParkBattleMenuDataHeader: ; 24f89 db $40 ; flags db 12, 02 ; start coords db 17, 19 ; end coords - dw MenuData_0x24f91 + dw ParkBattleMenuData db 1 ; default option ; 24f91 -MenuData_0x24f91: ; 24f91 +ParkBattleMenuData: ; 24f91 db $81 ; flags dn 2, 2 ; rows, columns db 12 ; spacing - dbw BANK(Strings24f9a), Strings24f9a + dbw BANK(ParkBattleMenuStrings), ParkBattleMenuStrings dbw BANK(Function24fb2), Function24fb2 ; 24f9a -Strings24f9a: ; 24f9a +ParkBattleMenuStrings: ; 24f9a db "FIGHT@" db $4a, "@" db "PARKBALL× @" @@ -36017,7 +36022,7 @@ Function28177: ; 28177 ld [rIE], a pop af ld [rIF], a - ld a, $16 + ld a, PREDEF_START_BATTLE call Predef ld a, [rIF] ld h, a @@ -47484,7 +47489,7 @@ Function3e139: ; 3e139 ld a, [BattleType] cp $6 jr nz, .asm_3e165 - callba Function24f13 + callba LoadParkBattleMenuDataHeader jr .asm_3e175 .asm_3e165 @@ -47522,7 +47527,7 @@ Function3e192: ; 3e192 Function3e19b: ; 3e19b call Function3d2f1 jr z, .asm_3e1a8 - callba Function24ef2 + callba LoadBattleMenuDataHeader and a ret From 02d001a1f48136158383d3f006305de4bc9a1a49 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 12 Nov 2013 01:05:21 -0600 Subject: [PATCH 2/4] label CheckInMobileLinkBattle --- main.asm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.asm b/main.asm index 32a42fea0..b42de17fe 100644 --- a/main.asm +++ b/main.asm @@ -42614,7 +42614,7 @@ Function3c12f: ; 3c12f call Function3c27c call UpdateBattleMonInParty callba AIChooseMove - call Function3d2f1 + call CheckInMobileLinkBattle jr nz, .asm_3c174 callba Function100da5 callba Function100641 @@ -44851,7 +44851,7 @@ Function3cfa4: ; 3cfa4 callab Function39939 ld hl, BattleText_0x809da call StdBattleTextBox - call Function3d2f1 + call CheckInMobileLinkBattle jr z, .asm_3cff5 ld a, [InLinkBattle] and a @@ -45354,7 +45354,7 @@ Function3d2e0: ; 3d2e0 ret ; 3d2f1 -Function3d2f1: ; 3d2f1 +CheckInMobileLinkBattle: ; 3d2f1 ld a, [InLinkBattle] cp $4 ret @@ -45380,7 +45380,7 @@ Function3d313: ; 3d313 ; 3d329 Function3d329: ; 3d329 - call Function3d2f1 + call CheckInMobileLinkBattle jr z, .asm_3d335 callba PartyMenuSelect ret @@ -45524,7 +45524,7 @@ LostBattle: ; 3d38e .asm_3d40a ld hl, LostAgainstText - call Function3d2f1 + call CheckInMobileLinkBattle jr z, .asm_3d417 .asm_3d412 @@ -47525,7 +47525,7 @@ Function3e192: ; 3e192 ; 3e19b Function3e19b: ; 3e19b - call Function3d2f1 + call CheckInMobileLinkBattle jr z, .asm_3e1a8 callba LoadBattleMenuDataHeader and a @@ -47699,7 +47699,7 @@ Function3e299: ; 3e2f5 Function3e2f5: ; 3e2f5 - call Function3d2f1 + call CheckInMobileLinkBattle jr z, .asm_3e301 callba Function24e99 ret @@ -47924,7 +47924,7 @@ Function3e4a8: ; 3e4a8 ; 3e4bc Function3e4bc: ; 3e4bc - call Function3d2f1 + call CheckInMobileLinkBattle jr nz, .asm_3e4c8 callba Function100b9f ret From 2ee493898787e18f20fefda4384531f286701123 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 12 Nov 2013 01:05:54 -0600 Subject: [PATCH 3/4] fix typo in PartyMenuSelect comment --- main.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.asm b/main.asm index b42de17fe..73f599691 100644 --- a/main.asm +++ b/main.asm @@ -64992,7 +64992,7 @@ Function5042d: ; 0x5042d INCBIN "baserom.gbc",$5044f,$50457 - $5044f PartyMenuSelect: ; 0x50457 -; sets carry if exitted menu. +; sets carry if exited menu. call Function1bc9 call Function1bee ld a, [PartyCount] From 40ed4545b27c0c08e2cba18079fea315749c0752 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 12 Nov 2013 01:39:41 -0600 Subject: [PATCH 4/4] local labels for some mobile link battles --- main.asm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/main.asm b/main.asm index 73f599691..43d5f46b4 100644 --- a/main.asm +++ b/main.asm @@ -42615,13 +42615,13 @@ Function3c12f: ; 3c12f call UpdateBattleMonInParty callba AIChooseMove call CheckInMobileLinkBattle - jr nz, .asm_3c174 + jr nz, .notmobilelinkbattle callba Function100da5 callba Function100641 callba Function100dd8 jp c, .asm_3c1be -.asm_3c174 +.notmobilelinkbattle call Function3c410 jr c, .asm_3c18a .asm_3c179 @@ -44852,7 +44852,7 @@ Function3cfa4: ; 3cfa4 ld hl, BattleText_0x809da call StdBattleTextBox call CheckInMobileLinkBattle - jr z, .asm_3cff5 + jr z, .ismobilelinkbattle ld a, [InLinkBattle] and a ret nz @@ -44877,7 +44877,7 @@ Function3cfa4: ; 3cfa4 .asm_3cff2 jp Function3d02b -.asm_3cff5 +.ismobilelinkbattle call Function3ebd8 ld c, $28 call DelayFrames @@ -45381,11 +45381,11 @@ Function3d313: ; 3d313 Function3d329: ; 3d329 call CheckInMobileLinkBattle - jr z, .asm_3d335 + jr z, .ismobilelinkbattle callba PartyMenuSelect ret -.asm_3d335 +.ismobilelinkbattle callba Function100cb5 ret ; 3d33c @@ -45525,7 +45525,7 @@ LostBattle: ; 3d38e .asm_3d40a ld hl, LostAgainstText call CheckInMobileLinkBattle - jr z, .asm_3d417 + jr z, .ismobilelinkbattle .asm_3d412 call StdBattleTextBox @@ -45534,7 +45534,7 @@ LostBattle: ; 3d38e scf ret -.asm_3d417 +.ismobilelinkbattle ; Remove the enemy from the screen. hlcoord 0, 0 ld bc, $0815 @@ -47526,12 +47526,12 @@ Function3e192: ; 3e192 Function3e19b: ; 3e19b call CheckInMobileLinkBattle - jr z, .asm_3e1a8 + jr z, .ismobilelinkbattle callba LoadBattleMenuDataHeader and a ret -.asm_3e1a8 +.ismobilelinkbattle callba Function100b12 ld a, [$cd2b] and a @@ -47700,11 +47700,11 @@ Function3e299: Function3e2f5: ; 3e2f5 call CheckInMobileLinkBattle - jr z, .asm_3e301 + jr z, .ismobilelinkbattle callba Function24e99 ret -.asm_3e301 +.ismobilelinkbattle callba Function100d22 ret ; 3e308 @@ -47925,11 +47925,11 @@ Function3e4a8: ; 3e4a8 Function3e4bc: ; 3e4bc call CheckInMobileLinkBattle - jr nz, .asm_3e4c8 + jr nz, .notmobilelinkbattle callba Function100b9f ret -.asm_3e4c8 +.notmobilelinkbattle ld hl, EnemyMonMove1 ld a, [$d235] dec a