From 1f00b1847ff4dcd0278f990aed29915850a90487 Mon Sep 17 00:00:00 2001 From: Not6 Date: Sun, 30 Jul 2017 14:56:36 +0200 Subject: [PATCH] basic wiiu rules --- .gitignore | 5 +++++ Makefile | 16 +++++++++++++++- atari800/src/atari.c | 5 +++++ atari800/src/cfg.c | 5 +++++ atari800/src/ui_basic.c | 11 +++++++++++ atari800/src/util.c | 4 ++++ libretro/config.h | 6 +++++- 7 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc67d46 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.so +*.o +*.dll +*.bc +*.a diff --git a/Makefile b/Makefile index 2e2e61a..0d73bcd 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,21 @@ else ifeq ($(platform), ngc) PLATFORM_DEFINES += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float STATIC_LINKING = 1 HAVE_COMPAT = 1 - +# Nintendo Game Cube / Wii / WiiU +else ifneq (,$(filter $(platform), wiiu)) + TARGET := $(TARGET_NAME)_libretro_$(platform).a + CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) + CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT) + AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) + CFLAGS += -DDEFAULT_CFG_NAME="\"sd:\\retroarch\\cores\\system\\atari800.cfg\"" + PLATFORM_DEFINES += -I$(DEVKITPRO)/portlibs/ppc/include + PLATFORM_DEFINES += -DSDL_BYTEORDER=SDL_BIG_ENDIAN -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN -DBYTE_ORDER=BIG_ENDIAN + PLATFORM_DEFINES += -DGEKKO -mcpu=750 -meabi -mhard-float -DHAVE_STRTOF_L -DHAVE_LOCALE + PLATFORM_DEFINES += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int -D_GNU_SOURCE + STATIC_LINKING = 1 + PLATFORM_DEFINES += -DWIIU -DHW_RVL -mwup -DWORDS_BIGENDIAN=1 -Dpowerpc -DMSB_FIRST -D__POWERPC__ -D__ppc__ + PLATFORM_DEFINES += -DGEKKO -DWIIU -DHW_RVL -mwup -mcpu=750 -meabi -mhard-float -D__POWERPC__ -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1 + HAVE_COMPAT = 1 # Nintendo Wii else ifeq ($(platform), wii) TARGET := $(TARGET_NAME)_libretro_wii.a diff --git a/atari800/src/atari.c b/atari800/src/atari.c index 7dbb9d9..3b2f08c 100644 --- a/atari800/src/atari.c +++ b/atari800/src/atari.c @@ -445,6 +445,11 @@ int Atari800_Initialise(int *argc, char *argv[]) #if defined(unix) || defined(__unix__) || defined(__linux__) SYSROM_FindInDir("/usr/share/atari800", TRUE); #endif + +#if defined(WIIU) && defined(__LIBRETRO__) +SYSROM_FindInDir("sd:/retroarch/cores/system/atari800", TRUE); +#endif + if (*argc > 0 && argv[0] != NULL) { char atari800_exe_dir[FILENAME_MAX]; char atari800_exe_rom_dir[FILENAME_MAX]; diff --git a/atari800/src/cfg.c b/atari800/src/cfg.c index bb07376..224c8ff 100644 --- a/atari800/src/cfg.c +++ b/atari800/src/cfg.c @@ -75,6 +75,11 @@ int CFG_save_on_exit = FALSE; #define SYSTEM_WIDE_CFG_FILE "/etc/atari800.cfg" #endif +#ifdef WIIU +#define DEFAULT_CFG_NAME "sd:/retroarch/cores/system/atari800.cfg" +#define SYSTEM_WIDE_CFG_FILE "sd:/retroarch/cores/system/atari800.cfg" +#endif + static char rtconfig_filename[FILENAME_MAX]; int CFG_LoadConfig(const char *alternate_config_filename) diff --git a/atari800/src/ui_basic.c b/atari800/src/ui_basic.c index 7d38775..708e648 100644 --- a/atari800/src/ui_basic.c +++ b/atari800/src/ui_basic.c @@ -935,6 +935,11 @@ static void GetDirectory(const char *directory) #ifdef PS2 FilenamesAdd(Util_strdup("[mc0:]")); #endif +#ifdef WIIU +// FIXME: limited to sd: add usb: + FilenamesAdd(Util_strdup("[sd:]")); +#endif + #ifdef DOS_DRIVES /* in DOS/Windows, add all existing disk letters */ { @@ -1150,6 +1155,12 @@ static int FileSelector(char *path, int select_dir, char pDirectories[][FILENAME strcpy(new_dir, "mc0:/"); } #endif +#ifdef WIIU +// FIXME for now only sd: ,please add usb: + else if (strcmp(selected_filename, "[sd:]") == 0) { + strcpy(new_dir, "sd:/"); + } +#endif #ifdef DOS_DRIVES else if (selected_filename[2] == ':' && selected_filename[3] == ']') { /* disk selected */ diff --git a/atari800/src/util.c b/atari800/src/util.c index bc6ed72..bebdb9e 100644 --- a/atari800/src/util.c +++ b/atari800/src/util.c @@ -477,6 +477,10 @@ double Util_time(void) void Util_sleep(double s) { +#ifdef WIIU +/* no need to sleep on retroarch (we are awake) so bypass it for wiiu */ +return; +#endif #ifdef SUPPORTS_PLATFORM_SLEEP PLATFORM_Sleep(s); #else /* !SUPPORTS_PLATFORM_SLEEP */ diff --git a/libretro/config.h b/libretro/config.h index 8bf4b34..0ae53c4 100644 --- a/libretro/config.h +++ b/libretro/config.h @@ -374,7 +374,7 @@ #define NTSC_FILTER 1 /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "pstehlik@sophics.cz" +#define PACKAGE_BUGREPORT "none@snowhere.org" /* Define to the full name of this package. */ #define PACKAGE_NAME "Atari800" @@ -534,6 +534,10 @@ # endif #endif + +#ifdef WIIU + #define WORDS_BIGENDIAN 1 +#endif /* Define if unaligned word access is ok. */ #define WORDS_UNALIGNED_OK 1