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
DATA := data
INCLUDES := include
#GAME_ICON := $(CURDIR)/icon.bmp
GAME_TITLE := TMFH
GAME_SUBTITLE1 := Title Manager for HiyaCFW
GAME_SUBTITLE2 := JeffRuLz
GAME_CODE := TMFH
GAME_LABEL := TITLEMANFH
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
@ -111,8 +115,9 @@ endif
#---------------------------------------------------------------------------------
$(BUILD):
@[ -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:
@echo clean ...
@ -126,6 +131,12 @@ else
#---------------------------------------------------------------------------------
$(OUTPUT).nds : $(OUTPUT).elf
$(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

View File

@ -393,7 +393,7 @@ void install(char* fpath)
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);
}
else
@ -408,6 +408,22 @@ void install(char* fpath)
fseek(f, header.ndshdr.bannerOffset, SEEK_SET);
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
int fileSize = -1;
@ -635,7 +651,7 @@ complete:
error:
fclose(f);
iprintf("\nInstallation failed.\nPress B to exit.\n");
iprintf("\nInstallation failed.\n\nPress B to exit.\n");
keyWait(KEY_A | KEY_B);
return;

View File

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

View File

@ -435,28 +435,38 @@ void subMenu()
else
{
tNDSHeader header;
tNDSBanner banner;
int fsize = getFileSize(f);
fread(&header, sizeof(tNDSHeader), 1, f);
fseek(f, header.bannerOffset, SEEK_SET);
fread(&banner, sizeof(tNDSBanner), 1, f);
fclose(f);
if (fsize > getSDCardFree())
messageBox("Not enough free space on SD card.\n");
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)
else
{
if (copyFile(fpath, outpath) == 1)
messageBox("Title saved.\n");
else
messageBox("Title dump failed.\n");
tNDSHeader header;
tNDSBanner banner;
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;