From f4a31b3e0b7ca89e14c4e3836f3d3ad15f38e5ce Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 3 Jul 2015 14:38:12 -0500 Subject: Rename/organize part 2 of 4 rename functions, clean up address/wram comments, other misc only broken up so that all changes are viewable on github --- scripts/route22.asm | 80 ++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 9181380a..66df3bb2 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -22,7 +22,7 @@ Route22Script7: ; 50ed5 (14:4ed5) ret Route22Script_50ed6: ; 50ed6 (14:4ed6) - ld a, [W_RIVALSTARTER] ; wd715 + ld a, [W_RIVALSTARTER] ld b, a .asm_50eda ld a, [hli] @@ -32,11 +32,11 @@ Route22Script_50ed6: ; 50ed6 (14:4ed6) jr .asm_50eda .asm_50ee1 ld a, [hl] - ld [W_TRAINERNO], a ; wd05d + ld [W_TRAINERNO], a ret Route22MoveRivalSprite: ; 50ee6 (14:4ee6) - ld de, Route22RivalMovementData ; $4efb + ld de, Route22RivalMovementData ld a, [wcf0d] cp $1 jr z, .asm_50ef1 @@ -54,7 +54,7 @@ Route22Script0: ; 50f00 (14:4f00) ld a, [wd7eb] bit 7, a ret z - ld hl, .Route22RivalBattleCoords ; $4f2d + ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray ret nc ld a, [wWhichTrade] @@ -67,7 +67,7 @@ Route22Script0: ; 50f00 (14:4f00) ld [wd528], a ld a, [wd7eb] bit 0, a ; is this the rival battle at the beginning of the game? - jr nz, .firstRivalBattle ; 0x50f25 $b + jr nz, .firstRivalBattle bit 1, a ; is this the rival at the end of the game? jp nz, Route22Script_5104e ret @@ -85,7 +85,7 @@ Route22Script0: ; 50f00 (14:4f00) predef EmotionBubble ld a, [wWalkBikeSurfState] and a - jr z, .asm_50f4e ; 0x50f44 $8 + jr z, .asm_50f4e ld a, $ff ld [wc0ee], a call PlaySound @@ -106,11 +106,11 @@ Route22Script1: ; 50f62 (14:4f62) ret nz ld a, [wcf0d] cp $1 - jr nz, .asm_50f78 ; 0x50f6d $9 + jr nz, .asm_50f78 ld a, $4 ld [wd528], a ld a, $4 - jr .asm_50f7a ; 0x50f76 $2 + jr .asm_50f7a .asm_50f78 ld a, $c .asm_50f7a @@ -131,7 +131,7 @@ Route22Script1: ; 50f62 (14:4f62) call SaveEndBattleTextPointers ld a, SONY1 + $c8 ld [W_CUROPPONENT], a - ld hl, StarterMons_50faf ; $4faf + ld hl, StarterMons_50faf call Route22Script_50ed6 ld a, $2 ld [W_ROUTE22CURSCRIPT], a @@ -149,9 +149,9 @@ Route22Script2: ; 50fb5 (14:4fb5) jp z, Route22Script_50ece ld a, [wSpriteStateData1 + 9] and a - jr nz, .asm_50fc7 ; 0x50fc1 $4 + jr nz, .asm_50fc7 ld a, $4 - jr .asm_50fc9 ; 0x50fc5 $2 + jr .asm_50fc9 .asm_50fc7 ld a, $c .asm_50fc9 @@ -172,9 +172,9 @@ Route22Script2: ; 50fb5 (14:4fb5) callba Music_RivalAlternateStart ld a, [wcf0d] cp $1 - jr nz, .asm_50fff ; 0x50ff8 $5 + jr nz, .asm_50fff call Route22Script_51008 - jr .asm_51002 ; 0x50ffd $3 + jr .asm_51002 .asm_50fff call Route22Script_5100d .asm_51002 @@ -183,12 +183,12 @@ Route22Script2: ; 50fb5 (14:4fb5) ret Route22Script_51008: ; 51008 (14:5008) - ld de, Route22RivalExitMovementData1 ; $5017 - jr asm_51010 + ld de, Route22RivalExitMovementData1 + jr Route22MoveRival1 Route22Script_5100d: ; 5100d (14:500d) - ld de, Route22RivalExitMovementData2 ; $501f -asm_51010 + ld de, Route22RivalExitMovementData2 +Route22MoveRival1: ; 51010 (14:5010) ld a, $1 ld [H_SPRITEHEIGHT], a jp MoveSprite @@ -234,7 +234,7 @@ Route22Script_5104e: ; 5104e (14:504e) call PlaySound callba Music_RivalAlternateTempo ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call Route22MoveRivalSprite ld a, $4 ld [W_ROUTE22CURSCRIPT], a @@ -245,7 +245,7 @@ Route22Script4: ; 51087 (14:5087) bit 0, a ret nz ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a ld a, [wcf0d] cp $1 jr nz, .asm_510a1 @@ -263,17 +263,17 @@ Route22Script4: ; 51087 (14:5087) xor a ld [wJoyIgnore], a ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld hl, wd72d set 6, [hl] set 7, [hl] - ld hl, Route22RivalDefeatedText2 ; $51cb - ld de, Route22Text_511d0 ; $51d0 + ld hl, Route22RivalDefeatedText2 + ld de, Route22Text_511d0 call SaveEndBattleTextPointers ld a, SONY2 + $c8 - ld [W_CUROPPONENT], a ; wd059 - ld hl, StarterMons_510d9 ; $50d9 + ld [W_CUROPPONENT], a + ld hl, StarterMons_510d9 call Route22Script_50ed6 ld a, $5 ld [W_ROUTE22CURSCRIPT], a @@ -285,11 +285,11 @@ StarterMons_510d9: ; 510d9 (14:50d9) db STARTER1,$0c Route22Script5: ; 510df (14:50df) - ld a, [W_ISINBATTLE] ; W_ISINBATTLE + ld a, [W_ISINBATTLE] cp $ff jp z, Route22Script_50ece ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a ld a, [wcf0d] cp $1 jr nz, .asm_510fb @@ -309,7 +309,7 @@ Route22Script5: ; 510df (14:50df) ld hl, wd7eb set 6, [hl] ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID ld a, $ff ld [wc0ee], a @@ -328,14 +328,14 @@ Route22Script5: ; 510df (14:50df) ret Route22Script_5113d: ; 5113d (14:513d) - ld de, MovementData_5114c ; $514c - jr asm_51145 + ld de, MovementData_5114c + jr Route22MoveRival2 Route22Script_51142: ; 51142 (14:5142) - ld de, MovementData_5114d ; $514d -asm_51145: ; 51145 (14:5145) + ld de, MovementData_5114d +Route22MoveRival2: ; 51145 (14:5145) ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a jp MoveSprite MovementData_5114c: ; 5114c (14:514c) @@ -370,28 +370,28 @@ Route22Text1: ; 5117b (14:517b) db $08 ; asm ld a, [wd7eb] bit 5, a - jr z, .asm_a88cf ; 0x51181 + jr z, .asm_5118b ld hl, Route22RivalAfterBattleText1 call PrintText - jr .asm_48088 ; 0x51189 -.asm_a88cf ; 0x5118b + jr .asm_51191 +.asm_5118b ld hl, Route22RivalBeforeBattleText1 call PrintText -.asm_48088 ; 0x51191 +.asm_51191 jp TextScriptEnd Route22Text2: ; 51194 (14:5194) db $08 ; asm ld a, [wd7eb] bit 6, a - jr z, .asm_58c0a ; 0x5119a + jr z, .asm_511a4 ld hl, Route22RivalAfterBattleText2 call PrintText - jr .asm_673ee ; 0x511a2 -.asm_58c0a ; 0x511a4 + jr .asm_511aa +.asm_511a4 ld hl, Route22RivalBeforeBattleText2 call PrintText -.asm_673ee ; 0x511aa +.asm_511aa jp TextScriptEnd Route22RivalBeforeBattleText1: ; 511ad (14:51ad) -- 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 --- scripts/route22.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 66df3bb2..88f69bea 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -367,7 +367,7 @@ Route22TextPointers: ; 51175 (14:5175) dw Route22FrontGateText Route22Text1: ; 5117b (14:517b) - db $08 ; asm + TX_ASM ld a, [wd7eb] bit 5, a jr z, .asm_5118b @@ -381,7 +381,7 @@ Route22Text1: ; 5117b (14:517b) jp TextScriptEnd Route22Text2: ; 51194 (14:5194) - db $08 ; asm + TX_ASM ld a, [wd7eb] bit 6, a jr z, .asm_511a4 -- 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 --- scripts/route22.asm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 88f69bea..7d70924b 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -148,13 +148,13 @@ Route22Script2: ; 50fb5 (14:4fb5) cp $ff jp z, Route22Script_50ece ld a, [wSpriteStateData1 + 9] - and a - jr nz, .asm_50fc7 - ld a, $4 - jr .asm_50fc9 -.asm_50fc7 - ld a, $c -.asm_50fc9 + and a ; cp SPRITE_FACING_DOWN + jr nz, .notDown + ld a, SPRITE_FACING_UP + jr .done +.notDown + ld a, SPRITE_FACING_RIGHT +.done ld [$ff8d], a ld a, $1 ld [$ff8c], a -- cgit v1.2.3 From 01631a2e5910b5334ba0f7cc534bc5d7e5b60ccc Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 14 Jul 2015 14:32:49 -0700 Subject: player animations, emotion bubbles, etc. --- scripts/route22.asm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 7d70924b..68b3a4b9 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -79,9 +79,9 @@ Route22Script0: ; 50f00 (14:4f00) .firstRivalBattle ld a, $1 - ld [wcd4f], a - xor a - ld [wcd50], a + ld [wEmotionBubbleSpriteIndex], a + xor a ; EXCLAMATION_BUBBLE + ld [wWhichEmotionBubble], a predef EmotionBubble ld a, [wWalkBikeSurfState] and a @@ -218,9 +218,9 @@ Route22Script3: ; 5102a (14:502a) Route22Script_5104e: ; 5104e (14:504e) ld a, $2 - ld [wcd4f], a - xor a - ld [wcd50], a + ld [wEmotionBubbleSpriteIndex], a + xor a ; EXCLAMATION_BUBBLE + ld [wWhichEmotionBubble], a predef EmotionBubble ld a, [wWalkBikeSurfState] and a -- cgit v1.2.3 From fb559f1f4e0104bfc59350359a2fb82fbe88ebba Mon Sep 17 00:00:00 2001 From: dannye Date: Fri, 17 Jul 2015 02:52:25 -0500 Subject: More direction constants facing directions, npc movement, joypad --- scripts/route22.asm | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 68b3a4b9..84fb5634 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -48,7 +48,11 @@ Route22MoveRivalSprite: ; 50ee6 (14:4ee6) jp SetSpriteFacingDirectionAndDelay Route22RivalMovementData: ; 50efb (14:4efb) - db $C0,$C0,$C0,$C0,$FF ; move right 4 times + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db $FF Route22Script0: ; 50f00 (14:4f00) ld a, [wd7eb] @@ -194,10 +198,27 @@ Route22MoveRival1: ; 51010 (14:5010) jp MoveSprite Route22RivalExitMovementData1: ; 51017 (14:5017) - db $C0,$C0,$00,$00,$00,$00,$00,$FF + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db $FF Route22RivalExitMovementData2: ; 5101f (14:501f) - db $40,$C0,$C0,$C0,$00,$00,$00,$00,$00,$00,$FF + db NPC_MOVEMENT_UP + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_RIGHT + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db NPC_MOVEMENT_DOWN + db $FF Route22Script3: ; 5102a (14:502a) ld a, [wd730] @@ -339,10 +360,13 @@ Route22MoveRival2: ; 51145 (14:5145) jp MoveSprite MovementData_5114c: ; 5114c (14:514c) - db $80 ; left + db NPC_MOVEMENT_LEFT MovementData_5114d: ; 5114d (14:514d) - db $80,$80,$80,$FF ; left x3 + db NPC_MOVEMENT_LEFT + db NPC_MOVEMENT_LEFT + db NPC_MOVEMENT_LEFT + db $FF Route22Script6: ; 51151 (14:5151) ld a, [wd730] -- cgit v1.2.3 From fc9af362ae65d24c66b39ea7759637cc9c1f9b0a Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 18 Jul 2015 08:17:29 -0700 Subject: fix variable naming --- scripts/route22.asm | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 84fb5634..f125030e 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -43,8 +43,8 @@ Route22MoveRivalSprite: ; 50ee6 (14:4ee6) inc de .asm_50ef1 call MoveSprite - ld a, $c - ld [$ff8d], a + ld a, SPRITE_FACING_RIGHT + ld [hSpriteFacingDirection], a jp SetSpriteFacingDirectionAndDelay Route22RivalMovementData: ; 50efb (14:4efb) @@ -61,7 +61,7 @@ Route22Script0: ; 50f00 (14:4f00) ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray ret nc - ld a, [wWhichTrade] + ld a, [wCoordIndex] ld [wcf0d], a xor a ld [hJoyHeld], a @@ -98,7 +98,7 @@ Route22Script0: ; 50f00 (14:4f00) ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call Route22MoveRivalSprite ld a, $1 ld [W_ROUTE22CURSCRIPT], a @@ -113,19 +113,19 @@ Route22Script1: ; 50f62 (14:4f62) jr nz, .asm_50f78 ld a, $4 ld [wd528], a - ld a, $4 + ld a, SPRITE_FACING_UP jr .asm_50f7a .asm_50f78 - ld a, $c + ld a, SPRITE_FACING_RIGHT .asm_50f7a - ld [$ff8d], a + ld [hSpriteFacingDirection], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteFacingDirectionAndDelay xor a ld [wJoyIgnore], a ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd72d set 6, [hl] @@ -159,16 +159,16 @@ Route22Script2: ; 50fb5 (14:4fb5) .notDown ld a, SPRITE_FACING_RIGHT .done - ld [$ff8d], a + ld [hSpriteFacingDirection], a ld a, $1 - ld [$ff8c], a + ld [H_SPRITEINDEX], a call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a ld hl, wd7eb set 5, [hl] ld a, $1 - ld [$ff8c], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wc0ee], a @@ -194,7 +194,7 @@ Route22Script_5100d: ; 5100d (14:500d) ld de, Route22RivalExitMovementData2 Route22MoveRival1: ; 51010 (14:5010) ld a, $1 - ld [H_SPRITEHEIGHT], a + ld [H_SPRITEINDEX], a jp MoveSprite Route22RivalExitMovementData1: ; 51017 (14:5017) @@ -255,7 +255,7 @@ Route22Script_5104e: ; 5104e (14:504e) call PlaySound callba Music_RivalAlternateTempo ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a call Route22MoveRivalSprite ld a, $4 ld [W_ROUTE22CURSCRIPT], a @@ -266,25 +266,25 @@ Route22Script4: ; 51087 (14:5087) bit 0, a ret nz ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a ld a, [wcf0d] cp $1 jr nz, .asm_510a1 ld a, $4 ld [wd528], a - ld a, $4 + ld a, SPRITE_FACING_UP jr .asm_510a8 .asm_510a1 ld a, $2 ld [wd528], a - ld a, $c + ld a, SPRITE_FACING_RIGHT .asm_510a8 - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay xor a ld [wJoyIgnore], a ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld hl, wd72d set 6, [hl] @@ -310,27 +310,27 @@ Route22Script5: ; 510df (14:50df) cp $ff jp z, Route22Script_50ece ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a ld a, [wcf0d] cp $1 jr nz, .asm_510fb ld a, $4 ld [wd528], a - ld a, $4 + ld a, SPRITE_FACING_UP jr .asm_51102 .asm_510fb ld a, $2 ld [wd528], a - ld a, $c + ld a, SPRITE_FACING_RIGHT .asm_51102 - ld [$ff8d], a + ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a ld hl, wd7eb set 6, [hl] ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff ld [wc0ee], a @@ -356,7 +356,7 @@ Route22Script_51142: ; 51142 (14:5142) ld de, MovementData_5114d Route22MoveRival2: ; 51145 (14:5145) ld a, $2 - ld [H_DOWNARROWBLINKCNT2], a + ld [H_SPRITEINDEX], a jp MoveSprite MovementData_5114c: ; 5114c (14:514c) -- cgit v1.2.3 From 1d86932cc9c38815434409f07d14c2bfe4e7a836 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sun, 19 Jul 2015 17:52:26 -0700 Subject: naming --- scripts/route22.asm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index f125030e..01f8bee8 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -67,8 +67,8 @@ Route22Script0: ; 50f00 (14:4f00) ld [hJoyHeld], a ld a, $f0 ld [wJoyIgnore], a - ld a, $2 - ld [wd528], a + ld a, PLAYER_DIR_LEFT + ld [wPlayerMovingDirection], a ld a, [wd7eb] bit 0, a ; is this the rival battle at the beginning of the game? jr nz, .firstRivalBattle @@ -111,8 +111,8 @@ Route22Script1: ; 50f62 (14:4f62) ld a, [wcf0d] cp $1 jr nz, .asm_50f78 - ld a, $4 - ld [wd528], a + ld a, PLAYER_DIR_DOWN + ld [wPlayerMovingDirection], a ld a, SPRITE_FACING_UP jr .asm_50f7a .asm_50f78 @@ -270,13 +270,13 @@ Route22Script4: ; 51087 (14:5087) ld a, [wcf0d] cp $1 jr nz, .asm_510a1 - ld a, $4 - ld [wd528], a + ld a, PLAYER_DIR_DOWN + ld [wPlayerMovingDirection], a ld a, SPRITE_FACING_UP jr .asm_510a8 .asm_510a1 - ld a, $2 - ld [wd528], a + ld a, PLAYER_DIR_LEFT + ld [wPlayerMovingDirection], a ld a, SPRITE_FACING_RIGHT .asm_510a8 ld [hSpriteFacingDirection], a @@ -314,13 +314,13 @@ Route22Script5: ; 510df (14:50df) ld a, [wcf0d] cp $1 jr nz, .asm_510fb - ld a, $4 - ld [wd528], a + ld a, PLAYER_DIR_DOWN + ld [wPlayerMovingDirection], a ld a, SPRITE_FACING_UP jr .asm_51102 .asm_510fb - ld a, $2 - ld [wd528], a + ld a, PLAYER_DIR_LEFT + ld [wPlayerMovingDirection], a ld a, SPRITE_FACING_RIGHT .asm_51102 ld [hSpriteFacingDirection], a -- 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 --- scripts/route22.asm | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 01f8bee8..dec8afd6 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -55,8 +55,7 @@ Route22RivalMovementData: ; 50efb (14:4efb) db $FF Route22Script0: ; 50f00 (14:4f00) - ld a, [wd7eb] - bit 7, a + CheckEvent EVENT_527 ret z ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray @@ -69,10 +68,9 @@ Route22Script0: ; 50f00 (14:4f00) ld [wJoyIgnore], a ld a, PLAYER_DIR_LEFT ld [wPlayerMovingDirection], a - ld a, [wd7eb] - bit 0, a ; is this the rival battle at the beginning of the game? + CheckEvent EVENT_520 jr nz, .firstRivalBattle - bit 1, a ; is this the rival at the end of the game? + CheckEventReuseA EVENT_521 ; is this the rival at the end of the game? jp nz, Route22Script_5104e ret @@ -165,8 +163,7 @@ Route22Script2: ; 50fb5 (14:4fb5) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - ld hl, wd7eb - set 5, [hl] + SetEvent EVENT_525 ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -230,9 +227,7 @@ Route22Script3: ; 5102a (14:502a) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ld hl, wd7eb - res 0, [hl] - res 7, [hl] + ResetEvents EVENT_520, EVENT_527 ld a, $0 ld [W_ROUTE22CURSCRIPT], a ret @@ -327,8 +322,7 @@ Route22Script5: ; 510df (14:50df) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - ld hl, wd7eb - set 6, [hl] + SetEvent EVENT_526 ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -378,9 +372,7 @@ Route22Script6: ; 51151 (14:5151) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ld hl, wd7eb - res 1, [hl] - res 7, [hl] + ResetEvents EVENT_521, EVENT_527 ld a, $7 ld [W_ROUTE22CURSCRIPT], a ret @@ -392,8 +384,7 @@ Route22TextPointers: ; 51175 (14:5175) Route22Text1: ; 5117b (14:517b) TX_ASM - ld a, [wd7eb] - bit 5, a + CheckEvent EVENT_525 jr z, .asm_5118b ld hl, Route22RivalAfterBattleText1 call PrintText @@ -406,8 +397,7 @@ Route22Text1: ; 5117b (14:517b) Route22Text2: ; 51194 (14:5194) TX_ASM - ld a, [wd7eb] - bit 6, a + CheckEvent EVENT_526 jr z, .asm_511a4 ld hl, Route22RivalAfterBattleText2 call PrintText -- 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 --- scripts/route22.asm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index dec8afd6..73fe2f55 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -55,7 +55,7 @@ Route22RivalMovementData: ; 50efb (14:4efb) db $FF Route22Script0: ; 50f00 (14:4f00) - CheckEvent EVENT_527 + CheckEvent EVENT_ROUTE22_RIVAL_WANTS_FIGHT ret z ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray @@ -68,9 +68,9 @@ Route22Script0: ; 50f00 (14:4f00) ld [wJoyIgnore], a ld a, PLAYER_DIR_LEFT ld [wPlayerMovingDirection], a - CheckEvent EVENT_520 + CheckEvent EVENT_1ST_ROUTE22_RIVAL_BATTLE jr nz, .firstRivalBattle - CheckEventReuseA EVENT_521 ; is this the rival at the end of the game? + CheckEventReuseA EVENT_2ND_ROUTE22_RIVAL_BATTLE ; is this the rival at the end of the game? jp nz, Route22Script_5104e ret @@ -163,7 +163,7 @@ Route22Script2: ; 50fb5 (14:4fb5) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_525 + SetEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -227,7 +227,7 @@ Route22Script3: ; 5102a (14:502a) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ResetEvents EVENT_520, EVENT_527 + ResetEvents EVENT_1ST_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT ld a, $0 ld [W_ROUTE22CURSCRIPT], a ret @@ -322,7 +322,7 @@ Route22Script5: ; 510df (14:50df) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_526 + SetEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -372,7 +372,7 @@ Route22Script6: ; 51151 (14:5151) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ResetEvents EVENT_521, EVENT_527 + ResetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT ld a, $7 ld [W_ROUTE22CURSCRIPT], a ret @@ -384,7 +384,7 @@ Route22TextPointers: ; 51175 (14:5175) Route22Text1: ; 5117b (14:517b) TX_ASM - CheckEvent EVENT_525 + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT jr z, .asm_5118b ld hl, Route22RivalAfterBattleText1 call PrintText @@ -397,7 +397,7 @@ Route22Text1: ; 5117b (14:517b) Route22Text2: ; 51194 (14:5194) TX_ASM - CheckEvent EVENT_526 + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT jr z, .asm_511a4 ld hl, Route22RivalAfterBattleText2 call PrintText -- cgit v1.2.3 From e6d02b4b7b69701f223fe9100ccc21ad2089afc4 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Thu, 23 Jul 2015 21:20:20 -0700 Subject: make route22 rival events more consistent --- scripts/route22.asm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 73fe2f55..25b16886 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -55,7 +55,7 @@ Route22RivalMovementData: ; 50efb (14:4efb) db $FF Route22Script0: ; 50f00 (14:4f00) - CheckEvent EVENT_ROUTE22_RIVAL_WANTS_FIGHT + CheckEvent EVENT_ROUTE22_RIVAL_WANTS_BATTLE ret z ld hl, .Route22RivalBattleCoords call ArePlayerCoordsInArray @@ -163,7 +163,7 @@ Route22Script2: ; 50fb5 (14:4fb5) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT + SetEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_BATTLE ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -227,7 +227,7 @@ Route22Script3: ; 5102a (14:502a) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ResetEvents EVENT_1ST_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT + ResetEvents EVENT_1ST_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_BATTLE ld a, $0 ld [W_ROUTE22CURSCRIPT], a ret @@ -322,7 +322,7 @@ Route22Script5: ; 510df (14:50df) call SetSpriteFacingDirectionAndDelay ld a, $f0 ld [wJoyIgnore], a - SetEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT + SetEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_BATTLE ld a, $2 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -372,7 +372,7 @@ Route22Script6: ; 51151 (14:5151) ld [wcc4d], a predef HideObject call PlayDefaultMusic - ResetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_FIGHT + ResetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_BATTLE ld a, $7 ld [W_ROUTE22CURSCRIPT], a ret @@ -384,7 +384,7 @@ Route22TextPointers: ; 51175 (14:5175) Route22Text1: ; 5117b (14:517b) TX_ASM - CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_FIGHT + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_BATTLE jr z, .asm_5118b ld hl, Route22RivalAfterBattleText1 call PrintText @@ -397,7 +397,7 @@ Route22Text1: ; 5117b (14:517b) Route22Text2: ; 51194 (14:5194) TX_ASM - CheckEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_FIGHT + CheckEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_BATTLE jr z, .asm_511a4 ld hl, Route22RivalAfterBattleText2 call PrintText -- cgit v1.2.3 From 7f6d0d49b61a77cfba76057d99881634b882486b Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 24 Jul 2015 20:27:59 -0700 Subject: more naming variables --- scripts/route22.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 25b16886..041f75e6 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -224,7 +224,7 @@ Route22Script3: ; 5102a (14:502a) xor a ld [wJoyIgnore], a ld a, HS_ROUTE_22_RIVAL_1 - ld [wcc4d], a + ld [wMissableObjectIndex], a predef HideObject call PlayDefaultMusic ResetEvents EVENT_1ST_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_BATTLE @@ -369,7 +369,7 @@ Route22Script6: ; 51151 (14:5151) xor a ld [wJoyIgnore], a ld a, HS_ROUTE_22_RIVAL_2 - ld [wcc4d], a + ld [wMissableObjectIndex], a predef HideObject call PlayDefaultMusic ResetEvents EVENT_2ND_ROUTE22_RIVAL_BATTLE, EVENT_ROUTE22_RIVAL_WANTS_BATTLE -- cgit v1.2.3 From 2b018159997e3b580efd114ff4e3548a0de3cbc5 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 8 Aug 2015 22:32:44 -0700 Subject: commented audio code --- scripts/route22.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index 041f75e6..f6f6778e 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -89,7 +89,7 @@ Route22Script0: ; 50f00 (14:4f00) and a jr z, .asm_50f4e ld a, $ff - ld [wc0ee], a + ld [wNewSoundID], a call PlaySound .asm_50f4e ld c, BANK(Music_MeetRival) @@ -168,7 +168,7 @@ Route22Script2: ; 50fb5 (14:4fb5) ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff - ld [wc0ee], a + ld [wNewSoundID], a call PlaySound callba Music_RivalAlternateStart ld a, [wcf0d] @@ -242,11 +242,11 @@ Route22Script_5104e: ; 5104e (14:504e) and a jr z, .skipYVisibilityTesta ld a, $ff - ld [wc0ee], a + ld [wNewSoundID], a call PlaySound .skipYVisibilityTesta ld a, $ff - ld [wc0ee], a + ld [wNewSoundID], a call PlaySound callba Music_RivalAlternateTempo ld a, $2 @@ -327,7 +327,7 @@ Route22Script5: ; 510df (14:50df) ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $ff - ld [wc0ee], a + ld [wNewSoundID], a call PlaySound callba Music_RivalAlternateStartAndTempo ld a, [wcf0d] -- cgit v1.2.3 From dfc152d667e3695f83eb0fbabb839b0fad275ceb Mon Sep 17 00:00:00 2001 From: dannye Date: Mon, 10 Aug 2015 11:09:16 -0500 Subject: No more $C8 Use OPP_ constants separate from trainer constants since valid opponents can be all Pokemon and trainers --- scripts/route22.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/route22.asm') diff --git a/scripts/route22.asm b/scripts/route22.asm index f6f6778e..1244f0ff 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -131,7 +131,7 @@ Route22Script1: ; 50f62 (14:4f62) ld hl, Route22RivalDefeatedText1 ld de, Route22Text_511bc call SaveEndBattleTextPointers - ld a, SONY1 + $c8 + ld a, OPP_SONY1 ld [W_CUROPPONENT], a ld hl, StarterMons_50faf call Route22Script_50ed6 @@ -287,7 +287,7 @@ Route22Script4: ; 51087 (14:5087) ld hl, Route22RivalDefeatedText2 ld de, Route22Text_511d0 call SaveEndBattleTextPointers - ld a, SONY2 + $c8 + ld a, OPP_SONY2 ld [W_CUROPPONENT], a ld hl, StarterMons_510d9 call Route22Script_50ed6 -- cgit v1.2.3