Use hardware.inc constants in places unique to Yellow
Some checks failed
CI / build (push) Has been cancelled

This commit is contained in:
Rangi42 2025-07-02 23:39:15 -04:00
parent ca019eac8f
commit 5a142e3fee
7 changed files with 22 additions and 26 deletions

View File

@ -4,10 +4,6 @@
const SHADE_LIGHT ; %01
const SHADE_DARK ; %10
const SHADE_BLACK ; %11
DEF NUM_PAL_COLORS EQU const_value
DEF PAL_COLOR_SIZE EQU 2
DEF PALETTE_SIZE EQU NUM_PAL_COLORS * PAL_COLOR_SIZE
DEF NUM_ACTIVE_PALS EQU 4

View File

@ -817,7 +817,7 @@ DMGPalToCGBPal::
ldh a, [rOBP1]
ld [wLastOBP1], a
.convert
FOR color_index, NUM_PAL_COLORS
FOR color_index, PAL_COLORS
ld b, a
and %11
call .GetColorAddress
@ -826,7 +826,7 @@ DMGPalToCGBPal::
ld a, [hl]
ld [wCGBPal + color_index * 2 + 1], a
IF color_index < NUM_PAL_COLORS - 1
IF color_index < PAL_COLORS - 1
ld a, b
rrca
rrca
@ -855,12 +855,12 @@ TransferCurBGPData::
ldh a, [rLCDC]
and LCDC_ON
jr nz, .lcdEnabled
REPT NUM_PAL_COLORS
REPT PAL_COLORS
call TransferPalColorLCDDisabled
ENDR
jr .done
.lcdEnabled
REPT NUM_PAL_COLORS
REPT PAL_COLORS
call TransferPalColorLCDEnabled
ENDR
.done
@ -879,7 +879,7 @@ BufferBGPPal::
ld de, wBGPPalsBuffer
add hl, de
ld de, wCGBPal
ld c, PALETTE_SIZE
ld c, PAL_SIZE
.loop
ld a, [de]
ld [hli], a
@ -910,7 +910,7 @@ TransferBGPPals::
ldh [rBGPI], a
ld de, rBGPD
ld hl, wBGPPalsBuffer
ld c, 4 * PALETTE_SIZE
ld c, 4 * PAL_SIZE
.loop
ld a, [hli]
ld [de], a
@ -931,12 +931,12 @@ TransferCurOBPData:
ldh a, [rLCDC]
and LCDC_ON
jr nz, .lcdEnabled
REPT NUM_PAL_COLORS
REPT PAL_COLORS
call TransferPalColorLCDDisabled
ENDR
jr .done
.lcdEnabled
REPT NUM_PAL_COLORS
REPT PAL_COLORS
call TransferPalColorLCDEnabled
ENDR
.done

View File

@ -1453,7 +1453,7 @@ SurfingMinigame_DrawHP:
SurfingMinigame_DrawResultsScreen:
ld hl, wTileMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld bc, SCREEN_AREA
xor a
call FillMemory
ld hl, .BeachTilemap
@ -2396,7 +2396,7 @@ SurfingPikachuMinigameIntro:
DrawSurfingPikachuMinigameIntroBackground:
ld hl, wTileMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld bc, SCREEN_AREA
ld a, $ff
call FillMemory
ld hl, Tilemap_f90bc
@ -2536,7 +2536,7 @@ SurfingPikachuMinigame_NormalPals:
SurfingPikachu_ClearTileMap:
ld hl, wTileMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld bc, SCREEN_AREA
xor a
call FillMemory
ret

View File

@ -43,7 +43,7 @@ PlayIntroScene:
ldh [hWY], a
call ClearObjectAnimationBuffers
ld hl, wTileMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld bc, SCREEN_AREA
xor a
call Bank3E_FillMemory
call YellowIntro_BlankOAMBuffer
@ -823,7 +823,7 @@ InitYellowIntroGFXAndMusic:
ldh [hAutoBGTransferDest + 1], a
call YellowIntro_BlankTileMap
ld hl, wTileMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld bc, SCREEN_AREA
ld a, $1
call Bank3E_FillMemory
hlcoord 0, 4
@ -881,7 +881,7 @@ LoadYellowIntroObjectAnimationDataPointers:
YellowIntro_BlankTileMap:
ld hl, wTileMap
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld bc, SCREEN_AREA
ld a, $7f
call Bank3E_FillMemory
ret

View File

@ -466,14 +466,14 @@ Printer_CheckPressingB:
Printer_CopyTileMapToPrinterTileBuffer:
hlcoord 0, 0
decoord 0, 0, wPrinterTileBuffer
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
ld bc, SCREEN_AREA
call CopyData
ret
Printer_CopyTileMapFromPrinterTileBuffer:
hlcoord 0, 0, wPrinterTileBuffer
decoord 0, 0
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
ld bc, SCREEN_AREA
call CopyData
ret

View File

@ -9,9 +9,9 @@ DEF palred EQUS "(1 << B_COLOR_RED) *"
DEF palgreen EQUS "(1 << B_COLOR_GREEN) *"
DEF palblue EQUS "(1 << B_COLOR_BLUE) *"
DEF palettes EQUS "* PALETTE_SIZE"
DEF palette EQUS "+ PALETTE_SIZE *"
DEF color EQUS "+ PAL_COLOR_SIZE *"
DEF palettes EQUS "* PAL_SIZE"
DEF palette EQUS "+ PAL_SIZE *"
DEF color EQUS "+ COLOR_SIZE *"
DEF tiles EQUS "* TILE_SIZE"
DEF tile EQUS "+ TILE_SIZE *"

View File

@ -316,7 +316,7 @@ wHandshakeFrameDelay:: db
wPrinterSerialFrameDelay:: db
wPrinterSendByteOffset:: dw
wPrinterDataSize:: dw
wPrinterTileBuffer:: ds SCREEN_HEIGHT * SCREEN_WIDTH
wPrinterTileBuffer:: ds SCREEN_AREA
wPrinterStatusIndicator:: dw
wcae2:: db
wPrinterSettingsTempCopy:: db
@ -2503,12 +2503,12 @@ wBoxDataEnd::
SECTION "CGB Palette Data", WRAM0
wCGBBasePalPointers:: ds NUM_ACTIVE_PALS * 2
wCGBPal:: ds PALETTE_SIZE
wCGBPal:: ds PAL_SIZE
wLastBGP:: db
wLastOBP0:: db
wLastOBP1:: db
wdef4:: db
wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PALETTE_SIZE
wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PAL_SIZE
SECTION "Stack", WRAM0