Some DMG fx

This commit is contained in:
Randy Thiemann 2023-11-13 08:17:11 +01:00
parent 545ab11a81
commit a8f96418a9
6 changed files with 1282 additions and 1210 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,7 @@ wSPRTimeCS1:: ds 4
wSPRTimeCS2:: ds 4 wSPRTimeCS2:: ds 4
ENDU ENDU
wScratch: ds 2 wScratch: ds 2
wSpritePal: ds 1
SECTION "OAM DMA Code", ROM0 SECTION "OAM DMA Code", ROM0
@ -113,6 +114,24 @@ ClearOAM::
SECTION "Domain Specific Functions", ROM0 SECTION "Domain Specific Functions", ROM0
SetPal::
ldh a, [hCurrentIntegerGravity]
cp a, 20
jr nz, .darker
ld hl, hFrameCtr
bit 4, [hl]
jr z, .lighter
.darker
ld a, OAMF_PAL0 | $07
ld [wSpritePal], a
ret
.lighter
ld a, OAMF_PAL1 | $07
ld [wSpritePal], a
ret
.setpal
; Puts the mode tells into sprites and displays them. ; Puts the mode tells into sprites and displays them.
ApplyTells:: ApplyTells::
ld a, TELLS_BASE_Y ld a, TELLS_BASE_Y
@ -485,7 +504,7 @@ ApplyTime::
ld [wSPRTimeCS2+1], a ld [wSPRTimeCS2+1], a
; Set the palette of the time objects. ; Set the palette of the time objects.
ld a, OAMF_PAL0 | $07 ld a, OAMF_PAL1 | $07
ld [wSPRTimeM1+3], a ld [wSPRTimeM1+3], a
ld [wSPRTimeM2+3], a ld [wSPRTimeM2+3], a
ld [wSPRTimeS1+3], a ld [wSPRTimeS1+3], a
@ -590,11 +609,6 @@ ApplyTime::
ld a, [de] ld a, [de]
add a, TILE_SMALL_0 add a, TILE_SMALL_0
ld [hl], a ld [hl], a
ret ret
@ -604,13 +618,15 @@ ApplyTime::
ApplyNumbers8:: ApplyNumbers8::
inc hl inc hl
inc hl inc hl
ld bc, 4 ld bc, 2
ld a, [de] ld a, [de]
or a, a or a, a
jr nz, .one jr nz, .one
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -618,7 +634,9 @@ ApplyNumbers8::
or a, a or a, a
jr nz, .two jr nz, .two
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -626,7 +644,9 @@ ApplyNumbers8::
or a, a or a, a
jr nz, .three jr nz, .three
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -634,7 +654,9 @@ ApplyNumbers8::
or a, a or a, a
jr nz, .four jr nz, .four
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -642,7 +664,9 @@ ApplyNumbers8::
or a, a or a, a
jr nz, .five jr nz, .five
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -650,7 +674,9 @@ ApplyNumbers8::
or a, a or a, a
jr nz, .six jr nz, .six
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -658,7 +684,9 @@ ApplyNumbers8::
or a, a or a, a
jr nz, .seven jr nz, .seven
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -667,56 +695,72 @@ ApplyNumbers8::
.one .one
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.two .two
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.three .three
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.four .four
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.five .five
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.six .six
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.seven .seven
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.eight .eight
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
ret ret
@ -726,13 +770,15 @@ ApplyNumbers8::
ApplyNumbers4:: ApplyNumbers4::
inc hl inc hl
inc hl inc hl
ld bc, 4 ld bc, 2
ld a, [de] ld a, [de]
or a, a or a, a
jr nz, .one jr nz, .one
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -740,7 +786,9 @@ ApplyNumbers4::
or a, a or a, a
jr nz, .two jr nz, .two
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -748,7 +796,9 @@ ApplyNumbers4::
or a, a or a, a
jr nz, .three jr nz, .three
ld a, TILE_BLANK ld a, TILE_BLANK
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
@ -757,27 +807,35 @@ ApplyNumbers4::
.one .one
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.two .two
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.three .three
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl], a ld [hl+], a
ld a, [wSpritePal]
ld [hl+], a
add hl, bc add hl, bc
inc de inc de
.four .four
ld a, [de] ld a, [de]
add a, TILE_0 add a, TILE_0
ld [hl+], a
ld a, [wSpritePal]
ld [hl], a ld [hl], a
ret ret
@ -795,7 +853,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -807,7 +865,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -819,7 +877,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -831,7 +889,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -843,7 +901,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -855,7 +913,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -867,7 +925,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -878,7 +936,7 @@ SetNumberSpritePositions::
ld [hl], a ld [hl], a
inc hl inc hl
inc hl inc hl
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ldh a, [rSCX] ldh a, [rSCX]
@ -892,7 +950,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -904,7 +962,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -916,7 +974,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -927,7 +985,7 @@ SetNumberSpritePositions::
ld [hl], a ld [hl], a
inc hl inc hl
inc hl inc hl
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ldh a, [rSCX] ldh a, [rSCX]
@ -941,7 +999,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -953,7 +1011,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -965,7 +1023,7 @@ SetNumberSpritePositions::
inc hl inc hl
inc hl inc hl
ld b, a ld b, a
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ld a, b ld a, b
add a, 8 add a, 8
@ -976,7 +1034,7 @@ SetNumberSpritePositions::
ld [hl], a ld [hl], a
inc hl inc hl
inc hl inc hl
ld a, OAMF_PAL1 | $07 ld a, [wSpritePal]
ld [hl], a ld [hl], a
ret ret
@ -1021,7 +1079,7 @@ GradeRendering::
ld a, [wSPRGrade1+3] ld a, [wSPRGrade1+3]
inc a inc a
and a, OAMF_PALMASK and a, OAMF_PALMASK
or a, OAMF_PAL1 or a, OAMF_PAL0
ld [wSPRGrade1+3], a ld [wSPRGrade1+3], a
ld [wSPRGrade2+3], a ld [wSPRGrade2+3], a
jr .drawgrade jr .drawgrade

View File

@ -772,6 +772,8 @@ GamePlayEventLoopHandlerB::
; Always draw the score, level, next piece, and held piece. ; Always draw the score, level, next piece, and held piece.
.drawStaticInfo .drawStaticInfo
call SetPal
ldh a, [hNextPiece] ldh a, [hNextPiece]
call ApplyNext call ApplyNext
@ -1583,6 +1585,8 @@ GamePlayBigEventLoopHandlerB:
; Always draw the score, level, next piece, and held piece. ; Always draw the score, level, next piece, and held piece.
.drawStaticInfo .drawStaticInfo
call SetPal
ldh a, [hNextPiece] ldh a, [hNextPiece]
call ApplyNext call ApplyNext