Replace hardware_constants.asm with the community-standard hardware.inc 5.0 (#1186)

This commit is contained in:
Rangi
2025-06-23 09:11:33 -04:00
committed by GitHub
parent ae7ee67d21
commit 4c540aa43b
149 changed files with 3444 additions and 3103 deletions

View File

@@ -37,7 +37,7 @@ _LoadOverworldAttrmapPals::
.next
pop hl
ld [de], a
res OAM_TILE_BANK + 4, [hl]
res B_OAM_BANK1 + 4, [hl]
inc hl
inc de
dec c
@@ -81,7 +81,7 @@ _ScrollBGMapPalettes::
.next
pop hl
ld [de], a
res OAM_TILE_BANK + 4, [hl]
res B_OAM_BANK1 + 4, [hl]
inc hl
inc de
dec c

View File

@@ -321,7 +321,7 @@ ScrollTileUpDown: ; unreferenced
ScrollTileLeft:
ld h, d
ld l, e
ld c, LEN_2BPP_TILE / 4
ld c, TILE_SIZE / 4
.loop
rept 4
ld a, [hl]
@@ -335,7 +335,7 @@ endr
ScrollTileRight:
ld h, d
ld l, e
ld c, LEN_2BPP_TILE / 4
ld c, TILE_SIZE / 4
.loop
rept 4
ld a, [hl]
@@ -352,9 +352,9 @@ ScrollTileUp:
ld d, [hl]
inc hl
ld e, [hl]
ld bc, LEN_2BPP_TILE - 2
ld bc, TILE_SIZE - 2
add hl, bc
ld a, LEN_2BPP_TILE / 4
ld a, TILE_SIZE / 4
.loop
ld c, [hl]
ld [hl], e
@@ -375,14 +375,14 @@ ScrollTileUp:
ScrollTileDown:
ld h, d
ld l, e
ld de, LEN_2BPP_TILE - 2
ld de, TILE_SIZE - 2
push hl
add hl, de
ld d, [hl]
inc hl
ld e, [hl]
pop hl
ld a, LEN_2BPP_TILE / 4
ld a, TILE_SIZE / 4
.loop
ld b, [hl]
ld [hl], d
@@ -888,7 +888,7 @@ WriteTile:
ld [hl], e
inc hl
ld [hl], d
rept (LEN_2BPP_TILE - 2) / 2
rept (TILE_SIZE - 2) / 2
pop de
inc hl
ld [hl], e
@@ -922,13 +922,13 @@ AnimateWaterPalette:
ret nz
; Ready for BGPD input
ld a, (1 << rBGPI_AUTO_INCREMENT) palette PAL_BG_WATER color 0
ld a, BGPI_AUTOINC palette PAL_BG_WATER color 0
ldh [rBGPI], a
ldh a, [rSVBK]
ldh a, [rWBK]
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
ldh [rWBK], a
; A cycle of 4 colors (0 1 2 1), updating every other tick
ld a, l
@@ -964,7 +964,7 @@ AnimateWaterPalette:
.end
pop af
ldh [rSVBK], a
ldh [rWBK], a
ret
FlickeringCaveEntrancePalette:
@@ -983,13 +983,13 @@ FlickeringCaveEntrancePalette:
cp DARKNESS_PALSET
ret nz
ldh a, [rSVBK]
ldh a, [rWBK]
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
ldh [rWBK], a
; Ready for BGPD input
ld a, (1 << rBGPI_AUTO_INCREMENT) palette PAL_BG_YELLOW color 0
ld a, BGPI_AUTOINC palette PAL_BG_YELLOW color 0
ldh [rBGPI], a
; A cycle of 2 colors (0 2), updating every other vblank
@@ -1013,7 +1013,7 @@ FlickeringCaveEntrancePalette:
ldh [rBGPD], a
pop af
ldh [rSVBK], a
ldh [rWBK], a
ret
TowerPillarTilePointer1: dw vTiles2 tile $2d, TowerPillarTile1

View File

@@ -43,14 +43,14 @@ _TimeOfDayPals::
ld hl, wBGPals1 palette PAL_BG_TEXT
; save wram bank
ldh a, [rSVBK]
ldh a, [rWBK]
ld b, a
ld a, BANK(wBGPals1)
ldh [rSVBK], a
ldh [rWBK], a
; push palette
ld c, NUM_PAL_COLORS
ld c, PAL_COLORS
.push
ld d, [hl]
inc hl
@@ -62,7 +62,7 @@ _TimeOfDayPals::
; restore wram bank
ld a, b
ldh [rSVBK], a
ldh [rWBK], a
; update sgb pals
ld b, SCGB_MAPPALS
@@ -72,14 +72,14 @@ _TimeOfDayPals::
ld hl, wOBPals1 - 1 ; last byte in wBGPals1
; save wram bank
ldh a, [rSVBK]
ldh a, [rWBK]
ld d, a
ld a, BANK(wOBPals1)
ldh [rSVBK], a
ldh [rWBK], a
; pop palette
ld e, NUM_PAL_COLORS
ld e, PAL_COLORS
.pop
pop bc
ld [hl], c
@@ -91,7 +91,7 @@ _TimeOfDayPals::
; restore wram bank
ld a, d
ldh [rSVBK], a
ldh [rWBK], a
; update palettes
call _UpdateTimePals
@@ -159,10 +159,10 @@ FadeOutToBlack:
FillWhiteBGColor:
; Copy white palette of wBGPals1 Pal0 into white palette of wBGPals1 Pal1-Pal6
ldh a, [rSVBK]
ldh a, [rWBK]
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
ldh [rWBK], a
ld hl, wBGPals1
ld a, [hli]
@@ -183,7 +183,7 @@ endr
jr nz, .loop
pop af
ldh [rSVBK], a
ldh [rWBK], a
ret
ReplaceTimeOfDayPals: