From 80cf859cd31c3882f8c42dd19e56fcde02b8955c Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 19 Jan 2020 14:10:10 -0500 Subject: [PATCH] PHONE_DISPLAY_HEIGHT is 4, the number of visible phone entries --- engine/battle/core.asm | 2 +- engine/pokegear/pokegear.asm | 46 ++++++++++++++++++------------------ engine/smallflag.asm | 5 ++-- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 4e62a4a91..dcf68fedc 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6998,7 +6998,7 @@ GiveExperiencePoints: ld a, [wCurPartyMon] ld c, a ld b, CHECK_FLAG - ld d, FALSE + ld d, 0 predef SmallFarFlagAction ld a, c and a diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index a4262bf02..b4228f68a 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -6,6 +6,8 @@ const POKEGEARCARD_RADIO ; 3 NUM_POKEGEAR_CARDS EQU const_value +PHONE_DISPLAY_HEIGHT EQU 4 + ; PokegearJumptable.Jumptable indexes const_def const POKEGEARSTATE_CLOCKINIT ; 0 @@ -878,7 +880,7 @@ PokegearPhone_Joypad: ld [wPokegearPhoneSelectedPerson], a hlcoord 1, 4 ld a, [wPokegearPhoneCursorPosition] - ld bc, 20 * 2 + ld bc, SCREEN_WIDTH * 2 call AddNTimes ld [hl], "▷" call PokegearPhoneContactSubmenu @@ -982,7 +984,7 @@ PokegearPhone_GetDPad: .down ld hl, wPokegearPhoneCursorPosition ld a, [hl] - cp 3 + cp PHONE_DISPLAY_HEIGHT - 1 jr nc, .scroll_page_down inc [hl] jr .done_joypad_same_page @@ -990,7 +992,7 @@ PokegearPhone_GetDPad: .scroll_page_down ld hl, wPokegearPhoneScrollPosition ld a, [hl] - cp 6 + cp CONTACT_LIST_SIZE - PHONE_DISPLAY_HEIGHT ret nc inc [hl] jr .done_joypad_update_page @@ -1011,14 +1013,12 @@ PokegearPhone_GetDPad: PokegearPhone_UpdateCursor: ld a, " " - hlcoord 1, 4 - ld [hl], a - hlcoord 1, 6 - ld [hl], a - hlcoord 1, 8 - ld [hl], a - hlcoord 1, 10 +x = 4 +rept PHONE_DISPLAY_HEIGHT + hlcoord 1, x ld [hl], a +x = x + 2 +endr hlcoord 1, 4 ld a, [wPokegearPhoneCursorPosition] ld bc, 2 * SCREEN_WIDTH @@ -1028,10 +1028,10 @@ PokegearPhone_UpdateCursor: PokegearPhone_UpdateDisplayList: hlcoord 1, 3 - ld b, 9 + ld b, PHONE_DISPLAY_HEIGHT * 2 + 1 ld a, " " .row - ld c, 18 + ld c, SCREEN_WIDTH - 2 .col ld [hli], a dec c @@ -1042,7 +1042,7 @@ PokegearPhone_UpdateDisplayList: jr nz, .row ld a, [wPokegearPhoneScrollPosition] ld e, a - ld d, $0 + ld d, 0 ld hl, wPhoneList add hl, de xor a @@ -1064,7 +1064,7 @@ PokegearPhone_UpdateDisplayList: ld a, [wPokegearPhoneLoadNameBuffer] inc a ld [wPokegearPhoneLoadNameBuffer], a - cp 4 + cp PHONE_DISPLAY_HEIGHT jr c, .loop call PokegearPhone_UpdateCursor ret @@ -1463,15 +1463,15 @@ RadioChannels: ; entries correspond to constants/radio_constants.asm ; frequency value given here = 4 × ingame_frequency − 2 - dbw 16, .PKMNTalkAndPokedexShow - dbw 28, .PokemonMusic - dbw 32, .LuckyChannel - dbw 40, .BuenasPassword - dbw 52, .RuinsOfAlphRadio - dbw 64, .PlacesAndPeople - dbw 72, .LetsAllSing - dbw 78, .PokeFluteRadio - dbw 80, .EvolutionRadio + dbw 16, .PKMNTalkAndPokedexShow ; 04.5 + dbw 28, .PokemonMusic ; 07.5 + dbw 32, .LuckyChannel ; 08.5 + dbw 40, .BuenasPassword ; 10.5 + dbw 52, .RuinsOfAlphRadio ; 13.5 + dbw 64, .PlacesAndPeople ; 16.5 + dbw 72, .LetsAllSing ; 18.5 + dbw 78, .PokeFluteRadio ; 20.0 + dbw 80, .EvolutionRadio ; 20.5 db -1 .PKMNTalkAndPokedexShow: diff --git a/engine/smallflag.asm b/engine/smallflag.asm index 22819e5d5..04cbfcc23 100644 --- a/engine/smallflag.asm +++ b/engine/smallflag.asm @@ -33,9 +33,10 @@ SmallFarFlagAction: ; What are we doing to this flag? dec b - jr z, .set ; 1 + jr z, .set ; 1 = SET_FLAG dec b - jr z, .check ; 2 + jr z, .check ; 2 = CHECK_FLAG +; 0 = RESET_FLAG .reset ld a, c