From ec77075a471b55042340c232fe242bdc07cbf80b Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 8 Oct 2013 12:44:45 -0400 Subject: [PATCH 01/17] ContestMons --- main.asm | 69 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/main.asm b/main.asm index 1707f0172..672f0c659 100644 --- a/main.asm +++ b/main.asm @@ -66722,32 +66722,45 @@ Function97d23: ; 97d23 ; 97d31 Function97d31: ; 97d31 +; Pick a random mon out of ContestMons. + .asm_97d31 call Random cp 100 << 1 jr nc, .asm_97d31 srl a - ld hl, Table97d87 - ld de, 4 -.asm_97d40 - sub [hl] - jr c, .asm_97d46 - add hl, de - jr .asm_97d40 -.asm_97d46 + ld hl, ContestMons + ld de, 4 +.CheckMon + sub [hl] + jr c, .GotMon + add hl, de + jr .CheckMon + +.GotMon inc hl + +; Species ld a, [hli] ld [$d22e], a + +; Min level ld a, [hli] ld d, a - ld a, [hl] - sub d - jr nz, .asm_97d54 - ld a, d - jr .asm_97d5f -.asm_97d54 +; Max level + ld a, [hl] + + sub d + jr nz, .RandomLevel + +; If min and max are the same. + ld a, d + jr .GotLevel + +.RandomLevel +; Get a random level between the min and max. ld c, a inc c call Random @@ -66755,8 +66768,9 @@ Function97d31: ; 97d31 call SimpleDivide add d -.asm_97d5f +.GotLevel ld [CurPartyLevel], a + xor a ret ; 97d64 @@ -66784,18 +66798,19 @@ Function97d64: ; 97d64 ret ; 97d87 -Table97d87: ; 97d87 - db 20, $0a, $07, $12 - db 20, $0d, $07, $12 - db 10, $0b, $09, $12 - db 10, $0e, $09, $12 - db 5, $0c, $0c, $0f - db 5, $0f, $0c, $0f - db 10, $30, $0a, $10 - db 10, $2e, $0a, $11 - db 5, $7b, $0d, $0e - db 5, $7f, $0d, $0e - db -1, $31, $1e, $28 +ContestMons: ; 97d87 + ; %, species, min, max + db 20, CATERPIE, 7, 18 + db 20, WEEDLE, 7, 18 + db 10, METAPOD, 9, 18 + db 10, KAKUNA, 9, 18 + db 5, BUTTERFREE, 12, 15 + db 5, BEEDRILL, 12, 15 + db 10, VENONAT, 10, 16 + db 10, PARAS, 10, 17 + db 5, SCYTHER, 13, 14 + db 5, PINSIR, 13, 14 + db -1, VENOMOTH, 30, 40 ; 97db3 Function97db3: ; 97db3 From 4ac678313f9c7b9d28774a1a936b8de64350b478 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 8 Oct 2013 13:05:52 -0400 Subject: [PATCH 02/17] rename 'PlaySFX' to 'PlayStereoSFX' --- audio/engine.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index e54bda967..46bc29c11 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -5,7 +5,7 @@ ; Notable functions: ; UpdateSound (called during VBlank) ; FadeMusic -; PlaySFX +; PlayStereoSFX ; PlayCry SoundRestart: ; e8000 @@ -2566,7 +2566,7 @@ LoadSFX: ; e8c04 ; e8ca6 -PlaySFX: ; e8ca6 +PlayStereoSFX: ; e8ca6 ; play sfx de call MusicOff From 546c17ad37b1e0cfd91ea630e0bbc044c28b3e6a Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 8 Oct 2013 13:10:36 -0400 Subject: [PATCH 03/17] rename 'StartSFX' to 'PlaySFX' --- engine/scripting.asm | 6 +- engine/title.asm | 2 +- home/joypad.asm | 2 +- home/menu.asm | 2 +- home/text.asm | 2 +- main.asm | 138 +++++++++++++++++++++---------------------- 6 files changed, 76 insertions(+), 76 deletions(-) diff --git a/engine/scripting.asm b/engine/scripting.asm index 39a56950e..06364a27c 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -588,7 +588,7 @@ Script_specialsound: ; 0x96fe4 jr z, .play ld de, SFX_ITEM .play - call StartSFX + call PlaySFX call WaitSFX ret ; 0x96ffe @@ -954,7 +954,7 @@ Script_playsound: ; 0x971b7 ld e, a call GetScriptByte ld d, a - call StartSFX + call PlaySFX ret ; 0x971c3 @@ -971,7 +971,7 @@ Script_warpsound: ; 0x971c7 ld a, $5 ld hl, $4a07 rst $8 - call StartSFX + call PlaySFX ret ; 0x971d1 diff --git a/engine/title.asm b/engine/title.asm index 3772b052f..97428430c 100644 --- a/engine/title.asm +++ b/engine/title.asm @@ -225,7 +225,7 @@ _TitleScreen: ; 10ed67 ; Play starting sound effect call SFXChannelsOff ld de, SFX_TITLE_SCREEN_ENTRANCE - call StartSFX + call PlaySFX ret ; 10eea7 diff --git a/home/joypad.asm b/home/joypad.asm index 198e1c47b..efe70e809 100644 --- a/home/joypad.asm +++ b/home/joypad.asm @@ -394,7 +394,7 @@ Functionaaf: ; aaf call Functionac6 push de ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX pop de ret diff --git a/home/menu.asm b/home/menu.asm index c761a927c..b3a3de377 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -532,7 +532,7 @@ Function1ff8: ; 1ff8 PlayClickSFX: ; 2009 push de ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX pop de ret ; 0x2012 diff --git a/home/text.asm b/home/text.asm index e010de6d4..d5123b849 100644 --- a/home/text.asm +++ b/home/text.asm @@ -1091,7 +1091,7 @@ Text_PlaySound:: ; 1500 ld e, [hl] inc hl ld d, [hl] - call StartSFX + call PlaySFX call WaitSFX pop de diff --git a/main.asm b/main.asm index 672f0c659..12ad9fa69 100644 --- a/main.asm +++ b/main.asm @@ -3183,7 +3183,7 @@ PlayCryHeader: ; 3be3 ; 3c23 -StartSFX: ; 3c23 +PlaySFX: ; 3c23 ; Play sound effect de. ; Sound effects are ordered by priority (lowest to highest) @@ -3225,7 +3225,7 @@ StartSFX: ; 3c23 WaitPlaySFX: ; 3c4e call WaitSFX - call StartSFX + call PlaySFX ret ; 3c55 @@ -5238,7 +5238,7 @@ Function48b3: ; 48b3 call Function6ec1 jr c, .asm_48eb ld de, SFX_STRENGTH - call StartSFX + call PlaySFX call Function5538 call Function463f ld hl, $0009 @@ -8695,7 +8695,7 @@ Function610f: ; 610f ld [MusicFadeIDHi], a ld de, SFX_ESCAPE_ROPE - call StartSFX + call PlaySFX pop af rst Bankswitch @@ -9554,7 +9554,7 @@ UnknownText_0x6684: ; 6684 ; 6689 push de ld de, SFX_SWITCH_POKEMON - call StartSFX + call PlaySFX pop de ld hl, UnknownText_0x6695 ret @@ -13213,7 +13213,7 @@ UnknownText_0xc8f3: ; 0xc8f3 Functionc8f8: ; c8f8 call WaitSFX ld de, SFX_FLASH - call StartSFX + call PlaySFX call WaitSFX ld hl, UnknownText_0xc908 ret @@ -16213,7 +16213,7 @@ Functiondd21: ; dd21 ld a, [BreedMon1Species] ld [CurPartySpecies], a ld de, $0022 - call StartSFX + call PlaySFX call WaitSFX call Functione698 ld a, b @@ -16229,7 +16229,7 @@ Functiondd42: ; dd42 ld a, [BreedMon2Species] ld [CurPartySpecies], a ld de, $0022 - call StartSFX + call PlaySFX call WaitSFX call Functione6b3 ld a, b @@ -18064,7 +18064,7 @@ Function1076f: ; 1076f ld [$cf63], a push de ld de, SFX_UNKNOWN_62 - call StartSFX + call PlaySFX pop de scf ret @@ -18076,7 +18076,7 @@ Function1076f: ; 1076f ld [$cf63], a push de ld de, SFX_UNKNOWN_62 - call StartSFX + call PlaySFX pop de scf ret @@ -19260,7 +19260,7 @@ Function123a7: ; 123a7 call Function124a3 push de ld de, $0012 - call StartSFX + call PlaySFX pop de ld c, $1e call DelayFrames @@ -19277,11 +19277,11 @@ Function123bf: ; 123bf Function123c8: ; 123c8 ld de, $00aa - call StartSFX + call PlaySFX call Function12459 call WaitSFX ld de, $000d - call StartSFX + call PlaySFX ret ; 123db @@ -19507,7 +19507,7 @@ StartMenu: ; 125cd call Function1fbf ld de, SFX_MENU - call StartSFX + call PlaySFX callba Function6454 @@ -21105,10 +21105,10 @@ Function130c6: ; 130c6 .asm_13113 ld de, $0020 - call StartSFX + call PlaySFX call WaitSFX ld de, $0020 - call StartSFX + call PlaySFX call WaitSFX ld hl, $c4c9 ld bc, $0812 @@ -25026,7 +25026,7 @@ Function15650: ; 15650 and a ret nz ld de, $000f - call StartSFX + call PlaySFX ld hl, $5663 call Function15a20 scf @@ -25058,7 +25058,7 @@ Function156d0: ; 156d0 push de call WaitSFX pop de - call StartSFX + call PlaySFX ret ; 156d9 @@ -26260,7 +26260,7 @@ UnknownText_0x15fbe: ; 0x15fbe Function15fc3: ; 15fc3 call WaitSFX ld de, SFX_TRANSACTION - call StartSFX + call PlaySFX ret ; 15fcd @@ -26804,7 +26804,7 @@ Function16936: ; 16936 ld hl, $6998 call PrintText ld de, $0096 - call StartSFX + call PlaySFX ld c, $78 call DelayFrames ld hl, $699d @@ -29630,7 +29630,7 @@ Function24d59: ; 24d59 set 6, [hl] call Function1bc9 ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX ld a, [hJoyPressed] bit 0, a ; A jr nz, .asm_24d84 @@ -29853,7 +29853,7 @@ Function24e99: ; 24e99 set 6, [hl] call Function1bc9 ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX ld a, [hJoyPressed] bit 1, a jr z, .asm_24ed2 @@ -30248,7 +30248,7 @@ ProfOaksPCBoot ; 0x265ee ld hl, OakPCText2 call PrintText call Rate - call StartSFX ; sfx loaded by previous Rate function call + call PlaySFX ; sfx loaded by previous Rate function call call Functiona36 call WaitSFX ret @@ -30260,7 +30260,7 @@ Function26601: ; 0x26601 ld de, MUSIC_NONE call StartMusic pop de - call StartSFX + call PlaySFX call Functiona36 call WaitSFX ret @@ -35398,7 +35398,7 @@ Function2c547: ; 2c547 call Function2c5f9 call WaitSFX ld de, $0097 - call StartSFX + call PlaySFX call WaitSFX ld hl, $45db call PrintText @@ -35526,7 +35526,7 @@ Function2c7fb: ; 2c7fb push bc push af ld de, SFX_WRONG - call StartSFX + call PlaySFX call WaitSFX pop af pop bc @@ -36252,7 +36252,7 @@ Function38387: ; 38387 Function3839a: ; 3839a push de ld de, SFX_FULL_HEAL - call StartSFX + call PlaySFX pop de ret ; 383a3 @@ -36918,7 +36918,7 @@ Function3c0e5: ; 3c0e5 jr c, .asm_3c126 ld de, SFX_RUN - call StartSFX + call PlaySFX .asm_3c126 call SetPlayerTurn @@ -39076,10 +39076,10 @@ Function3cef1: ; 3cef1 Function3cf14: ; 3cf14 call WaitSFX ld de, SFX_KINESIS - call StartSFX + call PlaySFX call Function3d432 ld de, SFX_UNKNOWN_2A - call StartSFX + call PlaySFX hlcoord 1, 0 ld bc, $040a call ClearBox @@ -39753,7 +39753,7 @@ Function3d362: ; 3d362 call Function3d2e0 ret c ld de, SFX_WRONG - call StartSFX + call PlaySFX call WaitSFX jr .asm_3d362 ; 3d375 @@ -41105,10 +41105,10 @@ Function3dc5b: ; 3dc5b or [hl] jr nz, .asm_3dce4 ld de, SFX_KINESIS - call StartSFX + call PlaySFX call WaitSFX ld de, SFX_UNKNOWN_2A - call StartSFX + call PlaySFX call WaitSFX call Function3d432 ld hl, BattleText_0x809a8 @@ -44368,7 +44368,7 @@ Function3ee3b: ; 3ee3b cp b jr z, .asm_3f057 ld de, SFX_HIT_END_OF_EXP_BAR - call StartSFX + call PlaySFX call WaitSFX ld hl, BattleText_0x80c9c call StdBattleTextBox @@ -44618,7 +44618,7 @@ Function3f136: ; 3f136 call CopyBytes call Function3dfe ld de, SFX_HIT_END_OF_EXP_BAR - call StartSFX + call PlaySFX ld a, $23 ld hl, $679d rst FarCall @@ -44655,7 +44655,7 @@ Function3f21b: ; 3f21b push bc call WaitSFX ld de, SFX_EXP_BAR - call StartSFX + call PlaySFX ld c, 10 call DelayFrames pop bc @@ -46237,7 +46237,7 @@ BattleStartMessage: ; 3fc8b jr z, .asm_3fcaa ld de, SFX_SHINE - call StartSFX + call PlaySFX call WaitSFX ld c, 20 @@ -46372,7 +46372,7 @@ Function40000: ; 40000 .asm_4003b ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX call WaitSFX call ClearSprites ld a, [$c7d4] @@ -47189,7 +47189,7 @@ Function421e6: ; 421e6 ld de, MUSIC_NONE call StartMusic ld de, SFX_CAUGHT_MON - call StartSFX + call PlaySFX call WaitSFX ld c, $28 call DelayFrames @@ -48654,7 +48654,7 @@ Function492b9: ; 492b9 jr nz, .asm_492e5 push de ld de, SFX_WRONG - call StartSFX + call PlaySFX pop de ld a, $b ld hl, $48ce @@ -49990,7 +49990,7 @@ Function4a94e: ; 4a94e .asm_4a9b0 ld de, $0019 - call StartSFX + call PlaySFX ld hl, $69be call PrintText jr .asm_4a974 @@ -50253,7 +50253,7 @@ Function4ab1a: ; 4ab1a ld a, [hl] ld [CurPartySpecies], a ld de, $0008 - call StartSFX + call PlaySFX call WaitSFX ld a, $1 and a @@ -50264,7 +50264,7 @@ Function4ab1a: ; 4ab1a ld [$d0d8], a .asm_4ab73 ld de, $0008 - call StartSFX + call PlaySFX call WaitSFX scf ret @@ -50276,7 +50276,7 @@ Function4ab1a: ; 4ab1a cp $2 jr z, .asm_4ab73 ld de, $0008 - call StartSFX + call PlaySFX call WaitSFX xor a ld [$d018], a @@ -50478,7 +50478,7 @@ Function4acaa: ; 4acaa set 6, [hl] call Function1bc9 ld de, $0008 - call StartSFX + call PlaySFX ld a, [hJoyPressed] bit 0, a jr nz, .asm_4acf4 @@ -52315,7 +52315,7 @@ EggStatsScreen: ; 4e33a cp 6 ret nc ld de, SFX_2_BOOPS - call StartSFX + call PlaySFX ret ; 0x4e3c0 @@ -52634,7 +52634,7 @@ Function4e7a6: ; 4e7a6 and a ret nz ld de, SFX_EVOLVED - call StartSFX + call PlaySFX ld hl, $cf63 ld a, [hl] push af @@ -54149,14 +54149,14 @@ PartyMenuSelect: ; 0x50457 ld [CurPartySpecies], a ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX call WaitSFX and a ret .exitmenu ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX call WaitSFX scf ret @@ -54348,7 +54348,7 @@ Function5062e: ; 5062e Function50658: ; 50658 ld de, SFX_POISON - call StartSFX + call PlaySFX ld b, $2 ld a, $2e call Predef @@ -56844,7 +56844,7 @@ TryJumpLedge: ; 801f3 jr z, .DontJump ld de, SFX_JUMP_OVER_LEDGE - call StartSFX + call PlaySFX ld a, STEP_LEDGE call DoStep ld a, 7 @@ -57247,7 +57247,7 @@ PlayBump: ; 803ee call CheckSFX ret c ld de, SFX_BUMP - call StartSFX + call PlaySFX ret ; 803f9 @@ -60379,7 +60379,7 @@ Function89a57: ; 89a57 Function89a8a: ; 89a8a push af ld de, $0062 - call StartSFX + call PlaySFX pop af ret ; 89a93 @@ -61078,7 +61078,7 @@ Function8afd4: ; 8afd4 .asm_8b051 ld de, $0022 - call StartSFX + call PlaySFX ld hl, $707c .asm_8b05a @@ -62358,7 +62358,7 @@ INCBIN "baserom.gbc", $8c6f7, $8c7d4 - $8c6f7 Function8c7d4: ; 8c7d4 call WaitSFX ld de, $0053 - call StartSFX + call PlaySFX call WaitSFX ret ; 8c7e1 @@ -62372,7 +62372,7 @@ Function8c940: ; 8c940 call Function8c96d call WaitSFX ld de, $001e - call StartSFX + call PlaySFX .asm_8c952 ld a, [$cf63] bit 7, a @@ -63687,7 +63687,7 @@ Function9031d: ; 9031d ld hl, UnknownText_0x9032a call PrintText ld de, SFX_HANG_UP - call StartSFX + call PlaySFX ret ; 9032a @@ -63717,7 +63717,7 @@ Function9033b: ; 9033b Function9033f: ; 9033f call WaitSFX ld de, SFX_CALL - call StartSFX + call PlaySFX call Function90375 call Function1ad2 ld a, $13 @@ -65931,7 +65931,7 @@ CheckAPressOW: ; 96999 PlayTalkObject: ; 969ac push de ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX pop de ret ; 969b5 @@ -68675,7 +68675,7 @@ Functioncc881: ; cc881 ld de, $00ab .asm_cc8a0 - call StartSFX + call PlaySFX ret ; cc8a4 @@ -70971,7 +70971,7 @@ _OptionsMenu: ; e41d0 .asm_e4234 ld de, SFX_TRANSACTION - call StartSFX + call PlaySFX call WaitSFX pop af ld [$ffaa], a @@ -71664,7 +71664,7 @@ Functione468d: ; e468d call CopyBytes call Functione4687 ld de, SFX_GAME_FREAK_PRESENTS - call StartSFX + call PlaySFX ret ; e46af @@ -75593,7 +75593,7 @@ Function100902: ; 100902 ld de, StringBuffer2 call PrintNum ld de, SFX_TWO_PC_BEEPS - call StartSFX + call PlaySFX callba Function104061 ld c, $3c call DelayFrames @@ -75604,7 +75604,7 @@ Function100902: ; 100902 ld hl, $c580 call PlaceString ld de, SFX_4_NOTE_DITTY - call StartSFX + call PlaySFX callba Function104061 ld c, $78 call DelayFrames @@ -76131,14 +76131,14 @@ Function100cb5: ; 100cb5 ld a, [hl] ld [CurPartySpecies], a ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX call WaitSFX and a ret .asm_100d17 ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX call WaitSFX scf ret @@ -76172,7 +76172,7 @@ Function100d22: ; 100d22 .asm_100d56 push af ld de, SFX_READ_TEXT_2 - call StartSFX + call PlaySFX pop af bit 1, a jr z, .asm_100d65 @@ -76343,7 +76343,7 @@ Function100e63: ; 100e63 call Function100db0 ret nc ld de, SFX_ELEVATOR_END - call StartSFX + call PlaySFX ret ; 100e72 @@ -76664,7 +76664,7 @@ Function102142: ; 102142 ld hl, $61d1 call Function1d4f ld de, $0090 - call StartSFX + call PlaySFX call Functiona36 call Function1c07 call Function10219f From 963fe4808bc36cb72984dbfc7a8582059165d8d7 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 8 Oct 2013 13:13:35 -0400 Subject: [PATCH 04/17] rename 'LoadSFX' to '_PlaySFX' --- audio/engine.asm | 4 ++-- main.asm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index 46bc29c11..b1d4cd169 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -2465,7 +2465,7 @@ PlayCry: ; e8b79 ret ; e8c04 -LoadSFX: ; e8c04 +_PlaySFX: ; e8c04 ; clear channels if they aren't already call MusicOff ld hl, $c1cc ; Channel5Flags @@ -2574,7 +2574,7 @@ PlayStereoSFX: ; e8ca6 ; standard procedure if stereo's off ld a, [Options] bit 5, a - jp z, LoadSFX + jp z, _PlaySFX ; else, let's go ahead with this ld hl, MusicID diff --git a/main.asm b/main.asm index 12ad9fa69..2bb8da8d6 100644 --- a/main.asm +++ b/main.asm @@ -3203,13 +3203,13 @@ PlaySFX: ; 3c23 .play ld a, [hROMBank] push af - ld a, BANK(LoadSFX) + ld a, BANK(_PlaySFX) ld [hROMBank], a ld [MBC3RomBank], a ; bankswitch ld a, e ld [CurSFX], a - call LoadSFX + call _PlaySFX pop af ld [hROMBank], a From 789469c465aa18850e1888785b0eb816fd80a18a Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 8 Oct 2013 13:21:15 -0400 Subject: [PATCH 05/17] rename 'StartMusic' to 'PlayMusic' --- audio/trainer_encounters.asm | 4 +- engine/credits.asm | 4 +- engine/scripting.asm | 4 +- main.asm | 84 ++++++++++++++++++------------------ 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/audio/trainer_encounters.asm b/audio/trainer_encounters.asm index 7c64d586a..7ddc38f06 100644 --- a/audio/trainer_encounters.asm +++ b/audio/trainer_encounters.asm @@ -8,7 +8,7 @@ PlayTrainerEncounterMusic: ; e900a ; play nothing for one frame push de ld de, $0000 ; id: Music_Nothing - call StartMusic + call PlayMusic call DelayFrame ; play new song call MaxVolume @@ -17,7 +17,7 @@ PlayTrainerEncounterMusic: ; e900a ld hl, TrainerEncounterMusic add hl, de ld e, [hl] - call StartMusic + call PlayMusic ret ; e9027 diff --git a/engine/credits.asm b/engine/credits.asm index d5e4399b9..2cfac86f1 100644 --- a/engine/credits.asm +++ b/engine/credits.asm @@ -223,10 +223,10 @@ ParseCredits: ; 1099aa ld de, MUSIC_CREDITS push de ld de, MUSIC_NONE - call StartMusic + call PlayMusic call DelayFrame pop de - call StartMusic + call PlayMusic jp .loop .wait2 diff --git a/engine/scripting.asm b/engine/scripting.asm index 06364a27c..dcd266f6e 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -917,7 +917,7 @@ Script_playmusic: ; 0x97189 ; music_pointer (MultiByteParam) ld de, $0000 - call StartMusic + call PlayMusic xor a ld [$c2a7], a call MaxVolume @@ -925,7 +925,7 @@ Script_playmusic: ; 0x97189 ld e, a call GetScriptByte ld d, a - call StartMusic + call PlayMusic ret ; 0x971a2 diff --git a/main.asm b/main.asm index 2bb8da8d6..2bc1e62a5 100644 --- a/main.asm +++ b/main.asm @@ -3055,7 +3055,7 @@ LoadMusicByte: ; 3b86 ; 3b97 -StartMusic: ; 3b97 +PlayMusic: ; 3b97 ; Play music de. push hl @@ -3091,7 +3091,7 @@ StartMusic: ; 3b97 ; 3bbc -StartMusic2: ; 3bbc +PlayMusic2: ; 3bbc ; Stop playing music, then play music de. push hl @@ -3357,12 +3357,12 @@ Function3cdf: ; 3cdf jr z, .asm_3cfe push de ld de, MUSIC_NONE - call StartMusic + call PlayMusic call DelayFrame pop de ld a, e ld [CurMusic], a - call StartMusic + call PlayMusic .asm_3cfe pop af @@ -3387,12 +3387,12 @@ Function3d03: ; 3d03 .asm_3d18 push de ld de, MUSIC_NONE - call StartMusic + call PlayMusic call DelayFrame pop de ld a, e ld [CurMusic], a - call StartMusic + call PlayMusic pop af pop bc pop de @@ -3407,7 +3407,7 @@ Function3d2f: ; 3d2f xor a ld [CurMusic], a ld de, MUSIC_NONE - call StartMusic + call PlayMusic call DelayFrame xor a ld [$c2c1], a @@ -3420,12 +3420,12 @@ Function3d47: ; 3d47 push bc push af ld de, MUSIC_NONE - call StartMusic + call PlayMusic call DelayFrame ld a, [CurMusic] ld e, a ld d, 0 - call StartMusic + call PlayMusic pop af pop bc pop de @@ -7794,12 +7794,12 @@ Function5ac2: ; 5ac2 Function5ae8: ; 5ae8 ld de, MUSIC_NONE - call StartMusic + call PlayMusic call DelayFrame ld de, MUSIC_MAIN_MENU ld a, e ld [CurMusic], a - call StartMusic + call PlayMusic ld a, $12 ld hl, $5cdc rst FarCall @@ -8503,7 +8503,7 @@ OakSpeech: ; 0x5f99 call ClearTileMap ld de, MUSIC_ROUTE_30 - call StartMusic + call PlayMusic call Function4a3 call Function4b6 @@ -9012,7 +9012,7 @@ TitleScreenEntrance: ; 62bc ; Play the title screen music. ld de, MUSIC_TITLE - call StartMusic + call PlayMusic ld a, $88 ld [hWY], a @@ -14294,13 +14294,13 @@ Functiond0bc: ; d0bc xor a ld [MusicFade], a ld de, $0000 - call StartMusic + call PlayMusic call DelayFrame call MaxVolume ld de, $0013 ld a, e ld [CurMusic], a - call StartMusic + call PlayMusic ld a, $1 ret @@ -19271,7 +19271,7 @@ Function123a7: ; 123a7 Function123bf: ; 123bf ld de, $000d - call StartMusic + call PlayMusic jp Function12459 ; 123c8 @@ -30258,7 +30258,7 @@ Function26601: ; 0x26601 call Rate push de ld de, MUSIC_NONE - call StartMusic + call PlayMusic pop de call PlaySFX call Functiona36 @@ -31130,7 +31130,7 @@ Function2805d: ; 2805d .asm_28091 ld de, $0000 - call StartMusic + call PlayMusic ld c, $3 call DelayFrames xor a @@ -31234,13 +31234,13 @@ Function2805d: ; 2805d ld a, $d3 ld [$d103], a ld de, $0000 - call StartMusic + call PlayMusic ld a, [$ffcb] cp $2 ld c, $42 call z, DelayFrames ld de, $002b - call StartMusic + call PlayMusic jp Function287e3 ; 28177 @@ -31273,7 +31273,7 @@ Function28177: ; 28177 .asm_281ae ld de, $0000 - call StartMusic + call PlayMusic ld c, $3 call DelayFrames xor a @@ -31310,7 +31310,7 @@ Function28177: ; 28177 ld a, $1d ld [rIE], a ld de, $0000 - call StartMusic + call PlayMusic call Function287ab ld hl, $d26b call Function287ca @@ -31476,7 +31476,7 @@ Function28177: ; 28177 ld a, $d3 ld [$d103], a ld de, $0000 - call StartMusic + call PlayMusic ld a, [$ffcb] cp $2 ld c, $42 @@ -31533,7 +31533,7 @@ Function28177: ; 28177 .asm_283a9 ld de, $002b - call StartMusic + call PlayMusic jp Function287e3 ; 283b2 @@ -33141,7 +33141,7 @@ Function28fa1: ; 28fa1 and a jr nz, .asm_28fca ld de, MUSIC_EVOLUTION - call StartMusic2 + call PlayMusic2 .asm_28fca call Function29082 jr nc, .asm_28fca @@ -35773,7 +35773,7 @@ PlayBattleMusic: ; 2ee6c xor a ld [MusicFade], a ld de, MUSIC_NONE - call StartMusic + call PlayMusic call DelayFrame call MaxVolume @@ -35866,7 +35866,7 @@ PlayBattleMusic: ; 2ee6c ld de, MUSIC_KANTO_TRAINER_BATTLE .done - call StartMusic + call PlayMusic pop bc pop de @@ -39376,7 +39376,7 @@ Function3d0be: ; 3d0be Function3d0ea: ; 3d0ea push de ld de, MUSIC_NONE - call StartMusic + call PlayMusic call DelayFrame ld de, MUSIC_WILD_VICTORY ld a, [IsInBattle] @@ -39402,7 +39402,7 @@ Function3d0ea: ; 3d0ea ld de, MUSIC_TRAINER_VICTORY .asm_3d11e - call StartMusic + call PlayMusic .asm_3d121 pop de @@ -47187,7 +47187,7 @@ Function421e6: ; 421e6 ld hl, $6094 rst FarCall ld de, MUSIC_NONE - call StartMusic + call PlayMusic ld de, SFX_CAUGHT_MON call PlaySFX call WaitSFX @@ -51198,7 +51198,7 @@ Function4d3b1: ; 4d3b1 call Functione51 call Functione5f ld de, $0054 - call StartMusic + call PlayMusic ld hl, $5408 call PrintText ld hl, $540d @@ -51442,7 +51442,7 @@ Function4d54c: ; 4d54c call Functione51 call Functione5f ld de, $0054 - call StartMusic + call PlayMusic ld hl, $5580 call PrintText ld hl, $5585 @@ -52409,7 +52409,7 @@ Function4e607: ; 4e607 ld a, $e4 ld [rOBP0], a ld de, $0000 - call StartMusic + call PlayMusic callba Function8cf53 ld de, $6831 ld hl, VTiles0 @@ -52451,7 +52451,7 @@ Function4e607: ; 4e607 .asm_4e67c ld de, $0022 - call StartMusic + call PlayMusic ld c, $50 call DelayFrames ld c, $1 @@ -53044,7 +53044,7 @@ Function4ea82: ; 4ea82 and a ret nz ld de, $0000 - call StartMusic + call PlayMusic call ClearTileMap ld hl, $6b76 ld de, $d000 @@ -57787,7 +57787,7 @@ Function84742: ; 84742 Function8474c: ; 8474c ld de, MUSIC_PRINTER - call StartMusic2 + call PlayMusic2 ret ; 84753 @@ -58115,10 +58115,10 @@ Function8648e: ; 8648e Function864b4: ; 864b4 push de ld de, $0000 - call StartMusic + call PlayMusic call DelayFrame pop de - call StartMusic + call PlayMusic ret ; 864c3 @@ -62576,7 +62576,7 @@ Function8ccc9: ; 8ccc9 ld [hli], a ld [hli], a ld de, MUSIC_MAGNET_TRAIN - call StartMusic2 + call PlayMusic2 ret ; 8cd27 @@ -71501,7 +71501,7 @@ Functione455c: ; e455c Functione4579: ; e4579 ld de, MUSIC_NONE - call StartMusic + call PlayMusic call WhiteBGMap call ClearTileMap ld a, $98 @@ -71743,7 +71743,7 @@ Functione48bc: ; e48bc .asm_e48db ld de, $0000 - call StartMusic + call PlayMusic .asm_e48e1 call WhiteBGMap @@ -83289,7 +83289,7 @@ Function17d2ce: ; 17d2ce ld [MusicFadeIDLo], a ld a, d ld [MusicFadeIDHi], a - call StartMusic + call PlayMusic call Function222a call Function2b3c ret From 91b822ceb81f08944d6289f726b8ef2086722982 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 8 Oct 2013 13:26:05 -0400 Subject: [PATCH 06/17] rename 'LoadMusic' to '_PlayMusic' --- audio/engine.asm | 8 ++++---- main.asm | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index b1d4cd169..2017fa642 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -636,7 +636,7 @@ FadeMusic: ; e8358 ld a, [MusicFadeIDHi] ld d, a ; load new song - call LoadMusic + call _PlayMusic .quit ; cleanup pop bc @@ -658,7 +658,7 @@ FadeMusic: ; e8358 ld a, [MusicFadeIDHi] ld d, a ; load new song - call LoadMusic + call _PlayMusic pop bc ; fade in ld hl, MusicFade @@ -2081,7 +2081,7 @@ MusicEB: ; e8a30 call GetMusicByte ld d, a push bc - call LoadMusic + call _PlayMusic pop bc ret ; e8a3e @@ -2308,7 +2308,7 @@ SetLRTracks: ; e8b1b ret ; e8b30 -LoadMusic: ; e8b30 +_PlayMusic: ; e8b30 ; load music call MusicOff ld hl, MusicID diff --git a/main.asm b/main.asm index 2bc1e62a5..154bd1eb1 100644 --- a/main.asm +++ b/main.asm @@ -3065,7 +3065,7 @@ PlayMusic: ; 3b97 ld a, [hROMBank] push af - ld a, BANK(LoadMusic) ; and BANK(SoundRestart) + ld a, BANK(_PlayMusic) ; and BANK(SoundRestart) ld [hROMBank], a ld [MBC3RomBank], a @@ -3073,7 +3073,7 @@ PlayMusic: ; 3b97 and a jr z, .nomusic - call LoadMusic + call _PlayMusic jr .end .nomusic @@ -3101,16 +3101,16 @@ PlayMusic2: ; 3bbc ld a, [hROMBank] push af - ld a, BANK(LoadMusic) + ld a, BANK(_PlayMusic) ld [hROMBank], a ld [MBC3RomBank], a push de ld de, MUSIC_NONE - call LoadMusic + call _PlayMusic call DelayFrame pop de - call LoadMusic + call _PlayMusic pop af ld [hROMBank], a From aae33da95b5ef1b329764065caf828717c00cf72 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 8 Oct 2013 13:34:32 -0400 Subject: [PATCH 07/17] fix LoadMusicByte naming scheme --- audio/engine.asm | 20 ++++++++++---------- main.asm | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index 2017fa642..d1f3376a9 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -2103,7 +2103,7 @@ GetMusicByte: ; e8a3e add hl, bc ld a, [hl] ; get byte - call LoadMusicByte ; load data into CurMusicByte + call _LoadMusicByte ; load data into CurMusicByte inc de ; advance to next byte for next time this is called ; update channeldata address ld hl, Channel1MusicAddress - Channel1 @@ -2324,7 +2324,7 @@ _PlayMusic: ; e8b30 ld e, [hl] inc hl ld d, [hl] ; music header address - call FarLoadMusicByte ; store first byte of music header in a + call LoadMusicByte ; store first byte of music header in a rlca rlca and a, $03 ; get number of channels @@ -2379,7 +2379,7 @@ PlayCry: ; e8b79 ld d, [hl] ; Read the cry's sound header - call FarLoadMusicByte + call LoadMusicByte ; Top 2 bits contain the number of channels rlca rlca @@ -2544,7 +2544,7 @@ _PlaySFX: ; e8c04 inc hl ld d, [hl] ; get # channels - call FarLoadMusicByte + call LoadMusicByte rlca ; top 2 rlca ; bits and a, $03 @@ -2597,7 +2597,7 @@ PlayStereoSFX: ; e8ca6 ld d, [hl] ; bit 2-3 - call FarLoadMusicByte + call LoadMusicByte rlca rlca and 3 ; ch1-4 @@ -2674,7 +2674,7 @@ LoadChannel: ; e8d1b ; input: ; de: ; get pointer to current channel - call FarLoadMusicByte + call LoadMusicByte inc de and a, $07 ; bit 0-2 (current channel) ld [CurChannel], a @@ -2693,10 +2693,10 @@ LoadChannel: ; e8d1b ; load music pointer ld hl, Channel1MusicAddress - Channel1 add hl, bc - call FarLoadMusicByte + call LoadMusicByte ld [hli], a inc de - call FarLoadMusicByte + call LoadMusicByte ld [hl], a inc de ; load music id @@ -2745,13 +2745,13 @@ ChannelInit: ; e8d5b ret ; e8d76 -FarLoadMusicByte: ; e8d76 +LoadMusicByte: ; e8d76 ; input: ; de = current music address ; output: ; a = CurMusicByte ld a, [MusicBank] - call LoadMusicByte + call _LoadMusicByte ld a, [CurMusicByte] ret ; e8d80 diff --git a/main.asm b/main.asm index 154bd1eb1..2afdbb02b 100644 --- a/main.asm +++ b/main.asm @@ -3039,7 +3039,7 @@ CleanUpdateSound: ; 3b6a ; 3b86 -LoadMusicByte: ; 3b86 +_LoadMusicByte: ; 3b86 ; CurMusicByte = [a:de] ld [hROMBank], a From a0ba53e09dbe470f8c89335609e4222c5a454b70 Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 8 Oct 2013 13:37:11 -0400 Subject: [PATCH 08/17] stop hardcoding the return bank for _LoadMusicByte --- main.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.asm b/main.asm index 2afdbb02b..8bd4f162f 100644 --- a/main.asm +++ b/main.asm @@ -3047,7 +3047,7 @@ _LoadMusicByte: ; 3b86 ld a, [de] ld [CurMusicByte], a - ld a, $3a ; manual bank restore + ld a, BANK(LoadMusicByte) ld [hROMBank], a ld [MBC3RomBank], a From e1cce1cfb961c5f5f191156b9ce595fcf28b9f7e Mon Sep 17 00:00:00 2001 From: yenatch Date: Tue, 8 Oct 2013 22:28:51 -0400 Subject: [PATCH 09/17] fix padding in compressed intro graphics --- gfx/intro/001.lz | Bin 12 -> 16 bytes gfx/intro/002.lz | Bin 59 -> 64 bytes gfx/intro/003.lz | Bin 12 -> 16 bytes gfx/intro/004.lz | Bin 88 -> 96 bytes gfx/intro/005.lz | Bin 27 -> 32 bytes gfx/intro/006.lz | Bin 69 -> 80 bytes gfx/intro/007.lz | Bin 71 -> 80 bytes gfx/intro/008.lz | Bin 179 -> 192 bytes gfx/intro/009.lz | Bin 14 -> 16 bytes gfx/intro/010.lz | Bin 83 -> 96 bytes gfx/intro/011.lz | Bin 88 -> 96 bytes gfx/intro/012.lz | Bin 205 -> 208 bytes gfx/intro/013.lz | Bin 76 -> 80 bytes gfx/intro/014.lz | Bin 206 -> 208 bytes gfx/intro/015.lz | Bin 39 -> 48 bytes gfx/intro/017.lz | Bin 52 -> 64 bytes gfx/intro/background.lz | Bin 492 -> 496 bytes gfx/intro/crystal_unowns.lz | Bin 243 -> 256 bytes gfx/intro/logo.lz | Bin 1080 -> 1088 bytes gfx/intro/pichu_wooper.lz | Bin 835 -> 848 bytes gfx/intro/pulse.lz | Bin 135 -> 144 bytes gfx/intro/suicune_back.lz | Bin 923 -> 928 bytes gfx/intro/suicune_close.lz | Bin 1050 -> 1056 bytes gfx/intro/suicune_jump.lz | Bin 1210 -> 1216 bytes gfx/intro/suicune_run.lz | Bin 974 -> 976 bytes gfx/intro/unown_back.lz | Bin 317 -> 320 bytes gfx/intro/unowns.lz | Bin 1003 -> 1008 bytes main.asm | 108 +++++++++++------------------------- 28 files changed, 33 insertions(+), 75 deletions(-) diff --git a/gfx/intro/001.lz b/gfx/intro/001.lz index 467aa27c11c0fd723fdd5b18db1b979f23df77f3..926fb6e8e435eb7d204cb20fccd776d8bde3c5fa 100644 GIT binary patch literal 16 WcmXR`{eQIKll=Ur`~UxE00IC{=LjzV literal 12 UcmXR`{eQIKll=Ur`~Uw3052;DF8}}l diff --git a/gfx/intro/002.lz b/gfx/intro/002.lz index 1f460c26d53be30c600c32bb957f19bbd3a08af5..c63f215f2a33c7146423ce059a7dda0995b61717 100644 GIT binary patch delta 10 OcmcC^m|)Gy00ICC(*aBX delta 4 LcmZ>;o?s0C0}ug6 diff --git a/gfx/intro/003.lz b/gfx/intro/003.lz index 30ef2881755c6b436577099ae2be24d92df35824..182ffb13047217c2100358df03b3b3801c2c9842 100644 GIT binary patch literal 16 WcmaD_&-f(1=}CO^+x`C;fB*nX#0Q)J literal 12 TcmaD_&-f(1=}CO^+x`CmEmQ}b diff --git a/gfx/intro/004.lz b/gfx/intro/004.lz index dda9d45a47c48dca1353092d120114b5992b5831..5897d176b4824aff89fc42b001b4beadbcc20e4c 100644 GIT binary patch delta 13 Ocmaz@m=M9i00jUN?E$F( delta 4 LcmYd@m=FN~1Ox%0 diff --git a/gfx/intro/005.lz b/gfx/intro/005.lz index aabd0661ebf46a1bf9e14defd822362aeed0d4f4..0ae96b7f7264fcb396747bef7ebe13e3c1d7f9d1 100644 GIT binary patch delta 10 Ocmb1Em>|u{00IC9lK|`h delta 4 LcmY$8o*)eX0uTV_ diff --git a/gfx/intro/006.lz b/gfx/intro/006.lz index b9de6c532061532960fb2fecee7e6939014428d0..46436b607e6ab36ab79805cb2911462a57443c7e 100644 GIT binary patch delta 16 OcmZ<_nBdCIfB*m#^#OJO delta 4 LcmWG=o!|-p19$;z diff --git a/gfx/intro/007.lz b/gfx/intro/007.lz index d1974ec774e7eb0ac653ae32f7e13361d7d84c8a..d1694ed3e37b943ba559a32cac8134f6bb043270 100644 GIT binary patch delta 14 OcmZ<{nBdOI00RILCjoc> delta 4 LcmWG=pWqGv1AqZ< diff --git a/gfx/intro/008.lz b/gfx/intro/008.lz index ffd675a6d4a7f3c0223ec7ad7822930f4d78908f..356c6d5e8fea4741438e069c455dded8e8c3a85d 100644 GIT binary patch delta 20 RcmdnYcz|)jW?lwl001xN0>%IU delta 6 NcmX@WxS4UnW&jB-0=WPH diff --git a/gfx/intro/009.lz b/gfx/intro/009.lz index f419a8924cd2d689339cca2948436ad69ad50c7a..238d6a60e2b1c9b36fd3848b46a54dfa45fce11c 100644 GIT binary patch literal 16 YcmaE}Qkn65!|8?(_vgP0{m;Mv08p9<1ONa4 literal 14 WcmaE}Qkn65!|8?(_vgP0{SN>>k_iL= diff --git a/gfx/intro/010.lz b/gfx/intro/010.lz index fb2c453d009971062023201a90da0ca1a60e0c9f..6e45c45f7a9f72d27603bc1f0b3727468665e212 100644 GIT binary patch delta 18 OcmWGem=Mg%fD8Z{+X18i delta 4 LcmYcYo)8QG1MmTt diff --git a/gfx/intro/011.lz b/gfx/intro/011.lz index e565424a17431b4c5cbf6782b98928d7c4db9d48..68ceb19f8ad5324db9528ce487d2b47752dd4c3c 100644 GIT binary patch delta 13 Ocmaz@m=M9i00jUN?E$F( delta 4 LcmYd@m=FN~1Ox%0 diff --git a/gfx/intro/012.lz b/gfx/intro/012.lz index 4c35460fc2edb597352a497ea7303eecf718ce5c..0d6af294cc0d1d5cdfcb572814304c9c36b1d8f3 100644 GIT binary patch delta 10 RcmX@hc!6=kS!Mc$RU(SpW(T0{s90 diff --git a/gfx/intro/013.lz b/gfx/intro/013.lz index 0887b9a142de4f99a51505cc0282bc557b13f382..91635527c34546f296a1a3a8eb9c15265a807975 100644 GIT binary patch delta 9 OcmeYXnBc?000aOF0Repg delta 4 LcmWIWncxEe1C#-I diff --git a/gfx/intro/014.lz b/gfx/intro/014.lz index 8ec56538857b63418be1fc7b34b26f031710dfbc..a892ab1b42f0d3a0bb95595ef535f5a306e1939b 100644 GIT binary patch delta 9 QcmX@dc!6=kIVJ`M0231f0RR91 delta 6 Ncmcb>c#d(xIRFY20{;L2 diff --git a/gfx/intro/015.lz b/gfx/intro/015.lz index 3fc339a468befd6160150a53f94eb345b24864e7..22a4cc926144bd96f2baaef75b7766c041ef5e55 100644 GIT binary patch delta 14 OcmY#4n4r$d00RIGX8{-h delta 4 LcmXp|pP&u^0)PPz diff --git a/gfx/intro/017.lz b/gfx/intro/017.lz index 335d395582885a965c6331190f63cd29188df47f..90ce59e58784a4c7ffaa920510eb07f8c813aacb 100644 GIT binary patch delta 17 OcmXqUm|()gfCK;&X#qt5 delta 4 LcmZ=TnP36{0`vhn diff --git a/gfx/intro/background.lz b/gfx/intro/background.lz index 7d3fc52f711a441414071f0aac535fb3a8e4fe56..1ef2f12036ae834265ad07471e45c26a830dd998 100644 GIT binary patch delta 12 ScmaFE{DFDH8%7oeAOHX$#sh=^ delta 7 Ocmeys{DyhM8%6*RIs| diff --git a/gfx/intro/logo.lz b/gfx/intro/logo.lz index bd93412c0736073caa0e7aaa570dd2f6ce678bae..5beb0e6ef8fd43f09f06e93f1b3555062d74844d 100644 GIT binary patch delta 16 ScmdnNae!lk1q%lQ6aWAs2m*Zo delta 7 OcmX@Wv4dlS1q%QRvjTMh diff --git a/gfx/intro/pichu_wooper.lz b/gfx/intro/pichu_wooper.lz index c2a325bb728fb5669c5b52ad8df73bfaa62328ef..90174a098ad6288cd131af46a6a367a96d94e699 100644 GIT binary patch delta 21 ScmX@ic7bh!Gczv(G5`QED*~ec delta 7 Ocmcb>c9?C0Gcy1TTLP8< diff --git a/gfx/intro/pulse.lz b/gfx/intro/pulse.lz index 3ce37c136715ce2c3da1a7259671ff70ecb0d570..5a7fec1a939aad53d38add7bf9f6dcf7a7775188 100644 GIT binary patch delta 16 QcmZo?oWMAtos$6u03BljIsgCw delta 6 NcmbQh*v>ei9RLS00xevW;^Ic5M2vI8yv diff --git a/gfx/intro/unown_back.lz b/gfx/intro/unown_back.lz index a1c49ed3ab38477e2243bb2aa7fc7a214bd2a411..21cae29274cad59745e9b28f1dffa57d02ac1a96 100644 GIT binary patch delta 11 ScmdnXbbx7tEh94n0|NjRT>^6e delta 7 OcmX@Ww3lgvEh7L6mjZAA diff --git a/gfx/intro/unowns.lz b/gfx/intro/unowns.lz index 882af3b3464d8ae1a80fe8a17ea982f749765e3b..67e90b0b68a13673749e1877e7a77a750b3697b3 100644 GIT binary patch delta 13 ScmaFO{(*hNYi3pk5C8xqp#zNo delta 7 Ocmeys{+fNmYi0lsT?2>! diff --git a/main.asm b/main.asm index 8bd4f162f..763b60072 100644 --- a/main.asm +++ b/main.asm @@ -71793,159 +71793,119 @@ INCBIN "baserom.gbc", $e491e, $e555d - $e491e IntroSuicuneRunGFX: ; e555d INCBIN "gfx/intro/suicune_run.lz" -; e592b - -INCBIN "baserom.gbc", $e592b, $e592d - $e592b +; e592d IntroPichuWooperGFX: ; e592d INCBIN "gfx/intro/pichu_wooper.lz" -; e5c70 - -INCBIN "baserom.gbc", $e5c70, $e5c7d - $e5c70 +; e5c7d IntroBackgroundGFX: ; e5c7d INCBIN "gfx/intro/background.lz" -; e5e69 - -INCBIN "baserom.gbc", $e5e69, $e5e6d - $e5e69 +; e5e6d IntroTilemap004: ; e5e6d INCBIN "gfx/intro/004.lz" -; e5ec5 - -INCBIN "baserom.gbc", $e5ec5, $e5ecd - $e5ec5 +; e5ecd IntroTilemap003: ; e5ecd INCBIN "gfx/intro/003.lz" -; e5ed9 +; e5edd -INCBIN "baserom.gbc", $e5ed9, $e5f5d - $e5ed9 +INCBIN "baserom.gbc", $e5edd, $e5f5d - $e5edd IntroUnownsGFX: ; e5f5d INCBIN "gfx/intro/unowns.lz" -; e6348 - -INCBIN "baserom.gbc", $e6348, $e634d - $e6348 +; e634d IntroPulseGFX: ; e634d INCBIN "gfx/intro/pulse.lz" -; e63d4 - -INCBIN "baserom.gbc", $e63d4, $e63dd - $e63d4 +; e63dd IntroTilemap002: ; e63dd INCBIN "gfx/intro/002.lz" -; e6418 - -INCBIN "baserom.gbc", $e6418, $e641d - $e6418 +; e641d IntroTilemap001: ; e641d INCBIN "gfx/intro/001.lz" -; e6429 - -INCBIN "baserom.gbc", $e6429, $e642d - $e6429 +; e642d IntroTilemap006: ; e642d INCBIN "gfx/intro/006.lz" -; e6472 - -INCBIN "baserom.gbc", $e6472, $e647d - $e6472 +; e647d IntroTilemap005: ; e647d INCBIN "gfx/intro/005.lz" -; e6498 - -INCBIN "baserom.gbc", $e6498, $e649d - $e6498 +; e649d IntroTilemap008: ; e649d INCBIN "gfx/intro/008.lz" -; e6550 - -INCBIN "baserom.gbc", $e6550, $e655d - $e6550 +; e655d IntroTilemap007: ; e655d INCBIN "gfx/intro/007.lz" -; e65a4 +; e65ad -INCBIN "baserom.gbc", $e65a4, $e662d - $e65a4 +INCBIN "baserom.gbc", $e65ad, $e662d - $e65ad IntroCrystalUnownsGFX: ; e662d INCBIN "gfx/intro/crystal_unowns.lz" -; e6720 - -INCBIN "baserom.gbc", $e6720, $e672d - $e6720 +; e672d IntroTilemap017: ; e672d INCBIN "gfx/intro/017.lz" -; e6761 - -INCBIN "baserom.gbc", $e6761, $e676d - $e6761 +; e676d IntroTilemap015: ; e676d INCBIN "gfx/intro/015.lz" -; e6794 +; e679d -INCBIN "baserom.gbc", $e6794, $e681d - $e6794 +INCBIN "baserom.gbc", $e679d, $e681d - $e679d IntroSuicuneCloseGFX: ; e681d INCBIN "gfx/intro/suicune_close.lz" -; e6c37 - -INCBIN "baserom.gbc", $e6c37, $e6c3d - $e6c37 +; e6c3d IntroTilemap012: ; e6c3d INCBIN "gfx/intro/012.lz" -; e6d0a - -INCBIN "baserom.gbc", $e6d0a, $e6d0d - $e6d0a +; e6d0d IntroTilemap011: ; e6d0d INCBIN "gfx/intro/011.lz" -; e6d65 +; e6d6d -INCBIN "baserom.gbc", $e6d65, $e6ded - $e6d65 +INCBIN "baserom.gbc", $e6d6d, $e6ded - $e6d6d IntroSuicuneJumpGFX: ; e6ded INCBIN "gfx/intro/suicune_jump.lz" -; e72a7 - -INCBIN "baserom.gbc", $e72a7, $e72ad - $e72a7 +; e72ad IntroSuicuneBackGFX: ; e72ad INCBIN "gfx/intro/suicune_back.lz" -; e7648 - -INCBIN "baserom.gbc", $e7648, $e764d - $e7648 +; e764d IntroTilemap010: ; e764d INCBIN "gfx/intro/010.lz" -; e76a0 - -INCBIN "baserom.gbc", $e76a0, $e76ad - $e76a0 +; e76ad IntroTilemap009: ; e76ad INCBIN "gfx/intro/009.lz" -; e76bb - -INCBIN "baserom.gbc", $e76bb, $e76bd - $e76bb +; e76bd IntroTilemap014: ; e76bd INCBIN "gfx/intro/014.lz" -; e778b - -INCBIN "baserom.gbc", $e778b, $e778d - $e778b +; e778d IntroTilemap013: ; e778d INCBIN "gfx/intro/013.lz" -; e77d9 +; e77dd -INCBIN "baserom.gbc", $e77d9, $e785d - $e77d9 +INCBIN "baserom.gbc", $e77dd, $e785d - $e77dd IntroUnownBackGFX: ; e785d INCBIN "gfx/intro/unown_back.lz" -; e799a +; e799d -INCBIN "baserom.gbc", $e799a, $e7a70 - $e799a +INCBIN "baserom.gbc", $e799d, $e7a70 - $e799d ; ================================================================ @@ -78936,9 +78896,7 @@ INCBIN "baserom.gbc", $108bbd, $109407 - $108bbd IntroLogoGFX: ; 109407 INCBIN "gfx/intro/logo.lz" -; 10983f - -INCBIN "baserom.gbc", $10983f, $109847 - $10983f +; 109847 Function109847: ; 109847 From 754325b270c86163541429bb4fb37c809bdf7ea3 Mon Sep 17 00:00:00 2001 From: yenatch Date: Thu, 10 Oct 2013 03:02:14 -0400 Subject: [PATCH 10/17] use the IntroLogoGFX label in existing asm --- main.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.asm b/main.asm index 763b60072..f401bcfa8 100644 --- a/main.asm +++ b/main.asm @@ -71563,9 +71563,9 @@ Functione45e8: ; e45e8 push af ld a, $6 ld [rSVBK], a - ld hl, $5407 + ld hl, IntroLogoGFX ld de, $d000 - ld a, $42 + ld a, BANK(IntroLogoGFX) call FarDecompress ld hl, VTiles0 ld de, $d000 From 650dc98be4a5cb79e23cf4495acc25b3af7dc6c0 Mon Sep 17 00:00:00 2001 From: yenatch Date: Thu, 10 Oct 2013 03:12:02 -0400 Subject: [PATCH 11/17] game freak logo --- gfx/splash/logo.1bpp | Bin 0 -> 224 bytes main.asm | 9 ++++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 gfx/splash/logo.1bpp diff --git a/gfx/splash/logo.1bpp b/gfx/splash/logo.1bpp new file mode 100644 index 0000000000000000000000000000000000000000..c59bf619760e02ee5ac5f5598617a0c431de90f6 GIT binary patch literal 224 zcmXAizY4-I5QndbuC4(=Hz#p+5Z!zU2c^|a{@biJTEW$a=xYcHom>RzBPa#a$)t-! z2(1_W4(_}Aac~_wyj^G)2x&C7JptTVF8lo}WHuWO?F_U%!a;(jl+Eb7AgDW;Q3n8O zl`0|V&2%*#qxnJXU+A^tIUagWpR|r{4PCN8{~^t;?|W%#wp|zmD9ez_M;vp`?~#;J vDfJ7niI+hL_r%%=v%nO7 Date: Fri, 11 Oct 2013 01:36:11 -0400 Subject: [PATCH 12/17] roofs for each map group --- main.asm | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/main.asm b/main.asm index 6bccab331..c42a7a66d 100644 --- a/main.asm +++ b/main.asm @@ -27882,22 +27882,54 @@ SECTION "bank7",ROMX,BANK[$7] Function1c000: ; 1c000 ld a, [MapGroup] ld e, a - ld d, $0 - ld hl, $4021 + ld d, 0 + ld hl, MapGroupRoofs add hl, de ld a, [hl] cp $ff ret z - ld hl, $403c - ld bc, $0090 + ld hl, Roofs + ld bc, $90 call AddNTimes ld de, $90a0 - ld bc, $0090 + ld bc, $90 call CopyBytes ret ; 1c021 -INCBIN "baserom.gbc", $1c021, $1c30c - $1c021 +MapGroupRoofs: ; 1c021i + db -1 ; group 1 + db 3 ; group 2 + db 2 ; group 3 + db -1 ; group 4 + db 1 ; group 5 + db 2 ; group 6 + db -1 ; group 7 + db -1 ; group 8 + db 2 ; group 9 + db 2 ; group 10 + db 1 ; group 11 + db 4 ; group 12 + db -1 ; group 13 + db -1 ; group 14 + db -1 ; group 15 + db -1 ; group 16 + db -1 ; group 17 + db -1 ; group 18 + db -1 ; group 19 + db 0 ; group 20 + db -1 ; group 21 + db -1 ; group 22 + db 3 ; group 23 + db -1 ; group 24 + db 0 ; group 25 + db -1 ; group 26 + db 0 ; group 27 +; 1c03c + +Roofs: ; 1c03c +INCBIN "baserom.gbc", $1c03c, $1c30c - $1c03c +; 1c30c INCLUDE "tilesets/data_2.asm" From da689fa7d6f76f61aa946de93dc8f624f57cd203 Mon Sep 17 00:00:00 2001 From: yenatch Date: Fri, 11 Oct 2013 01:43:15 -0400 Subject: [PATCH 13/17] roof graphics --- gfx/tilesets/roofs/0.2bpp | Bin 0 -> 144 bytes gfx/tilesets/roofs/1.2bpp | Bin 0 -> 144 bytes gfx/tilesets/roofs/2.2bpp | Bin 0 -> 144 bytes gfx/tilesets/roofs/3.2bpp | Bin 0 -> 144 bytes gfx/tilesets/roofs/4.2bpp | Bin 0 -> 144 bytes main.asm | 6 +++++- 6 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 gfx/tilesets/roofs/0.2bpp create mode 100644 gfx/tilesets/roofs/1.2bpp create mode 100644 gfx/tilesets/roofs/2.2bpp create mode 100644 gfx/tilesets/roofs/3.2bpp create mode 100644 gfx/tilesets/roofs/4.2bpp diff --git a/gfx/tilesets/roofs/0.2bpp b/gfx/tilesets/roofs/0.2bpp new file mode 100644 index 0000000000000000000000000000000000000000..51650e2e10f2351686055b0df1477ce048c6e805 GIT binary patch literal 144 zcmcb6=q?yOxc~qEf&Ksg-&KM@hX4QngYa#22xJDbng0Uiq3Yo@R6R@|Og)UQuRm}A Xt`?{lXet9tEr|a2kDVE&7DNL8i2_>n literal 0 HcmV?d00001 diff --git a/gfx/tilesets/roofs/1.2bpp b/gfx/tilesets/roofs/1.2bpp new file mode 100644 index 0000000000000000000000000000000000000000..eea01d2f2f1781cf90b65115ac6c046c085b97fe GIT binary patch literal 144 zcmYL?K@I>w1OthO^D{5Q60)7Sv`K}Vf2|sV)HMWhcdR#Iy$S10sy5u2_X`^CtSFO* GT0e`h;H{mSWkn|HTv?Y3-( tsMnls+YHi&&If8~X!yV9|Np}foj^VV!~dH9`+=%KI)Qvf#{ac&J^*z;QDFc8 literal 0 HcmV?d00001 diff --git a/gfx/tilesets/roofs/3.2bpp b/gfx/tilesets/roofs/3.2bpp new file mode 100644 index 0000000000000000000000000000000000000000..1d88fac5badd4e3ca2f52c585ddc4a6b8f3e5c30 GIT binary patch literal 144 zcmZXNK?(ps2m W>+2g()kBSk>G}7Mk?|uZLI(it1xY6W literal 0 HcmV?d00001 diff --git a/main.asm b/main.asm index c42a7a66d..ce33f508a 100644 --- a/main.asm +++ b/main.asm @@ -27928,7 +27928,11 @@ MapGroupRoofs: ; 1c021i ; 1c03c Roofs: ; 1c03c -INCBIN "baserom.gbc", $1c03c, $1c30c - $1c03c +INCBIN "gfx/tilesets/roofs/0.2bpp" +INCBIN "gfx/tilesets/roofs/1.2bpp" +INCBIN "gfx/tilesets/roofs/2.2bpp" +INCBIN "gfx/tilesets/roofs/3.2bpp" +INCBIN "gfx/tilesets/roofs/4.2bpp" ; 1c30c INCLUDE "tilesets/data_2.asm" From 66ef18384779629d3653892c0cfa821ced6ad3c5 Mon Sep 17 00:00:00 2001 From: yenatch Date: Fri, 11 Oct 2013 02:31:51 -0400 Subject: [PATCH 14/17] relabel LoadMapGroupRoof --- home/map.asm | 4 +--- main.asm | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/home/map.asm b/home/map.asm index d4cfe1be9..f78340849 100644 --- a/home/map.asm +++ b/home/map.asm @@ -1418,9 +1418,7 @@ Function2821: ; 2821 jr .asm_2875 .asm_286f - ld a, $7 - ld hl, $4000 - rst FarCall + callba LoadMapGroupRoof .asm_2875 xor a diff --git a/main.asm b/main.asm index ce33f508a..e1ce5b270 100644 --- a/main.asm +++ b/main.asm @@ -27879,7 +27879,7 @@ INCLUDE "tilesets/data_1.asm" SECTION "bank7",ROMX,BANK[$7] -Function1c000: ; 1c000 +LoadMapGroupRoof: ; 1c000 ld a, [MapGroup] ld e, a ld d, 0 From 946a213f09db39243c883ad677a22de738977836 Mon Sep 17 00:00:00 2001 From: yenatch Date: Fri, 11 Oct 2013 02:49:08 -0400 Subject: [PATCH 15/17] fix labels for SoundRestart and UpdateSound --- audio/engine.asm | 7 +++---- home/init.asm | 4 ++-- home/vblank.asm | 28 ++++++++++++++-------------- main.asm | 18 +++++++++--------- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index d1f3376a9..ea48825d4 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -3,12 +3,11 @@ ; Interfaces are in bank 0. ; Notable functions: -; UpdateSound (called during VBlank) ; FadeMusic ; PlayStereoSFX ; PlayCry -SoundRestart: ; e8000 +_SoundRestart: ; e8000 ; restart sound operation ; clear all relevant hardware registers & wram push hl @@ -65,7 +64,7 @@ MusicFadeRestart: ; e803d push af ld a, [MusicFadeIDLo] push af - call SoundRestart + call _SoundRestart pop af ld [MusicFadeIDLo], a pop af @@ -85,7 +84,7 @@ MusicOff: ; e8057 ret ; e805c -UpdateSound: ; e805c +_UpdateSound: ; e805c ; called once per frame ; no use updating audio if it's not playing ld a, [MusicPlaying] diff --git a/home/init.asm b/home/init.asm index ead75975c..46ff1de4b 100644 --- a/home/init.asm +++ b/home/init.asm @@ -1,6 +1,6 @@ Reset: ; 150 di - call CleanSoundRestart + call SoundRestart xor a ld [$ffde], a call ClearPalettes @@ -170,7 +170,7 @@ Init: ; 17d ld a, $30 call Predef - call CleanSoundRestart + call SoundRestart xor a ld [CurMusic], a jp GameInit diff --git a/home/vblank.asm b/home/vblank.asm index 71114964e..f9e68785d 100644 --- a/home/vblank.asm +++ b/home/vblank.asm @@ -167,9 +167,9 @@ VBlank0: ; 2b1 call Joypad ; update sound - ld a, BANK(UpdateSound) + ld a, BANK(_UpdateSound) rst Bankswitch ; bankswitch - call UpdateSound + call _UpdateSound ld a, [$ff8a] rst Bankswitch ; restore bank @@ -189,9 +189,9 @@ VBlank2: ; 325 ld [$ff8a], a ; update sound - ld a, BANK(UpdateSound) + ld a, BANK(_UpdateSound) rst Bankswitch ; bankswitch - call UpdateSound + call _UpdateSound ; restore bank ld a, [$ff8a] @@ -265,9 +265,9 @@ VBlank1: ; 337 ei ; update sound - ld a, BANK(UpdateSound) + ld a, BANK(_UpdateSound) rst Bankswitch ; bankswitch - call UpdateSound + call _UpdateSound ; restore bank ld a, [$ff8a] rst Bankswitch @@ -369,9 +369,9 @@ VBlank3: ; 396 ei ; update sound - ld a, BANK(UpdateSound) + ld a, BANK(_UpdateSound) rst Bankswitch ; bankswitch - call UpdateSound + call _UpdateSound ; restore bank ld a, [$ff8a] rst Bankswitch @@ -434,9 +434,9 @@ VBlank4: ; 3df call AskSerial ; update sound - ld a, BANK(UpdateSound) + ld a, BANK(_UpdateSound) rst Bankswitch ; bankswitch - call UpdateSound + call _UpdateSound ; restore bank ld a, [$ff8a] rst Bankswitch @@ -486,9 +486,9 @@ VBlank5: ; 400 ei ; update sound - ld a, BANK(UpdateSound) + ld a, BANK(_UpdateSound) rst Bankswitch ; bankswitch - call UpdateSound + call _UpdateSound ; restore bank ld a, [$ff8a] rst Bankswitch @@ -531,9 +531,9 @@ VBlank6: ; 436 ld [VBlankOccurred], a ; update sound - ld a, BANK(UpdateSound) + ld a, BANK(_UpdateSound) rst Bankswitch ; bankswitch - call UpdateSound + call _UpdateSound ; restore bank ld a, [$ff8a] rst Bankswitch diff --git a/main.asm b/main.asm index e1ce5b270..134a9f3ed 100644 --- a/main.asm +++ b/main.asm @@ -2985,7 +2985,7 @@ Function3b3c: ; 3b3c ; 3b4e -CleanSoundRestart: ; 3b4e +SoundRestart: ; 3b4e push hl push de @@ -2994,11 +2994,11 @@ CleanSoundRestart: ; 3b4e ld a, [hROMBank] push af - ld a, BANK(SoundRestart) + ld a, BANK(_SoundRestart) ld [hROMBank], a ld [MBC3RomBank], a - call SoundRestart + call _SoundRestart pop af ld [hROMBank], a @@ -3012,7 +3012,7 @@ CleanSoundRestart: ; 3b4e ; 3b6a -CleanUpdateSound: ; 3b6a +UpdateSound: ; 3b6a push hl push de @@ -3021,11 +3021,11 @@ CleanUpdateSound: ; 3b6a ld a, [hROMBank] push af - ld a, BANK(UpdateSound) + ld a, BANK(_UpdateSound) ld [hROMBank], a ld [MBC3RomBank], a - call UpdateSound + call _UpdateSound pop af ld [hROMBank], a @@ -3065,7 +3065,7 @@ PlayMusic: ; 3b97 ld a, [hROMBank] push af - ld a, BANK(_PlayMusic) ; and BANK(SoundRestart) + ld a, BANK(_PlayMusic) ; and BANK(_SoundRestart) ld [hROMBank], a ld [MBC3RomBank], a @@ -3077,7 +3077,7 @@ PlayMusic: ; 3b97 jr .end .nomusic - call SoundRestart + call _SoundRestart .end pop af @@ -3316,7 +3316,7 @@ Function3cb4: ; 3cb4 and a ret z dec a - call CleanUpdateSound + call UpdateSound jr .asm_3cb4 ; 3cbc From 0ead58cdaac5e231650ed39db38344e52051254f Mon Sep 17 00:00:00 2001 From: yenatch Date: Fri, 11 Oct 2013 03:04:21 -0400 Subject: [PATCH 16/17] fix labels for and rename GetBattleVarPair to GetBattleVar --- battle/effect_commands.asm | 412 ++++++++++++++++++------------------- battle/effects/curse.asm | 2 +- battle/effects/endure.asm | 2 +- battle/effects/protect.asm | 4 +- battle/hidden_power.asm | 2 +- main.asm | 68 +++--- 6 files changed, 245 insertions(+), 245 deletions(-) diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm index 16d03b5e9..d0ce88404 100644 --- a/battle/effect_commands.asm +++ b/battle/effect_commands.asm @@ -46,7 +46,7 @@ DoTurn: ; 3401d DoMove: ; 3402c ; Get the user's move effect. ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar ld c, a ld b, 0 ld hl, MoveEffectsPointers @@ -124,7 +124,7 @@ BattleCommand01: ; 34084 ; Move $ff immediately ends the turn. ld a, BATTLE_VARS_MOVE - call CleanGetBattleVarPair + call GetBattleVar inc a jp z, Function0x34385 @@ -367,11 +367,11 @@ CheckPlayerTurn: CantMove: ; 341f0 ld a, BATTLE_VARS_SUBSTATUS1 - call GetBattleVarPair + call _GetBattleVar res 6, [hl] ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar ld a, [hl] and $ec ld [hl], a @@ -379,7 +379,7 @@ CantMove: ; 341f0 call ResetFuryCutterCount ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp FLY jr z, .asm_3420f @@ -569,7 +569,7 @@ CheckEnemyTurn: ; 3421f ; Flicker the monster pic unless flying or underground. ld de, $0115 ld a, BATTLE_VARS_SUBSTATUS3_OPP - call CleanGetBattleVarPair + call GetBattleVar and $60 call z, PlayFXAnimID @@ -658,11 +658,11 @@ MoveDisabled: ; 3438d ; Make sure any charged moves fail ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar res 4, [hl] ld a, BATTLE_VARS_MOVE - call CleanGetBattleVarPair + call GetBattleVar ld [$d265], a call GetMoveName @@ -693,7 +693,7 @@ HitConfusion: ; 343a5 ; Flicker the monster pic unless flying or underground. ld de, $0115 ld a, BATTLE_VARS_SUBSTATUS3_OPP - call CleanGetBattleVarPair + call GetBattleVar and $60 call z, PlayFXAnimID @@ -1026,7 +1026,7 @@ Function0x3450c: ; 3450c IgnoreSleepOnly: ; 3451f ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp SNORE jr z, .CheckSleep @@ -1037,7 +1037,7 @@ IgnoreSleepOnly: ; 3451f .CheckSleep ld a, BATTLE_VARS_STATUS - call CleanGetBattleVarPair + call GetBattleVar and 7 ret z @@ -1095,7 +1095,7 @@ BattleCommand04: ; 34555 ld [bc], a ld a, BATTLE_VARS_MOVE - call CleanGetBattleVarPair + call GetBattleVar cp STRUGGLE ret z @@ -1180,7 +1180,7 @@ BattleCommand04: ; 34555 call BattleCommandaa ; get move effect ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar ; continuous? ld hl, .continuousmoves ld de, 1 @@ -1222,7 +1222,7 @@ Function0x3460b: ; 3460b call UserPartyAttr ld a, BATTLE_VARS_MOVE - call CleanGetBattleVarPair + call GetBattleVar cp MIMIC jr z, .asm_3462f @@ -1250,7 +1250,7 @@ BattleCommand05: ; 34631 ld [CriticalHit], a ld a, BATTLE_VARS_MOVE_POWER - call CleanGetBattleVarPair + call GetBattleVar and a ret z @@ -1288,7 +1288,7 @@ BattleCommand05: ; 34631 .FocusEnergy ld a, BATTLE_VARS_SUBSTATUS4 - call CleanGetBattleVarPair + call GetBattleVar bit 2, a jr z, .CheckCritical @@ -1297,7 +1297,7 @@ BattleCommand05: ; 34631 .CheckCritical ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar ld de, 1 ld hl, .Criticals push bc @@ -1382,7 +1382,7 @@ BattleCommand4f: ; 346cd BattleCommand07: ; 346d2 ; stab ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp STRUGGLE ret z @@ -1410,7 +1410,7 @@ BattleCommand07: ; 346d2 .go ld a, BATTLE_VARS_MOVE_TYPE - call GetBattleVarPair + call _GetBattleVar ld [$d265], a push hl @@ -1457,7 +1457,7 @@ BattleCommand07: ; 346d2 .asm_3473a ld a, BATTLE_VARS_MOVE_TYPE - call CleanGetBattleVarPair + call GetBattleVar ld b, a ld hl, TypeMatchup @@ -1471,7 +1471,7 @@ BattleCommand07: ; 346d2 cp $fe jr nz, .asm_34757 ld a, BATTLE_VARS_SUBSTATUS1_OPP - call CleanGetBattleVarPair + call GetBattleVar bit 3, a jr nz, .end @@ -1579,7 +1579,7 @@ Function0x347d3: ; 347d3 push de push bc ld a, BATTLE_VARS_MOVE_TYPE - call CleanGetBattleVarPair + call GetBattleVar ld d, a ld b, [hl] inc hl @@ -1594,7 +1594,7 @@ Function0x347d3: ; 347d3 cp $fe jr nz, .asm_347fb ; 0x347ee $b ld a, BATTLE_VARS_SUBSTATUS1_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_IDENTIFIED, a jr nz, .asm_3482f ; 0x347f7 $36 jr .asm_347e7 ; 0x347f9 $ec @@ -2388,7 +2388,7 @@ BattleCommand09: ; 34d32 ; Perfect-accuracy moves ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_ALWAYS_HIT ret z @@ -2434,7 +2434,7 @@ BattleCommand09: ; 34d32 .Miss ; Keep the damage value intact if we're using (Hi) Jump Kick. ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_JUMP_KICK jr z, .Missed call ResetDamage @@ -2449,12 +2449,12 @@ BattleCommand09: ; 34d32 ; Return z if we're trying to eat the dream of ; a monster that isn't sleeping. ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_DREAM_EATER ret nz ld a, BATTLE_VARS_STATUS_OPP - call CleanGetBattleVarPair + call GetBattleVar and SLP ret @@ -2462,7 +2462,7 @@ BattleCommand09: ; 34d32 .Protect ; Return nz if the opponent is protected. ld a, BATTLE_VARS_SUBSTATUS1_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_PROTECT, a ret z @@ -2485,18 +2485,18 @@ BattleCommand09: ; 34d32 ; Return nz if we are locked-on and aren't trying to use Earthquake, ; Fissure or Magnitude on a monster that is flying. ld a, BATTLE_VARS_SUBSTATUS5_OPP - call GetBattleVarPair + call _GetBattleVar bit SUBSTATUS_LOCK_ON, [hl] res SUBSTATUS_LOCK_ON, [hl] ret z ld a, BATTLE_VARS_SUBSTATUS3_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_FLYING, a jr z, .LockedOn ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp EARTHQUAKE ret z @@ -2517,7 +2517,7 @@ BattleCommand09: ; 34d32 jr z, .asm_34e00 ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_LEECH_HIT ret z @@ -2535,7 +2535,7 @@ BattleCommand09: ; 34d32 ; Return z if the current move can hit the opponent. ld a, BATTLE_VARS_SUBSTATUS3_OPP - call CleanGetBattleVarPair + call GetBattleVar and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret z @@ -2543,7 +2543,7 @@ BattleCommand09: ; 34d32 jr z, .DigMoves ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp GUST ret z @@ -2556,7 +2556,7 @@ BattleCommand09: ; 34d32 .DigMoves ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp EARTHQUAKE ret z @@ -2569,7 +2569,7 @@ BattleCommand09: ; 34d32 .ThunderRain ; Return z if the current move always hits in rain, and it is raining. ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_THUNDER ret nz @@ -2581,7 +2581,7 @@ BattleCommand09: ; 34d32 .UnleashedEnergy ; Return nz if unleashing energy from Bide. ld a, BATTLE_VARS_SUBSTATUS4 - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_UNLEASH, a ret @@ -2610,7 +2610,7 @@ BattleCommand09: ; 34d32 jr c, .asm_34e6b ld a, BATTLE_VARS_SUBSTATUS1_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_IDENTIFIED, a ret nz @@ -2717,17 +2717,17 @@ BattleCommand90: ; 34ecc BattleCommand0a: ; 34eee ld a, BATTLE_VARS_SUBSTATUS4 - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_SUBSTITUTE, a ret z ld a, BATTLE_VARS_SUBSTATUS3 - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_CHARGED, a jr nz, .asm_34f18 ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_RAZOR_WIND jr z, .asm_34f21 cp EFFECT_SKY_ATTACK @@ -2764,7 +2764,7 @@ BattleCommand0a: ; 34eee .Rampage ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_ROLLOUT jr z, .asm_34f4d cp EFFECT_RAMPAGE @@ -2807,7 +2807,7 @@ BattleCommand0b: ; 34f60 .asm_34f76 ld [$cfca], a ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_MULTI_HIT jr z, .asm_34fb0 cp EFFECT_CONVERSION @@ -2824,13 +2824,13 @@ BattleCommand0b: ; 34f60 .asm_34f96 ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar ld e, a ld d, 0 call PlayFXAnimID ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp FLY jr z, .asm_34fad cp DIG @@ -2848,7 +2848,7 @@ BattleCommand0b: ; 34f60 cp $1 push af ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar ld e, a ld d, 0 pop af @@ -2889,7 +2889,7 @@ BattleCommand91_92: ; 34feb xor a ld [$c689], a ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar ld e, a ld d, 0 jp PlayFXAnimID @@ -2909,7 +2909,7 @@ BattleCommand93: ; 34ffd BattleCommand0c: ; 35004 ld a, BATTLE_VARS_SUBSTATUS4 - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_SUBSTITUTE, a ret z @@ -2934,7 +2934,7 @@ BattleCommand0d: ; 35023 call Function0x350e4 ld a, BATTLE_VARS_MOVE_ANIM - call GetBattleVarPair + call _GetBattleVar cp FLY jr z, .asm_3504f ; 35032 $1b @@ -2959,7 +2959,7 @@ BattleCommand0d: ; 35023 .asm_3504f ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar res SUBSTATUS_UNDERGROUND, [hl] res SUBSTATUS_FLYING, [hl] call Function0x37ece @@ -2971,7 +2971,7 @@ BattleCommand0e: ; 3505e ; checkfaint ld a, BATTLE_VARS_SUBSTATUS1_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_ENDURE, a jr z, .asm_35072 ; 35065 $b call BattleCommand4b @@ -3027,7 +3027,7 @@ BattleCommand0e: ; 3505e .asm_50bb ld a, BATTLE_VARS_SUBSTATUS4_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_SUBSTITUTE, a ret nz @@ -3065,7 +3065,7 @@ Function0x350e4: ; 350e4 and $7f jr z, .asm_35110 ; 0x350ef $1f ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_FUTURE_SIGHT ld hl, ButItFailedText ld de, ItFailedText @@ -3081,7 +3081,7 @@ Function0x350e4: ; 350e4 xor a ld [CriticalHit], a ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_JUMP_KICK ret nz ld a, [TypeModifier] @@ -3117,7 +3117,7 @@ Function0x350e4: ; 350e4 Function0x35157: ; 35157 ld a, BATTLE_VARS_SUBSTATUS1_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_PROTECT, a jr z, .asm_35162 ld h, d @@ -3192,7 +3192,7 @@ BattleCommandad: ; 351a5 ; supereffectivelooptext ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar bit 2, a ret nz @@ -3232,7 +3232,7 @@ BattleCommand11: ; 351c0 ret nz ld a, BATTLE_VARS_SUBSTATUS5_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_DESTINY_BOND, a jr z, .asm_35231 @@ -3285,7 +3285,7 @@ BattleCommand11: ; 351c0 .asm_35231 ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_MULTI_HIT jr z, .asm_3524a cp EFFECT_DOUBLE_HIT @@ -3315,7 +3315,7 @@ BattleCommand12: ; 35250 ret nz ld a, BATTLE_VARS_SUBSTATUS4_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_RAGE, a ret z @@ -4042,7 +4042,7 @@ BattleCommand62: ; 35612 ; Return 1 if successful, else 0. ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar ; Selfdestruct and Explosion halve defense. cp EFFECT_EXPLOSION @@ -4144,7 +4144,7 @@ BattleCommand62: ; 35612 ; Type ld b, a ld a, BATTLE_VARS_MOVE_TYPE - call CleanGetBattleVarPair + call GetBattleVar cp b jr nz, .DoneItem @@ -4303,14 +4303,14 @@ BattleCommand3f: ; 35726 .asm_35731 ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_LEVEL_DAMAGE ld b, [hl] ld a, 0 jr z, .asm_3578c ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_PSYWAVE jr z, .asm_35758 @@ -4321,7 +4321,7 @@ BattleCommand3f: ; 35726 jr z, .asm_35792 ld a, BATTLE_VARS_MOVE_POWER - call CleanGetBattleVarPair + call GetBattleVar ld b, a ld a, $0 jr .asm_3578c @@ -4464,7 +4464,7 @@ BattleCommand40: ; 35813 ld a, $1 ld [AttackMissed], a ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar and a ret z ld b, a @@ -4483,7 +4483,7 @@ BattleCommand40: ; 35813 call Function0x36abf ret z ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar dec a ld de, StringBuffer1 call GetMoveData @@ -4526,7 +4526,7 @@ BattleCommand41: ; 35864 ld de, PlayerEncoreCount .asm_35875 ld a, BATTLE_VARS_LAST_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar and a jp z, Function0x35923 cp STRUGGLE @@ -4551,7 +4551,7 @@ BattleCommand41: ; 35864 and a jp nz, Function0x35923 ld a, BATTLE_VARS_SUBSTATUS5_OPP - call GetBattleVarPair + call _GetBattleVar bit 4, [hl] jp nz, Function0x35923 set 4, [hl] @@ -4743,7 +4743,7 @@ Function0x359cd: ; 359cd BattleCommand43: ; 359d0 ; snore ld a, BATTLE_VARS_STATUS - call CleanGetBattleVarPair + call GetBattleVar and SLP ret nz call ResetDamage @@ -4767,7 +4767,7 @@ BattleCommand44: ; 359e6 ld hl, EnemyMonType1 .asm_359f7 ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar and a jr z, .asm_35a50 ; 359fd $51 push hl @@ -4795,7 +4795,7 @@ BattleCommand44: ; 359e6 ld [hld], a push hl ld a, BATTLE_VARS_MOVE_TYPE - call GetBattleVarPair + call _GetBattleVar push af push hl ld a, d @@ -4830,7 +4830,7 @@ BattleCommand45: ; 35a53 and a jr nz, .asm_35a6e ld a, BATTLE_VARS_SUBSTATUS5_OPP - call GetBattleVarPair + call _GetBattleVar set SUBSTATUS_LOCK_ON, [hl] call Function0x37e01 @@ -4856,7 +4856,7 @@ BattleCommand46: ; 35a74 call CheckSubstituteOpp jp nz, .asm_35b10 ld a, BATTLE_VARS_SUBSTATUS5_OPP - call GetBattleVarPair + call _GetBattleVar bit 3, [hl] jp nz, .asm_35b10 ld a, $2 @@ -4870,7 +4870,7 @@ BattleCommand46: ; 35a74 ld hl, EnemyMonMoves .asm_35aa5 ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar ld [$d265], a ld b, a and a @@ -4955,12 +4955,12 @@ BattleCommand47: ; 35b16 call Function0x37e01 ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar call Defrost ; Sharply raise accuracy ld a, BATTLE_VARS_MOVE_EFFECT - call GetBattleVarPair + call _GetBattleVar ld a, [hl] push hl push af @@ -4994,7 +4994,7 @@ BattleCommand48: ; 35b33 ld d, a .asm_35b4f ld a, BATTLE_VARS_STATUS - call CleanGetBattleVarPair + call GetBattleVar and $7 jr z, .asm_35ba3 ; 35b56 $4b ld a, [hl] @@ -5016,7 +5016,7 @@ BattleCommand48: ; 35b33 jr z, .asm_35b62 ; 35b6f $f1 ld e, a ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp e jr z, .asm_35b62 ; 35b78 $e8 ld a, e @@ -5025,7 +5025,7 @@ BattleCommand48: ; 35b33 call .asm_35bdf jr z, .asm_35b62 ; 35b81 $df ld a, BATTLE_VARS_MOVE - call GetBattleVarPair + call _GetBattleVar ld a, e ld [hl], a call Function0x34548 @@ -5063,7 +5063,7 @@ BattleCommand48: ; 35b33 .asm_35bbe ld b, a ld a, $10 - call CleanGetBattleVarPair + call GetBattleVar ld c, a dec hl ld d, $4 @@ -5127,7 +5127,7 @@ BattleCommand49: ; 35bff ; destinybond ld a, BATTLE_VARS_SUBSTATUS5 - call GetBattleVarPair + call _GetBattleVar set 6, [hl] call Function0x37e01 ld hl, DestinyBondEffectText @@ -5149,7 +5149,7 @@ BattleCommand4a: ; 35c0f ld hl, BattleMonMoves .asm_35c24 ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar and a jr z, .asm_35c91 ; 35c2a $65 cp $a5 @@ -5196,7 +5196,7 @@ BattleCommand4a: ; 35c0f add hl, bc ld e, a ld a, BATTLE_VARS_SUBSTATUS5_OPP - call CleanGetBattleVarPair + call GetBattleVar bit 3, a jr nz, .asm_35c82 ; 35c70 $10 ld a, [hBattleTurn] @@ -5270,7 +5270,7 @@ BattleCommand4c: ; 35cc9 ; healbell ld a, BATTLE_VARS_SUBSTATUS1 - call GetBattleVarPair + call _GetBattleVar res 0, [hl] ld de, PartyMon1Status ld a, [hBattleTurn] @@ -5279,7 +5279,7 @@ BattleCommand4c: ; 35cc9 ld de, OTPartyMon1Status .asm_35cdb ld a, BATTLE_VARS_STATUS - call GetBattleVarPair + call _GetBattleVar xor a ld [hl], a ld h, d @@ -5308,7 +5308,7 @@ FarPlayBattleAnimation: ; 35d00 ; battle animations disabled? ld a, BATTLE_VARS_SUBSTATUS3 - call CleanGetBattleVarPair + call GetBattleVar and $60 ; bit 6 | 5 ret nz @@ -5475,7 +5475,7 @@ Function0x35de0: ; 35de0 .asm_35dff ld a, BATTLE_VARS_SUBSTATUS4_OPP - call GetBattleVarPair + call _GetBattleVar res 4, [hl] ld hl, SubFadedText @@ -5484,13 +5484,13 @@ Function0x35de0: ; 35de0 call SwitchTurn call BattleCommanda7 ld a, BATTLE_VARS_SUBSTATUS3 - call CleanGetBattleVarPair + call GetBattleVar and $60 ; fly | dig call z, Function0x37ec7 call SwitchTurn ld a, BATTLE_VARS_MOVE_EFFECT - call GetBattleVarPair + call _GetBattleVar cp EFFECT_MULTI_HIT jr z, .asm_35e3a cp EFFECT_DOUBLE_HIT @@ -5514,12 +5514,12 @@ Function0x35de0: ; 35de0 UpdateMoveData: ; 35e40 ld a, BATTLE_VARS_MOVE_ANIM - call GetBattleVarPair + call _GetBattleVar ld d, h ld e, l ld a, BATTLE_VARS_MOVE - call CleanGetBattleVarPair + call GetBattleVar ld [$cf60], a ; not CurSpecies ld [$d265], a @@ -5545,7 +5545,7 @@ BattleCommand14: ; 35e5c .asm_35e70 ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar ld d, h ld e, l ld a, [de] @@ -5641,7 +5641,7 @@ BattleCommand13: ; 35eee call CheckSubstituteOpp ret nz ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar and a ret nz ld a, [TypeModifier] @@ -5683,7 +5683,7 @@ BattleCommand2f: ; 35f2c call Function0x35fe1 jp z, .asm_35fb8 ld a, BATTLE_VARS_STATUS_OPP - call CleanGetBattleVarPair + call GetBattleVar ld b, a ld hl, AlreadyPoisonedText and $8 @@ -5700,7 +5700,7 @@ BattleCommand2f: ; 35f2c .asm_35f5f ld hl, DidntAffect1Text ld a, BATTLE_VARS_STATUS_OPP - call CleanGetBattleVarPair + call GetBattleVar and a jr nz, .asm_35fb8 ; 35f68 $4e ld a, [hBattleTurn] @@ -5764,7 +5764,7 @@ Function0x35fc0: ; 35fc0 Function0x35fc9: ; 35fc9 ld a, BATTLE_VARS_SUBSTATUS5_OPP - call GetBattleVarPair + call _GetBattleVar ld a, [hBattleTurn] and a ld de, $c67c @@ -5772,7 +5772,7 @@ Function0x35fc9: ; 35fc9 ld de, $c674 .asm_35fd9 ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_TOXIC ret ; 35fe1 @@ -5797,7 +5797,7 @@ Function0x35fe1: ; 35fe1 Function0x35ff5: ; 35ff5 ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar set PSN, [hl] jp UpdateOpponentInParty ; 35fff @@ -5910,7 +5910,7 @@ BattleCommand17: ; 3608c call CheckSubstituteOpp ret nz ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar and a jp nz, Defrost ld a, [TypeModifier] @@ -5928,7 +5928,7 @@ BattleCommand17: ; 3608c call Function0x37962 ret nz ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar set 4, [hl] call UpdateOpponentInParty ld hl, $6c76 @@ -5982,7 +5982,7 @@ BattleCommand18: ; 36102 call CheckSubstituteOpp ret nz ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar and a ret nz ld a, [TypeModifier] @@ -6003,7 +6003,7 @@ BattleCommand18: ; 36102 call Function0x37962 ret nz ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar set 5, [hl] call UpdateOpponentInParty ld de, $0108 @@ -6038,7 +6038,7 @@ BattleCommand19: ; 36165 call CheckSubstituteOpp ret nz ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar and a ret nz ld a, [TypeModifier] @@ -6054,7 +6054,7 @@ BattleCommand19: ; 36165 call Function0x37962 ret nz ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar set 6, [hl] call UpdateOpponentInParty ld hl, $6c39 @@ -6247,7 +6247,7 @@ Function0x36281: ; 36281 ld hl, $7486 .asm_36292 ld a, $c - call CleanGetBattleVarPair + call GetBattleVar cp $6b ret nz ld a, $1 @@ -6371,7 +6371,7 @@ BattleCommand1d: ; 362e3 ; Attacking moves that also lower accuracy are unaffected. ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_ACCURACY_DOWN_HIT jr z, .DidntMiss @@ -6444,7 +6444,7 @@ BattleCommand1d: ; 362e3 Function0x36391: ; 36391 ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_ATTACK_DOWN jr c, .asm_363ae cp EFFECT_EVASION_DOWN + 1 @@ -6462,7 +6462,7 @@ Function0x36391: ; 36391 ret .asm_363b0 ld a, BATTLE_VARS_SUBSTATUS4_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_MIST, a ret ; 363b8 @@ -6808,7 +6808,7 @@ BattleCommandac: ; 3658f BattleCommandaf: ; 365a7 ; curl ld a, BATTLE_VARS_SUBSTATUS2 - call GetBattleVarPair + call _GetBattleVar set 0, [hl] ret ; 365af @@ -6956,7 +6956,7 @@ BattleCommand21: ; 36671 ; storeenergy ld a, BATTLE_VARS_SUBSTATUS3 - call CleanGetBattleVarPair + call GetBattleVar bit 0, a ret z ld hl, PlayerRolloutCount @@ -6968,14 +6968,14 @@ BattleCommand21: ; 36671 dec [hl] jr nz, .asm_366dc ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar res 0, [hl] ld hl, UnleashedEnergyText call StdBattleTextBox ld a, BATTLE_VARS_MOVE_POWER - call GetBattleVarPair + call _GetBattleVar ld a, 1 ld [hl], a ld hl, PlayerDamageTaken + 1 @@ -7009,7 +7009,7 @@ BattleCommand21: ; 36671 ld [de], a ld a, BATTLE_VARS_MOVE_ANIM - call GetBattleVarPair + call _GetBattleVar ld a, BIDE ld [hl], a @@ -7035,7 +7035,7 @@ BattleCommand22: ; 366e5 ld bc, EnemyRolloutCount .asm_366f6 ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar set 0, [hl] xor a ld [de], a @@ -7065,7 +7065,7 @@ BattleCommand3e: ; 3671a ld de, EnemyRolloutCount .asm_36725 ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar bit 1, [hl] ret z ld a, [de] @@ -7097,7 +7097,7 @@ BattleCommand3d: ; 36751 ; No rampage during Sleep Talk. ld a, BATTLE_VARS_STATUS - call CleanGetBattleVarPair + call GetBattleVar and 7 ret nz @@ -7108,7 +7108,7 @@ BattleCommand3d: ; 36751 ld de, EnemyRolloutCount .asm_36764 ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar set 1, [hl] call BattleRandom and $1 @@ -7134,7 +7134,7 @@ BattleCommanda0: ; 36778 jr z, .asm_367b9 ld a, BATTLE_VARS_SUBSTATUS5_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_CANT_RUN, a jr nz, .asm_367b9 ld a, [hBattleTurn] @@ -7478,12 +7478,12 @@ BattleCommand24: ; 369b6 .asm_369c7 ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar bit 2, [hl] jp nz, .asm_36a43 set 2, [hl] ld a, BATTLE_VARS_MOVE_EFFECT - call GetBattleVarPair + call _GetBattleVar ld a, [hl] cp EFFECT_TWINEEDLE jr z, .asm_36a3f @@ -7525,7 +7525,7 @@ BattleCommand24: ; 369b6 .asm_36a1e ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar res 2, [hl] call BattleCommanda8 jp EndMoveEffect @@ -7554,7 +7554,7 @@ BattleCommand24: ; 369b6 jr nz, .asm_36a6b ; 36a46 $23 .asm_36a48 ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar res 2, [hl] ld hl, PlayerHitTimesText @@ -7566,7 +7566,7 @@ BattleCommand24: ; 369b6 push bc ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_BEAT_UP jr z, .asm_36a67 call StdBattleTextBox @@ -7603,7 +7603,7 @@ BattleCommand94: ; 36a82 call CheckSubstituteOpp jr nz, .asm_36a9a ; 36a8a $e ld a, BATTLE_VARS_STATUS_OPP - call CleanGetBattleVarPair + call GetBattleVar and $27 jr nz, .asm_36a9a ; 36a93 $5 call Function0x36abf @@ -7619,7 +7619,7 @@ BattleCommand25: ; 36aa0 call CheckSubstituteOpp ret nz ld a, BATTLE_VARS_STATUS_OPP - call CleanGetBattleVarPair + call GetBattleVar and $27 ret nz call Function0x36abf @@ -7634,7 +7634,7 @@ BattleCommand25: ; 36aa0 Function0x36ab5: ; 36ab5 ld a, BATTLE_VARS_SUBSTATUS3_OPP - call GetBattleVarPair + call _GetBattleVar set 3, [hl] jp EndRechargeOpp ; 36abf @@ -7666,7 +7666,7 @@ BattleCommand4d: ; 36ac9 call CheckSubstituteOpp ret nz ld a, BATTLE_VARS_MOVE_EFFECT - call GetBattleVarPair + call _GetBattleVar ld d, h ld e, l call GetUserItem @@ -7675,7 +7675,7 @@ BattleCommand4d: ; 36ac9 ret nc call EndRechargeOpp ld a, BATTLE_VARS_SUBSTATUS3_OPP - call GetBattleVarPair + call _GetBattleVar set 3, [hl] ret ; 36af3 @@ -7733,7 +7733,7 @@ BattleCommand3a: ; 36b3a ; charged? ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar bit 4, [hl] ret z ; go to town @@ -7750,7 +7750,7 @@ BattleCommand39: ; 36b4d call BattleCommand38 ld a, BATTLE_VARS_STATUS - call CleanGetBattleVarPair + call GetBattleVar and $7 jr z, .asm_36b65 @@ -7761,7 +7761,7 @@ BattleCommand39: ; 36b4d .asm_36b65 ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar set 4, [hl] ld hl, IgnoredOrders2Text @@ -7776,7 +7776,7 @@ BattleCommand39: ; 36b4d ld [$c689], a call Function0x37e36 ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp $13 jr z, .asm_36b96 ; 36b8b $9 cp $5b @@ -7787,9 +7787,9 @@ BattleCommand39: ; 36b4d call Function0x37ec0 .asm_36b99 ld a, BATTLE_VARS_SUBSTATUS3 - call GetBattleVarPair + call _GetBattleVar ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar ld b, a cp $13 jr z, .asm_36bb0 ; 36ba6 $8 @@ -7805,10 +7805,10 @@ BattleCommand39: ; 36b4d call Function0x34548 jr nz, .asm_36bc3 ; 36bb5 $c ld a, BATTLE_VARS_LAST_COUNTER_MOVE - call GetBattleVarPair + call _GetBattleVar ld [hl], b ld a, BATTLE_VARS_LAST_MOVE - call GetBattleVarPair + call _GetBattleVar ld [hl], b .asm_36bc3 @@ -7818,7 +7818,7 @@ BattleCommand39: ; 36b4d call BattleTextBox ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_SKULL_BASH ld b, $fe ; endturn jp z, SkipToBattleCommand @@ -7830,7 +7830,7 @@ BattleCommand39: ; 36b4d start_asm ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar cp RAZOR_WIND ld hl, .RazorWind jr z, .asm_36c0d @@ -7914,7 +7914,7 @@ BattleCommand3b: ; 36c2d and a ret nz ld a, BATTLE_VARS_SUBSTATUS4_OPP - call CleanGetBattleVarPair + call GetBattleVar bit 4, a ret nz call BattleRandom @@ -7924,7 +7924,7 @@ BattleCommand3b: ; 36c2d inc a ld [hl], a ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar ld [de], a ld b, a ld hl, .Traps @@ -7956,7 +7956,7 @@ BattleCommand28: ; 36c7e ; mist ld a, BATTLE_VARS_SUBSTATUS4 - call GetBattleVarPair + call _GetBattleVar bit 1, [hl] jr nz, .asm_36c92 ; 36c85 $b set 1, [hl] @@ -7973,7 +7973,7 @@ BattleCommand29: ; 36c98 ; focusenergy ld a, BATTLE_VARS_SUBSTATUS4 - call GetBattleVarPair + call _GetBattleVar bit 2, [hl] jr nz, .asm_36cac ; 36c9f $b set 2, [hl] @@ -7996,7 +7996,7 @@ BattleCommand27: ; 36cb2 ld hl, EnemyMonMaxHPHi .asm_36cbd ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar ld d, a ld a, [CurDamage] ld b, a @@ -8067,7 +8067,7 @@ BattleCommand2b: ; 36d1d call CheckSubstituteOpp ret nz ld a, BATTLE_VARS_SUBSTATUS3_OPP - call GetBattleVarPair + call _GetBattleVar bit 7, [hl] ret nz jr Function0x36d70 @@ -8089,7 +8089,7 @@ BattleCommand2a: ; 36d3b .asm_36d53 ld a, BATTLE_VARS_SUBSTATUS3_OPP - call GetBattleVarPair + call _GetBattleVar bit 7, [hl] jr z, .asm_36d65 call Function0x37e77 @@ -8123,7 +8123,7 @@ Function0x36d70: ; 36d70 ld [bc], a ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_CONFUSE_HIT jr z, .asm_36d99 cp EFFECT_SNORE @@ -8152,7 +8152,7 @@ Function0x36d70: ; 36d70 Function0x36db6: ; 36db6 ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_CONFUSE_HIT ret z cp EFFECT_SNORE @@ -8167,7 +8167,7 @@ BattleCommand30: ; 36dc7 ; paralyze ld a, BATTLE_VARS_STATUS_OPP - call CleanGetBattleVarPair + call GetBattleVar bit 6, a jr nz, .asm_36e49 ; 36dce $79 ld a, [TypeModifier] @@ -8201,7 +8201,7 @@ BattleCommand30: ; 36dc7 jr c, .asm_36e52 ; 36e0c $44 .asm_36e0e ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar and a jr nz, .asm_36e52 ; 36e14 $3c ld a, [AttackMissed] @@ -8215,7 +8215,7 @@ BattleCommand30: ; 36dc7 ld a, $1 ld [$ffd4], a ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar set 6, [hl] call UpdateOpponentInParty ld hl, $6c39 @@ -8250,7 +8250,7 @@ Function0x36e5b: ; 36e5b .ok ld a, BATTLE_VARS_MOVE_TYPE - call CleanGetBattleVarPair + call GetBattleVar cp NORMAL jr z, .normal @@ -8285,7 +8285,7 @@ BattleCommand31: ; 36e7c ld de, $c6e0 .asm_36e90 ld a, BATTLE_VARS_SUBSTATUS4 - call CleanGetBattleVarPair + call GetBattleVar bit 4, a jr nz, .asm_36ef4 ; 36e97 $5b ld a, [hli] @@ -8312,7 +8312,7 @@ BattleCommand31: ; 36e7c inc hl ld [hl], e ld a, BATTLE_VARS_SUBSTATUS4 - call GetBattleVarPair + call _GetBattleVar set 4, [hl] ld hl, $c730 ld de, $c72e @@ -8356,7 +8356,7 @@ BattleCommand31: ; 36e7c BattleCommand32: ; 36f0b ; rechargenextturn ld a, BATTLE_VARS_SUBSTATUS4 - call GetBattleVarPair + call _GetBattleVar set 5, [hl] ret ; 36f13 @@ -8365,7 +8365,7 @@ BattleCommand32: ; 36f0b EndRechargeOpp: ; 36f13 push hl ld a, BATTLE_VARS_SUBSTATUS4_OPP - call GetBattleVarPair + call _GetBattleVar res 5, [hl] pop hl ret @@ -8375,7 +8375,7 @@ EndRechargeOpp: ; 36f13 BattleCommand97: ; 36f1d ; rage ld a, BATTLE_VARS_SUBSTATUS4 - call GetBattleVarPair + call _GetBattleVar set 6, [hl] ret ; 36f25 @@ -8384,7 +8384,7 @@ BattleCommand97: ; 36f1d BattleCommand98: ; 36f25 ; doubleflyingdamage ld a, BATTLE_VARS_SUBSTATUS3_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_FLYING, a ret z jr DoubleDamage @@ -8394,7 +8394,7 @@ BattleCommand98: ; 36f25 BattleCommand99: ; 36f2f ; doubleundergrounddamage ld a, BATTLE_VARS_SUBSTATUS3_OPP - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_UNDERGROUND, a ret z @@ -8434,7 +8434,7 @@ BattleCommand33: ; 36f46 call CheckHiddenOpponent jr nz, .asm_36f9a ; 36f60 $38 ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar and a jr z, .asm_36f9a ; 36f68 $30 cp $a5 @@ -8454,7 +8454,7 @@ BattleCommand33: ; 36f46 jr nz, .asm_36f79 ; 36f7c $fb inc hl ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar ld [hl], a ld [$d265], a ld bc, $0006 @@ -8490,7 +8490,7 @@ BattleCommand35: ; 36f9d cp $16 jr z, .asm_36fd2 ; 36fbc $14 ld a, BATTLE_VARS_SUBSTATUS4_OPP - call GetBattleVarPair + call _GetBattleVar bit 7, [hl] jr nz, .asm_36fd8 ; 36fc5 $11 set 7, [hl] @@ -8534,7 +8534,7 @@ BattleCommand37: ; 36fed and a jr nz, .asm_37059 ; 37006 $51 ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar and a jr z, .asm_37059 ; 3700e $49 cp $a5 @@ -8574,7 +8574,7 @@ BattleCommand37: ; 36fed inc hl .asm_37047 ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar ld [hl], a ld [$d265], a call GetMoveName @@ -8757,7 +8757,7 @@ BattleCommand2c: ; 3713e ld hl, EnemyMonMaxHPHi .asm_3714f ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar ld b, a push hl push de @@ -8776,10 +8776,10 @@ BattleCommand2c: ; 3713e push af call BattleCommandaa ld a, BATTLE_VARS_SUBSTATUS5 - call GetBattleVarPair + call _GetBattleVar res 0, [hl] ld a, BATTLE_VARS_STATUS - call GetBattleVarPair + call _GetBattleVar ld a, [hl] and a ld [hl], $3 @@ -8830,7 +8830,7 @@ BattleCommand2d: ; 371cd call Function0x372d8 ld a, BATTLE_VARS_SUBSTATUS5_OPP - call GetBattleVarPair + call _GetBattleVar bit 3, [hl] jp nz, Function0x372d2 call CheckHiddenOpponent @@ -8841,7 +8841,7 @@ BattleCommand2d: ; 371cd ld a, $1 ld [$c689], a ld a, BATTLE_VARS_SUBSTATUS4 - call GetBattleVarPair + call _GetBattleVar bit 4, [hl] push af jr z, .asm_37200 ; 371f4 $a @@ -8851,7 +8851,7 @@ BattleCommand2d: ; 371cd call Function0x37e44 .asm_37200 ld a, BATTLE_VARS_SUBSTATUS5 - call GetBattleVarPair + call _GetBattleVar set 3, [hl] call Function0x372e7 ld hl, BattleMonSpecies @@ -8987,12 +8987,12 @@ Function0x372d2: ; 372d2 Function0x372d8: ; 372d8 ld a, BATTLE_VARS_LAST_COUNTER_MOVE - call GetBattleVarPair + call _GetBattleVar xor a ld [hl], a ld a, BATTLE_VARS_LAST_MOVE - call GetBattleVarPair + call _GetBattleVar xor a ld [hl], a ret @@ -9030,7 +9030,7 @@ BattleCommand2e: ; 372fc .asm_3730d ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar cp EFFECT_LIGHT_SCREEN jr nz, .Reflect @@ -9130,7 +9130,7 @@ PrintParalyze: ; 37372 CheckSubstituteOpp: ; 37378 ld a, BATTLE_VARS_SUBSTATUS4_OPP - call CleanGetBattleVarPair + call GetBattleVar bit 4, a ret ; 37380 @@ -9145,7 +9145,7 @@ BattleCommand1a: ; 37380 ld c, $3 call DelayFrames ld a, BATTLE_VARS_STATUS - call GetBattleVarPair + call _GetBattleVar xor a ld [hli], a inc hl @@ -9156,10 +9156,10 @@ BattleCommand1a: ; 37380 call BattleCommand0a call Function0x37e36 ld a, BATTLE_VARS_SUBSTATUS4 - call GetBattleVarPair + call _GetBattleVar res 7, [hl] ld a, BATTLE_VARS_SUBSTATUS5_OPP - call GetBattleVarPair + call _GetBattleVar res 6, [hl] call Function0x37ed5 ret nc @@ -9179,9 +9179,9 @@ BattleCommand1b: ; 373c9 call Function0x372d8 ld a, BATTLE_VARS_MOVE - call GetBattleVarPair + call _GetBattleVar ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar and a jr z, .asm_373de ; 373d7 $5 call CheckUserMove @@ -9197,7 +9197,7 @@ BattleCommand1b: ; 373c9 ld [$d265], a push af ld a, BATTLE_VARS_MOVE_ANIM - call GetBattleVarPair + call _GetBattleVar ld d, h ld e, l pop af @@ -9256,7 +9256,7 @@ BattleCommand34: ; 37418 ld a, BATTLE_VARS_MOVE - call GetBattleVarPair + call _GetBattleVar ld [hl], b call UpdateMoveData jp ResetTurn @@ -9452,7 +9452,7 @@ BattleCommand51: ; 37517 ; Don't trap if the opponent is already trapped. ld a, BATTLE_VARS_SUBSTATUS5 - call GetBattleVarPair + call _GetBattleVar bit SUBSTATUS_CANT_RUN, [hl] jr nz, .failed @@ -9485,14 +9485,14 @@ BattleCommand52: ; 37536 ; Only works on a sleeping opponent. ld a, BATTLE_VARS_STATUS_OPP - call GetBattleVarPair + call _GetBattleVar and SLP jr z, .failed ; Bail if the opponent is already having a nightmare. ld a, BATTLE_VARS_SUBSTATUS1_OPP - call GetBattleVarPair + call _GetBattleVar bit SUBSTATUS_NIGHTMARE, [hl] jr nz, .failed @@ -9515,7 +9515,7 @@ BattleCommand53: ; 37563 ; Thaw the user. ld a, BATTLE_VARS_STATUS - call GetBattleVarPair + call _GetBattleVar bit FRZ, [hl] ret z res FRZ, [hl] @@ -9560,7 +9560,7 @@ BattleCommand57: ; 376a0 call CheckHiddenOpponent jr nz, .asm_376bf ld a, BATTLE_VARS_SUBSTATUS1_OPP - call GetBattleVarPair + call _GetBattleVar bit SUBSTATUS_IDENTIFIED, [hl] jr nz, .asm_376bf set SUBSTATUS_IDENTIFIED, [hl] @@ -9635,7 +9635,7 @@ BattleCommand5b: ; 37718 ld de, EnemyRolloutCount .asm_37723 ld a, BATTLE_VARS_SUBSTATUS1 - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_ENCORED, a jr z, .asm_37731 @@ -9653,7 +9653,7 @@ BattleCommand5c: ; 37734 ; rolloutpower ld a, BATTLE_VARS_STATUS - call CleanGetBattleVarPair + call GetBattleVar and 7 ret nz @@ -9676,7 +9676,7 @@ BattleCommand5c: ; 37734 jr z, .hit ld a, BATTLE_VARS_SUBSTATUS1 - call GetBattleVarPair + call _GetBattleVar res 6, [hl] ret @@ -9687,18 +9687,18 @@ BattleCommand5c: ; 37734 cp $5 jr c, .asm_3776e ; 37763 $9 ld a, BATTLE_VARS_SUBSTATUS1 - call GetBattleVarPair + call _GetBattleVar res 6, [hl] jr .asm_37775 ; 3776c $7 .asm_3776e ld a, BATTLE_VARS_SUBSTATUS1 - call GetBattleVarPair + call _GetBattleVar set 6, [hl] .asm_37775 ld a, BATTLE_VARS_SUBSTATUS2 - call CleanGetBattleVarPair + call GetBattleVar bit 0, a jr z, .asm_3777f ; 3777c $1 inc b @@ -9795,7 +9795,7 @@ BattleCommand5f: ; 377ce call CheckHiddenOpponent jr nz, .asm_377f2 ld a, BATTLE_VARS_SUBSTATUS1_OPP - call GetBattleVarPair + call _GetBattleVar bit 7, [hl] jr nz, .asm_377f2 @@ -10266,11 +10266,11 @@ Function0x37aab: ; 37aab Function0x37ab1: ; 37ab1 ld a, BATTLE_VARS_STATUS - call CleanGetBattleVarPair + call GetBattleVar and 7 jr nz, .asm_37ac1 ld a, BATTLE_VARS_SUBSTATUS1 - call GetBattleVarPair + call _GetBattleVar res 0, [hl] .asm_37ac1 @@ -10281,11 +10281,11 @@ Function0x37ab1: ; 37ab1 res 7, [hl] ld hl, PlayerSubStatus5 ld a, BATTLE_VARS_SUBSTATUS5 - call GetBattleVarPair + call _GetBattleVar res 3, [hl] res 4, [hl] ld a, BATTLE_VARS_LAST_MOVE - call GetBattleVarPair + call _GetBattleVar ld [hl], 0 xor a ld [$c730], a @@ -10373,7 +10373,7 @@ BattleCommand69: ; 37b39 ; clearhazards ld a, BATTLE_VARS_SUBSTATUS4 - call GetBattleVarPair + call _GetBattleVar bit 7, [hl] jr z, .asm_37b4a ; 37b40 $8 res 7, [hl] @@ -10638,7 +10638,7 @@ BattleCommand9a: ; 37c95 ld a, $1 ld [AttackMissed], a ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar and a ret z ld b, a @@ -10655,7 +10655,7 @@ BattleCommand9a: ; 37c95 call Function0x36abf ret z ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP - call CleanGetBattleVarPair + call GetBattleVar dec a ld de, StringBuffer1 call GetMoveData @@ -10754,13 +10754,13 @@ BattleCommand9c: ; 37d34 call Function0x34548 jr nz, .asm_37d4b ; 37d37 $12 ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar ld b, a ld a, BATTLE_VARS_LAST_COUNTER_MOVE - call GetBattleVarPair + call _GetBattleVar ld [hl], b ld a, BATTLE_VARS_LAST_MOVE - call GetBattleVarPair + call _GetBattleVar ld [hl], b .asm_37d4b ld hl, $c71d @@ -10808,7 +10808,7 @@ BattleCommand9f: ; 37d94 ; thunderaccuracy ld a, BATTLE_VARS_MOVE_TYPE - call GetBattleVarPair + call _GetBattleVar inc hl ld a, [Weather] cp WEATHER_RAIN @@ -10825,7 +10825,7 @@ BattleCommand9f: ; 37d94 CheckHiddenOpponent: ; 37daa ld a, BATTLE_VARS_SUBSTATUS3_OPP - call CleanGetBattleVarPair + call GetBattleVar and $60 ; fly | dig ret ; 37db2 @@ -10920,7 +10920,7 @@ Function0x37e19: ; 37e19 ld [FXAnimIDHi], a ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar and a ret z @@ -10945,7 +10945,7 @@ Function0x37e36: ; 37e36 ld [FXAnimIDHi], a ld a, BATTLE_VARS_MOVE_ANIM - call CleanGetBattleVarPair + call GetBattleVar and a ret z diff --git a/battle/effects/curse.asm b/battle/effects/curse.asm index 41ffc3a8d..9dc7f4b1d 100644 --- a/battle/effects/curse.asm +++ b/battle/effects/curse.asm @@ -66,7 +66,7 @@ BattleCommand54: ; 37588 jr nz, .failed ld a, BATTLE_VARS_SUBSTATUS1_OPP - call GetBattleVarPair + call _GetBattleVar bit 1, [hl] jr nz, .failed diff --git a/battle/effects/endure.asm b/battle/effects/endure.asm index 79f657a24..b2c622079 100644 --- a/battle/effects/endure.asm +++ b/battle/effects/endure.asm @@ -7,7 +7,7 @@ BattleCommand5a: ; 3766f ret c ld a, BATTLE_VARS_SUBSTATUS1 - call GetBattleVarPair + call _GetBattleVar set SUBSTATUS_ENDURE, [hl] call Function0x37e01 diff --git a/battle/effects/protect.asm b/battle/effects/protect.asm index 80edc0d85..45e9a75d4 100644 --- a/battle/effects/protect.asm +++ b/battle/effects/protect.asm @@ -4,7 +4,7 @@ BattleCommand55: ; 37618 ret c ld a, BATTLE_VARS_SUBSTATUS1 - call GetBattleVarPair + call _GetBattleVar set SUBSTATUS_PROTECT, [hl] call Function0x37e01 @@ -29,7 +29,7 @@ ProtectChance: ; 3762c ; Can't have a substitute. ld a, BATTLE_VARS_SUBSTATUS4 - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_SUBSTITUTE, a jr nz, .failed diff --git a/battle/hidden_power.asm b/battle/hidden_power.asm index 995acea2d..3dc40c946 100644 --- a/battle/hidden_power.asm +++ b/battle/hidden_power.asm @@ -94,7 +94,7 @@ GetHiddenPower: ; fbced .GotType push af ld a, BATTLE_VARS_MOVE_TYPE - call GetBattleVarPair + call _GetBattleVar pop af ld [hl], a diff --git a/main.asm b/main.asm index 134a9f3ed..9449ae6cf 100644 --- a/main.asm +++ b/main.asm @@ -2660,15 +2660,15 @@ UpdateBattleHuds: ; 39d4 ; 39e1 -CleanGetBattleVarPair: ; 39e1 +GetBattleVar: ; 39e1 ; Preserves hl. push hl - call GetBattleVarPair + call _GetBattleVar pop hl ret ; 39e7 -GetBattleVarPair: ; 39e7 +_GetBattleVar: ; 39e7 ; Get variable from pair a, depending on whose turn it is. ; There are 21 variable pairs. @@ -37192,11 +37192,11 @@ Function3c27c: ; 3c27c xor a ld [hl], a ld a, $2 - call GetBattleVarPair + call _GetBattleVar push af set 7, [hl] ld a, $c - call GetBattleVarPair + call _GetBattleVar push hl push af xor a @@ -37815,18 +37815,18 @@ Function3c6de: ; 3c6de Function3c6ed: ; 3c6ed ld a, $5 - call GetBattleVarPair + call _GetBattleVar res 2, [hl] res 5, [hl] ld a, $9 - call GetBattleVarPair + call _GetBattleVar res 6, [hl] ret ; 3c6fe Function3c6fe: ; 3c6fe ld a, $4 - call GetBattleVarPair + call _GetBattleVar res 6, [hl] ret ; 3c706 @@ -37851,7 +37851,7 @@ Function3c716: ; 3c716 call Function3c706 ret z ld a, $a - call CleanGetBattleVarPair + call GetBattleVar and $18 jr z, .asm_3c768 ld hl, $47e2 @@ -37877,7 +37877,7 @@ Function3c716: ; 3c716 .asm_3c74d ld a, $4 - call CleanGetBattleVarPair + call GetBattleVar bit 0, a jr z, .asm_3c765 call Function3cc76 @@ -37899,7 +37899,7 @@ Function3c716: ; 3c716 call Function3c706 jp z, $47f7 ld a, $3 - call GetBattleVarPair + call _GetBattleVar bit 7, [hl] jr z, .asm_3c7a1 call Function3c8e4 @@ -37907,7 +37907,7 @@ Function3c716: ; 3c716 ld [$cfca], a ld de, $0107 ld a, $7 - call CleanGetBattleVarPair + call GetBattleVar and $60 call z, Function3ee0f call Function3c8e4 @@ -37923,7 +37923,7 @@ Function3c716: ; 3c716 call Function3c706 jr z, .asm_3c7f7 ld a, $0 - call GetBattleVarPair + call _GetBattleVar bit 0, [hl] jr z, .asm_3c7c5 xor a @@ -37939,7 +37939,7 @@ Function3c716: ; 3c716 call Function3c706 jr z, .asm_3c7f7 ld a, $0 - call GetBattleVarPair + call _GetBattleVar bit 1, [hl] jr z, .asm_3c7e9 xor a @@ -37992,7 +37992,7 @@ Function3c801: ; 3c801 .asm_3c827 ld a, $0 - call CleanGetBattleVarPair + call GetBattleVar bit 4, a ret z dec [hl] @@ -38004,7 +38004,7 @@ Function3c801: ; 3c801 pop af ret nz ld a, $0 - call GetBattleVarPair + call _GetBattleVar res 4, [hl] ld a, [hBattleTurn] and a @@ -38064,7 +38064,7 @@ Function3c874: ; 3c874 and a ret z ld a, $3 - call CleanGetBattleVarPair + call GetBattleVar bit 4, a ret nz ld a, [de] @@ -38074,7 +38074,7 @@ Function3c874: ; 3c874 dec [hl] jr z, .asm_3c8de ld a, $2 - call CleanGetBattleVarPair + call GetBattleVar and $60 jr nz, .asm_3c8d3 call Function3c8e4 @@ -38320,7 +38320,7 @@ Function3ca26: ; 3ca26 ld hl, $48b6 call StdBattleTextBox ld a, $10 - call GetBattleVarPair + call _GetBattleVar push af ld a, $f8 ld [hl], a @@ -38335,7 +38335,7 @@ Function3ca26: ; 3ca26 ld [CurDamage], a ld [$d257], a ld a, $10 - call GetBattleVarPair + call _GetBattleVar pop af ld [hl], a call UpdateBattleMonInParty @@ -38539,7 +38539,7 @@ HandleWeather: ; 3cb9e .asm_3cbd0 ld a, BATTLE_VARS_SUBSTATUS3 - call CleanGetBattleVarPair + call GetBattleVar bit SUBSTATUS_UNDERGROUND, a ret nz @@ -41087,7 +41087,7 @@ Function3dc5a: ; 3dc5a Function3dc5b: ; 3dc5b ld a, $10 - call CleanGetBattleVarPair + call GetBattleVar ld b, a call Function3c5ec ld a, b @@ -41107,7 +41107,7 @@ Function3dc5b: ; 3dc5b ld a, $d rst FarCall ld a, $10 - call GetBattleVarPair + call _GetBattleVar ld a, $ff ld [hl], a pop af @@ -41323,7 +41323,7 @@ Function3dde9: ; 3dde9 dec hl ld b, [hl] ld a, $b - call GetBattleVarPair + call _GetBattleVar and b ret z xor a @@ -41332,18 +41332,18 @@ Function3dde9: ; 3dde9 call UpdateOpponentInParty pop bc ld a, $9 - call GetBattleVarPair + call _GetBattleVar and [hl] res 0, [hl] ld a, $5 - call GetBattleVarPair + call _GetBattleVar and [hl] res 0, [hl] ld a, b cp $7f jr nz, .asm_3de26 ld a, $7 - call GetBattleVarPair + call _GetBattleVar res 7, [hl] .asm_3de26 @@ -41378,7 +41378,7 @@ Function3dde9: ; 3dde9 Function3de51: ; 3de51 ld a, $7 - call CleanGetBattleVarPair + call GetBattleVar bit 7, a ret z callab GetOpponentItem @@ -41392,7 +41392,7 @@ Function3de51: ; 3de51 ld a, [hl] ld [$d265], a ld a, $7 - call GetBattleVarPair + call _GetBattleVar res 7, [hl] call GetItemName call Function3ddc8 @@ -44057,7 +44057,7 @@ _BattleRandom: ; 3edd8 Function3ee0f: ; 3ee0f ld a, BATTLE_VARS_SUBSTATUS3 - call CleanGetBattleVarPair + call GetBattleVar and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret nz ; 3ee17 @@ -72689,7 +72689,7 @@ DoWeatherModifiers: ; fbda4 ld de, .WeatherMoveModifiers ld a, BATTLE_VARS_MOVE_EFFECT - call CleanGetBattleVarPair + call GetBattleVar ld c, a .CheckWeatherMove @@ -77584,17 +77584,17 @@ UsedMoveText: ; 105db9 .start ; get address for last move ld a, $13 ; last move - call GetBattleVarPair + call _GetBattleVar ld d, h ld e, l ; get address for last counter move ld a, $11 - call GetBattleVarPair + call _GetBattleVar ; get move animation (id) ld a, $c ; move animation - call CleanGetBattleVarPair + call GetBattleVar ld [$d265], a ; check actor ???? From cf966bb824ce0ffe384291cd51aa96a2dd86e839 Mon Sep 17 00:00:00 2001 From: yenatch Date: Sun, 13 Oct 2013 02:25:44 -0400 Subject: [PATCH 17/17] rename tilemap coordinate functions --- main.asm | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/main.asm b/main.asm index 9449ae6cf..a0d5e2074 100644 --- a/main.asm +++ b/main.asm @@ -341,7 +341,7 @@ Function1c89: ; 1c89 inc hl ld d, [hl] call Function1cc6 - call Function1d05 + call GetTileCoord inc de ld a, [de] inc de @@ -426,7 +426,8 @@ Function1cfd: ; 1cfd ; 1d05 -Function1d05: ; 1d05 +GetTileCoord: ; 1d05 +; Return the address of TileMap(c, b) in hl. xor a ld h, a ld l, b @@ -452,6 +453,9 @@ Function1d19: ; 1d19 ld c, a ld a, [$cf82] ld b, a + +GetAttrCoord: ; 1d21 +; Return the address of AttrMap(c, b) in hl. xor a ld h, a ld l, b @@ -1626,7 +1630,7 @@ Function352f: ; 352f sub c ld e, a push de - call Function1d05 + call GetTileCoord pop bc jp TextBox ; 354b @@ -7120,7 +7124,7 @@ Function56cd: ; 56cd jr nc, .asm_5760 ld c, a push bc - call Function1d05 + call GetTileCoord pop bc ld a, [hl] cp $60 @@ -28090,7 +28094,7 @@ Function240db: ; 240db inc hl ld d, [hl] call Function1cc6 - call Function1d05 + call GetTileCoord call Function240d3 ld b, a .asm_240eb @@ -28411,7 +28415,7 @@ Function2431a: ; 2431a ld b, a ld a, [$cfa2] ld c, a - call Function1d05 + call GetTileCoord ld a, [$cfa7] swap a and $f @@ -28741,7 +28745,7 @@ Function244e3: ; 244e3 ld a, [$cf83] inc a ld c, a - call Function1d05 + call GetTileCoord ld a, $80 ld [$ffad], a ld bc, $0707 @@ -29131,7 +29135,7 @@ Function247f0: ; 247f0 ld b, a ld a, [$cf85] ld c, a - call Function1d05 + call GetTileCoord ld [hl], $61 .asm_2480d @@ -29168,7 +29172,7 @@ Function247f0: ; 247f0 ld b, a ld a, [$cf85] ld c, a - call Function1d05 + call GetTileCoord ld [hl], $ee .asm_24850 @@ -29245,7 +29249,7 @@ Function2488b: ; 2488b ld a, [$cf83] add $0 ld c, a - call Function1d05 + call GetTileCoord ld [hl], $ec .asm_248b7 @@ -82676,7 +82680,7 @@ Function16d77a: ; 16d77a ld b, a ld a, [$cfa2] ld c, a - call Function1d05 + call GetTileCoord ld a, [$cfa7] swap a and $f