├── UpdateSuppressor.xml ├── icon.png ├── banner.png ├── banner.wav ├── .gitignore ├── README.md ├── source └── main.c ├── cia.rsf └── Makefile /UpdateSuppressor.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiantBlargg/UpdateSuppressor/HEAD/icon.png -------------------------------------------------------------------------------- /banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiantBlargg/UpdateSuppressor/HEAD/banner.png -------------------------------------------------------------------------------- /banner.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GiantBlargg/UpdateSuppressor/HEAD/banner.wav -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.3dsx 2 | *.elf 3 | *.smdh 4 | Thumbs.db 5 | build/ 6 | .project 7 | .cproject 8 | .settings/ 9 | /UpdateSuppressor.zip 10 | *.cia 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UpdateSuppressor 2 | Temporarily suppresses the 3ds update nag. 3 | 4 | Pick the app who's update you want blocked using the HBmenu title selector. 5 | 6 | Program will automatically exit if all goes well. 7 | 8 | Placing an empty file named `halt` in the same folder as the program will override this, as well as asking for confirmation before deleting the version record. 9 | 10 | Some code shamelessly stolen from 11 | 12 | Icon made by gbatemp user [xplay10](https://gbatemp.net/members/xplay10.378300/). 13 | -------------------------------------------------------------------------------- /source/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include <3ds.h> 6 | 7 | #ifndef VERSION 8 | #define VERSION 9 | #endif 10 | 11 | #define ENTRY_SIZE 0x10 12 | 13 | enum Mode { 14 | MODE_SINGLE, MODE_ALL, MODE_FILE //Not implemented 15 | }; 16 | 17 | enum Mode mode; 18 | 19 | int debug; 20 | 21 | int confirm() { 22 | while (aptMainLoop()) { 23 | hidScanInput(); 24 | gspWaitForVBlank(); 25 | 26 | u32 kDown = hidKeysDown(); 27 | if (!(kDown & (KEY_A | KEY_B))) 28 | break; 29 | } 30 | while (aptMainLoop()) { 31 | hidScanInput(); 32 | gspWaitForVBlank(); 33 | 34 | u32 kDown = hidKeysDown(); 35 | if (kDown & KEY_A) 36 | return true; 37 | if (kDown & KEY_B) 38 | return false; 39 | } 40 | return false; 41 | } 42 | 43 | FS_Archive extdata_archive; 44 | 45 | FS_Path verListPath; 46 | 47 | Result initFS() { 48 | u32 extdata_archive_lowpathdata[3] = { MEDIATYPE_NAND, 0xf000000e, 0 }; 49 | extdata_archive = (FS_Archive ) { ARCHIVE_SHARED_EXTDATA, 50 | (FS_Path ) { PATH_BINARY, 0xC, 51 | (u8*) extdata_archive_lowpathdata } }; 52 | 53 | verListPath = fsMakePath(PATH_ASCII, "/versionList.dat"); 54 | 55 | return FSUSER_OpenArchive(&extdata_archive); 56 | } 57 | 58 | Result getFile(u8 ** buffer, u64 * size) { 59 | Result ret = 0; 60 | Handle filehandle = 0; 61 | u32 tmpval = 0; 62 | 63 | ret = FSUSER_OpenFile(&filehandle, extdata_archive, verListPath, 64 | FS_OPEN_READ, 0); 65 | if (ret != 0) 66 | return ret; 67 | 68 | ret = FSFILE_GetSize(filehandle, size); 69 | if (ret != 0) 70 | return ret; 71 | 72 | if (*size <= ENTRY_SIZE) { 73 | *size = 0; 74 | return ret; 75 | } 76 | 77 | if (mode == MODE_ALL) 78 | *size = ENTRY_SIZE; 79 | 80 | *buffer = malloc(*size); 81 | ret = FSFILE_Read(filehandle, &tmpval, 0, *buffer, *size); 82 | 83 | if (ret != 0) 84 | return ret; 85 | 86 | FSFILE_Close(filehandle); 87 | return ret; 88 | } 89 | 90 | Result putFile(u8 * buffer, u64 size) { 91 | Result ret = 0; 92 | Handle filehandle = 0; 93 | u32 tmpval = 0; 94 | 95 | ret = FSUSER_DeleteFile(extdata_archive, verListPath); 96 | 97 | ret = FSUSER_CreateFile(extdata_archive, verListPath, 0, size); 98 | if (ret != 0) 99 | return ret; 100 | 101 | ret = FSUSER_OpenFile(&filehandle, extdata_archive, verListPath, 102 | FS_OPEN_WRITE, 0); 103 | if (ret != 0) 104 | return ret; 105 | 106 | ret = FSFILE_Write(filehandle, &tmpval, 0, buffer, size, FS_WRITE_FLUSH); 107 | FSFILE_Close(filehandle); 108 | 109 | return ret; 110 | } 111 | 112 | void setModes(void) { 113 | mode = (access("UpdateSuppressor.xml", F_OK) != -1) ? 114 | MODE_SINGLE : MODE_ALL; 115 | 116 | debug = (access("debug", F_OK) != -1); 117 | } 118 | 119 | int deleteEntry(u64 PID, u8 * buffer, u64 size) { 120 | u64 *file = (u64 *) buffer; 121 | 122 | u64 entry = 0; 123 | while (true) { 124 | 125 | if (file[entry * 0x2] == PID) 126 | break; 127 | 128 | entry++; 129 | if (entry * ENTRY_SIZE >= size) 130 | break; 131 | } 132 | 133 | if (entry * ENTRY_SIZE >= size) { 134 | printf("Version record not found.\n"); 135 | debug = true; 136 | return 2; 137 | } else { 138 | printf("Version record found at entry %X.\n", 139 | (unsigned int) (entry & 0xFFFFFFFF)); 140 | 141 | gfxFlushBuffers(); 142 | gfxSwapBuffers(); 143 | 144 | if (debug) { 145 | printf("Do you want to remove this record?(A/B)\n"); 146 | gfxFlushBuffers(); 147 | gfxSwapBuffers(); 148 | if (confirm() == false) { 149 | return 1; 150 | } 151 | } 152 | 153 | file[entry * 0x2] = 0x0; 154 | } 155 | return 0; 156 | } 157 | 158 | int main() { 159 | 160 | gfxInitDefault(); 161 | consoleInit(GFX_BOTTOM, NULL); 162 | 163 | printf("Update Suppressor %s\n", VERSION); 164 | 165 | setModes(); 166 | 167 | if (debug) 168 | printf("Debug Mode\n"); 169 | 170 | switch (mode) { 171 | case MODE_SINGLE: 172 | puts("Single Mode"); 173 | break; 174 | case MODE_ALL: 175 | puts("All Mode"); 176 | break; 177 | case MODE_FILE: 178 | puts("Not Implemented: File Mode"); 179 | break; 180 | default: 181 | puts("wtf? Unknown Mode"); 182 | break; 183 | } 184 | 185 | u64 PID = 0; 186 | if (mode == MODE_SINGLE) { 187 | aptOpenSession(); 188 | APT_GetProgramID(&PID); 189 | aptCloseSession(); 190 | 191 | printf("Title Id: %08X%08X\n", (unsigned int) (PID >> 32), 192 | (unsigned int) (PID & 0xFFFFFFFF)); 193 | } 194 | 195 | gfxFlushBuffers(); 196 | gfxSwapBuffers(); 197 | 198 | u8* u8file; 199 | u64 size; 200 | 201 | Result ret = initFS(); 202 | if (ret != 0) { 203 | printf("Error Initializing: %li\n", ret); 204 | debug = true; 205 | } else { 206 | 207 | ret = getFile(&u8file, &size); 208 | if (ret != 0) { 209 | printf("Error Reading: %li\n", ret); 210 | debug = true; 211 | } else if (size == 0) { 212 | puts("File already cleared"); 213 | debug = true; 214 | } else { 215 | 216 | if (mode != MODE_ALL) { 217 | 218 | ret = (Result) deleteEntry(PID, u8file, size); 219 | } else if (debug) { 220 | printf("Do you want to remove the list?(A/B)\n"); 221 | gfxFlushBuffers(); 222 | gfxSwapBuffers(); 223 | if (confirm() == false) { 224 | ret = 1; 225 | } 226 | } 227 | 228 | if (ret == 1) { 229 | gfxExit(); 230 | return 0; 231 | } 232 | 233 | if (ret == 0) { 234 | ret = putFile(u8file, size); 235 | 236 | if (ret != 0) { 237 | printf("Error Writing: %li\n", ret); 238 | debug = true; 239 | } else { 240 | printf("Version record removed.\n"); 241 | } 242 | } 243 | } 244 | 245 | FSUSER_CloseArchive(&extdata_archive); 246 | } 247 | 248 | gfxFlushBuffers(); 249 | gfxSwapBuffers(); 250 | 251 | if (debug) 252 | confirm(); 253 | 254 | gfxExit(); 255 | return 0; 256 | } 257 | -------------------------------------------------------------------------------- /cia.rsf: -------------------------------------------------------------------------------- 1 | BasicInfo: 2 | Title : $(APP_TITLE) 3 | ProductCode : "UpSup" # You can make this whatever you want, it doesn't have to follow the Nintendo standard 4 | Logo : Homebrew # Nintendo / Licensed / Distributed / iQue / iQueForSystem / Homebrew 5 | 6 | #RomFs: 7 | # Specifies the root path of the read only file system to include in the ROM. 8 | # RootPath : $(APP_ROMFS) 9 | 10 | TitleInfo: 11 | Category : Application 12 | UniqueId : 0x1F504 #Something like 0x1337, but you can make it whatever you want, as long as it's a hexadecimal number (probably best to make it something actually unique though!) 13 | 14 | Option: 15 | UseOnSD : true # true if App is to be installed to SD 16 | FreeProductCode : true # Removes limitations on ProductCode 17 | MediaFootPadding : false # If true CCI files are created with padding 18 | EnableCrypt : false # Enables encryption for NCCH and CIA 19 | EnableCompress : true # Compresses where applicable (currently only exefs:/.code) 20 | AccessControlInfo: 21 | CoreVersion : 2 22 | 23 | # Exheader Format Version 24 | DescVersion : 2 25 | # Minimum Required Kernel Version (below is for 4.5.0) 26 | ReleaseKernelMajor : "02" 27 | ReleaseKernelMinor : "33" 28 | 29 | # ExtData 30 | UseExtSaveData : false # enables ExtData 31 | #ExtSaveDataId : 0x300 # only set this when the ID is different to the UniqueId 32 | 33 | # FS:USER Archive Access Permissions 34 | # Uncomment as required 35 | FileSystemAccess: 36 | #- CategorySystemApplication 37 | #- CategoryHardwareCheck 38 | - CategoryFileSystemTool 39 | #- Debug 40 | #- TwlCardBackup 41 | #- TwlNandData 42 | #- Boss 43 | - DirectSdmc 44 | #- Core 45 | #- CtrNandRo 46 | #- CtrNandRw 47 | #- CtrNandRoWrite 48 | #- CategorySystemSettings 49 | #- CardBoard 50 | #- ExportImportIvs 51 | #- DirectSdmcWrite 52 | #- SwitchCleanup 53 | #- SaveDataMove 54 | #- Shop 55 | #- Shell 56 | #- CategoryHomeMenu 57 | 58 | # Process Settings 59 | MemoryType : Application # Application/System/Base 60 | SystemMode : 64MB # 64MB(Default)/96MB/80MB/72MB/32MB 61 | IdealProcessor : 0 62 | AffinityMask : 1 63 | Priority : 16 64 | MaxCpu : 0x9E # Default 65 | HandleTableSize : 0x200 66 | DisableDebug : false 67 | EnableForceDebug : false 68 | CanWriteSharedPage : true 69 | CanUsePrivilegedPriority : false 70 | CanUseNonAlphabetAndNumber : true 71 | PermitMainFunctionArgument : true 72 | CanShareDeviceMemory : true 73 | RunnableOnSleep : false 74 | SpecialMemoryArrange : true 75 | 76 | # New3DS Exclusive Process Settings 77 | #SystemModeExt : Legacy # Legacy(Default)/124MB/178MB Legacy:Use Old3DS SystemMode 78 | #CpuSpeed : 268MHz # 268MHz(Default)/804MHz 79 | #EnableL2Cache : true # false(default)/true 80 | #CanAccessCore2 : true 81 | 82 | # Virtual Address Mappings 83 | IORegisterMapping: 84 | - 1ff00000-1ff7ffff # DSP memory 85 | MemoryMapping: 86 | - 1f000000-1f5fffff:r # VRAM 87 | 88 | # Accessible SVCs, : 89 | SystemCallAccess: 90 | ArbitrateAddress: 34 91 | Backdoor: 123 92 | Break: 60 93 | CancelTimer: 28 94 | ClearEvent: 25 95 | ClearTimer: 29 96 | CloseHandle: 35 97 | ConnectToPort: 45 98 | ControlMemory: 1 99 | ControlProcessMemory: 112 100 | CreateAddressArbiter: 33 101 | CreateEvent: 23 102 | CreateMemoryBlock: 30 103 | CreateMutex: 19 104 | CreateSemaphore: 21 105 | CreateThread: 8 106 | CreateTimer: 26 107 | DuplicateHandle: 39 108 | ExitProcess: 3 109 | ExitThread: 9 110 | GetCurrentProcessorNumber: 17 111 | GetHandleInfo: 41 112 | GetProcessId: 53 113 | GetProcessIdOfThread: 54 114 | GetProcessIdealProcessor: 6 115 | GetProcessInfo: 43 116 | GetResourceLimit: 56 117 | GetResourceLimitCurrentValues: 58 118 | GetResourceLimitLimitValues: 57 119 | GetSystemInfo: 42 120 | GetSystemTick: 40 121 | GetThreadContext: 59 122 | GetThreadId: 55 123 | GetThreadIdealProcessor: 15 124 | GetThreadInfo: 44 125 | GetThreadPriority: 11 126 | MapMemoryBlock: 31 127 | OutputDebugString: 61 128 | QueryMemory: 2 129 | ReleaseMutex: 20 130 | ReleaseSemaphore: 22 131 | SendSyncRequest1: 46 132 | SendSyncRequest2: 47 133 | SendSyncRequest3: 48 134 | SendSyncRequest4: 49 135 | SendSyncRequest: 50 136 | SetThreadPriority: 12 137 | SetTimer: 27 138 | SignalEvent: 24 139 | SleepThread: 10 140 | UnmapMemoryBlock: 32 141 | WaitSynchronization1: 36 142 | WaitSynchronizationN: 37 143 | 144 | # Service List 145 | # Maximum 34 services (32 if firmware is prior to 9.6.0) 146 | ServiceAccessControl: 147 | - APT:U 148 | - ac:u 149 | - am:net 150 | - boss:U 151 | - cam:u 152 | - cecd:u 153 | - cfg:nor 154 | - cfg:u 155 | - csnd:SND 156 | - dsp::DSP 157 | - frd:u 158 | - fs:USER 159 | - gsp::Gpu 160 | - hid:USER 161 | - http:C 162 | - ir:rst 163 | - ir:u 164 | - ir:USER 165 | - mic:u 166 | - ndm:u 167 | - news:u 168 | - nwm::UDS 169 | - ptm:u 170 | - pxi:dev 171 | - soc:U 172 | - ssl:C 173 | - y2r:u 174 | 175 | 176 | SystemControlInfo: 177 | SaveDataSize: 0KB # Change if the app uses savedata 178 | RemasterVersion: 2 179 | StackSize: 0x40000 180 | 181 | # Modules that run services listed above should be included below 182 | # Maximum 48 dependencies 183 | # : 184 | Dependency: 185 | ac: 0x0004013000002402 186 | #act: 0x0004013000003802 187 | am: 0x0004013000001502 188 | boss: 0x0004013000003402 189 | camera: 0x0004013000001602 190 | cecd: 0x0004013000002602 191 | cfg: 0x0004013000001702 192 | codec: 0x0004013000001802 193 | csnd: 0x0004013000002702 194 | dlp: 0x0004013000002802 195 | dsp: 0x0004013000001a02 196 | friends: 0x0004013000003202 197 | gpio: 0x0004013000001b02 198 | gsp: 0x0004013000001c02 199 | hid: 0x0004013000001d02 200 | http: 0x0004013000002902 201 | i2c: 0x0004013000001e02 202 | ir: 0x0004013000003302 203 | mcu: 0x0004013000001f02 204 | mic: 0x0004013000002002 205 | ndm: 0x0004013000002b02 206 | news: 0x0004013000003502 207 | #nfc: 0x0004013000004002 208 | nim: 0x0004013000002c02 209 | nwm: 0x0004013000002d02 210 | pdn: 0x0004013000002102 211 | ps: 0x0004013000003102 212 | ptm: 0x0004013000002202 213 | #qtm: 0x0004013020004202 214 | ro: 0x0004013000003702 215 | socket: 0x0004013000002e02 216 | spi: 0x0004013000002302 217 | ssl: 0x0004013000002f02 218 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------------------- 2 | .SUFFIXES: 3 | #--------------------------------------------------------------------------------- 4 | 5 | ifeq ($(strip $(DEVKITARM)),) 6 | $(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") 7 | endif 8 | 9 | TOPDIR ?= $(CURDIR) 10 | include $(DEVKITARM)/3ds_rules 11 | 12 | #--------------------------------------------------------------------------------- 13 | # TARGET is the name of the output 14 | # BUILD is the directory where object files & intermediate files will be placed 15 | # SOURCES is a list of directories containing source code 16 | # DATA is a list of directories containing data files 17 | # INCLUDES is a list of directories containing header files 18 | # 19 | # NO_SMDH: if set to anything, no SMDH file is generated. 20 | # APP_TITLE is the name of the app stored in the SMDH file (Optional) 21 | # APP_DESCRIPTION is the description of the app stored in the SMDH file (Optional) 22 | # APP_AUTHOR is the author of the app stored in the SMDH file (Optional) 23 | # ICON is the filename of the icon (.png), relative to the project folder. 24 | # If not set, it attempts to use one of the following (in this order): 25 | # - .png 26 | # - icon.png 27 | # - /default_icon.png 28 | #--------------------------------------------------------------------------------- 29 | TARGET := $(notdir $(CURDIR)) 30 | BUILD := build 31 | SOURCES := source 32 | DATA := data 33 | INCLUDES := include 34 | 35 | APP_TITLE := Update Suppressor 36 | APP_DESCRIPTION := Temporarily suppresses the 3ds update nag. 37 | APP_AUTHOR := Giantblargg 38 | 39 | MAJOR_VER := 0 40 | MINOR_VER := 2 41 | MICRO_VER := 0 42 | VER_TAG := dev 43 | VERSION := v$(MAJOR_VER).$(MINOR_VER).$(MICRO_VER) 44 | 45 | ifneq ($(VER_TAG),) 46 | VERSION += -$(VER_TAG) 47 | endif 48 | 49 | 50 | #--------------------------------------------------------------------------------- 51 | # options for code generation 52 | #--------------------------------------------------------------------------------- 53 | ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft 54 | 55 | CFLAGS := -g -Wall -O2 -mword-relocations \ 56 | -fomit-frame-pointer -ffast-math \ 57 | $(ARCH) 58 | 59 | CFLAGS += $(INCLUDE) -DARM11 -D_3DS 60 | 61 | CFLAGS += -D VERSION="\"$(VERSION)\"" 62 | 63 | CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 64 | 65 | ASFLAGS := -g $(ARCH) 66 | LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) 67 | 68 | LIBS := -lctru -lm 69 | 70 | #--------------------------------------------------------------------------------- 71 | # list of directories containing libraries, this must be the top level containing 72 | # include and lib 73 | #--------------------------------------------------------------------------------- 74 | LIBDIRS := $(CTRULIB) 75 | 76 | 77 | #--------------------------------------------------------------------------------- 78 | # no real need to edit anything past this point unless you need to add additional 79 | # rules for different file extensions 80 | #--------------------------------------------------------------------------------- 81 | ifneq ($(BUILD),$(notdir $(CURDIR))) 82 | #--------------------------------------------------------------------------------- 83 | 84 | export OUTPUT := $(CURDIR)/$(TARGET) 85 | export TOPDIR := $(CURDIR) 86 | 87 | export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ 88 | $(foreach dir,$(DATA),$(CURDIR)/$(dir)) 89 | 90 | export DEPSDIR := $(CURDIR)/$(BUILD) 91 | 92 | CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) 93 | CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) 94 | SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) 95 | BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) 96 | 97 | #--------------------------------------------------------------------------------- 98 | # use CXX for linking C++ projects, CC for standard C 99 | #--------------------------------------------------------------------------------- 100 | ifeq ($(strip $(CPPFILES)),) 101 | #--------------------------------------------------------------------------------- 102 | export LD := $(CC) 103 | #--------------------------------------------------------------------------------- 104 | else 105 | #--------------------------------------------------------------------------------- 106 | export LD := $(CXX) 107 | #--------------------------------------------------------------------------------- 108 | endif 109 | #--------------------------------------------------------------------------------- 110 | 111 | export OFILES := $(addsuffix .o,$(BINFILES)) \ 112 | $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) 113 | 114 | export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ 115 | $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ 116 | -I$(CURDIR)/$(BUILD) 117 | 118 | export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) 119 | 120 | ifeq ($(strip $(ICON)),) 121 | icons := $(wildcard *.png) 122 | ifneq (,$(findstring $(TARGET).png,$(icons))) 123 | export APP_ICON := $(TOPDIR)/$(TARGET).png 124 | else 125 | ifneq (,$(findstring icon.png,$(icons))) 126 | export APP_ICON := $(TOPDIR)/icon.png 127 | endif 128 | endif 129 | else 130 | export APP_ICON := $(TOPDIR)/$(ICON) 131 | endif 132 | 133 | ifeq ($(strip $(NO_SMDH)),) 134 | export _3DSXFLAGS += --smdh=$(CURDIR)/$(TARGET).smdh 135 | endif 136 | 137 | .PHONY: $(BUILD) clean all zip 138 | 139 | #--------------------------------------------------------------------------------- 140 | all: $(BUILD) zip 141 | 142 | $(BUILD): 143 | @[ -d $@ ] || mkdir -p $@ 144 | @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile 145 | 146 | zip : $(OUTPUT)-3dsx.zip 147 | 148 | $(OUTPUT)-3dsx.zip: $(BUILD) 149 | @rm -fr $(BUILD)/$(TARGET) 150 | @mkdir $(BUILD)/$(TARGET) 151 | @cp *.3dsx *.smdh *.xml README.md -t $(BUILD)/$(TARGET) 152 | @cd $(BUILD) && zip -rFS $(OUTPUT).zip $(TARGET) 153 | 154 | 155 | #--------------------------------------------------------------------------------- 156 | clean: 157 | @echo clean ... 158 | @rm -fr $(BUILD) $(TARGET).3dsx $(OUTPUT).smdh $(TARGET).elf $(TARGET)-3dsx.zip $(TARGET).cia 159 | 160 | 161 | #--------------------------------------------------------------------------------- 162 | else 163 | 164 | DEPENDS := $(OFILES:.o=.d) 165 | 166 | .PHONY: all 167 | #--------------------------------------------------------------------------------- 168 | # main targets 169 | #--------------------------------------------------------------------------------- 170 | all : $(OUTPUT).3dsx $(OUTPUT).cia 171 | 172 | ifeq ($(strip $(NO_SMDH)),) 173 | $(OUTPUT).3dsx : $(OUTPUT).elf $(OUTPUT).smdh 174 | else 175 | $(OUTPUT).3dsx : $(OUTPUT).elf 176 | endif 177 | 178 | $(OUTPUT).elf : $(OFILES) 179 | 180 | #--------------------------------------------------------------------------------- 181 | %.cia : $(TOPDIR)/cia.rsf %.elf %.icn banner.bnr 182 | makerom -f cia -o $@ -rsf $(TOPDIR)/cia.rsf -DAPP_TITLE="$(APP_TITLE)" -target t -exefslogo -elf $*.elf -icon $*.icn -banner banner.bnr -major $(MAJOR_VER) -minor $(MINOR_VER) -micro $(MICRO_VER) 183 | @echo built ... $(notdir $@) 184 | 185 | %.icn : $(APP_ICON) 186 | @bannertool makesmdh -i "$(APP_ICON)" -o "$@" -s "$(APP_TITLE)" -l "$(APP_TITLE)" -p "$(APP_AUTHOR)" 187 | 188 | %.bnr : $(TOPDIR)/%.png $(TOPDIR)/%.wav 189 | bannertool makebanner -i $(TOPDIR)/$*.png -a $(TOPDIR)/$*.wav -o $@ 190 | 191 | #--------------------------------------------------------------------------------- 192 | # you need a rule like this for each extension you use as binary data 193 | #--------------------------------------------------------------------------------- 194 | %.bin.o : %.bin 195 | #--------------------------------------------------------------------------------- 196 | @echo $(notdir $<) 197 | @$(bin2o) 198 | 199 | # WARNING: This is not the right way to do this! TODO: Do it right! 200 | #--------------------------------------------------------------------------------- 201 | %.vsh.o : %.vsh 202 | #--------------------------------------------------------------------------------- 203 | @echo $(notdir $<) 204 | @python $(AEMSTRO)/aemstro_as.py $< ../$(notdir $<).shbin 205 | @bin2s ../$(notdir $<).shbin | $(PREFIX)as -o $@ 206 | @echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(notdir $<).shbin | tr . _)`.h 207 | @echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(notdir $<).shbin | tr . _)`.h 208 | @echo "extern const u32" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(notdir $<).shbin | tr . _)`.h 209 | @rm ../$(notdir $<).shbin 210 | 211 | -include $(DEPENDS) 212 | 213 | #--------------------------------------------------------------------------------------- 214 | endif 215 | #--------------------------------------------------------------------------------------- 216 | --------------------------------------------------------------------------------