mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-21 22:52:15 +13:00
Move all code out of home.asm into home/
This results in 64 home/*.asm files, comparable to pokecrystal's 57.
This commit is contained in:
parent
51ac538c25
commit
bbf2f51a02
35 changed files with 1754 additions and 1758 deletions
57
home/palettes.asm
Normal file
57
home/palettes.asm
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
RestoreScreenTilesAndReloadTilePatterns::
|
||||
call ClearSprites
|
||||
ld a, $1
|
||||
ld [wUpdateSpritesEnabled], a
|
||||
call ReloadMapSpriteTilePatterns
|
||||
call LoadScreenTilesFromBuffer2
|
||||
call LoadTextBoxTilePatterns
|
||||
call RunDefaultPaletteCommand
|
||||
jr Delay3
|
||||
|
||||
GBPalWhiteOutWithDelay3::
|
||||
call GBPalWhiteOut
|
||||
|
||||
Delay3::
|
||||
; The bg map is updated each frame in thirds.
|
||||
; Wait three frames to let the bg map fully update.
|
||||
ld c, 3
|
||||
jp DelayFrames
|
||||
|
||||
GBPalNormal::
|
||||
; Reset BGP and OBP0.
|
||||
ld a, %11100100 ; 3210
|
||||
ldh [rBGP], a
|
||||
ld a, %11010000 ; 3100
|
||||
ldh [rOBP0], a
|
||||
ret
|
||||
|
||||
GBPalWhiteOut::
|
||||
; White out all palettes.
|
||||
xor a
|
||||
ldh [rBGP], a
|
||||
ldh [rOBP0], a
|
||||
ldh [rOBP1], a
|
||||
ret
|
||||
|
||||
RunDefaultPaletteCommand::
|
||||
ld b, SET_PAL_DEFAULT
|
||||
RunPaletteCommand::
|
||||
ld a, [wOnSGB]
|
||||
and a
|
||||
ret z
|
||||
predef_jump _RunPaletteCommand
|
||||
|
||||
GetHealthBarColor::
|
||||
; Return at hl the palette of
|
||||
; an HP bar e pixels long.
|
||||
ld a, e
|
||||
cp 27
|
||||
ld d, 0 ; green
|
||||
jr nc, .gotColor
|
||||
cp 10
|
||||
inc d ; yellow
|
||||
jr nc, .gotColor
|
||||
inc d ; red
|
||||
.gotColor
|
||||
ld [hl], d
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue