From ed7bc5c26d9b9b936660d5b9a7c1113933fbff69 Mon Sep 17 00:00:00 2001 From: msiewert76 Date: Mon, 25 Apr 2011 20:03:31 +0000 Subject: [PATCH] The source code for the 0.1.1 release (12-7-2010). --- Makefile | 2 +- arm9/source/display.cpp | 6 +++--- arm9/source/hardware.cpp | 13 ++++++++++--- arm9/source/hardware.h | 2 +- savegame_manager.pnproj | 2 +- savegame_manager.pnps | 2 +- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 2fe57d8..8c9f7ea 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ endif include $(DEVKITARM)/ds_rules -export TARGET := $(shell basename $(CURDIR)) +export TARGET := savegame_manager export TOPDIR := $(CURDIR) diff --git a/arm9/source/display.cpp b/arm9/source/display.cpp index a9331af..6c378f5 100644 --- a/arm9/source/display.cpp +++ b/arm9/source/display.cpp @@ -55,10 +55,10 @@ void displayInit() consoleInit(&lowerScreen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true); consoleSelect(&upperScreen); - displayMessage("DS savegame manager\nVersion 0.1 Beta\nBy Pokedoc"); + displayMessage("DS savegame manager\nVersion 0.1.1 Beta\nBy Pokedoc"); - displayPrintState("Press (A) to continue"); - while (!(keysCurrent() & KEY_A)); + displayPrintState("Press (B) to continue"); + while (!(keysCurrent() & KEY_B)); } void displayPrintUpper() diff --git a/arm9/source/hardware.cpp b/arm9/source/hardware.cpp index ead96fe..800eb7c 100644 --- a/arm9/source/hardware.cpp +++ b/arm9/source/hardware.cpp @@ -272,11 +272,18 @@ void hwRestore3in1() while(0); } -void hwRestore3in1_b(uint32 size) +void hwRestore3in1_b(uint32 size_file) { - // Third, swap in a new game - swap_cart(); + uint32 size = auxspi_save_size_log_2(); + while ((size_file < size) || flash_card) { + //char txt[33]; + //sprintf(txt, "%i, %i (%i)", size_file, size, flash_card); + //displayPrintState(txt); + displayPrintState("File too small or no save chip!"); + swap_cart(); + size = auxspi_save_size_log_2(); + } displayPrintUpper(); uint8 type = auxspi_save_type(); diff --git a/arm9/source/hardware.h b/arm9/source/hardware.h index b8696f6..f1f3695 100644 --- a/arm9/source/hardware.h +++ b/arm9/source/hardware.h @@ -51,7 +51,7 @@ bool is_flash_card(); void hwBackup3in1(); void hwDump3in1(uint32 size, const char *gamename); void hwRestore3in1(); -void hwRestore3in1_b(uint32 size); +void hwRestore3in1_b(uint32 size_file); void hwErase(); void hwBackupGBA(); diff --git a/savegame_manager.pnproj b/savegame_manager.pnproj index 68ea4f5..67fab5d 100644 --- a/savegame_manager.pnproj +++ b/savegame_manager.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/savegame_manager.pnps b/savegame_manager.pnps index 14f54a4..76379c6 100644 --- a/savegame_manager.pnps +++ b/savegame_manager.pnps @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file