mirror of
https://github.com/thornAvery/jep-hack.git
synced 2025-12-28 21:33:16 +13:00
SGB color mode stuff!
dark caves don't currently work correctly, need to look into a fix
This commit is contained in:
parent
1ecdf6d1d4
commit
6757a7652a
|
|
@ -11,7 +11,7 @@
|
||||||
tilecoll WALL, WALL, WALL, WALL ; 0a
|
tilecoll WALL, WALL, WALL, WALL ; 0a
|
||||||
tilecoll WALL, WALL, WALL, WALL ; 0b
|
tilecoll WALL, WALL, WALL, WALL ; 0b
|
||||||
tilecoll WALL, DOOR, FLOOR, FLOOR ; 0c
|
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, DOOR ; 0e
|
||||||
tilecoll WALL, WALL, WALL, WALL ; 0f
|
tilecoll WALL, WALL, WALL, WALL ; 0f
|
||||||
tilecoll WALL, WALL, WALL, WALL ; 10
|
tilecoll WALL, WALL, WALL, WALL ; 10
|
||||||
|
|
|
||||||
|
|
@ -645,8 +645,8 @@ StartTrainerBattle_LoadPokeBallGraphics:
|
||||||
dec b
|
dec b
|
||||||
jr nz, .tile_loop
|
jr nz, .tile_loop
|
||||||
|
|
||||||
ldh a, [hCGB]
|
ld a, [wOptions2]
|
||||||
and a
|
and 1 << MENU_ACCOUNT
|
||||||
jr nz, .cgb
|
jr nz, .cgb
|
||||||
ld a, 1
|
ld a, 1
|
||||||
ldh [hBGMapMode], a
|
ldh [hBGMapMode], a
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,8 @@ INCBIN "gfx/overworld/heal_machine.2bpp"
|
||||||
dbsprite 11, 7, 5, 1, $7d, PAL_OW_TREE | OBP_NUM
|
dbsprite 11, 7, 5, 1, $7d, PAL_OW_TREE | OBP_NUM
|
||||||
|
|
||||||
.LoadPalettes:
|
.LoadPalettes:
|
||||||
call IsCGB
|
ld a, [wOptions2]
|
||||||
|
and 1 << MENU_ACCOUNT
|
||||||
jr nz, .cgb
|
jr nz, .cgb
|
||||||
ld a, %11100000
|
ld a, %11100000
|
||||||
ldh [rOBP1], a
|
ldh [rOBP1], a
|
||||||
|
|
|
||||||
|
|
@ -531,11 +531,95 @@ _CGB_Diploma:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
_CGB_MapPals:
|
_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
|
call LoadMapPals
|
||||||
ld a, SCGB_MAPPALS
|
ld a, SCGB_MAPPALS
|
||||||
ld [wDefaultSGBLayout], a
|
ld [wDefaultSGBLayout], a
|
||||||
ret
|
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:
|
_CGB_PartyMenu:
|
||||||
ld hl, PalPacket_PartyMenu + 1
|
ld hl, PalPacket_PartyMenu + 1
|
||||||
call CopyFourPalettes
|
call CopyFourPalettes
|
||||||
|
|
@ -627,6 +711,8 @@ _CGB_UnownPuzzle:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
_CGB_TrainerCard:
|
_CGB_TrainerCard:
|
||||||
|
ld a, [wOptions2]
|
||||||
|
and 1 << MENU_ACCOUNT
|
||||||
ld de, wBGPals1
|
ld de, wBGPals1
|
||||||
xor a ; CHRIS
|
xor a ; CHRIS
|
||||||
call GetTrainerPalettePointer
|
call GetTrainerPalettePointer
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ StringOptions:
|
||||||
db " :<LF>"
|
db " :<LF>"
|
||||||
db "PRINT<LF>"
|
db "PRINT<LF>"
|
||||||
db " :<LF>"
|
db " :<LF>"
|
||||||
db "MENU ACCOUNT<LF>"
|
db "GBC COLORS<LF>"
|
||||||
db " :<LF>"
|
db " :<LF>"
|
||||||
db "FRAME<LF>"
|
db "FRAME<LF>"
|
||||||
db " :TYPE<LF>"
|
db " :TYPE<LF>"
|
||||||
|
|
|
||||||
|
|
@ -381,8 +381,8 @@ endr
|
||||||
jp TextboxPalette
|
jp TextboxPalette
|
||||||
|
|
||||||
.IsMenuAccountOn:
|
.IsMenuAccountOn:
|
||||||
ld a, [wOptions2]
|
; ld a, [wOptions2]
|
||||||
and 1 << MENU_ACCOUNT
|
; and 1 << MENU_ACCOUNT
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.DrawBugContestStatusBox:
|
.DrawBugContestStatusBox:
|
||||||
|
|
|
||||||
|
|
@ -717,8 +717,8 @@ AnimateFlowerTile:
|
||||||
|
|
||||||
; CGB has different tile graphics for flowers
|
; CGB has different tile graphics for flowers
|
||||||
ld e, a
|
ld e, a
|
||||||
ldh a, [hCGB]
|
ld a, [wOptions2]
|
||||||
and 1
|
and 1 << MENU_ACCOUNT
|
||||||
add e
|
add e
|
||||||
|
|
||||||
; hl = .FlowerTileFrames + a * 16
|
; hl = .FlowerTileFrames + a * 16
|
||||||
|
|
@ -739,6 +739,7 @@ AnimateFlowerTile:
|
||||||
INCBIN "gfx/tilesets/flower/dmg_2.2bpp"
|
INCBIN "gfx/tilesets/flower/dmg_2.2bpp"
|
||||||
INCBIN "gfx/tilesets/flower/cgb_2.2bpp"
|
INCBIN "gfx/tilesets/flower/cgb_2.2bpp"
|
||||||
|
|
||||||
|
|
||||||
AnimateLavaBubbleTile1:
|
AnimateLavaBubbleTile1:
|
||||||
; Save the stack pointer in bc for WriteTile to restore
|
; Save the stack pointer in bc for WriteTile to restore
|
||||||
ld hl, sp+0
|
ld hl, sp+0
|
||||||
|
|
@ -950,8 +951,8 @@ AnimateWaterPalette:
|
||||||
; Transition between color values 0-2 for color 0 in palette 3.
|
; Transition between color values 0-2 for color 0 in palette 3.
|
||||||
|
|
||||||
; Don't update the palette on DMG
|
; Don't update the palette on DMG
|
||||||
ldh a, [hCGB]
|
ld a, [wOptions2]
|
||||||
and a
|
and 1 << MENU_ACCOUNT
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
; Don't update a non-standard palette order
|
; Don't update a non-standard palette order
|
||||||
|
|
@ -1013,8 +1014,8 @@ AnimateWaterPalette:
|
||||||
|
|
||||||
FlickeringCaveEntrancePalette:
|
FlickeringCaveEntrancePalette:
|
||||||
; Don't update the palette on DMG
|
; Don't update the palette on DMG
|
||||||
ldh a, [hCGB]
|
ld a, [wOptions2]
|
||||||
and a
|
and 1 << MENU_ACCOUNT
|
||||||
ret z
|
ret z
|
||||||
|
|
||||||
; Don't update a non-standard palette order
|
; Don't update a non-standard palette order
|
||||||
|
|
|
||||||
|
|
@ -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, 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, 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, 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_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_ONE_ISLAND (temp)
|
||||||
RGB 31,31,31, 29,26,18, 15,20,31, 00,00,00 ; PREDEFPAL_TWO_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_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_SIX_ISLAND (temp)
|
||||||
RGB 31,31,31, 29,26,18, 15,20,31, 00,00,00 ; PREDEFPAL_SEVEN_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, 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, 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
|
RGB 31,31,31, 07,07,07, 02,03,03, 00,00,00 ; PREDEFPAL_BLACKOUT
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue