PHONE_DISPLAY_HEIGHT is 4, the number of visible phone entries

This commit is contained in:
Rangi 2020-01-19 14:10:10 -05:00
parent bd67691bc3
commit 80cf859cd3
3 changed files with 27 additions and 26 deletions

View File

@ -6998,7 +6998,7 @@ GiveExperiencePoints:
ld a, [wCurPartyMon] ld a, [wCurPartyMon]
ld c, a ld c, a
ld b, CHECK_FLAG ld b, CHECK_FLAG
ld d, FALSE ld d, 0
predef SmallFarFlagAction predef SmallFarFlagAction
ld a, c ld a, c
and a and a

View File

@ -6,6 +6,8 @@
const POKEGEARCARD_RADIO ; 3 const POKEGEARCARD_RADIO ; 3
NUM_POKEGEAR_CARDS EQU const_value NUM_POKEGEAR_CARDS EQU const_value
PHONE_DISPLAY_HEIGHT EQU 4
; PokegearJumptable.Jumptable indexes ; PokegearJumptable.Jumptable indexes
const_def const_def
const POKEGEARSTATE_CLOCKINIT ; 0 const POKEGEARSTATE_CLOCKINIT ; 0
@ -878,7 +880,7 @@ PokegearPhone_Joypad:
ld [wPokegearPhoneSelectedPerson], a ld [wPokegearPhoneSelectedPerson], a
hlcoord 1, 4 hlcoord 1, 4
ld a, [wPokegearPhoneCursorPosition] ld a, [wPokegearPhoneCursorPosition]
ld bc, 20 * 2 ld bc, SCREEN_WIDTH * 2
call AddNTimes call AddNTimes
ld [hl], "▷" ld [hl], "▷"
call PokegearPhoneContactSubmenu call PokegearPhoneContactSubmenu
@ -982,7 +984,7 @@ PokegearPhone_GetDPad:
.down .down
ld hl, wPokegearPhoneCursorPosition ld hl, wPokegearPhoneCursorPosition
ld a, [hl] ld a, [hl]
cp 3 cp PHONE_DISPLAY_HEIGHT - 1
jr nc, .scroll_page_down jr nc, .scroll_page_down
inc [hl] inc [hl]
jr .done_joypad_same_page jr .done_joypad_same_page
@ -990,7 +992,7 @@ PokegearPhone_GetDPad:
.scroll_page_down .scroll_page_down
ld hl, wPokegearPhoneScrollPosition ld hl, wPokegearPhoneScrollPosition
ld a, [hl] ld a, [hl]
cp 6 cp CONTACT_LIST_SIZE - PHONE_DISPLAY_HEIGHT
ret nc ret nc
inc [hl] inc [hl]
jr .done_joypad_update_page jr .done_joypad_update_page
@ -1011,14 +1013,12 @@ PokegearPhone_GetDPad:
PokegearPhone_UpdateCursor: PokegearPhone_UpdateCursor:
ld a, " " ld a, " "
hlcoord 1, 4 x = 4
ld [hl], a rept PHONE_DISPLAY_HEIGHT
hlcoord 1, 6 hlcoord 1, x
ld [hl], a
hlcoord 1, 8
ld [hl], a
hlcoord 1, 10
ld [hl], a ld [hl], a
x = x + 2
endr
hlcoord 1, 4 hlcoord 1, 4
ld a, [wPokegearPhoneCursorPosition] ld a, [wPokegearPhoneCursorPosition]
ld bc, 2 * SCREEN_WIDTH ld bc, 2 * SCREEN_WIDTH
@ -1028,10 +1028,10 @@ PokegearPhone_UpdateCursor:
PokegearPhone_UpdateDisplayList: PokegearPhone_UpdateDisplayList:
hlcoord 1, 3 hlcoord 1, 3
ld b, 9 ld b, PHONE_DISPLAY_HEIGHT * 2 + 1
ld a, " " ld a, " "
.row .row
ld c, 18 ld c, SCREEN_WIDTH - 2
.col .col
ld [hli], a ld [hli], a
dec c dec c
@ -1042,7 +1042,7 @@ PokegearPhone_UpdateDisplayList:
jr nz, .row jr nz, .row
ld a, [wPokegearPhoneScrollPosition] ld a, [wPokegearPhoneScrollPosition]
ld e, a ld e, a
ld d, $0 ld d, 0
ld hl, wPhoneList ld hl, wPhoneList
add hl, de add hl, de
xor a xor a
@ -1064,7 +1064,7 @@ PokegearPhone_UpdateDisplayList:
ld a, [wPokegearPhoneLoadNameBuffer] ld a, [wPokegearPhoneLoadNameBuffer]
inc a inc a
ld [wPokegearPhoneLoadNameBuffer], a ld [wPokegearPhoneLoadNameBuffer], a
cp 4 cp PHONE_DISPLAY_HEIGHT
jr c, .loop jr c, .loop
call PokegearPhone_UpdateCursor call PokegearPhone_UpdateCursor
ret ret
@ -1463,15 +1463,15 @@ RadioChannels:
; entries correspond to constants/radio_constants.asm ; entries correspond to constants/radio_constants.asm
; frequency value given here = 4 × ingame_frequency 2 ; frequency value given here = 4 × ingame_frequency 2
dbw 16, .PKMNTalkAndPokedexShow dbw 16, .PKMNTalkAndPokedexShow ; 04.5
dbw 28, .PokemonMusic dbw 28, .PokemonMusic ; 07.5
dbw 32, .LuckyChannel dbw 32, .LuckyChannel ; 08.5
dbw 40, .BuenasPassword dbw 40, .BuenasPassword ; 10.5
dbw 52, .RuinsOfAlphRadio dbw 52, .RuinsOfAlphRadio ; 13.5
dbw 64, .PlacesAndPeople dbw 64, .PlacesAndPeople ; 16.5
dbw 72, .LetsAllSing dbw 72, .LetsAllSing ; 18.5
dbw 78, .PokeFluteRadio dbw 78, .PokeFluteRadio ; 20.0
dbw 80, .EvolutionRadio dbw 80, .EvolutionRadio ; 20.5
db -1 db -1
.PKMNTalkAndPokedexShow: .PKMNTalkAndPokedexShow:

View File

@ -33,9 +33,10 @@ SmallFarFlagAction:
; What are we doing to this flag? ; What are we doing to this flag?
dec b dec b
jr z, .set ; 1 jr z, .set ; 1 = SET_FLAG
dec b dec b
jr z, .check ; 2 jr z, .check ; 2 = CHECK_FLAG
; 0 = RESET_FLAG
.reset .reset
ld a, c ld a, c