Color improvements.

This commit is contained in:
Randy Thiemann 2023-10-30 19:33:57 +01:00
parent a752034528
commit 0a3103ba1e
8 changed files with 912 additions and 998 deletions

Binary file not shown.

View File

@ -20,302 +20,306 @@ ROM0 bank #0:
$00e6 = InitializeLCDCInterrupt
EMPTY: $00fb-$00ff ($0005 bytes)
SECTION: $0100-$014f ($0050 bytes) ["Cartridge Header"]
SECTION: $0150-$086f ($0720 bytes) ["GBC Functions"]
SECTION: $0150-$0c79 ($0b2a bytes) ["GBC Functions"]
$0150 = ToATTR
$0173 = GBCTitleInit
$035f = GBCGameplayInit
$0536 = GBCTitleProcess
$0564 = GBCTitleProcess.nores
$0567 = GBCTitleProcess.noinc
$057e = !0
$058b = GBCGameplayProcess
$05c5 = GBCGameplayProcess.goverride
$05d1 = !1
$05da = !2
$05e3 = !3
$05ec = GBCGameplayProcess.colorfield
$05f7 = GBCGameplayProcess.outer0
$05fc = GBCGameplayProcess.inner0
$0611 = !4
$061f = GBCGameplayProcess.outer1
$0624 = GBCGameplayProcess.inner1
$0648 = GBCGameplayProcess.outer2
$064d = GBCGameplayProcess.inner2
$0672 = GBCGameplayProcess.empty
$0676 = GBCGameplayProcess.sub59
$0678 = GBCGameplayProcess.sub52
$067a = GBCGameplayProcess.sub45
$067c = GBCGameplayProcess.sub38
$067e = GBCGameplayProcess.sub31
$0680 = GBCGameplayProcess.sub24
$0682 = GBCGameplayProcess.sub17
$0684 = GBCGameplayProcess.sub10
$0686 = GBCGameplayProcess.done
$06a8 = GBCGameplayProcess.darker
$06af = GBCGameplayProcess.wvr_u1
$06bc = GBCGameplayProcess.lighter
$06c3 = GBCGameplayProcess.wvr_u2
$06d0 = GBCGameplayProcess.black
$06d7 = GBCGameplayProcess.wvr_u3
$06e4 = GBCBigGameplayProcess
$071e = GBCBigGameplayProcess.goverride
$072a = !5
$0733 = !6
$073c = !7
$0745 = GBCBigGameplayProcess.colorfield
$0750 = GBCBigGameplayProcess.outer0
$0755 = GBCBigGameplayProcess.inner0
$076a = !8
$0778 = GBCBigGameplayProcess.outer1
$077d = GBCBigGameplayProcess.inner1
$07a1 = GBCBigGameplayProcess.outer2
$07a6 = GBCBigGameplayProcess.inner2
$07cb = GBCBigGameplayProcess.empty
$07cf = GBCBigGameplayProcess.sub59
$07d1 = GBCBigGameplayProcess.sub52
$07d3 = GBCBigGameplayProcess.sub45
$07d5 = GBCBigGameplayProcess.sub38
$07d7 = GBCBigGameplayProcess.sub31
$07d9 = GBCBigGameplayProcess.sub24
$07db = GBCBigGameplayProcess.sub17
$07dd = GBCBigGameplayProcess.sub10
$07df = GBCBigGameplayProcess.done
$0801 = GBCBigGameplayProcess.darker
$0808 = GBCBigGameplayProcess.wvr_u4
$0815 = GBCBigGameplayProcess.lighter
$081c = GBCBigGameplayProcess.wvr_u5
$0829 = GBCBigGameplayProcess.black
$0830 = GBCBigGameplayProcess.wvr_u6
$083d = ToVRAM
$083d = GBCBlitField
SECTION: $0870-$0f7f ($0710 bytes) ["Field Function Unbanked"]
$0870 = BlitField
$0a33 = BlitField.waitendvbloop
$0a39 = !0
$0a83 = !1
$0acd = !2
$0b17 = !3
$0b61 = !4
$0bab = !5
$0bf8 = BigBlitField
$0dbb = BigBlitField.waitendvbloop
$0dc1 = !6
$0e0b = !7
$0e55 = !8
$0e9f = !9
$0ee9 = !10
$0f33 = !11
SECTION: $0f80-$1249 ($02ca bytes) ["Domain Specific Functions"]
$0f80 = ApplyTells
$0fd7 = ApplyNext
$1007 = ApplyNext.regular
$100d = ApplyNext.postoffsets
$1011 = ApplyNext.getoffn
$101c = ApplyNext.skipoffn
$1095 = ApplyHold
$10b1 = ApplyHold.hide
$10c3 = ApplyHold.show
$10d3 = ApplyHold.x
$10e3 = ApplyHold.regular
$10e9 = ApplyHold.postoffsets
$10ed = ApplyHold.getoffh
$10f8 = ApplyHold.skipoffh
$112b = ApplyNumbers6
$1153 = ApplyNumbers4
$116f = SetNumberSpritePositions
SECTION: $124a-$14b7 ($026e bytes) ["SFX Functions"]
$124a = SFXInit
$126a = SFXPopQueue
$127f = SFXPushQueue
$1290 = SFXProcessQueue
$129d = !0
$12ba = SFXTriggerNoise
$12c7 = !1
$12d4 = !2
$12e0 = SFXEnqueue
$12ed = !3
$12ff = !4
$130f = !5
$131f = !6
$132f = !7
$133f = !8
$134f = !9
$135f = !10
$136f = !11
$137f = !12
$138f = !13
$139f = !14
$13af = !15
$13bf = !16
$13cf = !17
$13df = !18
$13ee = !19
$13fd = !20
$140b = !21
$1419 = !22
$1427 = !23
$1434 = SFXKill
$1456 = SFXPlayNoise
$1461 = SFXPlayNoise.noisereg
$146e = !24
$1478 = SFXPlayNoise.savenoiseplayhead
$1481 = SFXPlay
$148c = !25
$148f = SFXPlay.play
$149b = SFXPlay.getRegister
$14a5 = !26
$14af = SFXPlay.savePlayhead
SECTION: $14b8-$16a5 ($01ee bytes) ["RNG Functions"]
$14b8 = RNGInit
$14e8 = !0
$1503 = RNGInit.complexinit
$151a = !1
$1534 = ShiftHistory
$1551 = GetNextHellPiece
$1556 = GetNextTGM1Piece
$1559 = !2
$1571 = !3
$1573 = GetNextTGM2Piece
$1576 = !4
$158e = !5
$1590 = GetNextNesPiece
$159e = GetNextTGM3Piece
$15a1 = !6
$15c4 = !7
$15c7 = !8
$15d7 = !9
$15e1 = !10
$15ef = !11
$15fe = !12
$160a = !13
$1616 = !14
$1622 = !15
$162e = !16
$163a = !17
$1646 = !18
$1655 = GetNextPiece
$1663 = GetNextPiece.nextpiecejumps
$1672 = Next35Piece
$1672 = !19
$167c = Next7Piece
$167c = !20
$1686 = NextByte
SECTION: $16a6-$1848 ($01a3 bytes) ["Level Functions"]
$16a6 = LevelInit
$16f6 = LevelUp
$171a = LevelUp.doit
$175e = LevelUp.checknlevel
$178c = !0
$17a4 = !1
$17ad = LevelUp.bellmaybe
$17bf = LevelUp.leveljinglemaybe
$17cc = LevelUp.checkspeedup
$17dd = !2
$17ea = !3
$17fb = !4
$1808 = DoSpeedUp
SECTION: $1849-$1915 ($00cd bytes) ["Input Functions"]
$1849 = InputInit
$185b = GetInput
$185b = GetInput.btns
$1868 = GetInput.readA
$186c = GetInput.setA
$1877 = GetInput.clearA
$187a = GetInput.readB
$187e = GetInput.setB
$1889 = GetInput.clearB
$188c = GetInput.readSelect
$1890 = GetInput.setSelect
$189b = GetInput.clearSelect
$189e = GetInput.readStart
$18a2 = GetInput.setStart
$18ad = GetInput.clearStart
$18b0 = GetInput.dpad
$18bd = GetInput.readUp
$18c1 = GetInput.setUp
$18cc = GetInput.clearUp
$18cf = GetInput.readDown
$18d3 = GetInput.setDown
$18de = GetInput.clearDown
$18e1 = GetInput.readLeft
$18e5 = GetInput.setLeft
$18f0 = GetInput.clearLeft
$18f3 = GetInput.readRight
$18f7 = GetInput.setRight
$1902 = GetInput.clearRight
$1905 = GetInput.priorities
$1910 = GetInput.zero
SECTION: $1916-$19e1 ($00cc bytes) ["Score Functions"]
$1916 = ScoreInit
$1936 = IncreaseScore
$196a = IncreaseScore.doConvert
$196c = !0
$1982 = IncreaseScore.carry
$1984 = IncreaseScore.postConvert
$1991 = !1
$1998 = IncreaseScore.preAddDigit
$19b8 = IncreaseScore.addDigit
$19ce = IncreaseScore.nextDigit
SECTION: $19e2-$1aa4 ($00c3 bytes) ["Code Entry Point"]
$19e2 = Main
$19f7 = Main.wvr_u1
$1a00 = !0
$1a10 = Main.notgbc
$1a3d = Main.nocolortiles
$1a5e = Main.wvb_u2
$1a63 = !1
$1a69 = EventLoop
$1a7f = EventLoop.eventloopjumps
$1a88 = EventLoopPostHandler
$1a8a = EventLoopPostHandler.wvb_u3
$1a9c = EventLoopPostHandler.vblankjumps
SECTION: $1aa5-$1b5b ($00b7 bytes) ["SRAM Functions"]
$1aa5 = RestoreSRAM
$1afe = InitializeSRAM
SECTION: $1b5c-$1bed ($0092 bytes) ["DMG Intro Effect"]
$1b5c = DoDMGEffect
$1b64 = DoDMGEffect.loop0
$1b66 = DoDMGEffect.wvb_u1
$1b72 = DoDMGEffect.wvbe_u2
$1b7c = DoDMGEffect.loop1
$1b7e = DoDMGEffect.wvb_u3
$1b8b = DoDMGEffect.wvbe_u4
$1b95 = DoDMGEffect.wvb_u5
$1ba0 = DoDMGEffect.loop2
$1ba2 = DoDMGEffect.wvb_u6
$1ba9 = DoDMGEffect.wvbe_u7
$1bb3 = DoDMGEffect.wvb_u8
$1bbe = DoDMGEffect.loop3
$1bc0 = DoDMGEffect.wvb_u9
$1bc7 = DoDMGEffect.wvbe_u10
$1bd1 = DoDMGEffect.wvb_u11
$1bdc = DoDMGEffect.loop4
$1bde = DoDMGEffect.wvb_u12
$1be5 = DoDMGEffect.wvbe_u13
SECTION: $1bee-$1c3a ($004d bytes) ["Time Functions"]
$1bee = TimeInit
$1c03 = ResetTime
$1c0e = HandleTimers
SECTION: $1c3b-$1c68 ($002e bytes) ["Memory Functions"]
$1c3b = UnsafeMemCopy
$1c44 = SafeMemCopy.wvr_u1
$1c44 = SafeMemCopy
$1c53 = UnsafeMemSet
$1c5b = SafeMemSet
$1c5b = SafeMemSet.wvr_u2
SECTION: $1c69-$1c90 ($0028 bytes) ["Gameplay Function Trampolines"]
$1c69 = SwitchToGameplay
$1c73 = SwitchToGameplayBig
$1c7d = GamePlayEventLoopHandler
$1c87 = GamePlayBigEventLoopHandler
SECTION: $1c91-$1cb2 ($0022 bytes) ["OAM Functions"]
$1c91 = CopyOAMHandler
$1c9d = ClearOAM
SECTION: $1cb3-$1cbc ($000a bytes) ["OAM DMA Code"]
$1cb3 = OAMDMA
$1cbd = OAMDMAEnd
EMPTY: $1cbd-$3fff ($2343 bytes)
TOTAL EMPTY: $2350 bytes
$0354 = GBCTitleInit.agb
$0524 = GBCTitleInit.postpalettes
$0564 = GBCGameplayInit
$0745 = GBCGameplayInit.agb
$0915 = GBCGameplayInit.postpalettes
$0940 = GBCTitleProcess
$096e = GBCTitleProcess.nores
$0971 = GBCTitleProcess.noinc
$0988 = !0
$0995 = GBCGameplayProcess
$09cf = GBCGameplayProcess.goverride
$09db = !1
$09e4 = !2
$09ed = !3
$09f6 = GBCGameplayProcess.colorfield
$0a01 = GBCGameplayProcess.outer0
$0a06 = GBCGameplayProcess.inner0
$0a1b = !4
$0a29 = GBCGameplayProcess.outer1
$0a2e = GBCGameplayProcess.inner1
$0a52 = GBCGameplayProcess.outer2
$0a57 = GBCGameplayProcess.inner2
$0a7c = GBCGameplayProcess.empty
$0a80 = GBCGameplayProcess.sub59
$0a82 = GBCGameplayProcess.sub52
$0a84 = GBCGameplayProcess.sub45
$0a86 = GBCGameplayProcess.sub38
$0a88 = GBCGameplayProcess.sub31
$0a8a = GBCGameplayProcess.sub24
$0a8c = GBCGameplayProcess.sub17
$0a8e = GBCGameplayProcess.sub10
$0a90 = GBCGameplayProcess.done
$0ab2 = GBCGameplayProcess.darker
$0ab9 = GBCGameplayProcess.wvr_u1
$0ac6 = GBCGameplayProcess.lighter
$0acd = GBCGameplayProcess.wvr_u2
$0ada = GBCGameplayProcess.black
$0ae1 = GBCGameplayProcess.wvr_u3
$0aee = GBCBigGameplayProcess
$0b28 = GBCBigGameplayProcess.goverride
$0b34 = !5
$0b3d = !6
$0b46 = !7
$0b4f = GBCBigGameplayProcess.colorfield
$0b5a = GBCBigGameplayProcess.outer0
$0b5f = GBCBigGameplayProcess.inner0
$0b74 = !8
$0b82 = GBCBigGameplayProcess.outer1
$0b87 = GBCBigGameplayProcess.inner1
$0bab = GBCBigGameplayProcess.outer2
$0bb0 = GBCBigGameplayProcess.inner2
$0bd5 = GBCBigGameplayProcess.empty
$0bd9 = GBCBigGameplayProcess.sub59
$0bdb = GBCBigGameplayProcess.sub52
$0bdd = GBCBigGameplayProcess.sub45
$0bdf = GBCBigGameplayProcess.sub38
$0be1 = GBCBigGameplayProcess.sub31
$0be3 = GBCBigGameplayProcess.sub24
$0be5 = GBCBigGameplayProcess.sub17
$0be7 = GBCBigGameplayProcess.sub10
$0be9 = GBCBigGameplayProcess.done
$0c0b = GBCBigGameplayProcess.darker
$0c12 = GBCBigGameplayProcess.wvr_u4
$0c1f = GBCBigGameplayProcess.lighter
$0c26 = GBCBigGameplayProcess.wvr_u5
$0c33 = GBCBigGameplayProcess.black
$0c3a = GBCBigGameplayProcess.wvr_u6
$0c47 = ToVRAM
$0c47 = GBCBlitField
SECTION: $0c7a-$1389 ($0710 bytes) ["Field Function Unbanked"]
$0c7a = BlitField
$0e3d = BlitField.waitendvbloop
$0e43 = !0
$0e8d = !1
$0ed7 = !2
$0f21 = !3
$0f6b = !4
$0fb5 = !5
$1002 = BigBlitField
$11c5 = BigBlitField.waitendvbloop
$11cb = !6
$1215 = !7
$125f = !8
$12a9 = !9
$12f3 = !10
$133d = !11
SECTION: $138a-$1653 ($02ca bytes) ["Domain Specific Functions"]
$138a = ApplyTells
$13e1 = ApplyNext
$1411 = ApplyNext.regular
$1417 = ApplyNext.postoffsets
$141b = ApplyNext.getoffn
$1426 = ApplyNext.skipoffn
$149f = ApplyHold
$14bb = ApplyHold.hide
$14cd = ApplyHold.show
$14dd = ApplyHold.x
$14ed = ApplyHold.regular
$14f3 = ApplyHold.postoffsets
$14f7 = ApplyHold.getoffh
$1502 = ApplyHold.skipoffh
$1535 = ApplyNumbers6
$155d = ApplyNumbers4
$1579 = SetNumberSpritePositions
SECTION: $1654-$18c1 ($026e bytes) ["SFX Functions"]
$1654 = SFXInit
$1674 = SFXPopQueue
$1689 = SFXPushQueue
$169a = SFXProcessQueue
$16a7 = !0
$16c4 = SFXTriggerNoise
$16d1 = !1
$16de = !2
$16ea = SFXEnqueue
$16f7 = !3
$1709 = !4
$1719 = !5
$1729 = !6
$1739 = !7
$1749 = !8
$1759 = !9
$1769 = !10
$1779 = !11
$1789 = !12
$1799 = !13
$17a9 = !14
$17b9 = !15
$17c9 = !16
$17d9 = !17
$17e9 = !18
$17f8 = !19
$1807 = !20
$1815 = !21
$1823 = !22
$1831 = !23
$183e = SFXKill
$1860 = SFXPlayNoise
$186b = SFXPlayNoise.noisereg
$1878 = !24
$1882 = SFXPlayNoise.savenoiseplayhead
$188b = SFXPlay
$1896 = !25
$1899 = SFXPlay.play
$18a5 = SFXPlay.getRegister
$18af = !26
$18b9 = SFXPlay.savePlayhead
SECTION: $18c2-$1aaf ($01ee bytes) ["RNG Functions"]
$18c2 = RNGInit
$18f2 = !0
$190d = RNGInit.complexinit
$1924 = !1
$193e = ShiftHistory
$195b = GetNextHellPiece
$1960 = GetNextTGM1Piece
$1963 = !2
$197b = !3
$197d = GetNextTGM2Piece
$1980 = !4
$1998 = !5
$199a = GetNextNesPiece
$19a8 = GetNextTGM3Piece
$19ab = !6
$19ce = !7
$19d1 = !8
$19e1 = !9
$19eb = !10
$19f9 = !11
$1a08 = !12
$1a14 = !13
$1a20 = !14
$1a2c = !15
$1a38 = !16
$1a44 = !17
$1a50 = !18
$1a5f = GetNextPiece
$1a6d = GetNextPiece.nextpiecejumps
$1a7c = Next35Piece
$1a7c = !19
$1a86 = Next7Piece
$1a86 = !20
$1a90 = NextByte
SECTION: $1ab0-$1c52 ($01a3 bytes) ["Level Functions"]
$1ab0 = LevelInit
$1b00 = LevelUp
$1b24 = LevelUp.doit
$1b68 = LevelUp.checknlevel
$1b96 = !0
$1bae = !1
$1bb7 = LevelUp.bellmaybe
$1bc9 = LevelUp.leveljinglemaybe
$1bd6 = LevelUp.checkspeedup
$1be7 = !2
$1bf4 = !3
$1c05 = !4
$1c12 = DoSpeedUp
SECTION: $1c53-$1d1f ($00cd bytes) ["Input Functions"]
$1c53 = InputInit
$1c65 = GetInput
$1c65 = GetInput.btns
$1c72 = GetInput.readA
$1c76 = GetInput.setA
$1c81 = GetInput.clearA
$1c84 = GetInput.readB
$1c88 = GetInput.setB
$1c93 = GetInput.clearB
$1c96 = GetInput.readSelect
$1c9a = GetInput.setSelect
$1ca5 = GetInput.clearSelect
$1ca8 = GetInput.readStart
$1cac = GetInput.setStart
$1cb7 = GetInput.clearStart
$1cba = GetInput.dpad
$1cc7 = GetInput.readUp
$1ccb = GetInput.setUp
$1cd6 = GetInput.clearUp
$1cd9 = GetInput.readDown
$1cdd = GetInput.setDown
$1ce8 = GetInput.clearDown
$1ceb = GetInput.readLeft
$1cef = GetInput.setLeft
$1cfa = GetInput.clearLeft
$1cfd = GetInput.readRight
$1d01 = GetInput.setRight
$1d0c = GetInput.clearRight
$1d0f = GetInput.priorities
$1d1a = GetInput.zero
SECTION: $1d20-$1deb ($00cc bytes) ["Score Functions"]
$1d20 = ScoreInit
$1d40 = IncreaseScore
$1d74 = IncreaseScore.doConvert
$1d76 = !0
$1d8c = IncreaseScore.carry
$1d8e = IncreaseScore.postConvert
$1d9b = !1
$1da2 = IncreaseScore.preAddDigit
$1dc2 = IncreaseScore.addDigit
$1dd8 = IncreaseScore.nextDigit
SECTION: $1dec-$1eae ($00c3 bytes) ["Code Entry Point"]
$1dec = Main
$1e01 = Main.wvr_u1
$1e0a = !0
$1e1a = Main.notgbc
$1e47 = Main.nocolortiles
$1e68 = Main.wvb_u2
$1e6d = !1
$1e73 = EventLoop
$1e89 = EventLoop.eventloopjumps
$1e92 = EventLoopPostHandler
$1e94 = EventLoopPostHandler.wvb_u3
$1ea6 = EventLoopPostHandler.vblankjumps
SECTION: $1eaf-$1f65 ($00b7 bytes) ["SRAM Functions"]
$1eaf = RestoreSRAM
$1f08 = InitializeSRAM
SECTION: $1f66-$1ff7 ($0092 bytes) ["DMG Intro Effect"]
$1f66 = DoDMGEffect
$1f6e = DoDMGEffect.loop0
$1f70 = DoDMGEffect.wvb_u1
$1f7c = DoDMGEffect.wvbe_u2
$1f86 = DoDMGEffect.loop1
$1f88 = DoDMGEffect.wvb_u3
$1f95 = DoDMGEffect.wvbe_u4
$1f9f = DoDMGEffect.wvb_u5
$1faa = DoDMGEffect.loop2
$1fac = DoDMGEffect.wvb_u6
$1fb3 = DoDMGEffect.wvbe_u7
$1fbd = DoDMGEffect.wvb_u8
$1fc8 = DoDMGEffect.loop3
$1fca = DoDMGEffect.wvb_u9
$1fd1 = DoDMGEffect.wvbe_u10
$1fdb = DoDMGEffect.wvb_u11
$1fe6 = DoDMGEffect.loop4
$1fe8 = DoDMGEffect.wvb_u12
$1fef = DoDMGEffect.wvbe_u13
SECTION: $1ff8-$2044 ($004d bytes) ["Time Functions"]
$1ff8 = TimeInit
$200d = ResetTime
$2018 = HandleTimers
SECTION: $2045-$2072 ($002e bytes) ["Memory Functions"]
$2045 = UnsafeMemCopy
$204e = SafeMemCopy.wvr_u1
$204e = SafeMemCopy
$205d = UnsafeMemSet
$2065 = SafeMemSet
$2065 = SafeMemSet.wvr_u2
SECTION: $2073-$209a ($0028 bytes) ["Gameplay Function Trampolines"]
$2073 = SwitchToGameplay
$207d = SwitchToGameplayBig
$2087 = GamePlayEventLoopHandler
$2091 = GamePlayBigEventLoopHandler
SECTION: $209b-$20bc ($0022 bytes) ["OAM Functions"]
$209b = CopyOAMHandler
$20a7 = ClearOAM
SECTION: $20bd-$20c6 ($000a bytes) ["OAM DMA Code"]
$20bd = OAMDMA
$20c7 = OAMDMAEnd
EMPTY: $20c7-$3fff ($1f39 bytes)
TOTAL EMPTY: $1f46 bytes
ROMX bank #1:
SECTION: $4000-$4007 ($0008 bytes) ["Bank ID BANK_OTHER"]
@ -2213,7 +2217,7 @@ HRAM bank #0:
TOTAL EMPTY: $0007 bytes
SUMMARY:
ROM0: 7344 bytes used / 9040 free
ROM0: 8378 bytes used / 8006 free
ROMX: 48248 bytes used / 50056 free in 6 banks
SRAM: 14 bytes used / 8178 free in 1 bank
WRAM0: 3432 bytes used / 664 free

Binary file not shown.

View File

@ -12,204 +12,208 @@
00:00e6 InitializeLCDCInterrupt
00:0150 ToATTR
00:0173 GBCTitleInit
00:035f GBCGameplayInit
00:0536 GBCTitleProcess
00:0564 GBCTitleProcess.nores
00:0567 GBCTitleProcess.noinc
00:058b GBCGameplayProcess
00:05c5 GBCGameplayProcess.goverride
00:05ec GBCGameplayProcess.colorfield
00:05f7 GBCGameplayProcess.outer0
00:05fc GBCGameplayProcess.inner0
00:061f GBCGameplayProcess.outer1
00:0624 GBCGameplayProcess.inner1
00:0648 GBCGameplayProcess.outer2
00:064d GBCGameplayProcess.inner2
00:0672 GBCGameplayProcess.empty
00:0676 GBCGameplayProcess.sub59
00:0678 GBCGameplayProcess.sub52
00:067a GBCGameplayProcess.sub45
00:067c GBCGameplayProcess.sub38
00:067e GBCGameplayProcess.sub31
00:0680 GBCGameplayProcess.sub24
00:0682 GBCGameplayProcess.sub17
00:0684 GBCGameplayProcess.sub10
00:0686 GBCGameplayProcess.done
00:06a8 GBCGameplayProcess.darker
00:06af GBCGameplayProcess.wvr_u1
00:06bc GBCGameplayProcess.lighter
00:06c3 GBCGameplayProcess.wvr_u2
00:06d0 GBCGameplayProcess.black
00:06d7 GBCGameplayProcess.wvr_u3
00:06e4 GBCBigGameplayProcess
00:071e GBCBigGameplayProcess.goverride
00:0745 GBCBigGameplayProcess.colorfield
00:0750 GBCBigGameplayProcess.outer0
00:0755 GBCBigGameplayProcess.inner0
00:0778 GBCBigGameplayProcess.outer1
00:077d GBCBigGameplayProcess.inner1
00:07a1 GBCBigGameplayProcess.outer2
00:07a6 GBCBigGameplayProcess.inner2
00:07cb GBCBigGameplayProcess.empty
00:07cf GBCBigGameplayProcess.sub59
00:07d1 GBCBigGameplayProcess.sub52
00:07d3 GBCBigGameplayProcess.sub45
00:07d5 GBCBigGameplayProcess.sub38
00:07d7 GBCBigGameplayProcess.sub31
00:07d9 GBCBigGameplayProcess.sub24
00:07db GBCBigGameplayProcess.sub17
00:07dd GBCBigGameplayProcess.sub10
00:07df GBCBigGameplayProcess.done
00:0801 GBCBigGameplayProcess.darker
00:0808 GBCBigGameplayProcess.wvr_u4
00:0815 GBCBigGameplayProcess.lighter
00:081c GBCBigGameplayProcess.wvr_u5
00:0829 GBCBigGameplayProcess.black
00:0830 GBCBigGameplayProcess.wvr_u6
00:083d ToVRAM
00:083d GBCBlitField
00:0870 BlitField
00:0a33 BlitField.waitendvbloop
00:0bf8 BigBlitField
00:0dbb BigBlitField.waitendvbloop
00:0f80 ApplyTells
00:0fd7 ApplyNext
00:1007 ApplyNext.regular
00:100d ApplyNext.postoffsets
00:1011 ApplyNext.getoffn
00:101c ApplyNext.skipoffn
00:1095 ApplyHold
00:10b1 ApplyHold.hide
00:10c3 ApplyHold.show
00:10d3 ApplyHold.x
00:10e3 ApplyHold.regular
00:10e9 ApplyHold.postoffsets
00:10ed ApplyHold.getoffh
00:10f8 ApplyHold.skipoffh
00:112b ApplyNumbers6
00:1153 ApplyNumbers4
00:116f SetNumberSpritePositions
00:124a SFXInit
00:126a SFXPopQueue
00:127f SFXPushQueue
00:1290 SFXProcessQueue
00:12ba SFXTriggerNoise
00:12e0 SFXEnqueue
00:1434 SFXKill
00:1456 SFXPlayNoise
00:1461 SFXPlayNoise.noisereg
00:1478 SFXPlayNoise.savenoiseplayhead
00:1481 SFXPlay
00:148f SFXPlay.play
00:149b SFXPlay.getRegister
00:14af SFXPlay.savePlayhead
00:14b8 RNGInit
00:1503 RNGInit.complexinit
00:1534 ShiftHistory
00:1551 GetNextHellPiece
00:1556 GetNextTGM1Piece
00:1573 GetNextTGM2Piece
00:1590 GetNextNesPiece
00:159e GetNextTGM3Piece
00:1655 GetNextPiece
00:1663 GetNextPiece.nextpiecejumps
00:1672 Next35Piece
00:167c Next7Piece
00:1686 NextByte
00:16a6 LevelInit
00:16f6 LevelUp
00:171a LevelUp.doit
00:175e LevelUp.checknlevel
00:17ad LevelUp.bellmaybe
00:17bf LevelUp.leveljinglemaybe
00:17cc LevelUp.checkspeedup
00:1808 DoSpeedUp
00:1849 InputInit
00:185b GetInput
00:185b GetInput.btns
00:1868 GetInput.readA
00:186c GetInput.setA
00:1877 GetInput.clearA
00:187a GetInput.readB
00:187e GetInput.setB
00:1889 GetInput.clearB
00:188c GetInput.readSelect
00:1890 GetInput.setSelect
00:189b GetInput.clearSelect
00:189e GetInput.readStart
00:18a2 GetInput.setStart
00:18ad GetInput.clearStart
00:18b0 GetInput.dpad
00:18bd GetInput.readUp
00:18c1 GetInput.setUp
00:18cc GetInput.clearUp
00:18cf GetInput.readDown
00:18d3 GetInput.setDown
00:18de GetInput.clearDown
00:18e1 GetInput.readLeft
00:18e5 GetInput.setLeft
00:18f0 GetInput.clearLeft
00:18f3 GetInput.readRight
00:18f7 GetInput.setRight
00:1902 GetInput.clearRight
00:1905 GetInput.priorities
00:1910 GetInput.zero
00:1916 ScoreInit
00:1936 IncreaseScore
00:196a IncreaseScore.doConvert
00:1982 IncreaseScore.carry
00:1984 IncreaseScore.postConvert
00:1998 IncreaseScore.preAddDigit
00:19b8 IncreaseScore.addDigit
00:19ce IncreaseScore.nextDigit
00:19e2 Main
00:19f7 Main.wvr_u1
00:1a10 Main.notgbc
00:1a3d Main.nocolortiles
00:1a5e Main.wvb_u2
00:1a69 EventLoop
00:1a7f EventLoop.eventloopjumps
00:1a88 EventLoopPostHandler
00:1a8a EventLoopPostHandler.wvb_u3
00:1a9c EventLoopPostHandler.vblankjumps
00:1aa5 RestoreSRAM
00:1afe InitializeSRAM
00:1b5c DoDMGEffect
00:1b64 DoDMGEffect.loop0
00:1b66 DoDMGEffect.wvb_u1
00:1b72 DoDMGEffect.wvbe_u2
00:1b7c DoDMGEffect.loop1
00:1b7e DoDMGEffect.wvb_u3
00:1b8b DoDMGEffect.wvbe_u4
00:1b95 DoDMGEffect.wvb_u5
00:1ba0 DoDMGEffect.loop2
00:1ba2 DoDMGEffect.wvb_u6
00:1ba9 DoDMGEffect.wvbe_u7
00:1bb3 DoDMGEffect.wvb_u8
00:1bbe DoDMGEffect.loop3
00:1bc0 DoDMGEffect.wvb_u9
00:1bc7 DoDMGEffect.wvbe_u10
00:1bd1 DoDMGEffect.wvb_u11
00:1bdc DoDMGEffect.loop4
00:1bde DoDMGEffect.wvb_u12
00:1be5 DoDMGEffect.wvbe_u13
00:1bee TimeInit
00:1c03 ResetTime
00:1c0e HandleTimers
00:1c3b UnsafeMemCopy
00:1c44 SafeMemCopy.wvr_u1
00:1c44 SafeMemCopy
00:1c53 UnsafeMemSet
00:1c5b SafeMemSet
00:1c5b SafeMemSet.wvr_u2
00:1c69 SwitchToGameplay
00:1c73 SwitchToGameplayBig
00:1c7d GamePlayEventLoopHandler
00:1c87 GamePlayBigEventLoopHandler
00:1c91 CopyOAMHandler
00:1c9d ClearOAM
00:1cb3 OAMDMA
00:1cbd OAMDMAEnd
00:0354 GBCTitleInit.agb
00:0524 GBCTitleInit.postpalettes
00:0564 GBCGameplayInit
00:0745 GBCGameplayInit.agb
00:0915 GBCGameplayInit.postpalettes
00:0940 GBCTitleProcess
00:096e GBCTitleProcess.nores
00:0971 GBCTitleProcess.noinc
00:0995 GBCGameplayProcess
00:09cf GBCGameplayProcess.goverride
00:09f6 GBCGameplayProcess.colorfield
00:0a01 GBCGameplayProcess.outer0
00:0a06 GBCGameplayProcess.inner0
00:0a29 GBCGameplayProcess.outer1
00:0a2e GBCGameplayProcess.inner1
00:0a52 GBCGameplayProcess.outer2
00:0a57 GBCGameplayProcess.inner2
00:0a7c GBCGameplayProcess.empty
00:0a80 GBCGameplayProcess.sub59
00:0a82 GBCGameplayProcess.sub52
00:0a84 GBCGameplayProcess.sub45
00:0a86 GBCGameplayProcess.sub38
00:0a88 GBCGameplayProcess.sub31
00:0a8a GBCGameplayProcess.sub24
00:0a8c GBCGameplayProcess.sub17
00:0a8e GBCGameplayProcess.sub10
00:0a90 GBCGameplayProcess.done
00:0ab2 GBCGameplayProcess.darker
00:0ab9 GBCGameplayProcess.wvr_u1
00:0ac6 GBCGameplayProcess.lighter
00:0acd GBCGameplayProcess.wvr_u2
00:0ada GBCGameplayProcess.black
00:0ae1 GBCGameplayProcess.wvr_u3
00:0aee GBCBigGameplayProcess
00:0b28 GBCBigGameplayProcess.goverride
00:0b4f GBCBigGameplayProcess.colorfield
00:0b5a GBCBigGameplayProcess.outer0
00:0b5f GBCBigGameplayProcess.inner0
00:0b82 GBCBigGameplayProcess.outer1
00:0b87 GBCBigGameplayProcess.inner1
00:0bab GBCBigGameplayProcess.outer2
00:0bb0 GBCBigGameplayProcess.inner2
00:0bd5 GBCBigGameplayProcess.empty
00:0bd9 GBCBigGameplayProcess.sub59
00:0bdb GBCBigGameplayProcess.sub52
00:0bdd GBCBigGameplayProcess.sub45
00:0bdf GBCBigGameplayProcess.sub38
00:0be1 GBCBigGameplayProcess.sub31
00:0be3 GBCBigGameplayProcess.sub24
00:0be5 GBCBigGameplayProcess.sub17
00:0be7 GBCBigGameplayProcess.sub10
00:0be9 GBCBigGameplayProcess.done
00:0c0b GBCBigGameplayProcess.darker
00:0c12 GBCBigGameplayProcess.wvr_u4
00:0c1f GBCBigGameplayProcess.lighter
00:0c26 GBCBigGameplayProcess.wvr_u5
00:0c33 GBCBigGameplayProcess.black
00:0c3a GBCBigGameplayProcess.wvr_u6
00:0c47 ToVRAM
00:0c47 GBCBlitField
00:0c7a BlitField
00:0e3d BlitField.waitendvbloop
00:1002 BigBlitField
00:11c5 BigBlitField.waitendvbloop
00:138a ApplyTells
00:13e1 ApplyNext
00:1411 ApplyNext.regular
00:1417 ApplyNext.postoffsets
00:141b ApplyNext.getoffn
00:1426 ApplyNext.skipoffn
00:149f ApplyHold
00:14bb ApplyHold.hide
00:14cd ApplyHold.show
00:14dd ApplyHold.x
00:14ed ApplyHold.regular
00:14f3 ApplyHold.postoffsets
00:14f7 ApplyHold.getoffh
00:1502 ApplyHold.skipoffh
00:1535 ApplyNumbers6
00:155d ApplyNumbers4
00:1579 SetNumberSpritePositions
00:1654 SFXInit
00:1674 SFXPopQueue
00:1689 SFXPushQueue
00:169a SFXProcessQueue
00:16c4 SFXTriggerNoise
00:16ea SFXEnqueue
00:183e SFXKill
00:1860 SFXPlayNoise
00:186b SFXPlayNoise.noisereg
00:1882 SFXPlayNoise.savenoiseplayhead
00:188b SFXPlay
00:1899 SFXPlay.play
00:18a5 SFXPlay.getRegister
00:18b9 SFXPlay.savePlayhead
00:18c2 RNGInit
00:190d RNGInit.complexinit
00:193e ShiftHistory
00:195b GetNextHellPiece
00:1960 GetNextTGM1Piece
00:197d GetNextTGM2Piece
00:199a GetNextNesPiece
00:19a8 GetNextTGM3Piece
00:1a5f GetNextPiece
00:1a6d GetNextPiece.nextpiecejumps
00:1a7c Next35Piece
00:1a86 Next7Piece
00:1a90 NextByte
00:1ab0 LevelInit
00:1b00 LevelUp
00:1b24 LevelUp.doit
00:1b68 LevelUp.checknlevel
00:1bb7 LevelUp.bellmaybe
00:1bc9 LevelUp.leveljinglemaybe
00:1bd6 LevelUp.checkspeedup
00:1c12 DoSpeedUp
00:1c53 InputInit
00:1c65 GetInput
00:1c65 GetInput.btns
00:1c72 GetInput.readA
00:1c76 GetInput.setA
00:1c81 GetInput.clearA
00:1c84 GetInput.readB
00:1c88 GetInput.setB
00:1c93 GetInput.clearB
00:1c96 GetInput.readSelect
00:1c9a GetInput.setSelect
00:1ca5 GetInput.clearSelect
00:1ca8 GetInput.readStart
00:1cac GetInput.setStart
00:1cb7 GetInput.clearStart
00:1cba GetInput.dpad
00:1cc7 GetInput.readUp
00:1ccb GetInput.setUp
00:1cd6 GetInput.clearUp
00:1cd9 GetInput.readDown
00:1cdd GetInput.setDown
00:1ce8 GetInput.clearDown
00:1ceb GetInput.readLeft
00:1cef GetInput.setLeft
00:1cfa GetInput.clearLeft
00:1cfd GetInput.readRight
00:1d01 GetInput.setRight
00:1d0c GetInput.clearRight
00:1d0f GetInput.priorities
00:1d1a GetInput.zero
00:1d20 ScoreInit
00:1d40 IncreaseScore
00:1d74 IncreaseScore.doConvert
00:1d8c IncreaseScore.carry
00:1d8e IncreaseScore.postConvert
00:1da2 IncreaseScore.preAddDigit
00:1dc2 IncreaseScore.addDigit
00:1dd8 IncreaseScore.nextDigit
00:1dec Main
00:1e01 Main.wvr_u1
00:1e1a Main.notgbc
00:1e47 Main.nocolortiles
00:1e68 Main.wvb_u2
00:1e73 EventLoop
00:1e89 EventLoop.eventloopjumps
00:1e92 EventLoopPostHandler
00:1e94 EventLoopPostHandler.wvb_u3
00:1ea6 EventLoopPostHandler.vblankjumps
00:1eaf RestoreSRAM
00:1f08 InitializeSRAM
00:1f66 DoDMGEffect
00:1f6e DoDMGEffect.loop0
00:1f70 DoDMGEffect.wvb_u1
00:1f7c DoDMGEffect.wvbe_u2
00:1f86 DoDMGEffect.loop1
00:1f88 DoDMGEffect.wvb_u3
00:1f95 DoDMGEffect.wvbe_u4
00:1f9f DoDMGEffect.wvb_u5
00:1faa DoDMGEffect.loop2
00:1fac DoDMGEffect.wvb_u6
00:1fb3 DoDMGEffect.wvbe_u7
00:1fbd DoDMGEffect.wvb_u8
00:1fc8 DoDMGEffect.loop3
00:1fca DoDMGEffect.wvb_u9
00:1fd1 DoDMGEffect.wvbe_u10
00:1fdb DoDMGEffect.wvb_u11
00:1fe6 DoDMGEffect.loop4
00:1fe8 DoDMGEffect.wvb_u12
00:1fef DoDMGEffect.wvbe_u13
00:1ff8 TimeInit
00:200d ResetTime
00:2018 HandleTimers
00:2045 UnsafeMemCopy
00:204e SafeMemCopy.wvr_u1
00:204e SafeMemCopy
00:205d UnsafeMemSet
00:2065 SafeMemSet
00:2065 SafeMemSet.wvr_u2
00:2073 SwitchToGameplay
00:207d SwitchToGameplayBig
00:2087 GamePlayEventLoopHandler
00:2091 GamePlayBigEventLoopHandler
00:209b CopyOAMHandler
00:20a7 ClearOAM
00:20bd OAMDMA
00:20c7 OAMDMAEnd
01:4008 sDMGTSpeedCurve
01:4210 sDMGTSpeedCurveEnd
01:4212 sTGM1SpeedCurve

View File

@ -21,6 +21,9 @@ MAPPER := 0x1B
# Do not insert nop after halt
ASFLAGS += -h
# 8.24 fixed point.
ASFLAGS += -Q 25
# Extra fix flags
# Set as gbc compatible
FIXFLAGS += -c

View File

@ -21,6 +21,54 @@ DEF GBC_ASM EQU 1
INCLUDE "globals.asm"
; Standard B/W
DEF_RGB555_FROM24 BLACK, $00, $00, $00
DEF_RGB555_FROM24 GRAY_0, $55, $55, $55
DEF_RGB555_FROM24 GRAY_1, $AA, $AA, $AA
DEF_RGB555_FROM24 WHITE, $FF, $FF, $FF
; I piece
DEF_RGB555_FROM24 RED_0, $A2, $24, $24
DEF_RGB555_FROM24 RED_1, $D3, $2F, $2F
DEF_RGB555_FROM24 RED_2, $DE, $60, $60
DEF_RGB555_FROM24 RED_3, $FF, $FF, $FF
; S piece
DEF_RGB555_FROM24 GREEN_0, $2B, $6D, $2E
DEF_RGB555_FROM24 GREEN_1, $38, $8E, $3C
DEF_RGB555_FROM24 GREEN_2, $67, $A9, $6A
DEF_RGB555_FROM24 GREEN_3, $FF, $FF, $FF
; Z piece
DEF_RGB555_FROM24 PURPLE_0, $5F, $16, $7C
DEF_RGB555_FROM24 PURPLE_1, $7B, $1F, $A2
DEF_RGB555_FROM24 PURPLE_2, $9A, $53, $B7
DEF_RGB555_FROM24 PURPLE_3, $FF, $FF, $FF
; J piece
DEF_RGB555_FROM24 BLUE_0, $10, $4D, $94
DEF_RGB555_FROM24 BLUE_1, $15, $65, $C0
DEF_RGB555_FROM24 BLUE_2, $4B, $89, $CF
DEF_RGB555_FROM24 BLUE_3, $FF, $FF, $FF
; L piece
DEF_RGB555_FROM24 ORANGE_0, $BB, $5F, $00
DEF_RGB555_FROM24 ORANGE_1, $F7, $7D, $00
DEF_RGB555_FROM24 ORANGE_2, $F7, $9B, $3B
DEF_RGB555_FROM24 ORANGE_3, $FF, $FF, $FF
; O piece
DEF_RGB555_FROM24 YELLOW_0, $C0, $94, $23
DEF_RGB555_FROM24 YELLOW_1, $FB, $C0, $2D
DEF_RGB555_FROM24 YELLOW_2, $FC, $CE, $5E
DEF_RGB555_FROM24 YELLOW_3, $FF, $FF, $FF
; T piece
DEF_RGB555_FROM24 CYAN_0, $02, $77, $AF
DEF_RGB555_FROM24 CYAN_1, $03, $9B, $E5
DEF_RGB555_FROM24 CYAN_2, $3D, $B2, $EB
DEF_RGB555_FROM24 CYAN_3, $FF, $FF, $FF
DEF B0 EQU %0010000000000000
DEF B1 EQU %0100000000000000
DEF B2 EQU %0101000000000000
@ -79,249 +127,30 @@ GBCTitleInit::
ld a, [wInitialA]
cp a, $11
ret nz
ld a, BCPSF_AUTOINC
ldh [rBCPS], a
ldh [rOCPS], a
; Pal 0 (red, I)
ld bc, %0000000000000000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 1 (green, Z)
ld bc, %0000000000000000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, G1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, G2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, G3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 2 (purple, S)
ld bc, %0000000000000000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R1 | B1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R2 | B2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R3 | B3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 3 (blue, J)
ld bc, %0000000000000000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 4 (orange, L)
ld bc, %0000000000000000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R1 | G0
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R2 | G1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R3 | G2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 5 (yellow, O)
ld bc, %0000000000000000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R1 | G1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R2 | G2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R3 | G3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 6 (cyan, T)
ld bc, %0000000000000000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B1 | G1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B2 | G2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B3 | G3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 7 (grayscale, inverted)
ld bc, %0000000000000000
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, %0010000100001000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, %0100001000010000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, %0111111111111111
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Palettes.
ld a, [wInitialB]
bit 0, a
jp nz, .agb
WRITEPAL_A 0, BLACK_C, RED_0_C, RED_1_C, RED_2_C
WRITEPAL_A 1, BLACK_C, GREEN_0_C, GREEN_1_C, GREEN_2_C
WRITEPAL_A 2, BLACK_C, PURPLE_0_C, PURPLE_1_C, PURPLE_2_C
WRITEPAL_A 3, BLACK_C, BLUE_0_C, BLUE_1_C, BLUE_2_C
WRITEPAL_A 4, BLACK_C, ORANGE_0_C, ORANGE_1_C, ORANGE_2_C
WRITEPAL_A 5, BLACK_C, YELLOW_0_C, YELLOW_1_C, YELLOW_2_C
WRITEPAL_A 6, BLACK_C, CYAN_0_C, CYAN_1_C, CYAN_2_C
WRITEPAL_A 7, BLACK_C, GRAY_0_C, GRAY_1_C, WHITE_C
jp .postpalettes
.agb
WRITEPAL_A 0, BLACK_A, RED_0_A, RED_1_A, RED_2_A
WRITEPAL_A 1, BLACK_A, GREEN_0_A, GREEN_1_A, GREEN_2_A
WRITEPAL_A 2, BLACK_A, PURPLE_0_A, PURPLE_1_A, PURPLE_2_A
WRITEPAL_A 3, BLACK_A, BLUE_0_A, BLUE_1_A, BLUE_2_A
WRITEPAL_A 4, BLACK_A, ORANGE_0_A, ORANGE_1_A, ORANGE_2_A
WRITEPAL_A 5, BLACK_A, YELLOW_0_A, YELLOW_1_A, YELLOW_2_A
WRITEPAL_A 6, BLACK_A, CYAN_0_A, CYAN_1_A, CYAN_2_A
WRITEPAL_A 7, BLACK_A, GRAY_0_A, GRAY_1_A, WHITE_A
.postpalettes
; Copy the tilemap to shadow.
ld de, $9800
@ -361,270 +190,30 @@ GBCGameplayInit::
ld a, [wInitialA]
cp a, $11
ret nz
ld a, BCPSF_AUTOINC
ldh [rBCPS], a
ldh [rOCPS], a
; Pal 0 (red, I)
ld bc, R3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R0
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 1 (green, Z)
ld bc, G3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, G2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, G1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, G0
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 2 (purple, S)
ld bc, R2 | B3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R1 | B2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R0 | B1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B0 | %0000000000000010
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 3 (blue, J)
ld bc, B3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B0
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 4 (orange, L)
ld bc, R3 | G2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R2 | G1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R1 | G0
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R0
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 5 (yellow, O)
ld bc, R3 | G3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R2 | G2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R1 | G1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, R0 | G0
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 6 (cyan, T)
ld bc, B3 | G3
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B2 | G2
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B1 | G1
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, B0 | G0
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
; Pal 7 (grayscale)
ld bc, %0111111111111111
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, %0100001000010000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, %0010000100001000
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld bc, %0000000000000000
ld a, b
ldh [rBCPD], a
ldh [rOCPD], a
ld a, c
ldh [rBCPD], a
ldh [rOCPD], a
; Palettes.
ld a, [wInitialB]
bit 0, a
jp nz, .agb
WRITEPAL_A 0, RED_3_C, RED_2_C, RED_1_C, RED_0_C
WRITEPAL_A 1, GREEN_3_C, GREEN_2_C, GREEN_1_C, GREEN_0_C
WRITEPAL_A 2, PURPLE_3_C, PURPLE_2_C, PURPLE_1_C, PURPLE_0_C
WRITEPAL_A 3, BLUE_3_C, BLUE_2_C, BLUE_1_C, BLUE_0_C
WRITEPAL_A 4, ORANGE_3_C, ORANGE_2_C, ORANGE_1_C, ORANGE_0_C
WRITEPAL_A 5, YELLOW_3_C, YELLOW_2_C, YELLOW_1_C, YELLOW_0_C
WRITEPAL_A 6, CYAN_3_C, CYAN_2_C, CYAN_1_C, CYAN_0_C
WRITEPAL_A 7, WHITE_C, GRAY_1_C, GRAY_0_C, BLACK_C
jp .postpalettes
.agb
WRITEPAL_A 0, RED_3_A, RED_2_A, RED_1_A, RED_0_A
WRITEPAL_A 1, GREEN_3_A, GREEN_2_A, GREEN_1_A, GREEN_0_A
WRITEPAL_A 2, PURPLE_3_A, PURPLE_2_A, PURPLE_1_A, PURPLE_0_A
WRITEPAL_A 3, BLUE_3_A, BLUE_2_A, BLUE_1_A, BLUE_0_A
WRITEPAL_A 4, ORANGE_3_A, ORANGE_2_A, ORANGE_1_A, ORANGE_0_A
WRITEPAL_A 5, YELLOW_3_A, YELLOW_2_A, YELLOW_1_A, YELLOW_0_A
WRITEPAL_A 6, CYAN_3_A, CYAN_2_A, CYAN_1_A, CYAN_0_A
WRITEPAL_A 7, WHITE_A, GRAY_1_A, GRAY_0_A, BLACK_A
.postpalettes
; Copy the tilemap to shadow.
ld de, $9800

View File

@ -21,6 +21,7 @@ DEF GLOBALS_ASM EQU 1
INCLUDE "hardware.inc"
INCLUDE "structs.asm"
INCLUDE "rgb555.asm"
; Set up charmap.

313
src/include/rgb555.asm Normal file
View File

@ -0,0 +1,313 @@
; DMGTRIS
; Copyright (C) 2023 - Randy Thiemann <randy.thiemann@gmail.com>
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <https://www.gnu.org/licenses/>.
IF !DEF(RGB555_ASM)
DEF RGB555_ASM EQU 1
INCLUDE "hardware.inc"
; Macro to define an RGB555 color to be used in CGB mode.
; Will result in a symbol named COLORNAME, COLORNAME_A and COLORNAME_C being created.
; Usage:
; DEF_RGB555 COLORNAME, R, G, B
MACRO DEF_RGB555
ASSERT (\2) >= 0 && (\2) <= 31, "ERROR in DEF_RGB555: R value given was not in the range [0; 31]."
ASSERT (\3) >= 0 && (\3) <= 31, "ERROR in DEF_RGB555: G value given was not in the range [0; 31]."
ASSERT (\4) >= 0 && (\4) <= 31, "ERROR in DEF_RGB555: B value given was not in the range [0; 31]."
DEF COLOR EQUS "\1"
; Uncorrected
DEF RED_A EQU (\2 & $1F)
DEF GREEN_A EQU (\3 & $1F)
DEF BLUE_A EQU (\4 & $1F)
DEF {COLOR} EQU (RED_A << 0) | (GREEN_A << 5) | (BLUE_A << 10)
DEF {COLOR}_A EQU (RED_A << 0) | (GREEN_A << 5) | (BLUE_A << 10)
; Transfer function.
DEF GAMMA EQU 2.0q25
DEF INVGAMMA EQU DIV(1.0q25, 2.0q25, 25)
DEF RGBMAX EQU 31.0q25
DEF INVRGBMAX EQU DIV(1.0q25, 31.0q25, 25)
; From display gamma.
DEF R_C0 EQU POW(MUL(R_A << 25, INVRGBMAX), GAMMA, 25)
DEF G_C0 EQU POW(MUL(G_A << 25, INVRGBMAX), GAMMA, 25)
DEF B_C0 EQU POW(MUL(B_A << 25, INVRGBMAX), GAMMA, 25)
; To convert a color as displayed on a game boy color to the original color, the following formulas must be applied:
; R' = (0.86629 * R) + (0.13361 * G) + (0.00000 * B)
; G' = (0.02429 * R) + (0.70857 * G) + (0.25714 * B)
; B' = (0.11337 * R) + (0.11448 * G) + (0.77215 * B)
; We need the inverted matrix here.
DEF R_C1 EQU (MUL(R_C0, +1.15039q25, 25) + MUL(G_C0, -0.22976q25, 25) + MUL(B_C0, +0.07949q25, 25))
DEF G_C1 EQU (MUL(R_C0, +0.02568q25, 25) + MUL(G_C0, +1.48972q25, 25) + MUL(B_C0, -0.51540q25, 25))
DEF B_C1 EQU (MUL(R_C0, -0.17271q25, 25) + MUL(G_C0, -0.18713q25, 25) + MUL(B_C0, +1.35983q25, 25))
; DEF R_C1 EQU (MUL(R_C0, +1.0q25, 25) + MUL(G_C0, +0.0q25, 25) + MUL(B_C0, +0.0q25, 25))
; DEF G_C1 EQU (MUL(R_C0, +0.0q25, 25) + MUL(G_C0, +1.0q25, 25) + MUL(B_C0, +0.0q25, 25))
; DEF B_C1 EQU (MUL(R_C0, +0.0q25, 25) + MUL(G_C0, +0.0q25, 25) + MUL(B_C0, +1.0q25, 25))
; To display gamma.
DEF R_C2 EQU MUL(RGBMAX, POW(R_C1, INVGAMMA, 25), 25)
DEF G_C2 EQU MUL(RGBMAX, POW(G_C1, INVGAMMA, 25), 25)
DEF B_C2 EQU MUL(RGBMAX, POW(B_C1, INVGAMMA, 25), 25)
; To display color.
DEF R_C3 = (FLOOR(R_C2 + 0.5q25, 25) >> 25)
DEF G_C3 = (FLOOR(G_C2 + 0.5q25, 25) >> 25)
DEF B_C3 = (FLOOR(B_C2 + 0.5q25, 25) >> 25)
; Clamping
IF (R_C3) < 0
DEF R_C3 = 0
ENDC
IF (R_C3) > 31
DEF R_C3 = 31
ENDC
IF (G_C3) < 0
DEF G_C3 = 0
ENDC
IF (G_C3) > 31
DEF G_C3 = 31
ENDC
IF (B_C3) < 0
DEF B_C3 = 0
ENDC
IF (B_C3) > 31
DEF B_C3 = 31
ENDC
DEF R_C EQU (R_C3 & $1F)
DEF G_C EQU (G_C3 & $1F)
DEF B_C EQU (B_C3 & $1F)
DEF {COLOR}_C EQU (R_C << 0) | (G_C << 5) | (B_C << 10)
PURGE COLOR, R_A, G_A, B_A, GAMMA, INVGAMMA, RGBMAX, INVRGBMAX, R_C0, G_C0, B_C0, R_C1, G_C1, B_C1, R_C2, G_C2, B_C2, R_C3, G_C3, B_C3, R_C, G_C, B_C
ENDM
; Macro to define an RGB555 color to be used in CGB mode using standard 32 bit color semantics.
; Will result in a symbol named COLORNAME, COLORNAME_A and COLORNAME_C being created.
; Usage:
; DEF_RGB555_FROM24 COLORNAME, R, G, B
MACRO DEF_RGB555_FROM24
ASSERT (\2) >= 0 && (\2) <= 255, "ERROR in DEF_RGB555_FROM24: R value given was not in the range [0; 255]."
ASSERT (\3) >= 0 && (\3) <= 255, "ERROR in DEF_RGB555_FROM24: G value given was not in the range [0; 255]."
ASSERT (\4) >= 0 && (\4) <= 255, "ERROR in DEF_RGB555_FROM24: B value given was not in the range [0; 255]."
DEF COLOR EQUS "\1"
; Uncorrected
DEF R_A EQU ((\2 >> 3) & $1F)
DEF G_A EQU ((\3 >> 3) & $1F)
DEF B_A EQU ((\4 >> 3) & $1F)
DEF {COLOR} EQU (R_A << 0) | (G_A << 5) | (B_A << 10)
DEF {COLOR}_A EQU (R_A << 0) | (G_A << 5) | (B_A << 10)
; Transfer function.
DEF GAMMA EQU 2.0q25
DEF INVGAMMA EQU DIV(1.0q25, 2.0q25, 25)
DEF RGBMAX EQU 31.0q25
DEF INVRGBMAX EQU DIV(1.0q25, 31.0q25, 25)
; From display gamma.
DEF R_C0 EQU POW(MUL(R_A << 25, INVRGBMAX), GAMMA, 25)
DEF G_C0 EQU POW(MUL(G_A << 25, INVRGBMAX), GAMMA, 25)
DEF B_C0 EQU POW(MUL(B_A << 25, INVRGBMAX), GAMMA, 25)
; To convert a color as displayed on a game boy color to the original color, the following formulas must be applied:
; R' = (0.86629 * R) + (0.13361 * G) + (0.00000 * B)
; G' = (0.02429 * R) + (0.70857 * G) + (0.25714 * B)
; B' = (0.11337 * R) + (0.11448 * G) + (0.77215 * B)
; We need the inverted matrix here.
DEF R_C1 EQU (MUL(R_C0, +1.15039q25, 25) + MUL(G_C0, -0.22976q25, 25) + MUL(B_C0, +0.07949q25, 25))
DEF G_C1 EQU (MUL(R_C0, +0.02568q25, 25) + MUL(G_C0, +1.48972q25, 25) + MUL(B_C0, -0.51540q25, 25))
DEF B_C1 EQU (MUL(R_C0, -0.17271q25, 25) + MUL(G_C0, -0.18713q25, 25) + MUL(B_C0, +1.35983q25, 25))
; DEF R_C1 EQU (MUL(R_C0, +1.0q25, 25) + MUL(G_C0, +0.0q25, 25) + MUL(B_C0, +0.0q25, 25))
; DEF G_C1 EQU (MUL(R_C0, +0.0q25, 25) + MUL(G_C0, +1.0q25, 25) + MUL(B_C0, +0.0q25, 25))
; DEF B_C1 EQU (MUL(R_C0, +0.0q25, 25) + MUL(G_C0, +0.0q25, 25) + MUL(B_C0, +1.0q25, 25))
; To display gamma.
DEF R_C2 EQU MUL(RGBMAX, POW(R_C1, INVGAMMA, 25), 25)
DEF G_C2 EQU MUL(RGBMAX, POW(G_C1, INVGAMMA, 25), 25)
DEF B_C2 EQU MUL(RGBMAX, POW(B_C1, INVGAMMA, 25), 25)
; To display color.
DEF R_C3 = (FLOOR(R_C2 + 0.5q25, 25) >> 25)
DEF G_C3 = (FLOOR(G_C2 + 0.5q25, 25) >> 25)
DEF B_C3 = (FLOOR(B_C2 + 0.5q25, 25) >> 25)
; Clamping
IF (R_C3) < 0
DEF R_C3 = 0
ENDC
IF (R_C3) > 31
DEF R_C3 = 31
ENDC
IF (G_C3) < 0
DEF G_C3 = 0
ENDC
IF (G_C3) > 31
DEF G_C3 = 31
ENDC
IF (B_C3) < 0
DEF B_C3 = 0
ENDC
IF (B_C3) > 31
DEF B_C3 = 31
ENDC
DEF R_C EQU (R_C3 & $1F)
DEF G_C EQU (G_C3 & $1F)
DEF B_C EQU (B_C3 & $1F)
DEF {COLOR}_C EQU (R_C << 0) | (G_C << 5) | (B_C << 10)
PURGE COLOR, R_A, G_A, B_A, GAMMA, INVGAMMA, RGBMAX, INVRGBMAX, R_C0, G_C0, B_C0, R_C1, G_C1, B_C1, R_C2, G_C2, B_C2, R_C3, G_C3, B_C3, R_C, G_C, B_C
ENDM
; Macro to write a set of 4 colors to a CGB background palette.
; Usage:
; WRITEPAL_B ID, COLOR0, COLOR1, COLOR2, COLOR3
MACRO WRITEPAL_B
ASSERT (\1) >= 0 && (\1) <= 7, "ERROR in WRITEPAL_B: ID value given was not in the range [0; 7]."
ld a, BCPSF_AUTOINC | (\1 * 8)
ldh [rBCPS], a
ld bc, \2
ld a, c
ldh [rBCPD], a
ld a, b
ldh [rBCPD], a
ld bc, \3
ld a, c
ldh [rBCPD], a
ld a, b
ldh [rBCPD], a
ld bc, \4
ld a, c
ldh [rBCPD], a
ld a, b
ldh [rBCPD], a
ld bc, \5
ld a, c
ldh [rBCPD], a
ld a, b
ldh [rBCPD], a
ENDM
; Macro to write a set of 4 colors to a CGB object palette.
; Usage:
; WRITEPAL_O ID, COLOR0, COLOR1, COLOR2, COLOR3
MACRO WRITEPAL_O
ASSERT (\1) >= 0 && (\1) <= 7, "ERROR in WRITEPAL_O: ID value given was not in the range [0; 7]."
ld a, 0CPSF_AUTOINC | (\1 * 8)
ldh [rOCPS], a
ld bc, \2
ld a, c
ldh [rOCPD], a
ld a, b
ldh [rOCPD], a
ld bc, \3
ld a, c
ldh [rOCPD], a
ld a, b
ldh [rOCPD], a
ld bc, \4
ld a, c
ldh [rOCPD], a
ld a, b
ldh [rOCPD], a
ld bc, \5
ld a, c
ldh [rOCPD], a
ld a, b
ldh [rOCPD], a
ENDM
; Macro to write a set of 4 colors to a CGB object and background palette.
; Usage:
; WRITEPAL_A ID, COLOR0, COLOR1, COLOR2, COLOR3
MACRO WRITEPAL_A
ASSERT (\1) >= 0 && (\1) <= 7, "ERROR in WRITEPAL_O: ID value given was not in the range [0; 7]."
ld a, OCPSF_AUTOINC | (\1 * 8)
ldh [rOCPS], a
ldh [rBCPS], a
ld bc, \2
ld a, c
ldh [rOCPD], a
ldh [rBCPD], a
ld a, b
ldh [rOCPD], a
ldh [rBCPD], a
ld bc, \3
ld a, c
ldh [rOCPD], a
ldh [rBCPD], a
ld a, b
ldh [rOCPD], a
ldh [rBCPD], a
ld bc, \4
ld a, c
ldh [rOCPD], a
ldh [rBCPD], a
ld a, b
ldh [rOCPD], a
ldh [rBCPD], a
ld bc, \5
ld a, c
ldh [rOCPD], a
ldh [rBCPD], a
ld a, b
ldh [rOCPD], a
ldh [rBCPD], a
ENDM
ENDC