diff --git a/Makefile.gc b/Makefile.gc index 738c4e7..5356e00 100644 --- a/Makefile.gc +++ b/Makefile.gc @@ -18,11 +18,11 @@ include $(DEVKITPPC)/gamecube_rules TARGET := fceugx-gc TARGETDIR := executables BUILD := build_gc -SOURCES := source source/images source/sounds source/fonts source/lang \ - source/gui source/utils source/utils/unzip source/utils/sz \ +SOURCES := source source/gui source/utils source/utils/unzip source/utils/sz \ source/fceultra source/fceultra/boards source/fceultra/input \ source/fceultra/utils source/fceultra/mbshare source/utils/vm \ source/pocketnes source/pocketnes/minilzo +DATA := source/images source/sounds source/fonts source/lang INCLUDES := source #--------------------------------------------------------------------------------- @@ -72,10 +72,9 @@ CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S))) -TTFFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.ttf))) -LANGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.lang))) -PNGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.png))) -PCMFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.pcm))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ttf) \ + $(wildcard $(dir)/*.lang) $(wildcard $(dir)/*.png) \ + $(wildcard $(dir)/*.pcm))) #--------------------------------------------------------------------------------- # use CXX for linking C++ projects, CC for standard C @@ -86,16 +85,16 @@ else export LD := $(CXX) endif -export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ - $(sFILES:.s=.o) $(SFILES:.S=.o) \ - $(TTFFILES:.ttf=.ttf.o) $(LANGFILES:.lang=.lang.o) \ - $(PNGFILES:.png=.png.o) \ - $(PCMFILES:.pcm=.pcm.o) +export OFILES_BIN := $(addsuffix .o,$(BINFILES)) +export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(sFILES:.s=.o) $(SFILES:.S=.o) +export OFILES := $(OFILES_BIN) $(OFILES_SOURCES) + +export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES))) #--------------------------------------------------------------------------------- # build a list of include paths #--------------------------------------------------------------------------------- -export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ +export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ -I$(CURDIR)/$(BUILD) \ -I$(LIBOGC_INC) @@ -103,8 +102,7 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ #--------------------------------------------------------------------------------- # build a list of library paths #--------------------------------------------------------------------------------- -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ - -L$(LIBOGC_LIB) +export LIBPATHS := -L$(LIBOGC_LIB) $(foreach dir,$(LIBDIRS),-L$(dir)/lib) export OUTPUT := $(CURDIR)/$(TARGETDIR)/$(TARGET) .PHONY: $(BUILD) clean @@ -140,22 +138,24 @@ DEPENDS := $(OFILES:.o=.d) $(OUTPUT).dol: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) +$(OFILES_SOURCES) : $(HFILES) + #--------------------------------------------------------------------------------- # This rule links in binary data with these extensions: ttf lang png pcm #--------------------------------------------------------------------------------- -%.ttf.o : %.ttf +%.ttf.o %_ttf.h : %.ttf @echo $(notdir $<) $(bin2o) -%.lang.o : %.lang +%.lang.o %_lang.h : %.lang @echo $(notdir $<) $(bin2o) -%.png.o : %.png +%.png.o %_png.h : %.png @echo $(notdir $<) $(bin2o) - -%.pcm.o : %.pcm + +%.pcm.o %_pcm.h : %.pcm @echo $(notdir $<) $(bin2o) diff --git a/Makefile.wii b/Makefile.wii index 76040c0..f649af1 100644 --- a/Makefile.wii +++ b/Makefile.wii @@ -18,11 +18,11 @@ include $(DEVKITPPC)/wii_rules TARGET := fceugx-wii TARGETDIR := executables BUILD := build_wii -SOURCES := source source/images source/sounds source/fonts source/lang \ - source/gui source/utils source/utils/sz source/utils/unzip \ +SOURCES := source source/gui source/utils source/utils/sz source/utils/unzip \ source/fceultra source/fceultra/boards source/fceultra/input \ source/fceultra/utils source/fceultra/mbshare \ source/pocketnes source/pocketnes/minilzo +DATA := source/images source/sounds source/fonts source/lang INCLUDES := source #--------------------------------------------------------------------------------- @@ -73,11 +73,9 @@ CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S))) -TTFFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.ttf))) -LANGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.lang))) -PNGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.png))) -OGGFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.ogg))) -PCMFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.pcm))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ttf) \ + $(wildcard $(dir)/*.lang) $(wildcard $(dir)/*.png) \ + $(wildcard $(dir)/*.ogg) $(wildcard $(dir)/*.pcm))) #--------------------------------------------------------------------------------- # use CXX for linking C++ projects, CC for standard C @@ -88,11 +86,12 @@ else export LD := $(CXX) endif -export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ - $(sFILES:.s=.o) $(SFILES:.S=.o) \ - $(TTFFILES:.ttf=.ttf.o) $(LANGFILES:.lang=.lang.o) \ - $(PNGFILES:.png=.png.o) \ - $(OGGFILES:.ogg=.ogg.o) $(PCMFILES:.pcm=.pcm.o) +export OFILES_BIN := $(addsuffix .o,$(BINFILES)) +export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(sFILES:.s=.o) $(SFILES:.S=.o) +export OFILES := $(OFILES_BIN) $(OFILES_SOURCES) + +export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES))) + #--------------------------------------------------------------------------------- # build a list of include paths #--------------------------------------------------------------------------------- @@ -104,8 +103,7 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ #--------------------------------------------------------------------------------- # build a list of library paths #--------------------------------------------------------------------------------- -export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ - -L$(LIBOGC_LIB) +export LIBPATHS := -L$(LIBOGC_LIB) $(foreach dir,$(LIBDIRS),-L$(dir)/lib) export OUTPUT := $(CURDIR)/$(TARGETDIR)/$(TARGET) .PHONY: $(BUILD) clean @@ -141,26 +139,28 @@ DEPENDS := $(OFILES:.o=.d) $(OUTPUT).dol: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) +$(OFILES_SOURCES) : $(HFILES) + #--------------------------------------------------------------------------------- # This rule links in binary data with these extensions: ttf lang png ogg pcm #--------------------------------------------------------------------------------- -%.ttf.o : %.ttf +%.ttf.o %_ttf.h : %.ttf @echo $(notdir $<) $(bin2o) -%.lang.o : %.lang +%.lang.o %_lang.h : %.lang @echo $(notdir $<) $(bin2o) -%.png.o : %.png +%.png.o %_png.h : %.png @echo $(notdir $<) $(bin2o) -%.ogg.o : %.ogg +%.ogg.o %_ogg.h : %.ogg @echo $(notdir $<) $(bin2o) -%.pcm.o : %.pcm +%.pcm.o %_pcm.h : %.pcm @echo $(notdir $<) $(bin2o) diff --git a/source/filelist.h b/source/filelist.h index 05f3257..01fdc03 100644 --- a/source/filelist.h +++ b/source/filelist.h @@ -16,314 +16,125 @@ #include // Fonts -extern const u8 font_ttf[]; -extern const u32 font_ttf_size; +#include "font_ttf.h" // Languages -extern const u8 jp_lang[]; -extern const u32 jp_lang_size; -extern const u8 en_lang[]; -extern const u32 en_lang_size; -extern const u8 de_lang[]; -extern const u32 de_lang_size; -extern const u8 fr_lang[]; -extern const u32 fr_lang_size; -extern const u8 es_lang[]; -extern const u32 es_lang_size; -extern const u8 it_lang[]; -extern const u32 it_lang_size; -extern const u8 nl_lang[]; -extern const u32 nl_lang_size; -extern const u8 zh_lang[]; -extern const u32 zh_lang_size; -extern const u8 ko_lang[]; -extern const u32 ko_lang_size; -extern const u8 pt_lang[]; -extern const u32 pt_lang_size; -extern const u8 pt_br_lang[]; -extern const u32 pt_br_lang_size; -extern const u8 ca_lang[]; -extern const u32 ca_lang_size; -extern const u8 tr_lang[]; -extern const u32 tr_lang_size; +#include "jp_lang.h" +#include "en_lang.h" +#include "de_lang.h" +#include "fr_lang.h" +#include "es_lang.h" +#include "it_lang.h" +#include "nl_lang.h" +#include "zh_lang.h" +#include "ko_lang.h" +#include "pt_lang.h" +#include "pt_br_lang.h" +#include "ca_lang.h" +#include "tr_lang.h" // Sounds - -extern const u8 bg_music_ogg[]; -extern const u32 bg_music_ogg_size; - -extern const u8 enter_ogg[]; -extern const u32 enter_ogg_size; - -extern const u8 exit_ogg[]; -extern const u32 exit_ogg_size; - -extern const u8 button_over_pcm[]; -extern const u32 button_over_pcm_size; - -extern const u8 button_click_pcm[]; -extern const u32 button_click_pcm_size; +#ifdef HW_RVL +// background music is Wii-only +#include "bg_music_ogg.h" +#include "enter_ogg.h" +#include "exit_ogg.h" +#endif +#include "button_over_pcm.h" +#include "button_click_pcm.h" // Graphics - -extern const u8 logo_png[]; -extern const u32 logo_png_size; - -extern const u8 logo_over_png[]; -extern const u32 logo_over_png_size; - -extern const u8 bg_top_png[]; -extern const u32 bg_top_png_size; - -extern const u8 bg_bottom_png[]; -extern const u32 bg_bottom_png_size; - -extern const u8 icon_settings_png[]; -extern const u32 icon_settings_png_size; - -extern const u8 icon_home_png[]; -extern const u32 icon_home_png_size; - -extern const u8 icon_game_settings_png[]; -extern const u32 icon_game_settings_png_size; -extern const u8 icon_game_cheats_png[]; -extern const u32 icon_game_cheats_png_size; -extern const u8 icon_game_controllers_png[]; -extern const u32 icon_game_controllers_png_size; -extern const u8 icon_game_load_png[]; -extern const u32 icon_game_load_png_size; -extern const u8 icon_game_save_png[]; -extern const u32 icon_game_save_png_size; -extern const u8 icon_game_delete_png[]; -extern const u32 icon_game_delete_png_size; -extern const u8 icon_game_reset_png[]; -extern const u32 icon_game_reset_png_size; - -extern const u8 icon_settings_wiimote_png[]; -extern const u32 icon_settings_wiimote_png_size; -extern const u8 icon_settings_classic_png[]; -extern const u32 icon_settings_classic_png_size; -extern const u8 icon_settings_gamecube_png[]; -extern const u32 icon_settings_gamecube_png_size; -extern const u8 icon_settings_nunchuk_png[]; -extern const u32 icon_settings_nunchuk_png_size; -extern const u8 icon_settings_wiiupro_png[]; -extern const u32 icon_settings_wiiupro_png_size; -extern const u8 icon_settings_drc_png[]; -extern const u32 icon_settings_drc_png_size; - -extern const u8 icon_settings_nescontroller_png[]; -extern const u32 icon_settings_nescontroller_png_size; -extern const u8 icon_settings_zapper_png[]; -extern const u32 icon_settings_zapper_png_size; - -extern const u8 icon_settings_file_png[]; -extern const u32 icon_settings_file_png_size; -extern const u8 icon_settings_mappings_png[]; -extern const u32 icon_settings_mappings_png_size; -extern const u8 icon_settings_menu_png[]; -extern const u32 icon_settings_menu_png_size; -extern const u8 icon_settings_network_png[]; -extern const u32 icon_settings_network_png_size; -extern const u8 icon_settings_video_png[]; -extern const u32 icon_settings_video_png_size; -extern const u8 icon_settings_screenshot_png[]; -extern const u32 icon_settings_screenshot_png_size; - - -extern const u8 button_png[]; -extern const u32 button_png_size; - -extern const u8 button_over_png[]; -extern const u32 button_over_png_size; - -extern const u8 button_prompt_png[]; -extern const u32 button_prompt_png_size; - -extern const u8 button_prompt_over_png[]; -extern const u32 button_prompt_over_png_size; - -extern const u8 button_long_png[]; -extern const u32 button_long_png_size; - -extern const u8 button_long_over_png[]; -extern const u32 button_long_over_png_size; - -extern const u8 button_short_png[]; -extern const u32 button_short_png_size; - -extern const u8 button_short_over_png[]; -extern const u32 button_short_over_png_size; - -extern const u8 button_small_png[]; -extern const u32 button_small_png_size; - -extern const u8 button_small_over_png[]; -extern const u32 button_small_over_png_size; - -extern const u8 button_large_png[]; -extern const u32 button_large_png_size; - -extern const u8 button_large_over_png[]; -extern const u32 button_large_over_png_size; - -extern const u8 button_arrow_left_png[]; -extern const u32 button_arrow_left_png_size; - -extern const u8 button_arrow_right_png[]; -extern const u32 button_arrow_right_png_size; - -extern const u8 button_arrow_up_png[]; -extern const u32 button_arrow_up_png_size; - -extern const u8 button_arrow_down_png[]; -extern const u32 button_arrow_down_png_size; - -extern const u8 button_arrow_left_over_png[]; -extern const u32 button_arrow_left_over_png_size; - -extern const u8 button_arrow_right_over_png[]; -extern const u32 button_arrow_right_over_png_size; - -extern const u8 button_arrow_up_over_png[]; -extern const u32 button_arrow_up_over_png_size; - -extern const u8 button_arrow_down_over_png[]; -extern const u32 button_arrow_down_over_png_size; - -extern const u8 button_gamesave_png[]; -extern const u32 button_gamesave_png_size; - -extern const u8 button_gamesave_over_png[]; -extern const u32 button_gamesave_over_png_size; - -extern const u8 button_gamesave_blank_png[]; -extern const u32 button_gamesave_blank_png_size; - -extern const u8 screen_position_png[]; -extern const u32 screen_position_png_size; - -extern const u8 dialogue_box_png[]; -extern const u32 dialogue_box_png_size; - -extern const u8 credits_box_png[]; -extern const u32 credits_box_png_size; - -extern const u8 progressbar_png[]; -extern const u32 progressbar_png_size; - -extern const u8 progressbar_empty_png[]; -extern const u32 progressbar_empty_png_size; - -extern const u8 progressbar_outline_png[]; -extern const u32 progressbar_outline_png_size; - -extern const u8 throbber_png[]; -extern const u32 throbber_png_size; - -extern const u8 icon_folder_png[]; -extern const u32 icon_folder_png_size; - -extern const u8 icon_sd_png[]; -extern const u32 icon_sd_png_size; - -extern const u8 icon_usb_png[]; -extern const u32 icon_usb_png_size; - -extern const u8 icon_dvd_png[]; -extern const u32 icon_dvd_png_size; - -extern const u8 icon_smb_png[]; -extern const u32 icon_smb_png_size; - -extern const u8 battery_png[]; -extern const u32 battery_png_size; - -extern const u8 battery_red_png[]; -extern const u32 battery_red_png_size; - -extern const u8 battery_bar_png[]; -extern const u32 battery_bar_png_size; - -extern const u8 bg_options_png[]; -extern const u32 bg_options_png_size; - -extern const u8 bg_options_entry_png[]; -extern const u32 bg_options_entry_png_size; - -extern const u8 bg_game_selection_png[]; -extern const u32 bg_game_selection_png_size; - -extern const u8 bg_game_selection_entry_png[]; -extern const u32 bg_game_selection_entry_png_size; - -extern const u8 bg_preview_png[]; -extern const u32 bg_preview_png_size; - -extern const u8 scrollbar_png[]; -extern const u32 scrollbar_png_size; - -extern const u8 scrollbar_arrowup_png[]; -extern const u32 scrollbar_arrowup_png_size; - -extern const u8 scrollbar_arrowup_over_png[]; -extern const u32 scrollbar_arrowup_over_png_size; - -extern const u8 scrollbar_arrowdown_png[]; -extern const u32 scrollbar_arrowdown_png_size; - -extern const u8 scrollbar_arrowdown_over_png[]; -extern const u32 scrollbar_arrowdown_over_png_size; - -extern const u8 scrollbar_box_png[]; -extern const u32 scrollbar_box_png_size; - -extern const u8 scrollbar_box_over_png[]; -extern const u32 scrollbar_box_over_png_size; - -extern const u8 keyboard_textbox_png[]; -extern const u32 keyboard_textbox_png_size; - -extern const u8 keyboard_key_png[]; -extern const u32 keyboard_key_png_size; - -extern const u8 keyboard_key_over_png[]; -extern const u32 keyboard_key_over_png_size; - -extern const u8 keyboard_mediumkey_png[]; -extern const u32 keyboard_mediumkey_png_size; - -extern const u8 keyboard_mediumkey_over_png[]; -extern const u32 keyboard_mediumkey_over_png_size; - -extern const u8 keyboard_largekey_png[]; -extern const u32 keyboard_largekey_png_size; - -extern const u8 keyboard_largekey_over_png[]; -extern const u32 keyboard_largekey_over_png_size; - -extern const u8 player1_point_png[]; -extern const u32 player1_point_png_size; - -extern const u8 player2_point_png[]; -extern const u32 player2_point_png_size; - -extern const u8 player3_point_png[]; -extern const u32 player3_point_png_size; - -extern const u8 player4_point_png[]; -extern const u32 player4_point_png_size; - -extern const u8 player1_grab_png[]; -extern const u32 player1_grab_png_size; - -extern const u8 player2_grab_png[]; -extern const u32 player2_grab_png_size; - -extern const u8 player3_grab_png[]; -extern const u32 player3_grab_png_size; - -extern const u8 player4_grab_png[]; -extern const u32 player4_grab_png_size; +#include "logo_png.h" +#include "logo_over_png.h" +#include "bg_top_png.h" +#include "bg_bottom_png.h" +#include "icon_settings_png.h" +#include "icon_home_png.h" +#include "icon_game_settings_png.h" +#include "icon_game_cheats_png.h" +#include "icon_game_controllers_png.h" +#include "icon_game_load_png.h" +#include "icon_game_save_png.h" +#include "icon_game_delete_png.h" +#include "icon_game_reset_png.h" +#include "icon_settings_wiimote_png.h" +#include "icon_settings_classic_png.h" +#include "icon_settings_gamecube_png.h" +#include "icon_settings_nunchuk_png.h" +#include "icon_settings_wiiupro_png.h" +#include "icon_settings_drc_png.h" +#include "icon_settings_nescontroller_png.h" +#include "icon_settings_zapper_png.h" +#include "icon_settings_file_png.h" +#include "icon_settings_mappings_png.h" +#include "icon_settings_menu_png.h" +#include "icon_settings_network_png.h" +#include "icon_settings_video_png.h" +#include "icon_settings_screenshot_png.h" +#include "button_png.h" +#include "button_over_png.h" +#include "button_prompt_png.h" +#include "button_prompt_over_png.h" +#include "button_long_png.h" +#include "button_long_over_png.h" +#include "button_short_png.h" +#include "button_short_over_png.h" +#include "button_small_png.h" +#include "button_small_over_png.h" +#include "button_large_png.h" +#include "button_large_over_png.h" +#include "button_arrow_left_png.h" +#include "button_arrow_right_png.h" +#include "button_arrow_up_png.h" +#include "button_arrow_down_png.h" +#include "button_arrow_left_over_png.h" +#include "button_arrow_right_over_png.h" +#include "button_arrow_up_over_png.h" +#include "button_arrow_down_over_png.h" +#include "button_gamesave_png.h" +#include "button_gamesave_over_png.h" +#include "button_gamesave_blank_png.h" +#include "screen_position_png.h" +#include "dialogue_box_png.h" +#include "credits_box_png.h" +#include "progressbar_png.h" +#include "progressbar_empty_png.h" +#include "progressbar_outline_png.h" +#include "throbber_png.h" +#include "icon_folder_png.h" +#include "icon_sd_png.h" +#include "icon_usb_png.h" +#include "icon_dvd_png.h" +#include "icon_smb_png.h" +#include "battery_png.h" +#include "battery_red_png.h" +#include "battery_bar_png.h" +#include "bg_options_png.h" +#include "bg_options_entry_png.h" +#include "bg_game_selection_png.h" +#include "bg_game_selection_entry_png.h" +#include "bg_preview_png.h" +#include "scrollbar_png.h" +#include "scrollbar_arrowup_png.h" +#include "scrollbar_arrowup_over_png.h" +#include "scrollbar_arrowdown_png.h" +#include "scrollbar_arrowdown_over_png.h" +#include "scrollbar_box_png.h" +#include "scrollbar_box_over_png.h" +#include "keyboard_textbox_png.h" +#include "keyboard_key_png.h" +#include "keyboard_key_over_png.h" +#include "keyboard_mediumkey_png.h" +#include "keyboard_mediumkey_over_png.h" +#include "keyboard_largekey_png.h" +#include "keyboard_largekey_over_png.h" +#include "player1_point_png.h" +#include "player2_point_png.h" +#include "player3_point_png.h" +#include "player4_point_png.h" +#include "player1_grab_png.h" +#include "player2_grab_png.h" +#include "player3_grab_png.h" +#include "player4_grab_png.h" #endif diff --git a/source/menu.cpp b/source/menu.cpp index cff8647..f8a7fba 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -1864,17 +1864,17 @@ static int MenuGameSaves(int action) case FILE_RAM: strncpy(deletepath, filepath, 1024); deletepath[strlen(deletepath)-4] = 0; - sprintf(deletepath, "%s.sav", deletepath); + strcat(deletepath, ".sav"); remove(deletepath); // Delete the *.sav file (Battery save file) break; case FILE_STATE: strncpy(deletepath, filepath, 1024); deletepath[strlen(deletepath)-4] = 0; - sprintf(deletepath, "%s.png", deletepath); + strcat(deletepath, ".png"); remove(deletepath); // Delete the *.png file (Screenshot file) strncpy(deletepath, filepath, 1024); deletepath[strlen(deletepath)-4] = 0; - sprintf(deletepath, "%s.fcs", deletepath); + strcat(deletepath, ".fcs"); remove(deletepath); // Delete the *.fcs file (Save State file) break; }