diff --git a/Makefile.wii b/Makefile.wii new file mode 100644 index 0000000..305a8b3 --- /dev/null +++ b/Makefile.wii @@ -0,0 +1,103 @@ +#--------------------------------------------------------------------------------- +# 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 + +# Directories. +OBJ_DIR := obj +LIB_DIR := lib +BIN_DIR := . +SRC_DIR := src +INCLUDE_DIR := include + +# Tools. +PIPE_TO_SED := 2>&1 | sed "s/:\([0-9]*\):/\(\1\) :/" + +# Source files. +SRCS := $(wildcard $(SRC_DIR)/*.c $(SRC_DIR)/gfx-sdl/*.c (SRC_DIR)/jd-sdl/*.c (SRC_DIR)/sd-sdl/*.c (SRC_DIR)/td-none/*.c (SRC_DIR)/gui-none/*.c) + +# Library object files. +OBJS := $(subst $(SRC_DIR),$(OBJ_DIR),$(SRCS:.c=.o)) + +# Test source files. +# It can be useful to switch this variable around to select individual tests which are problematic. +TEST_SRCS := $(TEST_SRC_DIR)/showfont.c + +# What's a full build? +all: uae.elf + +# How to delete the intermediate files. +clean: + @echo Cleaning $(OBJ_DIR) + @rm -f $(OBJS) + +$(OBJ_DIR): + install -d $@ + +src/sysconfig.h: src/sysconfig.h.wii + cp $< $@ + +src/machdep: + cd src && ln -s md-generic machdep + +src/gfxdep: + cd src && ln -s gfx-sdl gfxdep + +src/osdep: + cd src && ln -s od-generic osdep + +src/guidep: + cd src && ln -s gui-none guidep + +src/joydep: + cd src && ln -s jd-sdl joydep + +src/threaddep: + cd src && ln -s td-sdl threaddep + +src/target.h: + cd src && ln -s targets/t-unix.h target.h + +# How to build a library. +$(LIB_DIR)/libSDL_ttf.a: $(OBJS) + @echo Archiving $@ + @-mkdir -p $(dir $@) + @powerpc-gekko-ar crs $@ $(OBJS) + @echo ---- + +# How to build a DOL. +$(BIN_DIR)/%.dol: %.elf + @echo Creating DOL $@ + @-mkdir -p $(dir $@) + #powerpc-gekko-objcopy -O binary $< $@ + elf2dol $< $@ + @echo ---- + +# Compilation flags. +COMMON_FLAGS := -g -O2 -mrvl -Wall $(MACHDEP) +INCLUDES := -Isrc/md-generic/ -Isrc/include -Isrc -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libogc/include/SDL +DEFINES := -DGEKKO -DDEBUG_ERROR -DDEBUG_TIMERS -DDEBUG_THREADS -DDEBUG_BUILD -DDEBUG_CONVERT +CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES) + +# Test link flags. +LDFLAGS := $(COMMON_FLAGS) -L$(LIB_DIR) -L$(DEVKITPRO)/libogc/lib/wii -lSDL_ttf -lSDL -lfreetype -lfat -lwiiuse -lbte -logc -lm + +# How to link an ELF. +uae.elf: src/target.h src/machdep src/osdep src/guidep src/threaddep src/joydep src/gfxdep src/osdep src/sysconfig.h $(OBJS) + @echo Linking $@ + @-mkdir -p $(dir $@) + powerpc-gekko-g++ -o $@ $< $(OBJS) $(LDFLAGS) + #keep elf for debugging + #cp $@ /tmp/elf + +# How to compile C file (SDL library). +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c + @echo Compiling $< + @-mkdir -p $(dir $@) + @powerpc-gekko-gcc $(CFLAGS) -c $< -o $@ $(PIPE_TO_SED) diff --git a/src/sysconfig.h.wii b/src/sysconfig.h.wii new file mode 100644 index 0000000..7bcf480 --- /dev/null +++ b/src/sysconfig.h.wii @@ -0,0 +1,416 @@ +/* src/sysconfig.h. Generated from sysconfig.h.in by configure. */ +/* src/sysconfig.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the `alarm' function. */ +#define HAVE_ALARM 1 + +/* Define to 1 if you have the 'bswap_16' function. */ +#define HAVE_BSWAP_16 1 + +/* Define to 1 if you have the 'bswap_32' function. */ +#define HAVE_BSWAP_32 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_BYTESWAP_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CAPS_CAPSIMAGE_H */ + +/* Define to 1 if you have the `cfmakeraw' function. */ +#define HAVE_CFMAKERAW 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CURSES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CYBERGRAPHX_CYBERGRAPHICS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DEVICES_AHI_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* "Define to 1 if you have 'dlopen' function */ +#define HAVE_DLOPEN 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DUSTAT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getopt' function. */ +#define HAVE_GETOPT 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if exists, doesn't clash with , and + declares uintmax_t. */ +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 + +/* Define to 1 if you have the `isinf' function. */ +#define HAVE_ISINF 1 + +/* Define to 1 if you have the `isnan' function. */ +#define HAVE_ISNAN 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBRARIES_CYBERGRAPHICS_H */ + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if you have the `localtime_r' function. */ +#define HAVE_LOCALTIME_R 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_JOYSTICK_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkdir' function. */ +#define HAVE_MKDIR 1 + +/* Define to 1 if you have the `nanosleep' function. */ +#define HAVE_NANOSLEEP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NCURSES_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define if you have POSIX threads libraries and header files. */ +/* #undef HAVE_PTHREAD */ + +/* Define to 1 if you have the `readdir_r' function. */ +#define HAVE_READDIR_R 1 + +/* Define to 1 if you have the `rmdir' function. */ +#define HAVE_RMDIR 1 + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `setitimer' function. */ +#define HAVE_SETITIMER 1 + +/* Define to 1 if you have the `sigaction' function. */ +#define HAVE_SIGACTION 1 + +/* Define to 1 if you have the `sleep' function. */ +#define HAVE_SLEEP 1 + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define if exists, doesn't clash with , and declares + uintmax_t. */ +#define HAVE_STDINT_H_WITH_UINTMAX 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strcmpi' function. */ +/* #undef HAVE_STRCMPI */ + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the `stricmp' function. */ +/* #undef HAVE_STRICMP */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_STRINGS_H 1*/ +#undef HAVE_STRINGS_H + + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strstr' function. */ +#define HAVE_STRSTR 1 + +/* Define to 1 if `st_blocks' is member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 + +/* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use + `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ +#define HAVE_ST_BLOCKS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the `sync' function. */ +#define HAVE_SYNC 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_FILIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_FILSYS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_FS_S5PARAM_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_FS_TYPES_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IPC_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MOUNT_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SHM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STATFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STATVFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TERMIOS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_VFS_H 1 + +/* Define to 1 if you have the `tcgetattr' function. */ +#define HAVE_TCGETATTR 1 + +/* Define to 1 if you have the `timegm' function. */ +#define HAVE_TIMEGM 1 + +/* Define if you have the 'uintmax_t' type in or . */ +#define HAVE_UINTMAX_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if you have the 'unsigned long long' type. */ +#define HAVE_UNSIGNED_LONG_LONG 1 + +/* Define to 1 if you have the `usleep' function. */ +#define HAVE_USLEEP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UTIME_H 1 + +/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ +#define HAVE_UTIME_NULL 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_VALUES_H 1 */ +#undef HAVE_VALUES_H + +/* Define to 1 if you have the `vfprintf' function. */ +#define HAVE_VFPRINTF 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the `vsprintf' function. */ +#define HAVE_VSPRINTF 1 + +/* Define to 1 if the system has the type `_Bool'. */ +#define HAVE__BOOL 1 + +/* Define to 1 if your CPU profitably supports multiplication. */ +#define MULTIPLICATION_PROFITABLE 1 + +/* Name of package */ +#define PACKAGE "e-uae" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "E-UAE" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "E-UAE 0.8.29-WIP4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "e-uae" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.8.29-WIP4" + +/* Define to the necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* The size of `char', as computed by sizeof. */ +#define SIZEOF_CHAR 1 + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 4 + +/* The size of `__int64', as computed by sizeof. */ +#define SIZEOF___INT64 0 + +/* Define if the block counts reported by statfs may be truncated to 2GB and + the correct values may be stored in the f_spare array. (SunOS 4.1.2, 4.1.3, + and 4.1.3_U1 are reported to have this problem. SunOS 4.1.1 seems not to be + affected.) */ +/* #undef STATFS_TRUNCATES_BLOCK_COUNTS */ + +/* Define if there is no specific function for reading filesystems usage + information and you have the header file. (SVR2) */ +/* #undef STAT_READ_FILSYS */ + +/* Define if statfs takes 2 args and struct statfs has a field named f_bsize. + (4.3BSD, SunOS 4, HP-UX, AIX PS/2) */ +#define STAT_STATFS2_BSIZE 1 + +/* Define if statfs takes 2 args and struct statfs has a field named f_fsize. + (4.4BSD, NetBSD) */ +/* #undef STAT_STATFS2_FSIZE */ + +/* Define if statfs takes 2 args and the second argument has type struct + fs_data. (Ultrix) */ +/* #undef STAT_STATFS2_FS_DATA */ + +/* Define if statfs takes 3 args. (DEC Alpha running OSF/1) */ +/* #undef STAT_STATFS3_OSF1 */ + +/* Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin) */ +/* #undef STAT_STATFS4 */ + +/* Define if there is a function named statvfs. (SVR4) */ +/* #undef STAT_STATVFS */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Version number of package */ +#define VERSION "0.8.29-WIP4" + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#define WORDS_BIGENDIAN 1 + +/* Define to 1 if the X Window System is missing or not being used. */ +/* #undef X_DISPLAY_MISSING */ + +/* Define to 1 if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +/* # undef _ALL_SOURCE */ +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#define _FILE_OFFSET_BITS 64 + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `int' if does not define. */ +/* #undef mode_t */ + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Substitute for socklen_t */ +/* #undef socklen_t */ + +/* Define to unsigned long or unsigned long long if and + don't define. */ +/* #undef uintmax_t */ + +/* Define to empty if the keyword `volatile' does not work. Warning: valid + code using `volatile' can become incorrect without. Disable with care. */ +/* #undef volatile */