Add files via upload

This commit is contained in:
JeffRuLz 2018-09-14 13:02:46 -05:00 committed by GitHub
parent 7319fc2e9c
commit b7bf149dc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 22 deletions

View File

@ -20,11 +20,15 @@ BUILD := build
SOURCES := src SOURCES := src
DATA := data DATA := data
INCLUDES := include INCLUDES := include
#GAME_ICON := $(CURDIR)/icon.bmp
GAME_TITLE := TMFH GAME_TITLE := TMFH
GAME_SUBTITLE1 := Title Manager for HiyaCFW GAME_SUBTITLE1 := Title Manager for HiyaCFW
GAME_SUBTITLE2 := JeffRuLz GAME_SUBTITLE2 := JeffRuLz
GAME_CODE := TMFH
GAME_LABEL := TITLEMANFH
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# options for code generation # options for code generation
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -112,6 +116,7 @@ endif
$(BUILD): $(BUILD):
@[ -d $@ ] || mkdir -p $@ @[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
@echo built ... $(notdir $@)
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
clean: clean:
@ -127,6 +132,12 @@ else
$(OUTPUT).nds : $(OUTPUT).elf $(OUTPUT).nds : $(OUTPUT).elf
$(OUTPUT).elf : $(OFILES) $(OUTPUT).elf : $(OFILES)
$(OUTPUT).nds: $(OUTPUT).elf
@ndstool -u "00030004" \
-g "$(GAME_CODE)" "00" "$(GAME_LABEL)" \
-c $(OUTPUT).nds -9 $(OUTPUT).elf \
-b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)"
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%.bin.o : %.bin %.bin.o : %.bin
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------

View File

@ -393,7 +393,7 @@ void install(char* fpath)
if (!f) if (!f)
{ {
iprintf("Error: could not open file.\nPress B to exit.\n"); iprintf("Error: could not open file.\n\nPress B to exit.\n");
keyWait(KEY_A | KEY_B); keyWait(KEY_A | KEY_B);
} }
else else
@ -408,6 +408,22 @@ void install(char* fpath)
fseek(f, header.ndshdr.bannerOffset, SEEK_SET); fseek(f, header.ndshdr.bannerOffset, SEEK_SET);
fread(&banner, sizeof(tNDSBanner), 1, f); fread(&banner, sizeof(tNDSBanner), 1, f);
} }
/*
//Check header size
if (header.ndshdr.headerSize != 0x4000)
{
iprintf("Error: no DSi header.");
goto error;
}
*/
//Check high title id
if (header.tid_high != 0x00030004 &&
header.tid_high != 0x00030005 &&
header.tid_high != 0x00030015)
{
iprintf("This file cannot be installed.\nInvalid title ID.");
goto error;
}
//Print file size //Print file size
int fileSize = -1; int fileSize = -1;
@ -635,7 +651,7 @@ complete:
error: error:
fclose(f); fclose(f);
iprintf("\nInstallation failed.\nPress B to exit.\n"); iprintf("\nInstallation failed.\n\nPress B to exit.\n");
keyWait(KEY_A | KEY_B); keyWait(KEY_A | KEY_B);
return; return;

View File

@ -7,7 +7,6 @@ void testMenu()
consoleClear(); consoleClear();
iprintf("Storage Check Test\n\n"); iprintf("Storage Check Test\n\n");
iprintf("Verify these are accurate and\nreport if they're not.\n");
consoleSelect(&bottomScreen); consoleSelect(&bottomScreen);
consoleClear(); consoleClear();

View File

@ -435,28 +435,38 @@ void subMenu()
else else
{ {
tNDSHeader header; int fsize = getFileSize(f);
tNDSBanner banner;
fread(&header, sizeof(tNDSHeader), 1, f); if (fsize > getSDCardFree())
fseek(f, header.bannerOffset, SEEK_SET); messageBox("Not enough free space on SD card.\n");
fread(&banner, sizeof(tNDSBanner), 1, f);
fclose(f);
char outpath[256]; else
sprintf(outpath, "%s%.12s - %.4s.nds", ROM_PATH, header.gameTitle, header.gameCode);
char msg[512];
sprintf(msg, "Dump title to\n%s\n", outpath);
if (choiceBox(msg) == YES)
{ {
if (copyFile(fpath, outpath) == 1) tNDSHeader header;
messageBox("Title saved.\n"); tNDSBanner banner;
else
messageBox("Title dump failed.\n"); fread(&header, sizeof(tNDSHeader), 1, f);
fseek(f, header.bannerOffset, SEEK_SET);
fread(&banner, sizeof(tNDSBanner), 1, f);
fclose(f);
char outpath[256];
sprintf(outpath, "%s%.12s - %.4s.nds", ROM_PATH, header.gameTitle, header.gameCode);
char msg[512];
sprintf(msg, "Dump title to\n%s\n", outpath);
if (choiceBox(msg) == YES)
{
if (copyFile(fpath, outpath) == 1)
messageBox("Title saved.\n");
else
messageBox("Title dump failed.\n");
}
} }
} }
fclose(f);
} }
break; break;