diff --git a/3.0.5a/template1/Makefile b/3.0.5a/0_Minimum/Makefile similarity index 100% rename from 3.0.5a/template1/Makefile rename to 3.0.5a/0_Minimum/Makefile diff --git a/3.0.5a/0_Minimum/sources/main.c b/3.0.5a/0_Minimum/sources/main.c new file mode 100644 index 0000000..4fa172b --- /dev/null +++ b/3.0.5a/0_Minimum/sources/main.c @@ -0,0 +1,36 @@ +/*=========================================== + GRRLIB (GX version) 3.0.5 alpha + Code : NoNameNo + Additional Code : Crayon + GX hints : RedShade + + Minimum Code To Use GRRLIB +============================================*/ +#include "../../GRRLIB/GRRLIB/GRRLIB.h" + + +#include +#include + + +Mtx GXmodelView2D; + + +int main() { + u32 wpaddown; + + GRRLIB_Init(); + WPAD_Init(); + + while(1) { + WPAD_ScanPads(); + wpaddown = WPAD_ButtonsDown(0); + + GRRLIB_Render(); + if(wpaddown & WPAD_BUTTON_HOME) { + exit(0); + } + } + GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB + return 0; +} diff --git a/3.0.5a/1_Template/Makefile b/3.0.5a/1_Template/Makefile new file mode 100644 index 0000000..4d128dc --- /dev/null +++ b/3.0.5a/1_Template/Makefile @@ -0,0 +1,139 @@ +#--------------------------------------------------------------------------------- +# Clear the implicit built in rules +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- +ifeq ($(strip $(DEVKITPPC)),) +$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC) +endif + +include $(DEVKITPPC)/wii_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# INCLUDES is a list of directories containing extra header files +#--------------------------------------------------------------------------------- +TARGET := $(notdir $(CURDIR)) +BUILD := build +SOURCES := sources sources/gfx ../GRRLIB/GRRLIB ../GRRLIB/lib/libpng ../GRRLIB/lib/libpng/pngu +DATA := data +INCLUDES := + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- + +CFLAGS = -g -O2 -mrvl -Wall $(MACHDEP) $(INCLUDE) +CXXFLAGS = $(CFLAGS) + +LDFLAGS = -g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map + +#--------------------------------------------------------------------------------- +# any extra libraries we wish to link with the project +#--------------------------------------------------------------------------------- +LIBS := -lpng -ljpeg -lz -lfat -lwiiuse -lbte -logc -lm + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(CURDIR)/../GRRLIB + +#--------------------------------------------------------------------------------- +# no real need to edit anything past this point unless you need to add additional +# rules for different file extensions +#--------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/$(TARGET) + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +#--------------------------------------------------------------------------------- +# automatically build a list of object files for our project +#--------------------------------------------------------------------------------- +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))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) + export LD := $(CC) +else + export LD := $(CXX) +endif + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ + $(sFILES:.s=.o) $(SFILES:.S=.o) + +#--------------------------------------------------------------------------------- +# build a list of include paths +#--------------------------------------------------------------------------------- +export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) \ + -I$(LIBOGC_INC) + +#--------------------------------------------------------------------------------- +# build a list of library paths +#--------------------------------------------------------------------------------- +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ + -L$(LIBOGC_LIB) + +export OUTPUT := $(CURDIR)/$(TARGET) +.PHONY: $(BUILD) clean + +#--------------------------------------------------------------------------------- +$(BUILD): + @[ -d $@ ] || mkdir -p $@ + @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol + +#--------------------------------------------------------------------------------- +run: + psoload $(TARGET).dol + +#--------------------------------------------------------------------------------- +reload: + psoload -r $(TARGET).dol + + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +$(OUTPUT).dol: $(OUTPUT).elf +$(OUTPUT).elf: $(OFILES) + +#--------------------------------------------------------------------------------- +# This rule links in binary data with the .jpg extension +#--------------------------------------------------------------------------------- +%.jpg.o : %.jpg +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + $(bin2o) + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- diff --git a/3.0.5a/template1/sources/gfx/BMfont1.c b/3.0.5a/1_Template/sources/gfx/BMfont1.c similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont1.c rename to 3.0.5a/1_Template/sources/gfx/BMfont1.c diff --git a/3.0.5a/template1/sources/gfx/BMfont1.h b/3.0.5a/1_Template/sources/gfx/BMfont1.h similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont1.h rename to 3.0.5a/1_Template/sources/gfx/BMfont1.h diff --git a/3.0.5a/template1/sources/gfx/BMfont1.png b/3.0.5a/1_Template/sources/gfx/BMfont1.png similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont1.png rename to 3.0.5a/1_Template/sources/gfx/BMfont1.png diff --git a/3.0.5a/template1/sources/gfx/BMfont2.c b/3.0.5a/1_Template/sources/gfx/BMfont2.c similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont2.c rename to 3.0.5a/1_Template/sources/gfx/BMfont2.c diff --git a/3.0.5a/template1/sources/gfx/BMfont2.h b/3.0.5a/1_Template/sources/gfx/BMfont2.h similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont2.h rename to 3.0.5a/1_Template/sources/gfx/BMfont2.h diff --git a/3.0.5a/template1/sources/gfx/BMfont2.png b/3.0.5a/1_Template/sources/gfx/BMfont2.png similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont2.png rename to 3.0.5a/1_Template/sources/gfx/BMfont2.png diff --git a/3.0.5a/template1/sources/gfx/BMfont3.c b/3.0.5a/1_Template/sources/gfx/BMfont3.c similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont3.c rename to 3.0.5a/1_Template/sources/gfx/BMfont3.c diff --git a/3.0.5a/template1/sources/gfx/BMfont3.h b/3.0.5a/1_Template/sources/gfx/BMfont3.h similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont3.h rename to 3.0.5a/1_Template/sources/gfx/BMfont3.h diff --git a/3.0.5a/template1/sources/gfx/BMfont3.png b/3.0.5a/1_Template/sources/gfx/BMfont3.png similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont3.png rename to 3.0.5a/1_Template/sources/gfx/BMfont3.png diff --git a/3.0.5a/template1/sources/gfx/BMfont4.c b/3.0.5a/1_Template/sources/gfx/BMfont4.c similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont4.c rename to 3.0.5a/1_Template/sources/gfx/BMfont4.c diff --git a/3.0.5a/template1/sources/gfx/BMfont4.h b/3.0.5a/1_Template/sources/gfx/BMfont4.h similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont4.h rename to 3.0.5a/1_Template/sources/gfx/BMfont4.h diff --git a/3.0.5a/template1/sources/gfx/BMfont4.png b/3.0.5a/1_Template/sources/gfx/BMfont4.png similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont4.png rename to 3.0.5a/1_Template/sources/gfx/BMfont4.png diff --git a/3.0.5a/template1/sources/gfx/BMfont5.h b/3.0.5a/1_Template/sources/gfx/BMfont5.h similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont5.h rename to 3.0.5a/1_Template/sources/gfx/BMfont5.h diff --git a/3.0.5a/template1/sources/gfx/BMfont5.png b/3.0.5a/1_Template/sources/gfx/BMfont5.png similarity index 100% rename from 3.0.5a/template1/sources/gfx/BMfont5.png rename to 3.0.5a/1_Template/sources/gfx/BMfont5.png diff --git a/3.0.5a/template1/sources/gfx/sprite.h b/3.0.5a/1_Template/sources/gfx/sprite.h similarity index 100% rename from 3.0.5a/template1/sources/gfx/sprite.h rename to 3.0.5a/1_Template/sources/gfx/sprite.h diff --git a/3.0.5a/template1/sources/gfx/sprite.png b/3.0.5a/1_Template/sources/gfx/sprite.png similarity index 100% rename from 3.0.5a/template1/sources/gfx/sprite.png rename to 3.0.5a/1_Template/sources/gfx/sprite.png diff --git a/3.0.5a/template1/sources/gfx/test_jpg.c b/3.0.5a/1_Template/sources/gfx/test_jpg.c similarity index 100% rename from 3.0.5a/template1/sources/gfx/test_jpg.c rename to 3.0.5a/1_Template/sources/gfx/test_jpg.c diff --git a/3.0.5a/template1/sources/gfx/test_jpg.h b/3.0.5a/1_Template/sources/gfx/test_jpg.h similarity index 100% rename from 3.0.5a/template1/sources/gfx/test_jpg.h rename to 3.0.5a/1_Template/sources/gfx/test_jpg.h diff --git a/3.0.5a/template1/sources/gfx/test_jpg.jpg b/3.0.5a/1_Template/sources/gfx/test_jpg.jpg similarity index 100% rename from 3.0.5a/template1/sources/gfx/test_jpg.jpg rename to 3.0.5a/1_Template/sources/gfx/test_jpg.jpg diff --git a/3.0.5a/template1/sources/main.c b/3.0.5a/1_Template/sources/main.c similarity index 96% rename from 3.0.5a/template1/sources/main.c rename to 3.0.5a/1_Template/sources/main.c index 7c9a607..f7d5dba 100644 --- a/3.0.5a/template1/sources/main.c +++ b/3.0.5a/1_Template/sources/main.c @@ -4,7 +4,7 @@ Additional Code : Crayon GX hints : RedShade - Template Code (Minimum Requirement) + Template Code 1 ============================================*/ #include "../../GRRLIB/GRRLIB/GRRLIB.h"