mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
first pass to extract libagbsyscall to a package (#139)
Co-authored-by: JaceCear <11230293+JaceCear@users.noreply.github.com>
This commit is contained in:
1 parent
3eed7359bf
commit
5314361c7d
6 files changed
+579
-10
No files matched your search
@@ -101,11 +101,11 @@ ifeq ($(THUMB_SUPPORT),1)
|
|||||||
CC1FLAGS += -mthumb-interwork
|
CC1FLAGS += -mthumb-interwork
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
# Allow file input through stdin on modern GCC and set it to "compile only"
|
|
||||||
ifeq ($(CPU_ARCH),i386)
|
ifeq ($(CPU_ARCH),i386)
|
||||||
# Use the more legible Intel dialect for x86
|
# Use the more legible Intel dialect for x86
|
||||||
CC1FLAGS += -masm=intel
|
CC1FLAGS += -masm=intel
|
||||||
endif
|
endif
|
||||||
|
# Allow file input through stdin on modern GCC and set it to "compile only"
|
||||||
CC1FLAGS += -x c -S
|
CC1FLAGS += -x c -S
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -134,13 +134,13 @@ endif
|
|||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
||||||
|
|
||||||
# these commands will run regardless of deps being completed
|
# these commands will run regardless of deps being completed
|
||||||
.PHONY: clean tools clean-tools $(TOOLDIRS)
|
.PHONY: clean tools clean-tools $(TOOLDIRS) libagbsyscall
|
||||||
|
|
||||||
infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))
|
infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))
|
||||||
|
|
||||||
# Build tools when building the rom
|
# Build tools when building the rom
|
||||||
# Disable dependency scanning for clean/tidy/tools
|
# Disable dependency scanning for clean/tidy/tools
|
||||||
ifeq (,$(filter-out all rom compare,$(MAKECMDGOALS)))
|
ifeq (,$(filter-out all rom compare libagbsyscall,$(MAKECMDGOALS)))
|
||||||
# if we are doing any of these things, build tools first
|
# if we are doing any of these things, build tools first
|
||||||
$(call infoshell, $(MAKE) tools -j$(nproc))
|
$(call infoshell, $(MAKE) tools -j$(nproc))
|
||||||
else
|
else
|
||||||
@@ -149,9 +149,15 @@ endif
|
|||||||
|
|
||||||
#### Files ####
|
#### Files ####
|
||||||
OBJ_DIR := build/$(PLATFORM)/$(BUILD_NAME)
|
OBJ_DIR := build/$(PLATFORM)/$(BUILD_NAME)
|
||||||
|
ifeq ($(PLATFORM),gba)
|
||||||
ROM := $(BUILD_NAME).gba
|
ROM := $(BUILD_NAME).gba
|
||||||
ELF := $(ROM:.gba=.elf)
|
ELF := $(ROM:.gba=.elf)
|
||||||
MAP := $(ROM:.gba=.map)
|
MAP := $(ROM:.gba=.map)
|
||||||
|
else
|
||||||
|
ROM := $(BUILD_NAME).$(PLATFORM).exe
|
||||||
|
ELF := $(ROM:.exe=.elf)
|
||||||
|
MAP := $(ROM:.exe=.map)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CPU_ARCH),arm)
|
ifeq ($(CPU_ARCH),arm)
|
||||||
ASM_SUBDIR = asm
|
ASM_SUBDIR = asm
|
||||||
@@ -270,6 +276,7 @@ clean: tidy clean-tools
|
|||||||
@$(MAKE) clean -C multi_boot/subgame_bootstrap
|
@$(MAKE) clean -C multi_boot/subgame_bootstrap
|
||||||
@$(MAKE) clean -C multi_boot/programs/subgame_loader
|
@$(MAKE) clean -C multi_boot/programs/subgame_loader
|
||||||
@$(MAKE) clean -C multi_boot/collect_rings
|
@$(MAKE) clean -C multi_boot/collect_rings
|
||||||
|
@$(MAKE) clean -C libagbsyscall
|
||||||
|
|
||||||
$(RM) $(SAMPLE_SUBDIR)/*.bin $(MID_SUBDIR)/*.s
|
$(RM) $(SAMPLE_SUBDIR)/*.bin $(MID_SUBDIR)/*.s
|
||||||
find . \( -iwholename './data/maps/*/*/entities/*.bin' -o -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) {} +
|
find . \( -iwholename './data/maps/*/*/entities/*.bin' -o -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) {} +
|
||||||
@@ -332,11 +339,11 @@ PROCESSED_LDSCRIPT := $(OBJ_DIR)/$(LDSCRIPT)
|
|||||||
$(PROCESSED_LDSCRIPT): $(LDSCRIPT)
|
$(PROCESSED_LDSCRIPT): $(LDSCRIPT)
|
||||||
$(CPP) $(CPPFLAGS) $(LDSCRIPT) > $(PROCESSED_LDSCRIPT)
|
$(CPP) $(CPPFLAGS) $(LDSCRIPT) > $(PROCESSED_LDSCRIPT)
|
||||||
|
|
||||||
$(ELF): $(OBJS) $(PROCESSED_LDSCRIPT)
|
$(ELF): $(OBJS) $(PROCESSED_LDSCRIPT) libagbsyscall
|
||||||
@echo "$(LD) -T $(LDSCRIPT) -Map $(MAP) <objects> <lib>"
|
@echo "$(LD) -T $(LDSCRIPT) -Map $(MAP) <objects> <lib>"
|
||||||
# NOTE: It is important to pass the CPU arch through -A
|
# NOTE: It is important to pass the CPU arch through -A
|
||||||
# because the identifier for x86 (being i386) gets converted to a 1 by the preprocessor because it starts with an i...
|
# because the identifier for x86 (being i386) gets converted to a 1 by the preprocessor because it starts with an i...
|
||||||
@cd $(OBJ_DIR) && $(LD) -A CPU_ARCH -T $(LDSCRIPT) -Map "$(ROOT_DIR)/$(MAP)" $(OBJS_REL) "$(ROOT_DIR)/tools/agbcc/lib/libgcc.a" "$(ROOT_DIR)/tools/agbcc/lib/libc.a" -o $(ROOT_DIR)/$@
|
@cd $(OBJ_DIR) && $(LD) -A CPU_ARCH -T $(LDSCRIPT) -Map "$(ROOT_DIR)/$(MAP)" $(OBJS_REL) "$(ROOT_DIR)/tools/agbcc/lib/libgcc.a" "$(ROOT_DIR)/tools/agbcc/lib/libc.a" -L$(ROOT_DIR)/libagbsyscall -lagbsyscall -o $(ROOT_DIR)/$@
|
||||||
|
|
||||||
$(ROM): $(ELF)
|
$(ROM): $(ELF)
|
||||||
$(OBJCOPY) -O binary --pad-to 0x8400000 $< $@
|
$(OBJCOPY) -O binary --pad-to 0x8400000 $< $@
|
||||||
@@ -388,6 +395,8 @@ japan: ; @$(MAKE) GAME_REGION=JAPAN
|
|||||||
|
|
||||||
europe: ; @$(MAKE) GAME_REGION=EUROPE
|
europe: ; @$(MAKE) GAME_REGION=EUROPE
|
||||||
|
|
||||||
|
x86: ; @$(MAKE) PLATFORM=win32 CPU_ARCH=i386
|
||||||
|
|
||||||
chao_garden/mb_chao_garden.gba:
|
chao_garden/mb_chao_garden.gba:
|
||||||
@$(MAKE) -C chao_garden
|
@$(MAKE) -C chao_garden
|
||||||
|
|
||||||
@@ -413,3 +422,6 @@ subgame_loader: tools
|
|||||||
|
|
||||||
collect_rings: tools
|
collect_rings: tools
|
||||||
@$(MAKE) -C multi_boot/collect_rings
|
@$(MAKE) -C multi_boot/collect_rings
|
||||||
|
|
||||||
|
libagbsyscall:
|
||||||
|
@$(MAKE) -C libagbsyscall MODERN=0
|
||||||
File renamed without changes.
@@ -14,10 +14,7 @@ ifeq ($(CPU_ARCH),arm)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
MIDI_COMMENTS := "arm"
|
MIDI_COMMENTS := "arm"
|
||||||
else ifeq ($(CPU_ARCH),x86)
|
# This is 'i386' because that's the arch's name in GNU Linker scripts
|
||||||
CPU_ARCH := i386
|
|
||||||
THUMB_SUPPORT ?= 0
|
|
||||||
MIDI_COMMENTS := "x86"
|
|
||||||
else ifeq ($(CPU_ARCH),i386)
|
else ifeq ($(CPU_ARCH),i386)
|
||||||
THUMB_SUPPORT ?= 0
|
THUMB_SUPPORT ?= 0
|
||||||
MIDI_COMMENTS := "x86"
|
MIDI_COMMENTS := "x86"
|
||||||
|
|||||||
+12
-1
@@ -385,7 +385,18 @@ SECTIONS
|
|||||||
src/lib/agb_flash_le_512k.o(.text);
|
src/lib/agb_flash_le_512k.o(.text);
|
||||||
src/lib/agb_flash_mx_512k.o(.text);
|
src/lib/agb_flash_mx_512k.o(.text);
|
||||||
#if (PLATFORM_GBA == 1)
|
#if (PLATFORM_GBA == 1)
|
||||||
asm/libagbsyscall.o(.text);
|
*libagbsyscall.a:ArcTan2.o(.text);
|
||||||
|
*libagbsyscall.a:CpuFastSet.o(.text);
|
||||||
|
*libagbsyscall.a:CpuSet.o(.text);
|
||||||
|
*libagbsyscall.a:Div.o(.text);
|
||||||
|
*libagbsyscall.a:Mod.o(.text);
|
||||||
|
*libagbsyscall.a:LZ77UnCompWram.o(.text);
|
||||||
|
*libagbsyscall.a:MultiBoot.o(.text);
|
||||||
|
*libagbsyscall.a:RLUnCompWram.o(.text);
|
||||||
|
*libagbsyscall.a:SoftReset.o(.text);
|
||||||
|
*libagbsyscall.a:Sqrt.o(.text);
|
||||||
|
*libagbsyscall.a:VBlankIntrWait.o(.text);
|
||||||
|
*libagbsyscall.a:SoftResetExram.o(.text);
|
||||||
#else
|
#else
|
||||||
src/lib/libagbsyscall.o(.text);
|
src/lib/libagbsyscall.o(.text);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
TOOLCHAIN := $(DEVKITARM)
|
||||||
|
COMPARE ?= 0
|
||||||
|
|
||||||
|
# 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-
|
||||||
|
OBJCOPY := $(PREFIX)objcopy
|
||||||
|
AS := $(PREFIX)as
|
||||||
|
LD := $(PREFIX)ld
|
||||||
|
AR := $(PREFIX)ar
|
||||||
|
|
||||||
|
# note: the makefile must be set up so MODERNCC is never called
|
||||||
|
# if MODERN=0
|
||||||
|
MODERNCC := $(PREFIX)gcc
|
||||||
|
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
EXE := .exe
|
||||||
|
else
|
||||||
|
EXE :=
|
||||||
|
endif
|
||||||
|
|
||||||
|
# use arm-none-eabi-cpp for macOS
|
||||||
|
# as macOS's default compiler is clang
|
||||||
|
# and clang's preprocessor will warn on \u
|
||||||
|
# when preprocessing asm files, expecting a unicode literal
|
||||||
|
# we can't unconditionally use arm-none-eabi-cpp
|
||||||
|
# as installations which install binutils-arm-none-eabi
|
||||||
|
# don't come with it
|
||||||
|
ifneq ($(MODERN),1)
|
||||||
|
ifeq ($(shell uname -s),Darwin)
|
||||||
|
CPP := $(PREFIX)cpp
|
||||||
|
else
|
||||||
|
CPP := $(CC) -E
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
CPP := $(PREFIX)cpp
|
||||||
|
endif
|
||||||
|
|
||||||
|
ASFLAGS := -mcpu=arm7tdmi -mthumb-interwork
|
||||||
|
ARFLAGS := rc
|
||||||
|
|
||||||
|
SYSCALLS := IntrWait \
|
||||||
|
RegisterRamReset \
|
||||||
|
Sqrt \
|
||||||
|
MusicPlayerOpen \
|
||||||
|
SoundBiasReset \
|
||||||
|
SoundDriverVSyncOn \
|
||||||
|
Mod \
|
||||||
|
VBlankIntrWait \
|
||||||
|
MusicPlayerStart \
|
||||||
|
SoundDriverVSyncOff \
|
||||||
|
HuffUnComp \
|
||||||
|
SoftResetExram \
|
||||||
|
MusicPlayerFadeOut \
|
||||||
|
LZ77UnCompWram \
|
||||||
|
SoundDriverMain \
|
||||||
|
SoundBiasChange \
|
||||||
|
LZ77UnCompVram \
|
||||||
|
ArcTan2 \
|
||||||
|
MusicPlayerStop \
|
||||||
|
DivArm \
|
||||||
|
ModArm \
|
||||||
|
SoundDriverVSync \
|
||||||
|
SoundDriverInit \
|
||||||
|
BgAffineSet \
|
||||||
|
Diff8bitUnFilterWram \
|
||||||
|
MultiBoot \
|
||||||
|
MidiKey2Freq \
|
||||||
|
Div \
|
||||||
|
Diff8bitUnFilterVram \
|
||||||
|
ArcTan \
|
||||||
|
ObjAffineSet \
|
||||||
|
SoftResetRom \
|
||||||
|
SoundDriverMode \
|
||||||
|
RLUnCompWram \
|
||||||
|
BitUnPack \
|
||||||
|
SoundChannelClear \
|
||||||
|
CpuFastSet \
|
||||||
|
CpuSet \
|
||||||
|
Diff16bitUnFilter \
|
||||||
|
SoundBiasSet \
|
||||||
|
MusicPlayerContinue \
|
||||||
|
SoftReset \
|
||||||
|
RLUnCompVram
|
||||||
|
|
||||||
|
ASM_SRCS := libagbsyscall.s
|
||||||
|
ASM_OBJS := $(foreach syscall, $(SYSCALLS), $(syscall).o)
|
||||||
|
|
||||||
|
LIB := libagbsyscall.a
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
all: $(LIB)
|
||||||
|
@:
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(LIB) $(ASM_OBJS)
|
||||||
|
|
||||||
|
$(LIB): $(ASM_OBJS)
|
||||||
|
$(AR) $(ARFLAGS) $@ $^
|
||||||
|
|
||||||
|
$(ASM_OBJS): libagbsyscall.s
|
||||||
|
$(AS) $(ASFLAGS) --defsym L_$(*F)=1 -o $@ $<
|
||||||
@@ -0,0 +1,435 @@
|
|||||||
|
.include "../constants/gba_constants.inc"
|
||||||
|
.include "../asm/macros/function.inc"
|
||||||
|
|
||||||
|
.text
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
.arm
|
||||||
|
|
||||||
|
.set SOFT_RESET_DIRECT_BUF, 0x03007FFA
|
||||||
|
.set RESET_EX_WRAM_FLAG, 0x1
|
||||||
|
|
||||||
|
.ifdef NO_GRANULAR_AGBSYSCALL
|
||||||
|
.set L_IntrWait, 1
|
||||||
|
.set L_RegisterRamReset, 1
|
||||||
|
.set L_Sqrt, 1
|
||||||
|
.set L_MusicPlayerOpen, 1
|
||||||
|
.set L_SoundBiasReset, 1
|
||||||
|
.set L_SoundDriverVSyncOn, 1
|
||||||
|
.set L_Mod, 1
|
||||||
|
.set L_VBlankIntrWait, 1
|
||||||
|
.set L_MusicPlayerStart, 1
|
||||||
|
.set L_SoundDriverVSyncOff, 1
|
||||||
|
.set L_HuffUnComp, 1
|
||||||
|
.set L_SoftResetExram, 1
|
||||||
|
.set L_MusicPlayerFadeOut, 1
|
||||||
|
.set L_LZ77UnCompWram, 1
|
||||||
|
.set L_SoundDriverMain, 1
|
||||||
|
.set L_SoundBiasChange, 1
|
||||||
|
.set L_LZ77UnCompVram, 1
|
||||||
|
.set L_ArcTan2, 1
|
||||||
|
.set L_MusicPlayerStop, 1
|
||||||
|
.set L_DivArm, 1
|
||||||
|
.set L_ModArm, 1
|
||||||
|
.set L_SoundDriverVSync, 1
|
||||||
|
.set L_SoundDriverInit, 1
|
||||||
|
.set L_BgAffineSet, 1
|
||||||
|
.set L_Diff8bitUnFilterWram, 1
|
||||||
|
.set L_MultiBoot, 1
|
||||||
|
.set L_MidiKey2Freq, 1
|
||||||
|
.set L_Div, 1
|
||||||
|
.set L_Diff8bitUnFilterVram, 1
|
||||||
|
.set L_ArcTan, 1
|
||||||
|
.set L_ObjAffineSet, 1
|
||||||
|
.set L_SoftResetRom, 1
|
||||||
|
.set L_SoundDriverMode, 1
|
||||||
|
.set L_RLUnCompWram, 1
|
||||||
|
.set L_BitUnPack, 1
|
||||||
|
.set L_SoundChannelClear, 1
|
||||||
|
.set L_CpuFastSet, 1
|
||||||
|
.set L_CpuSet, 1
|
||||||
|
.set L_Diff16bitUnFilter, 1
|
||||||
|
.set L_SoundBiasSet, 1
|
||||||
|
.set L_MusicPlayerContinue, 1
|
||||||
|
.set L_SoftReset, 1
|
||||||
|
.set L_RLUnCompVram, 1
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_IntrWait
|
||||||
|
thumb_func_start IntrWait
|
||||||
|
IntrWait:
|
||||||
|
movs r2, #0
|
||||||
|
svc #4
|
||||||
|
bx lr
|
||||||
|
thumb_func_end IntrWait
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_RegisterRamReset
|
||||||
|
thumb_func_start RegisterRamReset
|
||||||
|
RegisterRamReset:
|
||||||
|
svc #1
|
||||||
|
bx lr
|
||||||
|
thumb_func_end RegisterRamReset
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_Sqrt
|
||||||
|
thumb_func_start Sqrt
|
||||||
|
Sqrt:
|
||||||
|
svc #8
|
||||||
|
bx lr
|
||||||
|
thumb_func_end Sqrt
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_MusicPlayerOpen
|
||||||
|
thumb_func_start MusicPlayerOpen
|
||||||
|
MusicPlayerOpen:
|
||||||
|
svc #32
|
||||||
|
bx lr
|
||||||
|
thumb_func_end MusicPlayerOpen
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundBiasReset
|
||||||
|
thumb_func_start SoundBiasReset
|
||||||
|
SoundBiasReset:
|
||||||
|
movs r0, #0
|
||||||
|
svc #25
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundBiasReset
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundDriverVSyncOn
|
||||||
|
thumb_func_start SoundDriverVSyncOn
|
||||||
|
SoundDriverVSyncOn:
|
||||||
|
svc #41
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundDriverVSyncOn
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_Mod
|
||||||
|
thumb_func_start Mod
|
||||||
|
Mod:
|
||||||
|
svc #6
|
||||||
|
adds r0, r1, #0
|
||||||
|
bx lr
|
||||||
|
thumb_func_end Mod
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_VBlankIntrWait
|
||||||
|
thumb_func_start VBlankIntrWait
|
||||||
|
VBlankIntrWait:
|
||||||
|
movs r2, #0
|
||||||
|
svc #5
|
||||||
|
bx lr
|
||||||
|
thumb_func_end VBlankIntrWait
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_MusicPlayerStart
|
||||||
|
thumb_func_start MusicPlayerStart
|
||||||
|
MusicPlayerStart:
|
||||||
|
svc #33
|
||||||
|
bx lr
|
||||||
|
thumb_func_end MusicPlayerStart
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundDriverVSyncOff
|
||||||
|
thumb_func_start SoundDriverVSyncOff
|
||||||
|
SoundDriverVSyncOff:
|
||||||
|
svc #40
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundDriverVSyncOff
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_HuffUnComp
|
||||||
|
thumb_func_start HuffUnComp
|
||||||
|
HuffUnComp:
|
||||||
|
svc #19
|
||||||
|
bx lr
|
||||||
|
thumb_func_end HuffUnComp
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoftResetExram
|
||||||
|
thumb_func_start SoftResetExram
|
||||||
|
SoftResetExram:
|
||||||
|
ldr r3, =REG_IME
|
||||||
|
movs r2, #0
|
||||||
|
strb r2, [r3, #0]
|
||||||
|
ldr r3, =SOFT_RESET_DIRECT_BUF
|
||||||
|
movs r2, #1
|
||||||
|
strb r2, [r3, #0]
|
||||||
|
subs r3, #SOFT_RESET_DIRECT_BUF - 0x3007f00
|
||||||
|
mov sp, r3
|
||||||
|
movs r2, #RESET_EX_WRAM_FLAG
|
||||||
|
bics r0, r2
|
||||||
|
svc #1
|
||||||
|
svc #0
|
||||||
|
.pool
|
||||||
|
thumb_func_end SoftResetExram
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_MusicPlayerFadeOut
|
||||||
|
thumb_func_start MusicPlayerFadeOut
|
||||||
|
MusicPlayerFadeOut:
|
||||||
|
svc #36
|
||||||
|
bx lr
|
||||||
|
thumb_func_end MusicPlayerFadeOut
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_LZ77UnCompWram
|
||||||
|
thumb_func_start LZ77UnCompWram
|
||||||
|
LZ77UnCompWram:
|
||||||
|
svc #17
|
||||||
|
bx lr
|
||||||
|
thumb_func_end LZ77UnCompWram
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundDriverMain
|
||||||
|
thumb_func_start SoundDriverMain
|
||||||
|
SoundDriverMain:
|
||||||
|
svc #28
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundDriverMain
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundBiasChange
|
||||||
|
thumb_func_start SoundBiasChange
|
||||||
|
SoundBiasChange:
|
||||||
|
svc #25
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundBiasChange
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_LZ77UnCompVram
|
||||||
|
thumb_func_start LZ77UnCompVram
|
||||||
|
LZ77UnCompVram:
|
||||||
|
svc #18
|
||||||
|
bx lr
|
||||||
|
thumb_func_end LZ77UnCompVram
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_ArcTan2
|
||||||
|
thumb_func_start ArcTan2
|
||||||
|
ArcTan2:
|
||||||
|
svc #10
|
||||||
|
bx lr
|
||||||
|
thumb_func_end ArcTan2
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_MusicPlayerStop
|
||||||
|
thumb_func_start MusicPlayerStop
|
||||||
|
MusicPlayerStop:
|
||||||
|
svc #34
|
||||||
|
bx lr
|
||||||
|
thumb_func_end MusicPlayerStop
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_DivArm
|
||||||
|
thumb_func_start DivArm
|
||||||
|
DivArm:
|
||||||
|
svc #7
|
||||||
|
bx lr
|
||||||
|
thumb_func_end DivArm
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_ModArm
|
||||||
|
thumb_func_start ModArm
|
||||||
|
ModArm:
|
||||||
|
svc #7
|
||||||
|
movs r0, r1
|
||||||
|
bx lr
|
||||||
|
thumb_func_end ModArm
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundDriverVSync
|
||||||
|
thumb_func_start SoundDriverVSync
|
||||||
|
SoundDriverVSync:
|
||||||
|
svc #29
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundDriverVSync
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundDriverInit
|
||||||
|
thumb_func_start SoundDriverInit
|
||||||
|
SoundDriverInit:
|
||||||
|
svc #26
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundDriverInit
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_BgAffineSet
|
||||||
|
thumb_func_start BgAffineSet
|
||||||
|
BgAffineSet:
|
||||||
|
svc #14
|
||||||
|
bx lr
|
||||||
|
thumb_func_end BgAffineSet
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_Diff8bitUnFilterWram
|
||||||
|
thumb_func_start Diff8bitUnFilterWram
|
||||||
|
Diff8bitUnFilterWram:
|
||||||
|
svc #22
|
||||||
|
bx lr
|
||||||
|
thumb_func_end Diff8bitUnFilterWram
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_MultiBoot
|
||||||
|
thumb_func_start MultiBoot
|
||||||
|
MultiBoot:
|
||||||
|
movs r1, #1
|
||||||
|
svc #37
|
||||||
|
bx lr
|
||||||
|
thumb_func_end MultiBoot
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_MidiKey2Freq
|
||||||
|
thumb_func_start MidiKey2Freq
|
||||||
|
MidiKey2Freq:
|
||||||
|
svc #31
|
||||||
|
bx lr
|
||||||
|
thumb_func_end MidiKey2Freq
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_Div
|
||||||
|
thumb_func_start Div
|
||||||
|
Div:
|
||||||
|
svc #6
|
||||||
|
bx lr
|
||||||
|
thumb_func_end Div
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_Diff8bitUnFilterVram
|
||||||
|
thumb_func_start Diff8bitUnFilterVram
|
||||||
|
Diff8bitUnFilterVram:
|
||||||
|
svc #23
|
||||||
|
bx lr
|
||||||
|
thumb_func_end Diff8bitUnFilterVram
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_ArcTan
|
||||||
|
thumb_func_start ArcTan
|
||||||
|
ArcTan:
|
||||||
|
svc #9
|
||||||
|
bx lr
|
||||||
|
thumb_func_end ArcTan
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_ObjAffineSet
|
||||||
|
thumb_func_start ObjAffineSet
|
||||||
|
ObjAffineSet:
|
||||||
|
svc #15
|
||||||
|
bx lr
|
||||||
|
thumb_func_end ObjAffineSet
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoftResetRom
|
||||||
|
thumb_func_start SoftResetRom
|
||||||
|
SoftResetRom:
|
||||||
|
ldr r3, =REG_IME
|
||||||
|
movs r2, #0
|
||||||
|
strb r2, [r3, #0]
|
||||||
|
ldr r3, =SOFT_RESET_DIRECT_BUF
|
||||||
|
movs r2, #0
|
||||||
|
strb r2, [r3, #0]
|
||||||
|
subs r3, #SOFT_RESET_DIRECT_BUF - 0x3007f00
|
||||||
|
mov sp, r3
|
||||||
|
svc #1
|
||||||
|
svc #0
|
||||||
|
.pool
|
||||||
|
thumb_func_end SoftResetRom
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundDriverMode
|
||||||
|
thumb_func_start SoundDriverMode
|
||||||
|
SoundDriverMode:
|
||||||
|
svc #27
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundDriverMode
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_RLUnCompWram
|
||||||
|
thumb_func_start RLUnCompWram
|
||||||
|
RLUnCompWram:
|
||||||
|
svc #20
|
||||||
|
bx lr
|
||||||
|
thumb_func_end RLUnCompWram
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_BitUnPack
|
||||||
|
thumb_func_start BitUnPack
|
||||||
|
BitUnPack:
|
||||||
|
svc #16
|
||||||
|
bx lr
|
||||||
|
thumb_func_end BitUnPack
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundChannelClear
|
||||||
|
thumb_func_start SoundChannelClear
|
||||||
|
SoundChannelClear:
|
||||||
|
svc #30
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundChannelClear
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_CpuFastSet
|
||||||
|
thumb_func_start CpuFastSet
|
||||||
|
CpuFastSet:
|
||||||
|
svc #12
|
||||||
|
bx lr
|
||||||
|
thumb_func_end CpuFastSet
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_CpuSet
|
||||||
|
thumb_func_start CpuSet
|
||||||
|
CpuSet:
|
||||||
|
svc #11
|
||||||
|
bx lr
|
||||||
|
thumb_func_end CpuSet
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_Diff16bitUnFilter
|
||||||
|
thumb_func_start Diff16bitUnFilter
|
||||||
|
Diff16bitUnFilter:
|
||||||
|
svc #24
|
||||||
|
bx lr
|
||||||
|
thumb_func_end Diff16bitUnFilter
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoundBiasSet
|
||||||
|
thumb_func_start SoundBiasSet
|
||||||
|
SoundBiasSet:
|
||||||
|
movs r0, #1
|
||||||
|
svc #25
|
||||||
|
bx lr
|
||||||
|
thumb_func_end SoundBiasSet
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_MusicPlayerContinue
|
||||||
|
thumb_func_start MusicPlayerContinue
|
||||||
|
MusicPlayerContinue:
|
||||||
|
svc #35
|
||||||
|
bx lr
|
||||||
|
thumb_func_end MusicPlayerContinue
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_SoftReset
|
||||||
|
thumb_func_start SoftReset
|
||||||
|
SoftReset:
|
||||||
|
ldr r3, =REG_IME
|
||||||
|
movs r2, #0
|
||||||
|
strb r2, [r3, #0]
|
||||||
|
ldr r1, =0x3007f00
|
||||||
|
mov sp, r1
|
||||||
|
svc #1
|
||||||
|
svc #0
|
||||||
|
.pool
|
||||||
|
thumb_func_end SoftReset
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.ifdef L_RLUnCompVram
|
||||||
|
thumb_func_start RLUnCompVram
|
||||||
|
RLUnCompVram:
|
||||||
|
svc #21
|
||||||
|
bx lr
|
||||||
|
thumb_func_end RLUnCompVram
|
||||||
|
.endif
|
||||||
|
|
||||||
|
.align 2, 0 @ Don't pad with nop
|
||||||
Reference in new issue
Block a user