You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Logic to manage PAL_OW_MISC (#3)
This commit is contained in:
@@ -201,21 +201,12 @@ DrawBoardMenuTilesAndClearPriorityAttr:
|
||||
jp FillBoxWithByte
|
||||
|
||||
ApplyBoardMenuSpritePalette:
|
||||
ld hl, BoardMenuItemPals
|
||||
ld a, [wBoardMenuCursorPosition]
|
||||
ld bc, PALETTE_SIZE
|
||||
call AddNTimes
|
||||
or PAL_OW_MISC_BOARD_MENU_ITEMS
|
||||
ld [wCurOverworldMiscPal], a
|
||||
; write to wOBPals2 directly as well to avoid calling ApplyPals and overwriting other overworld pals
|
||||
; writing to wOBPals1 is still necessary to make fading animations consistent
|
||||
ld de, wOBPals1 palette PAL_OW_MISC
|
||||
ld bc, PALETTE_SIZE
|
||||
ld a, BANK(wOBPals1)
|
||||
call FarCopyWRAM
|
||||
ld hl, wOBPals1 palette PAL_OW_MISC
|
||||
ld de, wOBPals2 palette PAL_OW_MISC
|
||||
ld bc, PALETTE_SIZE
|
||||
ld a, BANK(wOBPals1)
|
||||
call FarCopyWRAM
|
||||
farcall LoadOverworldMiscObjPal_ToObPals1And2
|
||||
ld a, TRUE
|
||||
ldh [hCGBPalUpdate], a
|
||||
ret
|
||||
@@ -487,6 +478,3 @@ BoardMenu_CloseSubmenu:
|
||||
farcall FadeInPalettesFromWhite
|
||||
call EnableSpriteUpdates
|
||||
ret
|
||||
|
||||
BoardMenuItemPals:
|
||||
INCLUDE "gfx/board/menu.pal"
|
||||
|
@@ -321,6 +321,8 @@ UnionSpaceScript::
|
||||
ret
|
||||
|
||||
PrintGainCoins:
|
||||
ld a, PAL_OW_MISC_BOARD_COINS | 0
|
||||
ld [wCurOverworldMiscPal], a
|
||||
ld hl, wStringBuffer1
|
||||
ld a, "<COIN>"
|
||||
ld [hli], a
|
||||
@@ -329,6 +331,8 @@ PrintGainCoins:
|
||||
jr PrintGainOrLoseCoins
|
||||
|
||||
PrintLoseCoins:
|
||||
ld a, PAL_OW_MISC_BOARD_COINS | 1
|
||||
ld [wCurOverworldMiscPal], a
|
||||
ld hl, wStringBuffer1
|
||||
ld a, "<COIN>"
|
||||
ld [hli], a
|
||||
@@ -338,7 +342,12 @@ PrintLoseCoins:
|
||||
|
||||
PrintGainOrLoseCoins:
|
||||
push hl
|
||||
farcall LoadOverworldMiscObjPal_ToObPals2
|
||||
ld a, TRUE
|
||||
ldh [hCGBPalUpdate], a
|
||||
pop hl
|
||||
; fill string space with "@" to ensure that it is terminated with at least one "@"
|
||||
push hl
|
||||
ld a, "@"
|
||||
ld c, MAX_DELTA_COINS_DIGITS + 1
|
||||
.loop
|
||||
|
Reference in New Issue
Block a user