Initial port to current libnds

* UI appears to function correclty. As I do not have a compatilbe slot-2
device I can't test further.
* Soft reset into GBA mode not yet fixed so likely not working yet.
* File browser untested. Ported fixes from NDS_Backup_Tool but untested
due to lacking compatible slot-2 hardware.
This commit is contained in:
ApacheThunder 2024-05-08 00:52:35 -05:00
parent bbe4ce75c0
commit d8f3fd9832
29 changed files with 322 additions and 4867 deletions

View File

@ -2,41 +2,59 @@
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
export TARGET := GBA_ExpLoader
export TOPDIR := $(CURDIR)
export VERSION_MAJOR := 0
export VERSION_MINOR := 57
export VERSTRING := $(VERSION_MAJOR).$(VERSION_MINOR)
# GMAE_ICON is the image used to create the game icon, leave blank to use default rule
GAME_ICON :=
# specify a directory which contains the nitro filesystem
# this is relative to the Makefile
# NITRO_FILES := nitroFiles
# These set the information text in the nds file
#GAME_TITLE := My Wonderful Homebrew
#GAME_SUBTITLE1 := built with devkitARM
#GAME_SUBTITLE2 := http://devitpro.org
include $(DEVKITARM)/ds_rules
export TARGET := $(shell basename $(CURDIR))
export TOPDIR := $(CURDIR)
#---------------------------------------------------------------------------------
# path to tools - this can be deleted if you set the path in windows
#---------------------------------------------------------------------------------
export PATH := $(DEVKITARM)/bin:$(PATH)
.PHONY: $(TARGET).arm7 $(TARGET).arm9
.PHONY: data clean
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
all: $(TARGET).nds
#$(TARGET).ds.gba : $(TARGET).nds
all: checkarm7 checkarm9 $(TARGET).nds
#---------------------------------------------------------------------------------
$(TARGET).nds : $(TARGET).arm7 $(TARGET).arm9
ndstool -c GBA_ExpLoader.nds -7 arm7/arm7.bin -9 arm9/arm9.bin -b arm9/logo32.bmp "GBA ExpLoader;Version 0.57;By Rudolph"
checkarm7:
$(MAKE) -C arm7
#---------------------------------------------------------------------------------
$(TARGET).arm7 : arm7/$(TARGET).elf
$(TARGET).arm9 : arm9/$(TARGET).elf
checkarm9:
$(MAKE) -C arm9
#---------------------------------------------------------------------------------
$(TARGET).nds : arm7/$(TARGET).elf arm9/$(TARGET).elf
@ndstool -c $@ -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf \
-b $(CURDIR)/logo32.bmp "GBA ExpLoader;Version $(VERSTRING);By Rudolph;" \
-g GBEX 01 "GBAEXPLOADER" -z 80040000 -u 00030004 -a 00000138 -p 0001 \
data:
@mkdir -p data
#---------------------------------------------------------------------------------
arm7/$(TARGET).elf:
$(MAKE) -C arm7
#---------------------------------------------------------------------------------
arm9/$(TARGET).elf:
$(MAKE) -C arm9
@ -45,4 +63,6 @@ arm9/$(TARGET).elf:
clean:
$(MAKE) -C arm9 clean
$(MAKE) -C arm7 clean
rm -f $(TARGET).ds.gba $(TARGET).nds $(TARGET).arm7 $(TARGET).arm9
rm -rf data
rm -f $(TARGET).nds

View File

@ -22,27 +22,32 @@ DATA :=
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
# ARCH := -mthumb -mthumb-interwork
ARCH := -mthumb-interwork
CFLAGS := -g -Wall -O2\
-mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\
-ffast-math \
$(ARCH)
CFLAGS := -g -Wall -O2 \
-mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer\
-ffast-math \
$(ARCH)
CFLAGS += $(INCLUDE) -DARM7
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -fno-rtti
# CFLAGS += $(INCLUDE) -DARM7
CFLAGS += $(INCLUDE) -DARM7 -fsigned-char
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
CXXFLAGS := $(CFLAGS)
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=ds_arm7.specs -g $(ARCH) -mno-fpu -Wl,-Map,../arm7.map
LDFLAGS = -specs=ds_arm7.specs -g $(ARCH) -Wl,-Map,$(notdir $*).map
# LDFLAGS = -specs=ds_arm7_iwram.specs -g $(ARCH) -Wl,-Map,$(notdir $*).map
LIBS := -lnds7
LIBS := -lnds7
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(LIBNDS) $(LIBFAT)
LIBDIRS := $(LIBNDS)
#---------------------------------------------------------------------------------
@ -52,8 +57,7 @@ LIBDIRS := $(LIBNDS) $(LIBFAT)
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export ARM7BIN := $(CURDIR)/arm7.bin
export ARM7ELF := $(CURDIR)/arm7.elf
export ARM7ELF := $(CURDIR)/$(TARGET).elf
export DEPSDIR := $(CURDIR)/$(BUILD)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))
@ -107,11 +111,6 @@ DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(ARM7BIN) : $(ARM7ELF)
@$(OBJCOPY) -O binary $< $@
@echo built ... $(notdir $@)
$(ARM7ELF) : $(OFILES)
@echo linking $(notdir $@)
@$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
@ -129,4 +128,5 @@ $(ARM7ELF) : $(OFILES)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------

View File

@ -1,724 +0,0 @@
Archive member included because of file (symbol)
d:/devkitPro/libnds/lib\libnds7.a(clock.o)
main.o (rtcGetTimeAndDate)
d:/devkitPro/libnds/lib\libnds7.a(spi.o)
main.o (writePowerManagement)
d:/devkitPro/libnds/lib\libnds7.a(touch.o)
main.o (touchReadXY)
d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
main.o (irqSet)
d:/devkitPro/libnds/lib\libnds7.a(biosCalls.o)
main.o (swiSoftReset)
d:/devkitPro/libnds/lib\libnds7.a(interruptDispatcher.o)
d:/devkitPro/libnds/lib\libnds7.a(interrupts.o) (IntrMain)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_divsi3.o)
main.o (__aeabi_idiv)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_dvmd_tls.o)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_divsi3.o) (__div0)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_call_via_rX.o)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o (_call_via_r3)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-init.o)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o (__libc_init_array)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-memcpy.o)
main.o (memcpy)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o)
d:/devkitPro/libnds/lib\libnds7.a(clock.o) (mktime)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o) (__tzcalc_limits)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzlock.o)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o) (__tz_lock)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzvars.o)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o) (_daylight)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-div.o)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o) (div)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-gettzinfo.o)
d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o) (__gettzinfo)
Allocating common symbols
Common symbol size file
_menu7_Gen 0x4 ret_menu7_Gen.o
irqTable 0xc8 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
tempPos 0xc main.o
first 0xc main.o
Memory Configuration
Name Origin Length Attributes
rom 0x08000000 0x02000000
iwram 0x037f8000 0x00018000
*default* 0x00000000 0xffffffff
Linker script and memory map
0x037f8000 __iwram_start = 0x37f8000
0x03810000 __iwram_top = 0x3810000
0x0380ffa0 __sp_irq = (__iwram_top - 0x60)
0x0380fea0 __sp_svc = (__sp_irq - 0x100)
0x0380fda0 __sp_usr = (__sp_svc - 0x100)
0x0380fff8 __irq_flags = (__iwram_top - 0x8)
0x0380fffc __irq_vector = (__iwram_top - 0x4)
.init 0x037f8000 0xe8
0x037f8000 __text_start = .
*(.init)
.init 0x037f8000 0xd0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o
0x037f8000 _start
.init 0x037f80d0 0xc d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crti.o
0x037f80d0 _init
.init 0x037f80dc 0xc d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtn.o
0x037f80e8 . = ALIGN (0x4)
.plt
*(.plt)
.text 0x037f80f0 0x3298
*(.text.*)
*(.stub)
*(.gnu.warning)
*(.gnu.linkonce.t*)
*(.glue_7)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crti.o
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
.glue_7 0x037f80f0 0x0 main.o
.glue_7 0x037f80f0 0x0 ret_menu7_Gen.o
.glue_7 0x037f80f0 0x0 ret_menu7_R4.o
.glue_7 0x037f80f0 0x0 ret_menu7_mse.o
.glue_7 0x037f80f0 0x0 linkreset_arm7.o
.glue_7 0x037f80f0 0x0 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.glue_7 0x037f80f0 0x0 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.glue_7 0x037f80f0 0x0 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.glue_7 0x037f80f0 0x0 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.glue_7 0x037f80f0 0x0 d:/devkitPro/libnds/lib\libnds7.a(biosCalls.o)
.glue_7 0x037f80f0 0x0 d:/devkitPro/libnds/lib\libnds7.a(interruptDispatcher.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_divsi3.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_dvmd_tls.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_call_via_rX.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-init.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-memcpy.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzlock.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzvars.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-div.o)
.glue_7 0x037f80f0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-gettzinfo.o)
.glue_7 0x037f80f0 0x9c d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
0x037f812c __irqSet_from_arm
0x037f8180 __swiSoftReset_from_arm
0x037f815c __swiDelay_from_arm
0x037f8138 __irqEnable_from_arm
0x037f8174 __touchReadTemperature_from_arm
0x037f80f0 ___call_via_r3_from_arm
0x037f8108 __swiSwitchToGBAMode_from_arm
0x037f8150 __touchReadXY_from_arm
0x037f8168 __rtcGetTimeAndDate_from_arm
0x037f8114 __irqInit_from_arm
0x037f8144 __swiWaitForVBlank_from_arm
0x037f8120 __initClockIRQ_from_arm
0x037f80fc __writePowerManagement_from_arm
.glue_7 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtn.o
*(.glue_7t)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crti.o
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
.glue_7t 0x037f818c 0x0 main.o
.glue_7t 0x037f818c 0x0 ret_menu7_Gen.o
.glue_7t 0x037f818c 0x0 ret_menu7_R4.o
.glue_7t 0x037f818c 0x0 ret_menu7_mse.o
.glue_7t 0x037f818c 0x0 linkreset_arm7.o
.glue_7t 0x037f818c 0x0 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.glue_7t 0x037f818c 0x0 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.glue_7t 0x037f818c 0x0 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.glue_7t 0x037f818c 0x0 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.glue_7t 0x037f818c 0x0 d:/devkitPro/libnds/lib\libnds7.a(biosCalls.o)
.glue_7t 0x037f818c 0x0 d:/devkitPro/libnds/lib\libnds7.a(interruptDispatcher.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_divsi3.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_dvmd_tls.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_call_via_rX.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-init.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-memcpy.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzlock.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzvars.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-div.o)
.glue_7t 0x037f818c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-gettzinfo.o)
.glue_7t 0x037f818c 0x10 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
0x037f818c __mktime_from_thumb
0x037f8194 ____aeabi_idiv_from_thumb
0x037f8190 __mktime_change_to_arm
0x037f8198 ____aeabi_idiv_change_to_arm
.glue_7t 0x037f819c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtn.o
0x037f819c . = ALIGN (0x4)
.text 0x037f819c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o
.text 0x037f819c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crti.o
.text 0x037f819c 0xa4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
.text 0x037f8240 0x6ac main.o
0x037f842c VcountHandler
0x037f86bc PM_SetControl
0x037f8240 FIFOInit
0x037f8318 gbaMode
0x037f8258 startSound
0x037f8534 PM_SetRegister
0x037f839c main
0x037f86dc VblankHandler
0x037f85d8 PM_GetRegister
0x037f82ec getFreeSoundChannel
.text 0x037f88ec 0x300 ret_menu7_Gen.o
0x037f88ec ret_menu7_Gen
0x037f8a0c _menu7_Gen_s
.text 0x037f8bec 0x2c4 ret_menu7_R4.o
0x037f8d00 ret_menu7_R4
.text 0x037f8eb0 0x118 ret_menu7_mse.o
0x037f8eb0 ret_menu7_mse
.text 0x037f8fc8 0x18 linkreset_arm7.o
0x037f8fc8 LinkReset_ARM7
.text 0x037f8fe0 0x3d0 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
0x037f8fe0 BCDToInteger
0x037f912c rtcSetTime
0x037f9154 rtcGetTime
0x037f9298 initClockIRQ
0x037f925c integerToBCD
0x037f9354 syncRTC
0x037f91a0 rtcSetTimeAndDate
0x037f9218 rtcReset
0x037f900c rtcTransaction
0x037f91cc rtcGetTimeAndDate
.text 0x037f93b0 0xf0 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
0x037f93b0 writePowerManagement
0x037f9408 readFirmware
.text 0x037f94a0 0x7dc d:/devkitPro/libnds/lib\libnds7.a(touch.o)
0x037f9520 CheckStylus
0x037f9b7c touchRead
0x037f9650 readTouchValue
0x037f9c48 touchReadTemperature
0x037f987c touchReadXY
0x037f94a0 UpdateRange
.text 0x037f9c7c 0x21c d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
0x037f9df4 irqEnable
0x037f9c80 irqSet
0x037f9e4c irqDisable
0x037f9cec irqInit
0x037f9c7c irqDummy
0x037f9dc0 irqInitHandler
0x037f9d3c irqClear
*fill* 0x037f9e98 0x8 ff
.text 0x037f9ea0 0x80 d:/devkitPro/libnds/lib\libnds7.a(biosCalls.o)
0x037f9eb0 swiSleep
0x037f9eea swiDecompressLZSSVram
0x037f9f02 swiGetPitchTable
0x037f9ed2 swiFastCopy
0x037f9ed6 swiSqrt
0x037f9f0a swiSwitchToGBAMode
0x037f9ea0 swiSoftReset
0x037f9eda swiCRC16
0x037f9eee swiDecompressHuffman
0x037f9f0e swiSetHaltCR
0x037f9efe swiGetSineTable
0x037f9f06 swiGetVolumeTable
0x037f9ebc swiRemainder
0x037f9ee2 swiUnpackBits
0x037f9efa swiHalt
0x037f9ee6 swiDecompressLZSSWram
0x037f9ea4 swiDelay
0x037f9ec2 swiDivMod
0x037f9ef6 swiDecompressRLEVram
0x037f9ef2 swiDecompressRLEWram
0x037f9eb8 swiDivide
0x037f9eb4 swiChangeSoundBias
0x037f9eac swiWaitForVBlank
0x037f9ea8 swiIntrWait
0x037f9ede swiIsDebugger
0x037f9ece swiCopy
.text 0x037f9f20 0xc8 d:/devkitPro/libnds/lib\libnds7.a(interruptDispatcher.o)
0x037f9f20 IntrMain
.text 0x037f9fe8 0x144 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_divsi3.o)
0x037f9fe8 __aeabi_idiv
0x037f9fe8 __divsi3
0x037fa114 __aeabi_idivmod
.text 0x037fa12c 0x4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_dvmd_tls.o)
0x037fa12c __aeabi_ldiv0
0x037fa12c __div0
0x037fa12c __aeabi_idiv0
.text 0x037fa130 0x3c d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_call_via_rX.o)
0x037fa138 _call_via_r2
0x037fa148 _call_via_r6
0x037fa144 _call_via_r5
0x037fa13c _call_via_r3
0x037fa15c _call_via_fp
0x037fa150 _call_via_r8
0x037fa14c _call_via_r7
0x037fa130 _call_via_r0
0x037fa158 _call_via_sl
0x037fa164 _call_via_sp
0x037fa154 _call_via_r9
0x037fa140 _call_via_r4
0x037fa134 _call_via_r1
0x037fa160 _call_via_ip
0x037fa168 _call_via_lr
.text 0x037fa16c 0xd4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-init.o)
0x037fa1b8 __libc_init_array
0x037fa16c __libc_fini_array
.text 0x037fa240 0x9c d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-memcpy.o)
0x037fa240 memcpy
.text 0x037fa2dc 0x7e4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o)
0x037fa694 mktime
.text 0x037faac0 0x848 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o)
0x037faac0 __tzcalc_limits
0x037fad30 _mktm_r
.text 0x037fb308 0x8 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzlock.o)
0x037fb30c __tz_unlock
0x037fb308 __tz_lock
.text 0x037fb310 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzvars.o)
.text 0x037fb310 0x6c d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-div.o)
0x037fb310 div
.text 0x037fb37c 0xc d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-gettzinfo.o)
0x037fb37c __gettzinfo
.text 0x037fb388 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
.text 0x037fb388 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtn.o
.fini 0x037fb388 0x18
*(.fini)
.fini 0x037fb388 0xc d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crti.o
0x037fb388 _fini
.fini 0x037fb394 0xc d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtn.o
0x037fb3a0 __text_end = .
.rodata 0x037fb3a0 0xcc
*(.rodata)
.rodata 0x037fb3a0 0x60 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o)
.rodata 0x037fb400 0x68 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o)
*all.rodata*(*)
*(.roda)
*(.rodata.*)
.rodata.str1.4
0x037fb468 0x4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzvars.o)
*(.gnu.linkonce.r*)
0x037fb46c . = ALIGN (0x4)
.ARM.extab
*(.ARM.extab* .gnu.linkonce.armextab.*)
0x037fb46c __exidx_start = .
.ARM.exidx
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
0x037fb46c __exidx_end = .
0x037fb46c . = ALIGN (0x4)
0x037fb46c PROVIDE (__preinit_array_start, .)
.preinit_array
*(.preinit_array)
0x037fb46c PROVIDE (__preinit_array_end, .)
0x037fb46c PROVIDE (__init_array_start, .)
.init_array 0x037fb46c 0x4
*(.init_array)
.init_array 0x037fb46c 0x4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
0x037fb470 PROVIDE (__init_array_end, .)
0x037fb470 PROVIDE (__fini_array_start, .)
.fini_array 0x037fb470 0x4
*(.fini_array)
.fini_array 0x037fb470 0x4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
0x037fb474 PROVIDE (__fini_array_end, .)
.ctors 0x037fb474 0x0
*crtbegin.o(.ctors)
*(EXCLUDE_FILE(*crtend.o) .ctors)
*(SORT(.ctors.*))
*(.ctors)
0x037fb474 . = ALIGN (0x4)
.dtors 0x037fb474 0x0
*crtbegin.o(.dtors)
*(EXCLUDE_FILE(*crtend.o) .dtors)
*(SORT(.dtors.*))
*(.dtors)
0x037fb474 . = ALIGN (0x4)
.eh_frame 0x037fb474 0x4
*(.eh_frame)
.eh_frame 0x037fb474 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
.eh_frame 0x037fb474 0x4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
0x037fb478 . = ALIGN (0x4)
.gcc_except_table
0x037fb478 0x0
*(.gcc_except_table)
0x037fb478 . = ALIGN (0x4)
.jcr 0x037fb478 0x4
*(.jcr)
.jcr 0x037fb478 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
.jcr 0x037fb478 0x4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
.got
*(.got.plt)
*(.got)
.iwram 0x037fb47c 0x0
0x037fb47c __iwram_start = <code 342> (.)
*(.iwram)
*iwram.*(.text)
0x037fb47c . = ALIGN (0x4)
0x037fb47c __iwram_end = <code 342> (.)
.data 0x037fb47c 0x54
0x037fb47c __data_start = <code 342> (.)
*(.data)
.data 0x037fb47c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o
.data 0x037fb47c 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crti.o
.data 0x037fb47c 0x4 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
0x037fb47c __dso_handle
.data 0x037fb480 0x4 main.o
.data 0x037fb484 0x0 ret_menu7_Gen.o
.data 0x037fb484 0x0 ret_menu7_R4.o
.data 0x037fb484 0x0 ret_menu7_mse.o
.data 0x037fb484 0x0 linkreset_arm7.o
.data 0x037fb484 0x0 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.data 0x037fb484 0x0 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.data 0x037fb484 0x1 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.data 0x037fb485 0x0 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.data 0x037fb485 0x0 d:/devkitPro/libnds/lib\libnds7.a(biosCalls.o)
.data 0x037fb485 0x0 d:/devkitPro/libnds/lib\libnds7.a(interruptDispatcher.o)
.data 0x037fb485 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_divsi3.o)
.data 0x037fb485 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_dvmd_tls.o)
.data 0x037fb485 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_call_via_rX.o)
.data 0x037fb485 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-init.o)
.data 0x037fb485 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-memcpy.o)
.data 0x037fb485 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o)
.data 0x037fb485 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o)
.data 0x037fb485 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzlock.o)
*fill* 0x037fb485 0x3 ff
.data 0x037fb488 0x8 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzvars.o)
0x037fb488 _tzname
.data 0x037fb490 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-div.o)
.data 0x037fb490 0x40 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-gettzinfo.o)
.data 0x037fb4d0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
.data 0x037fb4d0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtn.o
*(.data.*)
*(.gnu.linkonce.d*)
0x037fb4d0 . = ALIGN (0x4)
0x037fb4d0 __data_end = <code 342> (.)
.bss 0x037fb4d0 0x11c
0x037fb4d0 __bss_start = <code 342> (.)
0x037fb4d0 __bss_start__ = <code 342> (.)
*(.dynbss)
*(.gnu.linkonce.b*)
*(.bss*)
.bss 0x037fb4d0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o
.bss 0x037fb4d0 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crti.o
.bss 0x037fb4d0 0x1c d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
.bss 0x037fb4ec 0x0 main.o
.bss 0x037fb4ec 0x0 ret_menu7_Gen.o
.bss 0x037fb4ec 0x0 ret_menu7_R4.o
.bss 0x037fb4ec 0x0 ret_menu7_mse.o
.bss 0x037fb4ec 0x0 linkreset_arm7.o
.bss 0x037fb4ec 0x0 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.bss 0x037fb4ec 0x0 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.bss 0x037fb4ec 0x14 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.bss 0x037fb500 0x0 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.bss 0x037fb500 0x0 d:/devkitPro/libnds/lib\libnds7.a(biosCalls.o)
.bss 0x037fb500 0x0 d:/devkitPro/libnds/lib\libnds7.a(interruptDispatcher.o)
.bss 0x037fb500 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_divsi3.o)
.bss 0x037fb500 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_dvmd_tls.o)
.bss 0x037fb500 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_call_via_rX.o)
.bss 0x037fb500 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-init.o)
.bss 0x037fb500 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-memcpy.o)
.bss 0x037fb500 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o)
.bss 0x037fb500 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o)
.bss 0x037fb500 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzlock.o)
.bss 0x037fb500 0x8 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzvars.o)
0x037fb500 _daylight
0x037fb504 _timezone
.bss 0x037fb508 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-div.o)
.bss 0x037fb508 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-gettzinfo.o)
.bss 0x037fb508 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
.bss 0x037fb508 0x0 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtn.o
*(COMMON)
COMMON 0x037fb508 0x18 main.o
0x037fb508 tempPos
0x037fb514 first
COMMON 0x037fb520 0x4 ret_menu7_Gen.o
0x037fb520 _menu7_Gen
COMMON 0x037fb524 0xc8 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
0x037fb524 irqTable
0x037fb5ec . = ALIGN (0x4)
0x037fb5ec __bss_end = .
0x037fb5ec __bss_end__ = .
0x037fb5ec _end = .
0x037fb5ec __end__ = .
0x037fb5ec PROVIDE (end, _end)
.stab
*(.stab)
.stabstr
*(.stabstr)
.stab.excl
*(.stab.excl)
.stab.exclstr
*(.stab.exclstr)
.stab.index
*(.stab.index)
.stab.indexstr
*(.stab.indexstr)
.comment 0x00000000 0x2e2
*(.comment)
.comment 0x00000000 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
.comment 0x00000029 0x29 main.o
.comment 0x00000052 0x29 ret_menu7_Gen.o
.comment 0x0000007b 0x29 ret_menu7_R4.o
.comment 0x000000a4 0x29 ret_menu7_mse.o
.comment 0x000000cd 0x29 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.comment 0x000000f6 0x29 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.comment 0x0000011f 0x29 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.comment 0x00000148 0x29 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.comment 0x00000171 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-init.o)
.comment 0x0000019a 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-memcpy.o)
.comment 0x000001c3 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o)
.comment 0x000001ec 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o)
.comment 0x00000215 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzlock.o)
.comment 0x0000023e 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzvars.o)
.comment 0x00000267 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-div.o)
.comment 0x00000290 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-gettzinfo.o)
.comment 0x000002b9 0x29 d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
.debug
*(.debug)
.line
*(.line)
.debug_srcinfo
*(.debug_srcinfo)
.debug_sfnames
*(.debug_sfnames)
.debug_aranges 0x00000000 0x120
*(.debug_aranges)
.debug_aranges
0x00000000 0x20 main.o
.debug_aranges
0x00000020 0x20 ret_menu7_Gen.o
.debug_aranges
0x00000040 0x20 ret_menu7_R4.o
.debug_aranges
0x00000060 0x20 ret_menu7_mse.o
.debug_aranges
0x00000080 0x20 linkreset_arm7.o
.debug_aranges
0x000000a0 0x20 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.debug_aranges
0x000000c0 0x20 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.debug_aranges
0x000000e0 0x20 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.debug_aranges
0x00000100 0x20 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.debug_pubnames
0x00000000 0x34b
*(.debug_pubnames)
.debug_pubnames
0x00000000 0xcd main.o
.debug_pubnames
0x000000cd 0x44 ret_menu7_Gen.o
.debug_pubnames
0x00000111 0x23 ret_menu7_R4.o
.debug_pubnames
0x00000134 0x24 ret_menu7_mse.o
.debug_pubnames
0x00000158 0xbb d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.debug_pubnames
0x00000213 0x3c d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.debug_pubnames
0x0000024f 0x7c d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.debug_pubnames
0x000002cb 0x80 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.debug_info 0x00000000 0x1e10
*(.debug_info)
.debug_info 0x00000000 0x85b main.o
.debug_info 0x0000085b 0x1d5 ret_menu7_Gen.o
.debug_info 0x00000a30 0x198 ret_menu7_R4.o
.debug_info 0x00000bc8 0xdb ret_menu7_mse.o
.debug_info 0x00000ca3 0x82 linkreset_arm7.o
.debug_info 0x00000d25 0x74b d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.debug_info 0x00001470 0x140 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.debug_info 0x000015b0 0x615 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.debug_info 0x00001bc5 0x24b d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.debug_abbrev 0x00000000 0xa67
*(.debug_abbrev)
.debug_abbrev 0x00000000 0x2cc main.o
.debug_abbrev 0x000002cc 0xb7 ret_menu7_Gen.o
.debug_abbrev 0x00000383 0xf2 ret_menu7_R4.o
.debug_abbrev 0x00000475 0x85 ret_menu7_mse.o
.debug_abbrev 0x000004fa 0x14 linkreset_arm7.o
.debug_abbrev 0x0000050e 0x1a8 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.debug_abbrev 0x000006b6 0xa4 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.debug_abbrev 0x0000075a 0x1d8 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.debug_abbrev 0x00000932 0x135 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.debug_line 0x00000000 0xe62
*(.debug_line)
.debug_line 0x00000000 0x2a6 main.o
.debug_line 0x000002a6 0x14f ret_menu7_Gen.o
.debug_line 0x000003f5 0x180 ret_menu7_R4.o
.debug_line 0x00000575 0x109 ret_menu7_mse.o
.debug_line 0x0000067e 0x69 linkreset_arm7.o
.debug_line 0x000006e7 0x1e7 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.debug_line 0x000008ce 0x118 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.debug_line 0x000009e6 0x321 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.debug_line 0x00000d07 0x15b d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.debug_frame 0x00000000 0x4e8
*(.debug_frame)
.debug_frame 0x00000000 0x114 main.o
.debug_frame 0x00000114 0x44 ret_menu7_Gen.o
.debug_frame 0x00000158 0x50 ret_menu7_R4.o
.debug_frame 0x000001a8 0x28 ret_menu7_mse.o
.debug_frame 0x000001d0 0x144 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.debug_frame 0x00000314 0x44 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.debug_frame 0x00000358 0xe0 d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.debug_frame 0x00000438 0xb0 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.debug_str 0x00000000 0x8b6
*(.debug_str)
.debug_str 0x00000000 0x33d main.o
0x3c5 (size before relaxing)
.debug_str 0x0000033d 0x87 ret_menu7_Gen.o
0x179 (size before relaxing)
.debug_str 0x000003c4 0x61 ret_menu7_R4.o
0x148 (size before relaxing)
.debug_str 0x00000425 0x44 ret_menu7_mse.o
0x12b (size before relaxing)
.debug_str 0x00000469 0x18b d:/devkitPro/libnds/lib\libnds7.a(clock.o)
0x3aa (size before relaxing)
.debug_str 0x000005f4 0x71 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
0x173 (size before relaxing)
.debug_str 0x00000665 0x18e d:/devkitPro/libnds/lib\libnds7.a(touch.o)
0x2fa (size before relaxing)
.debug_str 0x000007f3 0xc3 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
0x1b4 (size before relaxing)
.debug_loc 0x00000000 0x1482
*(.debug_loc)
.debug_loc 0x00000000 0x346 main.o
.debug_loc 0x00000346 0x2ac ret_menu7_Gen.o
.debug_loc 0x000005f2 0x119 ret_menu7_R4.o
.debug_loc 0x0000070b 0x5f ret_menu7_mse.o
.debug_loc 0x0000076a 0x446 d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.debug_loc 0x00000bb0 0xf2 d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.debug_loc 0x00000ca2 0x6ab d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.debug_loc 0x0000134d 0x135 d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.debug_macinfo
*(.debug_macinfo)
.debug_weaknames
*(.debug_weaknames)
.debug_funcnames
*(.debug_funcnames)
.debug_typenames
*(.debug_typenames)
.debug_varnames
*(.debug_varnames)
.stack 0x00080000 0x0
0x00080000 _stack = .
*(.stack)
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crti.o
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
LOAD main.o
LOAD ret_menu7_Gen.o
LOAD ret_menu7_R4.o
LOAD ret_menu7_mse.o
LOAD linkreset_arm7.o
LOAD d:/devkitPro/libnds/lib\libnds7.a
START GROUP
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libc.a
END GROUP
START GROUP
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libsysbase.a
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libc.a
END GROUP
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
LOAD d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtn.o
OUTPUT(d:/NDSŠJ”­/GBA_ExpLoader5/arm7/arm7.elf elf32-littlearm)
.ARM.attributes
0x00000000 0x10
.ARM.attributes
0x00000000 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/ds_arm7_crt0.o
.ARM.attributes
0x0000001e 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crti.o
.ARM.attributes
0x0000003c 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtbegin.o
.ARM.attributes
0x0000005a 0x1e main.o
.ARM.attributes
0x00000078 0x1e ret_menu7_Gen.o
.ARM.attributes
0x00000096 0x1e ret_menu7_R4.o
.ARM.attributes
0x000000b4 0x1e ret_menu7_mse.o
.ARM.attributes
0x000000d2 0x1e linkreset_arm7.o
.ARM.attributes
0x000000f0 0x1e d:/devkitPro/libnds/lib\libnds7.a(clock.o)
.ARM.attributes
0x0000010e 0x1e d:/devkitPro/libnds/lib\libnds7.a(spi.o)
.ARM.attributes
0x0000012c 0x1e d:/devkitPro/libnds/lib\libnds7.a(touch.o)
.ARM.attributes
0x0000014a 0x1e d:/devkitPro/libnds/lib\libnds7.a(interrupts.o)
.ARM.attributes
0x00000168 0x1e d:/devkitPro/libnds/lib\libnds7.a(biosCalls.o)
.ARM.attributes
0x00000186 0x1e d:/devkitPro/libnds/lib\libnds7.a(interruptDispatcher.o)
.ARM.attributes
0x000001a4 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_divsi3.o)
.ARM.attributes
0x000001c2 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_dvmd_tls.o)
.ARM.attributes
0x000001e0 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2\libgcc.a(_call_via_rX.o)
.ARM.attributes
0x000001fe 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-init.o)
.ARM.attributes
0x0000021c 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-memcpy.o)
.ARM.attributes
0x0000023a 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktime.o)
.ARM.attributes
0x00000258 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-mktm_r.o)
.ARM.attributes
0x00000276 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzlock.o)
.ARM.attributes
0x00000294 0x1c d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-tzvars.o)
.ARM.attributes
0x000002b0 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-div.o)
.ARM.attributes
0x000002ce 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib\libg.a(lib_a-gettzinfo.o)
.ARM.attributes
0x000002ec 0x1c d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtend.o
.ARM.attributes
0x00000308 0x1e d:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/crtn.o
.debug_ranges 0x00000000 0xd0
.debug_ranges 0x00000000 0x88 main.o
.debug_ranges 0x00000088 0x48 d:/devkitPro/libnds/lib\libnds7.a(touch.o)

View File

@ -1,18 +0,0 @@
#ifdef __cplusplus
extern "C" {
#endif
void LinkReset_ARM7();
#ifdef __cplusplus
}
#endif
/*
--------------------------
EDIY Studio
http://www.gbalink.net
http://www.ds-link.net
--------------------------
*/

View File

@ -1,20 +0,0 @@
.TEXT
.ARM
@---------------------------------------------------------------------------------------
.GLOBAL LinkReset_ARM7
.func LinkReset_ARM7
@---------------------------------------------------------------------------------------
LinkReset_ARM7:
MOV R12,#0x2800000
LDR R1,[R12,#-0x1DC]
ADD R1,R1,#0x1FC
CMP R12, R1
SUBEQ R15,R12,#0x700000
BX LR
.endfunc
.end

View File

@ -1,53 +1,35 @@
/*---------------------------------------------------------------------------------
default ARM7 core
Copyright (C) 2005 - 2010
Michael Noland (joat)
Jason Rogers (dovoto)
Dave Murphy (WinterMute)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
---------------------------------------------------------------------------------*/
#include <nds.h>
#include <stdlib.h>
#include <string.h>
#include "linkreset_arm7.h"
extern void ret_menu7_R4(void);
extern void ret_menu7_Gen(void);
extern void ret_menu7_mse(void);
#define IPC_CMD_GBAMODE 1
#define IPC_CMD_SLOT2 2
#define IPC_CMD_TURNOFF 9
#define IPC_CMD_SR_R4TF 11
#define IPC_CMD_SR_DLMS 12
#define IPC_CMD_SR_GEN 13
#define IPC_CMD_SR_MSE 14
void FIFOInit()
{
REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR;
}
static void prepairReset()
{
vu32 vr;
u32 i;
powerON(POWER_SOUND);
for(i = 0x040000B0; i < (0x040000B0+0x30); i+=4) {
*((vu32*)i) = 0;
}
REG_IME = IME_DISABLE;
REG_IE = 0;
REG_IF = ~0;
for(vr = 0; vr < 0x100; vr++); // Wait ARM9
swiSoftReset();
}
void gbaMode()
{
/*void gbaMode() {
vu32 vr;
REG_IME = IME_DISABLE;
@ -62,236 +44,48 @@ void gbaMode()
// asm("swi 0x1F0000");
while(1);
}
__attribute__((noinline)) u8 PM_GetRegister(int reg)
{
// while(REG_SPICNT & SPI_BUSY)
// SWI_WaitByLoop(1);
SerialWaitBusy();
REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER |SPI_BAUD_1MHz | SPI_CONTINUOUS;
REG_SPIDATA = reg | 0x80;
SerialWaitBusy();
// while(REG_SPICNT & SPI_BUSY)
// SWI_WaitByLoop(1);
REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER |SPI_BAUD_1MHz ;
REG_SPIDATA = 0;
SerialWaitBusy();
// while(REG_SPICNT & SPI_BUSY)
// SWI_WaitByLoop(1);
return REG_SPIDATA & 0xff;
}
__attribute__((noinline)) void PM_SetRegister(int reg, int control)
{
SerialWaitBusy();
// while(REG_SPICNT & SPI_BUSY)
// SWI_WaitByLoop(1);
REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER | SPI_BAUD_1MHz | SPI_CONTINUOUS;
REG_SPIDATA = reg;
SerialWaitBusy();
// while(REG_SPICNT & SPI_BUSY)
// SWI_WaitByLoop(1);
REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER | SPI_BAUD_1MHz;
REG_SPIDATA = control;
}*/
}
volatile bool exitflag = false;
void PM_SetControl(int control)
{
PM_SetRegister(0, PM_GetRegister(0) | control);
}
void powerButtonCB() { exitflag = true; }
void VblankHandler(void) { /*Wifi_Update();*/ }
//---------------------------------------------------------------------------------
void startSound(int sampleRate, const void* data, u32 bytes, u8 channel, u8 vol, u8 pan, u8 format) {
//---------------------------------------------------------------------------------
SCHANNEL_TIMER(channel) = SOUND_FREQ(sampleRate);
SCHANNEL_SOURCE(channel) = (u32)data;
SCHANNEL_LENGTH(channel) = bytes >> 2 ;
SCHANNEL_CR(channel) = SCHANNEL_ENABLE | SOUND_ONE_SHOT | SOUND_VOL(vol) | SOUND_PAN(pan) | (format==1?SOUND_8BIT:SOUND_16BIT);
}
void VcountHandler() { inputGetAndSend(); }
//---------------------------------------------------------------------------------
s32 getFreeSoundChannel() {
//---------------------------------------------------------------------------------
int i;
for (i=0; i<16; i++) {
if ( (SCHANNEL_CR(i) & SCHANNEL_ENABLE) == 0 ) return i;
}
return -1;
}
touchPosition first,tempPos;
//---------------------------------------------------------------------------------
void VcountHandler() {
//---------------------------------------------------------------------------------
static int lastbut = -1;
int main() {
readUserSettings();
ledBlink(0);
uint16 but=0, x=0, y=0, xpx=0, ypx=0, z1=0, z2=0;
but = REG_KEYXY;
if (!( (but ^ lastbut) & (1<<6))) {
tempPos = touchReadXY();
if ( tempPos.x == 0 || tempPos.y == 0 ) {
but |= (1 <<6);
lastbut = but;
} else {
x = tempPos.x;
y = tempPos.y;
xpx = tempPos.px;
ypx = tempPos.py;
z1 = tempPos.z1;
z2 = tempPos.z2;
}
} else {
lastbut = but;
but |= (1 <<6);
}
IPC->touchX = x;
IPC->touchY = y;
IPC->touchXpx = xpx;
IPC->touchYpx = ypx;
IPC->touchZ1 = z1;
IPC->touchZ2 = z2;
IPC->buttons = but;
}
/***
#define READ_TIME_AND_DATE 0x65
//---------------------------------------------------------------------------------
void rtcGetTimeAndDate(uint8 * time) {
//---------------------------------------------------------------------------------
uint8 command, status;
command = READ_TIME_AND_DATE;
rtcTransaction(&command, 1, time, 7);
command = READ_STATUS_REG1;
rtcTransaction(&command, 1, &status, 1);
if ( status & STATUS_24HRS ) {
time[4] &= 0x3f;
} else {
}
BCDToInteger(time,7);
}
**/
//---------------------------------------------------------------------------------
void VblankHandler(void) {
//---------------------------------------------------------------------------------
u32 fifo;
if(!(REG_IPC_FIFO_CR & IPC_FIFO_RECV_EMPTY)) {
fifo = REG_IPC_FIFO_RX;
if(fifo == IPC_CMD_GBAMODE)
gbaMode();
if(fifo == IPC_CMD_SLOT2) {
prepairReset();
}
if(fifo == IPC_CMD_TURNOFF) {
PM_SetControl(1<<6);
while(1);
}
if(fifo == IPC_CMD_SR_R4TF)
ret_menu7_R4();
if(fifo == IPC_CMD_SR_DLMS)
LinkReset_ARM7();
if(fifo == IPC_CMD_SR_GEN)
ret_menu7_Gen();
if(fifo == IPC_CMD_SR_MSE)
ret_menu7_mse();
}
u32 i;
//sound code :)
TransferSound *snd = IPC->soundData;
IPC->soundData = 0;
if (0 != snd) {
for (i=0; i<snd->count; i++) {
s32 chan = getFreeSoundChannel();
if (chan >= 0) {
startSound(snd->data[i].rate, snd->data[i].data, snd->data[i].len, chan, snd->data[i].vol, snd->data[i].pan, snd->data[i].format);
}
}
}
uint8 ct[sizeof(IPC->time.curtime)];
int t1, t2;
rtcGetTimeAndDate((uint8 *)ct);
IPC->time.rtc.year = ct[0];
IPC->time.rtc.month = ct[1];
IPC->time.rtc.day = ct[2];
IPC->time.rtc.weekday = ct[3];
IPC->time.rtc.hours = (ct[4]<12) ? ct[4] : ct[4]+40;
IPC->time.rtc.minutes = ct[5];
IPC->time.rtc.seconds = ct[6];
IPC->temperature = touchReadTemperature(&t1, &t2);
IPC->tdiode1 = t1;
IPC->tdiode2 = t2;
}
//---------------------------------------------------------------------------------
int main(int argc, char ** argv) {
//---------------------------------------------------------------------------------
// memset((void*)IPC, 0, sizeof(IPC));
// rtcReset();
FIFOInit();
//enable sound
powerON(POWER_SOUND);
SOUND_CR = SOUND_ENABLE | SOUND_VOL(0x7F);
IPC->soundData = 0;
irqInit();
// Start the RTC tracking IRQ
initClockIRQ();
fifoInit();
touchInit();
SetYtrigger(80);
irqSet(IRQ_VBLANK, VblankHandler);
installSystemFIFO();
irqSet(IRQ_VCOUNT, VcountHandler);
irqSet(IRQ_VBLANK, VblankHandler);
irqEnable( IRQ_VBLANK | IRQ_VCOUNT);
/*if (REG_SNDEXTCNT != 0) {
i2cWriteRegister(0x4A, 0x12, 0x00); // Press power-button for auto-reset
i2cWriteRegister(0x4A, 0x70, 0x01); // Bootflag = Warmboot/SkipHealthSafety
}*/
irqEnable(IRQ_VBLANK | IRQ_VCOUNT);
while(1) {
swiWaitForVBlank();
}
setPowerButtonCB(powerButtonCB);
// Keep the ARM7 mostly idle
while(1)swiWaitForVBlank();
return 0;
}

View File

@ -1,163 +0,0 @@
/***********************************************************
Arm7 Soft rest for General purpose
by Rudolph (<EFBFBD>cé)
***************************************************************/
#include <nds.h>
//#include <nds/registers_alt.h> // devkitPror20
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ARM7_PROG (0x03810000 - 0xA00)
typedef void (* FN_MEDIUM_ARM7)(void);
FN_MEDIUM_ARM7 _menu7_Gen;
extern void _menu7_Gen_s();
void ret_menu7_Gen()
{
u32 *adr;
u32 *buf;
u32 i;
while((*(vu32*)0x027FFDFC) != 0x027FFDF8) { // Timing adjustment with ARM9
vu32 w;
for(w=0;w<0x100;w++){
}
}
REG_IME = IME_DISABLE; // Disable interrupts
REG_IF = REG_IF; // Acknowledge interrupt
// REG_IME = 0;
for (i = 0x04000400; i < 0x04000500; i+=4) {
*((u32*)i) = 0;
}
SOUND_CR = 0;
for(i = 0x040000B0; i < (0x040000B0+0x30); i+=4) {
*((vu32*)i) = 0;
}
for(i = 0x04000100; i < 0x04000110; i+=2) {
*((u16*)i) = 0;
}
//switch to user mode
asm("mov r0, #0x1F");
asm("msr cpsr, r0");
adr = (u32*)ARM7_PROG;
buf = (u32*)_menu7_Gen_s;
for(i = 0; i < 0x200/4; i++) {
*adr = *buf;
adr++;
buf++;
}
_menu7_Gen = (FN_MEDIUM_ARM7)ARM7_PROG;
_menu7_Gen();
while(1);
}
void _menu7_Gen_s()
{
u32 *adr;
u32 *bufh, *buf7, *buf9;
u32 siz;
u32 i;
u32 *arm9s, *arm9e;
u32 *arm7s, *arm7e;
bufh = (u32*)(*(vu32*)0x027FFDF4);
adr = (u32*)0x027FFE00;
for(i = 0; i < 512/4; i++) { // Header
*adr = *bufh;
adr++;
bufh++;
}
buf9 = bufh;
buf7 = buf9 + ((*(vu32*)0x027FFE2C) / 4);
adr = (u32*)(*(vu32*)0x027FFE38);
siz = (*(vu32*)0x027FFE3C);
for(i = 0; i < siz/4; i++) { // ARM7
*adr = *buf7;
adr++;
buf7++;
}
arm7e = adr;
adr = (u32*)(*(vu32*)0x027FFE28);
siz = (*(vu32*)0x027FFE2C);
if(adr < buf9) { // ARM9
for(i = 0; i < siz/4; i++) {
*adr = *buf9;
adr++;
buf9++;
}
arm9e = adr;
} else {
adr += (siz/4 - 1);
buf9 += (siz/4 - 1);
arm9e = adr + 1;
for(i = 0; i < siz/4; i++) {
*adr = *buf9;
adr--;
buf9--;
}
}
arm7s = (u32*)(*(vu32*)0x027FFE38);
if(arm7s > (u32*)0x023FF800)
arm7s = (u32*)0x023FF800;
arm9s = (u32*)(*(vu32*)0x027FFE28);
if(arm9s > arm7s) {
adr = arm9s;
arm9s = arm7s;
arm7s = adr;
adr = arm9e;
arm9e = arm7e;
arm7e = adr;
}
adr = (u32*)0x02000000;
while(adr < arm9s) {
*adr = 0x00000000;
adr++;
}
while(arm9e < arm7s) {
*arm9e = 0x00000000;
arm9e++;
}
while(arm7e < (u32*)0x023FF800) {
*arm7e = 0x00000000;
arm7e++;
}
REG_IE = 0;
REG_IF = ~0;
(*(vu32*)(0x04000000-4)) = 0; //IRQ_HANDLER ARM7 version
(*(vu32*)(0x04000000-8)) = ~0; //VBLANK_INTR_WAIT_FLAGS, ARM7 version
REG_POWERCNT = 1; //turn off power to stuffs
*(vu32*)0x027FFDFC = *(vu32*)0x027FFE24;
asm("swi 0x00"); // JUMP 0x027FFE34
while(1);
// swiSoftReset();
}

View File

@ -1,156 +0,0 @@
/***********************************************************
by Rudolph (<EFBFBD>cé)
2007/05/24 First release
2007/05/27 Timing adjustment with ARM9
------------------------------------------------------------
SoftwareReset Routines for R4DS or M3SimplyDS.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
that the following conditions are met:
Only the Homebrew application can be used.
It is not possible to use it by a business purpose.
This software is made based on information obtained
by Reverse engineering.
Please use that at once when a source code that is
more formal than the official is open to the public.
***************************************************************/
#include <nds.h>
//#include <nds/registers_alt.h> // devkitPror20
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int _set_r4menu()
{
u32 add;
add = (*(vu32*)0x027FFE18);
while(CARD_CR2 & CARD_BUSY);
CARD_CR1H = 0xC0;
CARD_COMMAND[0] = 0xB4;
CARD_COMMAND[1] = (add >> 24) & 0xFF;
CARD_COMMAND[2] = (add >> 16) & 0xFF;
CARD_COMMAND[3] = (add >> 8) & 0xFF;
CARD_COMMAND[4] = add & 0xFF;
// CARD_COMMAND[5] = 0x00;
// CARD_COMMAND[6] = 0x00;
// CARD_COMMAND[7] = 0x00;
CARD_CR2 = 0xA7586000;
while(!(CARD_CR2 & CARD_DATA_READY));
return(CARD_DATA_RD);
}
static int _read_r4menu(char *buf, u32 blk)
{
int s = 0;
u32 *buf32;
buf32 = (u32*)buf;
blk *= 2;
do {
while(CARD_CR2 & CARD_BUSY);
CARD_CR1H = 0xC0;
CARD_COMMAND[0] = 0xB6;
CARD_COMMAND[1] = (blk >> 16) & 0xFF;
CARD_COMMAND[2] = (blk >> 8) & 0xFF;
CARD_COMMAND[3] = blk & 0xFF;
CARD_COMMAND[4] = 0x00;
// CARD_COMMAND[5] = 0x00;
// CARD_COMMAND[6] = 0x00;
// CARD_COMMAND[7] = 0x00;
CARD_CR2 = 0xA7586000;
while(!(CARD_CR2 & CARD_DATA_READY));
} while(CARD_DATA_RD);
while(CARD_CR2 & CARD_BUSY);
CARD_CR1H = 0xC0;
CARD_COMMAND[0] = 0xBF;
CARD_COMMAND[1] = (blk >> 16) & 0xFF;
CARD_COMMAND[2] = (blk >> 8) & 0xFF;
CARD_COMMAND[3] = blk & 0xFF;
CARD_COMMAND[4] = 0x00;
// CARD_COMMAND[5] = 0x00;
// CARD_COMMAND[6] = 0x00;
// CARD_COMMAND[7] = 0x00;
CARD_CR2 = 0xA1586000;
do {
while(!(CARD_CR2 & CARD_DATA_READY));
*buf32 = CARD_DATA_RD;
buf32++;
s += 4;
} while(CARD_CR2 & CARD_BUSY);
return(s);
}
void ret_menu7_R4()
{
char *adr;
u32 blk, siz;
u32 i;
u32 *mem;
REG_IME = 0;
REG_IE = 0;
REG_IF = REG_IF;
REG_IPC_SYNC = 0;
DMA0_CR = 0;
DMA1_CR = 0;
DMA2_CR = 0;
DMA3_CR = 0;
while((*(vu32*)0x027FFDFC) != 0x027FFDF8); // Timing adjustment with ARM9
mem = (u32*)0x02000000;
for(i = 0; i < 0x3FF800/4; i++) {
*mem = 0x00000000;
mem++;
}
// memset((u8*)0x2000000, 0x00, 0x3FF800);
while(_set_r4menu());
adr = (char*)0x027FFE00;
_read_r4menu(adr, 0); // Header
blk = (*(vu32*)0x027FFE20) / 512;
adr = (char*)(*(vu32*)0x027FFE28);
siz = (*(vu32*)0x027FFE2C);
for(i = 0; i < siz; i += 512) { // ARM9
_read_r4menu(adr, blk);
blk++;
adr += 512;
}
blk = (*(vu32*)0x027FFE30) / 512;
adr = (char*)(*(vu32*)0x027FFE38);
siz = (*(vu32*)0x027FFE3C);
for(i = 0; i < siz; i += 512) { // ARM7
_read_r4menu(adr, blk);
blk++;
adr += 512;
}
*(vu32*)0x027FFDFC = *(vu32*)0x027FFE24;
asm("swi 0x00"); // JUMP 0x027FFE34
while(1);
}

View File

@ -1,58 +0,0 @@
/***********************************************************
Arm7 Soft rest for reset.mse
by Rudolph (<EFBFBD>cé)
***************************************************************/
#include <nds.h>
//#include <nds/registers_alt.h> // devkitPror20
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void ret_menu7_mse()
{
u32 i;
while(*((vu32*)0x027FFDFC) != 0x06000000) { // Timing adjustment with ARM9
vu32 w;
for(w=0;w<0x100;w++){
}
}
REG_IME = IME_DISABLE; // Disable interrupts
REG_IF = REG_IF; // Acknowledge interrupt
for (i = 0x04000400; i < 0x04000500; i+=4) {
*((u32*)i) = 0;
}
SOUND_CR = 0;
for(i = 0x040000B0; i < (0x040000B0+0x30); i+=4) {
*((vu32*)i) = 0;
}
for(i = 0x04000100; i < 0x04000110; i+=2) {
*((u16*)i) = 0;
}
//switch to user mode
asm("mov r0, #0x1F");
asm("msr cpsr, r0");
REG_IE = 0;
REG_IF = ~0;
(*(vu32*)(0x04000000-4)) = 0; //IRQ_HANDLER ARM7 version
(*(vu32*)(0x04000000-8)) = ~0; //VBLANK_INTR_WAIT_FLAGS, ARM7 version
REG_POWERCNT = 1; //turn off power to stuffs
*((vu32*)0x027FFE34) = *((vu32*)0x027FFDFC); // Bootloader start address
// asm("swi 0x00"); // JUMP 0x027FFE34
swiSoftReset();
while(1);
}

View File

@ -11,130 +11,131 @@ include $(DEVKITARM)/ds_rules
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
# DATA is a list of directories containing binary files
# DATA is a list of directories containing binary files embedded using bin2o
# GRAPHICS is a list of directories containing image files to be converted with grit
# all directories are relative to this makefile
#---------------------------------------------------------------------------------
BUILD := build
SOURCES := source data \
source/tarosa
INCLUDES := include build source/tarosa source/libfat
DATA := data
# SOURCES := source fonts source/tarosa source/card
# INCLUDES := include build source/tarosa source/card
SOURCES := source data source/tarosa
INCLUDES := include build source/tarosa
DATA := data
STATICLIBS :=
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -mthumb -mthumb-interwork
#
# note: arm9tdmi isn't the correct CPU arch, but anything newer and LD
# *insists* it has a FPU or VFP, and it won't take no for an answer!
CFLAGS := -g -Wall -O2\
-mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
-ffast-math \
$(ARCH)
CFLAGS += $(INCLUDE) -DARM9
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
#--ansi
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -mno-fpu -Wl,-Map,../arm9.map
# $(ARCH) $(INCLUDE) -DARM9 -D_LegacyCardLib
ARCH := -mthumb-interwork
CFLAGS := -g -Wall -O2 \
$(ARCH) $(INCLUDE) -DARM9
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=dsi_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lfat -lnds9
# LIBS := -lfat -ldswifi9 -lnds9
# disable Wifi lib. It's not being used in this build
LIBS := -lfat -lnds329
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(LIBNDS) $(LIBIORPG) $(LIBFAT)
LIBDIRS := $(LIBNDS) $(PORTLIBS)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export ARM9BIN := $(CURDIR)/arm9.bin
export ARM9ELF := $(CURDIR)/arm9.elf
export DEPSDIR := $(CURDIR)/$(BUILD)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
export ARM9ELF := $(CURDIR)/$(TARGET).elf
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \
$(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BMPFILES := $(foreach dir,$(GRAPHICS),$(notdir $(wildcard $(dir)/*.bmp)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(BMPFILES:.bmp=.o) $(OFILES_BIN) $(OFILES_SOURCES)
export HFILES := $(BMPFILES:.bmp=.h) $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\
$(foreach dir,$(LIBDIRS),-I$(dir)/include)\
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
.PHONY: $(BUILD) clean
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) *.elf *.nds* *.bin
@rm -fr $(BUILD) $(TARGET).elf
#---------------------------------------------------------------------------------
else
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(ARM9BIN) : $(ARM9ELF)
@$(OBJCOPY) -O binary $< $@
@echo built ... $(notdir $@)
$(ARM9ELF) : $(OFILES)
$(ARM9ELF) : $(OFILES)
@echo linking $(notdir $@)
@$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o : %.bin
%.bin.o %_bin.h : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
#---------------------------------------------------------------------------------
# This rule creates assembly source files using grit
# grit takes an image file and a .grit describing how the file is to be processed
# add additional rules like this for each image extension
# you use in the graphics folders
#---------------------------------------------------------------------------------
%.s %.h: %.bmp %.grit
#---------------------------------------------------------------------------------
grit $< -fts -o$*
-include $(DEPSDIR)/*.d
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -1,54 +0,0 @@
/*
common.h
Common definitions and included files for the FATlib
Copyright (c) 2006 Michael "Chishm" Chisholm
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2006-07-11 - Chishm
* Original release
*/
#ifndef _COMMON_H
#define _COMMON_H
// When compiling for NDS, make sure NDS is defined
#ifndef NDS
#if defined ARM9 || defined ARM7
#define NDS
#endif
#endif
#ifdef NDS
#include <nds/jtypes.h>
#else
#include "gba_types.h"
#endif
#define BYTES_PER_READ 512
#ifndef NULL
#define NULL 0
#endif
#endif // _COMMON_H

View File

@ -1,171 +0,0 @@
/*
directory.h
Reading, writing and manipulation of the directory structure on
a FAT partition
Copyright (c) 2006 Michael "Chishm" Chisholm
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2006-07-11 - Chishm
* Original release
*/
#ifndef _DIRECTORY_H
#define _DIRECTORY_H
#include <sys/stat.h>
#include "common.h"
#include "partition.h"
#define DIR_ENTRY_DATA_SIZE 0x20
#define MAX_FILENAME_LENGTH 256
#define MAX_ALIAS_LENGTH 13
#define LFN_ENTRY_LENGTH 13
#define FAT16_ROOT_DIR_CLUSTER 0
#define DIR_SEPARATOR '/'
// File attributes
#define ATTRIB_ARCH 0x20 // Archive
#define ATTRIB_DIR 0x10 // Directory
#define ATTRIB_LFN 0x0F // Long file name
#define ATTRIB_VOL 0x08 // Volume
#define ATTRIB_SYS 0x04 // System
#define ATTRIB_HID 0x02 // Hidden
#define ATTRIB_RO 0x01 // Read only
typedef enum {FT_DIRECTORY, FT_FILE} FILE_TYPE;
typedef struct {
u32 cluster;
u32 sector;
s32 offset;
} DIR_ENTRY_POSITION;
typedef struct {
u8 entryData[DIR_ENTRY_DATA_SIZE];
DIR_ENTRY_POSITION dataStart; // Points to the start of the LFN entries of a file, or the alias for no LFN
DIR_ENTRY_POSITION dataEnd; // Always points to the file/directory's alias entry
char filename[MAX_FILENAME_LENGTH];
} DIR_ENTRY;
// Directory entry offsets
enum DIR_ENTRY_offset {
DIR_ENTRY_name = 0x00,
DIR_ENTRY_extension = 0x08,
DIR_ENTRY_attributes = 0x0B,
DIR_ENTRY_reserved = 0x0C,
DIR_ENTRY_cTime_ms = 0x0D,
DIR_ENTRY_cTime = 0x0E,
DIR_ENTRY_cDate = 0x10,
DIR_ENTRY_aDate = 0x12,
DIR_ENTRY_clusterHigh = 0x14,
DIR_ENTRY_mTime = 0x16,
DIR_ENTRY_mDate = 0x18,
DIR_ENTRY_cluster = 0x1A,
DIR_ENTRY_fileSize = 0x1C
};
/*
Returns true if the file specified by entry is a directory
*/
static inline bool _FAT_directory_isDirectory (DIR_ENTRY* entry) {
return ((entry->entryData[DIR_ENTRY_attributes] & ATTRIB_DIR) != 0);
}
static inline bool _FAT_directory_isWritable (DIR_ENTRY* entry) {
return ((entry->entryData[DIR_ENTRY_attributes] & ATTRIB_RO) == 0);
}
static inline bool _FAT_directory_isDot (DIR_ENTRY* entry) {
return ((entry->filename[0] == '.') && ((entry->filename[1] == '\0') ||
((entry->filename[1] == '.') && entry->filename[2] == '\0')));
}
/*
Reads the first directory entry from the directory starting at dirCluster
Places result in entry
entry will be destroyed even if no directory entry is found
Returns true on success, false on failure
*/
bool _FAT_directory_getFirstEntry (PARTITION* partition, DIR_ENTRY* entry, u32 dirCluster);
/*
Reads the next directory entry after the one already pointed to by entry
Places result in entry
entry will be destroyed even if no directory entry is found
Returns true on success, false on failure
*/
bool _FAT_directory_getNextEntry (PARTITION* partition, DIR_ENTRY* entry);
/*
Gets the directory entry corrsponding to the supplied path
entry will be destroyed even if no directory entry is found
pathEnd specifies the end of the path string, for cutting strings short if needed
specify NULL to use the full length of path
pathEnd is only a suggestion, and the path string will be searched up until the next PATH_SEPARATOR
after pathEND.
Returns true on success, false on failure
*/
bool _FAT_directory_entryFromPath (PARTITION* partition, DIR_ENTRY* entry, const char* path, const char* pathEnd);
/*
Changes the current directory to the one specified by path
Returns true on success, false on failure
*/
bool _FAT_directory_chdir (PARTITION* partition, const char* path);
/*
Removes the directory entry specified by entry
Assumes that entry is valid
Returns true on success, false on failure
*/
bool _FAT_directory_removeEntry (PARTITION* partition, DIR_ENTRY* entry);
/*
Add a directory entry to the directory specified by dirCluster
The fileData, dataStart and dataEnd elements of the DIR_ENTRY struct are
updated with the new directory entry position and alias.
Returns true on success, false on failure
*/
bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, u32 dirCluster);
/*
Get the start cluster of a file from it's entry data
*/
u32 _FAT_directory_entryGetCluster (const u8* entryData);
/*
Fill in the file name and entry data of DIR_ENTRY* entry.
Assumes that the entry's dataStart and dataEnd are correct
Returns true on success, false on failure
*/
bool _FAT_directory_entryFromPosition (PARTITION* partition, DIR_ENTRY* entry);
/*
Fill in a stat struct based on a file entry
*/
void _FAT_directory_entryStat (PARTITION* partition, DIR_ENTRY* entry, struct stat *st);
#endif // _DIRECTORY_H

View File

@ -1,126 +0,0 @@
/*
disc.h
Interface to the low level disc functions. Used by the higher level
file system code.
Copyright (c) 2006 Michael "Chishm" Chisholm
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2006-07-11 - Chishm
* Original release
*/
#ifndef _DISC_H
#define _DISC_H
#include "../common.h"
#include "disc_io.h"
/*
Search for a block based device in the GBA slot.
Return a pointer to a usable interface if one is found,
NULL if not.
*/
extern const IO_INTERFACE* _FAT_disc_gbaSlotFindInterface (void);
/*
Search for a block based device in the DS slot.
Return a pointer to a usable interface if one is found,
NULL if not.
*/
#ifdef NDS
extern const IO_INTERFACE* _FAT_disc_dsSlotFindInterface (void);
#endif
/*
Search for a block based device in the both slots.
Return a pointer to a usable interface if one is found,
NULL if not.
*/
extern const IO_INTERFACE* _FAT_disc_findInterface (void);
/*
Check if a disc is inserted
Return true if a disc is inserted and ready, false otherwise
*/
static inline bool _FAT_disc_isInserted (const IO_INTERFACE* disc) {
return disc->fn_isInserted();
}
/*
Read numSectors sectors from a disc, starting at sector.
numSectors is between 1 and 256
sector is from 0 to 2^28
buffer is a pointer to the memory to fill
*/
static inline bool _FAT_disc_readSectors (const IO_INTERFACE* disc, u32 sector, u32 numSectors, void* buffer) {
return disc->fn_readSectors (sector, numSectors, buffer);
}
/*
Write numSectors sectors to a disc, starting at sector.
numSectors is between 1 and 256
sector is from 0 to 2^28
buffer is a pointer to the memory to read from
*/
static inline bool _FAT_disc_writeSectors (const IO_INTERFACE* disc, u32 sector, u32 numSectors, const void* buffer) {
return disc->fn_writeSectors (sector, numSectors, buffer);
}
/*
Reset the card back to a ready state
*/
static inline bool _FAT_disc_clearStatus (const IO_INTERFACE* disc) {
return disc->fn_clearStatus();
}
/*
Initialise the disc to a state ready for data reading or writing
*/
static inline bool _FAT_disc_startup (const IO_INTERFACE* disc) {
return disc->fn_startup();
}
/*
Put the disc in a state ready for power down.
Complete any pending writes and disable the disc if necessary
*/
static inline bool _FAT_disc_shutdown (const IO_INTERFACE* disc) {
return disc->fn_shutdown();
}
/*
Return a 32 bit value unique to each type of interface
*/
static inline u32 _FAT_disc_hostType (const IO_INTERFACE* disc) {
return disc->ioType;
}
/*
Return a 32 bit value that specifies the capabilities of the disc
*/
static inline u32 _FAT_disc_features (const IO_INTERFACE* disc) {
return disc->features;
}
#endif // _DISC_H

View File

@ -1,81 +0,0 @@
/*
disc_io.h
Interface template for low level disc functions.
Copyright (c) 2006 Michael "Chishm" Chisholm
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2006-07-11 - Chishm
* Original release
2006-07-16 - Chishm
* Renamed _CF_USE_DMA to _IO_USE_DMA
* Renamed _CF_ALLOW_UNALIGNED to _IO_ALLOW_UNALIGNED
*/
#ifndef _DISC_IO_H
#define _DISC_IO_H
#include "../common.h"
//----------------------------------------------------------------------
// Customisable features
// Use DMA to read the card, remove this line to use normal reads/writes
// #define _IO_USE_DMA
// Allow buffers not alligned to 16 bits when reading files.
// Note that this will slow down access speed, so only use if you have to.
// It is also incompatible with DMA
#define _IO_ALLOW_UNALIGNED
#if defined _IO_USE_DMA && defined _IO_ALLOW_UNALIGNED
#error You can't use both DMA and unaligned memory
#endif
#define FEATURE_MEDIUM_CANREAD 0x00000001
#define FEATURE_MEDIUM_CANWRITE 0x00000002
#define FEATURE_SLOT_GBA 0x00000010
#define FEATURE_SLOT_NDS 0x00000020
typedef bool (* FN_MEDIUM_STARTUP)(void) ;
typedef bool (* FN_MEDIUM_ISINSERTED)(void) ;
typedef bool (* FN_MEDIUM_READSECTORS)(u32 sector, u32 numSectors, void* buffer) ;
typedef bool (* FN_MEDIUM_WRITESECTORS)(u32 sector, u32 numSectors, const void* buffer) ;
typedef bool (* FN_MEDIUM_CLEARSTATUS)(void) ;
typedef bool (* FN_MEDIUM_SHUTDOWN)(void) ;
struct IO_INTERFACE_STRUCT {
unsigned long ioType ;
unsigned long features ;
FN_MEDIUM_STARTUP fn_startup ;
FN_MEDIUM_ISINSERTED fn_isInserted ;
FN_MEDIUM_READSECTORS fn_readSectors ;
FN_MEDIUM_WRITESECTORS fn_writeSectors ;
FN_MEDIUM_CLEARSTATUS fn_clearStatus ;
FN_MEDIUM_SHUTDOWN fn_shutdown ;
} ;
typedef struct IO_INTERFACE_STRUCT IO_INTERFACE ;
#endif // define _DISC_IO_H

View File

@ -1,44 +0,0 @@
/*
io_dldi.h
Reserved space for post-compilation adding of an extra driver
Copyright (c) 2006 Michael "Chishm" Chisholm
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2006-12-22 - Chishm
* Original release
*/
#ifndef IO_DLDI_H
#define IO_DLDI_H
// 'DLDD'
#define DEVICE_TYPE_DLDD 0x49444C44
#include "disc_io.h"
// export interface
extern const IO_INTERFACE _io_dldi ;
#endif // define IO_DLDI_H

View File

@ -1,80 +0,0 @@
/*
fatdir.h
Functions used by the newlib disc stubs to interface with
this library
Copyright (c) 2006 Michael "Chishm" Chisholm
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2006-08-13 - Chishm
* Moved all externally visible directory related functions to fatdir
* Added _FAT_mkdir_r
2006-08-14 - Chishm
* Added directory iterator functions
2007-01-10 - Chishm
* Updated directory iterator functions for DevkitPro r20
*/
#ifndef _FATDIR_H
#define _FATDIR_H
#include <sys/reent.h>
#include <sys/stat.h>
#include <sys/iosupport.h>
#include "common.h"
#include "directory.h"
typedef struct {
PARTITION* partition;
DIR_ENTRY currentEntry;
u32 startCluster;
bool inUse;
bool validEntry;
} DIR_STATE_STRUCT;
extern int _FAT_stat_r (struct _reent *r, const char *path, struct stat *st);
extern int _FAT_link_r (struct _reent *r, const char *existing, const char *newLink);
extern int _FAT_unlink_r (struct _reent *r, const char *name);
extern int _FAT_chdir_r (struct _reent *r, const char *name);
extern int _FAT_rename_r (struct _reent *r, const char *oldName, const char *newName);
extern int _FAT_mkdir_r (struct _reent *r, const char *path, int mode);
/*
Directory iterator functions
*/
extern DIR_ITER* _FAT_diropen_r(struct _reent *r, DIR_ITER *dirState, const char *path);
extern int _FAT_dirreset_r (struct _reent *r, DIR_ITER *dirState);
extern int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct stat *filestat);
extern int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState);
#endif // _FATDIR_H

View File

@ -1,18 +0,0 @@
#ifndef _FATDIR_EX_H_
#define _FATDIR_EX_H_
#include "fatdir.h"
#ifdef __cplusplus
extern "C" {
#endif
int dirnextl (DIR_ITER *dirState, char *filename, char *longFilename, struct stat *filestat);
int renamex( const char *oldName, const char *newName );
#ifdef __cplusplus
}
#endif
#endif//_FATDIR_EX_H_

View File

@ -1,88 +0,0 @@
/*
fatfile.h
Functions used by the newlib disc stubs to interface with
this library
Copyright (c) 2006 Michael "Chishm" Chisholm
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2006-07-11 - Chishm
* Original release
2006-07-17 - Chishm
* Made all path inputs const char*
* Added _FAT_rename_r
2006-07-24 - Chishm
* Removed padding workaround from FILE_STRUCT
2006-08-13 - Chishm
* Moved all externally visible directory related functions to fatdir
*/
#ifndef _FATFILE_H
#define _FATFILE_H
#include <sys/reent.h>
#include <sys/stat.h>
#include "common.h"
#include "partition.h"
#include "directory.h"
typedef struct {
u32 cluster;
u32 sector;
s32 byte;
} FILE_POSITION;
typedef struct {
u32 filesize;
u32 startCluster;
u32 currentPosition;
FILE_POSITION rwPosition;
FILE_POSITION appendPosition;
bool read;
bool write;
bool append;
bool inUse;
PARTITION* partition;
DIR_ENTRY_POSITION dirEntryStart; // Points to the start of the LFN entries of a file, or the alias for no LFN
DIR_ENTRY_POSITION dirEntryEnd; // Always points to the file's alias entry
} FILE_STRUCT;
extern int _FAT_open_r (struct _reent *r, void *fileStruct, const char *path, int flags, int mode);
extern int _FAT_close_r (struct _reent *r, int fd);
extern int _FAT_write_r (struct _reent *r,int fd, const char *ptr, int len);
extern int _FAT_read_r (struct _reent *r, int fd, char *ptr, int len);
extern int _FAT_seek_r (struct _reent *r, int fd,int pos, int dir);
extern int _FAT_fstat_r (struct _reent *r, int fd, struct stat *st);
#endif // _FATFILE_H

View File

@ -1,19 +0,0 @@
#ifndef _FATFILE_EX_H_
#define _FATFILE_EX_H_
#include <stdio.h>
#include "fatfile.h"
#ifdef __cplusplus
extern "C" {
#endif
int freadex( void * buffer, int _size, int _n, FILE * f );
int fwritex( const void * buffer, int _size, int _n, FILE * f );
#ifdef __cplusplus
}
#endif
#endif//_FATFILE_EX_H_

View File

@ -1,7 +1,7 @@
#include <nds.h>
#include <fat.h>
#include "fatdir_ex.h"
// #include "fatdir_ex.h"
#include <sys/iosupport.h>
#include <stdio.h>
@ -9,6 +9,9 @@
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <dirent.h>
#include <string>
#include <vector>
//#include "disc_io.h"
//#include "gba_nds_fat.h"
@ -81,7 +84,7 @@ int carttype = 0;
extern int save_sel(int mod, char *name);
using namespace std;
void SetEWINRam(u8 page)
{
@ -237,8 +240,7 @@ void SetM3Ram(u8 page)
}
bool _set_M3(int sw)
{
bool _set_M3(int sw) {
vu32 wait;
vu16 tmp;
vu8 a;
@ -487,7 +489,7 @@ int checkFlashID()
char *Rudolph = "GBA ExpLoader by Rudolph (LocalCode v0.1)";
char const *Rudolph = "GBA ExpLoader by Rudolph (LocalCode v0.1)";
bool checkSRAM_cnf()
{
@ -1134,16 +1136,24 @@ static void _sort_file()
}
}
bool nameEndsWith (const string& name, const string& extension) {
if (name.size() == 0) return false;
if (name.front() == '.') return false;
void FileListGBA()
{
DIR_ITER *dir;
const string ext = extension;
if (strcasecmp(name.c_str() + name.size() - ext.size(), ext.c_str()) == 0)return true;
return false;
}
// TODO: Fix Filelist to use new code based on port of NDS_Backup_Tool
void FileListGBA() {
DIR *dir;
struct stat st;
char fname[256];
char lfnname[512];
// char fname[256];
// char lfnname[512];
u32 flen;
FILE *gbaFile;
// u32 flen;
FILE *gbaFile;
int i;
// mkdir("/GBA_SAVE");
@ -1152,13 +1162,41 @@ void FileListGBA()
numFiles = 0;
numGames = 0;
dir = diropen(curpath);
chdir (curpath);
dir = opendir(curpath);
if(dir == NULL) {
strcpy(curpath, "/");
dir = diropen(curpath);
dir = opendir(curpath);
}
while(dirnextl(dir, fname, lfnname, &st) == 0) {
const char* GBAEXT = ".GBA";
const char* BINEXT = ".BIN";
if (dir != NULL) {
while(true) {
dirent* pent = readdir(dir);
if(pent == NULL)break;
stat(pent->d_name, &st);
if (((string)pent->d_name).compare(".") != 0 && ((st.st_mode & S_IFMT) != S_IFDIR) && (nameEndsWith(pent->d_name, GBAEXT) || nameEndsWith(pent->d_name, BINEXT))) {
strcpy(fs[numFiles].filename, pent->d_name);
strcpy(fs[numFiles].Alias, pent->d_name);
fs[numFiles].type = st.st_mode;
FILE *file = fopen(pent->d_name, "rb");
if (file) {
fseek(file, 0, SEEK_END);
fs[numFiles].filesize = ftell(file);
fclose(file);
}
numFiles++;
if (numFiles > 199 )break;
}
}
closedir(dir);
}
/*while(dirnextl(dir, fname, lfnname, &st) == 0) {
flen = strlen(fname);
if(lfnname[0] == 0)
strcpy(lfnname, fname);
@ -1175,9 +1213,10 @@ void FileListGBA()
numFiles++;
if(numFiles > 199) break;
}
}
}*/
dirclose(dir);
// dirclose(dir);
// closedir(dir);
for(i = 0; i < numFiles; i++) {
sortfile[i] = i;
@ -1188,8 +1227,7 @@ void FileListGBA()
sprintf(tbuf, "%s%s", curpath, fs[i].filename);
gbaFile = fopen(tbuf, "rb");
memset(tbuf, 0, 256);
if(gbaFile != NULL)
fread(tbuf, 1, 256, gbaFile);
if(gbaFile != NULL)fread(tbuf, 1, 256, gbaFile);
tbuf[0xB0] = 0;
strcpy(fs[i].gamecode, tbuf + 0xAC);
tbuf[0xAC] = 0;

View File

@ -22,12 +22,14 @@
#include "nds.h"
#include <nds/arm9/console.h> //basic print funcionality
//#include <nds/registers_alt.h>
#include <nds/jtypes.h>
// #include <nds/jtypes.h>
#include <nds/ndstypes.h>
#include <fat.h>
#include <sys/dir.h>
#include <sys/iosupport.h>
#include "fatfile.h"
// #include "fatfile.h"
#include <nds/arm9/dldi.h>
#include <stdio.h>
#include <stdlib.h>
@ -59,6 +61,7 @@ extern uint16* SubScreen;
//uint16* MainScreen = VRAM_A;
//uint16* SubScreen = (uint16*)BG_TILE_RAM_SUB(1);
#define BG_256_COLOR (BIT(7))
int numFiles = 0;
int numGames = 0;
@ -226,12 +229,11 @@ void gbaMode()
videoSetMode(0);
videoSetModeSub(0);
vramSetMainBanks(VRAM_A_MAIN_BG, VRAM_B_MAIN_BG, VRAM_C_MAIN_BG, VRAM_D_MAIN_BG);
// vramSetMainBanks(VRAM_A_MAIN_BG, VRAM_B_MAIN_BG, VRAM_C_MAIN_BG, VRAM_D_MAIN_BG);
vramSetPrimaryBanks(VRAM_A_MAIN_BG, VRAM_B_MAIN_BG, VRAM_C_MAIN_BG, VRAM_D_MAIN_BG);
// vramSetMainBanks(VRAM_A_MAIN_BG, VRAM_B_MAIN_BG, VRAM_C_ARM7, VRAM_D_ARM7);
if(PersonalData->_user_data.gbaScreen)
lcdMainOnBottom();
else lcdMainOnTop();
if(PersonalData->gbaScreen) { lcdMainOnBottom(); } else { lcdMainOnTop(); }
// FIFOSend(IPC_CMD_GBAMODE);
@ -674,9 +676,11 @@ void _gba_sel_dsp(int no, int yc, int mod)
DrawBox_SUB(SubScreen, 8, 82, 247, 109, 5, 0);
if(GBAmode == 0)
if(GBAmode == 0) {
ColorSwap_SUB(SubScreen, 0, 0, 255, 192, 3, 5);
else ColorSwap_SUB(SubScreen, 0, 0, 255, 192, 5, 3);
} else {
ColorSwap_SUB(SubScreen, 0, 0, 255, 192, 5, 3);
}
checkSRAM(filename);
@ -1042,7 +1046,7 @@ inp_key();
}
extern u32 _io_dldi;
// extern u32 _io_dldi;
extern void setLang(void);
@ -1053,8 +1057,9 @@ void mainloop(void)
FILE *r4dt;
__handle *handle;
FILE_STRUCT *file;
PARTITION *part;
// FILE_STRUCT *file;
FILE *file;
// PARTITION *part;
int cmd;
@ -1147,22 +1152,24 @@ REG_EXMEMCNT = (reg & 0xFFE0) | (1 << 4) | (1 << 2) | 1;
r4tf = 3;
} else {
r4tf = 0;
if(_io_dldi == 0x46543452) { // R4TF
if(io_dldi_data->ioInterface.ioType == 0x46543452) { // R4TF
if((*(vu32*)0x027FFE18) == 0x00000000) {
r4dt = fopen("/_DS_MENU.DAT", "rb");
if(r4dt != NULL) {
handle = (__handle *)r4dt->_file;
file = (FILE_STRUCT *)handle->fileStruct;
part = file->partition;
(*(vu32*)0x027FFE18) = (part->rootDirStart + file->dirEntryStart.sector) * 512 + file->dirEntryStart.offset * 32;
// file = (FILE_STRUCT *)handle->fileStruct;
file = (FILE*)handle->fileStruct;
// part = file->partition;
// (*(vu32*)0x027FFE18) = (part->rootDirStart + file->dirEntryStart.sector) * 512 + file->dirEntryStart.offset * 32;
fclose(r4dt);
r4tf = 1;
}
} else r4tf = 1;
} else {
r4tf = 1;
}
}
if(_io_dldi == 0x534D4C44) // DLMS
r4tf = 2;
if(io_dldi_data->ioInterface.ioType == 0x534D4C44)r4tf = 2; // DLMS
}
/******************************
@ -1263,8 +1270,8 @@ int main(void) {
int i;
vramSetMainBanks(VRAM_A_LCD , VRAM_B_LCD , VRAM_C_SUB_BG, VRAM_D_MAIN_BG );
powerON(POWER_ALL);
vramSetPrimaryBanks(VRAM_A_LCD , VRAM_B_LCD , VRAM_C_SUB_BG, VRAM_D_MAIN_BG );
powerOn(POWER_ALL);
irqInit();
irqSet(IRQ_VBLANK, Vblank);
@ -1273,7 +1280,8 @@ int main(void) {
videoSetMode(MODE_FB0 | DISPLAY_BG2_ACTIVE);
videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE );
SUB_BG0_CR = BG_256_COLOR | BG_MAP_BASE(0) | BG_TILE_BASE(1);
// SUB_BG0_CR = BG_256_COLOR | BG_MAP_BASE(0) | BG_TILE_BASE(1);
REG_BG0CNT_SUB = BG_256_COLOR | BG_MAP_BASE(0) | BG_TILE_BASE(1);
uint16* map1 = (uint16*)BG_MAP_RAM_SUB(0);
for(i=0;i<(256*192/8/8);i++) map1[i]=i;
lcdMainOnTop();

View File

@ -24,14 +24,6 @@ THE SOFTWARE.
---------------------------------------------------------------------------------*/
#include <nds.h>
#include <nds/registers_alt.h>
@ -64,11 +56,11 @@ void resetARM9Memory()
// trun on vram banks for clear
VRAM_CR = 0x80808080;
(*(vu32*)0x027FFE04) = 0; // temporary variable
PALETTE[0] = 0xFFFF;
dmaFillWords((void*)0x027FFE04, PALETTE+1, (2*1024)-2);
dmaFillWords((void*)0x027FFE04, OAM, 2*1024);
dmaFillWords((void*)0x027FFE04, (void*)0x04000000, 0x56); //clear main display registers
dmaFillWords((void*)0x027FFE04, (void*)0x04001000, 0x56); //clear sub display registers
BG_PALETTE[0] = 0xFFFF;
dmaFillWords(0, BG_PALETTE+1, (2*1024)-2);
dmaFillWords(0, OAM, 2*1024);
dmaFillWords(0, (void*)0x04000000, 0x56); //clear main display registers
dmaFillWords(0, (void*)0x04001000, 0x56); //clear sub display registers
// clear video registers
REG_DISPCNT = 0;
@ -90,3 +82,4 @@ void resetARM9Memory()
REG_IE = 0;
REG_IF = ~0;
}

View File

@ -12,7 +12,7 @@ char *cmd_m[4];
char *t_msg[22];
char *savmsg[6];
static char *errmsg_j[14] = {
static const char *errmsg_j[14] = {
"FATの初期化に失敗しました", // 0
"適切なDLDIパッチを行ってください", // 1
"Slot2拡張パックがセットされていません", // 2
@ -29,7 +29,7 @@ static char *errmsg_j[14] = {
"(A):確認" // 13
};
static char *errmsg_e[14] = {
static const char *errmsg_e[14] = {
"FAT initialization failed ", // 0
"Please apply the appropriate DLDI Patch.", // 1
"Slot2 expansion pack not found ", // 2
@ -47,7 +47,7 @@ static char *errmsg_e[14] = {
};
static char *cnfmsg_j[11] = {
static const char *cnfmsg_j[11] = {
"(A):実行, (B):取消", // 0
"現在のSRAMにあるSAVEデータを", // 1
"SAVファイルに保存します", // 2
@ -61,7 +61,7 @@ static char *cnfmsg_j[11] = {
"設定(SRAMは失われます)していいですか?" // 10
};
static char *cnfmsg_e[11] = {
static const char *cnfmsg_e[11] = {
"(A):Run, (B):Cancel", // 0
"Write save data in SRAM", // 1
" to SAV file", // 2
@ -76,14 +76,14 @@ static char *cnfmsg_e[11] = {
};
static char *barmsg_j[4] = {
static const char *barmsg_j[4] = {
" NORを消去中... ", // 0
" NORにコピー中... ", // 1
" RAMにロード中... ", // 2
" ROMを解析中... " // 3
};
static char *barmsg_e[4] = {
static const char *barmsg_e[4] = {
" Erasing NOR... ", // 0
" Copying to NOR... ", // 1
" Loading to RAM... ", // 2
@ -91,14 +91,14 @@ static char *barmsg_e[4] = {
};
static char *cmd_m_j[4] = {
static const char *cmd_m_j[4] = {
" 振動レベル (小) ",
" 振動レベル (中) ",
" 振動レベル (大) ",
" ブラウザ用拡張メモリ "
};
static char *cmd_m_e[4] = {
static const char *cmd_m_e[4] = {
" Rumble level: Weak ",
" Rumble level: Medium ",
" Rumble level: Strong ",
@ -106,7 +106,7 @@ static char *cmd_m_e[4] = {
};
static char *t_msg_j[22] = {
static const char *t_msg_j[22] = {
"選択中のゲーム",
" PSRAMモード",
"(A):RAMにゲームをロードして実行 ",
@ -131,7 +131,7 @@ static char *t_msg_j[22] = {
" SDRAMモード",
};
static char *t_msg_e[22] = {
static const char *t_msg_e[22] = {
"Selected game",
" PSRAM Mode ",
"(A):Run (B):Write SRAM to SAV file",
@ -157,7 +157,7 @@ static char *t_msg_e[22] = {
};
static char *savmsg_j[6] = {
static const char *savmsg_j[6] = {
" SRAMにSAVEデータをロード", // 0
"(A):選択したファイルをロード", // 1
"(B):ロードしない(新規ゲーム)", // 2
@ -166,7 +166,7 @@ static char *savmsg_j[6] = {
"(B):保存しない(取消)", // 5
};
static char *savmsg_e[6] = {
static const char *savmsg_e[6] = {
" Load SRAM from SAV file ", // 0
"(A):Load from selected file", // 1
"(B):No load(New Game)", // 2
@ -176,46 +176,31 @@ static char *savmsg_e[6] = {
};
void setLangMsg()
{
void setLangMsg() {
u32 UserLang = 0;
int i;
UserLang = PersonalData->_user_data.language;
UserLang = PersonalData->language;
if(UserLang != 0) {
for(i = 0; i < 14; i++)
errmsg[i] = errmsg_e[i];
for(i = 0; i < 11; i++)
cnfmsg[i] = cnfmsg_e[i];
for(i = 0; i < 4; i++)
barmsg[i] = barmsg_e[i];
for(i = 0; i < 4; i++)
cmd_m[i] = cmd_m_e[i];
for(i = 0; i < 22; i++)
t_msg[i] = t_msg_e[i];
for(i = 0; i < 6; i++)
savmsg[i] = savmsg_e[i];
for(i = 0; i < 14; i++)errmsg[i] = (char*)errmsg_e[i];
for(i = 0; i < 11; i++)cnfmsg[i] = (char*)cnfmsg_e[i];
for(i = 0; i < 4; i++)barmsg[i] = (char*)barmsg_e[i];
for(i = 0; i < 4; i++)cmd_m[i] = (char*)cmd_m_e[i];
for(i = 0; i < 22; i++)t_msg[i] = (char*)t_msg_e[i];
for(i = 0; i < 6; i++)savmsg[i] = (char*)savmsg_e[i];
return;
}
for(i = 0; i < 14; i++)
errmsg[i] = errmsg_j[i];
for(i = 0; i < 11; i++)
cnfmsg[i] = cnfmsg_j[i];
for(i = 0; i < 4; i++)
barmsg[i] = barmsg_j[i];
for(i = 0; i < 4; i++)
cmd_m[i] = cmd_m_j[i];
for(i = 0; i < 22; i++)
t_msg[i] = t_msg_j[i];
for(i = 0; i < 6; i++)
savmsg[i] = savmsg_j[i];
for(i = 0; i < 14; i++)errmsg[i] = (char*)errmsg_j[i];
for(i = 0; i < 11; i++)cnfmsg[i] = (char*)cnfmsg_j[i];
for(i = 0; i < 4; i++)barmsg[i] = (char*)barmsg_j[i];
for(i = 0; i < 4; i++)cmd_m[i] = (char*)cmd_m_j[i];
for(i = 0; i < 22; i++)t_msg[i] = (char*)t_msg_j[i];
for(i = 0; i < 6; i++)savmsg[i] = (char*)savmsg_j[i];
}
static bool _isKanji1(u8 ch)
{
static bool _isKanji1(u8 ch) {
if((ch >= 0x81) && (ch <= 0x9F))
return true;
if((ch >= 0xE0) && (ch <= 0xEF))
@ -225,8 +210,7 @@ static bool _isKanji1(u8 ch)
return false;
}
char *jstrncpy(char *s1, char *s2, size_t n)
{
char *jstrncpy(char *s1, char *s2, size_t n) {
bool kan;
char *p = s1;

View File

@ -6,14 +6,14 @@
#include <nds.h>
//#include <nds/registers_alt.h> // devkitPror20
#include <nds/arm9/dldi.h>
#include <fat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
extern u32 _io_dldi;
// extern u32 _io_dldi;
static char *menu_nam;
static char name[32];
@ -23,10 +23,10 @@ bool ret_menu_chk()
FILE *fp;
char buf[5];
buf[0] = _io_dldi & 0xFF;
buf[1] = (_io_dldi >> 8) & 0xFF;
buf[2] = (_io_dldi >> 16) & 0xFF;
buf[3] = (_io_dldi >> 24) & 0xFF;
buf[0] = io_dldi_data->ioInterface.ioType & 0xFF;
buf[1] = (io_dldi_data->ioInterface.ioType >> 8) & 0xFF;
buf[2] = (io_dldi_data->ioInterface.ioType >> 16) & 0xFF;
buf[3] = (io_dldi_data->ioInterface.ioType >> 24) & 0xFF;
buf[4] = 0;
sprintf(name, "/SoftReset.%s", buf);
fp = fopen(name, "rb");
@ -38,7 +38,7 @@ bool ret_menu_chk()
menu_nam = NULL;
if(_io_dldi == 0x53444353) { // SCDS
if(io_dldi_data->ioInterface.ioType == 0x53444353) { // SCDS
menu_nam = "/MSFORSC.NDS";
}
@ -46,23 +46,23 @@ bool ret_menu_chk()
// menu_nam = "/system/akmenu2_fat.nds";
// }
if(_io_dldi == 0x4F49524E) { // N-Card
if(io_dldi_data->ioInterface.ioType == 0x4F49524E) { // N-Card
menu_nam = "/udisk.nds"; // Žbè
}
if(_io_dldi == 0x4E475052) { // AK.R.P.G NAND
if(io_dldi_data->ioInterface.ioType == 0x4E475052) { // AK.R.P.G NAND
menu_nam = "/akmenu4.nds";
}
if(_io_dldi == 0x53475052) { // AK.R.P.G SD
if(io_dldi_data->ioInterface.ioType == 0x53475052) { // AK.R.P.G SD
menu_nam = "/akmenu4.nds";
}
if(_io_dldi == 0x44533958) { // X9 SD
if(io_dldi_data->ioInterface.ioType == 0x44533958) { // X9 SD
menu_nam = "/loader.nds";
}
if(_io_dldi == 0x4F495454) { // DSTT
if(io_dldi_data->ioInterface.ioType == 0x4F495454) { // DSTT
menu_nam = "/TTMENU.DAT";
}

View File

@ -9,8 +9,9 @@
#include <string.h>
#include <time.h>
#include <sys/dir.h>
#include <dirent.h>
#include "fatdir_ex.h"
// #include "fatdir_ex.h"
#include "message.h"
#include "GBA_ini.h"
@ -24,8 +25,7 @@ char savnam[6][26];
char savext[6][4];
bool savexist[6];
void _save_list(char *name)
{
void _save_list(char *name) {
struct tm *ptime;
struct stat st;
char fname[512];

View File

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 630 B

View File

@ -1,30 +0,0 @@
pause
@echo off
call setenv_devkitPro.bat
:loop
cls
goto skipclean
del /Q arm7\build\*.*
del /Q arm9\build\*.*
:skipclean
del arm7\_BOOT_MP.arm7.elf
del arm9\_BOOT_MP.arm9.elf
del _BOOT_MP.bin
rem del "C:\APP\_Network\anhttpd\public\wifitemp.nds"
make
if exist _BOOT_MP.nds goto run
pause
goto loop
:run
rem ren _BOOT_MP.nds _BOOT_MP.bin
del _BOOT_MP.arm7
del _BOOT_MP.arm9
rem del _BOOT_MP.ds.gba
rem call cfcopy.bat
rem call wificopy.bat
pause
goto loop

View File

@ -1,5 +0,0 @@
rem with libnds-20060719
set PATH=d:\devkitPro\msys\bin;d:\devkitPro\devkitARM\bin;%PATH%
set DEVKITARM=/d/devkitPro/devkitARM
set DEVKITPRO=/d/devkitPro
set LIBNDS=/d/devkitPro/libnds