diff --git a/DSGM_Makefile b/DSGM_Makefile index 0752964..d4c2fc6 100644 --- a/DSGM_Makefile +++ b/DSGM_Makefile @@ -45,6 +45,11 @@ CFLAGS := -g -Wall -O2 -fms-extensions\ $(ARCH) CFLAGS += $(INCLUDE) -DARM9 -DGAME_NAME=\"$(GAME_TITLE)\" + +ifeq ($(USES_SAVING),YES) + CFLAGS += -DUSES_SAVING +endif + CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions ASFLAGS := -g $(ARCH) diff --git a/examples/Basic3D/Basic3D.nds b/examples/Basic3D/Basic3D.nds index 350a8c2..6a73a95 100644 Binary files a/examples/Basic3D/Basic3D.nds and b/examples/Basic3D/Basic3D.nds differ diff --git a/examples/Basic3D/Makefile b/examples/Basic3D/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/Basic3D/Makefile +++ b/examples/Basic3D/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/BasicSaving/BasicSaving.nds b/examples/BasicSaving/BasicSaving.nds index 4f2cb65..3b56505 100644 Binary files a/examples/BasicSaving/BasicSaving.nds and b/examples/BasicSaving/BasicSaving.nds differ diff --git a/examples/BasicSaving/Makefile b/examples/BasicSaving/Makefile index 5bb20ff..7e5d875 100644 --- a/examples/BasicSaving/Makefile +++ b/examples/BasicSaving/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := YES + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/Collision/Collision.nds b/examples/Collision/Collision.nds index 0b979ea..9409feb 100644 Binary files a/examples/Collision/Collision.nds and b/examples/Collision/Collision.nds differ diff --git a/examples/Collision/Makefile b/examples/Collision/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/Collision/Makefile +++ b/examples/Collision/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/CustomFont/CustomFont.nds b/examples/CustomFont/CustomFont.nds index e07e23b..e830d5c 100644 Binary files a/examples/CustomFont/CustomFont.nds and b/examples/CustomFont/CustomFont.nds differ diff --git a/examples/CustomFont/Makefile b/examples/CustomFont/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/CustomFont/Makefile +++ b/examples/CustomFont/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/DrawableBackground/DrawableBackground.nds b/examples/DrawableBackground/DrawableBackground.nds index 598419d..3131530 100644 Binary files a/examples/DrawableBackground/DrawableBackground.nds and b/examples/DrawableBackground/DrawableBackground.nds differ diff --git a/examples/DrawableBackground/Makefile b/examples/DrawableBackground/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/DrawableBackground/Makefile +++ b/examples/DrawableBackground/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/FruitNinja/FruitNinja.nds b/examples/FruitNinja/FruitNinja.nds index 37b44ea..fd2dd12 100644 Binary files a/examples/FruitNinja/FruitNinja.nds and b/examples/FruitNinja/FruitNinja.nds differ diff --git a/examples/FruitNinja/Makefile b/examples/FruitNinja/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/FruitNinja/Makefile +++ b/examples/FruitNinja/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/Galaxy/Galaxy.nds b/examples/Galaxy/Galaxy.nds index 2a01466..2d33bb9 100644 Binary files a/examples/Galaxy/Galaxy.nds and b/examples/Galaxy/Galaxy.nds differ diff --git a/examples/Galaxy/Makefile b/examples/Galaxy/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/Galaxy/Makefile +++ b/examples/Galaxy/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/LargeBackground/LargeBackground.nds b/examples/LargeBackground/LargeBackground.nds index 6ffdf41..7f8a4bb 100644 Binary files a/examples/LargeBackground/LargeBackground.nds and b/examples/LargeBackground/LargeBackground.nds differ diff --git a/examples/LargeBackground/Makefile b/examples/LargeBackground/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/LargeBackground/Makefile +++ b/examples/LargeBackground/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/MD2/MD2.nds b/examples/MD2/MD2.nds index aace55e..3b524c1 100644 Binary files a/examples/MD2/MD2.nds and b/examples/MD2/MD2.nds differ diff --git a/examples/MD2/Makefile b/examples/MD2/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/MD2/Makefile +++ b/examples/MD2/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/MarioKart/Makefile b/examples/MarioKart/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/MarioKart/Makefile +++ b/examples/MarioKart/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/MarioKart/MarioKart.nds b/examples/MarioKart/MarioKart.nds index a12d9c6..8a005b4 100644 Binary files a/examples/MarioKart/MarioKart.nds and b/examples/MarioKart/MarioKart.nds differ diff --git a/examples/NiFi/Makefile b/examples/NiFi/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/NiFi/Makefile +++ b/examples/NiFi/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/NiFi/NiFi.nds b/examples/NiFi/NiFi.nds index 95385ae..2ff43a9 100644 Binary files a/examples/NiFi/NiFi.nds and b/examples/NiFi/NiFi.nds differ diff --git a/examples/Priority/Makefile b/examples/Priority/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/Priority/Makefile +++ b/examples/Priority/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/Priority/Priority.nds b/examples/Priority/Priority.nds index 8d1c16c..bc86f5f 100644 Binary files a/examples/Priority/Priority.nds and b/examples/Priority/Priority.nds differ diff --git a/examples/RoomPersistency/Makefile b/examples/RoomPersistency/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/RoomPersistency/Makefile +++ b/examples/RoomPersistency/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/RoomPersistency/RoomPersistency.nds b/examples/RoomPersistency/RoomPersistency.nds index 3c30db6..9afbd36 100644 Binary files a/examples/RoomPersistency/RoomPersistency.nds and b/examples/RoomPersistency/RoomPersistency.nds differ diff --git a/examples/RoomSaving/Makefile b/examples/RoomSaving/Makefile index 5bb20ff..7e5d875 100644 --- a/examples/RoomSaving/Makefile +++ b/examples/RoomSaving/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := YES + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/RoomSaving/RoomSaving.nds b/examples/RoomSaving/RoomSaving.nds index ece7a94..dd0c96c 100644 Binary files a/examples/RoomSaving/RoomSaving.nds and b/examples/RoomSaving/RoomSaving.nds differ diff --git a/examples/RotationBackground/Makefile b/examples/RotationBackground/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/RotationBackground/Makefile +++ b/examples/RotationBackground/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/RotationBackground/RotationBackground.nds b/examples/RotationBackground/RotationBackground.nds index b7073fd..c961a51 100644 Binary files a/examples/RotationBackground/RotationBackground.nds and b/examples/RotationBackground/RotationBackground.nds differ diff --git a/examples/RotsetEffects/Makefile b/examples/RotsetEffects/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/RotsetEffects/Makefile +++ b/examples/RotsetEffects/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/RotsetEffects/RotsetEffects.nds b/examples/RotsetEffects/RotsetEffects.nds index 0672370..cfa97d6 100644 Binary files a/examples/RotsetEffects/RotsetEffects.nds and b/examples/RotsetEffects/RotsetEffects.nds differ diff --git a/examples/TopDownShooter/Makefile b/examples/TopDownShooter/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/TopDownShooter/Makefile +++ b/examples/TopDownShooter/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/TopDownShooter/TopDownShooter.nds b/examples/TopDownShooter/TopDownShooter.nds index 5664ecc..96cd6fe 100644 Binary files a/examples/TopDownShooter/TopDownShooter.nds and b/examples/TopDownShooter/TopDownShooter.nds differ diff --git a/examples/Unpossible/Makefile b/examples/Unpossible/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/Unpossible/Makefile +++ b/examples/Unpossible/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/Unpossible/Unpossible.nds b/examples/Unpossible/Unpossible.nds index 6f390bc..db78ec3 100644 Binary files a/examples/Unpossible/Unpossible.nds and b/examples/Unpossible/Unpossible.nds differ diff --git a/examples/Worms/Makefile b/examples/Worms/Makefile index 5bb20ff..2e88cea 100644 --- a/examples/Worms/Makefile +++ b/examples/Worms/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/examples/Worms/Worms.nds b/examples/Worms/Worms.nds index 8186841..b110abb 100644 Binary files a/examples/Worms/Worms.nds and b/examples/Worms/Worms.nds differ diff --git a/include/DSGM_projectHelper.h b/include/DSGM_projectHelper.h index 27c58f7..fd9690c 100644 --- a/include/DSGM_projectHelper.h +++ b/include/DSGM_projectHelper.h @@ -9,19 +9,23 @@ #define DSGM_GotoNextRoom(persistent) DSGM_SwitchRoom(DSGM_currentRoom + 1, persistent) void DSGM_InitSaving(int argc, char **argv) { - if(argc > 0 && strlen(argv[0]) > 4) { - snprintf(DSGM_saveName, 255, "%.*s.sav", strlen(argv[0]) - 4, argv[0]); - } - else { - sprintf(DSGM_saveName, "fat:/" GAME_NAME ".sav"); - } - - DSGM_save = fopen(DSGM_saveName, "r+b"); - - if(!DSGM_save) { - DSGM_save = fopen(DSGM_saveName, "wb"); - fclose(DSGM_save); - } + #if USES_SAVING + DSGM_Debug("InitSaving\n"); + + if(argc > 0 && strlen(argv[0]) > 4) { + snprintf(DSGM_saveName, 255, "%.*s.sav", strlen(argv[0]) - 4, argv[0]); + } + else { + sprintf(DSGM_saveName, "fat:/" GAME_NAME ".sav"); + } + + DSGM_save = fopen(DSGM_saveName, "r+b"); + + if(!DSGM_save) { + DSGM_save = fopen(DSGM_saveName, "wb"); + fclose(DSGM_save); + } + #endif } void DSGM_Init(int argc, char **argv) { diff --git a/lib/libdsgm.a b/lib/libdsgm.a index 770eacd..4c09caa 100644 Binary files a/lib/libdsgm.a and b/lib/libdsgm.a differ diff --git a/template/Makefile b/template/Makefile index 5bb20ff..2e88cea 100644 --- a/template/Makefile +++ b/template/Makefile @@ -1,2 +1,4 @@ +USES_SAVING := NO + DSGMLIB := $(DEVKITPRO)/dsgmLib include $(DSGMLIB)/DSGM_Makefile \ No newline at end of file diff --git a/template/template.nds b/template/template.nds index 90d62a3..58fbfb7 100644 Binary files a/template/template.nds and b/template/template.nds differ