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

Binary file not shown.

View File

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

View File

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

View File

@ -21,6 +21,54 @@ DEF GBC_ASM EQU 1
INCLUDE "globals.asm" 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 B0 EQU %0010000000000000
DEF B1 EQU %0100000000000000 DEF B1 EQU %0100000000000000
DEF B2 EQU %0101000000000000 DEF B2 EQU %0101000000000000
@ -79,249 +127,30 @@ GBCTitleInit::
ld a, [wInitialA] ld a, [wInitialA]
cp a, $11 cp a, $11
ret nz ret nz
ld a, BCPSF_AUTOINC
ldh [rBCPS], a
ldh [rOCPS], a
; Pal 0 (red, I) ; Palettes.
ld bc, %0000000000000000 ld a, [wInitialB]
ld a, c bit 0, a
ldh [rBCPD], a jp nz, .agb
ldh [rOCPD], a WRITEPAL_A 0, BLACK_C, RED_0_C, RED_1_C, RED_2_C
ld a, b WRITEPAL_A 1, BLACK_C, GREEN_0_C, GREEN_1_C, GREEN_2_C
ldh [rBCPD], a WRITEPAL_A 2, BLACK_C, PURPLE_0_C, PURPLE_1_C, PURPLE_2_C
ldh [rOCPD], a WRITEPAL_A 3, BLACK_C, BLUE_0_C, BLUE_1_C, BLUE_2_C
ld bc, R1 WRITEPAL_A 4, BLACK_C, ORANGE_0_C, ORANGE_1_C, ORANGE_2_C
ld a, c WRITEPAL_A 5, BLACK_C, YELLOW_0_C, YELLOW_1_C, YELLOW_2_C
ldh [rBCPD], a WRITEPAL_A 6, BLACK_C, CYAN_0_C, CYAN_1_C, CYAN_2_C
ldh [rOCPD], a WRITEPAL_A 7, BLACK_C, GRAY_0_C, GRAY_1_C, WHITE_C
ld a, b jp .postpalettes
ldh [rBCPD], a .agb
ldh [rOCPD], a WRITEPAL_A 0, BLACK_A, RED_0_A, RED_1_A, RED_2_A
ld bc, R2 WRITEPAL_A 1, BLACK_A, GREEN_0_A, GREEN_1_A, GREEN_2_A
ld a, c WRITEPAL_A 2, BLACK_A, PURPLE_0_A, PURPLE_1_A, PURPLE_2_A
ldh [rBCPD], a WRITEPAL_A 3, BLACK_A, BLUE_0_A, BLUE_1_A, BLUE_2_A
ldh [rOCPD], a WRITEPAL_A 4, BLACK_A, ORANGE_0_A, ORANGE_1_A, ORANGE_2_A
ld a, b WRITEPAL_A 5, BLACK_A, YELLOW_0_A, YELLOW_1_A, YELLOW_2_A
ldh [rBCPD], a WRITEPAL_A 6, BLACK_A, CYAN_0_A, CYAN_1_A, CYAN_2_A
ldh [rOCPD], a WRITEPAL_A 7, BLACK_A, GRAY_0_A, GRAY_1_A, WHITE_A
ld bc, R3 .postpalettes
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
; Copy the tilemap to shadow. ; Copy the tilemap to shadow.
ld de, $9800 ld de, $9800
@ -361,270 +190,30 @@ GBCGameplayInit::
ld a, [wInitialA] ld a, [wInitialA]
cp a, $11 cp a, $11
ret nz ret nz
ld a, BCPSF_AUTOINC
ldh [rBCPS], a
ldh [rOCPS], a
; Pal 0 (red, I) ; Palettes.
ld bc, R3 ld a, [wInitialB]
ld a, c bit 0, a
ldh [rBCPD], a jp nz, .agb
ldh [rOCPD], a WRITEPAL_A 0, RED_3_C, RED_2_C, RED_1_C, RED_0_C
ld a, b WRITEPAL_A 1, GREEN_3_C, GREEN_2_C, GREEN_1_C, GREEN_0_C
ldh [rBCPD], a WRITEPAL_A 2, PURPLE_3_C, PURPLE_2_C, PURPLE_1_C, PURPLE_0_C
ldh [rOCPD], a 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
ld bc, R2 WRITEPAL_A 5, YELLOW_3_C, YELLOW_2_C, YELLOW_1_C, YELLOW_0_C
ld a, c WRITEPAL_A 6, CYAN_3_C, CYAN_2_C, CYAN_1_C, CYAN_0_C
ldh [rBCPD], a WRITEPAL_A 7, WHITE_C, GRAY_1_C, GRAY_0_C, BLACK_C
ldh [rOCPD], a jp .postpalettes
ld a, b .agb
ldh [rBCPD], a WRITEPAL_A 0, RED_3_A, RED_2_A, RED_1_A, RED_0_A
ldh [rOCPD], 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
ld bc, R1 WRITEPAL_A 3, BLUE_3_A, BLUE_2_A, BLUE_1_A, BLUE_0_A
ld a, c WRITEPAL_A 4, ORANGE_3_A, ORANGE_2_A, ORANGE_1_A, ORANGE_0_A
ldh [rBCPD], a WRITEPAL_A 5, YELLOW_3_A, YELLOW_2_A, YELLOW_1_A, YELLOW_0_A
ldh [rOCPD], a WRITEPAL_A 6, CYAN_3_A, CYAN_2_A, CYAN_1_A, CYAN_0_A
ld a, b WRITEPAL_A 7, WHITE_A, GRAY_1_A, GRAY_0_A, BLACK_A
ldh [rBCPD], a .postpalettes
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
; Copy the tilemap to shadow. ; Copy the tilemap to shadow.
ld de, $9800 ld de, $9800

View File

@ -21,6 +21,7 @@ DEF GLOBALS_ASM EQU 1
INCLUDE "hardware.inc" INCLUDE "hardware.inc"
INCLUDE "structs.asm" INCLUDE "structs.asm"
INCLUDE "rgb555.asm"
; Set up charmap. ; 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