diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8a6605f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build/ +*.dol +*.elf diff --git a/Makefile b/Makefile index 1d192f2..765788b 100644 --- a/Makefile +++ b/Makefile @@ -57,12 +57,10 @@ 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,$(SOURCES),$(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 #--------------------------------------------------------------------------------- @@ -72,11 +70,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 @@ -124,26 +123,27 @@ DEPENDS := $(OFILES:.o=.d) $(OUTPUT).dol: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) +$(OFILES_SOURCES): $(HFILES) #--------------------------------------------------------------------------------- # This rule links in binary data with .ttf, .png, and .mp3 extensions #--------------------------------------------------------------------------------- -%.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 8a838b9..7150f95 100644 --- a/source/filelist.h +++ b/source/filelist.h @@ -12,118 +12,48 @@ #include // Fonts -extern const u8 font_ttf[]; -extern const u32 font_ttf_size; +#include "font_ttf.h" // Languages -extern const u8 en_lang[]; -extern const u32 en_lang_size; +#include "en_lang.h" // Sounds -extern const u8 bg_music_ogg[]; -extern const u32 bg_music_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; +#include "bg_music_ogg.h" +#include "button_over_pcm.h" +#include "button_click_pcm.h" // Images -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_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 dialogue_box_png[]; -extern const u32 dialogue_box_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 folder_png[]; -extern const u32 folder_png_size; - -extern const u8 bg_file_selection_png[]; -extern const u32 bg_file_selection_png_size; - -extern const u8 bg_file_selection_entry_png[]; -extern const u32 bg_file_selection_entry_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 "button_png.h" +#include "button_over_png.h" +#include "button_large_png.h" +#include "button_large_over_png.h" +#include "dialogue_box_png.h" +#include "bg_options_png.h" +#include "bg_options_entry_png.h" +#include "folder_png.h" +#include "bg_file_selection_png.h" +#include "bg_file_selection_entry_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