mirror of
https://github.com/suloku/gcmm.git
synced 2026-04-24 14:59:43 -05:00
Merge pull request #38 from carstene1ns/bugfix/building
Fix building issues
This commit is contained in:
commit
e93e57cb42
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
/build_WII/
|
||||
/build_GC/
|
||||
|
||||
/release/
|
||||
|
||||
*.elf
|
||||
*.dol
|
||||
4
Makefile
4
Makefile
|
|
@ -5,14 +5,12 @@ all: wii gc
|
|||
clean: gc-clean wii-clean
|
||||
|
||||
wii:
|
||||
cp source/gcmm-bk.wii source/gcmm-bk.s
|
||||
$(MAKE) -f Makefile.wii
|
||||
|
||||
wii-clean:
|
||||
$(MAKE) -f Makefile.wii clean
|
||||
|
||||
gc:
|
||||
cp source/gcmm-bk.gc source/gcmm-bk.s
|
||||
$(MAKE) -f Makefile.gc
|
||||
|
||||
gc-clean:
|
||||
|
|
@ -24,4 +22,4 @@ runwii:
|
|||
rungc:
|
||||
$(MAKE) -f Makefile.gc run
|
||||
|
||||
run: runwii
|
||||
run: runwii
|
||||
|
|
|
|||
38
Makefile.gc
38
Makefile.gc
|
|
@ -4,7 +4,7 @@
|
|||
.SUFFIXES:
|
||||
#---------------------------------------------------------------------------------
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC)
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
||||
endif
|
||||
|
||||
include $(DEVKITPPC)/gamecube_rules
|
||||
|
|
@ -17,11 +17,10 @@ DKV := $(shell $(DEVKITPPC)/bin/$(CC) --version | sed 's/^.*(devkitPPC release
|
|||
# SOURCES is a list of directories containing source code
|
||||
# INCLUDES is a list of directories containing extra header files
|
||||
#---------------------------------------------------------------------------------
|
||||
#TARGET := $(notdir $(CURDIR))
|
||||
TARGET := gcmm_GC
|
||||
BUILD := build_GC
|
||||
SOURCES := source
|
||||
DATA := data
|
||||
DATA := data data-gc
|
||||
INCLUDES :=
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
|
@ -36,7 +35,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
|
|||
#---------------------------------------------------------------------------------
|
||||
# any extra libraries we wish to link with the project
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBS := -lfat -logc -lm -lfreetype -lz
|
||||
LIBS := -lfat -logc `freetype-config --libs` -lz -lm
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# list of directories containing libraries, this must be the top level containing
|
||||
|
|
@ -76,24 +75,25 @@ else
|
|||
export LD := $(CXX)
|
||||
endif
|
||||
|
||||
export OFILES := $(addsuffix .o,$(BINFILES)) \
|
||||
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
||||
$(sFILES:.s=.o) $(SFILES:.S=.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) \
|
||||
-I$(PORTLIBS)/include/freetype2
|
||||
`freetype-config --cflags`
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# 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)/$(TARGET)
|
||||
.PHONY: $(BUILD) clean
|
||||
|
|
@ -101,12 +101,12 @@ export OUTPUT := $(CURDIR)/$(TARGET)
|
|||
#---------------------------------------------------------------------------------
|
||||
$(BUILD):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.gc
|
||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.gc
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol $(SOURCES)/gcmm-bk.s
|
||||
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
run:
|
||||
|
|
@ -128,14 +128,20 @@ DEPENDS := $(OFILES:.o=.d)
|
|||
$(OUTPUT).dol: $(OUTPUT).elf
|
||||
$(OUTPUT).elf: $(OFILES)
|
||||
|
||||
$(OFILES_SOURCES) : $(HFILES)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# This rule links in binary data with the .jpg extension
|
||||
#---------------------------------------------------------------------------------
|
||||
%.jpg.o : %.jpg
|
||||
# These rules link in binary data with the .bmp and .ttf extensions
|
||||
#---------------------------------------------------------------------------------
|
||||
%.ttf.o %_ttf.h : %.ttf
|
||||
@echo $(notdir $<)
|
||||
$(bin2o)
|
||||
|
||||
%.bmp.o %_bmp.h : %.bmp
|
||||
@echo $(notdir $<)
|
||||
$(bin2o)
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
-include $(DEPENDS)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
|
|
|||
39
Makefile.wii
39
Makefile.wii
|
|
@ -4,7 +4,7 @@
|
|||
.SUFFIXES:
|
||||
#---------------------------------------------------------------------------------
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC)
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
||||
endif
|
||||
|
||||
include $(DEVKITPPC)/wii_rules
|
||||
|
|
@ -17,11 +17,10 @@ DKV := $(shell $(DEVKITPPC)/bin/$(CC) --version | sed 's/^.*(devkitPPC release
|
|||
# SOURCES is a list of directories containing source code
|
||||
# INCLUDES is a list of directories containing extra header files
|
||||
#---------------------------------------------------------------------------------
|
||||
#TARGET := $(notdir $(CURDIR))
|
||||
TARGET := gcmm_WII
|
||||
BUILD := build_WII
|
||||
SOURCES := source
|
||||
DATA := data
|
||||
DATA := data data-wii
|
||||
INCLUDES :=
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
|
@ -36,7 +35,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
|
|||
#---------------------------------------------------------------------------------
|
||||
# any extra libraries we wish to link with the project
|
||||
#---------------------------------------------------------------------------------
|
||||
LIBS := -lwiiuse -lbte -lfat -logc -lm -lfreetype -lz
|
||||
LIBS := -lwiiuse -lbte -lfat -logc `freetype-config --libs` -lz -lm
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# list of directories containing libraries, this must be the top level containing
|
||||
|
|
@ -76,24 +75,25 @@ else
|
|||
export LD := $(CXX)
|
||||
endif
|
||||
|
||||
export OFILES := $(addsuffix .o,$(BINFILES)) \
|
||||
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
||||
$(sFILES:.s=.o) $(SFILES:.S=.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) \
|
||||
-I$(PORTLIBS)/include/freetype2
|
||||
`freetype-config --cflags`
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# 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)/$(TARGET)
|
||||
.PHONY: $(BUILD) clean
|
||||
|
|
@ -101,17 +101,18 @@ export OUTPUT := $(CURDIR)/$(TARGET)
|
|||
#---------------------------------------------------------------------------------
|
||||
$(BUILD):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.wii
|
||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.wii
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol $(SOURCES)/gcmm-bk.s
|
||||
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
run:
|
||||
wiiload $(TARGET).dol
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
else
|
||||
|
||||
|
|
@ -123,14 +124,20 @@ DEPENDS := $(OFILES:.o=.d)
|
|||
$(OUTPUT).dol: $(OUTPUT).elf
|
||||
$(OUTPUT).elf: $(OFILES)
|
||||
|
||||
$(OFILES_SOURCES) : $(HFILES)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# This rule links in binary data with the .jpg extension
|
||||
#---------------------------------------------------------------------------------
|
||||
%.jpg.o : %.jpg
|
||||
# These rules link in binary data with the .bmp and .ttf extensions
|
||||
#---------------------------------------------------------------------------------
|
||||
%.ttf.o %_ttf.h : %.ttf
|
||||
@echo $(notdir $<)
|
||||
$(bin2o)
|
||||
|
||||
%.bmp.o %_bmp.h : %.bmp
|
||||
@echo $(notdir $<)
|
||||
$(bin2o)
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
-include $(DEPENDS)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 844 KiB After Width: | Height: | Size: 844 KiB |
|
Before Width: | Height: | Size: 844 KiB After Width: | Height: | Size: 844 KiB |
|
|
@ -17,7 +17,9 @@
|
|||
#include "bitmap.h"
|
||||
#include "freetype.h"
|
||||
#include "gci.h"
|
||||
|
||||
|
||||
#include "background_bmp.h"
|
||||
|
||||
extern GCI gci;
|
||||
//*extern GXRModeObj *vmode; /*** Graphics Mode Object ***/
|
||||
//extern u32 *xfb[2] = { NULL, NULL }; /*** Framebuffers ***/
|
||||
|
|
@ -287,5 +289,5 @@ void ShowIcon(u8 *icon) {
|
|||
}
|
||||
|
||||
void ClearScreen() {
|
||||
ShowBMP(bitmapfile);
|
||||
ShowBMP((u8*) background_bmp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
extern GXRModeObj *vmode; /*** Graphics Mode Object ***/
|
||||
extern u32 *xfb[2]; /*** Framebuffers ***/
|
||||
extern int whichfb; /*** Frame buffer toggle ***/
|
||||
extern u8 bitmapfile[];
|
||||
u32 CvtRGB(u8 r1, u8 g1, u8 b1, u8 r2, u8 g2, u8 b2);
|
||||
u32 ShowBMP (u8 *bmpfile);
|
||||
void ShowBanner ();
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
# Fonts
|
||||
|
||||
.rodata
|
||||
.globl fontface
|
||||
.balign 32
|
||||
fontface:
|
||||
.incbin "../source/ttf/font.ttf"
|
||||
|
||||
|
||||
.globl fontsize
|
||||
fontsize: .long 50824
|
||||
|
||||
|
|
@ -25,6 +25,9 @@
|
|||
#include <wiiuse/wpad.h>
|
||||
#endif
|
||||
|
||||
/*** The actual TrueType Font ***/
|
||||
#include "font_ttf.h"
|
||||
|
||||
#define MCDATAOFFSET 64
|
||||
#define FONT_SIZE 16 //pixels
|
||||
|
||||
|
|
@ -60,10 +63,6 @@ extern u8 imageserial[12];
|
|||
|
||||
static int fonthi, fontlo;
|
||||
|
||||
/*** The actual TrueType Font ***/
|
||||
extern char fontface[]; /*** From fontface.s ***/
|
||||
extern int fontsize; /*** From fontface.s ***/
|
||||
|
||||
/*** From video subsystem ***/
|
||||
extern int screenheight;
|
||||
extern u32 *xfb[2];
|
||||
|
|
@ -130,7 +129,7 @@ int FT_Init ()
|
|||
return 1;
|
||||
|
||||
err =
|
||||
FT_New_Memory_Face (ftlibrary, (FT_Byte *) fontface, fontsize, 0, &face);
|
||||
FT_New_Memory_Face (ftlibrary, (FT_Byte *) font_ttf, font_ttf_size, 0, &face);
|
||||
if (err)
|
||||
return 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
.rodata
|
||||
.globl bitmapfile
|
||||
.balign 32
|
||||
bitmapfile:
|
||||
.incbin "../source/gcbk.bmp"
|
||||
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
.rodata
|
||||
.globl bitmapfile
|
||||
.balign 32
|
||||
bitmapfile:
|
||||
.incbin "../source/wiibk.bmp"
|
||||
|
||||
|
|
@ -959,7 +959,7 @@ s32 FZEROGX_MakeSaveGameValid(s32 chn)
|
|||
u32 serial1,serial2;
|
||||
u16 chksum = 0xFFFF;
|
||||
|
||||
if(stricmp(&FileBuffer[0x08],"f_zero.dat")!=0) return CARD_ERROR_READY; // check for F-Zero GX system file
|
||||
if(strcasecmp(&FileBuffer[0x08],"f_zero.dat")!=0) return CARD_ERROR_READY; // check for F-Zero GX system file
|
||||
if((ret=CARD_GetSerialNo(chn,&serial1,&serial2))<0) return ret; // get encrypted destination memory card serial numbers
|
||||
|
||||
*(u16*)&FileBuffer[0x2066+MCDATAOFFSET] = serial1 >> 16; // set new serial numbers
|
||||
|
|
@ -998,12 +998,12 @@ s32 PSO_MakeSaveGameValid(s32 chn)
|
|||
u32 serial1,serial2;
|
||||
u32 pso3offset;
|
||||
|
||||
if(stricmp(&FileBuffer[0x08],"PSO_SYSTEM")==0) { // check for PSO1&2 system file
|
||||
if(strcasecmp(&FileBuffer[0x08],"PSO_SYSTEM")==0) { // check for PSO1&2 system file
|
||||
pso3offset = 0x00;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(stricmp(&FileBuffer[0x08],"PSO3_SYSTEM")==0) { // check for PSO3 system file
|
||||
if(strcasecmp(&FileBuffer[0x08],"PSO3_SYSTEM")==0) { // check for PSO3 system file
|
||||
pso3offset = 0x10; // PSO3 data block size adjustment
|
||||
goto exit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user