Compare commits

..

No commits in common. "master" and "small-version" have entirely different histories.

86 changed files with 6375 additions and 41551 deletions

3
.gitignore vendored
View File

@ -1,7 +1,8 @@
/bin/
/obj/
/dep/
/res/
/tools/**
/src/res/sources/*.z80
/src/res/sources/*.inc
/bin/*.sav
DMGTRIS.sav

3
.vscode/launch.json vendored
View File

@ -8,7 +8,8 @@
"type": "emulicious-debugger",
"request": "launch",
"name": "Launch in Emulicious",
"program": "${workspaceFolder}\\bin\\PandorasBlocks.gbc",
"program": "${workspaceFolder}\\bin\\DMGTRIS.gbc",
"emuliciousPath": "K:\\TGM\\dmgtris\\tools",
"port": 58870,
"stopOnEntry": false,
"preLaunchTask": "buildrom"

BIN
DMGTRIS.GBC Normal file

Binary file not shown.

View File

@ -43,7 +43,7 @@ INCDIRS = src/ src/include/
WARNINGS = all extra
ASFLAGS = -p 0xFF $(addprefix -i,$(INCDIRS)) $(addprefix -W,$(WARNINGS))
LDFLAGS = -p 0xFF
FIXFLAGS = -p 0xFF -l 0x33 -r 0x04 -v -i $(GAMEID) -k $(LICENSEE) -t $(TITLE) -n $(VERSION) -m $(MAPPER)
FIXFLAGS = -p 0xFF -l 0x33 -r 0x02 -v -i $(GAMEID) -k $(LICENSEE) -t $(TITLE) -n $(VERSION) -m $(MAPPER)
# The list of "root" ASM files that RGBASM will be invoked on
SRCS = $(wildcard src/*.asm)
@ -52,7 +52,11 @@ SRCS = $(wildcard src/*.asm)
# Use this to override the above
include project.mk
################################################
# #
# TARGETS #
# #
################################################
# `all` (Default target): build the ROM
all: $(ROM)
@ -73,12 +77,52 @@ rebuild:
$(MAKE) all
.PHONY: rebuild
################################################
# #
# RESOURCE FILES #
# #
################################################
# By default, asset recipes convert files in `res/` into other files in `res/`
# This line causes assets not found in `res/` to be also looked for in `src/res/`
# "Source" assets can thus be safely stored there without `make clean` removing them
VPATH := src
res/%.1bpp: res/%.png
@$(MKDIR_P) $(@D)
$(RGBGFX) -d 1 -o $@ $<
# Define how to compress files using the PackBits16 codec
# Compressor script requires Python 3
res/%.pb16: res/% src/tools/pb16.py
@$(MKDIR_P) $(@D)
$(PY) src/tools/pb16.py $< res/$*.pb16
res/%.pb16.size: res/%
@$(MKDIR_P) $(@D)
$(call filesize,$<,16) > res/$*.pb16.size
# Define how to compress files using the PackBits8 codec
# Compressor script requires Python 3
res/%.pb8: res/% src/tools/pb8.py
@$(MKDIR_P) $(@D)
$(PY) src/tools/pb8.py $< res/$*.pb8
res/%.pb8.size: res/%
@$(MKDIR_P) $(@D)
$(call filesize,$<,8) > res/$*.pb8.size
###############################################
# #
# COMPILATION #
# #
###############################################
# How to build a ROM
$(BINDIR)/%.$(ROMEXT) $(BINDIR)/%.sym $(BINDIR)/%.map: $(patsubst src/%.asm,$(OBJDIR)/%.o,$(SRCS))
@$(MKDIR_P) $(@D)
$(RGBLINK) $(LDFLAGS) -m $(BINDIR)/$*.map -n $(BINDIR)/$*.sym -o $(BINDIR)/$*.$(ROMEXT) $^ \
$(RGBASM) $(ASFLAGS) -o $(OBJDIR)/build_date.o src/res/build_date.asm
$(RGBLINK) $(LDFLAGS) -m $(BINDIR)/$*.map -n $(BINDIR)/$*.sym -o $(BINDIR)/$*.$(ROMEXT) $^ $(OBJDIR)/build_date.o \
&& $(RGBFIX) -v $(FIXFLAGS) $(BINDIR)/$*.$(ROMEXT)
# `.mk` files are auto-generated dependency lists of the "root" ASM files, to save a lot of hassle.

106
README.md
View File

@ -1,5 +1,5 @@
# Pandora's Blocks
Pandora's Blocks (formerly DMGTRIS) is a block stacking game for the original game boy written in assembly.
# DMGTRIS
DMGTRIS is a block stacking game for the original game boy written in assembly.
The game is heavily inspired by the TGM series of games and has the following features:
- TLS (ghost piece) until 1G speeds.
@ -13,20 +13,6 @@ The game is heavily inspired by the TGM series of games and has the following fe
- A speed curve reminiscent of TGM, starting slightly faster and skipping the awkward speed reset. The game continues infinitely... But so does the speed increase.
- A rock solid 60FPS with a traditional 20x10 grid.
- Game boy color mode.
- Invisible rolls, big mode, including big mode rolls, bone pieces, and even torikans!
- Grading systems that are inspired by, but do not exactly mimic, those in the TGM series of games in many of the speed curves.
- A challenging final challenge awaits you at the end of all the finite modes.
- High scores.
## Playing
Try the game online [here](https://villadelfia.org/dmgtris/). Controls are arrow keys, Z, X, Space, and Enter. The online version has no sound though, so the better thing would be to run it in an emulator locally.
You can build the game yourself, or use the binary [here](https://git.villadelfia.org/villadelfia/dmgtris/raw/branch/master/bin/PandorasBlocks.gbc) or [here](https://github.com/Villadelfia/DMGTRIS/raw/master/bin/PandorasBlocks.gbc).
The game should run in any accurate emulator. For Windows or Linux using Wine [bgb](https://bgb.bircd.org/) is generally regarded as the best option. For macOS [SameBoy](https://sameboy.github.io/) comes recommended.
Please do not try running it on older emulators such as VBA, since this game uses the semi-randomness of the initial game boy memory as one source of RNG entropy.
## Options
@ -39,27 +25,20 @@ Choose between a few randomizer options:
- TGM2: 4 history, 6 rerolls.
- TGM3: The TGM3 RNG system.
- HELL: Pure Random.
- 1ROL: Reroll once if you get the same piece as the previous one.
- NES: Reroll once if you get the same piece as the previous one.
### Rot Mode
Select the rotation rules:
- ARS1: Classic ARS from TGM1 and TGM2.
- ARS2: ARS from TGM3.
- SEGA: No kicks.
- MYCO: Like ARS1, but without I, L, J and T restrictions.
### Drop Mode
Choose how the up and down buttons act:
- FIRM: Up drops to the bottom but does not lock until you are in neutral position. Down locks.
- SNIC: Like FIRM, but thre is no neutral lock.
- HARD: Up drops and locks. Down does not lock until you go neutral when the piece is grounded.
- LOCK: Like HARD but down locks.
- NONE: Up does nothing. Down locks.
Select whether up performs a sonic drop, a hard drop, or nothing at all.
### Speed Curve
Select between several speed curves including the DMGTRIS default speed curve, TGM1, TGM3, as well as DEATH and SHIRASE mode. In addition there's a "CHILL" curve for when you just want to enjoy some tetris. It doesn't speed up very fast at all. The MYCO speed curve mimics the excellent game Tromi by Mycophobia.
Select between several speed curves including the DMGTRIS default speed curve, TGM1, TGM3, as well as DEATH and SHIRASE mode. In addition there's a "CHILL" curve for when you just want to enjoy some tetris. It doesn't speed up very fast at all.
Note that all modes use the same scoring.
Note that all modes use the same scoring and they are all infinite.
### Always 20G
Whether you want instant-drop gravity to be active at any level.
@ -67,14 +46,6 @@ Whether you want instant-drop gravity to be active at any level.
### Start Level
Choose any of the speed breakpoints to start the game at.
### D-Pad Filter
Choose which D-Pad buttons get priority.
- DLRU: Down > Left/Right > Up
- ULRD: Up > Left/Right > Down
- LRUD: Left/Right > Up/Down
- UDLR: Up/Down > Left/Right
- NONE: No filtering or priority.
## Scoring
After each piece is dropped, a check is made:
@ -87,7 +58,7 @@ Lines = Lines cleared.
Level = The level before the lines were cleared.
Soft = Amount of frames the down button was held during this piece + double the rows the piece was sonic or hard dropped.
Soft = Amount of frames the down button was held during this piece + 10 if the piece was sonic or hard dropped.
Combo = Old combo + (2 x Lines) - 2
@ -98,12 +69,19 @@ ScoreIncrement = ((Level + Lines) >> 4 + 1 + Soft) x Combo x Lines x Bravo.
ScoreIncrement points are then awarded.
## Playing
You can build the game yourself, or use the binary [here](https://git.villadelfia.org/villadelfia/dmgtris/raw/branch/master/DMGTRIS.GBC) or [here](https://github.com/Villadelfia/DMGTRIS/raw/master/DMGTRIS.GBC).
The game should run in any accurate emulator. For Windows or Linux using Wine [bgb](https://bgb.bircd.org/) is generally regarded as the best option. For macOS [SameBoy](https://sameboy.github.io/) comes recommended.
Please do not try running it on older emulators such as VBA, since this game uses the semi-randomness of the initial game boy memory as one source of RNG entropy.
## Controls
### Menu
- A/B/Start — Navigate the menus
- A/B/Start — Start the game
- Up/Down — Change which option is selected
- Left/Right — Change the value of the option
- Select — Switch profiles while on the main menu, hold for 5 seconds to wipe the score table currently displayed when on the records screen.
### Gameplay
- A — Rotate 1
@ -113,65 +91,15 @@ ScoreIncrement points are then awarded.
- Up — Sonic/Hard drop
- Down — Soft drop/Lock
- Left/Right — Move
- A+B+Select — Bail to main menu if paused
### Game Over
- A — Restart immediately
- B — Go back to title
## Screenshots
Original Game Boy | Game Boy Color
:-: | :-:
<img src="https://villadelfia.org/i/xAAHfqDw.png" width="160" height="144" /> | <img src="https://villadelfia.org/i/Hj2P8Pk5.png" width="160" height="144" />
## Videos
### Original Game Boy
Normal Mode | Big Mode
:-: | :-:
[VIDEO](https://villadelfia.org/dmgtris/demo-dmg-normal.mp4) | [VIDEO](https://villadelfia.org/dmgtris/demo-dmg-big.mp4)
### Game Boy Color
Normal Mode | Big Mode
:-: | :-:
[VIDEO](https://villadelfia.org/dmgtris/demo-gbc-normal.mp4) | [VIDEO](https://villadelfia.org/dmgtris/demo-gbc-big.mp4)
## Building and Development
## Building
The game can be built using gnu make and the RGBDS toolchain.
A few guidelines are in effect:
- If you add a bank, please add a section to `bankid.asm` and follow the existing format.
- Stuff that goes in the sram belongs in the `sram.asm` file, where there exists code to init SRAM to known defaults.
## Reporting Bugs
If you have found a bug, please follow the following steps *before* sending a bug report. The easier you make it for me to find and fix a bug, the more likely it is that I will do so.
0. I do not own a analogue pocket, the `.pocket` version is released on a best effort basis and I cannot help with bugs that *only* happen on the analogue pocket. If you find a bug, please reproduce the bug on the `.gbc` version.
1. Download the latest `.gbc`, `.map` and `.sym` files from this repository.
2. Use either emulicious or bgb to reproduce the bug on that version, documenting the exact steps taken to make it happen. Please also include what should be happening if the bug is subtle.
3. Make a save state at the moment the bug starts happening.
4. Send the `.gbc`, `.map`, `.sym`, and save state files as well as the documentation of the bug to me.
I will try to fix all bugs that I can, but please remember that this is free software and that I can not, and do not, guarantee fitness for purpose.
## Shoutouts and Thanks
Thanks for playtesting and debugging go to:
- CreeperCraftYT™
- AntonErgo
- Lindtobias
- \_Zaphod77\_
- bbbbbr
The amazing logo was created by Lindtobias.
The tracks in this game were created by Pandora Nova, but the title screen was inspired by TGM2's Mode Select music, and the final challenge roll is a demake of Kenet & Rez' Unreal Superhero 3.
Parts of the grading system were contributed by CreeperCraftYT™
## License
Copyright (C) 2023 - Randy Thiemann <randy.thiemann@gmail.com>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +0,0 @@
@echo off
cd /D "%~dp0"
echo Cleaning up...
make clean > NUL
echo Making pocket version...
del /Q src\include\hardware.inc > NUL
copy src\include\hardware.analogue src\include\hardware.inc > NUL
make > NUL
echo Fixing pocket version header...
ren bin\PandorasBlocks.gbc PandorasBlocks.pocket > NUL
python patch_pocket.py > NUL
rgbfix -fhg -O bin\PandorasBlocks.pocket > NUL
echo Making GB version...
rd /S /Q obj > NUL
rd /S /Q dep > NUL
del /Q src\include\hardware.inc > NUL
copy src\include\hardware.nintendo src\include\hardware.inc > NUL
make > NUL
echo Pushing new version...
git add . > NUL
git commit -am %* > NUL
git push

View File

@ -1,5 +0,0 @@
logo = b"\x01\x10\xCE\xEF\x00\x00\x44\xAA\x00\x74\x00\x18\x11\x95\x00\x34\x00\x1A\x00\xD5\x00\x22\x00\x69\x6F\xF6\xF7\x73\x09\x90\xE1\x10\x44\x40\x9A\x90\xD5\xD0\x44\x30\xA9\x21\x5D\x48\x22\xE0\xF8\x60"
with open('bin/PandorasBlocks.pocket', 'rb+') as f:
f.seek(0x104)
f.write(logo)

View File

@ -11,18 +11,19 @@ TITLE := DMGTRIS
LICENSEE := NR
# Output options
ROMNAME := PandorasBlocks
ROMEXT := gbc
ROMNAME := DMGTRIS
ROMEXT := GBC
# Mapper
MAPPER := 0x1B
MAPPER := 0x03
# Extra assembler flags
# Do not insert nop after halt
ASFLAGS += -h
# 8.24 fixed point.
ASFLAGS += -Q 25
# Extra linker flags
# Tiny Rom
LDFLAGS += -t
# Extra fix flags
# Set as gbc compatible

View File

@ -1,86 +0,0 @@
; 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(BANKID_ASM)
DEF BANKID_ASM EQU 1
INCLUDE "globals.asm"
SECTION "Bank ID BANK_MAIN", ROM0[$0]
REPT 7
rst $00
ENDR
db BANK_MAIN
SECTION "Bank ID BANK_OTHER", ROMX[$4000], BANK[BANK_OTHER]
REPT 7
rst $00
ENDR
db BANK_OTHER
SECTION "Bank ID BANK_SFX", ROMX[$4000], BANK[BANK_SFX]
REPT 7
rst $00
ENDR
db BANK_SFX
SECTION "Bank ID BANK_TITLE", ROMX[$4000], BANK[BANK_TITLE]
REPT 7
rst $00
ENDR
db BANK_TITLE
SECTION "Bank ID BANK_GAMEPLAY", ROMX[$4000], BANK[BANK_GAMEPLAY]
REPT 7
rst $00
ENDR
db BANK_GAMEPLAY
SECTION "Bank ID BANK_GAMEPLAY_BIG", ROMX[$4000], BANK[BANK_GAMEPLAY_BIG]
REPT 7
rst $00
ENDR
db BANK_GAMEPLAY_BIG
SECTION "Bank ID BANK_MUSIC_0", ROMX[$4000], BANK[BANK_MUSIC_0]
REPT 7
rst $00
ENDR
db BANK_MUSIC_0
SECTION "Bank ID BANK_MUSIC_1", ROMX[$4000], BANK[BANK_MUSIC_1]
REPT 7
rst $00
ENDR
db BANK_MUSIC_1
SECTION "Bank ID BANK_MUSIC_2", ROMX[$4000], BANK[BANK_MUSIC_2]
REPT 7
rst $00
ENDR
db BANK_MUSIC_2
SECTION "Bank ID BANK_MUSIC_3", ROMX[$4000], BANK[BANK_MUSIC_3]
REPT 7
rst $00
ENDR
db BANK_MUSIC_3
ENDC

View File

@ -1,70 +0,0 @@
; 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(BANKING_ASM)
DEF BANKING_ASM EQU 1
INCLUDE "globals.asm"
SECTION "Banking Variables", WRAM0
wBankBackup: ds 4
SECTION "Banking Functions", ROM0
BankingInit::
ld a, BANK_OTHER
ld [wBankBackup], a
ld [wBankBackup+1], a
ld [wBankBackup+2], a
ld [wBankBackup+3], a
ret
SECTION "Switch Bank", ROM0[$08]
; Pushes the current bank to the stach, switches to bank in B.
RSTSwitchBank::
ld a, [wBankBackup+2]
ld [wBankBackup+3], a
ld a, [wBankBackup+1]
ld [wBankBackup+2], a
ld a, [wBankBackup+0]
ld [wBankBackup+1], a
ld a, [rBANKID]
ld [wBankBackup+0], a
ld a, b
ld [rROMB0], a
ret
SECTION "Restore Bank", ROM0[$28]
; Pops a bank from the stack and switches to it.
RSTRestoreBank::
ld a, [wBankBackup+0]
ld b, a
ld a, [wBankBackup+1]
ld [wBankBackup+0], a
ld a, [wBankBackup+2]
ld [wBankBackup+1], a
ld a, [wBankBackup+3]
ld [wBankBackup+2], a
ld a, b
ld [rROMB0], a
ret
ENDC

861
src/constants.asm Normal file
View File

@ -0,0 +1,861 @@
; 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(CONSTANTS_ASM)
DEF CONSTANTS_ASM EQU 1
CHARMAP " ", 1
CHARMAP "0", 66
CHARMAP "1", 67
CHARMAP "2", 68
CHARMAP "3", 69
CHARMAP "4", 70
CHARMAP "5", 71
CHARMAP "6", 72
CHARMAP "7", 73
CHARMAP "8", 74
CHARMAP "9", 75
CHARMAP "A", 76
CHARMAP "B", 77
CHARMAP "C", 78
CHARMAP "D", 79
CHARMAP "E", 80
CHARMAP "F", 81
CHARMAP "G", 82
CHARMAP "H", 83
CHARMAP "I", 84
CHARMAP "J", 85
CHARMAP "K", 86
CHARMAP "L", 87
CHARMAP "M", 88
CHARMAP "N", 89
CHARMAP "O", 90
CHARMAP "P", 91
CHARMAP "Q", 92
CHARMAP "R", 93
CHARMAP "S", 94
CHARMAP "T", 95
CHARMAP "U", 96
CHARMAP "V", 97
CHARMAP "W", 98
CHARMAP "X", 99
CHARMAP "Y", 100
CHARMAP "Z", 101
CHARMAP "!", 102
CHARMAP "?", 103
CHARMAP "[", 129
CHARMAP "]", 130
CHARMAP "/", 128
CHARMAP "-", 127
CHARMAP "|", 126
CHARMAP "#", 125
SECTION "Static Data", ROM0
sLeady:: db " READY? "
sGo:: db " GO "
sPause::
db "P A U S E "
db " P A U S E"
sOption0::
db "NORM"
db " INV"
sOption1::
db "TGM1"
db "TGM2"
db "TGM3"
db "HELL"
db " NES"
sOption2::
db "ARS1"
db "ARS2"
sOption3::
db "SNIC"
db "HARD"
db "NONE"
sOption4::
db "DMGT"
db "TGM1"
db "TGM3"
db "DEAT"
db "SHIR"
db "CHIL"
sOption5::
db " NO"
db " YES"
sEasterM0:: db $C4, $C6, $C8, $CA, $CC ; MGB
sEasterM1:: db $C5, $C7, $C9, $CB, $CD
sEasterC0:: db $CE, $D0, $C8, $CA, $CC, $72, $74, $76, $78, $7A, $D6, $D7 ; CGB
sEasterC1:: db $CF, $D1, $C9, $CB, $CD, $73, $75, $77, $79, $7B, $01, $01
sEasterA0:: db $D2, $D4, $C8, $CA, $CC, $72, $74, $76, $78, $7A, $D6, $D7 ; AGB
sEasterA1:: db $D3, $D5, $C9, $CB, $CD, $73, $75, $77, $79, $7B, $01, $01
sEasterS0:: db $F6, $F8, $C8, $CA, $CC ; SGB
sEasterS1:: db $F7, $F9, $C9, $CB, $CD
sPieceXOffsets:: ; How to draw each piece. X-offsets of the sprites.
db 0, 8, 16, 24 ; I
db 0, 8, 8, 16 ; Z
db 0, 8, 8, 16 ; S
db 0, 8, 16, 16 ; J
db 0, 0, 8, 16 ; L
db 8, 8, 16, 16 ; O
db 0, 8, 8, 16 ; T
sPieceYOffsets:: ; How to draw each piece. Y-offsets of the sprites.
db 0, 0, 0, 0 ; I
db 0, 0, 7, 7 ; Z
db 7, 7, 0, 0 ; S
db 0, 0, 0, 7 ; J
db 7, 0, 0, 0 ; L
db 0, 7, 0, 7 ; O
db 0, 0, 7, 0 ; T
sTGM1SpeedCurve::
dw $0000, 0, $0100
db 1, 64
db 30, 16, 30, 41
dw $0030, 30, $0100
db 1, 42
db 30, 16, 30, 41
dw $0035, 35, $0100
db 1, 32
db 30, 16, 30, 41
dw $0040, 40, $0100
db 1, 25
db 30, 16, 30, 41
dw $0060, 60, $0100
db 1, 16
db 30, 16, 30, 41
dw $0070, 70, $0100
db 1, 8
db 30, 16, 30, 41
dw $0080, 80, $0100
db 1, 5
db 30, 16, 30, 41
dw $0100, 100, $0200
db 1, 3
db 30, 16, 30, 41
dw $0160, 160, $0200
db 1, 2
db 30, 16, 30, 41
dw $0200, 200, $0300
db 1, 64
db 30, 16, 30, 41
dw $0220, 220, $0300
db 1, 8
db 30, 16, 30, 41
dw $0230, 230, $0300
db 1, 4
db 30, 16, 30, 41
dw $0233, 233, $0300
db 1, 3
db 30, 16, 30, 41
dw $0236, 236, $0300
db 1, 2
db 30, 16, 30, 41
dw $0251, 251, $0300
db 1, 1
db 30, 16, 30, 41
dw $0300, 300, $0400
db 2, 1
db 30, 16, 30, 41
dw $0330, 330, $0400
db 3, 1
db 30, 16, 30, 41
dw $0360, 360, $0400
db 4, 1
db 30, 16, 30, 41
dw $0400, 400, $0500
db 5, 1
db 30, 16, 30, 41
dw $0420, 420, $0500
db 4, 1
db 30, 16, 30, 41
dw $0450, 450, $0500
db 3, 1
db 30, 16, 30, 41
dw $0500, 500, $0600
db 20, 1
db 30, 16, 30, 41
sTGM1SpeedCurveEnd::
dw $FFFF
sCHILSpeedCurve::
dw $0000, 0, $0100
db 1, 48
db 10, 16, 25, 17
dw $0100, 100, $0200
db 1, 43
db 10, 16, 25, 17
dw $0200, 200, $0300
db 1, 38
db 10, 16, 25, 17
dw $0300, 300, $0400
db 1, 33
db 10, 16, 25, 17
dw $0400, 400, $0500
db 1, 28
db 10, 16, 25, 17
dw $0500, 500, $0600
db 1, 23
db 10, 16, 25, 17
dw $0600, 600, $0700
db 1, 18
db 10, 16, 25, 17
dw $0700, 700, $0800
db 1, 13
db 10, 16, 25, 17
dw $0800, 800, $0900
db 1, 8
db 10, 16, 25, 17
dw $0900, 900, $1000
db 1, 6
db 10, 16, 25, 17
dw $1000, 1000, $1100
db 1, 5
db 10, 16, 25, 17
dw $1300, 1300, $1400
db 1, 4
db 10, 16, 25, 17
dw $1600, 1600, $1700
db 1, 3
db 10, 16, 25, 17
dw $1900, 1900, $2000
db 1, 2
db 10, 16, 25, 17
dw $2900, 2900, $3000
db 1, 1
db 10, 16, 25, 17
dw $3333, 3333, $3400
db 2, 1
db 10, 12, 25, 17
dw $4444, 4444, $4500
db 3, 1
db 10, 12, 25, 17
dw $5555, 5555, $5600
db 4, 1
db 10, 12, 25, 17
dw $6666, 6666, $6700
db 5, 1
db 10, 12, 25, 17
dw $7777, 7777, $7800
db 20, 1
db 10, 8, 25, 17
dw $8888, 8888, $8900
db 20, 1
db 10, 6, 18, 17
dw $9999, 9999, $9999
db 20, 1
db 5, 6, 14, 10
sCHILSpeedCurveEnd::
dw $FFFF
sTGM3SpeedCurve::
dw $0000, 0, $0100
db 1, 64
db 27, 16, 30, 40
dw $0030, 30, $0100
db 1, 42
db 27, 16, 30, 40
dw $0035, 35, $0100
db 1, 32
db 27, 16, 30, 40
dw $0040, 40, $0100
db 1, 25
db 27, 16, 30, 40
dw $0060, 60, $0100
db 1, 16
db 27, 16, 30, 40
dw $0070, 70, $0100
db 1, 8
db 27, 16, 30, 40
dw $0080, 80, $0100
db 1, 5
db 27, 16, 30, 40
dw $0100, 100, $0200
db 1, 3
db 27, 16, 30, 40
dw $0160, 160, $0200
db 1, 2
db 27, 16, 30, 40
dw $0200, 200, $0300
db 1, 64
db 27, 16, 30, 40
dw $0220, 220, $0300
db 1, 8
db 27, 16, 30, 40
dw $0230, 230, $0300
db 1, 4
db 27, 16, 30, 40
dw $0233, 233, $0300
db 1, 3
db 27, 16, 30, 40
dw $0236, 236, $0300
db 1, 2
db 27, 16, 30, 40
dw $0251, 251, $0300
db 1, 1
db 27, 16, 30, 40
dw $0300, 300, $0400
db 2, 1
db 27, 16, 30, 40
dw $0330, 330, $0400
db 3, 1
db 27, 16, 30, 40
dw $0360, 360, $0400
db 4, 1
db 27, 16, 30, 40
dw $0400, 400, $0500
db 5, 1
db 27, 16, 30, 40
dw $0420, 420, $0500
db 4, 1
db 27, 16, 30, 40
dw $0450, 450, $0500
db 3, 1
db 27, 16, 30, 40
dw $0500, 500, $0600
db 20, 1
db 27, 10, 30, 25
dw $0600, 600, $0700
db 20, 1
db 27, 10, 30, 7
dw $0700, 700, $0800
db 20, 1
db 18, 10, 30, 7
dw $0800, 800, $0900
db 20, 1
db 14, 10, 30, 1
dw $0900, 900, $1000
db 20, 1
db 14, 8, 18, 1
dw $1000, 1000, $1100
db 20, 1
db 8, 8, 18, 6
dw $1100, 1000, $1200
db 20, 1
db 7, 8, 14, 6
dw $1200, 1000, $1300
db 20, 1
db 6, 8, 14, 6
sTGM3SpeedCurveEnd::
dw $FFFF
sDEATSpeedCurve::
dw $0000, 0, $0100
db 20, 1
db 18, 12, 30, 12
dw $0100, 0, $0200
db 20, 1
db 14, 12, 25, 1
dw $0200, 0, $0300
db 20, 1
db 14, 11, 20, 1
dw $0300, 0, $0400
db 20, 1
db 8, 10, 18, 6
dw $0400, 0, $0500
db 20, 1
db 7, 8, 14, 5
dw $0500, 0, $0600
db 20, 1
db 6, 8, 14, 4
sDEATSpeedCurveEnd::
dw $FFFF
sSHIRSpeedCurve::
dw $0000, 0, $0100
db 20, 1
db 12, 10, 18, 6
dw $0100, 100, $0200
db 20, 1
db 12, 8, 18, 5
dw $0200, 200, $0300
db 20, 1
db 12, 8, 16, 4
dw $0300, 300, $0400
db 20, 1
db 6, 8, 14, 4
dw $0500, 500, $0600
db 20, 1
db 6, 6, 12, 2
dw $1100, 1100, $1200
db 20, 1
db 6, 6, 10, 2
dw $1200, 1200, $1300
db 20, 1
db 6, 6, 8, 2
sSHIRSpeedCurveEnd::
dw $FFFF
sSpeedCurve:: ; Speed curve of the game.
dw $0000, 0, $0100 ; Level 0000
db 1, 16 ; 1G every 16 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0015, 15, $0100 ; Level 0015
db 1, 15 ; 1G every 15 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0030, 30, $0100 ; Level 0030
db 1, 14 ; 1G every 14 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0040, 40, $0100 ; Level 0040
db 1, 13 ; 1G every 13 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0050, 50, $0100 ; Level 0050
db 1, 12 ; 1G every 12 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0060, 60, $0100 ; Level 0060
db 1, 11 ; 1G every 11 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0070, 70, $0100 ; Level 0070
db 1, 10 ; 1G every 10 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0080, 80, $0100 ; Level 0080
db 1, 9 ; 1G every 9 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0090, 90, $0100 ; Level 0090
db 1, 8 ; 1G every 8 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0100, 100, $0200 ; Level 0100
db 1, 7 ; 1G every 7 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0150, 150, $0200 ; Level 0150
db 1, 6 ; 1G every 6 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0200, 200, $0300 ; Level 0200
db 1, 5 ; 1G every 5 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0225, 225, $0300 ; Level 0225
db 1, 4 ; 1G every 4 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0250, 250, $0300 ; Level 0250
db 1, 3 ; 1G every 3 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0275, 275, $0300 ; Level 0275
db 1, 2 ; 1G every 2 frames
db 25, 14, 30, 40 ; ARE, DAS, LOCK, LINECLEAR
dw $0300, 300, $0400 ; Level 0300
db 1, 1 ; 1G
db 25, 14, 30, 32 ; ARE, DAS, LOCK, LINECLEAR
dw $0350, 350, $0350 ; Level 0350
db 2, 1 ; 2G
db 25, 14, 30, 32 ; ARE, DAS, LOCK, LINECLEAR
dw $0400, 400, $0400 ; Level 0400
db 3, 1 ; 3G
db 25, 14, 30, 32 ; ARE, DAS, LOCK, LINECLEAR
dw $0450, 450, $0500 ; Level 0450
db 4, 1 ; 4G
db 25, 14, 30, 32 ; ARE, DAS, LOCK, LINECLEAR
dw $0475, 475, $0500 ; Level 0475
db 5, 1 ; 5G
db 25, 14, 30, 32 ; ARE, DAS, LOCK, LINECLEAR
dw $0500, 500, $0600 ; Level 0500
db 20, 1 ; 20G
db 25, 14, 30, 24 ; ARE, DAS, LOCK, LINECLEAR
dw $0600, 600, $0700 ; Level 0600
db 20, 1 ; 20G
db 25, 8, 30, 24 ; ARE, DAS, LOCK, LINECLEAR
dw $0700, 700, $0800 ; Level 0700
db 20, 1 ; 20G
db 20, 8, 30, 24 ; ARE, DAS, LOCK, LINECLEAR
dw $0900, 900, $1000 ; Level 0900
db 20, 1 ; 20G
db 16, 6, 25, 16 ; ARE, DAS, LOCK, LINECLEAR
dw $1100, 1100, $1200 ; Level 1100
db 20, 1 ; 20G
db 12, 6, 25, 16 ; ARE, DAS, LOCK, LINECLEAR
dw $1200, 1200, $1300 ; Level 1200
db 20, 1 ; 20G
db 12, 6, 25, 8 ; ARE, DAS, LOCK, LINECLEAR
dw $1300, 1300, $1400 ; Level 1300
db 20, 1 ; 20G
db 10, 6, 20, 7 ; ARE, DAS, LOCK, LINECLEAR
dw $1400, 1400, $1500 ; Level 1400
db 20, 1 ; 20G
db 10, 6, 18, 6 ; ARE, DAS, LOCK, LINECLEAR
dw $1500, 1500, $1600 ; Level 1500
db 20, 1 ; 20G
db 8, 4, 16, 5 ; ARE, DAS, LOCK, LINECLEAR
dw $1600, 1600, $1700 ; Level 1600
db 20, 1 ; 20G
db 8, 4, 14, 4 ; ARE, DAS, LOCK, LINECLEAR
dw $1700, 1700, $1800 ; Level 1700
db 20, 1 ; 20G
db 6, 4, 12, 3 ; ARE, DAS, LOCK, LINECLEAR
dw $1800, 1800, $1900 ; Level 1800
db 20, 1 ; 20G
db 6, 4, 10, 3 ; ARE, DAS, LOCK, LINECLEAR
dw $1900, 1900, $2000 ; Level 1900
db 20, 1 ; 20G
db 4, 4, 8, 3 ; ARE, DAS, LOCK, LINECLEAR
dw $2000, 2000, $2100 ; Level 2000
db 20, 1 ; 20G
db 4, 3, 8, 3 ; ARE, DAS, LOCK, LINECLEAR
dw $2500, 2500, $2600 ; Level 2500
db 20, 1 ; 20G
db 2, 1, 8, 2 ; ARE, DAS, LOCK, LINECLEAR
dw $3000, 3000, $3100 ; Level 3000
db 20, 1 ; 20G
db 1, 1, 8, 1 ; ARE, DAS, LOCK, LINECLEAR
dw $4000, 4000, $4100 ; Level 4000
db 20, 1 ; 20G
db 1, 1, 6, 1 ; ARE, DAS, LOCK, LINECLEAR
dw $5000, 5000, $5100 ; Level 5000
db 20, 1 ; 20G
db 1, 1, 4, 1 ; ARE, DAS, LOCK, LINECLEAR
dw $6666, 6666, $6700 ; Level 6666
db 20, 1 ; 20G
db 1, 1, 2, 1 ; ARE, DAS, LOCK, LINECLEAR
dw $9999, 9999, $9999 ; Level 9999
db 20, 1 ; 20G
db 1, 1, 1, 1 ; ARE, DAS, LOCK, LINECLEAR
sSpeedCurveEnd::
dw $FFFF ; End.
sPieceFastRotationStates::
; I
db 14, 1, 1, 1
db 2, 14, 14, 14
db 14, 1, 1, 1
db 2, 14, 14, 14
; Z
db 14, 1, 14, 1
db 2, 13, 1, 13
db 14, 1, 14, 1
db 2, 13, 1, 13
; S
db 15, 1, 12, 1
db 0, 14, 1, 14
db 15, 1, 12, 1
db 0, 14, 1, 14
; J
db 14, 1, 1, 14
db 1, 1, 13, 14
db 14, 14, 1, 1
db 1, 14, 13, 1
; L
db 14, 1, 1, 12
db 1, 14, 14, 1
db 16, 12, 1, 1
db 0, 1, 14, 14
; O
db 15, 1, 13, 1
db 15, 1, 13, 1
db 15, 1, 13, 1
db 15, 1, 13, 1
; T
db 14, 1, 1, 13
db 1, 14, 1, 13
db 15, 13, 1, 1
db 1, 13, 1, 14
sPieceRotationStates:: ; How each piece is rotated.
; I
db %0000
db %1111
db %0000
db %0000
db %0010
db %0010
db %0010
db %0010
db %0000
db %1111
db %0000
db %0000
db %0010
db %0010
db %0010
db %0010
; Z
db %0000
db %1100
db %0110
db %0000
db %0010
db %0110
db %0100
db %0000
db %0000
db %1100
db %0110
db %0000
db %0010
db %0110
db %0100
db %0000
; S
db %0000
db %0110
db %1100
db %0000
db %1000
db %1100
db %0100
db %0000
db %0000
db %0110
db %1100
db %0000
db %1000
db %1100
db %0100
db %0000
; J
db %0000
db %1110
db %0010
db %0000
db %0110
db %0100
db %0100
db %0000
db %0000
db %1000
db %1110
db %0000
db %0100
db %0100
db %1100
db %0000
; L
db %0000
db %1110
db %1000
db %0000
db %0100
db %0100
db %0110
db %0000
db %0000
db %0010
db %1110
db %0000
db %1100
db %0100
db %0100
db %0000
; O
db %0000
db %0110
db %0110
db %0000
db %0000
db %0110
db %0110
db %0000
db %0000
db %0110
db %0110
db %0000
db %0000
db %0110
db %0110
db %0000
; T
db %0000
db %1110
db %0100
db %0000
db %0100
db %0110
db %0100
db %0000
db %0000
db %0100
db %1110
db %0000
db %0100
db %1100
db %0100
db %0000
sTGM3Bag::
db 0, 0, 0, 0, 0
db 1, 1, 1, 1, 1
db 2, 2, 2, 2, 2
db 3, 3, 3, 3, 3
db 4, 4, 4, 4, 4
db 5, 5, 5, 5, 5
db 6, 6, 6, 6, 6
sTGM3Droughts::
db 0, 0, 0, 0, 0, 0, 0
ENDC

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,425 +0,0 @@
; 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(HISCORE_ASM)
DEF HISCORE_ASM EQU 1
INCLUDE "globals.asm"
SECTION "Hi Score Data", ROM0
sHiscoreDefaultData::
db 0, 0, 0, 0, 0, 0, 0, 0, "DMG", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, "TRI", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, "SDM", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, "GTR", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, "ISD", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, "MGT", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, "RIS", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, "DMG", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, "TRI", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0, "SDM", GRADE_NONE, RNG_MODE_TGM3, ROT_MODE_ARSTI, DROP_MODE_FIRM, HIG_MODE_OFF
db 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
SECTION "Hi Score Variables", WRAM0
wTargetHSTable:: ds 2
wWorkingIdx:: ds 1
wWorkingPtr:: ds 1
wWorkingCopy:: ds ((HISCORE_ENTRY_COUNT+1)*(HISCORE_ENTRY_SIZE))
wInsertTarget:: ds 1
SECTION "Hi Score Functions", ROM0
CheckAndAddHiscore::
; Get the table
ld a, [wSpeedCurveState]
call InitTargetHSTable
; Initialize loop at 0.
xor a, a
ld [wInsertTarget], a
.checkloop
; Load the score at position a.
call GetHiScoreEntry
; Backup HL to DE for later.
ld d, h
ld e, l
; Compare grades, HL needs to forwarded 11 bytes.
.checkgrade
ld bc, 11
add hl, bc
; HL is now pointing to the grade in this high score.
; The handling depends on whether or not the old score had a grade.
ld a, [hl]
cp a, GRADE_NONE
jr z, .oldungraded
; The old score had a grade, so compare ours to theirs.
.oldgraded
ld b, a
ld a, [wDisplayedGrade]
cp a, GRADE_NONE
jr z, .notbetter ; If we don't have a grade, we're worse than any grade.
cp a, b
jr c, .notbetter ; If we're less, we're not better.
jr nz, .better ; If we're higher, we're better.
jr .checklevel ; Equal, so check level.
; The old score did NOT have a grade. So check if we do.
.oldungraded
ld a, [wDisplayedGrade]
cp a, GRADE_NONE
jr nz, .better ; We do have a grade, so we win.
; We don't have a grade either, so continue as equals.
; Our grade is equal.
; Compare levels. HL needs to be forwarded 5 bytes.
.checklevel
ld bc, 5
add hl, bc
; HL is now pointing to the level in this high score.
; Make BC point to our level.
ld bc, hCLevel
; And compare the first digit...
ld a, [bc]
cp a, [hl]
jr c, .notbetter ; Lower? Not better.
jr nz, .better ; Higher? Better.
inc bc ; Equal? Keep checking...
inc hl
; Second...
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Third...
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Fourth...
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
; Our level is equal.
; So now also check the score. Restore the DE from earlier.
.checkscore
ld h, d
ld l, e
; HL is pointing to that score, make BC point to our current score.
ld bc, hScore
; First digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Second digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Third digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Fourth digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Fifth digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Sixth digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Seventh digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
inc bc
inc hl
; Eighth digit
ld a, [bc]
cp a, [hl]
jr c, .notbetter
jr nz, .better
; If we fell through all the way to here, we are completely equal. Oldest score has priority.
; Loop or return if we didn't make the scores.
.notbetter
ld a, [wInsertTarget]
inc a
ld [wInsertTarget], a
cp a, 10
ret z
jp .checkloop
.better
jr InsertHiScore
; Inserts the current score data into the table.
; Data will be saved and persisted.
InsertHiScore::
; Copy the entire table to working data, but one row down.
.copylower
ld a, [wTargetHSTable]
ld e, a
ld a, [wTargetHSTable+1]
ld d, a
ld hl, wWorkingCopy+HISCORE_ENTRY_SIZE
ld bc, (HISCORE_ENTRY_COUNT*HISCORE_ENTRY_SIZE)
call UnsafeMemCopy
; Copy the top rows to the working data.
.copyupper
ld a, [wInsertTarget]
or a, a
jr z, .findrow
ld hl, 0
ld bc, HISCORE_ENTRY_SIZE
: add hl, bc
dec a
jr nz, :-
ld b, h
ld c, l
ld a, [wTargetHSTable]
ld e, a
ld a, [wTargetHSTable+1]
ld d, a
ld hl, wWorkingCopy
call UnsafeMemCopy
; Make HL point to the correct location to insert the new score
.findrow
ld hl, wWorkingCopy
ld bc, HISCORE_ENTRY_SIZE
ld a, [wInsertTarget]
or a, a
jr z, .insert
: add hl, bc
dec a
jr nz, :-
; And do the insertion
.insert
ldh a, [hScore+0]
ld [hl+], a
ldh a, [hScore+1]
ld [hl+], a
ldh a, [hScore+2]
ld [hl+], a
ldh a, [hScore+3]
ld [hl+], a
ldh a, [hScore+4]
ld [hl+], a
ldh a, [hScore+5]
ld [hl+], a
ldh a, [hScore+6]
ld [hl+], a
ldh a, [hScore+7]
ld [hl+], a
ld a, [wProfileName+0]
ld [hl+], a
ld a, [wProfileName+1]
ld [hl+], a
ld a, [wProfileName+2]
ld [hl+], a
ld a, [wDisplayedGrade]
ld [hl+], a
ld a, [wRNGModeState]
ld [hl+], a
ld a, [wRotModeState]
ld [hl+], a
ld a, [wDropModeState]
ld [hl+], a
ld a, [wAlways20GState]
ld [hl+], a
ldh a, [hCLevel+0]
ld [hl+], a
ldh a, [hCLevel+1]
ld [hl+], a
ldh a, [hCLevel+2]
ld [hl+], a
ldh a, [hCLevel+3]
ld [hl+], a
ldh a, [hNLevel+0]
ld [hl+], a
ldh a, [hNLevel+1]
ld [hl+], a
ldh a, [hNLevel+2]
ld [hl+], a
ldh a, [hNLevel+3]
ld [hl+], a
; 8 filler bytes.
xor a, a
REPT 8
ld [hl+], a
ENDR
; And copy it back.
.persist
ld de, wWorkingCopy
ld a, [wTargetHSTable]
ld l, a
ld a, [wTargetHSTable+1]
ld h, a
ld bc, HISCORE_ENTRY_COUNT*HISCORE_ENTRY_SIZE
jp UnsafeMemCopy
; Updates the pointers for the current hi score to point to the index in register A.
; HL will be left pointing at said memory.
GetHiScoreEntry::
ld [wWorkingIdx], a
ld a, [wTargetHSTable]
ld l, a
ld a, [wTargetHSTable+1]
ld h, a
ld bc, HISCORE_ENTRY_SIZE
ld a, [wWorkingIdx]
or a, a
jr z, .store
: add hl, bc
dec a
jr nz, :-
.store
ld a, l
ld [wWorkingPtr], a
ld a, h
ld [wWorkingPtr+1], a
ret
; Initializes all the pointers to point to the very first score in the table for the game mode passed in
; register A.
InitTargetHSTable::
ld b, a
add a, b
add a, b
ld c, a
ld b, 0
ld hl, .jumps
add hl, bc
jp hl
.jumps
jp .dmgt
jp .tgm1
jp .tgm3
jp .deat
jp .shir
jp .chil
jp .myco
.dmgt
ld hl, rScoreTableDMGT
jr .store
.tgm1
ld hl, rScoreTableTGM1
jr .store
.tgm3
ld hl, rScoreTableTGM3
jr .store
.deat
ld hl, rScoreTableDEAT
jr .store
.shir
ld hl, rScoreTableSHIR
jr .store
.chil
ld hl, rScoreTableCHIL
jr .store
.myco
ld hl, rScoreTableMYCO
.store
ld a, l
ld [wTargetHSTable], a
ld [wWorkingPtr], a
ld a, h
ld [wTargetHSTable+1], a
ld [wWorkingPtr+1], a
xor a, a
ld [wWorkingIdx], a
ret
ENDC

View File

@ -21,72 +21,21 @@ DEF GLOBALS_ASM EQU 1
INCLUDE "hardware.inc"
INCLUDE "structs.asm"
INCLUDE "rgb555.asm"
; Set up charmap.
CHARMAP " ", 1
CHARMAP "0", 2
CHARMAP "1", 3
CHARMAP "2", 4
CHARMAP "3", 5
CHARMAP "4", 6
CHARMAP "5", 7
CHARMAP "6", 8
CHARMAP "7", 9
CHARMAP "8", 10
CHARMAP "9", 11
CHARMAP "A", 12
CHARMAP "B", 13
CHARMAP "C", 14
CHARMAP "D", 15
CHARMAP "E", 16
CHARMAP "F", 17
CHARMAP "G", 18
CHARMAP "H", 19
CHARMAP "I", 20
CHARMAP "J", 21
CHARMAP "K", 22
CHARMAP "L", 23
CHARMAP "M", 24
CHARMAP "N", 25
CHARMAP "O", 26
CHARMAP "P", 27
CHARMAP "Q", 28
CHARMAP "R", 29
CHARMAP "S", 30
CHARMAP "T", 31
CHARMAP "U", 32
CHARMAP "V", 33
CHARMAP "W", 34
CHARMAP "X", 35
CHARMAP "Y", 36
CHARMAP "Z", 37
CHARMAP "!", 38
CHARMAP "?", 39
CHARMAP "[", 40
CHARMAP "]", 41
CHARMAP "-", 42
CHARMAP "'", 43
CHARMAP "a", 207
CHARMAP "b", 208
CHARMAP "c", 209
CHARMAP "d", 210
CHARMAP "m", 211
CHARMAP ":", 212
CHARMAP ".", 255
CHARMAP "k", 47
CHARMAP "v", 45
CHARMAP "o", 44
CHARMAP "n", 46
; PPU modes:
; - 0: HBlank
; - 1: VBlank
; - 2: OAM Scan
; - 3: Drawing
; Waits for PPU mode to be 0 or 1.
; We don't wait for 2 because it's super short and impractical to do much of anything in.
MACRO wait_vram
ld hl, rSTAT
.wvr\@
ldh a, [rSTAT]
bit STATB_BUSY, a
bit 1, [hl]
jr nz, .wvr\@
ENDM
@ -138,12 +87,6 @@ MACRO set_all_palettes
set_obj1_palette
ENDM
MACRO no_jump
nop
nop
ret
ENDM
; Writes two bytes to a register pair.
MACRO lb
@ -151,22 +94,8 @@ MACRO lb
ENDM
; Bank names
DEF BANK_MAIN EQU 0
DEF BANK_OTHER EQU 1
DEF BANK_SFX EQU 2
DEF BANK_TITLE EQU 3
DEF BANK_GAMEPLAY EQU 4
DEF BANK_GAMEPLAY_BIG EQU 5
DEF BANK_MUSIC_0 EQU 6
DEF BANK_MUSIC_1 EQU 7
DEF BANK_MUSIC_2 EQU 8
DEF BANK_MUSIC_3 EQU 9
; Some useful palettes.
DEF PALETTE_REGULAR EQU %11100100
DEF PALETTE_INVERTED EQU %00011011
DEF PALETTE_INVERTED_L EQU %01101111
DEF PALETTE_MONO_0 EQU %11111111
DEF PALETTE_MONO_1 EQU %10101010
DEF PALETTE_MONO_2 EQU %01010101
@ -180,28 +109,18 @@ DEF PALETTE_LIGHTER_1 EQU %10010000
DEF PALETTE_LIGHTER_2 EQU %01000000
DEF PALETTE_LIGHTER_3 EQU %00000000
; Sprite base positions.
DEF NEXT_BASE_X EQU 100
DEF NEXT_BASE_Y EQU 37
DEF HOLD_BASE_X EQU 100
DEF HOLD_BASE_Y EQU 75
DEF QUEUE_BASE_X EQU 142
DEF QUEUE_BASE_Y EQU 34
DEF SCORE_BASE_X EQU 97
DEF SCORE_BASE_Y EQU 105
DEF LEVEL_BASE_X EQU 100
DEF CLEVEL_BASE_Y EQU 126
DEF NLEVEL_BASE_Y EQU 138
DEF GRADE_BASE_X EQU 145
DEF GRADE_BASE_Y EQU 22
DEF TIME_BASE_X EQU 100
DEF TIME_BASE_Y EQU 152
DEF TELLS_BASE_X EQU 142
DEF TELLS_BASE_Y EQU 118
DEF TELLS_Y_DIST EQU 7
DEF TELLS_X_DIST EQU 12
DEF NEXT_BASE_X EQU 115
DEF NEXT_BASE_Y EQU 40
DEF HOLD_BASE_X EQU 115
DEF HOLD_BASE_Y EQU 80
DEF SCORE_BASE_X EQU 112
DEF SCORE_BASE_Y EQU 115
DEF LEVEL_BASE_X EQU 120
DEF CLEVEL_BASE_Y EQU 136
DEF NLEVEL_BASE_Y EQU 148
DEF SCURVE_ENTRY_SIZE EQU 8
; Piece names
DEF PIECE_I EQU 0
DEF PIECE_Z EQU 1
DEF PIECE_S EQU 2
@ -209,51 +128,8 @@ DEF PIECE_J EQU 3
DEF PIECE_L EQU 4
DEF PIECE_O EQU 5
DEF PIECE_T EQU 6
DEF PIECE_NONE EQU 7
DEF PIECE_NONE EQU 255
; Sound effect names
DEF REG_NR10_CH1_SWEEP EQU $10
DEF REG_NR11_CH1_LENDT EQU $11
DEF REG_NR12_CH1_VOLEV EQU $12
DEF REG_NR13_CH1_FRQLO EQU $13
DEF REG_NR14_CH1_FRQHI EQU $14
DEF REG_NR21_CH2_LENDT EQU $16
DEF REG_NR22_CH2_VOLEV EQU $17
DEF REG_NR23_CH2_FRQLO EQU $18
DEF REG_NR24_CH2_FRQHI EQU $19
DEF REG_NR30_CH3_DACEN EQU $1A
DEF REG_NR31_CH3_LENGT EQU $1B
DEF REG_NR32_CH3_VOLUM EQU $1C
DEF REG_NR33_CH3_FRQLO EQU $1D
DEF REG_NR34_CH3_FRQHI EQU $1E
DEF REG_NR41_CH4_LENGT EQU $20
DEF REG_NR42_CH4_VOLEV EQU $21
DEF REG_NR43_CH4_FQRND EQU $22
DEF REG_NR44_CH4_CNTRL EQU $23
DEF REG_NR50_MVOLVINPN EQU $24
DEF REG_NR51_MASTERPAN EQU $25
DEF REG_NR52_MASTERCTL EQU $26
DEF REG_WAVE_PATTERN_0 EQU $30
DEF REG_WAVE_PATTERN_1 EQU $31
DEF REG_WAVE_PATTERN_2 EQU $32
DEF REG_WAVE_PATTERN_3 EQU $33
DEF REG_WAVE_PATTERN_4 EQU $34
DEF REG_WAVE_PATTERN_5 EQU $35
DEF REG_WAVE_PATTERN_6 EQU $36
DEF REG_WAVE_PATTERN_7 EQU $37
DEF REG_WAVE_PATTERN_8 EQU $38
DEF REG_WAVE_PATTERN_9 EQU $39
DEF REG_WAVE_PATTERN_A EQU $3A
DEF REG_WAVE_PATTERN_B EQU $3B
DEF REG_WAVE_PATTERN_C EQU $3C
DEF REG_WAVE_PATTERN_D EQU $3D
DEF REG_WAVE_PATTERN_E EQU $3E
DEF REG_WAVE_PATTERN_F EQU $3F
DEF END_OF_SAMPLE EQU $FF
DEF END_OF_SONG EQU $FE
DEF END_OF_SFX EQU $FE
DEF CHANGE_BANK EQU $FD
DEF CHANGE_PLAYHEAD EQU $FC
DEF SFX_IRS EQU $80
DEF SFX_IHS EQU 10
DEF SFX_LINE_CLEAR EQU 11
@ -263,43 +139,20 @@ DEF SFX_LEVELLOCK EQU 14
DEF SFX_LEVELUP EQU 15
DEF SFX_RANKUP EQU 16
DEF SFX_READYGO EQU 17
DEF SFX_RANKGM EQU 18
DEF MUSIC_MENU EQU $EE
DEF MUSIC_ROLL EQU $EF
; Tile data offsets
; Shared
DEF TILE_BLANK EQU 1
DEF TILE_0 EQU 2
DEF STACK_SIZE EQU 64
DEF GAME_OVER_R10 EQU 133
DEF GAME_OVER_R12 EQU 153
DEF GAME_OVER_R14 EQU 173
DEF GAME_OVER_OTHER EQU 131
DEF LEADY_TIME EQU 80
DEF GO_TIME EQU 40
; Title
DEF TILE_SELECTED EQU 92
DEF TILE_UNSELECTED EQU 93
; Gameplay
DEF TILE_FIELD_EMPTY EQU 108
DEF TILE_PIECE_0 EQU 48
DEF TILE_CLEARING EQU 106
DEF TILE_GHOST EQU 107
DEF TILE_PIECE_SMALL_0 EQU 116
DEF TILE_PIECE_BONE EQU 104
DEF TILE_SMALL_0 EQU 213
DEF TILE_BONE EQU 104
DEF TILE_INVIS EQU 254
DEF TILE_QUEUE_BONE EQU 105
DEF TILE_ROT_MODE_MYCO EQU 253
DEF GAME_OVER_R10 EQU 147
DEF GAME_OVER_R12 EQU 167
DEF GAME_OVER_R14 EQU 187
DEF GAME_OVER_OTHER EQU 145
; Button mode.
DEF BUTTON_MODE_NORM EQU 0
DEF BUTTON_MODE_INVR EQU 1
DEF BUTTON_MODE_COUNT EQU 2
; RNG mode.
DEF TILE_RNG_MODE_BASE EQU 130
DEF TILE_RNG_MODE_BASE EQU 217
DEF RNG_MODE_TGM1 EQU 0
DEF RNG_MODE_TGM2 EQU 1
DEF RNG_MODE_TGM3 EQU 2
@ -307,224 +160,56 @@ DEF RNG_MODE_HELL EQU 3
DEF RNG_MODE_NES EQU 4
DEF RNG_MODE_COUNT EQU 5
; Rotation mode.
DEF TILE_ROT_MODE_BASE EQU 135
DEF TILE_ROT_MODE_BASE EQU 225
DEF ROT_MODE_ARS EQU 0
DEF ROT_MODE_ARSTI EQU 1
DEF ROT_MODE_NES EQU 2
DEF ROT_MODE_MYCO EQU 3
DEF ROT_MODE_COUNT EQU 4
DEF ROT_MODE_COUNT EQU 2
; Drop mode.
DEF TILE_DROP_MODE_BASE EQU 138
DEF DROP_MODE_FIRM EQU 0
DEF DROP_MODE_SNIC EQU 1
DEF DROP_MODE_HARD EQU 2
DEF DROP_MODE_LOCK EQU 3
DEF DROP_MODE_NONE EQU 4
DEF DROP_MODE_COUNT EQU 5
DEF TILE_DROP_MODE_BASE EQU 229
DEF DROP_MODE_SONIC EQU 0
DEF DROP_MODE_HARD EQU 1
DEF DROP_MODE_NONE EQU 2
DEF DROP_MODE_COUNT EQU 3
; Speed curve selection.
DEF SCURVE_ENTRY_SIZE EQU 13
DEF SCURVE_DMGT EQU 0
DEF SCURVE_TGM1 EQU 1
DEF SCURVE_TGM3 EQU 2
DEF SCURVE_DEAT EQU 3
DEF SCURVE_SHIR EQU 4
DEF SCURVE_CHIL EQU 5
DEF SCURVE_MYCO EQU 6
DEF SCURVE_COUNT EQU 7
DEF SCURVE_COUNT EQU 6
; 20G mode.
DEF TILE_HIG_MODE_BASE EQU 143
DEF TILE_HIG_MODE_BASE EQU 232
DEF HIG_MODE_OFF EQU 0
DEF HIG_MODE_ON EQU 1
DEF HIG_MODE_COUNT EQU 2
DEF FILTER_MODE_DLRU EQU 0
DEF FILTER_MODE_ULRD EQU 1
DEF FILTER_MODE_LRUD EQU 2
DEF FILTER_MODE_UDLR EQU 3
DEF FILTER_MODE_NONE EQU 4
DEF FILTER_MODE_COUNT EQU 5
DEF TILE_FIELD_EMPTY EQU 4
DEF TILE_PIECE_0 EQU 10
DEF TILE_0 EQU 66
DEF TILE_CLEARING EQU 124
DEF TILE_GHOST EQU 125
DEF TILE_SELECTED EQU 193
DEF TILE_UNSELECTED EQU 194
DEF BG_MODE_LITE EQU 0
DEF BG_MODE_DARK EQU 1
DEF BG_MODE_COUNT EQU 2
DEF TITLE_OPTIONS EQU 7
DEF TITLE_OPTION_0 EQU $98E0
DEF TITLE_OPTION_1 EQU $9920
DEF TITLE_OPTION_2 EQU $9960
DEF TITLE_OPTION_3 EQU $99A0
DEF TITLE_OPTION_4 EQU $99E0
DEF TITLE_OPTION_5 EQU $9A20
DEF TITLE_OPTION_6 EQU $9A60
DEF TITLE_OPTION_OFFSET EQU 15
; VRAM Offsets for gameplay tiles
DEF FIELD_RNG EQU $9852
DEF FIELD_ROT EQU $9892
DEF FIELD_DROP EQU $9912
DEF FIELD_HIG EQU $9952
DEF FIELD_TOP_LEFT EQU $9800
DEF FIELD_TOP_LEFT EQU $9800+1
; Gameplay definitions.
DEF LEADY_TIME EQU 80
DEF GO_TIME EQU 40
DEF PIECE_SPAWN_X EQU 5
DEF PIECE_SPAWN_Y EQU 3
DEF PIECE_SPAWN_X_BIG EQU 3
DEF PIECE_SPAWN_Y_BIG EQU 3
DEF ROTATION_STATE_DEF EQU 0
DEF ROTATION_STATE_CW EQU 1
DEF ROTATION_STATE_180 EQU 2
DEF ROTATION_STATE_CCW EQU 3
DEF EASTER_0 EQU $9845
DEF EASTER_1 EQU $9865
; Game states. (Let these increase by 3)
DEF STATE_TITLE EQU 0
DEF STATE_GAMEPLAY EQU 3
DEF STATE_GAMEPLAY_BIG EQU 6
; Other
DEF STACK_SIZE EQU 64
DEF EASTER_0 EQU $9865
DEF EASTER_1 EQU $9885
DEF SLAM_ANIMATION_LEN EQU 6
; Magic location for bank id.
DEF rBANKID EQU $4007
; Grade names.
DEF GRADE_9 EQU 0
DEF GRADE_8 EQU 1
DEF GRADE_7 EQU 2
DEF GRADE_6 EQU 3
DEF GRADE_5 EQU 4
DEF GRADE_4 EQU 5
DEF GRADE_3 EQU 6
DEF GRADE_2 EQU 7
DEF GRADE_1 EQU 8
DEF GRADE_S1 EQU 9
DEF GRADE_S2 EQU 10
DEF GRADE_S3 EQU 11
DEF GRADE_S4 EQU 12
DEF GRADE_S5 EQU 13
DEF GRADE_S6 EQU 14
DEF GRADE_S7 EQU 15
DEF GRADE_S8 EQU 16
DEF GRADE_S9 EQU 17
DEF GRADE_S10 EQU 18
DEF GRADE_S11 EQU 19
DEF GRADE_S12 EQU 20
DEF GRADE_S13 EQU 21
DEF GRADE_M1 EQU 22
DEF GRADE_M2 EQU 23
DEF GRADE_M3 EQU 24
DEF GRADE_M4 EQU 25
DEF GRADE_M5 EQU 26
DEF GRADE_M6 EQU 27
DEF GRADE_M7 EQU 28
DEF GRADE_M8 EQU 29
DEF GRADE_M9 EQU 30
DEF GRADE_M EQU 31
DEF GRADE_MK EQU 32
DEF GRADE_MV EQU 33
DEF GRADE_MO EQU 34
DEF GRADE_MM EQU 35
DEF GRADE_GM EQU 36
DEF GRADE_NONE EQU 255
DEF GRADE_S10_PLUS EQU 4
; Game mode
DEF MODE_LEADY EQU 0
DEF MODE_GO EQU 3
DEF MODE_POSTGO EQU 6
DEF MODE_PREFETCHED_PIECE EQU 9
DEF MODE_SPAWN_PIECE EQU 12
DEF MODE_PIECE_IN_MOTION EQU 15
DEF MODE_DELAY EQU 18
DEF MODE_GAME_OVER EQU 21
DEF MODE_PRE_GAME_OVER EQU 24
DEF MODE_PAUSED EQU 27
DEF MODE_PREROLL EQU 30
; Helpers to avoid magic numbers
DEF SCORE_ONES EQU 7
DEF SCORE_TENS EQU 6
DEF SCORE_HUNDREDS EQU 5
DEF SCORE_THOUSANDS EQU 4
DEF SCORE_TENTHOUSANDS EQU 3
DEF SCORE_HUNDREDTHOUSANDS EQU 2
DEF SCORE_MILLIONS EQU 1
DEF SCORE_TENMILLIONSS EQU 0
DEF CLEVEL_THOUSANDS EQU 0
DEF CLEVEL_HUNDREDS EQU 1
DEF CLEVEL_TENS EQU 2
DEF CLEVEL_ONES EQU 3
DEF NLEVEL_THOUSANDS EQU 0
DEF NLEVEL_HUNDREDS EQU 1
DEF NLEVEL_TENS EQU 2
DEF NLEVEL_ONES EQU 3
DEF LEVEL_MULT_1A EQU $02
DEF LEVEL_MULT_1B EQU $50
DEF LEVEL_MULT_2A EQU $05
DEF LEVEL_MULT_3A EQU $07
DEF LEVEL_MULT_3B EQU $50
; Title screens
DEF TITLE_MAIN EQU 0
DEF TITLE_PROFILE EQU 3
DEF TITLE_SETTINGS EQU 6
DEF TITLE_RECORDS EQU 9
DEF TITLE_CREDITS EQU 12
DEF TITLE_MAIN_OPTION_BASE EQU $98C3
DEF TITLE_MAIN_OPTIONS EQU 6
DEF TITLE_MAIN_PROFILE EQU $9801
DEF TITLE_MAIN_ROT EQU $99E2
DEF TITLE_MAIN_DROP EQU $99E9
DEF TITLE_MAIN_SCURVE EQU $99F0
DEF TITLE_MAIN_RNG EQU $9A22
DEF TITLE_MAIN_HIG EQU $9A29
DEF TITLE_MAIN_START EQU $9A30
DEF TITLE_MAIN_SEL_START_N EQU 0
DEF TITLE_MAIN_SEL_START_B EQU 1
DEF TITLE_MAIN_SEL_PROFILE EQU 2
DEF TITLE_MAIN_SEL_SETTINGS EQU 3
DEF TITLE_MAIN_SEL_RECORDS EQU 4
DEF TITLE_MAIN_SEL_CREDITS EQU 5
DEF TITLE_SETTINGS_OPTION_BASE EQU $9840
DEF TITLE_SETTINGS_OPTIONS EQU 7
DEF TITLE_SETTINGS_RNG EQU $984F
DEF TITLE_SETTINGS_ROT EQU $986F
DEF TITLE_SETTINGS_DROP EQU $988F
DEF TITLE_SETTINGS_SCURVE EQU $98AF
DEF TITLE_SETTINGS_HIG EQU $98CF
DEF TITLE_SETTINGS_START EQU $98EF
DEF TITLE_SETTINGS_TETRY EQU $99C0
DEF TITLE_SETTINGS_SEL_BACK EQU 6
DEF TITLE_PROFILE_OPTION_BASE EQU $9840
DEF TITLE_PROFILE_OPTIONS EQU 9
DEF TITLE_PROFILE_INDEX EQU $984F
DEF TITLE_PROFILE_NAME_0 EQU $986F
DEF TITLE_PROFILE_NAME_1 EQU $988F
DEF TITLE_PROFILE_NAME_2 EQU $98AF
DEF TITLE_PROFILE_BUTTONS EQU $98CF
DEF TITLE_PROFILE_FILTER EQU $98EF
DEF TITLE_PROFILE_BG EQU $990F
DEF TITLE_PROFILE_RESET EQU $992F
DEF TITLE_PROFILE_BACK EQU $994F
DEF TITLE_PROFILE_TETRY EQU $99C0
DEF TITLE_PROFILE_SEL_RESET EQU 7
DEF TITLE_PROFILE_SEL_BACK EQU 8
DEF TITLE_RECORDS_MODE EQU $9848
DEF TITLE_RECORDS_SCORE_BASE EQU $98A2
DEF TITLE_RECORDS_RNG_BASE EQU 96
DEF TITLE_RECORDS_ROT_BASE EQU 101
DEF TITLE_RECORDS_DROP_BASE EQU 105
DEF TITLE_RECORDS_HIG_BASE EQU 110
DEF TITLE_RECORDS_GRADE_BASE EQU 112
DEF TITLE_RECORDS_RESET_BASE EQU 150
DEF TITLE_RECORDS_RESET_LOC EQU $9A13
DEF PROFILE_SIZE EQU 64
DEF PROFILE_COUNT EQU 10
DEF HISCORE_ENTRY_SIZE EQU 32
DEF HISCORE_ENTRY_COUNT EQU 10
DEF HISCORE_TABLE_COUNT EQU 7
ENDC

File diff suppressed because it is too large Load Diff

View File

@ -59,10 +59,6 @@ ENDC
IF !DEF(HARDWARE_INC)
DEF HARDWARE_INC EQU 1
; Uncomment this line to build a rom with the registers scrambled for the analogue pocket.
; DEF BUILD_POCKET EQU 1
; Usage: rev_Check_hardware_inc <min_ver>
; Examples: rev_Check_hardware_inc 4.1.2
; rev_Check_hardware_inc 4.1 (equivalent to 4.1.0)
@ -538,30 +534,8 @@ DEF AUDENA_OFF EQU %00000000 ; sets all audio regs to 0!
; -- LCDC ($FF40)
; -- LCD Control (R/W)
; --
if def(BUILD_POCKET)
DEF rLCDC EQU $FF4E
else
DEF rLCDC EQU $FF40
endc
if def(BUILD_POCKET)
DEF LCDCF_OFF EQU %00000000 ; LCD Control Operation
DEF LCDCF_ON EQU %00000001 ; LCD Control Operation
DEF LCDCF_WIN9800 EQU %00000000 ; Window Tile Map Display Select
DEF LCDCF_WIN9C00 EQU %00000010 ; Window Tile Map Display Select
DEF LCDCF_WINOFF EQU %00000000 ; Window Display
DEF LCDCF_WINON EQU %00000100 ; Window Display
DEF LCDCF_BLK21 EQU %00000000 ; BG & Window Tile Data Select
DEF LCDCF_BLK01 EQU %00001000 ; BG & Window Tile Data Select
DEF LCDCF_BG9800 EQU %00000000 ; BG Tile Map Display Select
DEF LCDCF_BG9C00 EQU %00010000 ; BG Tile Map Display Select
DEF LCDCF_OBJ8 EQU %00000000 ; OBJ Construction
DEF LCDCF_OBJ16 EQU %00100000 ; OBJ Construction
DEF LCDCF_OBJOFF EQU %00000000 ; OBJ Display
DEF LCDCF_OBJON EQU %01000000 ; OBJ Display
DEF LCDCF_BGOFF EQU %00000000 ; BG Display
DEF LCDCF_BGON EQU %10000000 ; BG Display
else
DEF LCDCF_OFF EQU %00000000 ; LCD Control Operation
DEF LCDCF_ON EQU %10000000 ; LCD Control Operation
DEF LCDCF_WIN9800 EQU %00000000 ; Window Tile Map Display Select
@ -578,18 +552,7 @@ DEF LCDCF_OBJOFF EQU %00000000 ; OBJ Display
DEF LCDCF_OBJON EQU %00000010 ; OBJ Display
DEF LCDCF_BGOFF EQU %00000000 ; BG Display
DEF LCDCF_BGON EQU %00000001 ; BG Display
endc
if def(BUILD_POCKET)
DEF LCDCB_ON EQU 0 ; LCD Control Operation
DEF LCDCB_WIN9C00 EQU 1 ; Window Tile Map Display Select
DEF LCDCB_WINON EQU 2 ; Window Display
DEF LCDCB_BLKS EQU 3 ; BG & Window Tile Data Select
DEF LCDCB_BG9C00 EQU 4 ; BG Tile Map Display Select
DEF LCDCB_OBJ16 EQU 5 ; OBJ Construction
DEF LCDCB_OBJON EQU 6; OBJ Display
DEF LCDCB_BGON EQU 7 ; BG Display
else
DEF LCDCB_ON EQU 7 ; LCD Control Operation
DEF LCDCB_WIN9C00 EQU 6 ; Window Tile Map Display Select
DEF LCDCB_WINON EQU 5 ; Window Display
@ -598,7 +561,6 @@ DEF LCDCB_BG9C00 EQU 3 ; BG Tile Map Display Select
DEF LCDCB_OBJ16 EQU 2 ; OBJ Construction
DEF LCDCB_OBJON EQU 1 ; OBJ Display
DEF LCDCB_BGON EQU 0 ; BG Display
endc
; "Window Character Data Select" follows BG
@ -608,18 +570,6 @@ endc
; --
DEF rSTAT EQU $FF41
if def(BUILD_POCKET)
DEF STATF_LYC EQU %00000010 ; LYC=LY Coincidence (Selectable)
DEF STATF_MODE10 EQU %00000100 ; Mode 10
DEF STATF_MODE01 EQU %00001000 ; Mode 01 (V-Blank)
DEF STATF_MODE00 EQU %00010000 ; Mode 00 (H-Blank)
DEF STATF_LYCF EQU %00100000 ; Coincidence Flag
DEF STATF_HBL EQU %00000000 ; H-Blank
DEF STATF_VBL EQU %10000000 ; V-Blank
DEF STATF_OAM EQU %01000000 ; OAM-RAM is used by system
DEF STATF_LCD EQU %11000000 ; Both OAM and VRAM used by system
DEF STATF_BUSY EQU %01000000 ; When set, VRAM access is unsafe
else
DEF STATF_LYC EQU %01000000 ; LYC=LY Coincidence (Selectable)
DEF STATF_MODE10 EQU %00100000 ; Mode 10
DEF STATF_MODE01 EQU %00010000 ; Mode 01 (V-Blank)
@ -630,23 +580,13 @@ DEF STATF_VBL EQU %00000001 ; V-Blank
DEF STATF_OAM EQU %00000010 ; OAM-RAM is used by system
DEF STATF_LCD EQU %00000011 ; Both OAM and VRAM used by system
DEF STATF_BUSY EQU %00000010 ; When set, VRAM access is unsafe
endc
if def(BUILD_POCKET)
DEF STATB_LYC EQU 1
DEF STATB_MODE10 EQU 2
DEF STATB_MODE01 EQU 3
DEF STATB_MODE00 EQU 4
DEF STATB_LYCF EQU 5
DEF STATB_BUSY EQU 6
else
DEF STATB_LYC EQU 6
DEF STATB_MODE10 EQU 5
DEF STATB_MODE01 EQU 4
DEF STATB_MODE00 EQU 3
DEF STATB_LYCF EQU 2
DEF STATB_BUSY EQU 1
endc
; --
; -- SCY ($FF42)

File diff suppressed because it is too large Load Diff

View File

@ -1,313 +0,0 @@
; 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 R_A EQU (\2 & $1F)
DEF G_A EQU (\3 & $1F)
DEF B_A EQU (\4 & $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 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, +0.86629q25, 25) + MUL(G_C0, +0.13361q25, 25) + MUL(B_C0, +0.00000q25, 25))
; DEF G_C1 EQU (MUL(R_C0, +0.02429q25, 25) + MUL(G_C0, +0.70857q25, 25) + MUL(B_C0, +0.25714q25, 25))
; DEF B_C1 EQU (MUL(R_C0, +0.11337q25, 25) + MUL(G_C0, +0.11448q25, 25) + MUL(B_C0, +0.77215q25, 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

View File

@ -31,12 +31,11 @@ hAState:: ds 1
hBState:: ds 1
hStartState:: ds 1
hSelectState:: ds 1
hFilterMode:: ds 1
hDASCharge:: ds 1
SECTION "Input Functions", ROM0
; Zeroes out all button states.
InputInit::
xor a, a
ldh [hUpState], a
@ -47,13 +46,37 @@ InputInit::
ldh [hBState], a
ldh [hStartState], a
ldh [hSelectState], a
ldh [hDASCharge], a
ret
; Gets the current state of all buttons.
; Held buttons are incremented. Buttons that aren't held are reset to 0.
; Left/Right cause Up/Down to be reset as well.
GetInput::
; Check if the left state > DAS charge.
ldh a, [hLeftState]
ld b, a
ldh a, [hDASCharge]
cp a, b
; If so, save the new DAS charge.
jr nc, :+
ld a, b
;ldh [hDASCharge], a
; Check if the right state > DAS charge.
: ldh a, [hRightState]
ld b, a
ldh a, [hDASCharge]
cp a, b
; If so, save the new DAS charge.
jr nc, :+
ld a, b
;ldh [hDASCharge], a
; There's an overflow risk here if the DAS charge is 255.
: cp a, $FF
jr nz, .btns
dec a
ldh [hDASCharge], a
; Get the button state.
.btns
ld a, P1F_GET_BTN
@ -164,7 +187,7 @@ GetInput::
xor a, a
ldh [hDownState], a
; Read left button.
; Read left button. If it's just been pressed, restore the held DAS charge.
.readLeft
bit 1, b
jr nz, .clearLeft
@ -172,115 +195,42 @@ GetInput::
ldh a, [hLeftState]
cp a, $FF
jr z, .readRight
inc a
cp a, 0
jr nz, :+
ldh a, [hDASCharge]
: inc a
ldh [hLeftState], a
jr .readRight
.clearLeft
xor a, a
ldh [hLeftState], a
; Read right button.
; Read right button. If it's just been pressed, restore the held DAS charge.
.readRight
bit 0, b
jr nz, .clearRight
.setRight
ldh a, [hRightState]
cp a, $FF
jr z, .priorities
inc a
jr z, .checkDAS
cp a, 0
jr nz, :+
ldh a, [hDASCharge]
: inc a
ldh [hRightState], a
jr .priorities
jr .checkDAS
.clearRight
xor a, a
ldh [hRightState], a
; If left or right are pressed, zero out up and down.
.priorities
ldh a, [hFilterMode]
ld b, a
add a, b
add a, b
ld c, a
ld b, 0
ld hl, .jumps
add hl, bc
jp hl
.jumps
jp .dlru
jp .ulrd
jp .lrud
jp .udlr
no_jump
.dlru
ldh a, [hDownState]
or a, a
jr nz, .zerolru
ldh a, [hLeftState]
or a, a
jr nz, .zeroud
ldh a, [hRightState]
or a, a
ret z
jr .zeroud
.ulrd
ldh a, [hUpState]
or a, a
jr nz, .zerolrd
ldh a, [hLeftState]
or a, a
jr nz, .zeroud
ldh a, [hRightState]
or a, a
ret z
jr .zeroud
.lrud
ldh a, [hRightState]
or a, a
jr nz, .zeroud
ldh a, [hLeftState]
or a, a
ret z
jr .zeroud
.udlr
ldh a, [hUpState]
or a, a
jr nz, .zerolr
ldh a, [hLeftState]
or a, a
ret z
jr .zerolr
.zeroud
; If none of the four directions are pressed, reset the DAS charge.
.checkDAS
ld a, b
or a, $F0
cp a, $FF
ret nz
xor a, a
ldh [hUpState], a
ldh [hDownState], a
ret
.zerolr
xor a, a
ldh [hLeftState], a
ldh [hRightState], a
ret
.zerolrd
xor a, a
ldh [hLeftState], a
ldh [hRightState], a
ldh [hDownState], a
ret
.zerolru
xor a, a
ldh [hLeftState], a
ldh [hRightState], a
ldh [hUpState], a
ldh [hDASCharge], a
ret

View File

@ -22,25 +22,23 @@ DEF INTERRUPTS_ASM EQU 1
INCLUDE "globals.asm"
DEF INIT_SCY EQU 3
DEF INIT_LYC EQU 3
SECTION "High Interrupt Variables", HRAM
hLCDCCtr:: ds 1
SECTION "Interrupt Initialization Functions", ROM0
EnableScreenSquish::
di
nop
IntrInit::
xor a, a
ldh [hLCDCCtr], a
ret
InitializeLCDCInterrupt::
ld a, STATF_LYC
ldh [rSTAT], a
ld a, INIT_LYC
ld a, 6
ldh [rLYC], a
ld a, INIT_SCY
ld a, 0
ldh [rSCY], a
ld a, IEF_STAT
ldh [rIE], a
@ -49,20 +47,8 @@ EnableScreenSquish::
ei
ret
DisableScreenSquish::
di
nop
xor a, a
ldh [rIE], a
ldh [rIF], a
ldh [rSCY], a
ei
ret
SECTION "LCDC Interrupt", ROM0[INT_HANDLER_STAT]
; This interrupt handler will be called every 7 scanlines, scrolling up the tile map by 1 line. This has the
; effect of making the tiles appear as 8x7 pixels, and making 20 rows fit on the screen.
LCDCInterrupt:
push af
push hl
@ -83,14 +69,19 @@ LCDCInterrupt_WaitUntilNotBusy:
ldh [rLYC], a
; Check our interrupt counter
cp a, 144
jr c, LCDCInterrupt_End
ld a, INIT_LYC
ldh a, [hLCDCCtr]
cp 21
jr nz, LCDCInterrupt_End
ld a, 255
ldh [hLCDCCtr], a
ld a, 6
ldh [rLYC], a
ld a, INIT_SCY
ld a, 0
ldh [rSCY], a
LCDCInterrupt_End:
inc a
ldh [hLCDCCtr], a
pop hl
pop af
reti

View File

@ -1,202 +0,0 @@
; 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(INTRO_ASM)
DEF INTRO_ASM EQU 1
INCLUDE "globals.asm"
DEF_RGB555 FADE_0, 31, 31, 31
DEF_RGB555 FADE_1, 30, 30, 30
DEF_RGB555 FADE_2, 29, 29, 29
DEF_RGB555 FADE_3, 28, 28, 28
DEF_RGB555 FADE_4, 27, 27, 27
DEF_RGB555 FADE_5, 26, 26, 26
DEF_RGB555 FADE_6, 25, 25, 25
DEF_RGB555 FADE_7, 24, 24, 24
DEF_RGB555 FADE_8, 23, 23, 23
DEF_RGB555 FADE_9, 22, 22, 22
DEF_RGB555 FADE_10, 21, 21, 21
DEF_RGB555 FADE_11, 20, 20, 20
DEF_RGB555 FADE_12, 19, 19, 19
DEF_RGB555 FADE_13, 18, 18, 18
DEF_RGB555 FADE_14, 17, 17, 17
DEF_RGB555 FADE_15, 16, 16, 16
DEF_RGB555 FADE_16, 15, 15, 15
DEF_RGB555 FADE_17, 14, 14, 14
DEF_RGB555 FADE_18, 13, 13, 13
DEF_RGB555 FADE_19, 12, 12, 12
DEF_RGB555 FADE_20, 11, 11, 11
DEF_RGB555 FADE_21, 10, 10, 10
DEF_RGB555 FADE_22, 9, 9, 9
DEF_RGB555 FADE_23, 8, 8, 8
DEF_RGB555 FADE_24, 7, 7, 7
DEF_RGB555 FADE_25, 6, 6, 6
DEF_RGB555 FADE_26, 5, 5, 5
DEF_RGB555 FADE_27, 4, 4, 4
DEF_RGB555 FADE_28, 3, 3, 3
DEF_RGB555 FADE_29, 2, 2, 2
DEF_RGB555 FADE_30, 1, 1, 1
DEF_RGB555 FADE_31, 0, 0, 0
SECTION "Intro Effect Trampoline", ROM0
DoIntroEffect::
ld b, BANK_TITLE
rst RSTSwitchBank
ld a, [wInitialA]
cp a, $11
call nz, DoDMGEffect
call z, DoGBCEffect
jp RSTRestoreBank
SECTION "Intro Effects Banked", ROMX, BANK[BANK_TITLE]
DoDMGEffect:
; Yeet the logo
ld c, 10
.loop0
push bc
call GetInput
pop bc
ldh a, [hStartState]
ld hl, hAState
or a, [hl]
ld hl, hBState
or a, [hl]
ret nz
wait_vblank
ldh a, [rSCY]
dec a
ldh [rSCY], a
wait_vblank_end
dec c
jr nz, .loop0
ld c, 45
.loop1
push bc
call GetInput
pop bc
ldh a, [hStartState]
ld hl, hAState
or a, [hl]
ld hl, hBState
or a, [hl]
ret nz
wait_vblank
ldh a, [rSCY]
inc a
inc a
ldh [rSCY], a
wait_vblank_end
dec c
jr nz, .loop1
; Fade
wait_vblank
ld a, PALETTE_MONO_2
ldh [rBGP], a
ld c, 20
.loop2
push bc
call GetInput
pop bc
ldh a, [hStartState]
ld hl, hAState
or a, [hl]
ld hl, hBState
or a, [hl]
ret nz
wait_vblank
wait_vblank_end
dec c
jr nz, .loop2
wait_vblank
ld a, PALETTE_MONO_1
ldh [rBGP], a
ld c, 20
.loop3
push bc
call GetInput
pop bc
ldh a, [hStartState]
ld hl, hAState
or a, [hl]
ld hl, hBState
or a, [hl]
ret nz
wait_vblank
wait_vblank_end
dec c
jr nz, .loop3
wait_vblank
ld a, PALETTE_MONO_0
ldh [rBGP], a
ld c, 20
.loop4
push bc
call GetInput
pop bc
ldh a, [hStartState]
ld hl, hAState
or a, [hl]
ld hl, hBState
or a, [hl]
ret nz
wait_vblank
wait_vblank_end
dec c
jr nz, .loop4
ret
DoGBCEffect:
; Fade the screen to black.
FOR I, 31, 0, -1
wait_vblank
WRITEPAL_B 0, (I << 10 | I << 5 | I), (I << 10 | I << 5 | I), (I << 10 | I << 5 | I), (I << 10 | I << 5 | I)
wait_vblank_end
wait_vblank
wait_vblank_end
call GetInput
ldh a, [hStartState]
ld hl, hAState
or a, [hl]
ld hl, hBState
or a, [hl]
ret nz
ENDR
wait_vblank
wait_vblank_end
wait_vblank
wait_vblank_end
wait_vblank
wait_vblank_end
wait_vblank
wait_vblank_end
wait_vblank
ret
ENDC

View File

@ -25,54 +25,36 @@ INCLUDE "globals.asm"
SECTION "High Level Variables", HRAM
hCurrentDAS:: ds 1
hCurrentARE:: ds 1
hCurrentLineARE:: ds 1
hCurrentLockDelay:: ds 1
hCurrentLineClearDelay:: ds 1
hCurrentIntegerGravity:: ds 1
hCurrentFractionalGravity:: ds 1
hCurrentGravityPerTick:: ds 1
hCurrentFramesPerGravityTick:: ds 1
hNextSpeedUp:: ds 2
hSpeedCurvePtr:: ds 2
hStartSpeed:: ds 2
hRequiresLineClear:: ds 1
hLevel:: ds 2
hCLevel:: ds 4
hNLevel:: ds 4
hTrueCLevel:: ds 4
hNLevel:: ds 6 ; The extra 2 bytes will be clobbered by the sprite drawing functions.
hPrevHundreds:: ds 1
SECTION "Level Variables", WRAM0
wBoneActivationLevel: ds 2
wInvisActivationLevel: ds 2
wKillScreenActivationLevel: ds 2
wKillScreenActivationLevelBCD: ds 2
wLastLockLevel: ds 2
wStaffRollDuration:: ds 2
wBigStaffRoll:: ds 1
wBonesActive:: ds 1
wInvisActive:: ds 1
wKillScreenActive:: ds 1
wLockLevel:: ds 1
wShouldGoStaffRoll:: ds 1
wNoMoreLocks:: ds 1
wSkippedSectionsBCD:: ds 1
SECTION "Level Functions", ROM0
; Loads the initial state of the speed curve.
LevelInit::
; Bank to speed curve data.
ld b, BANK_OTHER
rst RSTSwitchBank
xor a, a
ldh [hLevel], a
ldh [hLevel+1], a
ldh [hCLevel], a
ldh [hCLevel+1], a
ldh [hCLevel+2], a
ldh [hCLevel+3], a
ldh [hNLevel], a
ldh [hNLevel+2], a ; Note +1 is inited later.
ldh [hNLevel+3], a
ldh [hRequiresLineClear], a
ld [wBonesActive], a
ld [wInvisActive], a
ld [wKillScreenActive], a
ld [wLockLevel], a
ld [wShouldGoStaffRoll], a
ld [wNoMoreLocks], a
ld [wSkippedSectionsBCD], a
ld a, 1
ldh [hNLevel+1], a
ldh a, [hStartSpeed]
ld l, a
@ -84,22 +66,18 @@ LevelInit::
ld b, a
and a, $0F
ldh [hCLevel+3], a
ldh [hTrueCLevel+3], a
ld a, b
swap a
and a, $0F
ldh [hCLevel+2], a
ldh [hTrueCLevel+2], a
ld a, [hl+]
ld b, a
and a, $0F
ldh [hCLevel+1], a
ldh [hTrueCLevel+1], a
ld a, b
swap a
and a, $0F
ldh [hCLevel], a
ldh [hTrueCLevel], a
ld a, l
ldh [hSpeedCurvePtr], a
@ -130,102 +108,12 @@ LevelInit::
and a, $0F
ldh [hNLevel], a
; Get special data.
call SpecialLevelInit
; Restore the bank to keep the stack balanced.
rst RSTRestoreBank
; Get the speed curve
jp AdjustSpeedCurveForced
SpecialLevelInit:
ld a, [wSpeedCurveState]
ld b, a
add a, b
add a, b
ld b, 0
ld c, a
ld hl, .jumps
add hl, bc
jp hl
.jumps
jp .dmgt
jp .tgm1
jp .tgm3
jp .deat
jp .shir
jp .chil
jp .myco
.dmgt
ld hl, sDMGTSpeedCurveSpecialData
jr .loaddata
.tgm1
ld hl, sTGM1SpeedCurveSpecialData
jr .loaddata
.tgm3
ld hl, sTGM3SpeedCurveSpecialData
jr .loaddata
.deat
ld hl, sDEATSpeedCurveSpecialData
jr .loaddata
.shir
ld hl, sSHIRSpeedCurveSpecialData
jr .loaddata
.chil
ld hl, sCHILSpeedCurveSpecialData
jr .loaddata
.myco
ld hl, sMYCOSpeedCurveSpecialData
jr .loaddata
.loaddata
ld a, [hl+]
ld [wBoneActivationLevel], a
ld a, [hl+]
ld [wBoneActivationLevel+1], a
ld a, [hl+]
ld [wInvisActivationLevel], a
ld a, [hl+]
ld [wInvisActivationLevel+1], a
ld a, [hl+]
ld [wKillScreenActivationLevel], a
ld a, [hl+]
ld [wKillScreenActivationLevel+1], a
ld a, [hl+]
ld [wKillScreenActivationLevelBCD], a
ld a, [hl+]
ld [wKillScreenActivationLevelBCD+1], a
ld a, [hl+]
ld [wLastLockLevel], a
ld a, [hl+]
ld [wLastLockLevel+1], a
ld a, [hl+]
ld [wStaffRollDuration], a
ld a, [hl+]
ld [wStaffRollDuration+1], a
ld a, [hl]
ld [wBigStaffRoll], a
call DoSpeedUp
ret
; Increment level and speed up if necessary. Level increment in E.
; Levels may only increment by single digits.
LevelUp::
; Return if our level is hard locked.
ld a, [wLockLevel]
cp a, $FF
ret z
; Return if we're maxed out.
ld hl, hCLevel
ld a, $09
@ -308,7 +196,10 @@ LevelUp::
ldh [hLevel], a
ld a, h
ldh [hLevel+1], a
jp AdjustSpeedCurve
call DoSpeedUp
ld a, SFX_RANKUP
call SFXEnqueue
ret
.checknlevel
; Make wNLevel make sense.
@ -329,16 +220,15 @@ LevelUp::
ld hl, hCLevel+2
ld a, [hl+]
cp a, 9
jp nz, AdjustSpeedCurve
jr nz, .checkspeedup
ld a, [hl]
cp a, 8
jp nz, AdjustSpeedCurve
jr nz, .checkspeedup
ld a, $FF
ldh [hRequiresLineClear], a
call SFXKill
ld a, SFX_LEVELLOCK
call SFXEnqueue
jp .leveljinglemaybe
jr .leveljinglemaybe
; Otherwise check the second digit of wCLevel.
: ld hl, hCLevel+1
@ -363,62 +253,6 @@ LevelUp::
ld hl, hNLevel+1
ld [hl], a
; Check for regrets or cools
; Make sure we are at level *70-*78 and that we didn't check for the cool already
.checkcool
ld a, [wSpeedCurveState]
cp a, SCURVE_TGM3
jr nz, .bellmaybe
ld a, [wCOOLIsActive]
cp a, 1
jr z, .checkregret
ld a, [hCLevel+CLEVEL_TENS]
cp a, 7
jr nz, .checkregret
ld a, [hCLevel+CLEVEL_ONES]
cp a, 9
call c, TGM3COOLHandler
cp a, 1
jr z, .bellmaybe
.checkregret
; Make sure we are at level *00-*05 and that we haven't checked already. Reset the section timer, too.
ld a, [wREGRETChecked]
cp a, 1
jr z, .bellmaybe
ld a, [hCLevel+CLEVEL_TENS]
cp a, 0
jr nz, .regretavailable
ld a, [hCLevel+CLEVEL_ONES]
cp a, 6
call c, TGM3REGRETHandler
ld a, [wSectionTimerReset]
cp a, 1
jr z, .bellmaybe
.resetsectiontimer
ld a, [hCLevel+CLEVEL_HUNDREDS]
ld b, a
ld a, [hCLevel+CLEVEL_THOUSANDS]
swap a
or b
cp a, $00
jr z, .regretavailable
ld a, [hCLevel+CLEVEL_TENS]
cp a, 0
jr nz, .regretavailable
xor a, a
ld [wSectionMinutes], a
ld [wSectionSeconds], a
ld [wSectionFrames], a
inc a
ld [wSectionTimerReset], a
.regretavailable
xor a, a
ld [wREGRETChecked], a
.bellmaybe
; If the last two digits of wCLevel are 99, play the bell.
ld hl, hCLevel+2
@ -426,12 +260,8 @@ LevelUp::
and a, [hl]
cp a, 9
jr nz, .leveljinglemaybe
ld a, [wNoMoreLocks]
cp a, $FF
jr z, AdjustSpeedCurve
ld a, $FF
ldh [hRequiresLineClear], a
call SFXKill
ld a, SFX_LEVELLOCK
call SFXEnqueue
@ -440,75 +270,52 @@ LevelUp::
ld b, a
ldh a, [hCLevel+1]
cp a, b
jr z, AdjustSpeedCurve
call SFXKill
jr z, .checkspeedup
ld a, SFX_LEVELUP
call SFXEnqueue
; This falls through to AdjustSpeedCurve, this is intended.
AdjustSpeedCurve:
call BuildTrueCLevel
call CheckSpecialLevelConditions
.docheck
.checkthousands
; Get the thousands level of the next speed up.
.checkspeedup
ldh a, [hNextSpeedUp]
and a, $F0
jr z, :+
swap a
and a, $0F
; Compare to ours.
ld hl, hTrueCLevel+CLEVEL_THOUSANDS
ld hl, hCLevel
cp a, [hl]
jr z, .checkhundreds ; Equal? We need to check deeper.
jr c, AdjustSpeedCurveForced ; Ours higher? We need to increase.
ret ; Ours lower? We're done.
jr z, :+
ret nc
.checkhundreds
; Get the hundreds level of the next speed up.
ldh a, [hNextSpeedUp]
: ldh a, [hNextSpeedUp]
and a, $0F
; Compare to ours.
ld hl, hTrueCLevel+CLEVEL_HUNDREDS
jr z, :+
ld hl, hCLevel+1
cp a, [hl]
jr z, .checktens ; Equal? We need to check deeper.
jr c, AdjustSpeedCurveForced ; Ours higher? We need to increase.
ret ; Ours lower? We're done.
jr z, :+
ret nc
.checktens
; Get the tens level of the next speed up.
ldh a, [hNextSpeedUp+1]
: ldh a, [hNextSpeedUp+1]
and a, $F0
jr z, :+
swap a
and a, $0F
; Compare to ours.
ld hl, hTrueCLevel+CLEVEL_TENS
ld hl, hCLevel+2
cp a, [hl]
jr z, .checkones ; Equal? We need to check deeper.
jr c, AdjustSpeedCurveForced ; Ours higher? We need to increase.
ret ; Ours lower? We're done.
jr z, :+
ret nc
.checkones
; Get the ones level of the next speed up.
ldh a, [hNextSpeedUp+1]
: ldh a, [hNextSpeedUp+1]
and a, $0F
; Compare to ours.
ld hl, hTrueCLevel+CLEVEL_ONES
jr z, :+
ld hl, hCLevel+3
cp a, [hl]
jr c, AdjustSpeedCurveForced ; Ours higher? We need to increase.
ret nz ; Ours lower? We're done.
; Equal? We need to increase.
jr z, :+
ret nc
: call DoSpeedUp
ret
AdjustSpeedCurveForced:
; Update all data to the next speed curve data.
; Bank to speed curve data.
ld b, BANK_OTHER
rst RSTSwitchBank
DoSpeedUp:
; Load curve ptr.
ldh a, [hSpeedCurvePtr]
ld l, a
@ -523,14 +330,12 @@ AdjustSpeedCurveForced:
; Get all the new data.
ld a, [hl+]
ldh [hCurrentIntegerGravity], a
ldh [hCurrentGravityPerTick], a
ld a, [hl+]
ldh [hCurrentFractionalGravity], a
ldh [hCurrentFramesPerGravityTick], a
ld a, [hl+]
ldh [hCurrentARE], a
ld a, [hl+]
ldh [hCurrentLineARE], a
ld a, [hl+]
ldh [hCurrentDAS], a
ld a, [hl+]
ldh [hCurrentLockDelay], a
@ -549,401 +354,13 @@ AdjustSpeedCurveForced:
; Do we want to force 20G?
ld a, [wAlways20GState]
or a, a
jr z, .continue
ld a, 20
ldh [hCurrentIntegerGravity], a
xor a, a
ldh [hCurrentFractionalGravity], a
.continue
call RSTRestoreBank
; Jump back, we may need to increase more than once.
jr AdjustSpeedCurve.docheck
; Builds an internal level that is the displayed level skipped an amount of sections ahead.
BuildTrueCLevel:
ld hl, hCLevel
ld a, [hl+]
ldh [hTrueCLevel], a
ld a, [hl+]
ldh [hTrueCLevel+1], a
ld a, [hl+]
ldh [hTrueCLevel+2], a
ld a, [hl]
ldh [hTrueCLevel+3], a
; Except in TGM3 mode, this will always just be the same as the real level, so check for the most common case and bail.
ld a, [wSkippedSectionsBCD]
or a, a
cp a, 0
ret z
; Otherwise, to the thing.
; Amount of steps to increment hundreds.
ld a, [wSkippedSectionsBCD]
and a, $0F
ld b, a
; Increase hundreds
ldh a, [hTrueCLevel+CLEVEL_HUNDREDS]
add a, b
ldh [hTrueCLevel+CLEVEL_HUNDREDS], a
; Is hundreds overflowing?
cp a, $0A
jr c, .thousands
; Yes, it was, so decrease by 10, and increment thousands.
sub a, 10
ldh [hTrueCLevel+CLEVEL_HUNDREDS], a
ld hl, hTrueCLevel+CLEVEL_THOUSANDS
inc [hl]
.thousands
; Amount of steps to increment thousands.
ld a, [wSkippedSectionsBCD]
swap a
and a, $0F
ld b, a
; Increase thousands
ldh a, [hTrueCLevel+CLEVEL_THOUSANDS]
add a, b
ldh [hTrueCLevel+CLEVEL_THOUSANDS], a
; This may cause a nonsense number. Fix it if that happens.
cp a, $0A
ret c
ld a, $09
ldh [hTrueCLevel+CLEVEL_THOUSANDS], a
ret
CheckSpecialLevelConditions:
; Is our nlevel > our kill screen?
ld hl, wKillScreenActivationLevelBCD+1
ld a, [hl]
swap a
and a, $0F
ld b, a
ldh a, [hNLevel]
cp a, b
jr c, .nooverride
jr nz, .override
ld a, [hl-]
and a, $0F
ld b, a
ldh a, [hNLevel+1]
cp a, b
jr c, .nooverride
jr nz, .override
ld a, [hl]
swap a
and a, $0F
ld b, a
ldh a, [hNLevel+2]
cp a, b
jr c, .nooverride
jr nz, .override
ld a, [hl]
and a, $0F
ld b, a
ldh a, [hNLevel+3]
cp a, b
jr c, .nooverride
.override
ld hl, wKillScreenActivationLevelBCD
ld a, [hl]
and a, $0F
ldh [hNLevel+3], a
ld a, [hl+]
swap a
and a, $0F
ldh [hNLevel+2], a
ld a, [hl]
and a, $0F
ldh [hNLevel+1], a
ld a, [hl]
swap a
and a, $0F
ldh [hNLevel], a
; Get our level in bc
.nooverride
ldh a, [hLevel]
ld c, a
ldh a, [hLevel+1]
ld b, a
; Do we need to do a special lock?
.speciallock
ld hl, wLastLockLevel
ld a, [hl+]
cp a, $FF ; $FF means never.
jp z, .bones
; Load the level, binary in de.
ld e, a
ld d, [hl]
; Check if BC == DE...
ld a, b
cp a, d
jr nz, .bones
ld a, c
cp a, e
jr nz, .bones
; Jingle and level lock.
ld a, $FF
ldh [hRequiresLineClear], a
ld [wNoMoreLocks], a
push bc
call SFXKill
ld a, SFX_LEVELLOCK
call SFXEnqueue
pop bc
; Bones?
.bones
ld hl, wBoneActivationLevel
ld a, [hl+]
cp a, $FF ; $FF means never.
jp z, .invis
; Load the level, binary in de.
ld e, a
ld d, [hl]
; Check if BC >= DE...
; Skip if B < D.
ld a, b
cp a, d
jr c, .invis
; We can confidently enter the bone zone if B > D.
jr nz, .enterthebonezone
; If B == D, we need to check C and E...
; Skip if C < E. Otherwise enter the bone zone.
ld a, c
cp a, e
jr c, .invis
.enterthebonezone
ld a, $FF
ld [wBonesActive], a
; Invis?
.invis
ld hl, wInvisActivationLevel
ld a, [hl+]
cp a, $FF ; $FF means never.
jp z, .killscreen
; Load the level, binary in de.
ld e, a
ld d, [hl]
; Check if BC >= DE...
; Skip if B < D.
ld a, b
cp a, d
jr c, .killscreen
; We can confidently vanish if B > D.
jr nz, .vanishoxyaction
; If B == D, we need to check C and E...
; Skip if C < E. Otherwise vanish.
ld a, c
cp a, e
jr c, .killscreen
.vanishoxyaction
ld a, $FF
ld [wInvisActive], a
; Kill screen?
.killscreen
ld hl, wKillScreenActivationLevel
ld a, [hl+]
cp a, $FF
ret z
; Load the level, binary in de.
ld e, a
ld d, [hl]
; Check if BC >= DE...
; Ret if B < D.
ld a, b
cp a, d
ret c
; We can confidently rip if B > D.
jr nz, .rip
; If B == D, we need to check C and E...
; Skip if C < E. Otherwise rip.
ld a, c
cp a, e
ret c
.rip
call SFXKill
ld a, $FF
ld [wKillScreenActive], a
ld hl, wKillScreenActivationLevelBCD
ld a, [hl]
and a, $0F
ldh [hCLevel+3], a
ldh [hNLevel+3], a
ld a, [hl+]
swap a
and a, $0F
ldh [hCLevel+2], a
ldh [hNLevel+2], a
ld a, [hl]
and a, $0F
ldh [hCLevel+1], a
ldh [hNLevel+1], a
ld a, [hl]
swap a
and a, $0F
ldh [hCLevel], a
ldh [hNLevel], a
ld a, $FF
ld [wLockLevel], a
; Since we triggered a kill screen, does this mean the game now just ends, or do we transition to the staff roll?
.staffroll
ld hl, wStaffRollDuration
ld a, [hl+]
cp a, $FF
jr z, .justkill
; Yes, tell the game that we should go to staff roll instead.
ld a, $FF
ld [wShouldGoStaffRoll], a
ret
.justkill
ld a, 1
ldh [hCurrentARE], a
ldh [hCurrentLineARE], a
ldh [hCurrentDAS], a
ldh [hCurrentLockDelay], a
ldh [hCurrentLineClearDelay], a
ld a, 20
ldh [hCurrentIntegerGravity], a
xor a, a
ldh [hCurrentFractionalGravity], a
ret
TriggerKillScreen::
call SFXKill
ldh [hCurrentGravityPerTick], a
ld a, 1
ldh [hCurrentARE], a
ldh [hCurrentLineARE], a
ldh [hCurrentDAS], a
ldh [hCurrentLockDelay], a
ldh [hCurrentLineClearDelay], a
ld a, 20
ldh [hCurrentIntegerGravity], a
xor a, a
ldh [hCurrentFractionalGravity], a
ld [wKillScreenActivationLevel], a
ld [wKillScreenActivationLevel+1], a
ld a, $FF
ld [wKillScreenActive], a
ldh [hCurrentFramesPerGravityTick], a
ret
; Gets a 0-indexed section number, returned in A as binary.
; Levels 0000-0099 would return 0, levels 0100-0199 would return 1, ... levels 9900-9999 would return 99.
GetSection::
; Load thousands.
ldh a, [hCLevel+CLEVEL_THOUSANDS]
; Multiply by 10, which is equal to multiply by 8 + multiply by 2
ld b, a
sla b
add a, a
add a, a
add a, a
add a, b
; Add hundreds.
ld hl, hCLevel+CLEVEL_HUNDREDS
add a, [hl]
ret
; Gets the current section, but as BCD in A.
GetSectionBCD::
ldh a, [hCLevel+CLEVEL_THOUSANDS]
swap a
ld hl, hCLevel+CLEVEL_HUNDREDS
or a, [hl]
ret
; Gets a 0-indexed section number, returned in A as binary.
; Levels 0000-0099 would return 0, levels 0100-0199 would return 1, ... levels 9900-9999 would return 99.
; This version calculates the amount of skipped sections in.
GetAdjustedSection::
; Load thousands.
ldh a, [hTrueCLevel+CLEVEL_THOUSANDS]
; Multiply by 10, which is equal to multiply by 8 + multiply by 2
ld b, a
sla b
add a, a
add a, a
add a, a
add a, b
; Add hundreds.
ld hl, hTrueCLevel+CLEVEL_HUNDREDS
add a, [hl]
ret
; Gets the current section, but as BCD in A.
; This version calculates the amount of skipped sections in.
GetAdjustedSectionBCD::
ldh a, [hTrueCLevel+CLEVEL_THOUSANDS]
swap a
ld hl, hTrueCLevel+CLEVEL_HUNDREDS
or a, [hl]
ret
; Will skip the virtual level forward by 100 levels.
; This will NOT affect the displayed level, nor will it affect scoring.
; It will only make it so the internal speed pointer will be ahead by N*100 levels.
SkipSection::
ld a, [wSkippedSectionsBCD]
add a, $01
daa ; Yes, this is the rare case where this instruction is useful!
ld [wSkippedSectionsBCD], a
jp AdjustSpeedCurve
ENDC

View File

@ -20,7 +20,9 @@ DEF MAIN_ASM EQU 1
INCLUDE "globals.asm"
INCLUDE "res/other_data.inc"
INCLUDE "res/tiles.inc"
INCLUDE "res/gameplay_map.inc"
INCLUDE "res/title_map.inc"
SECTION "High Globals", HRAM
@ -34,10 +36,24 @@ wRotModeState:: ds 1
wDropModeState:: ds 1
wSpeedCurveState:: ds 1
wAlways20GState:: ds 1
wBGMode:: ds 1
wInitialA:: ds 1
wInitialB:: ds 1
wInitialC:: ds 1
wInitialD:: ds 1
wInitialE:: ds 1
wInitialH:: ds 1
wInitialL:: ds 1
SECTION "Persistent Globals", SRAM
rMagic:: ds 4
rSwapABState:: ds 1
rRNGModeState:: ds 1
rRotModeState:: ds 1
rDropModeState:: ds 1
rSpeedCurveState:: ds 1
rAlways20GState:: ds 1
rSelectedStartLevel:: ds 2
SECTION "Stack", WRAM0
@ -47,7 +63,6 @@ wStackEnd::
SECTION "Code Entry Point", ROM0
; Main entry point. Does some set up and then goes into an infinite event loop initialized on the title screen.
Main::
; Load the initial registers. For reasons.
ld [wInitialA], a
@ -55,19 +70,24 @@ Main::
ld [wInitialB], a
ld a, c
ld [wInitialC], a
ld a, d
ld [wInitialD], a
ld a, e
ld [wInitialE], a
ld a, h
ld [wInitialH], a
ld a, l
ld [wInitialL], a
; Initialize the mapper.
ld a, CART_SRAM_ENABLE
ld [rRAMG], a
; Turn off LCD during initialization.
wait_vram
xor a, a
ld [rRAMB], a
ld a, BANK_OTHER
ld [rROMB0], a
ldh [rLCDC], a
; Set up stack
ld sp, wStackEnd-1
; GBC? Double speed.
; GBC? Double speed mode and set up palettes.
ld a, [wInitialA]
cp a, $11
jr nz, .notgbc
@ -76,87 +96,138 @@ Main::
stop
.notgbc
; Harvest entropy
call HarvestEntropy
; Let the console have some fun with the initial screen.
call InputInit
call BankingInit
xor a, a
ldh [hFilterMode], a
call DoIntroEffect
; Turn off LCD during initialization.
wait_vram
xor a, a
ldh [rLCDC], a
ld [wSpritePal], a
; We use a single set of tiles for the entire game, so we copy it at the start.
ld de, Tiles
ld hl, _VRAM
ld bc, TilesEnd - Tiles
call UnsafeMemCopy
; Clear OAM.
call ClearOAM
call SetNumberSpritePositions
call CopyOAMHandler
; Other initialization.
call RestoreSRAM
call InputInit
; Enable RAM. (Not actually needed since we don't ACTUALLY use an MBC, but without this emulators shit the bed.)
ld hl, rRAMG
ld a, CART_SRAM_ENABLE
ld [hl], a
; Check for save data.
ld a, [rMagic]
cp a, "D"
jr nz, .nosavedata
ld a, [rMagic+1]
cp a, "M"
jr nz, .nosavedata
ld a, [rMagic+2]
cp a, "G"
jr nz, .nosavedata
ld a, [rMagic+3]
cp a, "2"
jr nz, .nosavedata
.savedata
ld a, [rSwapABState]
ld [wSwapABState], a
ld a, [rRNGModeState]
ld [wRNGModeState], a
ld a, [rRotModeState]
ld [wRotModeState], a
ld a, [rDropModeState]
ld [wDropModeState], a
ld a, [rSpeedCurveState]
ld [wSpeedCurveState], a
ld a, [rAlways20GState]
ld [wAlways20GState], a
ld a, [rSelectedStartLevel]
ldh [hStartSpeed], a
ld a, [rSelectedStartLevel+1]
ldh [hStartSpeed+1], a
jr .otherinit
.nosavedata
ld a, "D"
ld [rMagic], a
ld a, "M"
ld [rMagic+1], a
ld a, "G"
ld [rMagic+2], a
ld a, "2"
ld [rMagic+3], a
ld a, BUTTON_MODE_NORM
ld [rSwapABState], a
ld [wSwapABState], a
ld a, RNG_MODE_TGM3
ld [rRNGModeState], a
ld [wRNGModeState], a
ld a, RNG_MODE_TGM3
ld [rRNGModeState], a
ld [wRNGModeState], a
ld a, ROT_MODE_ARSTI
ld [rRotModeState], a
ld [wRotModeState], a
ld a, DROP_MODE_SONIC
ld [rDropModeState], a
ld [wDropModeState], a
ld a, SCURVE_DMGT
ld [rSpeedCurveState], a
ld [wSpeedCurveState], a
ld a, HIG_MODE_OFF
ld [rAlways20GState], a
ld [wAlways20GState], a
ld hl, sSpeedCurve
ld a, l
ldh [hStartSpeed], a
ld [rSelectedStartLevel], a
ld a, h
ldh [hStartSpeed+1], a
ld [rSelectedStartLevel+1], a
.otherinit
call TimeInit
call IntrInit
call InputInit
call SFXInit
call BankingInit
xor a, a
ld [wKillScreenActive], a
ld [wSkippedSectionsBCD], a
ldh [hMode], a
; Set up the interrupt handlers.
call InitializeLCDCInterrupt
; Switch to title state.
; Switch to gameplay state.
call SwitchToTitle
; Event loop time!
EventLoop::
; Play the sound effect, if any.
call SFXPlay
call SFXPlayNoise
; Wrangle inputs and timers at the start of every frame.
call GetInput
call HandleTimers
call HandleSectionTimers
; Call the current state's event handler.
ld hl, .eventloopjumps
ldh a, [hGameState]
ld b, 0
ld c, a
add hl, bc
jp hl
.eventloopjumps
ldh a, [hGameState]
cp a, b
jp nz, GamePlayEventLoopHandler
jp TitleEventLoopHandler
jp GamePlayEventLoopHandler
jp GamePlayBigEventLoopHandler
EventLoopPostHandler::
; Wait for vblank.
wait_vblank
; Do OAM DMA.
call hOAMDMA
; This will chain jump into the vblank handler.
jp hOAMDMA
; Call the current state's vblank handler.
ld hl, .vblankjumps
ldh a, [hGameState]
ld b, 0
ld c, a
add hl, bc
jp hl
.vblankjumps
jp TitleVBlankHandler
jp BlitField
jp BigBlitField
; The VBlank Handler is expected to end with jp EventLoop.
; The VBlank Handler is expected to end with jr EventLoop.
ENDC

View File

@ -23,7 +23,7 @@ INCLUDE "globals.asm"
SECTION "Memory Functions", ROM0
; Copies data from de to hl, bc bytes. Doesn't check for vram access.
; Copies data from de to hl, bc bytes
UnsafeMemCopy::
ld a, [de]
ld [hl+], a
@ -35,7 +35,7 @@ UnsafeMemCopy::
ret
; Copies data from de to hl, bc bytes. Checks for vram access.
; Copies data from de to hl, bc bytes
SafeMemCopy::
wait_vram
ld a, [de]
@ -47,8 +47,7 @@ SafeMemCopy::
jr nz, SafeMemCopy
ret
; Sets memory from hl to hl+bc to d. Doesn't check for vram access.
; Sets memory from hl to hl+bc to d
UnsafeMemSet::
ld [hl], d
inc hl
@ -59,16 +58,4 @@ UnsafeMemSet::
ret
; Sets memory from hl to hl+bc to d. Checks for vram access.
SafeMemSet::
wait_vram
ld [hl], d
inc hl
dec bc
ld a, b
or a, c
jr nz, SafeMemSet
ret
ENDC

View File

@ -1,358 +0,0 @@
; 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(PROGRESS_ASM)
DEF PROGRESS_ASM EQU 1
INCLUDE "globals.asm"
DEF TILE_BAR_0 EQU 248
DEF TILE_BAR_1 EQU 249
DEF TILE_BAR_2 EQU 250
DEF TILE_BAR_3 EQU 251
DEF TILE_BAR_4 EQU 252
SECTION "Progress Data", ROM0
sProgressData:
db %00010000, %00110000 ; 0
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011000, %00111000 ; 1
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011100, %00111100 ; 2
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011110, %00111110 ; 3
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 4
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 5
db %10000000, %10000000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 6
db %11000000, %11000000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 7
db %11100000, %11100000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 8
db %11110000, %11110000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 9
db %11111000, %11111000
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 10
db %11111100, %11111100
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 11
db %11111110, %11111110
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 12
db %11111111, %11111111
db %00000000, %00000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 13
db %11111111, %11111111
db %10000000, %10000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 14
db %11111111, %11111111
db %11000000, %11000000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 15
db %11111111, %11111111
db %11100000, %11100000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 16
db %11111111, %11111111
db %11110000, %11110000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 17
db %11111111, %11111111
db %11111000, %11111000
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 18
db %11111111, %11111111
db %11111100, %11111100
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 19
db %11111111, %11111111
db %11111110, %11111110
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 20
db %11111111, %11111111
db %11111111, %11111111
db %00000000, %00000000
db %00000000, %00001000
db %00011111, %00111111 ; 21
db %11111111, %11111111
db %11111111, %11111111
db %10000000, %10000000
db %00000000, %00001000
db %00011111, %00111111 ; 22
db %11111111, %11111111
db %11111111, %11111111
db %11000000, %11000000
db %00000000, %00001000
db %00011111, %00111111 ; 23
db %11111111, %11111111
db %11111111, %11111111
db %11100000, %11100000
db %00000000, %00001000
db %00011111, %00111111 ; 24
db %11111111, %11111111
db %11111111, %11111111
db %11110000, %11110000
db %00000000, %00001000
db %00011111, %00111111 ; 25
db %11111111, %11111111
db %11111111, %11111111
db %11111000, %11111000
db %00000000, %00001000
db %00011111, %00111111 ; 26
db %11111111, %11111111
db %11111111, %11111111
db %11111100, %11111100
db %00000000, %00001000
db %00011111, %00111111 ; 27
db %11111111, %11111111
db %11111111, %11111111
db %11111110, %11111110
db %00000000, %00001000
db %00011111, %00111111 ; 28
db %11111111, %11111111
db %11111111, %11111111
db %11111111, %11111111
db %00000000, %00001000
db %00011111, %00111111 ; 29
db %11111111, %11111111
db %11111111, %11111111
db %11111111, %11111111
db %10000000, %10001000
db %00011111, %00111111 ; 30
db %11111111, %11111111
db %11111111, %11111111
db %11111111, %11111111
db %11000000, %11001000
db %00011111, %00111111 ; 31
db %11111111, %11111111
db %11111111, %11111111
db %11111111, %11111111
db %11100000, %11101000
db %00011111, %00111111 ; 32
db %11111111, %11111111
db %11111111, %11111111
db %11111111, %11111111
db %11110000, %11111000
SECTION "Progress Variables", WRAM0
wProgress0B1:: ds 1
wProgress0B2:: ds 1
wProgress1B1:: ds 1
wProgress1B2:: ds 1
wProgress2B1:: ds 1
wProgress2B2:: ds 1
wProgress3B1:: ds 1
wProgress3B2:: ds 1
wProgress4B1:: ds 1
wProgress4B2:: ds 1
SECTION "Progress Functions", ROM0
; Changes the tiles between the level counters to show some progress.
; Progress in A, 0-32.
SetProgress::
ld hl, sProgressData
or a, a
jr z, .correct
ld b, a
ld de, 10
.loop
add hl, de
dec b
jr nz, .loop
.correct
ld de, wProgress0B1
ld a, [hl+]
ld [de], a
inc de
ld a, [hl+]
ld [de], a
inc de
ld a, [hl+]
ld [de], a
inc de
ld a, [hl+]
ld [de], a
inc de
ld a, [hl+]
ld [de], a
inc de
ld a, [hl+]
ld [de], a
inc de
ld a, [hl+]
ld [de], a
inc de
ld a, [hl+]
ld [de], a
inc de
ld a, [hl+]
ld [de], a
inc de
ld a, [hl+]
ld [de], a
ld hl, _VRAM + (TILE_BAR_0*16) + (3*2)
ld a, [wProgress0B1]
ld b, a
wait_vram
ld [hl], b
inc hl
ld a, [wProgress0B2]
ld b, a
wait_vram
ld [hl], b
ld hl, _VRAM + (TILE_BAR_1*16) + (3*2)
ld a, [wProgress1B1]
ld b, a
wait_vram
ld [hl], b
inc hl
ld a, [wProgress1B2]
ld b, a
wait_vram
ld [hl], b
ld hl, _VRAM + (TILE_BAR_2*16) + (3*2)
ld a, [wProgress2B1]
ld b, a
wait_vram
ld [hl], b
inc hl
ld a, [wProgress2B2]
ld b, a
wait_vram
ld [hl], b
ld hl, _VRAM + (TILE_BAR_3*16) + (3*2)
ld a, [wProgress3B1]
ld b, a
wait_vram
ld [hl], b
inc hl
ld a, [wProgress3B2]
ld b, a
wait_vram
ld [hl], b
ld hl, _VRAM + (TILE_BAR_4*16) + (3*2)
ld a, [wProgress4B1]
ld b, a
wait_vram
ld [hl], b
inc hl
ld a, [wProgress4B2]
ld b, a
wait_vram
ld [hl], b
ret
ENDC

30
src/res/build_date.asm Normal file
View File

@ -0,0 +1,30 @@
; 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(BUILD_DATE_ASM)
DEF BUILD_DATE_ASM EQU 1
SECTION "Build date", ROM0
db "Built "
BuildDate::
db __ISO_8601_UTC__
db 0
ENDC

View File

@ -1,457 +0,0 @@
; 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(GAMEPLAY_BIG_MAP_INC)
DEF GAMEPLAY_BIG_MAP_INC EQU 1
INCLUDE "globals.asm"
SECTION "Gameplay Big Static Data", ROMX, BANK[BANK_GAMEPLAY_BIG]
sBigLeftDasSlam::
db -1
db 0
db -1
db 0
db -1
db -2
sBigRightDasSlam::
db -3
db -4
db -3
db -4
db -3
db -2
sBigLeady:: db " READY? "
sBigGo:: db " GO "
sBigPause::
db "P A U S E "
db " "
db " P A U S E"
db " "
sBigKill::
db "EXCELLENT!"
db " "
db " "
db " BUT... "
db " "
db " "
db " LET'S GO "
db " "
db " BETTER "
db " "
db "NEXT TIME!"
db " "
db " "
db " RETRY[A] "
db " "
db " QUIT [B] "
sBigYouAreGM::
db " YOU ARE "
db " "
db " GRAND "
db " "
db " MASTER! "
db " "
db " "
db " RETRY[A] "
db " "
db " QUIT [B] "
sBigFinalChallenge::
db " "
db " "
db " "
db "EXCELLENT!"
db " "
db " "
db " BUT NOW "
db " "
db "TRY FINAL"
db " "
db "CHALLENGE!"
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
sBigPieceXOffsets:: ; How to draw each piece. X-offsets of the sprites.
db 0, 8, 16, 24 ; I
db 0, 8, 8, 16 ; Z
db 0, 8, 8, 16 ; S
db 0, 8, 16, 16 ; J
db 0, 0, 8, 16 ; L
db 8, 8, 16, 16 ; O
db 0, 8, 8, 16 ; T
sBigPieceYOffsets:: ; How to draw each piece. Y-offsets of the sprites.
db 0, 0, 0, 0 ; I
db 0, 0, 7, 7 ; Z
db 7, 7, 0, 0 ; S
db 0, 0, 0, 7 ; J
db 7, 0, 0, 0 ; L
db 0, 7, 0, 7 ; O
db 0, 0, 7, 0 ; T
sBigPieceFastRotationStates::
; I
db 14, 1, 1, 1
db 2, 14, 14, 14
db 14, 1, 1, 1
db 2, 14, 14, 14
; Z
db 14, 1, 14, 1
db 2, 13, 1, 13
db 14, 1, 14, 1
db 2, 13, 1, 13
; S
db 15, 1, 12, 1
db 0, 14, 1, 14
db 15, 1, 12, 1
db 0, 14, 1, 14
; J
db 14, 1, 1, 14
db 1, 1, 13, 14
db 14, 14, 1, 1
db 1, 14, 13, 1
; L
db 14, 1, 1, 12
db 1, 14, 14, 1
db 16, 12, 1, 1
db 0, 1, 14, 14
; O
db 15, 1, 13, 1
db 15, 1, 13, 1
db 15, 1, 13, 1
db 15, 1, 13, 1
; T
db 14, 1, 1, 13
db 1, 14, 1, 13
db 15, 13, 1, 1
db 1, 13, 1, 14
sBigPieceRotationStates:: ; How each piece is rotated.
; I
db %0000
db %1111
db %0000
db %0000
db %0010
db %0010
db %0010
db %0010
db %0000
db %1111
db %0000
db %0000
db %0010
db %0010
db %0010
db %0010
; Z
db %0000
db %1100
db %0110
db %0000
db %0010
db %0110
db %0100
db %0000
db %0000
db %1100
db %0110
db %0000
db %0010
db %0110
db %0100
db %0000
; S
db %0000
db %0110
db %1100
db %0000
db %1000
db %1100
db %0100
db %0000
db %0000
db %0110
db %1100
db %0000
db %1000
db %1100
db %0100
db %0000
; J
db %0000
db %1110
db %0010
db %0000
db %0110
db %0100
db %0100
db %0000
db %0000
db %1000
db %1110
db %0000
db %0100
db %0100
db %1100
db %0000
; L
db %0000
db %1110
db %1000
db %0000
db %0100
db %0100
db %0110
db %0000
db %0000
db %0010
db %1110
db %0000
db %1100
db %0100
db %0100
db %0000
; O
db %0000
db %0110
db %0110
db %0000
db %0000
db %0110
db %0110
db %0000
db %0000
db %0110
db %0110
db %0000
db %0000
db %0110
db %0110
db %0000
; T
db %0000
db %1110
db %0100
db %0000
db %0100
db %0110
db %0100
db %0000
db %0000
db %0100
db %1110
db %0000
db %0100
db %1100
db %0100
db %0000
sBigGameplayTileMap::
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$01,$01,$01,$01,$01,$EA,$EC,$EE,$F0
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6D,$19,$10,$23,$1F,$01,$EB,$ED
DB $EF,$F1,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$01,$01,$01,$01,$01
DB $E0,$F7,$F7,$F6,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$E2,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6D,$01
DB $01,$01,$01,$01,$01,$01,$01,$6F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$E1,$01,$01,$01,$01,$E3,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6E,$70,$70,$70,$70,$70,$70,$70
DB $70,$71,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$13,$1A,$17,$0F,$01
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$01,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6D,$01
DB $01,$01,$01,$01,$01,$01,$01,$6F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$01,$01,$01,$01,$01,$01,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6E,$70,$70,$70,$70,$70,$70,$70
DB $70,$71,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$1E,$0E,$1A,$1D,$10
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$01,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6E,$70
DB $70,$70,$70,$70,$F4,$70,$70,$71,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$17,$10,$21,$10,$17,$6F,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6D,$01,$01,$01,$01,$01,$6F,$01
DB $01,$6F,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$F8,$F9,$FA,$FB,$FC
DB $6F,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$6F,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$E6,$E7
DB $E7,$E7,$E7,$E7,$F5,$E7,$E7,$E8,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $E5,$E4,$E4,$D4,$E4,$E4,$DF,$E4,$E4,$E9
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00
sBigGameplayTileMapEnd::
sBigGameplayUngradedTileMap::
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$01,$01,$01,$01,$01,$01,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6D,$19,$10,$23,$1F,$01,$01,$01
DB $01,$6F,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$01,$01,$01,$01,$01
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$E2,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6D,$01
DB $01,$01,$01,$01,$01,$01,$01,$6F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$E1,$01,$01,$01,$01,$E3,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6E,$70,$70,$70,$70,$70,$70,$70
DB $70,$71,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$13,$1A,$17,$0F,$01
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$01,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6D,$01
DB $01,$01,$01,$01,$01,$01,$01,$6F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$01,$01,$01,$01,$01,$01,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6E,$70,$70,$70,$70,$70,$70,$70
DB $70,$71,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$1E,$0E,$1A,$1D,$10
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$01,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6E,$70
DB $70,$70,$70,$70,$F4,$70,$70,$71,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$17,$14,$19,$10,$1E,$6F,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6D,$01,$01,$01,$01,$01,$6F,$01
DB $01,$6F,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$F8,$F9,$FA,$FB,$FC
DB $6F,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$6F,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$E6,$E7
DB $E7,$E7,$E7,$E7,$F5,$E7,$E7,$E8,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $E5,$E4,$E4,$D4,$E4,$E4,$DF,$E4,$E4,$E9
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00
sBigGameplayUngradedTileMapEnd::
ENDC

View File

@ -1,470 +0,0 @@
; 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(GAMEPLAY_MAP_INC)
DEF GAMEPLAY_MAP_INC EQU 1
INCLUDE "globals.asm"
SECTION "Gameplay Static Data", ROMX, BANK[BANK_GAMEPLAY]
sLeftDasSlam::
db -1
db 0
db -1
db 0
db -1
db -2
sRightDasSlam::
db -3
db -4
db -3
db -4
db -3
db -2
sLeady:: db " READY? "
sGo:: db " GO "
sPause::
db "P A U S E "
db " "
db " P A U S E"
db " "
sKill::
db "EXCELLENT!"
db " "
db " "
db " BUT... "
db " "
db " "
db " LET'S GO "
db " "
db " BETTER "
db " "
db "NEXT TIME!"
db " "
db " "
db " RETRY[A] "
db " "
db " QUIT [B] "
sYouAreGM::
db " YOU ARE "
db " "
db " GRAND "
db " "
db " MASTER! "
db " "
db " "
db " RETRY[A] "
db " "
db " QUIT [B] "
sFinalChallenge::
db " "
db " "
db " "
db "EXCELLENT!"
db " "
db " "
db " BUT NOW "
db " "
db "TRY FINAL"
db " "
db "CHALLENGE!"
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
sPieceXOffsets:: ; How to draw each piece. X-offsets of the sprites.
db 0, 8, 16, 24 ; I
db 0, 8, 8, 16 ; Z
db 0, 8, 8, 16 ; S
db 0, 8, 16, 16 ; J
db 0, 0, 8, 16 ; L
db 8, 8, 16, 16 ; O
db 0, 8, 8, 16 ; T
sPieceYOffsets:: ; How to draw each piece. Y-offsets of the sprites.
db 0, 0, 0, 0 ; I
db 0, 0, 7, 7 ; Z
db 7, 7, 0, 0 ; S
db 0, 0, 0, 7 ; J
db 7, 0, 0, 0 ; L
db 0, 7, 0, 7 ; O
db 0, 0, 7, 0 ; T
sPieceFastRotationStates::
; I
db 14, 1, 1, 1
db 2, 14, 14, 14
db 14, 1, 1, 1
db 2, 14, 14, 14
; Z
db 14, 1, 14, 1
db 2, 13, 1, 13
db 14, 1, 14, 1
db 2, 13, 1, 13
; S
db 15, 1, 12, 1
db 0, 14, 1, 14
db 15, 1, 12, 1
db 0, 14, 1, 14
; J
db 14, 1, 1, 14
db 1, 1, 13, 14
db 14, 14, 1, 1
db 1, 14, 13, 1
; L
db 14, 1, 1, 12
db 1, 14, 14, 1
db 16, 12, 1, 1
db 0, 1, 14, 14
; O
db 15, 1, 13, 1
db 15, 1, 13, 1
db 15, 1, 13, 1
db 15, 1, 13, 1
; T
db 14, 1, 1, 13
db 1, 14, 1, 13
db 15, 13, 1, 1
db 1, 13, 1, 14
sPieceRotationStates:: ; How each piece is rotated.
; I
db %0000
db %1111
db %0000
db %0000
db %0010
db %0010
db %0010
db %0010
db %0000
db %1111
db %0000
db %0000
db %0010
db %0010
db %0010
db %0010
; Z
db %0000
db %1100
db %0110
db %0000
db %0010
db %0110
db %0100
db %0000
db %0000
db %1100
db %0110
db %0000
db %0010
db %0110
db %0100
db %0000
; S
db %0000
db %0110
db %1100
db %0000
db %1000
db %1100
db %0100
db %0000
db %0000
db %0110
db %1100
db %0000
db %1000
db %1100
db %0100
db %0000
; J
db %0000
db %1110
db %0010
db %0000
db %0110
db %0100
db %0100
db %0000
db %0000
db %1000
db %1110
db %0000
db %0100
db %0100
db %1100
db %0000
; L
db %0000
db %1110
db %1000
db %0000
db %0100
db %0100
db %0110
db %0000
db %0000
db %0010
db %1110
db %0000
db %1100
db %0100
db %0100
db %0000
; O
db %0000
db %0110
db %0110
db %0000
db %0000
db %0110
db %0110
db %0000
db %0000
db %0110
db %0110
db %0000
db %0000
db %0110
db %0110
db %0000
; T
db %0000
db %1110
db %0100
db %0000
db %0100
db %0110
db %0100
db %0000
db %0000
db %0100
db %1110
db %0000
db %0100
db %1100
db %0100
db %0000
sTGM3Bag::
db 0, 0, 0, 0, 0
db 1, 1, 1, 1, 1
db 2, 2, 2, 2, 2
db 3, 3, 3, 3, 3
db 4, 4, 4, 4, 4
db 5, 5, 5, 5, 5
db 6, 6, 6, 6, 6
sTGM3Droughts::
db 0, 0, 0, 0, 0, 0, 0
sGameplayTileMap::
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$01,$01,$01,$01,$01,$EA,$EC,$EE,$F0
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6D,$19,$10,$23,$1F,$01,$EB,$ED
DB $EF,$F1,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$01,$01,$01,$01,$01
DB $E0,$F7,$F7,$F6,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$E2,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6D,$01
DB $01,$01,$01,$01,$01,$01,$01,$6F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$E1,$01,$01,$01,$01,$E3,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6E,$70,$70,$70,$70,$70,$70,$70
DB $70,$71,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$13,$1A,$17,$0F,$01
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$01,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6D,$01
DB $01,$01,$01,$01,$01,$01,$01,$6F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$01,$01,$01,$01,$01,$01,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6E,$70,$70,$70,$70,$70,$70,$70
DB $70,$71,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$1E,$0E,$1A,$1D,$10
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$01,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6E,$70
DB $70,$70,$70,$70,$F4,$70,$70,$71,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$17,$10,$21,$10,$17,$6F,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6D,$01,$01,$01,$01,$01,$6F,$01
DB $01,$6F,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$F8,$F9,$FA,$FB,$FC
DB $6F,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$6F,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$E6,$E7
DB $E7,$E7,$E7,$E7,$F5,$E7,$E7,$E8,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $E5,$E4,$E4,$D4,$E4,$E4,$DF,$E4,$E4,$E9
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00
sGameplayTileMapEnd::
sGameplayUngradedTileMap::
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$01,$01,$01,$01,$01,$01,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6D,$19,$10,$23,$1F,$01,$01,$01
DB $01,$6F,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$01,$01,$01,$01,$01
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$E2,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6D,$01
DB $01,$01,$01,$01,$01,$01,$01,$6F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$E1,$01,$01,$01,$01,$E3,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6E,$70,$70,$70,$70,$70,$70,$70
DB $70,$71,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$13,$1A,$17,$0F,$01
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$01,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6D,$01
DB $01,$01,$01,$01,$01,$01,$01,$6F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$01,$01,$01,$01,$01,$01,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6E,$70,$70,$70,$70,$70,$70,$70
DB $70,$71,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$1E,$0E,$1A,$1D,$10
DB $01,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$01,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$6E,$70
DB $70,$70,$70,$70,$F4,$70,$70,$71,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $6D,$17,$14,$19,$10,$1E,$6F,$01,$01,$6F
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$6D,$01,$01,$01,$01,$01,$6F,$01
DB $01,$6F,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$6D,$F8,$F9,$FA,$FB,$FC
DB $6F,$01,$01,$6F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$6D,$01,$01,$01
DB $01,$01,$6F,$01,$01,$6F,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$E6,$E7
DB $E7,$E7,$E7,$E7,$F5,$E7,$E7,$E8,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $E5,$E4,$E4,$D4,$E4,$E4,$DF,$E4,$E4,$E9
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00
sGameplayUngradedTileMapEnd::
ENDC

93
src/res/gameplay_map.inc Normal file
View File

@ -0,0 +1,93 @@
; 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(GAMEPLAY_MAP_INC)
DEF GAMEPLAY_MAP_INC EQU 1
SECTION "Gameplay Tilemap", ROM0
GameplayTilemap::
DB $02,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$03,$09,$01,$01,$01,$01,$01,$01,$09
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$02,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$03,$09,$59,$50,$63,$5F,$01
DB $01,$09,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$02,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$03,$09,$01,$01,$01
DB $01,$01,$01,$09,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$02,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$03,$09,$01
DB $01,$01,$01,$01,$01,$09,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$02,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$03
DB $09,$01,$01,$01,$01,$01,$01,$09,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $02,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$03,$09,$01,$01,$01,$01,$01,$01,$09
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$02,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$03,$08,$06,$06,$06,$06,$06
DB $06,$07,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$02,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$03,$09,$53,$5A,$57
DB $4F,$01,$01,$09,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$02,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$03,$09,$01
DB $01,$01,$01,$01,$01,$09,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$02,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$03
DB $09,$01,$01,$01,$01,$01,$01,$09,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $02,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$03,$09,$01,$01,$01,$01,$01,$01,$09
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$02,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$03,$09,$01,$01,$01,$01,$01
DB $01,$09,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$02,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$03,$08,$06,$06,$06
DB $06,$06,$06,$07,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$02,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$03,$09,$5E
DB $4E,$5A,$5D,$50,$01,$09,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$02,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$03
DB $09,$01,$01,$01,$01,$01,$01,$09,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $02,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$03,$08,$06,$06,$06,$06,$06,$06,$07
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$02,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$03,$09,$57,$50,$61,$50,$57
DB $01,$09,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$02,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$03,$09,$01,$01,$01
DB $01,$01,$01,$09,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$02,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$03,$09,$01
DB $05,$05,$05,$05,$01,$09,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$02,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$03
DB $09,$01,$01,$01,$01,$01,$01,$09,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $02,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$03,$09,$01,$01,$01,$01,$01,$01,$09
GameplayTilemapEnd::
ENDC

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,975 +0,0 @@
; 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(MUSIC_DATA_3_INC)
DEF MUSIC_DATA_3_INC EQU 1
INCLUDE "globals.asm"
SECTION "Music Data 3", ROMX, BANK[BANK_MUSIC_3]
sMusicRoll3::
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $55, REG_NR14_CH1_FRQHI, $07, REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $89
db REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $63, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $71, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $7D, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $83, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $8E, REG_NR14_CH1_FRQHI, $07, REG_NR30_CH3_DACEN, $00
db REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $86
db REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80
db $FF
db REG_NR13_CH1_FRQLO, $97, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $A0, REG_NR14_CH1_FRQHI, $07, REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $C4
db REG_NR34_CH3_FRQHI, $06, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $03
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $A8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $B0, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $B1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $B8, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $B2, REG_NR24_CH2_FRQHI, $07
db REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $62
db REG_NR34_CH3_FRQHI, $87, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $07
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $BE, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $B4, REG_NR24_CH2_FRQHI, $07
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $C1, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $B5, REG_NR24_CH2_FRQHI, $07
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR23_CH2_FRQLO, $B6, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR23_CH2_FRQLO, $B7, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR23_CH2_FRQLO, $B8, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR23_CH2_FRQLO, $BA, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $BB, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $BA, REG_NR24_CH2_FRQHI, $07
db REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $B5, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $B1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $AA, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $BA, REG_NR24_CH2_FRQHI, $07
db REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $C4
db REG_NR34_CH3_FRQHI, $86, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $07
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $A1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $99, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $97, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $8D, REG_NR14_CH1_FRQHI, $07, REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $C4
db REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $83, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $C4, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $77, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF, REG_NR21_CH2_LENDT, $BF
db REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $CB, REG_NR24_CH2_FRQHI, $87, REG_NR30_CH3_DACEN, $00
db REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $85
db REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80
db $FF
db REG_NR13_CH1_FRQLO, $6A, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $62, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $70, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF, REG_NR21_CH2_LENDT, $BF
db REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $CB, REG_NR24_CH2_FRQHI, $87, REG_NR32_CH3_VOLUM, $00
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1
db REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $7C, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $83, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $8E, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF
db REG_NR21_CH2_LENDT, $BF, REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $C1, REG_NR24_CH2_FRQHI, $87
db REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $62
db REG_NR34_CH3_FRQHI, $87, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $74
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $97, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $A0, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF, REG_NR21_CH2_LENDT, $BF
db REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $CB, REG_NR24_CH2_FRQHI, $87, REG_NR32_CH3_VOLUM, $00
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $A8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $B0, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $B1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $B8, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF
db REG_NR21_CH2_LENDT, $BF, REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $B1, REG_NR24_CH2_FRQHI, $87
db REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $89
db REG_NR34_CH3_FRQHI, $85, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $07
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $BE, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $C1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $BB, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF, REG_NR21_CH2_LENDT, $BF
db REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $97, REG_NR24_CH2_FRQHI, $87, REG_NR32_CH3_VOLUM, $00
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $B5, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $B1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $AA, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF, REG_NR21_CH2_LENDT, $BF
db REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $BA, REG_NR24_CH2_FRQHI, $87, REG_NR30_CH3_DACEN, $00
db REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $87
db REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80
db $FF
db REG_NR13_CH1_FRQLO, $A1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $99, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $97, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $8D, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF, REG_NR21_CH2_LENDT, $BF
db REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $C1, REG_NR24_CH2_FRQHI, $87, REG_NR32_CH3_VOLUM, $00
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1
db REG_NR43_CH4_FQRND, $07, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $83, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $62, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $77, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF
db REG_NR21_CH2_LENDT, $BF, REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $CB, REG_NR24_CH2_FRQHI, $87
db REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $CE
db REG_NR34_CH3_FRQHI, $85, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $74
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $73, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $80, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $CC, REG_NR24_CH2_FRQHI, $07
db REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $8B, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $CC, REG_NR24_CH2_FRQHI, $07
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $90, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $CD, REG_NR24_CH2_FRQHI, $07
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR23_CH2_FRQLO, $CD, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR23_CH2_FRQLO, $CE, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR23_CH2_FRQLO, $CE, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR23_CH2_FRQLO, $CF, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $9A, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $CF
db REG_NR24_CH2_FRQHI, $07, REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $86, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1
db REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $A2, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $CF, REG_NR24_CH2_FRQHI, $07
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR23_CH2_FRQLO, $D0, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR23_CH2_FRQLO, $D0, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR23_CH2_FRQLO, $D1, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR23_CH2_FRQLO, $D1, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $AA, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $D1, REG_NR24_CH2_FRQHI, $07
db REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, REG_NR41_CH4_LENGT, $3F
db REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $B2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $B8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $BA, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $C0, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $D1, REG_NR24_CH2_FRQHI, $07
db REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $73
db REG_NR34_CH3_FRQHI, $87, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $07
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $C5, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $C8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $C3, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $D1, REG_NR24_CH2_FRQHI, $07
db REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $BD, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $BA, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $B3, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $D1
db REG_NR24_CH2_FRQHI, $07, REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $86, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1
db REG_NR43_CH4_FQRND, $74, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $AC, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $A4, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $A2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $99, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $D1, REG_NR24_CH2_FRQHI, $07
db REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $90, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $E7, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $86, REG_NR14_CH1_FRQHI, $07, REG_NR30_CH3_DACEN, $00
db REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $85
db REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80
db $FF
db REG_NR13_CH1_FRQLO, $7A, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $73, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $80, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF, REG_NR21_CH2_LENDT, $BF
db REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $D1, REG_NR24_CH2_FRQHI, $87, REG_NR32_CH3_VOLUM, $00
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1
db REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $8B, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $90, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $9A, REG_NR14_CH1_FRQHI, $07, REG_NR30_CH3_DACEN, $00
db REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $87
db REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $74, REG_NR44_CH4_CNTRL, $80
db $FF
db REG_NR13_CH1_FRQLO, $A2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $AA, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF, REG_NR21_CH2_LENDT, $BF
db REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $CB, REG_NR24_CH2_FRQHI, $87, REG_NR32_CH3_VOLUM, $00
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR13_CH1_FRQLO, $B2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $B8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $BA, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $C0, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF
db REG_NR21_CH2_LENDT, $BF, REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $C1, REG_NR24_CH2_FRQHI, $87
db REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $CE
db REG_NR34_CH3_FRQHI, $85, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $07
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $C5, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $C8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $C3, REG_NR14_CH1_FRQHI, $07, REG_NR21_CH2_LENDT, $BF, REG_NR21_CH2_LENDT, $BF
db REG_NR22_CH2_VOLEV, $F0, REG_NR23_CH2_FRQLO, $CB, REG_NR24_CH2_FRQHI, $87, REG_NR32_CH3_VOLUM, $00
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $BD, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $BA, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $CE, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $B3, REG_NR14_CH1_FRQHI, $07, REG_NR30_CH3_DACEN, $00
db REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $87
db REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $74, REG_NR44_CH4_CNTRL, $80
db $FF
db REG_NR13_CH1_FRQLO, $AC, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $A4, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR13_CH1_FRQLO, $A2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $99, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $CA
db REG_NR24_CH2_FRQHI, $07, REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80
db $FF
db REG_NR13_CH1_FRQLO, $90, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $CA, REG_NR24_CH2_FRQHI, $07
db REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07, REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR23_CH2_FRQLO, $C9, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR23_CH2_FRQLO, $C8, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR23_CH2_FRQLO, $C7, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR23_CH2_FRQLO, $C6, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR23_CH2_FRQLO, $C5, REG_NR24_CH2_FRQHI, $07, REG_NR33_CH3_FRQLO, $73, REG_NR34_CH3_FRQHI, $07
db $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $86, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $C4
db REG_NR24_CH2_FRQHI, $07, REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $85, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1
db REG_NR43_CH4_FQRND, $74, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $7A, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $C3, REG_NR24_CH2_FRQHI, $07
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $6E, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $C2, REG_NR24_CH2_FRQHI, $07
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $60, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $C1, REG_NR24_CH2_FRQHI, $07
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $51, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $44, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $55, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $C1, REG_NR24_CH2_FRQHI, $07
db REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $63, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $71, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $7D, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $83, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR42_CH4_VOLEV, $F1, REG_NR13_CH1_FRQLO, $8E, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $C1
db REG_NR24_CH2_FRQHI, $07, REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $86, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1
db REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $97, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $A0, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $A2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $AA, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $C1, REG_NR24_CH2_FRQHI, $07
db REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, REG_NR41_CH4_LENGT, $3F
db REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $B2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $03, REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $B8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $BF, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $C1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $C7, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $C1, REG_NR24_CH2_FRQHI, $07
db REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $11
db REG_NR34_CH3_FRQHI, $85, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $07
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $CC, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $D0, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $D1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $CD, REG_NR14_CH1_FRQHI, $07, REG_NR23_CH2_FRQLO, $C1, REG_NR24_CH2_FRQHI, $07
db REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $C8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $C2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $C1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $BB, REG_NR14_CH1_FRQHI, $07, REG_NR30_CH3_DACEN, $00, REG_NR30_CH3_DACEN, $80
db REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $86, $FF
db REG_NR13_CH1_FRQLO, $B5, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $AE, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $A6, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $A2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $99, REG_NR14_CH1_FRQHI, $07, REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $89
db REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR13_CH1_FRQLO, $90, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $85, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR13_CH1_FRQLO, $83, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06
db $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR33_CH3_FRQLO, $89, REG_NR34_CH3_FRQHI, $06, $FF
db REG_NR32_CH3_VOLUM, $20, REG_NR13_CH1_FRQLO, $77, REG_NR14_CH1_FRQHI, $07, REG_NR30_CH3_DACEN, $00
db REG_NR30_CH3_DACEN, $80, REG_NR32_CH3_VOLUM, $20, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $85
db REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $07, REG_NR44_CH4_CNTRL, $80
db $FF
db REG_NR13_CH1_FRQLO, $6A, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $5C, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $4C, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $44, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR32_CH3_VOLUM, $20, REG_NR13_CH1_FRQLO, $55, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11
db REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $63, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $71, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $7D, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $83, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR32_CH3_VOLUM, $40, REG_NR13_CH1_FRQLO, $8E, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11
db REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $97, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $A0, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $A2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR32_CH3_VOLUM, $40, REG_NR13_CH1_FRQLO, $AA, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11
db REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $B2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $B8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $BF, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $C1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR32_CH3_VOLUM, $60, REG_NR13_CH1_FRQLO, $C7, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11
db REG_NR34_CH3_FRQHI, $05, REG_NR41_CH4_LENGT, $3F, REG_NR42_CH4_VOLEV, $F1, REG_NR43_CH4_FQRND, $07
db REG_NR44_CH4_CNTRL, $80, $FF
db REG_NR13_CH1_FRQLO, $CC, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $D0, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $D1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR32_CH3_VOLUM, $60, REG_NR13_CH1_FRQLO, $CD, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11
db REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $C8, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $C2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $C1, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR32_CH3_VOLUM, $00, REG_NR13_CH1_FRQLO, $BB, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11
db REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $B5, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $AE, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $A6, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $A2, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR32_CH3_VOLUM, $00, REG_NR13_CH1_FRQLO, $99, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11
db REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR13_CH1_FRQLO, $90, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $85, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR13_CH1_FRQLO, $83, REG_NR14_CH1_FRQHI, $07, REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR12_CH1_VOLEV, $08, REG_NR13_CH1_FRQLO, $83, REG_NR14_CH1_FRQHI, $87, REG_NR22_CH2_VOLEV, $08
db REG_NR23_CH2_FRQLO, $C1, REG_NR24_CH2_FRQHI, $87, REG_NR32_CH3_VOLUM, $00, REG_NR33_CH3_FRQLO, $11
db REG_NR34_CH3_FRQHI, $05, REG_NR42_CH4_VOLEV, $08, REG_NR43_CH4_FQRND, $07, REG_NR44_CH4_CNTRL, $80
db $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FF
db REG_NR33_CH3_FRQLO, $11, REG_NR34_CH3_FRQHI, $05, $FE
sMusicRoll3End::
ENDC

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,241 +0,0 @@
# 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/>.
from construct import Struct, Const, Int32ul, Int16ul, Int8ul, Bytes
vgm_header = Struct(
"magic" / Const(b"Vgm "),
"eof_offset" / Int32ul,
"version" / Int32ul,
"sn76489_clock" / Int32ul,
"ym2413_clock" / Int32ul,
"gd3_offset" / Int32ul,
"total_samples" / Int32ul,
"loop_offset" / Int32ul,
"loop_samples" / Int32ul,
"rate" / Int32ul,
"sn_fb" / Int16ul,
"sn_w" / Int8ul,
"sn_c" / Int8ul,
"ym2612_clock" / Int32ul,
"ym2151_clock" / Int32ul,
"vgm_data_offset" / Int32ul,
"seg_pcm_clock" / Int32ul,
"seg_pcm_intf_reg" / Int32ul,
"rf5c68_clock" / Int32ul,
"ym2203_clock" / Int32ul,
"ym2608_clock" / Int32ul,
"ym2610_clock" / Int32ul,
"ym3812_clock" / Int32ul,
"ym3526_clock" / Int32ul,
"y8950_clock" / Int32ul,
"ymf262_clock" / Int32ul,
"ymf278b_clock" / Int32ul,
"ymf271_clock" / Int32ul,
"ymz280b_clock" / Int32ul,
"rf5c164_clock" / Int32ul,
"pwm_clock" / Int32ul,
"ay8910_clock" / Int32ul,
"ay8910_type" / Int8ul,
"ay8910_flags" / Int8ul,
"ym2203_ay8910_flags" / Int8ul,
"ym2608_ay8910_flags" / Int8ul,
"volume_mod" / Int8ul,
"reserved_0" / Bytes(1),
"loop_base" / Int8ul,
"loop_modifier" / Int8ul,
"dmg_clock" / Int32ul,
"nes_apu_clock" / Int32ul,
"multi_pcm_clock" / Int32ul,
"upd7759_clock" / Int32ul,
"okim6258_clock" / Int32ul,
"okim6258_flags" / Int8ul,
"k054539_flags" / Int8ul,
"c140_chip_type" / Int8ul,
"reserved_1" / Bytes(1),
"okim6295_clock" / Int32ul,
"k051649_k052539_clock" / Int32ul,
"k054539_clock" / Int32ul,
"huc6280_clock" / Int32ul,
"c140_clock" / Int32ul,
"k053260_clock" / Int32ul,
"pokey_clock" / Int32ul,
"qsound_clock" / Int32ul,
"scsp_clock" / Int32ul,
"extra_hdr_offset" / Int32ul,
"wonder_swan_clock" / Int32ul,
"vsu_clock" / Int32ul,
"saa1099_clock" / Int32ul,
"es5503_clock" / Int32ul,
"es5505_es5506_clock" / Int32ul,
"es5503_num_channels" / Int8ul,
"es5505_es5506_num_channels" / Int8ul,
"c352_clock_div" / Int8ul,
"reserved_2" / Bytes(1),
"x1_010_clock" / Int32ul,
"c352_clock" / Int32ul,
"ga20_clock" / Int32ul,
"reserved_3" / Bytes(28)
)
b3_command = Struct(
"command" / Const(b'\xB3'),
"reg" / Int8ul,
"data" / Int8ul
)
register_names = [
"REG_UNK", # 0x00
"REG_UNK", # 0x01
"REG_UNK", # 0x02
"REG_UNK", # 0x03
"REG_UNK", # 0x04
"REG_UNK", # 0x05
"REG_UNK", # 0x06
"REG_UNK", # 0x07
"REG_UNK", # 0x08
"REG_UNK", # 0x09
"REG_UNK", # 0x0A
"REG_UNK", # 0x0B
"REG_UNK", # 0x0C
"REG_UNK", # 0x0D
"REG_UNK", # 0x0E
"REG_UNK", # 0x0F
"REG_NR10_CH1_SWEEP", # 0x10
"REG_NR11_CH1_LENDT", # 0x11
"REG_NR12_CH1_VOLEV", # 0x12
"REG_NR13_CH1_FRQLO", # 0x13
"REG_NR14_CH1_FRQHI", # 0x14
"REG_UNK", # 0x15
"REG_NR21_CH2_LENDT", # 0x16
"REG_NR22_CH2_VOLEV", # 0x17
"REG_NR23_CH2_FRQLO", # 0x18
"REG_NR24_CH2_FRQHI", # 0x19
"REG_NR30_CH3_DACEN", # 0x1A
"REG_NR31_CH3_LENGT", # 0x1B
"REG_NR32_CH3_VOLUM", # 0x1C
"REG_NR33_CH3_FRQLO", # 0x1D
"REG_NR34_CH3_FRQHI", # 0x1E
"REG_UNK", # 0x1F
"REG_NR41_CH4_LENGT", # 0x20
"REG_NR42_CH4_VOLEV", # 0x21
"REG_NR43_CH4_FQRND", # 0x22
"REG_NR44_CH4_CNTRL", # 0x23
"REG_NR50_MVOLVINPN", # 0x24
"REG_NR51_MASTERPAN", # 0x25
"REG_NR52_MASTERCTL", # 0x26
"REG_UNK", # 0x27
"REG_UNK", # 0x28
"REG_UNK", # 0x29
"REG_UNK", # 0x2A
"REG_UNK", # 0x2B
"REG_UNK", # 0x2C
"REG_UNK", # 0x2D
"REG_UNK", # 0x2E
"REG_UNK", # 0x2F
"REG_WAVE_PATTERN_0", # 0x30
"REG_WAVE_PATTERN_1", # 0x31
"REG_WAVE_PATTERN_2", # 0x32
"REG_WAVE_PATTERN_3", # 0x33
"REG_WAVE_PATTERN_4", # 0x34
"REG_WAVE_PATTERN_5", # 0x35
"REG_WAVE_PATTERN_6", # 0x36
"REG_WAVE_PATTERN_7", # 0x37
"REG_WAVE_PATTERN_8", # 0x38
"REG_WAVE_PATTERN_9", # 0x39
"REG_WAVE_PATTERN_A", # 0x3A
"REG_WAVE_PATTERN_B", # 0x3B
"REG_WAVE_PATTERN_C", # 0x3C
"REG_WAVE_PATTERN_D", # 0x3D
"REG_WAVE_PATTERN_E", # 0x3E
"REG_WAVE_PATTERN_F", # 0x3F
]
def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n]
class DB:
l = []
def __init__(self):
self.l = []
def __str__(self):
out = []
for chunk in chunks(self.l, 8):
out.append(f" db {', '.join(chunk)}")
return "\n".join(out) + "\n"
def __repr__(self):
return str(self)
def __len__(self):
return len(self.l)
def add(self, *args):
if len(args) == 1:
self.l.append(f"${args[0]:02X}")
else:
self.l.append(register_names[args[0]])
self.l.append(f"${args[1]:02X}")
def trim(self):
while self.l[-1] == "$FF":
self.l.pop()
for c, v in enumerate(register_names):
if v != "REG_UNK":
print(f"DEF {v} EQU ${c:02X}")
print()
print("sMusicRoll::")
with open("final.vgm", "rb") as f:
data = f.read()
header = vgm_header.parse(data)
data_offset = 0x34 + header.vgm_data_offset
data = data[data_offset:]
db = DB()
ctr = 0
last = None
while len(data) > 0:
if data.startswith(b'\x67\x66'):
data = data[3:]
data = data[Int32ul.parse(data) + 4:]
elif data.startswith(b'\xB3'):
b3 = b3_command.parse(data)
if last == 0x62:
print(db)
db = DB()
db.add(b3.reg + 0x10, b3.data)
last = 0xB3
data = data[3:]
elif data.startswith(b'\x62'):
db.add(0xFF)
last = 0x62
data = data[1:]
elif data.startswith(b'\x66'):
if len(db) > 0:
db.trim()
db.add(0xFE)
print(db, end="")
break
else:
print(f"Unknown command: ${data[0]:02X}")
data = data[1:]
print("sMusicRollEnd::")

Binary file not shown.

Binary file not shown.

View File

@ -1,241 +0,0 @@
# 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/>.
from construct import Struct, Const, Int32ul, Int16ul, Int8ul, Bytes
vgm_header = Struct(
"magic" / Const(b"Vgm "),
"eof_offset" / Int32ul,
"version" / Int32ul,
"sn76489_clock" / Int32ul,
"ym2413_clock" / Int32ul,
"gd3_offset" / Int32ul,
"total_samples" / Int32ul,
"loop_offset" / Int32ul,
"loop_samples" / Int32ul,
"rate" / Int32ul,
"sn_fb" / Int16ul,
"sn_w" / Int8ul,
"sn_c" / Int8ul,
"ym2612_clock" / Int32ul,
"ym2151_clock" / Int32ul,
"vgm_data_offset" / Int32ul,
"seg_pcm_clock" / Int32ul,
"seg_pcm_intf_reg" / Int32ul,
"rf5c68_clock" / Int32ul,
"ym2203_clock" / Int32ul,
"ym2608_clock" / Int32ul,
"ym2610_clock" / Int32ul,
"ym3812_clock" / Int32ul,
"ym3526_clock" / Int32ul,
"y8950_clock" / Int32ul,
"ymf262_clock" / Int32ul,
"ymf278b_clock" / Int32ul,
"ymf271_clock" / Int32ul,
"ymz280b_clock" / Int32ul,
"rf5c164_clock" / Int32ul,
"pwm_clock" / Int32ul,
"ay8910_clock" / Int32ul,
"ay8910_type" / Int8ul,
"ay8910_flags" / Int8ul,
"ym2203_ay8910_flags" / Int8ul,
"ym2608_ay8910_flags" / Int8ul,
"volume_mod" / Int8ul,
"reserved_0" / Bytes(1),
"loop_base" / Int8ul,
"loop_modifier" / Int8ul,
"dmg_clock" / Int32ul,
"nes_apu_clock" / Int32ul,
"multi_pcm_clock" / Int32ul,
"upd7759_clock" / Int32ul,
"okim6258_clock" / Int32ul,
"okim6258_flags" / Int8ul,
"k054539_flags" / Int8ul,
"c140_chip_type" / Int8ul,
"reserved_1" / Bytes(1),
"okim6295_clock" / Int32ul,
"k051649_k052539_clock" / Int32ul,
"k054539_clock" / Int32ul,
"huc6280_clock" / Int32ul,
"c140_clock" / Int32ul,
"k053260_clock" / Int32ul,
"pokey_clock" / Int32ul,
"qsound_clock" / Int32ul,
"scsp_clock" / Int32ul,
"extra_hdr_offset" / Int32ul,
"wonder_swan_clock" / Int32ul,
"vsu_clock" / Int32ul,
"saa1099_clock" / Int32ul,
"es5503_clock" / Int32ul,
"es5505_es5506_clock" / Int32ul,
"es5503_num_channels" / Int8ul,
"es5505_es5506_num_channels" / Int8ul,
"c352_clock_div" / Int8ul,
"reserved_2" / Bytes(1),
"x1_010_clock" / Int32ul,
"c352_clock" / Int32ul,
"ga20_clock" / Int32ul,
"reserved_3" / Bytes(28)
)
b3_command = Struct(
"command" / Const(b'\xB3'),
"reg" / Int8ul,
"data" / Int8ul
)
register_names = [
"REG_UNK", # 0x00
"REG_UNK", # 0x01
"REG_UNK", # 0x02
"REG_UNK", # 0x03
"REG_UNK", # 0x04
"REG_UNK", # 0x05
"REG_UNK", # 0x06
"REG_UNK", # 0x07
"REG_UNK", # 0x08
"REG_UNK", # 0x09
"REG_UNK", # 0x0A
"REG_UNK", # 0x0B
"REG_UNK", # 0x0C
"REG_UNK", # 0x0D
"REG_UNK", # 0x0E
"REG_UNK", # 0x0F
"REG_NR10_CH1_SWEEP", # 0x10
"REG_NR11_CH1_LENDT", # 0x11
"REG_NR12_CH1_VOLEV", # 0x12
"REG_NR13_CH1_FRQLO", # 0x13
"REG_NR14_CH1_FRQHI", # 0x14
"REG_UNK", # 0x15
"REG_NR21_CH2_LENDT", # 0x16
"REG_NR22_CH2_VOLEV", # 0x17
"REG_NR23_CH2_FRQLO", # 0x18
"REG_NR24_CH2_FRQHI", # 0x19
"REG_NR30_CH3_DACEN", # 0x1A
"REG_NR31_CH3_LENGT", # 0x1B
"REG_NR32_CH3_VOLUM", # 0x1C
"REG_NR33_CH3_FRQLO", # 0x1D
"REG_NR34_CH3_FRQHI", # 0x1E
"REG_UNK", # 0x1F
"REG_NR41_CH4_LENGT", # 0x20
"REG_NR42_CH4_VOLEV", # 0x21
"REG_NR43_CH4_FQRND", # 0x22
"REG_NR44_CH4_CNTRL", # 0x23
"REG_NR50_MVOLVINPN", # 0x24
"REG_NR51_MASTERPAN", # 0x25
"REG_NR52_MASTERCTL", # 0x26
"REG_UNK", # 0x27
"REG_UNK", # 0x28
"REG_UNK", # 0x29
"REG_UNK", # 0x2A
"REG_UNK", # 0x2B
"REG_UNK", # 0x2C
"REG_UNK", # 0x2D
"REG_UNK", # 0x2E
"REG_UNK", # 0x2F
"REG_WAVE_PATTERN_0", # 0x30
"REG_WAVE_PATTERN_1", # 0x31
"REG_WAVE_PATTERN_2", # 0x32
"REG_WAVE_PATTERN_3", # 0x33
"REG_WAVE_PATTERN_4", # 0x34
"REG_WAVE_PATTERN_5", # 0x35
"REG_WAVE_PATTERN_6", # 0x36
"REG_WAVE_PATTERN_7", # 0x37
"REG_WAVE_PATTERN_8", # 0x38
"REG_WAVE_PATTERN_9", # 0x39
"REG_WAVE_PATTERN_A", # 0x3A
"REG_WAVE_PATTERN_B", # 0x3B
"REG_WAVE_PATTERN_C", # 0x3C
"REG_WAVE_PATTERN_D", # 0x3D
"REG_WAVE_PATTERN_E", # 0x3E
"REG_WAVE_PATTERN_F", # 0x3F
]
def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n]
class DB:
l = []
def __init__(self):
self.l = []
def __str__(self):
out = []
for chunk in chunks(self.l, 8):
out.append(f" db {', '.join(chunk)}")
return "\n".join(out) + "\n"
def __repr__(self):
return str(self)
def __len__(self):
return len(self.l)
def add(self, *args):
if len(args) == 1:
self.l.append(f"${args[0]:02X}")
else:
self.l.append(register_names[args[0]])
self.l.append(f"${args[1]:02X}")
def trim(self):
while self.l[-1] == "$FF":
self.l.pop()
for c, v in enumerate(register_names):
if v != "REG_UNK":
print(f"DEF {v} EQU ${c:02X}")
print()
print("sMusicGame::")
with open("game.vgm", "rb") as f:
data = f.read()
header = vgm_header.parse(data)
data_offset = 0x34 + header.vgm_data_offset
data = data[data_offset:]
db = DB()
ctr = 0
last = None
while len(data) > 0:
if data.startswith(b'\x67\x66'):
data = data[3:]
data = data[Int32ul.parse(data) + 4:]
elif data.startswith(b'\xB3'):
b3 = b3_command.parse(data)
if last == 0x62:
print(db)
db = DB()
db.add(b3.reg + 0x10, b3.data)
last = 0xB3
data = data[3:]
elif data.startswith(b'\x62'):
db.add(0xFF)
last = 0x62
data = data[1:]
elif data.startswith(b'\x66'):
if len(db) > 0:
db.trim()
db.add(0xFE)
print(db, end="")
break
else:
print(f"Unknown command: ${data[0]:02X}")
data = data[1:]
print("sMusicGameEnd::")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,241 +0,0 @@
# 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/>.
from construct import Struct, Const, Int32ul, Int16ul, Int8ul, Bytes
vgm_header = Struct(
"magic" / Const(b"Vgm "),
"eof_offset" / Int32ul,
"version" / Int32ul,
"sn76489_clock" / Int32ul,
"ym2413_clock" / Int32ul,
"gd3_offset" / Int32ul,
"total_samples" / Int32ul,
"loop_offset" / Int32ul,
"loop_samples" / Int32ul,
"rate" / Int32ul,
"sn_fb" / Int16ul,
"sn_w" / Int8ul,
"sn_c" / Int8ul,
"ym2612_clock" / Int32ul,
"ym2151_clock" / Int32ul,
"vgm_data_offset" / Int32ul,
"seg_pcm_clock" / Int32ul,
"seg_pcm_intf_reg" / Int32ul,
"rf5c68_clock" / Int32ul,
"ym2203_clock" / Int32ul,
"ym2608_clock" / Int32ul,
"ym2610_clock" / Int32ul,
"ym3812_clock" / Int32ul,
"ym3526_clock" / Int32ul,
"y8950_clock" / Int32ul,
"ymf262_clock" / Int32ul,
"ymf278b_clock" / Int32ul,
"ymf271_clock" / Int32ul,
"ymz280b_clock" / Int32ul,
"rf5c164_clock" / Int32ul,
"pwm_clock" / Int32ul,
"ay8910_clock" / Int32ul,
"ay8910_type" / Int8ul,
"ay8910_flags" / Int8ul,
"ym2203_ay8910_flags" / Int8ul,
"ym2608_ay8910_flags" / Int8ul,
"volume_mod" / Int8ul,
"reserved_0" / Bytes(1),
"loop_base" / Int8ul,
"loop_modifier" / Int8ul,
"dmg_clock" / Int32ul,
"nes_apu_clock" / Int32ul,
"multi_pcm_clock" / Int32ul,
"upd7759_clock" / Int32ul,
"okim6258_clock" / Int32ul,
"okim6258_flags" / Int8ul,
"k054539_flags" / Int8ul,
"c140_chip_type" / Int8ul,
"reserved_1" / Bytes(1),
"okim6295_clock" / Int32ul,
"k051649_k052539_clock" / Int32ul,
"k054539_clock" / Int32ul,
"huc6280_clock" / Int32ul,
"c140_clock" / Int32ul,
"k053260_clock" / Int32ul,
"pokey_clock" / Int32ul,
"qsound_clock" / Int32ul,
"scsp_clock" / Int32ul,
"extra_hdr_offset" / Int32ul,
"wonder_swan_clock" / Int32ul,
"vsu_clock" / Int32ul,
"saa1099_clock" / Int32ul,
"es5503_clock" / Int32ul,
"es5505_es5506_clock" / Int32ul,
"es5503_num_channels" / Int8ul,
"es5505_es5506_num_channels" / Int8ul,
"c352_clock_div" / Int8ul,
"reserved_2" / Bytes(1),
"x1_010_clock" / Int32ul,
"c352_clock" / Int32ul,
"ga20_clock" / Int32ul,
"reserved_3" / Bytes(28)
)
b3_command = Struct(
"command" / Const(b'\xB3'),
"reg" / Int8ul,
"data" / Int8ul
)
register_names = [
"REG_UNK", # 0x00
"REG_UNK", # 0x01
"REG_UNK", # 0x02
"REG_UNK", # 0x03
"REG_UNK", # 0x04
"REG_UNK", # 0x05
"REG_UNK", # 0x06
"REG_UNK", # 0x07
"REG_UNK", # 0x08
"REG_UNK", # 0x09
"REG_UNK", # 0x0A
"REG_UNK", # 0x0B
"REG_UNK", # 0x0C
"REG_UNK", # 0x0D
"REG_UNK", # 0x0E
"REG_UNK", # 0x0F
"REG_NR10_CH1_SWEEP", # 0x10
"REG_NR11_CH1_LENDT", # 0x11
"REG_NR12_CH1_VOLEV", # 0x12
"REG_NR13_CH1_FRQLO", # 0x13
"REG_NR14_CH1_FRQHI", # 0x14
"REG_UNK", # 0x15
"REG_NR21_CH2_LENDT", # 0x16
"REG_NR22_CH2_VOLEV", # 0x17
"REG_NR23_CH2_FRQLO", # 0x18
"REG_NR24_CH2_FRQHI", # 0x19
"REG_NR30_CH3_DACEN", # 0x1A
"REG_NR31_CH3_LENGT", # 0x1B
"REG_NR32_CH3_VOLUM", # 0x1C
"REG_NR33_CH3_FRQLO", # 0x1D
"REG_NR34_CH3_FRQHI", # 0x1E
"REG_UNK", # 0x1F
"REG_NR41_CH4_LENGT", # 0x20
"REG_NR42_CH4_VOLEV", # 0x21
"REG_NR43_CH4_FQRND", # 0x22
"REG_NR44_CH4_CNTRL", # 0x23
"REG_NR50_MVOLVINPN", # 0x24
"REG_NR51_MASTERPAN", # 0x25
"REG_NR52_MASTERCTL", # 0x26
"REG_UNK", # 0x27
"REG_UNK", # 0x28
"REG_UNK", # 0x29
"REG_UNK", # 0x2A
"REG_UNK", # 0x2B
"REG_UNK", # 0x2C
"REG_UNK", # 0x2D
"REG_UNK", # 0x2E
"REG_UNK", # 0x2F
"REG_WAVE_PATTERN_0", # 0x30
"REG_WAVE_PATTERN_1", # 0x31
"REG_WAVE_PATTERN_2", # 0x32
"REG_WAVE_PATTERN_3", # 0x33
"REG_WAVE_PATTERN_4", # 0x34
"REG_WAVE_PATTERN_5", # 0x35
"REG_WAVE_PATTERN_6", # 0x36
"REG_WAVE_PATTERN_7", # 0x37
"REG_WAVE_PATTERN_8", # 0x38
"REG_WAVE_PATTERN_9", # 0x39
"REG_WAVE_PATTERN_A", # 0x3A
"REG_WAVE_PATTERN_B", # 0x3B
"REG_WAVE_PATTERN_C", # 0x3C
"REG_WAVE_PATTERN_D", # 0x3D
"REG_WAVE_PATTERN_E", # 0x3E
"REG_WAVE_PATTERN_F", # 0x3F
]
def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i + n]
class DB:
l = []
def __init__(self):
self.l = []
def __str__(self):
out = []
for chunk in chunks(self.l, 8):
out.append(f" db {', '.join(chunk)}")
return "\n".join(out) + "\n"
def __repr__(self):
return str(self)
def __len__(self):
return len(self.l)
def add(self, *args):
if len(args) == 1:
self.l.append(f"${args[0]:02X}")
else:
self.l.append(register_names[args[0]])
self.l.append(f"${args[1]:02X}")
def trim(self):
while self.l[-1] == "$FF":
self.l.pop()
for c, v in enumerate(register_names):
if v != "REG_UNK":
print(f"DEF {v} EQU ${c:02X}")
print()
print("sMusicMenu::")
with open("menu.vgm", "rb") as f:
data = f.read()
header = vgm_header.parse(data)
data_offset = 0x34 + header.vgm_data_offset
data = data[data_offset:]
db = DB()
ctr = 0
last = None
while len(data) > 0:
if data.startswith(b'\x67\x66'):
data = data[3:]
data = data[Int32ul.parse(data) + 4:]
elif data.startswith(b'\xB3'):
b3 = b3_command.parse(data)
if last == 0x62:
print(db)
db = DB()
db.add(b3.reg + 0x10, b3.data)
last = 0xB3
data = data[3:]
elif data.startswith(b'\x62'):
db.add(0xFF)
last = 0x62
data = data[1:]
elif data.startswith(b'\x66'):
if len(db) > 0:
db.trim()
db.add(0xFE)
print(db, end="")
break
else:
print(f"Unknown command: ${data[0]:02X}")
data = data[1:]
print("sMusicMenuEnd::")

Binary file not shown.

Binary file not shown.

View File

@ -188,7 +188,6 @@ sfx_names = [
"sSFXLevelUp",
"sSFXRankUp",
"sSFXReadyGo",
"sSFXRankGM"
]
def chunks(lst, n):

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

538
src/res/tiles.inc Normal file
View File

@ -0,0 +1,538 @@
; 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(TILES_INC)
DEF TILES_INC EQU 1
SECTION "Tile data", ROM0
Tiles::
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $67,$1F,$67,$1F,$67,$1F,$67,$1F
DB $67,$1F,$67,$1F,$67,$1F,$00,$00
DB $E6,$F8,$E6,$F8,$E6,$F8,$E6,$F8
DB $E6,$F8,$E6,$F8,$E6,$F8,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$00,$00,$00
DB $00,$00,$00,$00,$00,$FF,$FF,$FF
DB $00,$FF,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$FF,$FF,$FF,$00
DB $FF,$FF,$00,$00,$00,$00,$00,$00
DB $1C,$14,$1C,$14,$FC,$E4,$F8,$08
DB $FC,$E4,$1C,$14,$1C,$14,$00,$00
DB $1C,$14,$1C,$14,$1F,$13,$0F,$08
DB $1F,$13,$1C,$14,$1C,$14,$00,$00
DB $1C,$14,$1C,$14,$1C,$14,$1C,$14
DB $1C,$14,$1C,$14,$1C,$14,$00,$00
DB $00,$FF,$7E,$99,$66,$BD,$66,$BD
DB $66,$BD,$7E,$99,$00,$FF,$00,$00
DB $00,$FF,$36,$C9,$6C,$93,$5A,$A5
DB $36,$C9,$6C,$93,$00,$FF,$00,$00
DB $00,$FF,$00,$BD,$3C,$81,$00,$81
DB $3C,$81,$00,$BD,$00,$FF,$00,$00
DB $00,$FF,$3C,$C3,$5A,$A5,$7E,$81
DB $5A,$A5,$3C,$C3,$00,$FF,$00,$00
DB $00,$FF,$5A,$A5,$42,$BD,$42,$BD
DB $42,$BD,$5A,$A5,$00,$FF,$00,$00
DB $00,$FF,$7E,$81,$7E,$81,$7E,$81
DB $7E,$81,$7E,$81,$00,$FF,$00,$00
DB $00,$FF,$54,$AB,$2A,$D5,$54,$AB
DB $2A,$D5,$54,$AB,$00,$FF,$00,$00
DB $FF,$FF,$FF,$99,$E7,$BD,$E7,$BD
DB $E7,$BD,$FF,$99,$FF,$FF,$00,$00
DB $FF,$FF,$B7,$C9,$ED,$93,$DB,$A5
DB $B7,$C9,$ED,$93,$FF,$FF,$00,$00
DB $FF,$FF,$81,$BD,$BD,$81,$81,$81
DB $BD,$81,$81,$BD,$FF,$FF,$00,$00
DB $FF,$FF,$BD,$C3,$DB,$A5,$FF,$81
DB $DB,$A5,$BD,$C3,$FF,$FF,$00,$00
DB $FF,$FF,$DB,$A5,$C3,$BD,$C3,$BD
DB $C3,$BD,$DB,$A5,$FF,$FF,$00,$00
DB $FF,$FF,$FF,$81,$FF,$81,$FF,$81
DB $FF,$81,$FF,$81,$FF,$FF,$00,$00
DB $FF,$FF,$D5,$AB,$AB,$D5,$D5,$AB
DB $AB,$D5,$D5,$AB,$FF,$FF,$00,$00
DB $00,$FF,$7E,$99,$66,$BD,$66,$BD
DB $66,$BD,$FE,$BB,$FF,$FF,$00,$00
DB $00,$FF,$36,$C9,$6C,$93,$5A,$A5
DB $36,$C9,$EE,$BB,$FF,$FF,$00,$00
DB $00,$FF,$00,$BD,$3C,$81,$00,$81
DB $3C,$81,$AA,$BF,$FF,$FF,$00,$00
DB $00,$FF,$3C,$C3,$5A,$A5,$7E,$81
DB $5A,$A5,$BE,$EB,$FF,$FF,$00,$00
DB $00,$FF,$5A,$A5,$42,$BD,$42,$BD
DB $42,$BD,$FA,$AF,$FF,$FF,$00,$00
DB $00,$FF,$7E,$81,$7E,$81,$7E,$81
DB $7E,$81,$FE,$AB,$FF,$FF,$00,$00
DB $00,$FF,$54,$AB,$2A,$D5,$54,$AB
DB $2A,$D5,$FE,$AB,$FF,$FF,$00,$00
DB $00,$FF,$7E,$99,$66,$BD,$66,$BD
DB $EE,$BF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$36,$C9,$6C,$93,$5A,$A5
DB $BE,$EB,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$00,$BD,$3C,$81,$00,$81
DB $BE,$AB,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$3C,$C3,$5A,$A5,$7E,$81
DB $FA,$AF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$5A,$A5,$42,$BD,$42,$BD
DB $EA,$BF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$7E,$81,$7E,$81,$7E,$81
DB $FE,$AB,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$54,$AB,$2A,$D5,$54,$AB
DB $AA,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$7E,$99,$66,$BD,$EE,$BF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$36,$C9,$6C,$93,$FA,$AF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$00,$BD,$3C,$81,$AA,$AB
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$3C,$C3,$5A,$A5,$FE,$AB
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$5A,$A5,$42,$BD,$EA,$BF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$7E,$81,$7E,$81,$FE,$AB
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$54,$AB,$2A,$D5,$FE,$AB
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$7E,$99,$EE,$BF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$36,$C9,$EE,$BB,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$00,$BD,$BE,$AB,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$3C,$C3,$FA,$AF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$5A,$A5,$EA,$BF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$7E,$81,$FE,$AB,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$54,$AB,$AA,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$FE,$BB,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$BE,$EB,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$AA,$BF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$BE,$EB,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$FA,$AF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$FE,$AB,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $00,$FF,$FE,$AB,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $AA,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $AA,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $AA,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $AA,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $AA,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $AA,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $AA,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$00,$00
DB $7C,$7C,$CE,$CE,$D6,$D6,$D6,$D6
DB $D6,$D6,$E6,$E6,$7C,$7C,$00,$00
DB $38,$38,$78,$78,$D8,$D8,$18,$18
DB $18,$18,$18,$18,$18,$18,$00,$00
DB $7C,$7C,$C6,$C6,$C6,$C6,$0C,$0C
DB $38,$38,$E0,$E0,$FE,$FE,$00,$00
DB $7C,$7C,$C6,$C6,$06,$06,$0C,$0C
DB $06,$06,$C6,$C6,$7C,$7C,$00,$00
DB $1C,$1C,$3C,$3C,$6C,$6C,$CC,$CC
DB $FE,$FE,$0C,$0C,$0C,$0C,$00,$00
DB $FE,$FE,$C0,$C0,$C0,$C0,$FC,$FC
DB $06,$06,$06,$06,$FC,$FC,$00,$00
DB $7C,$7C,$C6,$C6,$C0,$C0,$FC,$FC
DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00
DB $FE,$FE,$0C,$0C,$18,$18,$18,$18
DB $30,$30,$30,$30,$30,$30,$00,$00
DB $7C,$7C,$C6,$C6,$C6,$C6,$7C,$7C
DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00
DB $7C,$7C,$C6,$C6,$C6,$C6,$7E,$7E
DB $06,$06,$C6,$C6,$7C,$7C,$00,$00
DB $38,$38,$6C,$6C,$C6,$C6,$FE,$FE
DB $C6,$C6,$C6,$C6,$C6,$C6,$00,$00
DB $FC,$FC,$C6,$C6,$C6,$C6,$FC,$FC
DB $C6,$C6,$C6,$C6,$FC,$FC,$00,$00
DB $7C,$7C,$C6,$C6,$C0,$C0,$C0,$C0
DB $C0,$C0,$C6,$C6,$7C,$7C,$00,$00
DB $FC,$FC,$C6,$C6,$C6,$C6,$C6,$C6
DB $C6,$C6,$C6,$C6,$FC,$FC,$00,$00
DB $FE,$FE,$C0,$C0,$C0,$C0,$F8,$F8
DB $C0,$C0,$C0,$C0,$FE,$FE,$00,$00
DB $FE,$FE,$C0,$C0,$C0,$C0,$F8,$F8
DB $C0,$C0,$C0,$C0,$C0,$C0,$00,$00
DB $7C,$7C,$C6,$C6,$C0,$C0,$CE,$CE
DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00
DB $C6,$C6,$C6,$C6,$C6,$C6,$FE,$FE
DB $C6,$C6,$C6,$C6,$C6,$C6,$00,$00
DB $18,$18,$18,$18,$18,$18,$18,$18
DB $18,$18,$18,$18,$18,$18,$00,$00
DB $06,$06,$06,$06,$06,$06,$06,$06
DB $66,$66,$66,$66,$3C,$3C,$00,$00
DB $C6,$C6,$C6,$C6,$CC,$CC,$F8,$F8
DB $CC,$CC,$C6,$C6,$C6,$C6,$00,$00
DB $60,$60,$60,$60,$60,$60,$60,$60
DB $60,$60,$60,$60,$7C,$7C,$00,$00
DB $C6,$C6,$EE,$EE,$FE,$FE,$D6,$D6
DB $C6,$C6,$C6,$C6,$C6,$C6,$00,$00
DB $C6,$C6,$E6,$E6,$F6,$F6,$DE,$DE
DB $CE,$CE,$C6,$C6,$C6,$C6,$00,$00
DB $7C,$7C,$C6,$C6,$C6,$C6,$C6,$C6
DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00
DB $FC,$FC,$C6,$C6,$C6,$C6,$FC,$FC
DB $C0,$C0,$C0,$C0,$C0,$C0,$00,$00
DB $7C,$7C,$C6,$C6,$C6,$C6,$C6,$C6
DB $D6,$D6,$DE,$DE,$7C,$7C,$00,$00
DB $FC,$FC,$C6,$C6,$C6,$C6,$FC,$FC
DB $F8,$F8,$DC,$DC,$CE,$CE,$00,$00
DB $7E,$7E,$C0,$C0,$C0,$C0,$7C,$7C
DB $06,$06,$06,$06,$FC,$FC,$00,$00
DB $FC,$FC,$30,$30,$30,$30,$30,$30
DB $30,$30,$30,$30,$30,$30,$00,$00
DB $C6,$C6,$C6,$C6,$C6,$C6,$C6,$C6
DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00
DB $C6,$C6,$C6,$C6,$6C,$6C,$6C,$6C
DB $6C,$6C,$38,$38,$38,$38,$00,$00
DB $C6,$C6,$C6,$C6,$C6,$C6,$C6,$C6
DB $D6,$D6,$D6,$D6,$6C,$6C,$00,$00
DB $C6,$C6,$C6,$C6,$6C,$6C,$38,$38
DB $6C,$6C,$C6,$C6,$C6,$C6,$00,$00
DB $C6,$C6,$EE,$EE,$7C,$7C,$38,$38
DB $70,$70,$E0,$E0,$C0,$C0,$00,$00
DB $FE,$FE,$0C,$0C,$18,$18,$30,$30
DB $60,$60,$C0,$C0,$FE,$FE,$00,$00
DB $18,$18,$3C,$3C,$3C,$3C,$18,$18
DB $18,$18,$00,$00,$18,$18,$00,$00
DB $3C,$3C,$66,$66,$0C,$0C,$18,$18
DB $18,$18,$00,$00,$18,$18,$00,$00
DB $7C,$7C,$42,$42,$41,$41,$6A,$48
DB $5D,$4C,$6E,$4C,$7F,$4C,$00,$00
DB $5D,$6E,$6E,$5D,$5D,$6E,$48,$7F
DB $41,$7F,$42,$7E,$7C,$7C,$00,$00
DB $3E,$3E,$21,$21,$21,$20,$AE,$A4
DB $B7,$A6,$AD,$A5,$BC,$A4,$00,$00
DB $B4,$AC,$AC,$B4,$B4,$AC,$A4,$BC
DB $24,$3C,$24,$3C,$3C,$3C,$00,$00
DB $3E,$3E,$42,$42,$82,$82,$56,$12
DB $BA,$32,$56,$52,$9E,$92,$00,$00
DB $1A,$16,$16,$1A,$1A,$16,$12,$1E
DB $12,$1E,$12,$1E,$1E,$1E,$00,$00
DB $1E,$1E,$21,$21,$40,$40,$DD,$8C
DB $B3,$93,$D0,$90,$F7,$97,$00,$00
DB $B6,$D5,$D3,$B2,$B2,$D3,$8C,$FF
DB $40,$7F,$21,$3F,$1E,$1E,$00,$00
DB $1F,$1F,$10,$10,$90,$90,$5F,$5E
DB $C2,$C2,$03,$02,$C3,$C2,$00,$00
DB $C2,$43,$43,$C2,$C2,$43,$42,$C3
DB $82,$83,$02,$03,$03,$03,$00,$00
DB $FB,$FB,$0A,$0A,$0A,$0A,$7B,$7A
DB $C2,$42,$43,$42,$C3,$42,$00,$00
DB $C2,$43,$43,$C2,$C2,$43,$42,$C3
DB $42,$C3,$42,$C3,$C3,$C3,$00,$00
DB $FC,$FC,$02,$02,$01,$01,$7D,$79
DB $AB,$01,$56,$02,$FC,$4C,$00,$00
DB $E8,$58,$74,$EC,$EC,$74,$52,$DE
DB $52,$DE,$49,$CF,$CF,$CF,$00,$00
DB $78,$78,$49,$49,$4A,$4A,$5B,$4A
DB $6A,$4A,$5B,$4A,$7B,$4A,$00,$00
DB $69,$59,$58,$68,$68,$58,$4B,$7B
DB $4A,$7B,$4A,$7B,$7B,$7B,$00,$00
DB $FF,$FF,$01,$01,$01,$01,$7F,$3F
DB $C0,$40,$7C,$3C,$FE,$02,$00,$00
DB $AB,$55,$F5,$FB,$0B,$0D,$F1,$FF
DB $01,$FF,$02,$FE,$FC,$FC,$00,$00
DB $7E,$7E,$42,$42,$42,$42,$56,$42
DB $6A,$42,$34,$24,$3C,$24,$00,$00
DB $2C,$34,$18,$18,$00,$00,$18,$18
DB $24,$3C,$24,$3C,$18,$18,$00,$00
DB $FF,$FF,$AA,$FF,$00,$FF,$AA,$55
DB $00,$FF,$55,$FF,$FF,$FF,$00,$00
DB $DB,$E7,$A5,$C3,$42,$81,$81,$00
DB $42,$81,$A5,$C3,$DB,$E7,$00,$00
DB $10,$10,$38,$38,$7C,$7C,$10,$10
DB $7C,$7C,$38,$38,$10,$10,$00,$00
DB $00,$00,$28,$28,$6C,$6C,$FE,$FE
DB $6C,$6C,$28,$28,$00,$00,$00,$00
DB $00,$00,$18,$18,$18,$18,$30,$30
DB $30,$30,$60,$60,$60,$60,$00,$00
DB $F0,$F0,$C0,$C0,$C0,$C0,$C0,$C0
DB $C0,$C0,$C0,$C0,$F0,$F0,$00,$00
DB $0F,$0F,$03,$03,$03,$03,$03,$03
DB $03,$03,$03,$03,$0F,$0F,$00,$00
DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $7C,$FF,$C6,$FF,$C0,$FF,$CE,$FF
DB $C6,$FF,$C6,$FF,$7C,$FF,$00,$00
DB $38,$FF,$6C,$FF,$C6,$FF,$FE,$FF
DB $C6,$FF,$C6,$FF,$C6,$FF,$00,$00
DB $C6,$FF,$EE,$FF,$FE,$FF,$D6,$FF
DB $C6,$FF,$C6,$FF,$C6,$FF,$00,$00
DB $FE,$FF,$C0,$FF,$C0,$FF,$F8,$FF
DB $C0,$FF,$C0,$FF,$FE,$FF,$00,$00
DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $7C,$FF,$C6,$FF,$C6,$FF,$C6,$FF
DB $C6,$FF,$C6,$FF,$7C,$FF,$00,$00
DB $C6,$FF,$C6,$FF,$6C,$FF,$6C,$FF
DB $6C,$FF,$38,$FF,$38,$FF,$00,$00
DB $FE,$FF,$C0,$FF,$C0,$FF,$F8,$FF
DB $C0,$FF,$C0,$FF,$FE,$FF,$00,$00
DB $FC,$FF,$C6,$FF,$C6,$FF,$FC,$FF
DB $F8,$FF,$DC,$FF,$CE,$FF,$00,$00
DB $18,$FF,$3C,$FF,$3C,$FF,$18,$FF
DB $18,$FF,$00,$FF,$18,$FF,$00,$00
DB $7C,$7C,$C6,$C6,$C0,$C0,$CE,$CE
DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00
DB $38,$38,$6C,$6C,$C6,$C6,$FE,$FE
DB $C6,$C6,$C6,$C6,$C6,$C6,$00,$00
DB $C6,$C6,$EE,$EE,$FE,$FE,$D6,$D6
DB $C6,$C6,$C6,$C6,$C6,$C6,$00,$00
DB $FE,$FE,$C0,$C0,$C0,$C0,$F8,$F8
DB $C0,$C0,$C0,$C0,$FE,$FE,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $7C,$7C,$C6,$C6,$C6,$C6,$C6,$C6
DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00
DB $C6,$C6,$C6,$C6,$6C,$6C,$6C,$6C
DB $6C,$6C,$38,$38,$38,$38,$00,$00
DB $FE,$FE,$C0,$C0,$C0,$C0,$F8,$F8
DB $C0,$C0,$C0,$C0,$FE,$FE,$00,$00
DB $FC,$FC,$C6,$C6,$C6,$C6,$FC,$FC
DB $F8,$F8,$DC,$DC,$CE,$CE,$00,$00
DB $18,$18,$3C,$3C,$3C,$3C,$18,$18
DB $18,$18,$00,$00,$18,$18,$00,$00
DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $FC,$FF,$C6,$FF,$C6,$FF,$FC,$FF
DB $F8,$FF,$DC,$FF,$CE,$FF,$00,$00
DB $FE,$FF,$C0,$FF,$C0,$FF,$F8,$FF
DB $C0,$FF,$C0,$FF,$FE,$FF,$00,$00
DB $FC,$FF,$30,$FF,$30,$FF,$30,$FF
DB $30,$FF,$30,$FF,$30,$FF,$00,$00
DB $FC,$FF,$C6,$FF,$C6,$FF,$FC,$FF
DB $F8,$FF,$DC,$FF,$CE,$FF,$00,$00
DB $C6,$FF,$EE,$FF,$7C,$FF,$38,$FF
DB $70,$FF,$E0,$FF,$C0,$FF,$00,$00
DB $F0,$FF,$C0,$FF,$C0,$FF,$C0,$FF
DB $C0,$FF,$C0,$FF,$F0,$FF,$00,$00
DB $38,$FF,$6C,$FF,$C6,$FF,$FE,$FF
DB $C6,$FF,$C6,$FF,$C6,$FF,$00,$00
DB $0F,$FF,$03,$FF,$03,$FF,$03,$FF
DB $03,$FF,$03,$FF,$0F,$FF,$00,$00
DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $FC,$FC,$C6,$C6,$C6,$C6,$FC,$FC
DB $F8,$F8,$DC,$DC,$CE,$CE,$00,$00
DB $FE,$FE,$C0,$C0,$C0,$C0,$F8,$F8
DB $C0,$C0,$C0,$C0,$FE,$FE,$00,$00
DB $FC,$FC,$30,$30,$30,$30,$30,$30
DB $30,$30,$30,$30,$30,$30,$00,$00
DB $FC,$FC,$C6,$C6,$C6,$C6,$FC,$FC
DB $F8,$F8,$DC,$DC,$CE,$CE,$00,$00
DB $C6,$C6,$EE,$EE,$7C,$7C,$38,$38
DB $70,$70,$E0,$E0,$C0,$C0,$00,$00
DB $F0,$F0,$C0,$C0,$C0,$C0,$C0,$C0
DB $C0,$C0,$C0,$C0,$F0,$F0,$00,$00
DB $38,$38,$6C,$6C,$C6,$C6,$FE,$FE
DB $C6,$C6,$C6,$C6,$C6,$C6,$00,$00
DB $0F,$0F,$03,$03,$03,$03,$03,$03
DB $03,$03,$03,$03,$0F,$0F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $7C,$FF,$C6,$FF,$C6,$FF,$C6,$FF
DB $D6,$FF,$DE,$FF,$7C,$FF,$00,$00
DB $C6,$FF,$C6,$FF,$C6,$FF,$C6,$FF
DB $C6,$FF,$C6,$FF,$7C,$FF,$00,$00
DB $18,$FF,$18,$FF,$18,$FF,$18,$FF
DB $18,$FF,$18,$FF,$18,$FF,$00,$00
DB $FC,$FF,$30,$FF,$30,$FF,$30,$FF
DB $30,$FF,$30,$FF,$30,$FF,$00,$00
DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $F0,$FF,$C0,$FF,$C0,$FF,$C0,$FF
DB $C0,$FF,$C0,$FF,$F0,$FF,$00,$00
DB $FC,$FF,$C6,$FF,$C6,$FF,$FC,$FF
DB $C6,$FF,$C6,$FF,$FC,$FF,$00,$00
DB $0F,$FF,$03,$FF,$03,$FF,$03,$FF
DB $03,$FF,$03,$FF,$0F,$FF,$00,$00
DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $7C,$7C,$C6,$C6,$C6,$C6,$C6,$C6
DB $D6,$D6,$DE,$DE,$7C,$7C,$00,$00
DB $C6,$C6,$C6,$C6,$C6,$C6,$C6,$C6
DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00
DB $18,$18,$18,$18,$18,$18,$18,$18
DB $18,$18,$18,$18,$18,$18,$00,$00
DB $FC,$FC,$30,$30,$30,$30,$30,$30
DB $30,$30,$30,$30,$30,$30,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $F0,$F0,$C0,$C0,$C0,$C0,$C0,$C0
DB $C0,$C0,$C0,$C0,$F0,$F0,$00,$00
DB $FC,$FC,$C6,$C6,$C6,$C6,$FC,$FC
DB $C6,$C6,$C6,$C6,$FC,$FC,$00,$00
DB $0F,$0F,$03,$03,$03,$03,$03,$03
DB $03,$03,$03,$03,$0F,$0F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $C0,$C0,$F0,$F0,$FC,$FC,$FF,$FF
DB $FC,$FC,$F0,$F0,$C0,$C0,$00,$00
DB $C0,$00,$F0,$00,$FC,$00,$FF,$00
DB $FC,$00,$F0,$00,$C0,$00,$00,$00
DB $38,$38,$44,$44,$9A,$9A,$A2,$A2
DB $9A,$9A,$44,$44,$38,$38,$00,$00
DB $7C,$7C,$42,$42,$41,$41,$5D,$48
DB $6E,$4C,$5B,$4A,$79,$49,$00,$00
DB $68,$58,$58,$68,$68,$58,$48,$78
DB $48,$78,$48,$78,$78,$78,$00,$00
DB $7C,$7C,$84,$84,$04,$04,$75,$25
DB $ED,$65,$B5,$A5,$3D,$25,$00,$00
DB $2D,$35,$35,$2D,$2D,$35,$25,$3D
DB $24,$3C,$24,$3C,$3C,$3C,$00,$00
DB $3C,$3C,$42,$42,$81,$81,$BA,$18
DB $67,$27,$A0,$20,$EF,$2F,$00,$00
DB $6D,$AA,$A6,$65,$65,$A6,$18,$FF
DB $81,$FF,$42,$7E,$3C,$3C,$00,$00
DB $3F,$3F,$20,$20,$20,$20,$AE,$A6
DB $B5,$A5,$2E,$26,$BF,$A0,$00,$00
DB $B5,$AA,$AE,$B7,$B5,$AD,$A6,$BF
DB $20,$3F,$20,$3F,$3F,$3F,$00,$00
DB $1F,$1F,$90,$90,$50,$50,$DF,$5E
DB $42,$42,$C3,$42,$83,$82,$00,$00
DB $82,$83,$43,$42,$42,$C3,$42,$C3
DB $42,$C3,$82,$83,$03,$03,$00,$00
DB $01,$01,$02,$02,$04,$04,$0D,$08
DB $0B,$09,$0D,$09,$0F,$09,$00,$00
DB $0B,$0D,$0D,$0B,$0B,$0D,$08,$0F
DB $04,$07,$02,$03,$01,$01,$00,$00
DB $E0,$E0,$10,$10,$08,$08,$D5,$C5
DB $2D,$25,$3D,$3D,$01,$01,$00,$00
DB $01,$01,$3D,$3D,$2D,$35,$C5,$FD
DB $08,$F8,$10,$F0,$E0,$E0,$00,$00
DB $03,$03,$02,$02,$04,$04,$06,$04
DB $05,$04,$0B,$09,$0F,$09,$00,$00
DB $0D,$0B,$1A,$16,$17,$1B,$10,$1F
DB $23,$3F,$24,$3C,$3C,$3C,$00,$00
DB $C0,$C0,$40,$40,$20,$20,$A1,$21
DB $61,$21,$B1,$91,$F1,$91,$00,$00
DB $D1,$B1,$69,$59,$D9,$E9,$09,$F9
DB $C4,$FC,$24,$3C,$3C,$3C,$00,$00
DB $3C,$3C,$3E,$3E,$36,$36,$36,$36
DB $3E,$3E,$3C,$3C,$00,$00,$00,$00
DB $C6,$C6,$6C,$6C,$38,$38,$38,$38
DB $6C,$6C,$C6,$C6,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$75,$00,$47,$00,$55,$00,$55
DB $00,$75,$00,$00,$00,$3E,$00,$00
DB $00,$75,$00,$47,$00,$55,$00,$55
DB $00,$75,$00,$00,$00,$36,$00,$00
DB $00,$75,$00,$47,$00,$55,$00,$55
DB $00,$75,$00,$00,$00,$2A,$00,$00
DB $00,$00,$00,$3E,$00,$7F,$00,$6B
DB $00,$3E,$00,$2A,$00,$00,$00,$00
DB $00,$00,$00,$FF,$20,$81,$76,$81
DB $20,$81,$00,$FF,$00,$00,$00,$00
DB $00,$00,$00,$00,$28,$28,$10,$10
DB $28,$28,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$28,$28,$10,$10
DB $28,$28,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$28,$28,$10,$10
DB $28,$28,$00,$00,$00,$00,$00,$00
DB $00,$26,$00,$55,$00,$76,$00,$55
DB $00,$55,$00,$00,$00,$3E,$00,$00
DB $00,$26,$00,$55,$00,$76,$00,$55
DB $00,$55,$00,$00,$00,$36,$00,$00
DB $00,$00,$00,$00,$28,$28,$10,$10
DB $28,$28,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$28,$28,$10,$10
DB $28,$28,$00,$00,$00,$00,$00,$00
DB $02,$70,$02,$40,$02,$70,$07,$10
DB $07,$70,$02,$00,$00,$1F,$00,$00
DB $02,$50,$02,$50,$02,$70,$07,$50
DB $07,$50,$02,$00,$00,$1F,$00,$00
DB $02,$50,$02,$50,$02,$20,$07,$50
DB $07,$50,$02,$00,$00,$1F,$00,$00
DB $00,$3E,$02,$61,$04,$51,$24,$49
DB $00,$45,$30,$43,$00,$3E,$00,$00
DB $00,$00,$00,$62,$00,$15,$00,$25
DB $00,$45,$00,$72,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$E8,$00,$A8,$00,$A8,$00,$A8
DB $00,$EE,$00,$00,$00,$00,$00,$00
DB $00,$EA,$00,$8E,$00,$EA,$00,$2A
DB $00,$EA,$00,$00,$00,$00,$00,$00
DB $03,$03,$04,$04,$08,$08,$0D,$08
DB $0B,$09,$0D,$08,$0F,$08,$00,$00
DB $06,$05,$03,$03,$00,$00,$0F,$0F
DB $08,$0F,$08,$0F,$0F,$0F,$00,$00
DB $FC,$FC,$04,$04,$04,$04,$FD,$FD
DB $01,$01,$F1,$F1,$F9,$09,$00,$00
DB $AD,$55,$D5,$ED,$2D,$35,$C5,$FD
DB $04,$FC,$08,$F8,$F0,$F0,$00,$00
DB $44,$44,$44,$44,$28,$28,$28,$28
DB $28,$28,$10,$10,$12,$12,$00,$00
DB $C4,$C4,$2A,$2A,$2A,$2A,$4A,$4A
DB $8A,$8A,$8A,$8A,$E4,$E4,$00,$00
DB $CC,$CC,$22,$22,$22,$22,$44,$44
DB $82,$82,$82,$82,$EC,$EC,$00,$00
DB $44,$44,$CA,$CA,$4A,$4A,$4A,$4A
DB $4A,$4A,$4A,$4A,$E4,$E4,$00,$00
DB $CE,$CE,$28,$28,$28,$28,$4C,$4C
DB $82,$82,$82,$82,$EC,$EC,$00,$00
DB $08,$08,$1C,$1C,$30,$30,$3C,$3C
DB $3C,$3C,$1C,$1C,$14,$14,$00,$00
TilesEnd::
ENDC

View File

@ -1,536 +0,0 @@
; 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(TITLE_MAP_INC)
DEF TITLE_MAP_INC EQU 1
INCLUDE "globals.asm"
SECTION "Title Screen Static Data", ROMX, BANK[BANK_TITLE]
sBUTTONSMode::
db "NORM"
db " INV"
sRNGMode::
db "TGM1"
db "TGM2"
db "TGM3"
db "HELL"
db "1ROL"
sROTMode::
db "ARS1"
db "ARS2"
db "SEGA"
db "MYCO"
sDROPMode::
db "FIRM"
db "SNIC"
db "HARD"
db "LOCK"
db "NONE"
sCURVEMode::
db "DMGT"
db "TGM1"
db "TGM3"
db "DEAT"
db "SHIR"
db "CHIL"
db "MYCO"
sHIGMode::
db " NO"
db " YES"
sDisabled::
db "----"
sFilterMode::
db "DLRU"
db "ULRD"
db "LRUD"
db "UDLR"
db "NONE"
sBGMode::
db "LITE"
db "DARK"
sTetryRNG::
db "THIS OPTION WILL"
db "CHANGE THE WAY "
db "PIECES ARE RAN- "
db "DOMIZED "
sTetryROT::
db "THIS OPTION WILL"
db "CHANGE THE WAY "
db "PIECES ROTATE "
db " "
sTetryDROP::
db "THIS OPTION WILL"
db "CHANGE THE WAY "
db "THE UP AND DOWN "
db "ARROWS ACT "
sTetryCURVE::
db "THIS OPTION WILL"
db "SELECT A SPEED "
db "CURVE TO PLAY ON"
db " "
sTetryHIG::
db "THIS OPTION WILL"
db "FORCE PIECES TO "
db "DROP AT THE HI- "
db "GHEST SPEED "
sTetrySTART::
db "THIS OPTION WILL"
db "CHANGE WHERE YOU"
db "START IN THE SP-"
db "EED CURVE "
sTetryEXITSettings::
db "OH OKAY THEN- "
db "BYE BYE! "
db " "
db " "
sTetryProfileNumber::
db "SELECT THE PRO- "
db "FILE YOU WOULD "
db "LIKE TO EDIT! "
db " "
sTetryProfileInitial1::
db "THIS IS THE "
db "FIRST INITIAL IN"
db "YOUR NAME! "
db " "
sTetryProfileInitial2::
db "THIS IS THE "
db "SECOND INITIAL "
db "IN YOUR NAME! "
db " "
sTetryProfileInitial3::
db "THIS IS THE "
db "THIRD INITIAL IN"
db "YOUR NAME! "
db " "
sTetryButtons::
db "THIS OPTION WILL"
db "CHANGE WHICH WAY"
db "THE BUTTONS RO- "
db "TATE THE PIECE! "
sTetryFILTER::
db "THIS OPTION WILL"
db "DETERMINE WHICH "
db "D-PAD BUTTONS "
db "HAVE PRIORITY! "
sTetryBG::
db "THIS OPTION WILL"
db "CHANGE THE BACK-"
db "GROUND COLOR IN-"
db "GAME! "
sTetryReset::
db "THIS OPTION WILL"
db "RESET THIS PRO- "
db "FILE TO THE "
db "DEFAULT! "
sTetryEXITProfile::
db "ARE YOU LEAVING "
db "ALREADY? I'LL "
db "MISS YOU! "
db " "
sTitleAttrs::
db 7, 7, 7, 7, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, 1, 3, 3, 3, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 1, 1, 1, 1, 4, 4, 4, 1, 4, 4, 4, 1, 4, 4, 4, 4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
db 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
sTitleScreenMainMap::
DB $50,$01,$01,$01,$01,$FC,$F0,$F2,$F8,$FA
DB $F1,$F3,$F9,$FB,$F4,$F6,$01,$01,$59,$5B
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$A0,$A2,$01,$AA,$B0,$B2,$B8,$BA
DB $C0,$C2,$C8,$CA,$D0,$D2,$D8,$DA,$E0,$E2
DB $E8,$EA,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$A1,$A3,$A9,$AB,$B1,$B3
DB $B9,$BB,$C1,$C3,$C9,$CB,$D1,$D3,$D9,$DB
DB $E1,$E3,$E9,$EB,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$A4,$A6,$AC,$AE
DB $B4,$B6,$BC,$BE,$C4,$C6,$CC,$CE,$D4,$D6
DB $DC,$DE,$E4,$E6,$EC,$EE,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$A5,$A7
DB $AD,$AF,$B5,$B7,$BD,$BF,$C5,$B7,$CD,$CF
DB $D5,$D7,$DD,$DF,$E5,$E7,$ED,$EF,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$5D,$01,$1E,$1F,$0C
DB $1D,$1F,$01,$19,$1A,$1D,$18,$0C,$17,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$5D,$01,$1E
DB $1F,$0C,$1D,$1F,$01,$0D,$14,$12,$01,$01
DB $01,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$5D
DB $01,$1B,$1D,$1A,$11,$14,$17,$10,$01,$01
DB $01,$01,$01,$01,$01,$01,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$5D,$01,$1E,$10,$1F,$1F,$14,$19,$12
DB $1E,$01,$01,$01,$01,$01,$01,$01,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$5D,$01,$1D,$10,$0E,$1A,$1D
DB $0F,$1E,$01,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$5D,$01,$0E,$1D,$10
DB $0F,$14,$1F,$1E,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$0C,$2A,$0E,$1A
DB $19,$11,$01,$0D,$2A,$0D,$0C,$0E,$16,$01
DB $4D,$2A,$19,$0C,$21,$14,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$5E,$5E
DB $5E,$5E,$5E,$5E,$4A,$5E,$5E,$5E,$5E,$5E
DB $5E,$4A,$5E,$5E,$5E,$5E,$5E,$5E,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $41,$43,$01,$01,$01,$01,$40,$45,$47,$01
DB $01,$01,$01,$40,$42,$48,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$5E,$5E,$5E,$5E,$5E,$5E,$5F,$5E
DB $5E,$5E,$5E,$5E,$5E,$5F,$5E,$5E,$5E,$5E
DB $5E,$5E,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$44,$46,$01,$01,$01,$01
DB $40,$49,$4B,$01,$01,$01,$01,$40,$4C,$4E
DB $01,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00
sTitleScreenMainMapEnd::
sTitleScreenSettingsMap::
DB $01,$01,$01,$01,$01,$01,$1E,$10,$1F,$1F
DB $14,$19,$12,$1E,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$5D,$01,$1D,$19,$12,$01
DB $18,$1A,$0F,$10,$01,$01,$01,$01,$28,$01
DB $01,$01,$01,$29,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$5D,$01,$1D,$1A
DB $1F,$01,$18,$1A,$0F,$10,$01,$01,$01,$01
DB $28,$01,$01,$01,$01,$29,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$5D,$01
DB $0F,$1D,$1A,$1B,$01,$18,$1A,$0F,$10,$01
DB $01,$01,$28,$01,$01,$01,$01,$29,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $5D,$01,$1E,$1B,$10,$10,$0F,$01,$0E,$20
DB $1D,$21,$10,$01,$28,$01,$01,$01,$01,$29
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$5D,$01,$0C,$17,$22,$0C,$24,$1E
DB $01,$04,$02,$12,$01,$01,$28,$01,$01,$01
DB $01,$29,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$5D,$01,$1E,$1F,$0C,$1D
DB $1F,$01,$17,$10,$21,$10,$17,$01,$28,$01
DB $01,$01,$01,$29,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$5D,$01,$0D,$0C
DB $0E,$16,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$0C,$2A,$0E,$1A,$19,$11
DB $01,$0D,$2A,$0D,$0C,$0E,$16,$01,$4D,$2A
DB $19,$0C,$21,$14,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$5E,$5E,$5E,$5E
DB $5E,$5E,$5E,$5E,$5E,$5E,$5E,$5E,$5E,$5E
DB $5E,$5E,$5E,$5E,$5E,$5E,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$30,$32,$38,$3A,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$31,$33,$39,$3B
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$34,$36
DB $3C,$3E,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $35,$37,$3D,$3F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00
sTitleScreenSettingsMapEnd::
sTitleScreenCreditsMap::
DB $01,$01,$01,$01,$01,$01,$0E,$1D,$10,$0F
DB $14,$1F,$1E,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$22,$1D,$14,$1F,$1F,$10
DB $19,$01,$0D,$24,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$2A,$01,$1B,$0C
DB $19,$0F,$1A,$1D,$0C,$01,$19,$1A,$21,$0C
DB $01,$01,$01,$01,$01,$01,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $22,$14,$1F,$13,$01,$13,$10,$17,$1B,$01
DB $11,$1D,$1A,$18,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$2A,$01,$0E,$1D,$10,$10,$1B,$10
DB $1D,$0E,$1D,$0C,$11,$1F,$24,$1F,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$2A,$01,$17,$14,$19,$0F
DB $1F,$1A,$0D,$14,$0C,$1E,$01,$01,$01,$01
DB $01,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$2A,$01,$1F,$10
DB $1B,$1B,$17,$10,$1E,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$2A,$01
DB $0C,$19,$1F,$1A,$19,$10,$1D,$12,$1A,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $2A,$01,$25,$0C,$1B,$13,$1A,$0F,$09,$09
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$2A,$01,$0D,$0D,$0D,$0D,$0D,$1D
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$2A,$01,$0C,$23,$08,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$2A,$01,$0D,$10
DB $22,$0C,$1D,$10,$01,$01,$01,$01,$01,$01
DB $01,$01,$56,$56,$56,$56,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$2A,$01
DB $1F,$0C,$1B,$01,$58,$5A,$01,$01,$01,$01
DB $01,$01,$01,$01,$30,$32,$38,$3A,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $2A,$01,$12,$0D,$0F,$10,$21,$01,$58,$5A
DB $01,$01,$01,$01,$01,$01,$31,$33,$39,$3B
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$34,$36
DB $3C,$3E,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$0D,$2A,$0D,$0C,$0E,$16
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $35,$37,$3D,$3F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00
sTitleScreenCreditsMapEnd::
sTitleScreenProfileMap::
DB $01,$01,$01,$01,$01,$01,$1B,$1D,$1A,$11
DB $14,$17,$10,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$5D,$01,$19,$20,$18,$0D
DB $10,$1D,$01,$01,$01,$01,$01,$01,$28,$01
DB $29,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$5D,$01,$14,$19
DB $14,$1F,$14,$0C,$17,$01,$03,$01,$01,$01
DB $28,$01,$29,$01,$01,$01,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$5D,$01
DB $14,$19,$14,$1F,$14,$0C,$17,$01,$04,$01
DB $01,$01,$28,$01,$29,$01,$01,$01,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $5D,$01,$14,$19,$14,$1F,$14,$0C,$17,$01
DB $05,$01,$01,$01,$28,$01,$29,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$5D,$01,$0D,$20,$1F,$1F,$1A,$19
DB $1E,$01,$01,$01,$01,$01,$28,$01,$01,$01
DB $01,$29,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$5D,$01,$0F,$2A,$1B,$0C
DB $0F,$01,$11,$14,$17,$1F,$10,$1D,$28,$01
DB $01,$01,$01,$29,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$5D,$01,$0D,$0C
DB $0E,$16,$12,$1D,$1A,$20,$19,$0F,$01,$01
DB $28,$01,$01,$01,$01,$29,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$5D,$01
DB $1D,$10,$1E,$10,$1F,$01,$1B,$1D,$1A,$11
DB $14,$17,$10,$01,$01,$01,$01,$01,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $5D,$01,$0D,$0C,$0E,$16,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$0C,$2A,$0E,$1A,$19,$11
DB $01,$0D,$2A,$0D,$0C,$0E,$16,$01,$4D,$2A
DB $19,$0C,$21,$14,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$5E,$5E,$5E,$5E
DB $5E,$5E,$5E,$5E,$5E,$5E,$5E,$5E,$5E,$5E
DB $5E,$5E,$5E,$5E,$5E,$5E,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$30,$32,$38,$3A,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$31,$33,$39,$3B
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$34,$36
DB $3C,$3E,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $35,$37,$3D,$3F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00
sTitleScreenProfileMapEnd::
sTitleScreenRecordsMap::
DB $01,$01,$01,$01,$01,$01,$01,$1E,$0E,$1A
DB $1D,$10,$1E,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$01,$01,$01,$01,$01,$01
DB $55,$28,$23,$23,$23,$23,$29,$5C,$01,$01
DB $01,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $03,$53,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$04,$53,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$05,$53,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$06,$53,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$07,$53
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $08,$53,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$09,$53,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$0A,$53,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$0B,$53,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$03,$54
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$0D,$2A,$0D,$0C,$0E,$16
DB $01,$4D,$2A,$19,$0C,$21,$14,$01,$1E,$17
DB $2A,$1D,$1E,$1F,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00
sTitleScreenRecordsMapEnd::
ENDC

95
src/res/title_map.inc Normal file
View File

@ -0,0 +1,95 @@
; 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(TITLE_MAP_INC)
DEF TITLE_MAP_INC EQU 1
SECTION "Title Screen Tilemap", ROM0
TitleScreenTilemap::
DB $C3,$5B,$4C,$59,$4F,$5A,$5D,$4C,$01,$59
DB $5A,$61,$4C,$01,$FA,$FB,$FC,$FD,$FE,$FF
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$68
DB $6A,$6C,$6E,$70,$72,$74,$76,$78,$7A,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$69,$6B,$6D,$6F,$71,$73,$75,$77,$79
DB $7B,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$5B,$5D,$50,$5E,$5E,$01
DB $5E,$5F,$4C,$5D,$5F,$66,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$C1,$01,$4D,$60,$5F,$5F
DB $5A,$59,$5E,$01,$01,$01,$01,$01,$81,$01
DB $01,$01,$01,$82,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$C2,$01
DB $5D,$59,$52,$01,$58,$5A,$4F,$50,$01,$01
DB $01,$01,$81,$01,$01,$01,$01,$82,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$C2,$01,$5D,$5A,$5F,$01,$58,$5A
DB $4F,$50,$01,$01,$01,$01,$81,$01,$01,$01
DB $01,$82,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$C2,$01,$4F,$5D
DB $5A,$5B,$01,$58,$5A,$4F,$50,$01,$01,$01
DB $81,$01,$01,$01,$01,$82,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $C2,$01,$5E,$5B,$50,$50,$4F,$01,$4E,$60
DB $5D,$61,$50,$01,$81,$01,$01,$01,$01,$82
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$C2,$01,$4C,$57,$62,$4C
DB $64,$5E,$01,$44,$42,$52,$01,$01,$81,$01
DB $01,$01,$01,$82,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$C2,$01
DB $5E,$5F,$4C,$5D,$5F,$01,$57,$50,$61,$50
DB $57,$01,$81,$01,$01,$01,$01,$82,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01
TitleScreenTilemapEnd::
ENDC

View File

@ -26,8 +26,6 @@ SECTION "High RNG Variables", HRAM
hRNGSeed: ds 4
hPieceHistory: ds 4
hNextPiece:: ds 1
hUpcomingPiece1:: ds 1
hUpcomingPiece2:: ds 1
SECTION "TGM3 RNG Variables", WRAM0
@ -38,62 +36,25 @@ wTGM3WorstDroughtIdx: ds 1
section "RNG Functions", ROM0
HarvestEntropy::
ld hl, $C000
ld de, $E000
.loop
ldh a, [hRNGSeed]
xor a, [hl]
inc hl
ldh [hRNGSeed], a
ldh a, [hRNGSeed+1]
xor a, [hl]
inc hl
ldh [hRNGSeed+1], a
ldh a, [hRNGSeed+2]
xor a, [hl]
inc hl
ldh [hRNGSeed+2], a
ldh a, [hRNGSeed+3]
xor a, [hl]
inc hl
ldh [hRNGSeed+3], a
ld a, h
cp a, d
jr nz, .loop
ld a, l
cp a, e
jr nz, .loop
ret
; Snapshots the initial seed for a game, then initializes the history and piece queue.
RNGInit::
; Do some bit fuckery on the seed using the gameboy's free-running timers.
ld hl, rDIV
ldh a, [hRNGSeed]
ldh a, [rDIV]
xor a, [hl]
ldh [hRNGSeed], a
ldh a, [hRNGSeed+2]
ldh a, [rTIMA]
xor a, [hl]
ldh [hRNGSeed+1], a
ldh a, [rDIV]
xor a, [hl]
ldh [hRNGSeed+2], a
ld hl, rTIMA
ldh a, [hRNGSeed+1]
xor a, [hl]
ldh [hRNGSeed+1], a
ldh a, [hRNGSeed+3]
ldh a, [rTIMA]
xor a, [hl]
ldh [hRNGSeed+3], a
; TGM3 vars
ld b, BANK_GAMEPLAY
rst RSTSwitchBank
ld de, sTGM3Bag
ld hl, wTGM3Bag
ld bc, 35
@ -102,29 +63,21 @@ RNGInit::
ld hl, wTGM3Droughts
ld bc, 7
call UnsafeMemCopy
rst RSTRestoreBank
; Start with no piece held.
ld a, PIECE_NONE
; Start with a random non-S/Z piece held.
: call Next7Piece
cp a, PIECE_Z
jr z, :-
cp a, PIECE_S
jr z, :-
ldh [hHeldPiece], a
; If we're in HELL mode, we don't care about anything but a random piece to start with.
ld a, [wRNGModeState]
cp a, RNG_MODE_HELL
jr nz, .complexinit
.hellinit
call Next7Piece
ld [hUpcomingPiece2], a
call Next7Piece
ld [hUpcomingPiece1], a
call Next7Piece
ld [hNextPiece], a
xor a, a
ldh [hPieceHistory], a
ldh [hPieceHistory+1], a
ldh [hPieceHistory+2], a
ldh [hPieceHistory+3], a
ret
; Otherwise do complex init.
@ -137,49 +90,36 @@ RNGInit::
ld a, [wRNGModeState]
cp a, RNG_MODE_TGM1
jr z, .getfirstpiece
jr z, :+
ld a, PIECE_S
ldh [hPieceHistory+2], a
ldh [hPieceHistory+3], a
; Get the first piece and make sure it's not Z, S or O.
.getfirstpiece
call Next7Piece
: call Next7Piece
cp a, PIECE_Z
jr z, .getfirstpiece
jr z, :-
cp a, PIECE_S
jr z, .getfirstpiece
jr z, :-
cp a, PIECE_O
jr z, .getfirstpiece
jr z, :-
; Save the generated piece and put it in the history.
ldh [hPieceHistory], a
ldh [hUpcomingPiece1], a
ldh [hUpcomingPiece2], a
; Generate the next 2 to fill up the queue.
.getqueue
call GetNextPiece
jp GetNextPiece
ld [hNextPiece], a
ret
; Shift the generated piece into the history and save it.
ShiftHistory:
ld b, a
ldh a, [hUpcomingPiece1]
ldh [hNextPiece], a
ldh a, [hUpcomingPiece2]
ldh [hUpcomingPiece1], a
ld a, b
ldh [hUpcomingPiece2], a
ldh a, [hPieceHistory+2]
ldh [hPieceHistory+3], a
ldh a, [hPieceHistory+1]
ldh [hPieceHistory+2], a
ldh a, [hPieceHistory]
ldh [hPieceHistory+1], a
ldh a, [hUpcomingPiece2]
ldh a, [hNextPiece]
ldh [hPieceHistory], a
ret
@ -187,7 +127,8 @@ ShiftHistory:
; A random piece. Get fucked.
GetNextHellPiece:
call Next7Piece
jr ShiftHistory
ldh [hNextPiece], a
ret
; 4 history, 4 rerolls.
@ -247,7 +188,7 @@ GetNextNesPiece:
cp a, [hl]
jr nz, ShiftHistory
call Next7Piece
jr ShiftHistory
jr nz, ShiftHistory
; TGM3 mode... It's complex.
@ -304,7 +245,7 @@ GetNextTGM3Piece:
inc [hl]
; Set the drought of our most recently drawn piece to 0.
: ldh a, [hUpcomingPiece2]
: ldh a, [hCurrentPiece]
ld c, a
xor a, a
ld b, a
@ -331,7 +272,7 @@ GetNextTGM3Piece:
jr z, :+ ; Same.
jr c, :+ ; Nope.
ld e, a
xor a, a
ld a, 0
ld [wTGM3WorstDroughtIdx], a
; Is idx 1 worse?
@ -401,27 +342,21 @@ GetNextTGM3Piece:
ld [hl], a
ret
; Gets the next piece depending on RNG mode.
GetNextPiece::
ld hl, .nextpiecejumps
ld a, [wRNGModeState]
ld b, 0
ld c, a
add a, c
add a, c
ld c, a
add hl, bc
jp hl
.nextpiecejumps
jp GetNextTGM1Piece
jp GetNextTGM2Piece
jp GetNextTGM3Piece
jp GetNextHellPiece
jp GetNextNesPiece
cp a, RNG_MODE_HELL
jp z, GetNextHellPiece
cp a, RNG_MODE_TGM1
jp z, GetNextTGM1Piece
cp a, RNG_MODE_TGM2
jp z, GetNextTGM2Piece
cp a, RNG_MODE_TGM3
jp z, GetNextTGM3Piece
cp a, RNG_MODE_NES
jp z, GetNextNesPiece
; Tries generating bytes until it gets one in [0; 35)
Next35Piece:
: call NextByte
and a, $3F
@ -430,7 +365,6 @@ Next35Piece:
ret
; Tries generating bytes until it gets one in [0; 7)
Next7Piece:
: call NextByte
and a, $07
@ -439,7 +373,6 @@ Next7Piece:
ret
; Cyrcles the RNG returning a random byte in a.
NextByte:
; Load seed
ld hl, hRNGSeed+3

View File

@ -23,13 +23,13 @@ INCLUDE "globals.asm"
SECTION "Score Variables", HRAM
hScore:: ds 8
hScore:: ds 6
hScoreIncrement:: ds 2
hScoreIncrementBCD:: ds 8
hScoreIncrementBCD:: ds 6
hScoreIncrementHead:: ds 1
SECTION "Score Functions", ROM0
; Wipes the score.
ScoreInit::
xor a, a
ldh [hScore], a
@ -38,8 +38,6 @@ ScoreInit::
ldh [hScore+3], a
ldh [hScore+4], a
ldh [hScore+5], a
ldh [hScore+6], a
ldh [hScore+7], a
ldh [hScoreIncrement], a
ldh [hScoreIncrement+1], a
ld a, $FF
@ -49,11 +47,8 @@ ScoreInit::
ldh [hScoreIncrementBCD+3], a
ldh [hScoreIncrementBCD+4], a
ldh [hScoreIncrementBCD+5], a
ldh [hScoreIncrementBCD+6], a
ldh [hScoreIncrementBCD+7], a
ret
; Increases the current score by the amount in wScoreIncrement.
IncreaseScore::
; Wipe the old BCD score.
@ -64,8 +59,6 @@ IncreaseScore::
ldh [hScoreIncrementBCD+3], a
ldh [hScoreIncrementBCD+4], a
ldh [hScoreIncrementBCD+5], a
ldh [hScoreIncrementBCD+6], a
ldh [hScoreIncrementBCD+7], a
; First convert to BCD.
ldh a, [hScoreIncrement]
@ -117,21 +110,17 @@ IncreaseScore::
ld [hl+], a
ld [hl], a
ld hl, hScoreIncrementBCD+7
ld de, hScoreIncrementBCD+5
ld b, 0
ld a, $FF
: cp a, [hl]
: cp a, b
jr nz, .preAddDigit
inc b
dec hl
dec de
jr :-
.preAddDigit
; B contains the amount of times we need to shift the BCD score to the right.
ldh a, [hScoreIncrementBCD+6]
ldh [hScoreIncrementBCD+7], a
ldh a, [hScoreIncrementBCD+5]
ldh [hScoreIncrementBCD+6], a
ldh a, [hScoreIncrementBCD+4]
ldh [hScoreIncrementBCD+5], a
ldh a, [hScoreIncrementBCD+3]
@ -145,9 +134,9 @@ IncreaseScore::
xor a, a
ldh [hScoreIncrementBCD], a
dec b
jr nz, .preAddDigit
ld hl, hScore+7
ld de, hScoreIncrementBCD+7
jr z, :-
ld hl, hScore+5
ld de, hScoreIncrementBCD+5
; DE is now pointing to the last digit of the BCD score.
; HL points at the last digit of the displayed score.
@ -165,8 +154,8 @@ IncreaseScore::
cp a, $0A
jr c, .nextDigit
; Except if this is the 8th digit.
ld a, 7
; Except if this is the 6th digit.
ld a, 5
cp a, b
jr z, .nextDigit
@ -184,7 +173,7 @@ IncreaseScore::
dec hl
; Check if we're out of numbers.
ld a, 7
ld a, 5
cp a, b
jr nz, .addDigit
@ -196,8 +185,9 @@ IncreaseScore::
; If it has, reset the score.
xor a, a
ldh [hScore], a
ld a, SFX_RANKGM
jp SFXEnqueue
ld a, SFX_RANKUP
call SFXEnqueue
ret
ENDC

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,746 +0,0 @@
; 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(SRAM_ASM)
DEF SRAM_ASM EQU 1
INCLUDE "globals.asm"
MACRO PROFILE
UNION
rProfileData\1:: ds 64
NEXTU
rProfileName\1:: ds 3
rSwapABState\1:: ds 1
rRNGModeState\1:: ds 1
rRotModeState\1:: ds 1
rDropModeState\1:: ds 1
rSpeedCurveState\1:: ds 1
rAlways20GState\1:: ds 1
rSelectedStartLevel\1:: ds 2
rFilterMode\1:: ds 1
rBGMode\1:: ds 1
rUnused\1:: ds (64-13)
ENDU
ENDM
SECTION "Persistent Globals", SRAM
rCheck:: ds 6
rLastProfile:: ds 1
UNION
rProfileData:: ds PROFILE_SIZE
NEXTU
rProfileName:: ds 3
rSwapABState:: ds 1
rRNGModeState:: ds 1
rRotModeState:: ds 1
rDropModeState:: ds 1
rSpeedCurveState:: ds 1
rAlways20GState:: ds 1
rSelectedStartLevel:: ds 2
rFilterMode:: ds 1
rBGMode:: ds 1
rUnused:: ds (PROFILE_SIZE - 13) ; 13 = sum of the above
ENDU
PROFILE 0
PROFILE 1
PROFILE 2
PROFILE 3
PROFILE 4
PROFILE 5
PROFILE 6
PROFILE 7
PROFILE 8
PROFILE 9
rScoreTableDMGT:: ds (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
rScoreTableTGM1:: ds (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
rScoreTableTGM3:: ds (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
rScoreTableDEAT:: ds (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
rScoreTableSHIR:: ds (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
rScoreTableCHIL:: ds (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
rScoreTableMYCO:: ds (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
SECTION "SRAM Variables", WRAM0
wTarget:: ds 1
SECTION "SRAM Functions", ROM0
; Check if our SRAM is initialized and of the correct version.
; Restores it if so, otherwise initializes it.
RestoreSRAM::
ld a, [rCheck]
cp a, "D"
jp nz, InitializeSRAM
ld a, [rCheck+1]
cp a, "M"
jp nz, InitializeSRAM
ld a, [rCheck+2]
cp a, "G"
jp nz, InitializeSRAM
ld a, [rCheck+3]
cp a, "T"
jp nz, InitializeSRAM
ld a, [rCheck+4]
or a, a
jp nz, InitializeSRAM
ld a, [rCheck+5]
cp a, 4
jp nz, InitializeSRAM
; SRAM is initialized and for this build, so we can load the data.
; We do check for corruption and make sure all the values make sense.
TrustedLoad:
ld a, [rSwapABState]
ld [wSwapABState], a
cp a, BUTTON_MODE_COUNT
jr c, :+
xor a, a
ld [wSwapABState], a
ld [rSwapABState], a
: ld a, [rRNGModeState]
ld [wRNGModeState], a
cp a, RNG_MODE_COUNT
jr c, :+
xor a, a
ld [wRNGModeState], a
ld [rRNGModeState], a
: ld a, [rRotModeState]
ld [wRotModeState], a
cp a, ROT_MODE_COUNT
jr c, :+
xor a, a
ld [wRotModeState], a
ld [rRotModeState], a
: ld a, [rDropModeState]
ld [wDropModeState], a
cp a, DROP_MODE_COUNT
jr c, :+
xor a, a
ld [wDropModeState], a
ld [rDropModeState], a
: ld a, [rSpeedCurveState]
ld [wSpeedCurveState], a
cp a, SCURVE_COUNT
jr c, :+
xor a, a
ld [wSpeedCurveState], a
ld [rSpeedCurveState], a
: ld a, [rAlways20GState]
ld [wAlways20GState], a
cp a, HIG_MODE_COUNT
jr c, :+
xor a, a
ld [wAlways20GState], a
ld [rAlways20GState], a
: ld a, [rFilterMode]
ldh [hFilterMode], a
cp a, FILTER_MODE_COUNT
jr c, :+
xor a, a
ldh [hFilterMode], a
ld [rFilterMode], a
: ld a, [rBGMode]
ld [wBGMode], a
cp a, BG_MODE_COUNT
jr c, :+
xor a, a
ld [wBGMode], a
ld [rBGMode], a
: ld a, [rProfileName]
ld [wProfileName], a
ld a, [rProfileName+1]
ld [wProfileName+1], a
ld a, [rProfileName+2]
ld [wProfileName+2], a
; Restore the start level.
ld b, BANK_OTHER
rst RSTSwitchBank
ld a, [rSelectedStartLevel]
ld c, a
ld a, [rSelectedStartLevel+1]
ld b, a
ld a, [rSpeedCurveState]
ld d, a
add a, d
add a, d
ld e, a
ld d, 0
ld hl, .jumps
add hl, de
ld de, SCURVE_ENTRY_SIZE
jp hl
.jumps
jp .dmgt
jp .tgm1
jp .tgm3
jp .deat
jp .shir
jp .chil
jp .myco
jp .fallback
.dmgt
ld hl, sDMGTSpeedCurve
jp .search
.tgm1
ld hl, sTGM1SpeedCurve
jp .search
.tgm3
ld hl, sTGM3SpeedCurve
jp .search
.deat
ld hl, sDEATSpeedCurve
jp .search
.shir
ld hl, sSHIRSpeedCurve
jp .search
.chil
ld hl, sCHILSpeedCurve
jp .search
.myco
ld hl, sMYCOSpeedCurve
jp .search
.search
; HL = Speed curve table
; BC = Start level
; DE = Speed curve entry size
ld a, [hl+]
cp a, c
jr nz, .notfound
ld a, [hl]
cp a, b
jr nz, .notfound
; Found it!
dec hl
ld a, l
ldh [hStartSpeed], a
ld a, h
ldh [hStartSpeed+1], a
jp RSTRestoreBank
.notfound
dec hl
add hl, de
ld a, [hl]
cp a, $FF
jr nz, .search
.fallback
ld a, SCURVE_DMGT
ld [rSpeedCurveState], a
ld [wSpeedCurveState], a
ld hl, sDMGTSpeedCurve
ld a, l
ldh [hStartSpeed], a
ld a, h
ldh [hStartSpeed+1], a
xor a, a
ld [rSelectedStartLevel], a
ld [rSelectedStartLevel+1], a
jp RSTRestoreBank
; Initializes SRAM with default values.
InitializeSRAM:
; Set the magic id.
ld a, "D"
ld [rCheck], a
ld a, "M"
ld [rCheck+1], a
ld a, "G"
ld [rCheck+2], a
ld a, "T"
ld [rCheck+3], a
xor a, a
ld [rCheck+4], a
ld a, 4
ld [rCheck+5], a
xor a, a
ld [rLastProfile], a
; Load defaults.
ld a, "P"
ld [rProfileName], a
ld [wProfileName], a
ld a, "R"
ld [rProfileName+1], a
ld [wProfileName+1], a
ld a, "0"
ld [rProfileName+2], a
ld [wProfileName+2], a
ld a, BUTTON_MODE_NORM
ld [rSwapABState], a
ld [wSwapABState], a
ld a, RNG_MODE_TGM3
ld [rRNGModeState], a
ld [wRNGModeState], a
ld a, ROT_MODE_ARSTI
ld [rRotModeState], a
ld [wRotModeState], a
ld a, DROP_MODE_FIRM
ld [rDropModeState], a
ld [wDropModeState], a
ld a, SCURVE_DMGT
ld [rSpeedCurveState], a
ld [wSpeedCurveState], a
ld a, HIG_MODE_OFF
ld [rAlways20GState], a
ld [wAlways20GState], a
ld a, FILTER_MODE_DLRU
ld [rFilterMode], a
ldh [hFilterMode], a
ld a, BG_MODE_LITE
ld [rBGMode], a
ld [wBGMode], a
; Set to the default start level.
ld hl, sDMGTSpeedCurve
ld a, l
ldh [hStartSpeed], a
ld a, h
ldh [hStartSpeed+1], a
xor a, a
ld [rSelectedStartLevel], a
ld [rSelectedStartLevel+1], a
; Copy this profile to the other two.
ld hl, rProfileData0
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData1
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData2
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData3
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData4
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData5
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData6
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData7
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData8
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld hl, rProfileData9
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
ld a, "1"
ld [rProfileName1+2], a
ld a, "2"
ld [rProfileName2+2], a
ld a, "3"
ld [rProfileName3+2], a
ld a, "4"
ld [rProfileName4+2], a
ld a, "5"
ld [rProfileName5+2], a
ld a, "6"
ld [rProfileName6+2], a
ld a, "7"
ld [rProfileName7+2], a
ld a, "8"
ld [rProfileName8+2], a
ld a, "9"
ld [rProfileName9+2], a
ld a, 6
ld [wSelected], a
call ResetScores
ld a, 5
ld [wSelected], a
call ResetScores
ld a, 4
ld [wSelected], a
call ResetScores
ld a, 3
ld [wSelected], a
call ResetScores
ld a, 2
ld [wSelected], a
call ResetScores
ld a, 1
ld [wSelected], a
call ResetScores
xor a, a
ld [wSelected], a
; Set the default scores.
ResetScores::
ld a, [wSelected]
ld b, a
add a, b
add a, b
ld c, a
ld b, 0
ld hl, .jumps
add hl, bc
jp hl
.jumps
jp .dmgt
jp .tgm1
jp .tgm3
jp .deat
jp .shir
jp .chil
jp .myco
.dmgt
ld hl, rScoreTableDMGT
ld de, sHiscoreDefaultData
ld bc, (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
jp UnsafeMemCopy
.tgm1
ld hl, rScoreTableTGM1
ld de, sHiscoreDefaultData
ld bc, (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
jp UnsafeMemCopy
.tgm3
ld hl, rScoreTableTGM3
ld de, sHiscoreDefaultData
ld bc, (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
jp UnsafeMemCopy
.deat
ld hl, rScoreTableDEAT
ld de, sHiscoreDefaultData
ld bc, (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
jp UnsafeMemCopy
.shir
ld hl, rScoreTableSHIR
ld de, sHiscoreDefaultData
ld bc, (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
jp UnsafeMemCopy
.chil
ld hl, rScoreTableCHIL
ld de, sHiscoreDefaultData
ld bc, (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
jp UnsafeMemCopy
.myco
ld hl, rScoreTableMYCO
ld de, sHiscoreDefaultData
ld bc, (HISCORE_ENTRY_COUNT * HISCORE_ENTRY_SIZE)
jp UnsafeMemCopy
NextProfile::
ld a, [rLastProfile]
inc a
cp a, 10
jr nz, .update
xor a, a
.update
jp ChangeProfile
; Change to profile number in A.
ChangeProfile::
.backup
ld [wTarget], a
ld a, [rLastProfile]
or a, a
jr z, .first
cp a, 1
jr z, .second
cp a, 2
jr z, .third
cp a, 3
jr z, .fourth
cp a, 4
jr z, .fifth
cp a, 5
jr z, .sixth
cp a, 6
jr z, .seventh
cp a, 7
jr z, .eighth
cp a, 8
jr z, .ninth
cp a, 9
jr z, .tenth
ret
.first
ld hl, rProfileData0
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.second
ld hl, rProfileData1
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.third
ld hl, rProfileData2
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.fourth
ld hl, rProfileData3
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.fifth
ld hl, rProfileData4
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.sixth
ld hl, rProfileData5
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.seventh
ld hl, rProfileData6
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.eighth
ld hl, rProfileData7
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.ninth
ld hl, rProfileData8
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.tenth
ld hl, rProfileData9
ld de, rProfileData
ld bc, 64
call UnsafeMemCopy
jr .restore
.restore
ld a, [wTarget]
ld [rLastProfile], a
or a, a
jr z, .lfirst
cp a, 1
jr z, .lsecond
cp a, 2
jr z, .lthird
cp a, 3
jr z, .lfourth
cp a, 4
jr z, .lfifth
cp a, 5
jr z, .lsixth
cp a, 6
jr z, .lseventh
cp a, 7
jr z, .leighth
cp a, 8
jr z, .lninth
cp a, 9
jp z, .ltenth
ret
.lfirst
ld hl, rProfileData
ld de, rProfileData0
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
.lsecond
ld hl, rProfileData
ld de, rProfileData1
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
.lthird
ld hl, rProfileData
ld de, rProfileData2
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
.lfourth
ld hl, rProfileData
ld de, rProfileData3
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
.lfifth
ld hl, rProfileData
ld de, rProfileData4
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
.lsixth
ld hl, rProfileData
ld de, rProfileData5
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
.lseventh
ld hl, rProfileData
ld de, rProfileData6
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
.leighth
ld hl, rProfileData
ld de, rProfileData7
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
.lninth
ld hl, rProfileData
ld de, rProfileData8
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
.ltenth
ld hl, rProfileData
ld de, rProfileData9
ld bc, 64
call UnsafeMemCopy
jp TrustedLoad
ResetProfile::
ld a, "P"
ld [rProfileName], a
ld [wProfileName], a
ld a, "R"
ld [rProfileName+1], a
ld [wProfileName+1], a
ld a, [rLastProfile]
add a, "0"
ld [rProfileName+2], a
ld [wProfileName+2], a
ld a, BUTTON_MODE_NORM
ld [rSwapABState], a
ld [wSwapABState], a
ld a, RNG_MODE_TGM3
ld [rRNGModeState], a
ld [wRNGModeState], a
ld a, ROT_MODE_ARSTI
ld [rRotModeState], a
ld [wRotModeState], a
ld a, DROP_MODE_FIRM
ld [rDropModeState], a
ld [wDropModeState], a
ld a, SCURVE_DMGT
ld [rSpeedCurveState], a
ld [wSpeedCurveState], a
ld a, HIG_MODE_OFF
ld [rAlways20GState], a
ld [wAlways20GState], a
ld a, FILTER_MODE_DLRU
ld [rFilterMode], a
ldh [hFilterMode], a
; Set to the default start level.
ld hl, sDMGTSpeedCurve
ld a, l
ldh [hStartSpeed], a
ld a, h
ldh [hStartSpeed+1], a
xor a, a
ld [rSelectedStartLevel], a
ld [rSelectedStartLevel+1], a
ret
ENDC

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,70 +0,0 @@
; 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(TILES_ASM)
DEF TILES_ASM EQU 1
INCLUDE "globals.asm"
SECTION "Tile Functions", ROM0
LoadTitleTiles::
ld b, BANK_OTHER
rst RSTSwitchBank
ld de, sSharedTiles
ld hl, _VRAM
ld bc, sSharedTilesEnd - sSharedTiles
call SafeMemCopy
ld de, sTitleTiles
ld hl, _VRAM + (48*16)
ld bc, sTitleTilesEnd - sTitleTiles
call SafeMemCopy
jp RSTRestoreBank
LoadGameplayTiles::
ld b, BANK_OTHER
rst RSTSwitchBank
ld de, sSharedTiles
ld hl, _VRAM
ld bc, sSharedTilesEnd - sSharedTiles
call SafeMemCopy
ld a, [wInitialA]
cp a, $11
jr nz, .dmg
.gbc
ld de, sGameplayTilesC
ld hl, _VRAM + (48*16)
ld bc, sGameplayTilesCEnd - sGameplayTilesC
call SafeMemCopy
jp RSTRestoreBank
.dmg
ld de, sGameplayTilesM
ld hl, _VRAM + (48*16)
ld bc, sGameplayTilesMEnd - sGameplayTilesM
call SafeMemCopy
jp RSTRestoreBank
ENDC

View File

@ -27,273 +27,22 @@ hFrameCtr:: ds 1
hEvenFrame:: ds 1
SECTION "Time Variables", WRAM0
wMinutes:: ds 1
wSeconds:: ds 1
wFrames:: ds 1
wSectionMinutes:: ds 1
wSectionSeconds:: ds 1
wSectionFrames:: ds 1
wCountDown:: ds 2
wCountDownZero:: ds 1
wSectionTimerReset:: ds 1
SECTION "Time Data", ROM0
sFramesToCS::
db $00, $02, $03, $05, $07, $10
db $12, $13, $15, $17, $18, $20
db $22, $23, $25, $27, $28, $30
db $32, $33, $35, $37, $38, $40
db $42, $43, $45, $47, $48, $50
db $52, $53, $55, $57, $58, $60
db $62, $63, $65, $67, $68, $70
db $72, $73, $75, $77, $78, $80
db $82, $83, $85, $87, $88, $90
db $92, $93, $95, $97, $98, $00
SECTION "Time Functions", ROM0
; Zeroes all timers and gets the free-running timer ticking.
TimeInit::
xor a, a
ldh [rTMA], a
ldh [hEvenFrame], a
ldh [hFrameCtr], a
ld [wMinutes], a
ld [wSeconds], a
ld [wFrames], a
ld [wCountDown], a
ld [wCountDown+1], a
ld [wSectionMinutes], a
ld [wSectionSeconds], a
ld [wSectionFrames], a
ld a , $FF
ld [wCountDownZero], a
ld a, TACF_262KHZ | TACF_START
ldh [rTAC], a
ret
; Set the countdown timer (in frames) to start at the number in BC.
StartCountdown::
xor a, a
ld [wCountDownZero], a
dec bc
ld a, c
ld [wCountDown], a
ld a, b
ld [wCountDown+1], a
ret
; Resets the minute-second timer.
ResetGameTime::
xor a, a
ld [wMinutes], a
ld [wSeconds], a
ld [wFrames], a
ld [wSectionMinutes], a
ld [wSectionSeconds], a
ld [wSectionFrames], a
ret
; Checks if the minute-second timer has reached a certain value.
; Call with max minutes in B and max seconds in C.
; A will be $FF if the torikan has succeeded, and $00 otherwise.
CheckTorikan::
; Okay if minutes are less than max minutes.
ld a, [wMinutes]
cp a, b
jr c, .success
; Check seconds if minutes are equal.
jr nz, .failure
; Okay if seconds are less than max seconds.
ld a, [wSeconds]
cp a, c
jr c, .success
; Check frames if seconds are equal.
jr nz, .failure
; Okay if frames are exactly 0.
ld a, [wFrames]
or a, a
jr z, .success
.failure
xor a, a
ret
.success
ld a, $FF
ret
; Increments the global timer. Also saves whether we're on an even frame.
HandleTimers::
ldh a, [hFrameCtr]
inc a
ldh [hFrameCtr], a
and 1
ldh [hEvenFrame], a
ldh a, [hMode]
cp a, MODE_PAUSED
ret z
cp a, MODE_GAME_OVER
ret z
cp a, MODE_PRE_GAME_OVER
ret z
; Get countdown in BC
ld a, [wCountDown]
ld c, a
ld a, [wCountDown+1]
ld b, a
; Is it zero?
or a, c
jr nz, .reduce
ld a , $FF
ld [wCountDownZero], a
jr .clock
.reduce
xor a, a
ld [wCountDownZero], a
dec bc
ld a, c
ld [wCountDown], a
ld a, b
ld [wCountDown+1], a
.clock
ld a, [wKillScreenActive]
cp a, $FF
ret z
ld a, [wMinutes]
cp a, 99
jr nz, .go
ld a, [wSeconds]
cp a, 59
jr nz, .go
ld a, [wFrames]
cp a, 59
ret z
.go
ld a, [wFrames]
inc a
ld [wFrames], a
cp a, 60
ret nz
xor a, a
ld [wFrames], a
ld a, [wSeconds]
inc a
ld [wSeconds], a
cp a, 60
ret nz
xor a, a
ld [wSeconds], a
ld a, [wMinutes]
inc a
ld [wMinutes], a
ret
CheckCOOL_REGRET::
; Okay if minutes are less than max minutes.
ld a, [wSectionMinutes]
cp a, b
jr c, .success
; Check seconds if minutes are equal.
jr nz, .failure
; Okay if seconds are less than max seconds.
ld a, [wSectionSeconds]
cp a, c
jr c, .success
; Check frames if seconds are equal.
jr nz, .failure
; Okay if frames are less than or equal to max frames.
ld a, [wSectionFrames]
cp a, d
jr c, .success
jr z, .success
.failure
xor a, a
ret
.success
ld a, $FF
ret
HandleSectionTimers::
ldh a, [hGameState]
cp a, STATE_TITLE
ret z
ldh a, [hMode]
cp a, MODE_PAUSED
ret z
cp a, MODE_GAME_OVER
ret z
cp a, MODE_PRE_GAME_OVER
ret z
ld a, [wKillScreenActive]
cp a, $FF
ret z
ld a, [hCLevel+CLEVEL_ONES]
cp a, 6
jr c, .continue
xor a, a
ld [wSectionTimerReset], a
.continue
ld a, [wSectionMinutes]
cp a, 99
jr nz, .sectiongo
ld a, [wSectionSeconds]
cp a, 59
jr nz, .sectiongo
ld a, [wSectionFrames]
cp a, 59
ret z
.sectiongo
ld a, [wSectionFrames]
inc a
ld [wSectionFrames], a
cp a, 60
ret nz
xor a, a
ld [wSectionFrames], a
ld a, [wSectionSeconds]
inc a
ld [wSectionSeconds], a
cp a, 60
ret nz
xor a, a
ld [wSectionSeconds], a
ld a, [wSectionMinutes]
inc a
ld [wSectionMinutes], a
ret