Harmonize engine/{phone, pokedex, pokegear, printer, rtc, tilesets} with pokegold

To do: engine/{menus, movie, overworld, pokemon}
This commit is contained in:
Rangi 2020-06-17 11:29:00 -04:00
parent 8019db3ea9
commit be93ab33a7
8 changed files with 123 additions and 125 deletions

View File

@ -1055,8 +1055,8 @@ Pokedex_ListingPosChanged:
ret ret
Pokedex_FillColumn: Pokedex_FillColumn:
; Fills a column starting at HL, going downwards. ; Fills a column starting at hl, going downwards.
; B is the height of the column and A is the tile it's filled with. ; b is the height of the column, and a is the tile it's filled with.
push de push de
ld de, SCREEN_WIDTH ld de, SCREEN_WIDTH
.loop .loop
@ -2305,7 +2305,6 @@ Pokedex_FillBox:
jp FillBoxWithByte jp FillBoxWithByte
Pokedex_BlackOutBG: Pokedex_BlackOutBG:
; Make BG palettes black so that the BG becomes all black.
ldh a, [rSVBK] ldh a, [rSVBK]
push af push af
ld a, BANK(wBGPals1) ld a, BANK(wBGPals1)

View File

@ -52,7 +52,7 @@ DrawPokedexListWindow:
ld a, $51 ld a, $51
hlcoord 11, 1 hlcoord 11, 1
ld b, SCREEN_HEIGHT - 3 ld b, SCREEN_HEIGHT - 3
call Bank77_FillColumn call Pokedex_FillColumn2
ld [hl], $52 ld [hl], $52
jr .Done jr .Done
@ -63,7 +63,7 @@ DrawPokedexListWindow:
ld a, $67 ld a, $67
hlcoord 11, 1 hlcoord 11, 1
ld b, SCREEN_HEIGHT - 3 ld b, SCREEN_HEIGHT - 3
call Bank77_FillColumn call Pokedex_FillColumn2
ld [hl], $68 ld [hl], $68
.Done: .Done:
ret ret
@ -86,7 +86,7 @@ DrawPokedexSearchResultsWindow:
ld a, $67 ld a, $67
hlcoord 11, 1 hlcoord 11, 1
ld b, SCREEN_HEIGHT / 2 ld b, SCREEN_HEIGHT / 2
call Bank77_FillColumn call Pokedex_FillColumn2
ld [hl], $68 ld [hl], $68
ld a, $34 ld a, $34
hlcoord 0, 11 hlcoord 0, 11
@ -101,7 +101,7 @@ DrawPokedexSearchResultsWindow:
ld a, $67 ld a, $67
hlcoord 11, 12 hlcoord 11, 12
ld b, 5 ld b, 5
call Bank77_FillColumn call Pokedex_FillColumn2
ld [hl], $68 ld [hl], $68
hlcoord 0, 12 hlcoord 0, 12
lb bc, 5, 11 lb bc, 5, 11
@ -134,14 +134,14 @@ DrawDexEntryScreenRightEdge:
hlcoord 19, 1 hlcoord 19, 1
ld a, $67 ld a, $67
ld b, 15 ld b, 15
call Bank77_FillColumn call Pokedex_FillColumn2
ld [hl], $68 ld [hl], $68
hlcoord 19, 17 hlcoord 19, 17
ld [hl], $3c ld [hl], $3c
xor a xor a
ld b, SCREEN_HEIGHT ld b, SCREEN_HEIGHT
hlcoord 19, 0, wAttrmap hlcoord 19, 0, wAttrmap
call Bank77_FillColumn call Pokedex_FillColumn2
call WaitBGMap2 call WaitBGMap2
pop hl pop hl
ld a, l ld a, l
@ -150,7 +150,8 @@ DrawDexEntryScreenRightEdge:
ldh [hBGMapAddress + 1], a ldh [hBGMapAddress + 1], a
ret ret
Bank77_FillColumn: Pokedex_FillColumn2:
; A local duplicate of Pokedex_FillColumn.
push de push de
ld de, SCREEN_WIDTH ld de, SCREEN_WIDTH
.loop .loop

View File

@ -1098,7 +1098,7 @@ PeoplePlaces4: ; People
call Random call Random
maskbits NUM_TRAINER_CLASSES maskbits NUM_TRAINER_CLASSES
inc a inc a
cp NUM_TRAINER_CLASSES - 1 cp NUM_TRAINER_CLASSES - 1 ; omit MYSTICALMAN
jr nc, PeoplePlaces4 jr nc, PeoplePlaces4
push af push af
ld hl, PnP_HiddenPeople ld hl, PnP_HiddenPeople

View File

@ -71,7 +71,7 @@ PrintDexEntry:
ld hl, hVBlank ld hl, hVBlank
ld a, [hl] ld a, [hl]
push af push af
ld [hl], $4 ld [hl], 4
ld a, 8 ; 16 rows ld a, 8 ; 16 rows
ld [wPrinterQueueLength], a ld [wPrinterQueueLength], a
@ -904,7 +904,7 @@ Printer_PlaceBottomBorders:
Printer_PlaceEmptyBoxSlotString: Printer_PlaceEmptyBoxSlotString:
hlcoord 2, 0 hlcoord 2, 0
ld c, $6 ld c, 6
.loop .loop
push bc push bc
push hl push hl

View File

@ -13,7 +13,7 @@ _ResetClock:
call VerticalMenu call VerticalMenu
ret c ret c
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
cp $1 cp 1
ret z ret z
call ClockResetPassword call ClockResetPassword
jr c, .wrongpassword jr c, .wrongpassword
@ -62,7 +62,7 @@ ClockResetPassword:
ld bc, 5 ld bc, 5
xor a xor a
call ByteFill call ByteFill
ld a, $4 ld a, 4
ld [wStringBuffer2 + 5], a ld [wStringBuffer2 + 5], a
ld hl, .PasswordAskEnterText ld hl, .PasswordAskEnterText
call PrintText call PrintText
@ -120,7 +120,7 @@ ClockResetPassword:
hlcoord 14, 16 hlcoord 14, 16
ld a, [wStringBuffer2 + 5] ld a, [wStringBuffer2 + 5]
ld e, a ld e, a
ld d, $0 ld d, 0
add hl, de add hl, de
ld [hl], "▲" ld [hl], "▲"
ret ret
@ -150,7 +150,7 @@ ClockResetPassword:
.right .right
ld a, [wStringBuffer2 + 5] ld a, [wStringBuffer2 + 5]
cp $4 cp 4
ret z ret z
inc a inc a
ld [wStringBuffer2 + 5], a ld [wStringBuffer2 + 5], a
@ -166,7 +166,7 @@ ClockResetPassword:
ret ret
.wraparound_up .wraparound_up
ld [hl], $0 ld [hl], 0
ret ret
.down .down
@ -219,13 +219,13 @@ ClockResetPassword:
call GetSRAMBank call GetSRAMBank
ld de, 0 ld de, 0
ld hl, sPlayerData + (wPlayerID - wPlayerData) ld hl, sPlayerData + (wPlayerID - wPlayerData)
ld c, $2 ld c, 2
call .ComponentFromNumber call .ComponentFromNumber
ld hl, sPlayerData + (wPlayerName - wPlayerData) ld hl, sPlayerData + (wPlayerName - wPlayerData)
ld c, NAME_LENGTH_JAPANESE - 1 ld c, NAME_LENGTH_JAPANESE - 1
call .ComponentFromString call .ComponentFromString
ld hl, sPlayerData + (wMoney - wPlayerData) ld hl, sPlayerData + (wMoney - wPlayerData)
ld c, $3 ld c, 3
call .ComponentFromNumber call .ComponentFromNumber
call CloseSRAM call CloseSRAM
ret ret
@ -234,7 +234,7 @@ ClockResetPassword:
ld a, [hli] ld a, [hli]
add e add e
ld e, a ld e, a
ld a, $0 ld a, 0
adc d adc d
ld d, a ld d, a
dec c dec c
@ -247,7 +247,7 @@ ClockResetPassword:
ret z ret z
add e add e
ld e, a ld e, a
ld a, $0 ld a, 0
adc d adc d
ld d, a ld d, a
dec c dec c

View File

@ -74,11 +74,11 @@ StageRTCTimeForSave:
ret ret
SaveRTC: SaveRTC:
ld a, $a ld a, SRAM_ENABLE
ld [MBC3SRamEnable], a ld [MBC3SRamEnable], a
call LatchClock call LatchClock
ld hl, MBC3RTC ld hl, MBC3RTC
ld a, $c ld a, RTC_DH
ld [MBC3SRamBank], a ld [MBC3SRamBank], a
res 7, [hl] res 7, [hl]
ld a, BANK(sRTCStatusFlags) ld a, BANK(sRTCStatusFlags)

View File

@ -2,7 +2,7 @@ _AnimateTileset::
; Iterate over a given pointer array of ; Iterate over a given pointer array of
; animation functions (one per frame). ; animation functions (one per frame).
; Typically in wra1, vra0 ; Typically in WRAM bank 1, VRAM bank 0.
ld a, [wTilesetAnim] ld a, [wTilesetAnim]
ld e, a ld e, a
@ -658,7 +658,6 @@ FlowerTileFrames:
INCBIN "gfx/tilesets/flower/cgb_2.2bpp" INCBIN "gfx/tilesets/flower/cgb_2.2bpp"
LavaBubbleAnim1: LavaBubbleAnim1:
; Splash in the bottom-right corner of the fountain.
ld hl, sp+0 ld hl, sp+0
ld b, h ld b, h
ld c, l ld c, l
@ -678,7 +677,6 @@ LavaBubbleAnim1:
jp WriteTile jp WriteTile
LavaBubbleAnim2: LavaBubbleAnim2:
; Splash in the top-left corner of the fountain.
ld hl, sp+0 ld hl, sp+0
ld b, h ld b, h
ld c, l ld c, l

View File

@ -188,19 +188,19 @@ endr
ReplaceTimeOfDayPals: ReplaceTimeOfDayPals:
ld hl, .BrightnessLevels ld hl, .BrightnessLevels
ld a, [wMapTimeOfDay] ld a, [wMapTimeOfDay]
cp $4 ; Dark cave, needs Flash cp PALETTE_DARK
jr z, .DarkCave jr z, .NeedsFlash
and $7 and $7
add l add l
ld l, a ld l, a
ld a, $0 ld a, 0
adc h adc h
ld h, a ld h, a
ld a, [hl] ld a, [hl]
ld [wTimeOfDayPalset], a ld [wTimeOfDayPalset], a
ret ret
.DarkCave: .NeedsFlash:
ld a, [wStatusFlags] ld a, [wStatusFlags]
bit STATUSFLAGS_FLASH_F, a bit STATUSFLAGS_FLASH_F, a
jr nz, .UsedFlash jr nz, .UsedFlash
@ -319,7 +319,7 @@ GetTimePalFade:
; get fade table ; get fade table
push bc push bc
ld c, a ld c, a
ld b, $0 ld b, 0
ld hl, .dmgfades ld hl, .dmgfades
add hl, bc add hl, bc
add hl, bc add hl, bc
@ -329,13 +329,13 @@ GetTimePalFade:
pop bc pop bc
; get place in fade table ; get place in fade table
ld b, $0 ld b, 0
add hl, bc add hl, bc
ret ret
.cgb .cgb
ld hl, .cgbfade ld hl, .cgbfade
ld b, $0 ld b, 0
add hl, bc add hl, bc
ret ret