SGB color mode stuff!

dark caves don't currently work correctly, need to look into a fix
This commit is contained in:
Zeta_Null 2024-07-21 16:57:20 -04:00
parent 1ecdf6d1d4
commit 6757a7652a
8 changed files with 102 additions and 14 deletions

View file

@ -11,7 +11,7 @@
tilecoll WALL, WALL, WALL, WALL ; 0a
tilecoll WALL, WALL, WALL, WALL ; 0b
tilecoll WALL, DOOR, FLOOR, FLOOR ; 0c
tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 0d
tilecoll WALL, WALL, FLOOR, FLOOR ; 0d
tilecoll WALL, WALL, WALL, DOOR ; 0e
tilecoll WALL, WALL, WALL, WALL ; 0f
tilecoll WALL, WALL, WALL, WALL ; 10

View file

@ -645,8 +645,8 @@ StartTrainerBattle_LoadPokeBallGraphics:
dec b
jr nz, .tile_loop
ldh a, [hCGB]
and a
ld a, [wOptions2]
and 1 << MENU_ACCOUNT
jr nz, .cgb
ld a, 1
ldh [hBGMapMode], a

View file

@ -155,7 +155,8 @@ INCBIN "gfx/overworld/heal_machine.2bpp"
dbsprite 11, 7, 5, 1, $7d, PAL_OW_TREE | OBP_NUM
.LoadPalettes:
call IsCGB
ld a, [wOptions2]
and 1 << MENU_ACCOUNT
jr nz, .cgb
ld a, %11100000
ldh [rOBP1], a

View file

@ -531,10 +531,94 @@ _CGB_Diploma:
ret
_CGB_MapPals:
ld a, [wOptions2]
and 1 << MENU_ACCOUNT
jr z, .SGBmode
ld a, [wOptions2]
and 1 << MENU_ACCOUNT
jr nz, .GBCmode
ret
.GBCmode:
call LoadMapPals
ld a, SCGB_MAPPALS
ld [wDefaultSGBLayout], a
ret
.SGBmode:
; Get SGB palette
call SGBLayoutJumptable.GetMapPalsIndex
call GetPredefPal
ld de, wBGPals1
; Copy 7 BG palettes
ld b, 7
.bg_loop
call .LoadHLBGPaletteIntoDE
dec b
jr nz, .bg_loop
; Copy PAL_BG_TEXT and 6 OB palettes
ld b, 7
.ob_loop
call .LoadHLOBPaletteIntoDE
dec b
jr nz, .ob_loop
; Copy PAL_OW_TREE and PAL_OW_ROCK
call .LoadHLBGPaletteIntoDE
call .LoadHLBGPaletteIntoDE
ld a, SCGB_MAPPALS
ld [wDefaultSGBLayout], a
ret
.LoadHLBGPaletteIntoDE:
; morn/day: shades 0, 1, 2, 3 -> 0, 1, 2, 3
; nite: shades 0, 1, 2, 3 -> 1, 2, 2, 3
push hl
ld a, [wTimeOfDayPal]
cp NITE_F
jr c, .bg_morn_day
inc hl
inc hl
call .LoadHLColorIntoDE
call .LoadHLColorIntoDE
dec hl
dec hl
call .LoadHLColorIntoDE
call .LoadHLColorIntoDE
.bg_done
pop hl
ret
.bg_morn_day
call LoadHLPaletteIntoDE
jr .bg_done
.LoadHLOBPaletteIntoDE:
; shades 0, 1, 2, 3 -> 0, 0, 1, 3
push hl
call .LoadHLColorIntoDE
dec hl
dec hl
call .LoadHLColorIntoDE
call .LoadHLColorIntoDE
inc hl
inc hl
call .LoadHLColorIntoDE
pop hl
ret
.LoadHLColorIntoDE:
ldh a, [rSVBK]
push af
ld a, BANK(wBGPals1)
ldh [rSVBK], a
rept PAL_COLOR_SIZE
ld a, [hli]
ld [de], a
inc de
endr
pop af
ldh [rSVBK], a
ret
_CGB_PartyMenu:
ld hl, PalPacket_PartyMenu + 1
@ -627,6 +711,8 @@ _CGB_UnownPuzzle:
ret
_CGB_TrainerCard:
ld a, [wOptions2]
and 1 << MENU_ACCOUNT
ld de, wBGPals1
xor a ; CHRIS
call GetTrainerPalettePointer

View file

@ -85,7 +85,7 @@ StringOptions:
db " :<LF>"
db "PRINT<LF>"
db " :<LF>"
db "MENU ACCOUNT<LF>"
db "GBC COLORS<LF>"
db " :<LF>"
db "FRAME<LF>"
db " :TYPE<LF>"

View file

@ -381,8 +381,8 @@ endr
jp TextboxPalette
.IsMenuAccountOn:
ld a, [wOptions2]
and 1 << MENU_ACCOUNT
; ld a, [wOptions2]
; and 1 << MENU_ACCOUNT
ret
.DrawBugContestStatusBox:

View file

@ -717,8 +717,8 @@ AnimateFlowerTile:
; CGB has different tile graphics for flowers
ld e, a
ldh a, [hCGB]
and 1
ld a, [wOptions2]
and 1 << MENU_ACCOUNT
add e
; hl = .FlowerTileFrames + a * 16
@ -738,6 +738,7 @@ AnimateFlowerTile:
INCBIN "gfx/tilesets/flower/cgb_1.2bpp"
INCBIN "gfx/tilesets/flower/dmg_2.2bpp"
INCBIN "gfx/tilesets/flower/cgb_2.2bpp"
AnimateLavaBubbleTile1:
; Save the stack pointer in bc for WriteTile to restore
@ -950,8 +951,8 @@ AnimateWaterPalette:
; Transition between color values 0-2 for color 0 in palette 3.
; Don't update the palette on DMG
ldh a, [hCGB]
and a
ld a, [wOptions2]
and 1 << MENU_ACCOUNT
ret z
; Don't update a non-standard palette order
@ -1013,8 +1014,8 @@ AnimateWaterPalette:
FlickeringCaveEntrancePalette:
; Don't update the palette on DMG
ldh a, [hCGB]
and a
ld a, [wOptions2]
and 1 << MENU_ACCOUNT
ret z
; Don't update a non-standard palette order

View file

@ -23,7 +23,6 @@
RGB 31,31,31, 31,20,20, 15,20,31, 00,00,00 ; PREDEFPAL_LAKE_OF_RAGE
RGB 31,31,31, 26,26,26, 15,20,31, 00,00,00 ; PREDEFPAL_SILVER_CAVE
RGB 31,31,31, 21,14,09, 15,20,20, 00,00,00 ; PREDEFPAL_DUNGEONS
RGB 31,31,31, 12,28,22, 15,20,20, 00,00,00 ; PREDEFPAL_SILENT_HILLS
RGB 31,31,31, 29,26,18, 15,20,31, 00,00,00 ; PREDEFPAL_CITRINE (temp)
RGB 31,31,31, 29,26,18, 15,20,31, 00,00,00 ; PREDEFPAL_ONE_ISLAND (temp)
RGB 31,31,31, 29,26,18, 15,20,31, 00,00,00 ; PREDEFPAL_TWO_ISLAND (temp)
@ -32,6 +31,7 @@
RGB 31,31,31, 29,26,18, 15,20,31, 00,00,00 ; PREDEFPAL_FIVE_ISLAND (temp)
RGB 31,31,31, 29,26,18, 15,20,31, 00,00,00 ; PREDEFPAL_SIX_ISLAND (temp)
RGB 31,31,31, 29,26,18, 15,20,31, 00,00,00 ; PREDEFPAL_SEVEN_ISLAND (temp)
RGB 31,31,31, 12,28,22, 15,20,20, 00,00,00 ; PREDEFPAL_SILENT_HILLS
RGB 31,31,31, 18,14,31, 15,20,20, 00,00,00 ; PREDEFPAL_BLUE_FOREST
RGB 31,31,31, 12,28,22, 15,20,20, 00,00,00 ; PREDEFPAL_NITE
RGB 31,31,31, 07,07,07, 02,03,03, 00,00,00 ; PREDEFPAL_BLACKOUT