diff --git a/src/data/game_over/framesets.asm b/src/data/game_over/framesets.asm new file mode 100644 index 0000000..bd92043 --- /dev/null +++ b/src/data/game_over/framesets.asm @@ -0,0 +1,3 @@ +Frameset_dbbf5: + db $00, 4 + db $ff diff --git a/src/data/game_over/oam.asm b/src/data/game_over/oam.asm new file mode 100644 index 0000000..04a7aaf --- /dev/null +++ b/src/data/game_over/oam.asm @@ -0,0 +1,13 @@ +OAM_dbbd2: + dw .frame_0 + +.frame_0 + frame_oam 0, 0, $80, 2 + frame_oam 0, 9, $82, 2 + frame_oam 0, 24, $84, 2 + frame_oam 0, 56, $86, 2 + frame_oam 0, 104, $88, 2 + frame_oam 32, 0, $8a, 2 + frame_oam 32, 56, $8c, 2 + frame_oam 32, 72, $8e, 2 + db $80 diff --git a/src/data/game_over/palettes.asm b/src/data/game_over/palettes.asm new file mode 100644 index 0000000..c3e1fb1 --- /dev/null +++ b/src/data/game_over/palettes.asm @@ -0,0 +1,81 @@ +Pals_db509: + rgb 0, 0, 0 + rgb 31, 31, 31 + rgb 31, 3, 0 + rgb 10, 0, 24 + + rgb 0, 0, 0 + rgb 31, 31, 31 + rgb 28, 28, 0 + rgb 19, 11, 0 + + rgb 0, 0, 0 + rgb 31, 31, 31 + rgb 28, 28, 0 + rgb 31, 3, 0 + + rgb 0, 0, 0 + rgb 19, 11, 0 + rgb 31, 3, 0 + rgb 10, 0, 24 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + +Pals_db549: + rgb 0, 22, 16 + rgb 31, 31, 31 + rgb 31, 15, 10 + rgb 0, 0, 0 + + rgb 0, 22, 16 + rgb 30, 0, 3 + rgb 31, 30, 12 + rgb 6, 5, 26 + + rgb 0, 22, 16 + rgb 31, 31, 31 + rgb 28, 31, 0 + rgb 22, 8, 0 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 diff --git a/src/data/perfect/framesets.asm b/src/data/perfect/framesets.asm new file mode 100644 index 0000000..36dafd1 --- /dev/null +++ b/src/data/perfect/framesets.asm @@ -0,0 +1,10 @@ +Frameset_dd848: + db $00, 4 + db $01, 4 + db $02, 4 + db $03, 4 + db $04, 4 + db $05, 4 + db $06, 4 + db $07, 4 + db $ff diff --git a/src/data/perfect/oam.asm b/src/data/perfect/oam.asm new file mode 100644 index 0000000..b3805aa --- /dev/null +++ b/src/data/perfect/oam.asm @@ -0,0 +1,105 @@ +OAM_dd710: + dw .frame_0 + dw .frame_1 + dw .frame_2 + dw .frame_3 + dw .frame_4 + dw .frame_5 + dw .frame_6 + dw .frame_7 + +.frame_0 + frame_oam -4, -43, $00, 1 + frame_oam -4, -35, $02, 1 + frame_oam -4, -27, $04, 1 + frame_oam 12, -37, $06, 1 + frame_oam 12, -29, $08, 1 + frame_oam 12, 93, $42, 1 + frame_oam 2, 101, $44, 1 + frame_oam -4, 109, $46, 1 + db $80 + +.frame_1 + frame_oam -14, -18, $0a, 0 + frame_oam -14, -10, $0c, 0 + frame_oam 2, -14, $0e, 0 + frame_oam 2, -6, $10, 0 + frame_oam -4, -43, $00, 1 + frame_oam -4, -35, $02, 1 + frame_oam -4, -27, $04, 1 + frame_oam 12, -37, $06, 1 + frame_oam 12, -29, $08, 1 + db $80 + +.frame_2 + frame_oam -20, 3, $12, 0 + frame_oam -20, 11, $14, 0 + frame_oam -20, 19, $16, 0 + frame_oam -4, 3, $18, 0 + frame_oam -4, 11, $1a, 0 + frame_oam -4, 19, $1c, 0 + frame_oam -14, -18, $0a, 2 + frame_oam -14, -10, $0c, 2 + frame_oam 2, -14, $0e, 2 + frame_oam 2, -6, $10, 2 + db $80 + +.frame_3 + frame_oam -20, 28, $1e, 0 + frame_oam -20, 36, $20, 0 + frame_oam -4, 28, $22, 0 + frame_oam -4, 36, $24, 0 + frame_oam -20, 3, $12, 5 + frame_oam -20, 11, $14, 5 + frame_oam -20, 19, $16, 5 + frame_oam -4, 3, $18, 5 + frame_oam -4, 11, $1a, 5 + frame_oam -4, 19, $1c, 5 + db $80 + +.frame_4 + frame_oam -20, 45, $26, 0 + frame_oam -20, 53, $28, 0 + frame_oam -4, 45, $2a, 0 + frame_oam -4, 53, $2c, 0 + frame_oam -20, 28, $1e, 3 + frame_oam -20, 36, $20, 3 + frame_oam -4, 28, $22, 3 + frame_oam -4, 36, $24, 3 + db $80 + +.frame_5 + frame_oam -15, 61, $2e, 0 + frame_oam -15, 69, $30, 0 + frame_oam -15, 77, $32, 0 + frame_oam 1, 62, $34, 0 + frame_oam 1, 70, $36, 0 + frame_oam -20, 45, $26, 4 + frame_oam -20, 53, $28, 4 + frame_oam -4, 45, $2a, 4 + frame_oam -4, 53, $2c, 4 + db $80 + +.frame_6 + frame_oam -12, 83, $38, 0 + frame_oam -12, 91, $3a, 0 + frame_oam -12, 99, $3c, 0 + frame_oam 4, 83, $3e, 0 + frame_oam 4, 91, $40, 0 + frame_oam -15, 61, $2e, 5 + frame_oam -15, 69, $30, 5 + frame_oam -15, 77, $32, 5 + frame_oam 1, 62, $34, 5 + frame_oam 1, 70, $36, 5 + db $80 + +.frame_7 + frame_oam 12, 93, $42, 1 + frame_oam 2, 101, $44, 1 + frame_oam -4, 109, $46, 1 + frame_oam -12, 83, $38, 2 + frame_oam -12, 91, $3a, 2 + frame_oam -12, 99, $3c, 2 + frame_oam 4, 83, $3e, 2 + frame_oam 4, 91, $40, 2 + db $80 diff --git a/src/data/perfect/palettes.asm b/src/data/perfect/palettes.asm new file mode 100644 index 0000000..81924c7 --- /dev/null +++ b/src/data/perfect/palettes.asm @@ -0,0 +1,129 @@ +Pals_dc173: + rgb 0, 0, 0 + rgb 31, 31, 31 + rgb 31, 26, 2 + rgb 17, 0, 25 + + rgb 0, 0, 0 + rgb 31, 31, 31 + rgb 31, 26, 2 + rgb 31, 15, 12 + + rgb 0, 0, 0 + rgb 31, 31, 31 + rgb 31, 26, 2 + rgb 8, 16, 31 + + rgb 0, 0, 0 + rgb 31, 31, 31 + rgb 31, 8, 15 + rgb 21, 0, 11 + + rgb 0, 0, 0 + rgb 31, 26, 2 + rgb 31, 15, 12 + rgb 17, 0, 0 + + rgb 0, 0, 0 + rgb 29, 22, 0 + rgb 26, 4, 0 + rgb 13, 0, 0 + + rgb 0, 0, 0 + rgb 11, 31, 0 + rgb 29, 13, 21 + rgb 17, 0, 13 + + rgb 0, 0, 0 + rgb 11, 31, 0 + rgb 0, 14, 31 + rgb 0, 6, 17 + +Pals_dc1b3: + rgb 0, 0, 0 + rgb 14, 27, 14 + rgb 0, 22, 0 + rgb 1, 13, 1 + + rgb 0, 0, 0 + rgb 14, 27, 14 + rgb 0, 22, 0 + rgb 1, 13, 1 + + rgb 0, 0, 0 + rgb 14, 27, 14 + rgb 0, 22, 0 + rgb 1, 13, 1 + +Pals_dc1cb: + rgb 0, 0, 0 + rgb 0, 27, 27 + rgb 0, 18, 28 + rgb 0, 6, 26 + + rgb 0, 0, 0 + rgb 0, 27, 27 + rgb 0, 18, 28 + rgb 0, 6, 26 + + rgb 0, 0, 0 + rgb 0, 27, 27 + rgb 0, 18, 28 + rgb 0, 6, 26 + +Pals_dc1e3: + rgb 0, 0, 0 + rgb 27, 17, 26 + rgb 26, 0, 24 + rgb 15, 0, 25 + + rgb 0, 0, 0 + rgb 27, 17, 26 + rgb 26, 0, 24 + rgb 15, 0, 25 + + rgb 0, 0, 0 + rgb 27, 17, 26 + rgb 26, 0, 24 + rgb 15, 0, 25 + +Pals_dc1fb: + rgb 0, 0, 0 + rgb 31, 31, 31 + rgb 23, 23, 23 + rgb 14, 14, 14 + + rgb 0, 0, 0 + rgb 30, 11, 24 + rgb 24, 6, 13 + rgb 18, 5, 2 + + rgb 0, 0, 0 + rgb 31, 29, 17 + rgb 31, 23, 12 + rgb 21, 14, 0 + + rgb 0, 0, 0 + rgb 18, 31, 18 + rgb 0, 27, 2 + rgb 6, 20, 6 + + rgb 0, 0, 0 + rgb 2, 31, 31 + rgb 0, 21, 31 + rgb 4, 11, 31 + + rgb 0, 0, 0 + rgb 31, 20, 26 + rgb 24, 13, 19 + rgb 21, 8, 15 + + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + rgb 0, 0, 0 + + rgb 0, 0, 0 + rgb 31, 27, 0 + rgb 31, 0, 29 + rgb 19, 0, 29 diff --git a/src/engine/bank21.asm b/src/engine/bank21.asm index 8aa227d..ebbffa1 100644 --- a/src/engine/bank21.asm +++ b/src/engine/bank21.asm @@ -4053,7 +4053,7 @@ Pals_86acd: rgb 31, 11, 8 rgb 7, 2, 20 -Pals_86ad5: +Pals_86ad5:: rgb 0, 0, 0 rgb 31, 31, 31 rgb 31, 15, 10 diff --git a/src/engine/bank36.asm b/src/engine/bank36.asm deleted file mode 100644 index 5c63515..0000000 --- a/src/engine/bank36.asm +++ /dev/null @@ -1,494 +0,0 @@ -HiddenFigure1Gfx:: -INCBIN "gfx/enemies/hidden_figure1.2bpp" - -HiddenFigure2Gfx:: -INCBIN "gfx/enemies/hidden_figure2.2bpp" - -Pals_db000: - rgb 1, 4, 9 - rgb 31, 0, 0 - rgb 6, 10, 10 - rgb 0, 0, 0 - - rgb 31, 31, 31 - rgb 0, 30, 31 - rgb 6, 10, 10 - rgb 0, 0, 0 - - rgb 1, 4, 9 - rgb 0, 31, 18 - rgb 6, 10, 10 - rgb 0, 0, 0 - - rgb 1, 4, 9 - rgb 28, 20, 6 - rgb 6, 10, 10 - rgb 0, 0, 0 - - rgb 1, 4, 9 - rgb 0, 11, 21 - rgb 31, 25, 0 - rgb 0, 0, 0 - - rgb 1, 4, 9 - rgb 15, 0, 0 - rgb 31, 25, 0 - rgb 0, 0, 0 - - rgb 31, 19, 23 - rgb 21, 8, 17 - rgb 12, 2, 6 - rgb 0, 0, 0 - - rgb 27, 23, 11 - rgb 22, 13, 2 - rgb 13, 6, 1 - rgb 5, 2, 0 - -Pals_db040: - rgb 21, 21, 21 - rgb 31, 31, 31 - rgb 31, 0, 0 - rgb 0, 0, 0 - - rgb 21, 21, 21 - rgb 4, 24, 12 - rgb 4, 11, 12 - rgb 0, 0, 0 - - rgb 21, 21, 21 - rgb 15, 0, 0 - rgb 31, 25, 0 - rgb 0, 0, 0 - - rgb 21, 21, 21 - rgb 25, 10, 0 - rgb 31, 25, 0 - rgb 0, 0, 0 - - rgb 21, 21, 21 - rgb 0, 21, 31 - rgb 31, 25, 0 - rgb 0, 0, 0 - -HiddenFigure1Map:: -INCBIN "gfx/bgmaps/hidden_figure1.bin" - -HiddenFigure2Map:: -INCBIN "gfx/bgmaps/hidden_figure2.bin" - -HiddenFigure3Map:: -INCBIN "gfx/bgmaps/hidden_figure3.bin" - -HiddenFigure4Map:: -INCBIN "gfx/bgmaps/hidden_figure4.bin" - -_GameOverStateTable:: - ld a, [wSubState] - jumptable - - dw FastFadeToWhite - dw Func_db29b - dw SlowFadeFromWhite - dw Func_db317 - dw Func_db3e4 - dw FastFadeToWhite - dw Func_db41b - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - -Func_db29b: - call DisableLCD - call FillBGMap0_With7f - call ClearVirtualOAM - - call LoadGameOverPals - call LoadGameOverGfx - call Func_db4cf - call VBlank_GameOver - - xor a - ldh [rSCX], a - ld [wSCX], a - ld a, $60 - ldh [rSCY], a - ld [wSCY], a - - ld hl, wGameOverWario - ld a, $80 - ld [hli], a ; y - ld a, $50 - ld [hli], a ; x - xor a - ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a - ld [wGameOverWarioVar], a - ld [wSFXTimer], a - ld a, HIGH(Frameset_aaccb) - ld [hli], a ; frameset pointer - ld a, LOW(Frameset_aaccb) - ld [hl], a - farcall BANK(Frameset_aaccb), UpdateObjAnim - ld hl, wGameOverWario - call Func_17be - - ld hl, wMenuObj1 - ld a, $18 - ld [hli], a ; y - ld a, $18 - ld [hli], a ; x - xor a - ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a - ld a, HIGH(Frameset_dbbf5) - ld [hli], a ; frameset pointer - ld a, LOW(Frameset_dbbf5) - ld [hl], a - call UpdateObjAnim - ld hl, wMenuObj1 - call Func_db4e9 - - ld a, LCDC_DEFAULT - ldh [rLCDC], a - ld a, 64 - ld [wTimer], a - ld hl, wSubState - inc [hl] - ret - -Func_db317: - ld a, [wGameOverWarioVar] - dec a - jr z, .asm_db338 - dec a - jr z, .asm_db35b - dec a - jr z, .asm_db38a - ld hl, wTimer - dec [hl] - jp nz, .asm_db3a9 - - play_sfx SFX_134 - ld hl, wGameOverWarioVar - inc [hl] - jr .asm_db3a9 - -.asm_db338 - ld hl, wSCY - dec [hl] - dec [hl] - dec [hl] - jr nz, .asm_db3a9 - play_sfx SFX_061 - play_music MUSIC_GOLF_GAME_OVER - ld a, 6 - ld [wTimer], a - ld hl, wGameOverWarioVar - inc [hl] - jr .asm_db3a9 - -.asm_db35b - ld a, [wGlobalCounter] - and %11 - ret nz - ld hl, wTimer - dec [hl] - ld a, [hl] - and $01 - jr z, .asm_db371 - ld hl, wSCY - inc [hl] - inc [hl] - jr .asm_db3a9 -.asm_db371 - ld hl, wSCY - dec [hl] - dec [hl] - ld a, [wTimer] - and a - jr nz, .asm_db3a9 - play_music MUSIC_GAME_OVER - ld hl, wGameOverWarioVar - inc [hl] - jr .asm_db3a9 - -.asm_db38a - ld a, [wJoypadPressed] - bit A_BUTTON_F, a - jr z, .asm_db3a9 - play_sfx SFX_SELECTION - ld hl, wGameOverWarioFramesetOffset - xor a - ld [hli], a - ld [hli], a ; duration - ld a, HIGH(Frameset_aace2) - ld [hli], a ; frameset pointer - ld a, LOW(Frameset_aace2) - ld [hl], a - ld hl, wSubState - inc [hl] -.asm_db3a9 - ld hl, wGameOverWarioFramesetPtr + 1 - farcall BANK(Frameset_aace2), UpdateObjAnim - - ld a, [wObjAnimWasReset] - ld [wGameOverWarioAnimationEnded], a - and a - call nz, .Func_db3db - ld hl, wGameOverWario - call Func_17be - ld hl, wMenuObj1FramesetPtr + 1 - call UpdateObjAnim - ld hl, wMenuObj1 - call Func_db4e9 - call ClearUnusedVirtualOAM - ret - -.Func_db3db - play_sfx SFX_0F5 - ret - -Func_db3e4: - ld hl, wGameOverWarioFramesetPtr + 1 - farcall BANK(Frameset_aaccb), UpdateObjAnim - - ld a, [wObjAnimWasReset] - ld [wGameOverWarioAnimationEnded], a - ld hl, wGameOverWario - call Func_17be - ld hl, wMenuObj1FramesetPtr + 1 - call UpdateObjAnim - ld hl, wMenuObj1 - call Func_db4e9 - call ClearUnusedVirtualOAM - ld a, [wGameOverWarioAnimationEnded] - and a - ret z - ld hl, wSubState - inc [hl] - ret - -Func_db41b: - jp Init - -LoadHiddenFigureGfx:: - call .LoadPals - call .LoadTiles - call .LoadMap - ret - -.LoadPals - ld hl, Pals_db000 - call LoadPalsToTempPals1 - ld hl, Pals_db040 - ld de, wTempPals2 + palette 3 - ld b, 5 palettes - call CopyHLToDE_Short - ret - -.LoadTiles - ld a, BANK("VRAM1") - ldh [rVBK], a - ld hl, HiddenFigure2Gfx - ld de, v1Tiles0 - ld bc, $180 tiles - call CopyHLToDE_BC - - xor a ; VRAM0 - ldh [rVBK], a - ld hl, HiddenFigure1Gfx - ld de, v0Tiles0 - ld bc, $180 tiles - call CopyHLToDE_BC - ret - -.LoadMap - ld a, BANK("VRAM1") - ldh [rVBK], a - ld hl, HiddenFigure2Map - ld bc, v1BGMap0 - call Decompress - ld hl, HiddenFigure4Map - ld bc, v1BGMap1 - call Decompress - - xor a ; VRAM0 - ldh [rVBK], a - ld hl, HiddenFigure1Map - ld bc, v0BGMap0 - call Decompress - ld hl, HiddenFigure3Map - ld bc, v0BGMap1 - call Decompress - ret - -LoadGameOverPals: - ld hl, Pals_db509 - call LoadPalsToTempPals1 - ld hl, Pals_db549 - call LoadPalsToTempPals2 - - ld hl, Pals_86ad5 - ld de, wTempPals2 palette 0 - ld b, 1 palettes - farcall BANK(Pals_86ad5), CopyHLToDE_Short - ret - -LoadGameOverGfx: - xor a - ldh [rVBK], a - ld hl, GameOverGfx - ld bc, v0Tiles0 - call Decompress - ld hl, WarioSleepGfx - ld de, v0Tiles0 - ld bc, $80 tiles - farcall BANK(WarioSleepGfx), CopyHLToDE_BC - ret - -Func_db4cf: - ld a, BANK("VRAM1") - ldh [rVBK], a - ld hl, BGMap_dbb8f - ld bc, v0BGMap0 - call Decompress - xor a - ldh [rVBK], a - ld hl, BGMap_dbaee - ld bc, v0BGMap0 - call Decompress - ret - -Func_db4e9: - ld a, [wSCY] - ld b, a - ld a, [hli] - add OAM_Y_OFS - sub b - ld [wCurSpriteYCoord], a - ld a, [hli] - add OAM_X_OFS - ld [wCurSpriteXCoord], a - ld a, [hli] - ld [wCurSpriteFrame], a - ld a, [hl] - ld [wCurSpriteAttributes], a - ld hl, OAM_dbbd2 - call AddSprite - ret - -Pals_db509: - rgb 0, 0, 0 - rgb 31, 31, 31 - rgb 31, 3, 0 - rgb 10, 0, 24 - - rgb 0, 0, 0 - rgb 31, 31, 31 - rgb 28, 28, 0 - rgb 19, 11, 0 - - rgb 0, 0, 0 - rgb 31, 31, 31 - rgb 28, 28, 0 - rgb 31, 3, 0 - - rgb 0, 0, 0 - rgb 19, 11, 0 - rgb 31, 3, 0 - rgb 10, 0, 24 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - -Pals_db549: - rgb 0, 22, 16 - rgb 31, 31, 31 - rgb 31, 15, 10 - rgb 0, 0, 0 - - rgb 0, 22, 16 - rgb 30, 0, 3 - rgb 31, 30, 12 - rgb 6, 5, 26 - - rgb 0, 22, 16 - rgb 31, 31, 31 - rgb 28, 31, 0 - rgb 22, 8, 0 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - -GameOverGfx: INCBIN "gfx/game_over.2bpp.rle" - -BGMap_dbaee: INCBIN "gfx/bgmaps/map_dbaee.bin" -BGMap_dbb8f: INCBIN "gfx/bgmaps/map_dbb8f.bin" - -OAM_dbbd2: - dw .frame_0 - -.frame_0 - frame_oam 0, 0, $80, 2 - frame_oam 0, 9, $82, 2 - frame_oam 0, 24, $84, 2 - frame_oam 0, 56, $86, 2 - frame_oam 0, 104, $88, 2 - frame_oam 32, 0, $8a, 2 - frame_oam 32, 56, $8c, 2 - frame_oam 32, 72, $8e, 2 - db $80 - -Frameset_dbbf5: - db $00, 4 - db $ff diff --git a/src/engine/bank37.asm b/src/engine/bank37.asm deleted file mode 100644 index 32a30b6..0000000 --- a/src/engine/bank37.asm +++ /dev/null @@ -1,455 +0,0 @@ -_PerfectStateTable: - ld a, [wSubState] - jumptable - - dw SlowFadeBGToWhite - dw Func_dc01e - dw DarkenBGToPal_Fast - dw Func_dc073 - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - dw DebugReset - -Func_dc01e: - call DisableLCD - call FillBGMap0_With7f - call ClearVirtualOAM - - call LoadPerfectPals - call LoadPerfectGfx - call Func_dc13e - call VBlank_Perfect - - xor a - ldh [rSCX], a - ld [wSCX], a - ldh [rSCY], a - ld [wSCY], a - - ld hl, wMenuObj1 - ld a, $23 - ld [hli], a - ld a, $2b - ld [hli], a - xor a - ld [hli], a - ld [hli], a - ld [hli], a - ld [hli], a - ld a, HIGH(Frameset_dd848) - ld [hli], a - ld a, LOW(Frameset_dd848) - ld [hl], a - call UpdateObjAnim - - ld hl, wMenuObj1 - call Func_dc158 - - play_music MUSIC_PERFECT - - ld a, LCDC_DEFAULT - ldh [rLCDC], a - xor a - ld [wTimer], a - ld [wGameOverWarioVar], a - ld hl, wSubState - inc [hl] - ret - -Func_dc073: - ld hl, wMenuObj1FramesetPtr + 1 - call UpdateObjAnim - ld hl, wMenuObj1 - call Func_dc158 - call ClearUnusedVirtualOAM - ld hl, wTimer - ld a, [hl] - and a - jr z, .asm_dc08c - dec [hl] - jr nz, .asm_dc0cf -.asm_dc08c - ld a, [wGlobalCounter] - and %111 - jr nz, .asm_dc0cf - call SlowFadeInScreen - ld a, [wSubState] - cp $03 - jr z, .asm_dc0cf - ld a, $03 - ld [wSubState], a - ld hl, wGameOverWarioVar - inc [hl] - ld a, [hl] - dec a - jr z, .asm_dc0bd - dec a - jr z, .asm_dc0c7 - dec a - jr z, .asm_dc0cc - dec a - jr z, .asm_dc0c7 - dec a - jr z, .asm_dc0c2 - ld [hl], $00 - call Func_dc101 - jr .asm_dc0cf -.asm_dc0bd - ld a, 240 - ld [wTimer], a -.asm_dc0c2 - call Func_dc10d - jr .asm_dc0cf -.asm_dc0c7 - call Func_dc119 - jr .asm_dc0cf -.asm_dc0cc - call Func_dc125 - -.asm_dc0cf - ld a, [wGameModeFlags] - bit MODE_TIME_ATTACK_F, a - ret nz - ld a, [wJoypadPressed] - and a - ret z - xor a - ld [wFadeSpeed], a - ld [wPalFadeCounter], a - ld [wUnused_c186], a - ld hl, wGameModeFlags - set MODE_TIME_ATTACK_F, [hl] - ld a, ST_PAUSE_MENU - ld [wState], a - ld a, SST_PAUSE_28 - ld [wSubState], a - ret - -LoadPerfectPals: - ld hl, Pals_dc173 - call LoadPalsToTempPals1 - ld hl, Pals_dc1fb - call LoadPalsToTempPals2 - ret - -Func_dc101: - ld hl, Pals_dc173 palette 5 - ld de, wTempPals1 palette 5 - ld b, 3 palettes - call CopyHLToDE_Short - ret - -Func_dc10d: - ld hl, Pals_dc1b3 - ld de, wTempPals1 palette 5 - ld b, 3 palettes - call CopyHLToDE_Short - ret - -Func_dc119: - ld hl, Pals_dc1cb - ld de, wTempPals1 palette 5 - ld b, 3 palettes - call CopyHLToDE_Short - ret - -Func_dc125: - ld hl, Pals_dc1e3 - ld de, wTempPals1 palette 5 - ld b, 3 palettes - call CopyHLToDE_Short - ret - -LoadPerfectGfx: - xor a - ldh [rVBK], a - ld hl, PerfectGfx - ld bc, v0Tiles0 - call Decompress - ret - -Func_dc13e: - ld a, BANK("VRAM1") - ldh [rVBK], a - ld hl, BGMap_dd5b5 - ld bc, v0BGMap0 - call Decompress - xor a - ldh [rVBK], a - ld hl, BGMap_dd417 - ld bc, v0BGMap0 - call Decompress - ret - -Func_dc158: - ld a, [hli] - add OAM_Y_OFS - ld [wCurSpriteYCoord], a - ld a, [hli] - add OAM_X_OFS - ld [wCurSpriteXCoord], a - ld a, [hli] - ld [wCurSpriteFrame], a - ld a, [hl] - ld [wCurSpriteAttributes], a - ld hl, OAM_dd710 - call AddSprite - ret - -Pals_dc173: - rgb 0, 0, 0 - rgb 31, 31, 31 - rgb 31, 26, 2 - rgb 17, 0, 25 - - rgb 0, 0, 0 - rgb 31, 31, 31 - rgb 31, 26, 2 - rgb 31, 15, 12 - - rgb 0, 0, 0 - rgb 31, 31, 31 - rgb 31, 26, 2 - rgb 8, 16, 31 - - rgb 0, 0, 0 - rgb 31, 31, 31 - rgb 31, 8, 15 - rgb 21, 0, 11 - - rgb 0, 0, 0 - rgb 31, 26, 2 - rgb 31, 15, 12 - rgb 17, 0, 0 - - rgb 0, 0, 0 - rgb 29, 22, 0 - rgb 26, 4, 0 - rgb 13, 0, 0 - - rgb 0, 0, 0 - rgb 11, 31, 0 - rgb 29, 13, 21 - rgb 17, 0, 13 - - rgb 0, 0, 0 - rgb 11, 31, 0 - rgb 0, 14, 31 - rgb 0, 6, 17 - -Pals_dc1b3: - rgb 0, 0, 0 - rgb 14, 27, 14 - rgb 0, 22, 0 - rgb 1, 13, 1 - - rgb 0, 0, 0 - rgb 14, 27, 14 - rgb 0, 22, 0 - rgb 1, 13, 1 - - rgb 0, 0, 0 - rgb 14, 27, 14 - rgb 0, 22, 0 - rgb 1, 13, 1 - -Pals_dc1cb: - rgb 0, 0, 0 - rgb 0, 27, 27 - rgb 0, 18, 28 - rgb 0, 6, 26 - - rgb 0, 0, 0 - rgb 0, 27, 27 - rgb 0, 18, 28 - rgb 0, 6, 26 - - rgb 0, 0, 0 - rgb 0, 27, 27 - rgb 0, 18, 28 - rgb 0, 6, 26 - -Pals_dc1e3: - rgb 0, 0, 0 - rgb 27, 17, 26 - rgb 26, 0, 24 - rgb 15, 0, 25 - - rgb 0, 0, 0 - rgb 27, 17, 26 - rgb 26, 0, 24 - rgb 15, 0, 25 - - rgb 0, 0, 0 - rgb 27, 17, 26 - rgb 26, 0, 24 - rgb 15, 0, 25 - -Pals_dc1fb: - rgb 0, 0, 0 - rgb 31, 31, 31 - rgb 23, 23, 23 - rgb 14, 14, 14 - - rgb 0, 0, 0 - rgb 30, 11, 24 - rgb 24, 6, 13 - rgb 18, 5, 2 - - rgb 0, 0, 0 - rgb 31, 29, 17 - rgb 31, 23, 12 - rgb 21, 14, 0 - - rgb 0, 0, 0 - rgb 18, 31, 18 - rgb 0, 27, 2 - rgb 6, 20, 6 - - rgb 0, 0, 0 - rgb 2, 31, 31 - rgb 0, 21, 31 - rgb 4, 11, 31 - - rgb 0, 0, 0 - rgb 31, 20, 26 - rgb 24, 13, 19 - rgb 21, 8, 15 - - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - rgb 0, 0, 0 - - rgb 0, 0, 0 - rgb 31, 27, 0 - rgb 31, 0, 29 - rgb 19, 0, 29 - -PerfectGfx: INCBIN "gfx/perfect.2bpp.rle" - -BGMap_dd417: INCBIN "gfx/bgmaps/map_dd417.bin" -BGMap_dd5b5: INCBIN "gfx/bgmaps/map_dd5b5.bin" - -OAM_dd710: - dw .frame_0 - dw .frame_1 - dw .frame_2 - dw .frame_3 - dw .frame_4 - dw .frame_5 - dw .frame_6 - dw .frame_7 - -.frame_0 - frame_oam -4, -43, $00, 1 - frame_oam -4, -35, $02, 1 - frame_oam -4, -27, $04, 1 - frame_oam 12, -37, $06, 1 - frame_oam 12, -29, $08, 1 - frame_oam 12, 93, $42, 1 - frame_oam 2, 101, $44, 1 - frame_oam -4, 109, $46, 1 - db $80 - -.frame_1 - frame_oam -14, -18, $0a, 0 - frame_oam -14, -10, $0c, 0 - frame_oam 2, -14, $0e, 0 - frame_oam 2, -6, $10, 0 - frame_oam -4, -43, $00, 1 - frame_oam -4, -35, $02, 1 - frame_oam -4, -27, $04, 1 - frame_oam 12, -37, $06, 1 - frame_oam 12, -29, $08, 1 - db $80 - -.frame_2 - frame_oam -20, 3, $12, 0 - frame_oam -20, 11, $14, 0 - frame_oam -20, 19, $16, 0 - frame_oam -4, 3, $18, 0 - frame_oam -4, 11, $1a, 0 - frame_oam -4, 19, $1c, 0 - frame_oam -14, -18, $0a, 2 - frame_oam -14, -10, $0c, 2 - frame_oam 2, -14, $0e, 2 - frame_oam 2, -6, $10, 2 - db $80 - -.frame_3 - frame_oam -20, 28, $1e, 0 - frame_oam -20, 36, $20, 0 - frame_oam -4, 28, $22, 0 - frame_oam -4, 36, $24, 0 - frame_oam -20, 3, $12, 5 - frame_oam -20, 11, $14, 5 - frame_oam -20, 19, $16, 5 - frame_oam -4, 3, $18, 5 - frame_oam -4, 11, $1a, 5 - frame_oam -4, 19, $1c, 5 - db $80 - -.frame_4 - frame_oam -20, 45, $26, 0 - frame_oam -20, 53, $28, 0 - frame_oam -4, 45, $2a, 0 - frame_oam -4, 53, $2c, 0 - frame_oam -20, 28, $1e, 3 - frame_oam -20, 36, $20, 3 - frame_oam -4, 28, $22, 3 - frame_oam -4, 36, $24, 3 - db $80 - -.frame_5 - frame_oam -15, 61, $2e, 0 - frame_oam -15, 69, $30, 0 - frame_oam -15, 77, $32, 0 - frame_oam 1, 62, $34, 0 - frame_oam 1, 70, $36, 0 - frame_oam -20, 45, $26, 4 - frame_oam -20, 53, $28, 4 - frame_oam -4, 45, $2a, 4 - frame_oam -4, 53, $2c, 4 - db $80 - -.frame_6 - frame_oam -12, 83, $38, 0 - frame_oam -12, 91, $3a, 0 - frame_oam -12, 99, $3c, 0 - frame_oam 4, 83, $3e, 0 - frame_oam 4, 91, $40, 0 - frame_oam -15, 61, $2e, 5 - frame_oam -15, 69, $30, 5 - frame_oam -15, 77, $32, 5 - frame_oam 1, 62, $34, 5 - frame_oam 1, 70, $36, 5 - db $80 - -.frame_7 - frame_oam 12, 93, $42, 1 - frame_oam 2, 101, $44, 1 - frame_oam -4, 109, $46, 1 - frame_oam -12, 83, $38, 2 - frame_oam -12, 91, $3a, 2 - frame_oam -12, 99, $3c, 2 - frame_oam 4, 83, $3e, 2 - frame_oam 4, 91, $40, 2 - db $80 - -Frameset_dd848: - db $00, 4 - db $01, 4 - db $02, 4 - db $03, 4 - db $04, 4 - db $05, 4 - db $06, 4 - db $07, 4 - db $ff diff --git a/src/engine/bank78.asm b/src/engine/bank78.asm index 5c3b446..bd1a56c 100644 --- a/src/engine/bank78.asm +++ b/src/engine/bank78.asm @@ -60,7 +60,7 @@ Func_1e005f: ld bc, v0BGMap0 call Decompress - call .GeResult + call .GetResult ld a, [wLevel] srl a srl a @@ -163,7 +163,7 @@ Func_1e005f: ld [hl], a ret -.GeResult: +.GetResult: xor a ; TIME_ATTACK_NOT_COMPLETED ld [wTimeAttackResult], a ld a, [wKeyAndTreasureFlags] diff --git a/src/engine/game_over/core.asm b/src/engine/game_over/core.asm new file mode 100644 index 0000000..dea6b79 --- /dev/null +++ b/src/engine/game_over/core.asm @@ -0,0 +1,177 @@ +InitGameOverScreen: + call DisableLCD + call FillBGMap0_With7f + call ClearVirtualOAM + + call LoadGameOverPals + call LoadGameOverGfx + call Func_db4cf + call VBlank_GameOver + + xor a + ldh [rSCX], a + ld [wSCX], a + ld a, $60 + ldh [rSCY], a + ld [wSCY], a + + ld hl, wGameOverWario + ld a, $80 + ld [hli], a ; y + ld a, $50 + ld [hli], a ; x + xor a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [wGameOverWarioVar], a + ld [wSFXTimer], a + ld a, HIGH(Frameset_aaccb) + ld [hli], a ; frameset pointer + ld a, LOW(Frameset_aaccb) + ld [hl], a + farcall BANK(Frameset_aaccb), UpdateObjAnim + ld hl, wGameOverWario + call Func_17be + + ld hl, wMenuObj1 + ld a, $18 + ld [hli], a ; y + ld a, $18 + ld [hli], a ; x + xor a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld a, HIGH(Frameset_dbbf5) + ld [hli], a ; frameset pointer + ld a, LOW(Frameset_dbbf5) + ld [hl], a + call UpdateObjAnim + ld hl, wMenuObj1 + call Func_db4e9 + + ld a, LCDC_DEFAULT + ldh [rLCDC], a + ld a, 64 + ld [wTimer], a + ld hl, wSubState + inc [hl] + ret + +UpdateGameOverScreen: + ld a, [wGameOverWarioVar] + dec a + jr z, .asm_db338 + dec a + jr z, .asm_db35b + dec a + jr z, .asm_db38a + ld hl, wTimer + dec [hl] + jp nz, .asm_db3a9 + + play_sfx SFX_134 + ld hl, wGameOverWarioVar + inc [hl] + jr .asm_db3a9 + +.asm_db338 + ld hl, wSCY + dec [hl] + dec [hl] + dec [hl] + jr nz, .asm_db3a9 + play_sfx SFX_061 + play_music MUSIC_GOLF_GAME_OVER + ld a, 6 + ld [wTimer], a + ld hl, wGameOverWarioVar + inc [hl] + jr .asm_db3a9 + +.asm_db35b + ld a, [wGlobalCounter] + and %11 + ret nz + ld hl, wTimer + dec [hl] + ld a, [hl] + and $01 + jr z, .asm_db371 + ld hl, wSCY + inc [hl] + inc [hl] + jr .asm_db3a9 +.asm_db371 + ld hl, wSCY + dec [hl] + dec [hl] + ld a, [wTimer] + and a + jr nz, .asm_db3a9 + play_music MUSIC_GAME_OVER + ld hl, wGameOverWarioVar + inc [hl] + jr .asm_db3a9 + +.asm_db38a + ld a, [wJoypadPressed] + bit A_BUTTON_F, a + jr z, .asm_db3a9 + play_sfx SFX_SELECTION + ld hl, wGameOverWarioFramesetOffset + xor a + ld [hli], a + ld [hli], a ; duration + ld a, HIGH(Frameset_aace2) + ld [hli], a ; frameset pointer + ld a, LOW(Frameset_aace2) + ld [hl], a + ld hl, wSubState + inc [hl] +.asm_db3a9 + ld hl, wGameOverWarioFramesetPtr + 1 + farcall BANK(Frameset_aace2), UpdateObjAnim + + ld a, [wObjAnimWasReset] + ld [wGameOverWarioAnimationEnded], a + and a + call nz, .Func_db3db + ld hl, wGameOverWario + call Func_17be + ld hl, wMenuObj1FramesetPtr + 1 + call UpdateObjAnim + ld hl, wMenuObj1 + call Func_db4e9 + call ClearUnusedVirtualOAM + ret + +.Func_db3db + play_sfx SFX_0F5 + ret + +Func_db3e4: + ld hl, wGameOverWarioFramesetPtr + 1 + farcall BANK(Frameset_aaccb), UpdateObjAnim + + ld a, [wObjAnimWasReset] + ld [wGameOverWarioAnimationEnded], a + ld hl, wGameOverWario + call Func_17be + ld hl, wMenuObj1FramesetPtr + 1 + call UpdateObjAnim + ld hl, wMenuObj1 + call Func_db4e9 + call ClearUnusedVirtualOAM + ld a, [wGameOverWarioAnimationEnded] + and a + ret z + ld hl, wSubState + inc [hl] + ret + +GameOverReset: + jp Init diff --git a/src/engine/game_over/load_gfx.asm b/src/engine/game_over/load_gfx.asm new file mode 100644 index 0000000..5d481ee --- /dev/null +++ b/src/engine/game_over/load_gfx.asm @@ -0,0 +1,105 @@ +LoadHiddenFigureGfx:: + call .LoadPals + call .LoadTiles + call .LoadMap + ret + +.LoadPals + ld hl, Pals_db000 + call LoadPalsToTempPals1 + ld hl, Pals_db040 + ld de, wTempPals2 + palette 3 + ld b, 5 palettes + call CopyHLToDE_Short + ret + +.LoadTiles + ld a, BANK("VRAM1") + ldh [rVBK], a + ld hl, HiddenFigure2Gfx + ld de, v1Tiles0 + ld bc, $180 tiles + call CopyHLToDE_BC + + xor a ; VRAM0 + ldh [rVBK], a + ld hl, HiddenFigure1Gfx + ld de, v0Tiles0 + ld bc, $180 tiles + call CopyHLToDE_BC + ret + +.LoadMap + ld a, BANK("VRAM1") + ldh [rVBK], a + ld hl, HiddenFigure2Map + ld bc, v1BGMap0 + call Decompress + ld hl, HiddenFigure4Map + ld bc, v1BGMap1 + call Decompress + + xor a ; VRAM0 + ldh [rVBK], a + ld hl, HiddenFigure1Map + ld bc, v0BGMap0 + call Decompress + ld hl, HiddenFigure3Map + ld bc, v0BGMap1 + call Decompress + ret + +LoadGameOverPals: + ld hl, Pals_db509 + call LoadPalsToTempPals1 + ld hl, Pals_db549 + call LoadPalsToTempPals2 + + ld hl, Pals_86ad5 + ld de, wTempPals2 palette 0 + ld b, 1 palettes + farcall BANK(Pals_86ad5), CopyHLToDE_Short + ret + +LoadGameOverGfx: + xor a + ldh [rVBK], a + ld hl, GameOverGfx + ld bc, v0Tiles0 + call Decompress + ld hl, WarioSleepGfx + ld de, v0Tiles0 + ld bc, $80 tiles + farcall BANK(WarioSleepGfx), CopyHLToDE_BC + ret + +Func_db4cf: + ld a, BANK("VRAM1") + ldh [rVBK], a + ld hl, BGMap_dbb8f + ld bc, v0BGMap0 + call Decompress + xor a + ldh [rVBK], a + ld hl, BGMap_dbaee + ld bc, v0BGMap0 + call Decompress + ret + +Func_db4e9: + ld a, [wSCY] + ld b, a + ld a, [hli] + add OAM_Y_OFS + sub b + ld [wCurSpriteYCoord], a + ld a, [hli] + add OAM_X_OFS + ld [wCurSpriteXCoord], a + ld a, [hli] + ld [wCurSpriteFrame], a + ld a, [hl] + ld [wCurSpriteAttributes], a + ld hl, OAM_dbbd2 + call AddSprite + ret diff --git a/src/engine/game_over/state_table.asm b/src/engine/game_over/state_table.asm new file mode 100644 index 0000000..a0a70fa --- /dev/null +++ b/src/engine/game_over/state_table.asm @@ -0,0 +1,20 @@ +_GameOverStateTable:: + ld a, [wSubState] + jumptable + + dw FastFadeToWhite + dw InitGameOverScreen + dw SlowFadeFromWhite + dw UpdateGameOverScreen + dw Func_db3e4 + dw FastFadeToWhite + dw GameOverReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset diff --git a/src/engine/perfect/core.asm b/src/engine/perfect/core.asm new file mode 100644 index 0000000..1a86b8d --- /dev/null +++ b/src/engine/perfect/core.asm @@ -0,0 +1,185 @@ +InitPerfectScreen: + call DisableLCD + call FillBGMap0_With7f + call ClearVirtualOAM + + call LoadPerfectPals + call LoadPerfectGfx + call Func_dc13e + call VBlank_Perfect + + xor a + ldh [rSCX], a + ld [wSCX], a + ldh [rSCY], a + ld [wSCY], a + + ld hl, wMenuObj1 + ld a, $23 + ld [hli], a + ld a, $2b + ld [hli], a + xor a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld a, HIGH(Frameset_dd848) + ld [hli], a + ld a, LOW(Frameset_dd848) + ld [hl], a + call UpdateObjAnim + + ld hl, wMenuObj1 + call Func_dc158 + + play_music MUSIC_PERFECT + + ld a, LCDC_DEFAULT + ldh [rLCDC], a + xor a + ld [wTimer], a + ld [wGameOverWarioVar], a + ld hl, wSubState + inc [hl] + ret + +UpdatePerfectScreen: + ld hl, wMenuObj1FramesetPtr + 1 + call UpdateObjAnim + ld hl, wMenuObj1 + call Func_dc158 + call ClearUnusedVirtualOAM + ld hl, wTimer + ld a, [hl] + and a + jr z, .asm_dc08c + dec [hl] + jr nz, .asm_dc0cf +.asm_dc08c + ld a, [wGlobalCounter] + and %111 + jr nz, .asm_dc0cf + call SlowFadeInScreen + ld a, [wSubState] + cp $03 + jr z, .asm_dc0cf + ld a, $03 + ld [wSubState], a + ld hl, wGameOverWarioVar + inc [hl] + ld a, [hl] + dec a + jr z, .asm_dc0bd + dec a + jr z, .asm_dc0c7 + dec a + jr z, .asm_dc0cc + dec a + jr z, .asm_dc0c7 + dec a + jr z, .asm_dc0c2 + ld [hl], $00 + call Func_dc101 + jr .asm_dc0cf +.asm_dc0bd + ld a, 240 + ld [wTimer], a +.asm_dc0c2 + call Func_dc10d + jr .asm_dc0cf +.asm_dc0c7 + call Func_dc119 + jr .asm_dc0cf +.asm_dc0cc + call Func_dc125 + +.asm_dc0cf + ld a, [wGameModeFlags] + bit MODE_TIME_ATTACK_F, a + ret nz + ld a, [wJoypadPressed] + and a + ret z + xor a + ld [wFadeSpeed], a + ld [wPalFadeCounter], a + ld [wUnused_c186], a + ld hl, wGameModeFlags + set MODE_TIME_ATTACK_F, [hl] + ld a, ST_PAUSE_MENU + ld [wState], a + ld a, SST_PAUSE_28 + ld [wSubState], a + ret + +LoadPerfectPals: + ld hl, Pals_dc173 + call LoadPalsToTempPals1 + ld hl, Pals_dc1fb + call LoadPalsToTempPals2 + ret + +Func_dc101: + ld hl, Pals_dc173 palette 5 + ld de, wTempPals1 palette 5 + ld b, 3 palettes + call CopyHLToDE_Short + ret + +Func_dc10d: + ld hl, Pals_dc1b3 + ld de, wTempPals1 palette 5 + ld b, 3 palettes + call CopyHLToDE_Short + ret + +Func_dc119: + ld hl, Pals_dc1cb + ld de, wTempPals1 palette 5 + ld b, 3 palettes + call CopyHLToDE_Short + ret + +Func_dc125: + ld hl, Pals_dc1e3 + ld de, wTempPals1 palette 5 + ld b, 3 palettes + call CopyHLToDE_Short + ret + +LoadPerfectGfx: + xor a + ldh [rVBK], a + ld hl, PerfectGfx + ld bc, v0Tiles0 + call Decompress + ret + +Func_dc13e: + ld a, BANK("VRAM1") + ldh [rVBK], a + ld hl, BGMap_dd5b5 + ld bc, v0BGMap0 + call Decompress + xor a + ldh [rVBK], a + ld hl, BGMap_dd417 + ld bc, v0BGMap0 + call Decompress + ret + +Func_dc158: + ld a, [hli] + add OAM_Y_OFS + ld [wCurSpriteYCoord], a + ld a, [hli] + add OAM_X_OFS + ld [wCurSpriteXCoord], a + ld a, [hli] + ld [wCurSpriteFrame], a + ld a, [hl] + ld [wCurSpriteAttributes], a + ld hl, OAM_dd710 + call AddSprite + ret diff --git a/src/engine/perfect/state_table.asm b/src/engine/perfect/state_table.asm new file mode 100644 index 0000000..6bc8f5b --- /dev/null +++ b/src/engine/perfect/state_table.asm @@ -0,0 +1,17 @@ +_PerfectStateTable: + ld a, [wSubState] + jumptable + + dw SlowFadeBGToWhite + dw InitPerfectScreen + dw DarkenBGToPal_Fast + dw UpdatePerfectScreen + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset + dw DebugReset diff --git a/src/gfx.asm b/src/gfx.asm index 16297f7..9dbffb0 100644 --- a/src/gfx.asm +++ b/src/gfx.asm @@ -331,3 +331,81 @@ AnimatedTiles21Gfx:: INCBIN "gfx/levels/animated/animated_tiles21.2bpp" ; ANIMAT AnimatedTiles22Gfx:: INCBIN "gfx/levels/animated/animated_tiles22.2bpp" ; ANIMATED_TILES_GFX_21 AnimatedTiles23Gfx:: INCBIN "gfx/levels/animated/animated_tiles23.2bpp" ; ANIMATED_TILES_GFX_22 AnimatedTiles24Gfx:: INCBIN "gfx/levels/animated/animated_tiles24.2bpp" ; ANIMATED_TILES_GFX_23 + + +SECTION "Hidden Figure GFX", ROMX + +HiddenFigure1Gfx:: INCBIN "gfx/enemies/hidden_figure1.2bpp" +HiddenFigure2Gfx:: INCBIN "gfx/enemies/hidden_figure2.2bpp" + +Pals_db000:: + rgb 1, 4, 9 + rgb 31, 0, 0 + rgb 6, 10, 10 + rgb 0, 0, 0 + + rgb 31, 31, 31 + rgb 0, 30, 31 + rgb 6, 10, 10 + rgb 0, 0, 0 + + rgb 1, 4, 9 + rgb 0, 31, 18 + rgb 6, 10, 10 + rgb 0, 0, 0 + + rgb 1, 4, 9 + rgb 28, 20, 6 + rgb 6, 10, 10 + rgb 0, 0, 0 + + rgb 1, 4, 9 + rgb 0, 11, 21 + rgb 31, 25, 0 + rgb 0, 0, 0 + + rgb 1, 4, 9 + rgb 15, 0, 0 + rgb 31, 25, 0 + rgb 0, 0, 0 + + rgb 31, 19, 23 + rgb 21, 8, 17 + rgb 12, 2, 6 + rgb 0, 0, 0 + + rgb 27, 23, 11 + rgb 22, 13, 2 + rgb 13, 6, 1 + rgb 5, 2, 0 + +Pals_db040:: + rgb 21, 21, 21 + rgb 31, 31, 31 + rgb 31, 0, 0 + rgb 0, 0, 0 + + rgb 21, 21, 21 + rgb 4, 24, 12 + rgb 4, 11, 12 + rgb 0, 0, 0 + + rgb 21, 21, 21 + rgb 15, 0, 0 + rgb 31, 25, 0 + rgb 0, 0, 0 + + rgb 21, 21, 21 + rgb 25, 10, 0 + rgb 31, 25, 0 + rgb 0, 0, 0 + + rgb 21, 21, 21 + rgb 0, 21, 31 + rgb 31, 25, 0 + rgb 0, 0, 0 + +HiddenFigure1Map:: INCBIN "gfx/bgmaps/hidden_figure1.bin" +HiddenFigure2Map:: INCBIN "gfx/bgmaps/hidden_figure2.bin" +HiddenFigure3Map:: INCBIN "gfx/bgmaps/hidden_figure3.bin" +HiddenFigure4Map:: INCBIN "gfx/bgmaps/hidden_figure4.bin" diff --git a/src/layout.link b/src/layout.link index 33e3cd1..224aec3 100644 --- a/src/layout.link +++ b/src/layout.link @@ -140,7 +140,7 @@ ROMX $2e ROMX $2f "Bank 2F" ROMX $30 - "Level Data" + "Level Headers" "Rooms 1" ROMX $31 "Rooms 2" @@ -154,9 +154,10 @@ ROMX $34 ROMX $35 "Clear Level" ROMX $36 - "Bank 36" + "Hidden Figure GFX" + "Game Over" ROMX $37 - "Bank 37" + "Perfect" ROMX $38 "Level Data 1" ROMX $39 diff --git a/src/main.asm b/src/main.asm index fd6f9a1..efc5cb1 100644 --- a/src/main.asm +++ b/src/main.asm @@ -330,7 +330,7 @@ SECTION "Object Loading", ROMX INCLUDE "engine/level/load_objects.asm" -SECTION "Level Data", ROMX +SECTION "Level Headers", ROMX INCLUDE "engine/level/load_room_gfx.asm" INCLUDE "data/levels/level_headers.asm" @@ -383,9 +383,33 @@ BGMap_d6502: INCBIN "gfx/bgmaps/map_d6502.bin" INCLUDE "data/clear/pencil_oam.asm" -SECTION "Bank 37", ROMX +SECTION "Game Over", ROMX -INCLUDE "engine/bank37.asm" +INCLUDE "engine/game_over/state_table.asm" +INCLUDE "engine/game_over/core.asm" +INCLUDE "engine/game_over/load_gfx.asm" +INCLUDE "data/game_over/palettes.asm" + +GameOverGfx: INCBIN "gfx/game_over.2bpp.rle" +BGMap_dbaee: INCBIN "gfx/bgmaps/map_dbaee.bin" +BGMap_dbb8f: INCBIN "gfx/bgmaps/map_dbb8f.bin" + +INCLUDE "data/game_over/oam.asm" +INCLUDE "data/game_over/framesets.asm" + + +SECTION "Perfect", ROMX + +INCLUDE "engine/perfect/state_table.asm" +INCLUDE "engine/perfect/core.asm" +INCLUDE "data/perfect/palettes.asm" + +PerfectGfx: INCBIN "gfx/perfect.2bpp.rle" +BGMap_dd417: INCBIN "gfx/bgmaps/map_dd417.bin" +BGMap_dd5b5: INCBIN "gfx/bgmaps/map_dd5b5.bin" + +INCLUDE "data/perfect/oam.asm" +INCLUDE "data/perfect/framesets.asm" SECTION "Level Data 1", ROMX diff --git a/src/overworld.asm b/src/overworld.asm index af653d1..d151799 100644 --- a/src/overworld.asm +++ b/src/overworld.asm @@ -119,11 +119,6 @@ SECTION "Bank 2F", ROMX INCLUDE "engine/bank2f.asm" -SECTION "Bank 36", ROMX - -INCLUDE "engine/bank36.asm" - - SECTION "Bank 56", ROMX INCLUDE "engine/bank56.asm"