Fix build.

This commit is contained in:
Hana Nova 2025-02-26 05:23:26 +01:00
parent d9456244e0
commit 5fad7f347a
8 changed files with 6826 additions and 6872 deletions

2
.vscode/launch.json vendored
View File

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

View File

@ -1,99 +1,54 @@
.SUFFIXES:
################################################
# #
# CONSTANT DEFINITIONS #
# #
################################################
# Directory constants
BINDIR := bin
OBJDIR := obj
DEPDIR := dep
# Program constants
ifneq ($(strip $(shell which rm)),)
# POSIX OSes
RM_RF := rm -rf
MKDIR_P := mkdir -p
PY :=
filesize = printf 'NB_PB$2_BLOCKS equ ((%u) + $2 - 1) / $2\n' "`wc -c <$1`"
else
# Windows outside of a POSIX env (Cygwin, MSYS2, etc.)
# We need Powershell to get any sort of decent functionality
$(warning Powershell is required to get basic functionality)
RM_RF := -del /q
RM_RF := rm -rf
MKDIR_P := mkdir -p
ifeq ($(strip $(shell which rm)),)
RM_RF := -rmdir /s /q
MKDIR_P := -mkdir
PY := python
filesize = powershell Write-Output $$('NB_PB$2_BLOCKS equ ' + [string] [int] (([IO.File]::ReadAllBytes('$1').Length + $2 - 1) / $2))
endif
# Shortcut if you want to use a local copy of RGBDS
RGBDS :=
RGBDS ?=
RGBASM := $(RGBDS)rgbasm
RGBLINK := $(RGBDS)rgblink
RGBFIX := $(RGBDS)rgbfix
RGBGFX := $(RGBDS)rgbgfx
ROM = $(BINDIR)/$(ROMNAME).$(ROMEXT)
ROM = bin/$(ROMNAME).$(ROMEXT)
# Argument constants
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)
ASFLAGS = -p ${PADVALUE} $(addprefix -I,${INCDIRS}) $(addprefix -W,${WARNINGS})
LDFLAGS = -p ${PADVALUE}
FIXFLAGS = -p ${PADVALUE} -i "${GAMEID}" -k "${LICENSEE}" -l ${OLDLIC} -m ${MBC} -n ${VERSION} -r ${SRAMSIZE} -t ${TITLE}
# The list of "root" ASM files that RGBASM will be invoked on
SRCS = $(wildcard src/*.asm)
## Project-specific configuration
# Use this to override the above
include project.mk
# `all` (Default target): build the ROM
all: $(ROM)
.PHONY: all
# `clean`: Clean temp and bin files
clean:
$(RM_RF) $(BINDIR)
$(RM_RF) $(OBJDIR)
$(RM_RF) $(DEPDIR)
$(RM_RF) res
$(RM_RF) dep obj bin
.PHONY: clean
# `rebuild`: Build everything from scratch
# It's important to do these two in order if we're using more than one job
rebuild:
$(MAKE) clean
$(MAKE) all
.PHONY: rebuild
bin/%.${ROMEXT}: $(patsubst src/%.asm,obj/%.o,${SRCS})
@${MKDIR_P} "${@D}"
${RGBLINK} ${LDFLAGS} -m bin/$*.map -n bin/$*.sym -o $@ $^ \
&& ${RGBFIX} -v ${FIXFLAGS} $@
obj/%.mk: src/%.asm
@${MKDIR_P} "${@D}"
${RGBASM} ${ASFLAGS} -M $@ -MG -MP -MQ ${@:.mk=.o} -MQ $@ -o ${@:.mk=.o} $<
# 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) $^ \
&& $(RGBFIX) -v $(FIXFLAGS) $(BINDIR)/$*.$(ROMEXT)
obj/%.o: obj/%.mk
@touch $@
# `.mk` files are auto-generated dependency lists of the "root" ASM files, to save a lot of hassle.
# Also add all obj dependencies to the dep file too, so Make knows to remake it
# Caution: some of these flags were added in RGBDS 0.4.0, using an earlier version WILL NOT WORK
# (and produce weird errors)
$(OBJDIR)/%.o $(DEPDIR)/%.mk: src/%.asm
@$(MKDIR_P) $(patsubst %/,%,$(dir $(OBJDIR)/$* $(DEPDIR)/$*))
$(RGBASM) $(ASFLAGS) -M $(DEPDIR)/$*.mk -MG -MP -MQ $(OBJDIR)/$*.o -MQ $(DEPDIR)/$*.mk -o $(OBJDIR)/$*.o $<
ifneq ($(MAKECMDGOALS),clean)
-include $(patsubst src/%.asm,$(DEPDIR)/%.mk,$(SRCS))
ifeq ($(filter clean,${MAKECMDGOALS}),)
include $(patsubst src/%.asm,obj/%.mk,${SRCS})
endif
# Catch non-existent files
# KEEP THIS LAST!!
%:
@false

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -72,8 +72,8 @@
00:1153 GBCBigGameplayProcess.wvr_u7
00:1160 GBCBigGameplayProcess.white
00:1167 GBCBigGameplayProcess.wvr_u8
00:1174 ToVRAM
00:1174 GBCBlitField
00:1174 ToVRAM
00:11a6 BlitField
00:1369 BlitField.waitendvbloop
00:1593 BigBlitField
@ -81,8 +81,8 @@
00:1980 SetPal
00:198d SetPal.darker
00:1993 SetPal.lighter
00:1999 ApplyTells
00:1999 SetPal.setpal
00:1999 ApplyTells
00:19d7 ApplyTells.myco
00:19dc ApplyTells.dropmode
00:1a00 ApplyNext
@ -209,8 +209,8 @@
00:26e7 LevelUp.bellmaybe
00:2703 LevelUp.leveljinglemaybe
00:2713 AdjustSpeedCurve
00:2719 AdjustSpeedCurve.docheck
00:2719 AdjustSpeedCurve.checkthousands
00:2719 AdjustSpeedCurve.docheck
00:2728 AdjustSpeedCurve.checkhundreds
00:2735 AdjustSpeedCurve.checktens
00:2744 AdjustSpeedCurve.checkones
@ -401,8 +401,8 @@
00:38ba TGM3REGRETHandler
00:38c3 TGM3COOLHandler
00:38cc UnsafeMemCopy
00:38d5 SafeMemCopy.wvr_u1
00:38d5 SafeMemCopy
00:38d5 SafeMemCopy.wvr_u1
00:38e4 UnsafeMemSet
00:38ec SafeMemSet
00:38ec SafeMemSet.wvr_u2
@ -440,12 +440,12 @@
01:4945 sMYCOSpeedCurveEnd
01:4947 sMYCOSpeedCurveSpecialData
01:4954 sSharedTiles
01:4c54 sTitleTiles
01:4c54 sSharedTilesEnd
01:4c54 sTitleTiles
01:5954 sTitleTilesEnd
01:5954 sGameplayTilesM
01:6654 sGameplayTilesMEnd
01:6654 sGameplayTilesC
01:6654 sGameplayTilesMEnd
01:7354 sGameplayTilesCEnd
02:4008 sSFXPieceI
02:4325 sSFXPieceZ
@ -1939,8 +1939,8 @@
04:6b99 sGameplayUngradedTileMapEnd
04:6b99 GradeInitB
04:6be9 GradeInitB.grade9start
04:6bee UpdateGradeB
04:6bee GradeInitB.end
04:6bee UpdateGradeB
04:6bfc UpdateGradeB.gradejumptable
04:6c11 DecayGradeProcessB
04:6c1f DecayGradeProcessB.gradejumptable
@ -2964,8 +2964,8 @@
00:a7c7 rScoreTableSHIR
00:a907 rScoreTableCHIL
00:aa47 rScoreTableMYCO
00:c000 wShadowTilemap
00:c400 wShadowTileAttrs
00:c000 wShadowTileAttrs
00:c400 wShadowTilemap
00:c800 wShadowOAM
00:c800 wSPRNext1
00:c804 wSPRNext2
@ -3069,48 +3069,48 @@
00:cf20 wShouldGoStaffRoll
00:cf21 wNoMoreLocks
00:cf22 wSkippedSectionsBCD
00:cf23 wProgress0B1
00:cf24 wProgress0B2
00:cf25 wProgress1B1
00:cf26 wProgress1B2
00:cf27 wProgress2B1
00:cf28 wProgress2B2
00:cf29 wProgress3B1
00:cf2a wProgress3B2
00:cf2b wProgress4B1
00:cf2c wProgress4B2
00:cf2d wSwapABState
00:cf2e wRNGModeState
00:cf2f wRotModeState
00:cf30 wDropModeState
00:cf31 wSpeedCurveState
00:cf32 wAlways20GState
00:cf33 wBGMode
00:cf34 wInitialA
00:cf35 wInitialB
00:cf36 wInitialC
00:cf37 wMinutes
00:cf38 wSeconds
00:cf39 wFrames
00:cf3a wSectionMinutes
00:cf3b wSectionSeconds
00:cf3c wSectionFrames
00:cf3d wCountDown
00:cf3f wCountDownZero
00:cf40 wSectionTimerReset
00:cf23 wMinutes
00:cf24 wSeconds
00:cf25 wFrames
00:cf26 wSectionMinutes
00:cf27 wSectionSeconds
00:cf28 wSectionFrames
00:cf29 wCountDown
00:cf2b wCountDownZero
00:cf2c wSectionTimerReset
00:cf2d wProgress0B1
00:cf2e wProgress0B2
00:cf2f wProgress1B1
00:cf30 wProgress1B2
00:cf31 wProgress2B1
00:cf32 wProgress2B2
00:cf33 wProgress3B1
00:cf34 wProgress3B2
00:cf35 wProgress4B1
00:cf36 wProgress4B2
00:cf37 wSwapABState
00:cf38 wRNGModeState
00:cf39 wRotModeState
00:cf3a wDropModeState
00:cf3b wSpeedCurveState
00:cf3c wAlways20GState
00:cf3d wBGMode
00:cf3e wInitialA
00:cf3f wInitialB
00:cf40 wInitialC
00:cf41 wSelected
00:cf42 wTitleMode
00:cf43 wProfileName
00:cf46 wDisplayingScoreMode
00:cf47 wScoreFlipTimer
00:cf48 wCurrentBank
00:cf49 wBankSwitchTarget
00:cf4a wPlayHeadTarget
00:cf4c wBankBackup
00:cf50 wRollLine
00:cf51 wInStaffRoll
00:cf52 wBigModeTransfered
00:cf53 wGameOverIgnoreInput
00:cf48 wRollLine
00:cf49 wInStaffRoll
00:cf4a wBigModeTransfered
00:cf4b wGameOverIgnoreInput
00:cf4c wCurrentBank
00:cf4d wBankSwitchTarget
00:cf4e wPlayHeadTarget
00:cf50 wBankBackup
00:cf54 wOuterReps
00:cf55 wInnerReps
00:cf56 wTarget
@ -3171,19 +3171,19 @@
00:ffdd hPrePause
00:ffde hRequestedJingle
00:ffdf hOAMDMA
00:ffe9 hUpState
00:ffea hDownState
00:ffeb hLeftState
00:ffec hRightState
00:ffed hAState
00:ffee hBState
00:ffef hStartState
00:fff0 hSelectState
00:fff1 hFilterMode
00:fff2 hPlayhead
00:fff4 hCurrentlyPlaying
00:fff5 hPlayQueue
00:fff9 hNoisePlayhead
00:ffe9 hPlayhead
00:ffeb hCurrentlyPlaying
00:ffec hPlayQueue
00:fff0 hNoisePlayhead
00:fff2 hUpState
00:fff3 hDownState
00:fff4 hLeftState
00:fff5 hRightState
00:fff6 hAState
00:fff7 hBState
00:fff8 hStartState
00:fff9 hSelectState
00:fffa hFilterMode
00:fffb hFrameCtr
00:fffc hEvenFrame
00:fffd hGameState

16
deploy.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
echo "Cleaning..."
make clean >/dev/null
echo "Making pocket version."
rm src/include/hardware.inc >/dev/null
cp src/include/hardware.analogue src/include/hardware.inc >/dev/null
make >/dev/null
echo "Fixing pocket version."
mv bin/PandorasBlocks.gbc bin/PandorasBlocks.pocket >/dev/null
python patch_pocket.py >/dev/null
rgbfix -fhg -O bin/PandorasBlocks.pocket >/dev/null
echo "Making regular version."
rm -rf obj >/dev/null
rm src/include/hardware.inc >/dev/null
cp src/include/hardware.nintendo src/include/hardware.inc >/dev/null
make >/dev/null

View File

@ -1,29 +1,12 @@
# ROM Version
PADVALUE := 0xFF
VERSION := 0x01
# 4 Character Game ID
GAMEID := DTGM
# ROM Title (14 chars max)
TITLE := DMGTRIS
# "Licensee" code (2 chars)
LICENSEE := NR
# Output options
OLDLIC := 0x33
MBC := 0x1B
SRAMSIZE := 0x04
ROMNAME := PandorasBlocks
ROMEXT := gbc
# Mapper
MAPPER := 0x1B
# Extra assembler flags
# Do not insert nop after halt
ASFLAGS += -h
# 8.24 fixed point.
ASFLAGS += -Q 25
# Extra fix flags
# Set as gbc compatible
FIXFLAGS += -c