Select whether to use saving in the Makefile

This commit is contained in:
CTurt 2015-03-15 16:54:14 +00:00
parent c9b87ec095
commit 517d421d00
43 changed files with 62 additions and 13 deletions

View File

@ -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)

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := YES
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

View File

@ -1,2 +1,4 @@
USES_SAVING := YES
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.

View File

@ -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) {

Binary file not shown.

View File

@ -1,2 +1,4 @@
USES_SAVING := NO
DSGMLIB := $(DEVKITPRO)/dsgmLib
include $(DSGMLIB)/DSGM_Makefile

Binary file not shown.