mirror of
https://github.com/CTurt/dsgmLib.git
synced 2025-06-18 14:45:43 -04:00
Select whether to use saving in the Makefile
This commit is contained in:
parent
c9b87ec095
commit
517d421d00
@ -45,6 +45,11 @@ CFLAGS := -g -Wall -O2 -fms-extensions\
|
|||||||
$(ARCH)
|
$(ARCH)
|
||||||
|
|
||||||
CFLAGS += $(INCLUDE) -DARM9 -DGAME_NAME=\"$(GAME_TITLE)\"
|
CFLAGS += $(INCLUDE) -DARM9 -DGAME_NAME=\"$(GAME_TITLE)\"
|
||||||
|
|
||||||
|
ifeq ($(USES_SAVING),YES)
|
||||||
|
CFLAGS += -DUSES_SAVING
|
||||||
|
endif
|
||||||
|
|
||||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||||
|
|
||||||
ASFLAGS := -g $(ARCH)
|
ASFLAGS := -g $(ARCH)
|
||||||
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := YES
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := YES
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
@ -9,19 +9,23 @@
|
|||||||
#define DSGM_GotoNextRoom(persistent) DSGM_SwitchRoom(DSGM_currentRoom + 1, persistent)
|
#define DSGM_GotoNextRoom(persistent) DSGM_SwitchRoom(DSGM_currentRoom + 1, persistent)
|
||||||
|
|
||||||
void DSGM_InitSaving(int argc, char **argv) {
|
void DSGM_InitSaving(int argc, char **argv) {
|
||||||
if(argc > 0 && strlen(argv[0]) > 4) {
|
#if USES_SAVING
|
||||||
snprintf(DSGM_saveName, 255, "%.*s.sav", strlen(argv[0]) - 4, argv[0]);
|
DSGM_Debug("InitSaving\n");
|
||||||
}
|
|
||||||
else {
|
if(argc > 0 && strlen(argv[0]) > 4) {
|
||||||
sprintf(DSGM_saveName, "fat:/" GAME_NAME ".sav");
|
snprintf(DSGM_saveName, 255, "%.*s.sav", strlen(argv[0]) - 4, argv[0]);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
DSGM_save = fopen(DSGM_saveName, "r+b");
|
sprintf(DSGM_saveName, "fat:/" GAME_NAME ".sav");
|
||||||
|
}
|
||||||
if(!DSGM_save) {
|
|
||||||
DSGM_save = fopen(DSGM_saveName, "wb");
|
DSGM_save = fopen(DSGM_saveName, "r+b");
|
||||||
fclose(DSGM_save);
|
|
||||||
}
|
if(!DSGM_save) {
|
||||||
|
DSGM_save = fopen(DSGM_saveName, "wb");
|
||||||
|
fclose(DSGM_save);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSGM_Init(int argc, char **argv) {
|
void DSGM_Init(int argc, char **argv) {
|
||||||
|
BIN
lib/libdsgm.a
BIN
lib/libdsgm.a
Binary file not shown.
@ -1,2 +1,4 @@
|
|||||||
|
USES_SAVING := NO
|
||||||
|
|
||||||
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
DSGMLIB := $(DEVKITPRO)/dsgmLib
|
||||||
include $(DSGMLIB)/DSGM_Makefile
|
include $(DSGMLIB)/DSGM_Makefile
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user