refactor multiboot folder

This commit is contained in:
Oliver Bell committed 2023-05-14 02:50:38 +01:00
1 parent b2041cb18b
commit 05c349d399
86 files changed
+120 -2565

No files matched your search

+16 -12
View File
@@ -173,9 +173,9 @@ compare: rom
clean: tidy clean-tools
@$(MAKE) clean -C chao_garden
@$(MAKE) clean -C multi_boot/subgame_loader
@$(MAKE) clean -C multi_boot/subgame_loader_2
@$(MAKE) clean -C multi_boot/signed_collect_rings
@$(MAKE) clean -C multi_boot/subgame_bootstrap
@$(MAKE) clean -C multi_boot/programs/subgame_loader
@$(MAKE) clean -C multi_boot/collect_rings
$(RM) $(SAMPLE_SUBDIR)/*.bin $(MID_SUBDIR)/*.s
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec $(RM) {} +
@@ -185,6 +185,7 @@ clean-tools:
tidy:
$(RM) -f $(ROM) $(ELF) $(MAP)
$(RM) -f $(BUILD_NAME)_europe.gba $(BUILD_NAME)_europe.elf $(BUILD_NAME)_europe.map
$(RM) -r build/*
#### Recipes ####
@@ -274,17 +275,20 @@ chao_garden/mb_chao_garden.gba:
chao_garden: tools
$(MAKE) -C chao_garden
multi_boot/subgame_loader/mb_subgame_loader.gba:
$(MAKE) -C multi_boot/subgame_loader
multi_boot/subgame_bootstrap/subgame_bootstrap.gba:
$(MAKE) -C multi_boot/subgame_bootstrap
multi_boot/subgame_loader_2/mb_subgame_loader_2.gba:
$(MAKE) -C multi_boot/subgame_loader_2
multi_boot/programs/subgame_loader/subgame_loader.bin:
$(MAKE) -C multi_boot/programs/subgame_loader
multi_boot/signed_collect_rings/mb_signed_collect_rings.gba:
$(MAKE) -C multi_boot/signed_collect_rings
multi_boot/collect_rings/mb_signed_collect_rings.gba:
$(MAKE) -C multi_boot/collect_rings
subgame_bootstrap: tools
$(MAKE) -C multi_boot/subgame_bootstrap
subgame_loader: tools
$(MAKE) -C multi_boot/subgame_loader
$(MAKE) -C multi_boot/programs/subgame_loader
subgame_loader_2: tools
$(MAKE) -C multi_boot/subgame_loader_2
collect_rings: tools
$(MAKE) -C multi_boot/collect_rings
+1 -4
View File
@@ -36,8 +36,5 @@ gUnknown_08CB41C0:
.global gUnknown_08CBAC04
gUnknown_08CBAC04:
.incbin "multi_boot/signed_collect_rings/mb_signed_collect_rings.gba.lz"
.incbin "multi_boot/collect_rings/mb_signed_collect_rings.gba.lz"
.global gUnknown_08CD0728
gUnknown_08CD0728:
.incbin "multi_boot/subgame_loader_2/mb_subgame_loader_2.gba.lz"
+6 -1
View File
@@ -1,5 +1,10 @@
.section .rodata
@; Not really sure why this is here
.global gUnknown_08CD0728
gUnknown_08CD0728:
.incbin "multi_boot/programs/subgame_loader/subgame_loader.bin.lz"
.global gMultiBootProgram_SubgameLoader
gMultiBootProgram_SubgameLoader:
.incbin "multi_boot/subgame_loader/mb_subgame_loader.gba"
.incbin "multi_boot/subgame_bootstrap/subgame_bootstrap.gba"
@@ -88,7 +88,7 @@ compare: $(ROM)
$(SHA1) $(BUILD_NAME).sha1
clean: tidy
@$(MAKE) clean -C collect_rings
@$(MAKE) clean -C ../roms/collect_rings
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec $(RM) {} +
tidy:
@@ -128,5 +128,5 @@ $(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep)
@echo "$(AS) <flags> -o $@ $<"
@$(PREPROC) $< | $(CPP) $(CPPFLAGS) - | $(AS) $(ASFLAGS) -o $@
collect_rings/collect_rings.gba:
$(MAKE) -C collect_rings
../roms/collect_rings/collect_rings.gba:
$(MAKE) -C ../roms/collect_rings
+1
View File
@@ -0,0 +1 @@
# MultiBoot Collect Rings
File renamed without changes.
@@ -5,4 +5,4 @@
.global gCollectRingsRom
gCollectRingsRom: @ 0x20000C0
.incbin "collect_rings/collect_rings.gba"
.incbin "../roms/collect_rings/collect_rings.gba"
@@ -0,0 +1 @@
subgame_loader
@@ -32,24 +32,24 @@ endif
SHELL := /bin/bash -o pipefail
SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c
CC1 := ../../../../tools/agbcc/bin/agbcc$(EXE)
CC1_OLD := ../../../../tools/agbcc/bin/old_agbcc$(EXE)
CC1 := ../../../tools/agbcc/bin/agbcc$(EXE)
CC1_OLD := ../../../tools/agbcc/bin/old_agbcc$(EXE)
CPP := $(PREFIX)cpp
LD := $(PREFIX)ld
OBJCOPY := $(PREFIX)objcopy
AS := $(PREFIX)as
GFX := ../../../../tools/gbagfx/gbagfx$(EXE)
AIF := ../../../../tools/aif2pcm/aif2pcm$(EXE)
MID2AGB := ../../../../tools/mid2agb/mid2agb$(EXE)
SCANINC := ../../../../tools/scaninc/scaninc$(EXE)
PREPROC := ../../../../tools/preproc/preproc$(EXE)
RAMSCRGEN := ../../../../tools/ramscrgen/ramscrgen$(EXE)
FIX := ../../../../tools/gbafix/gbafix$(EXE)
GFX := ../../../tools/gbagfx/gbagfx$(EXE)
AIF := ../../../tools/aif2pcm/aif2pcm$(EXE)
MID2AGB := ../../../tools/mid2agb/mid2agb$(EXE)
SCANINC := ../../../tools/scaninc/scaninc$(EXE)
PREPROC := ../../../tools/preproc/preproc$(EXE)
RAMSCRGEN := ../../../tools/ramscrgen/ramscrgen$(EXE)
FIX := ../../../tools/gbafix/gbafix$(EXE)
CC1FLAGS := -mthumb-interwork -Wimplicit -Wparentheses -O2 -fhex-asm -Werror
CPPFLAGS := -I ../../../../tools/agbcc/include -iquote include -nostdinc -D $(GAME_REGION) -D GAME_TITLE=$(TITLE) -D GAME_CODE=$(GAME_CODE)
CPPFLAGS := -I ../../../tools/agbcc/include -iquote include -nostdinc -D $(GAME_REGION) -D GAME_TITLE=$(TITLE) -D GAME_CODE=$(GAME_CODE)
ASFLAGS := -mcpu=arm7tdmi -mthumb-interwork --defsym $(GAME_REGION)=1 --defsym GAME_TITLE=$(TITLE) --defsym GAME_CODE=$(GAME_CODE)
@@ -64,10 +64,10 @@ ASFLAGS := -mcpu=arm7tdmi -mthumb-interwork --defsym $(GAME_REGION)=1 --defsym
.SECONDEXPANSION:
#### Files ####
OBJ_DIR:= build/payload
ROM := payload.gba
ELF := $(ROM:.gba=.elf)
MAP := $(ROM:.gba=.map)
OBJ_DIR:= build/subgame_loader
PROG := subgame_loader.bin
ELF := $(PROG:.bin=.elf)
MAP := $(PROG:.bin=.map)
LDSCRIPT := ldscript.txt
C_SUBDIR = src
@@ -124,7 +124,7 @@ endif
MAKEFLAGS += --no-print-directory
compare: $(ROM)
compare: $(PROG)
$(SHA1) $(BUILD_NAME).sha1
clean: tidy
@@ -132,7 +132,7 @@ clean: tidy
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec $(RM) {} +
tidy:
$(RM) -f $(ROM) $(ELF) $(MAP)
$(RM) -f $(PROG) $(ELF) $(MAP)
$(RM) -r build/*
#### Recipes ####
@@ -155,9 +155,9 @@ tidy:
$(ELF): $(OBJS) $(LDSCRIPT)
@echo "$(LD) -T $(LD_SCRIPT) -Map $(MAP) <objects> <lib>"
@$(LD) -T $(LDSCRIPT) -Map $(MAP) $(OBJS) ../../../../tools/agbcc/lib/libgcc.a ../../../../tools/agbcc/lib/libc.a -o $@
@$(LD) -T $(LDSCRIPT) -Map $(MAP) $(OBJS) ../../../tools/agbcc/lib/libgcc.a ../../../tools/agbcc/lib/libc.a -o $@
%.gba: %.elf
$(PROG): $(ELF)
$(OBJCOPY) -O binary $< $@
ifeq ($(NODEP),1)
@@ -1,5 +1,5 @@
.include "../../../../asm/macros/function.inc"
.include "../../../../constants/gba_constants.inc"
.include "../../../asm/macros/function.inc"
.include "../../../constants/gba_constants.inc"
.syntax unified
.arm
@@ -1,5 +1,5 @@
.include "../../../../asm/macros/function.inc"
.include "../../../../constants/gba_constants.inc"
.include "../../../asm/macros/function.inc"
.include "../../../constants/gba_constants.inc"
.syntax unified
.arm
@@ -1,6 +1,6 @@
.include "../../../../asm/macros/function.inc"
.include "../../../../constants/gba_constants.inc"
.include "../../../../constants/multi_sio_constants.inc"
.include "../../../asm/macros/function.inc"
.include "../../../constants/gba_constants.inc"
.include "../../../constants/multi_sio_constants.inc"
.syntax unified
@@ -10,7 +10,7 @@ COMPARE ?= 1
MAKER_CODE := 8P
# Version
BUILD_NAME := payload
BUILD_NAME := subgame_loader
TITLE := SONICADVANC2
GAME_CODE := A2N
@@ -8,12 +8,12 @@ SECTIONS {
. = 0x203B000;
.text :
ALIGN(4) {
build/payload/asm/crt0.o(.text);
build/payload/asm/multi_sio_asm.o(.text);
build/payload/src/main.o(.text);
build/payload/src/multi_sio.o(.text);
build/payload/src/sio32_multi_load.o(.text);
build/payload/asm/libagbsyscall.o(.text);
build/subgame_loader/asm/crt0.o(.text);
build/subgame_loader/asm/multi_sio_asm.o(.text);
build/subgame_loader/src/main.o(.text);
build/subgame_loader/src/multi_sio.o(.text);
build/subgame_loader/src/sio32_multi_load.o(.text);
build/subgame_loader/asm/libagbsyscall.o(.text);
*libgcc.a:_call_via_rX.o(.text);
*libgcc.a:_udivsi3.o(.text);
*libgcc.a:_dvmd_tls.o(.text);
@@ -22,20 +22,20 @@ SECTIONS {
.rodata :
ALIGN(4) {
build/payload/src/main.o(.rodata);
build/payload/src/multi_sio.o(.rodata);
build/payload/src/sio32_multi_load.o(.rodata);
build/payload/src/loader_tables.o(.rodata);
build/payload/data/data.o(.rodata);
build/subgame_loader/src/main.o(.rodata);
build/subgame_loader/src/multi_sio.o(.rodata);
build/subgame_loader/src/sio32_multi_load.o(.rodata);
build/subgame_loader/src/loader_tables.o(.rodata);
build/subgame_loader/data/data.o(.rodata);
}
. = 0x03000000;
IWRAM (NOLOAD) :
ALIGN(4)
{
build/payload/src/main.o(.data);
build/payload/src/multi_sio.o(.data);
build/payload/src/sio32_multi_load.o(COMMON);
build/subgame_loader/src/main.o(.data);
build/subgame_loader/src/multi_sio.o(.data);
build/subgame_loader/src/sio32_multi_load.o(COMMON);
}
/* DWARF debug sections.
@@ -0,0 +1 @@
ccf732e280d4aa8ee042aefb4f30d121307b3d6f subgame_loader.bin
@@ -0,0 +1 @@
01d2dd855d639c5ada616d53991599d25e5ac113 subgame_loader.bin
@@ -57,8 +57,8 @@ ASFLAGS := -mcpu=arm7tdmi -mthumb-interwork --defsym $(GAME_REGION)=1
.SECONDEXPANSION:
#### Files ####
OBJ_DIR:= build/signed_payload
ROM := signed_payload.gba
OBJ_DIR:= build/subgame_loader
ROM := subgame_loader.gba
ELF := $(ROM:.gba=.elf)
MAP := $(ROM:.gba=.map)
LDSCRIPT := ldscript.txt
@@ -88,7 +88,7 @@ compare: $(ROM)
$(SHA1) $(BUILD_NAME).sha1
clean: tidy
@$(MAKE) clean -C payload
@$(MAKE) clean -C ../../programs/subgame_loader
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec $(RM) {} +
tidy:
@@ -129,6 +129,5 @@ $(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep)
@echo "$(AS) <flags> -o $@ $<"
@$(PREPROC) $< | $(CPP) $(CPPFLAGS) - | $(AS) $(ASFLAGS) -o $@
payload/payload.gba:
$(MAKE) -C payload GAME_REGION=$(GAME_REGION)
../../programs/subgame_loader/subgame_loader.bin:
$(MAKE) -C ../../programs/subgame_loader
@@ -10,7 +10,7 @@ COMPARE ?= 1
MAKER_CODE := 8P
# Version
BUILD_NAME := signed_payload
BUILD_NAME := subgame_loader
TITLE := SONICADVANC2
GAME_CODE := A2N
@@ -0,0 +1,8 @@
.include "../../../asm/macros/function.inc"
.include "../../../constants/gba_constants.inc"
.section .rodata
.global gSubgameLoader
gSubgameLoader: @ 0x2000370
.incbin "../../programs/subgame_loader/subgame_loader.bin.lz"
@@ -2,12 +2,12 @@ SECTIONS {
. = 0x20001B0;
.text :
ALIGN(4) {
build/signed_payload/asm/rom_header.o(.text);
build/subgame_loader/asm/rom_header.o(.text);
}
.rodata :
ALIGN(4) {
build/signed_payload/data/data.o(.rodata);
build/subgame_loader/data/data.o(.rodata);
}
/* DWARF debug sections.
@@ -0,0 +1 @@
f930a4d7cb2a514bf827e9145aed9c7e2761ad79 subgame_loader.gba
@@ -0,0 +1 @@
2a571835adcf4041e51a126480e78b55735a3923 subgame_loader.gba
@@ -57,8 +57,8 @@ ASFLAGS := -mcpu=arm7tdmi -mthumb-interwork --defsym $(GAME_REGION)=1
.SECONDEXPANSION:
#### Files ####
OBJ_DIR:= build/mb_subgame_loader
ROM := mb_subgame_loader.gba
OBJ_DIR:= build/subgame_bootstrap
ROM := subgame_bootstrap.gba
ELF := $(ROM:.gba=.elf)
MAP := $(ROM:.gba=.map)
LDSCRIPT := ldscript.txt
@@ -88,7 +88,7 @@ compare: $(ROM)
$(SHA1) $(BUILD_NAME).sha1
clean: tidy
@$(MAKE) clean -C signed_payload
@$(MAKE) clean -C ../roms/subgame_loader
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec $(RM) {} +
tidy:
@@ -128,5 +128,5 @@ $(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep)
@echo "$(AS) <flags> -o $@ $<"
@$(PREPROC) $< | $(CPP) $(CPPFLAGS) - | $(AS) $(ASFLAGS) -o $@
signed_payload/signed_payload.gba:
$(MAKE) -C signed_payload GAME_REGION=$(GAME_REGION)
../roms/subgame_loader/subgame_loader.gba:
$(MAKE) -C ../roms/subgame_loader
File renamed without changes.
@@ -60,7 +60,7 @@ _02000160:
bne _02000160
mov r1, #0
strh r1, [r0, #0xa]
ldr r0, _020001A8 @ =gSignedPayload + 0x1C0
ldr r0, _020001A8 @ =gSubgameLoaderRom + 0x1C0
ldr r1, _020001AC @ =gUnknown_0203B000
svc #0x110000
@@ -70,5 +70,5 @@ _02000160:
.align 2, 0
_020001A0: .4byte 0x04000120
_020001A4: .4byte 0x020000AC
_020001A8: .4byte gSignedPayload + 0x1C0
_020001A8: .4byte gSubgameLoaderRom + 0x1C0
_020001AC: .4byte gUnknown_0203B000
@@ -10,7 +10,7 @@ COMPARE ?= 1
MAKER_CODE := 8P
# Version
BUILD_NAME := mb_subgame_loader
BUILD_NAME := subgame_bootstrap
TITLE := SONICADVANC2
GAME_CODE := A2N
+8
View File
@@ -0,0 +1,8 @@
.include "../../asm/macros/function.inc"
.include "../../constants/gba_constants.inc"
.section .rodata
.global gSubgameLoaderRom
gSubgameLoaderRom: @ 0x20001B0
.incbin "../roms/subgame_loader/subgame_loader.gba"
@@ -2,13 +2,13 @@ SECTIONS {
. = 0x2000000;
.text :
ALIGN(4) {
build/mb_subgame_loader/asm/rom_header.o(.text);
build/mb_subgame_loader/asm/loader.o(.text);
build/subgame_bootstrap/asm/rom_header.o(.text);
build/subgame_bootstrap/asm/loader.o(.text);
}
.rodata :
ALIGN(4) {
build/mb_subgame_loader/data/data.o(.rodata);
build/subgame_bootstrap/data/data.o(.rodata);
}
. = 0x2000000;
@@ -0,0 +1 @@
01156e4a03d1fa8bada0f1bfe2d37b39e77452e3 subgame_bootstrap.gba
@@ -0,0 +1 @@
eafcc61271285525f05663fb38e2c81652a05db6 subgame_bootstrap.gba
-8
View File
@@ -1,8 +0,0 @@
.include "../../asm/macros/function.inc"
.include "../../constants/gba_constants.inc"
.section .rodata
.global gSignedPayload
gSignedPayload: @ 0x20001B0
.incbin "signed_payload/signed_payload.gba"
@@ -1 +0,0 @@
01156e4a03d1fa8bada0f1bfe2d37b39e77452e3 mb_subgame_loader.gba
@@ -1 +0,0 @@
eafcc61271285525f05663fb38e2c81652a05db6 mb_subgame_loader.gba
@@ -1,8 +0,0 @@
.include "../../../asm/macros/function.inc"
.include "../../../constants/gba_constants.inc"
.section .rodata
.global gPayload
gSignedPayload: @ 0x2000370
.incbin "payload/payload.gba.lz"
@@ -1 +0,0 @@
ccf732e280d4aa8ee042aefb4f30d121307b3d6f payload.gba
@@ -1 +0,0 @@
01d2dd855d639c5ada616d53991599d25e5ac113 payload.gba
@@ -1 +0,0 @@
f930a4d7cb2a514bf827e9145aed9c7e2761ad79 signed_payload.gba
@@ -1 +0,0 @@
2a571835adcf4041e51a126480e78b55735a3923 signed_payload.gba
-130
View File
@@ -1,130 +0,0 @@
TOOLCHAIN := $(DEVKITARM)
COMPARE ?= 0
ifeq (compare,$(MAKECMDGOALS))
COMPARE := 1
endif
# don't use dkP's base_tools anymore
# because the redefinition of $(CC) conflicts
# with when we want to use $(CC) to preprocess files
# thus, manually create the variables for the bin
# files, or use arm-none-eabi binaries on the system
# if dkP is not installed on this system
ifneq (,$(TOOLCHAIN))
ifneq ($(wildcard $(TOOLCHAIN)/bin),)
export PATH := $(TOOLCHAIN)/bin:$(PATH)
endif
endif
PREFIX := arm-none-eabi-
include config.mk
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
#### Tools ####
SHELL := /bin/bash -o pipefail
SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c
LD := $(PREFIX)ld
OBJCOPY := $(PREFIX)objcopy
AS := $(PREFIX)as
GFX := ../../tools/gbagfx/gbagfx$(EXE)
AIF := ../../tools/aif2pcm/aif2pcm$(EXE)
SCANINC := ../../tools/scaninc/scaninc$(EXE)
PREPROC := ../../tools/preproc/preproc$(EXE)
RAMSCRGEN := ../../tools/ramscrgen/ramscrgen$(EXE)
FIX := ../../tools/gbafix/gbafix$(EXE)
ASFLAGS := -mcpu=arm7tdmi -mthumb-interwork --defsym $(GAME_REGION)=1
# Clear the default suffixes
.SUFFIXES:
# Don't delete intermediate files
.SECONDARY:
# Delete files that weren't built properly
.DELETE_ON_ERROR:
# Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION:
#### Files ####
OBJ_DIR:= build/mb_subgame_loader_2
ROM := mb_subgame_loader_2.gba
ELF := $(ROM:.gba=.elf)
MAP := $(ROM:.gba=.map)
LDSCRIPT := ldscript.txt
ASM_SUBDIR = asm
DATA_ASM_SUBDIR = data
ASM_BUILDDIR = $(OBJ_DIR)/$(ASM_SUBDIR)
DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR)
$(shell mkdir -p $(ASM_BUILDDIR) $(DATA_ASM_BUILDDIR))
ASM_SRCS := $(wildcard $(ASM_SUBDIR)/*.s)
ASM_OBJS := $(patsubst $(ASM_SUBDIR)/%.s,$(ASM_BUILDDIR)/%.o,$(ASM_SRCS))
DATA_ASM_SRCS := $(wildcard $(DATA_ASM_SUBDIR)/*.s)
DATA_ASM_OBJS := $(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o,$(DATA_ASM_SRCS))
OBJS := $(ASM_OBJS) $(DATA_ASM_OBJS)
OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS))
#### Main Targets ####
MAKEFLAGS += --no-print-directory
compare: $(ROM)
$(SHA1) $(BUILD_NAME).sha1
clean: tidy
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec $(RM) {} +
tidy:
$(RM) -f $(ROM) $(ELF) $(MAP)
$(RM) -r build/*
#### Recipes ####
%.s: ;
$(ELF): $(OBJS) $(LDSCRIPT)
@echo "$(LD) -T $(LD_SCRIPT) -Map $(MAP) <objects> <lib>"
@$(LD) -T $(LDSCRIPT) -Map $(MAP) $(OBJS) ../../tools/agbcc/lib/libgcc.a ../../tools/agbcc/lib/libc.a -o $@
%.gba: %.elf
$(OBJCOPY) -O binary $< $@
ifeq ($(NODEP),1)
$(ASM_BUILDDIR)/%.o: asm_dep :=
else
$(ASM_BUILDDIR)/%.o: asm_dep = $(shell $(SCANINC) $(ASM_SUBDIR)/$*.s)
endif
$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s $$(asm_dep)
@echo "$(AS) <flags> -o $@ $<"
@$(AS) $(ASFLAGS) -o $@ $<
ifeq ($(NODEP),1)
$(DATA_ASM_BUILDDIR)/%.o: data_dep :=
else
$(DATA_ASM_BUILDDIR)/%.o: data_dep = $(shell $(SCANINC) $(DATA_ASM_SUBDIR)/$*.s)
endif
$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep)
@echo "$(AS) <flags> -o $@ $<"
@$(PREPROC) $< | $(CPP) $(CPPFLAGS) - | $(AS) $(ASFLAGS) -o $@
# signed_payload/signed_payload.gba:
# $(MAKE) -C signed_payload GAME_REGION=$(GAME_REGION)
File diff suppressed because it is too large. Load diff
-42
View File
@@ -1,42 +0,0 @@
### Build Configuration ###
# Default variables
GAME_REVISION ?= 0
GAME_REGION ?= USA
DEBUG ?= 0
COMPARE ?= 1
# For gbafix
MAKER_CODE := 8P
# Version
BUILD_NAME := mb_subgame_loader_2
TITLE := SONICADVANC2
GAME_CODE := A2N
# Revision
ifeq ($(GAME_REVISION), 0)
BUILD_NAME := $(BUILD_NAME)
else
$(error unknown revision $(GAME_REVISION))
endif
# Region
ifeq ($(GAME_REGION), USA)
BUILD_NAME := $(BUILD_NAME)
GAME_CODE := $(GAME_CODE)E
else
ifeq ($(GAME_REGION), EUROPE)
BUILD_NAME := $(BUILD_NAME)_europe
GAME_CODE := $(GAME_CODE)P
else
$(error unknown region $(GAME_REGION))
endif
endif
# Debug
ifeq ($(DEBUG), 1)
COMPARE := 0
BUILD_NAME := $(BUILD_NAME)_debug
endif
-8
View File
@@ -1,8 +0,0 @@
.include "../../asm/macros/function.inc"
.include "../../constants/gba_constants.inc"
.section .rodata
.global gUnknown_0203C208
gUnknown_0203C208: @ 0x0203C208
.incbin "data/rom_data.bin", 0x1208, 0x3524
-43
View File
@@ -1,43 +0,0 @@
SECTIONS {
. = 0x0203B000;
.text :
ALIGN(4) {
build/mb_subgame_loader_2/asm/code.o(.text);
}
.rodata :
ALIGN(4) {
build/mb_subgame_loader_2/data/data.o(.rodata);
}
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* Discard everything not specifically mentioned above. */
/DISCARD/ :
{
*(*);
}
}
@@ -1 +0,0 @@
ccf732e280d4aa8ee042aefb4f30d121307b3d6f mb_subgame_loader_2.gba
@@ -1 +0,0 @@
01d2dd855d639c5ada616d53991599d25e5ac113 mb_subgame_loader_2.gba
+7 -7
View File
@@ -1,10 +1,10 @@
rom_start = 0x020000C0
end_of_code = 0x02014F10
end_of_data = 0x0201cc2c
rom_start = 0x0203B000
end_of_code = 0x0203C208
end_of_data = 0x0203F72C
addresses = set()
with open('multi_boot/signed_collect_rings/collect_rings/asm/code.s') as code:
with open('multi_boot/subgame_loader_2/asm/code.s') as code:
for line in code.readlines():
line = line.strip()
if ".4byte 0x02" in line:
@@ -37,7 +37,7 @@ for i in range(len(sorted_addresses)):
summed = 0
with open("multi_boot/signed_collect_rings/collect_rings/data/new_data.s", "w") as data_file:
with open("multi_boot/subgame_loader_2/data/new_data.s", "w") as data_file:
data_file.write(' .section .rodata\n')
data_file.write('\n')
for raw_addr, addr, size in addresses_with_size:
@@ -50,8 +50,8 @@ with open("multi_boot/signed_collect_rings/collect_rings/data/new_data.s", "w")
""")
print(hex(summed))
with open("multi_boot/signed_collect_rings/collect_rings/asm/new_code.s", "w") as new_rom:
existing_code = "".join(open("multi_boot/signed_collect_rings/collect_rings/asm/code.s").readlines())
with open("multi_boot/subgame_loader_2/asm/new_code.s", "w") as new_rom:
existing_code = "".join(open("multi_boot/subgame_loader_2/asm/code.s").readlines())
for _, addr, __ in addresses_with_size:
var = to_var_name(addr)
existing_code = existing_code.replace(addr, to_var_name(addr))
+3 -4
View File
@@ -5,7 +5,7 @@ replace = {}
max_ewram = "0x02014F10"
with open("multi_boot/signed_collect_rings/collect_rings/asm/code.s") as code_file:
with open("multi_boot/subgame_loader_2/asm/code.s") as code_file:
for line in code_file.readlines():
line = line.strip()
if "0x030" in line and ":" not in line:
@@ -19,10 +19,10 @@ with open("multi_boot/signed_collect_rings/collect_rings/asm/code.s") as code_fi
for addr, sym in replace.items():
code_content = code_content.replace(addr, sym)
with open("multi_boot/signed_collect_rings/collect_rings/asm/new_code.s", "w") as new_code:
with open("multi_boot/subgame_loader_2/asm/new_code.s", "w") as new_code:
new_code.write(code_content)
with open("multi_boot/signed_collect_rings/collect_rings/asm/sym_iwram.txt", "w") as iwram_sym_file:
with open("multi_boot/subgame_loader_2/asm/sym_iwram.txt", "w") as iwram_sym_file:
keys = sorted(iwram_syms.keys())
for addr in keys:
sym = iwram_syms[addr]
@@ -33,4 +33,3 @@ with open("multi_boot/signed_collect_rings/collect_rings/asm/code.s") as code_fi
# for addr in keys:
# sym = ewram_syms[addr]
# ewram_sym_file.write(f". = {addr}; {sym} = .;\n")