diff --git a/retail/Makefile b/retail/Makefile index a5a64161c..06a86892d 100644 --- a/retail/Makefile +++ b/retail/Makefile @@ -72,7 +72,7 @@ endif export GAME_ICON := $(CURDIR)/$(ASSETS)/icon.bmp #.PHONY: cardengine_arm7 cardengine_arm9 bootloader BootStrap clean -.PHONY: all dist release nightly bootloader bootloader1 bootloader2 bootloaderi bootloaderi1 bootloaderi2 cardengine_arm7 cardengine_arm7_music cardengine_arm9_igm cardengine_arm9_igm_extmem cardengine_arm9 cardengine_arm9_32 cardengine_arm9_start cardengine_arm9_start_foto cardengine_arm9_alt cardengine_arm9_alt_gsdd cardengine_arm9_alt2 cardengine_arm9_alt3 cardengine_arm9_extmem cardengine_arm9_extmem_gsdd cardengine_arm9_extmem_start cardengine_arm9_extmem_foto cardenginei_arm7 cardenginei_arm7_alt cardenginei_arm7_twlsdk cardenginei_arm7_twlsdk3 cardenginei_arm7_dsiware cardenginei_arm7_dsiware3 cardenginei_arm7_cheat cardenginei_arm9_igm cardenginei_arm9 cardenginei_arm9_dlp cardenginei_arm9_gsdd cardenginei_arm9_dldi cardenginei_arm9_gsdd_dldi cardenginei_arm9_twlsdk cardenginei_arm9_twlsdk3 cardenginei_arm9_twlsdk_dldi cardenginei_arm9_twlsdk3_dldi cardenginei_arm9_dsiware cardenginei_arm9_dsiware3 preLoadSettings apfix arm7/$(TARGET).elf arm9/$(TARGET).elf clean +.PHONY: all dist release nightly bootloader bootloader1 bootloader2 bootloaderi bootloaderi1 bootloaderi2 cardengine_arm7 cardengine_arm7_music cardengine_arm9_igm cardengine_arm9_igm_extmem cardengine_arm9 cardengine_arm9_32 cardengine_arm9_start cardengine_arm9_start_foto cardengine_arm9_alt cardengine_arm9_alt_gsdd cardengine_arm9_alt2 cardengine_arm9_alt3 cardengine_arm9_extmem cardengine_arm9_extmem_gsdd cardengine_arm9_extmem_start cardengine_arm9_extmem_foto cardenginei_arm7 cardenginei_arm7_alt cardenginei_arm7_twlsdk cardenginei_arm7_twlsdk3 cardenginei_arm7_dsiware cardenginei_arm7_dsiware3 cardenginei_arm7_cheat cardenginei_arm9_igm cardenginei_arm9 cardenginei_arm9_gsdd cardenginei_arm9_dldi cardenginei_arm9_gsdd_dldi cardenginei_arm9_twlsdk cardenginei_arm9_twlsdk3 cardenginei_arm9_twlsdk_dldi cardenginei_arm9_twlsdk3_dldi cardenginei_arm9_dsiware cardenginei_arm9_dsiware3 preLoadSettings apfix arm7/$(TARGET).elf arm9/$(TARGET).elf clean all: $(OUTPUT) @@ -117,7 +117,7 @@ bootloader2: @$(MAKE) -C bootloader2 #--------------------------------------------------------------------------------- -bootloaderi: cardenginei_arm7 cardenginei_arm7_alt cardenginei_arm7_twlsdk cardenginei_arm7_twlsdk3 cardenginei_arm7_dsiware cardenginei_arm7_dsiware3 cardenginei_arm7_cheat cardenginei_arm9_igm cardenginei_arm9 cardenginei_arm9_dlp cardenginei_arm9_gsdd cardenginei_arm9_dldi cardenginei_arm9_gsdd_dldi cardenginei_arm9_twlsdk cardenginei_arm9_twlsdk3 cardenginei_arm9_twlsdk_dldi cardenginei_arm9_twlsdk3_dldi cardenginei_arm9_dsiware cardenginei_arm9_dsiware3 +bootloaderi: cardenginei_arm7 cardenginei_arm7_alt cardenginei_arm7_twlsdk cardenginei_arm7_twlsdk3 cardenginei_arm7_dsiware cardenginei_arm7_dsiware3 cardenginei_arm7_cheat cardenginei_arm9_igm cardenginei_arm9 cardenginei_arm9_gsdd cardenginei_arm9_dldi cardenginei_arm9_gsdd_dldi cardenginei_arm9_twlsdk cardenginei_arm9_twlsdk3 cardenginei_arm9_twlsdk_dldi cardenginei_arm9_twlsdk3_dldi cardenginei_arm9_dsiware cardenginei_arm9_dsiware3 @$(MAKE) -C bootloaderi #--------------------------------------------------------------------------------- @@ -228,10 +228,6 @@ cardenginei_arm9_igm: cardenginei_arm9: @$(MAKE) -C cardenginei/arm9 -#--------------------------------------------------------------------------------- -cardenginei_arm9_dlp: - @$(MAKE) -C cardenginei/arm9_dlp - #--------------------------------------------------------------------------------- cardenginei_arm9_gsdd: @$(MAKE) -C cardenginei/arm9_gsdd @@ -312,7 +308,6 @@ clean: @$(MAKE) -C cardenginei/arm7_cheatonly clean @$(MAKE) -C cardenginei/arm9_igm clean @$(MAKE) -C cardenginei/arm9 clean - @$(MAKE) -C cardenginei/arm9_dlp clean @$(MAKE) -C cardenginei/arm9_gsdd clean @$(MAKE) -C cardenginei/arm9_dldi clean @$(MAKE) -C cardenginei/arm9_gsdd_dldi clean diff --git a/retail/arm9/source/conf_sd.cpp b/retail/arm9/source/conf_sd.cpp index 405da3e11..acfd8f8e0 100644 --- a/retail/arm9/source/conf_sd.cpp +++ b/retail/arm9/source/conf_sd.cpp @@ -1558,28 +1558,14 @@ int loadFromSD(configuration* conf, const char *bootstrapPath) { tonccpy((u8*)LOADER_RETURN_LOCATION+0x100, &srBackendId, 8); } - const bool dlp = (memcmp(romTid, "HND", 3) == 0); const bool gsdd = (memcmp(romTid, "BO5", 3) == 0); - if (conf->gameOnFlashcard) { - const char* ce9Path = "nitro:/cardenginei_arm9_dldi.lz77"; - if (gsdd) { - ce9Path = "nitro:/cardenginei_arm9_gsdd_dldi.lz77"; - } - - // Load DLDI ce9 binary - loadCardEngineBinary(ce9Path, (u8*)CARDENGINEI_ARM9_BUFFERED_LOCATION); - } else { - const char* ce9Path = "nitro:/cardenginei_arm9.lz77"; - if (dlp) { - ce9Path = "nitro:/cardenginei_arm9_dlp.lz77"; - } else if (gsdd) { - ce9Path = "nitro:/cardenginei_arm9_gsdd.lz77"; - } - - // Load ce9 binary - loadCardEngineBinary(ce9Path, (u8*)CARDENGINEI_ARM9_BUFFERED_LOCATION); - } + // Load DLDI ce9 binary + loadCardEngineBinary( + conf->gameOnFlashcard + ? (gsdd ? "nitro:/cardenginei_arm9_gsdd_dldi.lz77" : "nitro:/cardenginei_arm9_dldi.lz77") + : (gsdd ? "nitro:/cardenginei_arm9_gsdd.lz77" : "nitro:/cardenginei_arm9.lz77") + , (u8*)CARDENGINEI_ARM9_BUFFERED_LOCATION); } bool found = (access(pageFilePath.c_str(), F_OK) == 0); diff --git a/retail/cardenginei/arm7/source/cardengine.c b/retail/cardenginei/arm7/source/cardengine.c index 3c1579ba2..8ebb5f16e 100644 --- a/retail/cardenginei/arm7/source/cardengine.c +++ b/retail/cardenginei/arm7/source/cardengine.c @@ -564,7 +564,7 @@ void reset(const bool downloadedSrl) { ensureBinaryDecompressed(ndsHeader, moduleParams); patchCardNdsArm9( - (cardengineArm9*)((valueBits & isDlp) ? CARDENGINEI_ARM9_LOCATION_DLP : CARDENGINEI_ARM9_LOCATION), + (cardengineArm9*)CARDENGINEI_ARM9_LOCATION, ndsHeader, moduleParams, 1 @@ -580,7 +580,7 @@ void reset(const bool downloadedSrl) { ndsHeader ); hookNdsRetailArm9( - (cardengineArm9*)((valueBits & isDlp) ? CARDENGINEI_ARM9_LOCATION_DLP : CARDENGINEI_ARM9_LOCATION), + (cardengineArm9*)CARDENGINEI_ARM9_LOCATION, ndsHeader ); diff --git a/retail/cardenginei/arm9_dlp/Makefile b/retail/cardenginei/arm9_dlp/Makefile deleted file mode 100644 index 973d4f953..000000000 --- a/retail/cardenginei/arm9_dlp/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -#--------------------------------------------------------------------------------- -.SUFFIXES: -#--------------------------------------------------------------------------------- -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif - -include $(DEVKITARM)/ds_rules - -ifeq ($(OS),Windows_NT) -LZSS ?= ../../../../lzss.exe - -else - -LZSS ?= lzss - -endif -#--------------------------------------------------------------------------------- -# 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 -# all directories are relative to this makefile -#--------------------------------------------------------------------------------- -BUILD := build -SOURCES := ../arm9/source ../arm9/source_ext ../../common/source_general -INCLUDES := ../arm9/include ../arm9/include_ext ../../common/include -DATA := data - - -#--------------------------------------------------------------------------------- -# options for code generation -#--------------------------------------------------------------------------------- -ARCH := -mthumb -march=armv5te -mtune=arm946e-s - -CFLAGS := -g -Wall -O2\ - -march=armv5te -mtune=arm946e-s -fomit-frame-pointer\ - -ffast-math \ - $(ARCH) - -# ADD -DDEBUG here for logging/debug -CFLAGS += $(INCLUDE) -DARM9 -DNO_CARDID -CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions - -ASFLAGS := -g $(ARCH) $(INCLUDE) - -LDFLAGS = -nostartfiles -T cardengine.ld -g $(ARCH) -Wl,-Map,$(notdir $*.map) - -#--------------------------------------------------------------------------------- -# any extra libraries we wish to link with the project (order is important) -#--------------------------------------------------------------------------------- -LIBS := - -#--------------------------------------------------------------------------------- -# list of directories containing libraries, this must be the top level containing -# include and lib -#--------------------------------------------------------------------------------- -LIBDIRS := $(LIBNDS) - - -#--------------------------------------------------------------------------------- -# 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 TARGET := cardenginei_arm9_dlp -export OUTPUT := $(CURDIR)/../../nitrofiles_dec/$(TARGET) -export OUTPUT_CMP := $(CURDIR)/../../nitrofiles/$(TARGET) -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)/*.*))) - -#--------------------------------------------------------------------------------- -# use CXX for linking C++ projects, CC for standard C -#--------------------------------------------------------------------------------- -ifeq ($(strip $(CPPFILES)),) -#--------------------------------------------------------------------------------- - export LD := $(CC) -#--------------------------------------------------------------------------------- -else -#--------------------------------------------------------------------------------- - 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) - -.PHONY: $(BUILD) clean - -#--------------------------------------------------------------------------------- -$(BUILD): - @[ -d $@ ] || mkdir -p $@ - @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile - -#--------------------------------------------------------------------------------- -clean: - @echo clean ... - @rm -fr $(BUILD) $(TARGET).bin $(TARGET).elf - - -#--------------------------------------------------------------------------------- -else - -#--------------------------------------------------------------------------------- -# main targets -#--------------------------------------------------------------------------------- -$(OUTPUT_CMP).lz77: $(OUTPUT).bin - @cp $< $@ - @$(LZSS) -ewf $@ - -$(OUTPUT).bin: $(DEPSDIR)/$(TARGET).elf -$(DEPSDIR)/$(TARGET).elf: cardengine.ld $(OFILES) -# @echo linking $(notdir $@) -# @$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@ - -cardengine.ld: $(CURDIR)/../cardengine.ld.in - $(CPP) -P $(INCLUDE) $< $@ - - -#--------------------------------------------------------------------------------- -%.bin : %.elf -#--------------------------------------------------------------------------------- - @$(OBJCOPY) -O binary $< $@ - @echo built ... $(notdir $@) - --include $(DEPSDIR)/*.d - -#--------------------------------------------------------------------------------------- -endif -#--------------------------------------------------------------------------------------- diff --git a/retail/cardenginei/arm9_dlp/cardengine.ld.in b/retail/cardenginei/arm9_dlp/cardengine.ld.in deleted file mode 100644 index 419864840..000000000 --- a/retail/cardenginei/arm9_dlp/cardengine.ld.in +++ /dev/null @@ -1,201 +0,0 @@ -#include "locations.h" - -OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") -OUTPUT_ARCH(arm) -/*ENTRY(_start)*/ - -MEMORY { - - vram : ORIGIN = CARDENGINEI_ARM9_LOCATION_DLP, LENGTH = 29K /* Main RAM */ -} - -__vram_start = ORIGIN(vram); -__vram_top = ORIGIN(vram)+ LENGTH(vram); -__sp_irq = __vram_top - 0x60; -__sp_svc = __sp_irq - 0x100; -__sp_usr = __sp_svc - 0x100; - -__irq_flags = __vram_top - 8; -__irq_flagsaux = __vram_top - 0x40; /*__irq_flagsaux = 0x04000000 - 0x40;*/ -__irq_vector = __vram_top - 4; - -SECTIONS -{ - .init : - { - __text_start = . ; - KEEP (*(.init)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >vram = 0xff - - .plt : - { - *(.plt) - } >vram = 0xff - - .text : /* ALIGN (4): */ - { - - *(.text*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - *(.glue_7) - *(.glue_7t) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >vram = 0xff - - .fini : - { - KEEP (*(.fini)) - } >vram =0xff - - __text_end = . ; - - .rodata : - { - *(.rodata) - *all.rodata*(*) - *(.roda) - *(.rodata.*) - *(.gnu.linkonce.r*) - SORT(CONSTRUCTORS) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >vram = 0xff - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >vram - __exidx_start = .; - .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } >vram - __exidx_end = .; - -/* Ensure the __preinit_array_start label is properly aligned. We - could instead move the label definition inside the section, but - the linker would then create the section even if it turns out to - be empty, which isn't pretty. */ - . = ALIGN(32 / 8); - PROVIDE (__preinit_array_start = .); - .preinit_array : { KEEP (*(.preinit_array)) } >vram = 0xff - PROVIDE (__preinit_array_end = .); - PROVIDE (__init_array_start = .); - .init_array : { KEEP (*(.init_array)) } >vram = 0xff - PROVIDE (__init_array_end = .); - PROVIDE (__fini_array_start = .); - .fini_array : { KEEP (*(.fini_array)) } >vram = 0xff - PROVIDE (__fini_array_end = .); - - .ctors : - { - /* gcc uses crtbegin.o to find the start of the constructors, so - we make sure it is first. Because this is a wildcard, it - doesn't matter if the user does not actually link against - crtbegin.o; the linker won't look for a file to match a - wildcard. The wildcard also means that it doesn't matter which - directory crtbegin.o is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >vram = 0xff - - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >vram = 0xff - - .eh_frame : - { - KEEP (*(.eh_frame)) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >vram = 0xff - - .gcc_except_table : - { - *(.gcc_except_table) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >vram = 0xff - .jcr : { KEEP (*(.jcr)) } >vram = 0 - .got : { *(.got.plt) *(.got) } >vram = 0 - - - .vram ALIGN(4) : - { - __vram_start = ABSOLUTE(.) ; - *(.vram) - *vram.*(.text) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - __vram_end = ABSOLUTE(.) ; - } >vram = 0xff - - - .data ALIGN(4) : { - __data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d*) - CONSTRUCTORS - . = ALIGN(4); - __data_end = ABSOLUTE(.) ; - } >vram = 0xff - - - - .bss ALIGN(4) : - { - __bss_start = ABSOLUTE(.); - __bss_start__ = ABSOLUTE(.); - *(.dynbss) - *(.gnu.linkonce.b*) - *(.bss*) - *(COMMON) - . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ - } >vram - - __bss_end = . ; - __bss_end__ = . ; - - _end = . ; - __end__ = . ; - PROVIDE (end = _end); - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - .stack 0x80000 : { _stack = .; *(.stack) } - /* These must appear regardless of . */ -} diff --git a/retail/common/include/locations.h b/retail/common/include/locations.h index 20cbaed6f..33cbed0d3 100644 --- a/retail/common/include/locations.h +++ b/retail/common/include/locations.h @@ -93,7 +93,6 @@ #define CARDENGINEI_ARM7_DSIWARE_LOCATION 0x03037C00 #define CARDENGINEI_ARM7_DSIWARE_LOCATION3 0x03807400 #define CARDENGINEI_ARM9_LOCATION 0x027FC000 -#define CARDENGINEI_ARM9_LOCATION_DLP 0x02800000 #define CARDENGINEI_ARM9_LOCATION_DLDI_DRIVER CACHE_ADDRESS_TABLE_LOCATION #define CARDENGINEI_ARM9_LOCATION2_DLDI_DRIVER CACHE_ADDRESS_TABLE_LOCATION2 #define CARDENGINEI_ARM9_TWLSDK_LOCATION 0x02FD8800 // Used for DSi-Enhanced games in DSi mode