aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile9
-rw-r--r--overrides.c2
-rw-r--r--overrides/fceumm.h90
-rw-r--r--patches/fceumm/1000-trimui-build.patch51
-rw-r--r--scale.c5
6 files changed, 156 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 32f8524..5cd686a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ picoarch
/beetle-pce-fast
/fbalpha2012
+/fceumm
/gambatte
/gpsp
/mame2000
diff --git a/Makefile b/Makefile
index decb89d..bc09903 100644
--- a/Makefile
+++ b/Makefile
@@ -20,11 +20,14 @@ LDFLAGS = -lc -ldl -lgcc -lm -lSDL -lasound -lpng -lz -Wl,--gc-sections -flto
# EXTRA_CORES += fbalpha2012
# EXTRA_CORES += mame2003_plus
-CORES = beetle-pce-fast gambatte gpsp mame2000 pcsx_rearmed snes9x2002 snes9x2005 $(EXTRA_CORES)
+CORES = beetle-pce-fast fceumm gambatte gpsp mame2000 pcsx_rearmed snes9x2002 snes9x2005 $(EXTRA_CORES)
beetle-pce-fast_REPO = https://github.com/libretro/beetle-pce-fast-libretro
beetle-pce-fast_CORE = mednafen_pce_fast_libretro.so
+fceumm_REPO = https://github.com/libretro/libretro-fceumm
+fceumm_MAKEFILE = Makefile.libretro
+
gambatte_REPO = https://github.com/libretro/gambatte-libretro
fbalpha2012_BUILD_PATH = fbalpha2012/svn-current/trunk
@@ -142,6 +145,10 @@ fbalpha2012_ROM_DIR = ARCADE
fbalpha2012_TYPES = zip
fbalpha2012_PAK_NAME = Arcade (FBA)
+fceumm_ROM_DIR = FC
+fceumm_TYPES = fds,nes,unf,unif
+fceumm_PAK_NAME = Nintendo
+
gambatte_ROM_DIR = GB
gambatte_TYPES = gb,gbc,dmg,zip
gambatte_PAK_NAME = Game Boy
diff --git a/overrides.c b/overrides.c
index 1f8f0d8..fdb010e 100644
--- a/overrides.c
+++ b/overrides.c
@@ -1,5 +1,6 @@
#include "overrides.h"
#include "overrides/beetle-pce-fast.h"
+#include "overrides/fceumm.h"
#include "overrides/gambatte.h"
#include "overrides/gpsp.h"
#include "overrides/mame2000.h"
@@ -10,6 +11,7 @@
static const struct core_override overrides[] = {
beetle_pce_fast_overrides,
+ fceumm_overrides,
gambatte_overrides,
gpsp_overrides,
mame2000_overrides,
diff --git a/overrides/fceumm.h b/overrides/fceumm.h
new file mode 100644
index 0000000..2009d08
--- /dev/null
+++ b/overrides/fceumm.h
@@ -0,0 +1,90 @@
+#include "overrides.h"
+
+static const struct core_override_option fceumm_core_option_overrides[] = {
+ {
+ .key = "fceumm_ramstate",
+ .desc = "RAM Fill (Restart)",
+ },
+ {
+ .key = "fceumm_overscan_h",
+ .desc = "Crop Horz. Overscan",
+ },
+ {
+ .key = "fceumm_overscan_v",
+ .desc = "Crop Vert. Overscan",
+ },
+ {
+ .key = "fceumm_up_down_allowed",
+ .desc = "Opp. Directions",
+ },
+ {
+ .key = "fceumm_turbo_delay",
+ .desc = "Turbo Delay Frames",
+ },
+ {
+ .key = "fceumm_apu_1",
+ .desc = "Square 1 Channel",
+ },
+ {
+ .key = "fceumm_apu_2",
+ .desc = "Square 2 Channel",
+ },
+ {
+ .key = "fceumm_apu_3",
+ .desc = "Triangle Channel",
+ },
+ {
+ .key = "fceumm_apu_4",
+ .desc = "Noise Channel",
+ },
+ {
+ .key = "fceumm_apu_5",
+ .desc = "PCM Channel",
+ },
+ {
+ .key = "fceumm_show_adv_system_options",
+ .desc = "Show Sys Options",
+ },
+ {
+ .key = "fceumm_show_adv_sound_options",
+ .desc = "Show Snd Options",
+ },
+ {
+ .key = "fceumm_zapper_mode",
+ .blocked = true
+ },
+ {
+ .key = "fceumm_show_crosshair",
+ .blocked = true
+ },
+ {
+ .key = "fceumm_zapper_tolerance",
+ .blocked = true
+ },
+ { NULL }
+};
+
+me_bind_action fceumm_ctrl_actions[] =
+{
+ { "UP ", 1 << RETRO_DEVICE_ID_JOYPAD_UP},
+ { "DOWN ", 1 << RETRO_DEVICE_ID_JOYPAD_DOWN },
+ { "LEFT ", 1 << RETRO_DEVICE_ID_JOYPAD_LEFT },
+ { "RIGHT ", 1 << RETRO_DEVICE_ID_JOYPAD_RIGHT },
+ { "A ", 1 << RETRO_DEVICE_ID_JOYPAD_A },
+ { "B ", 1 << RETRO_DEVICE_ID_JOYPAD_B },
+ { "A TURBO ", 1 << RETRO_DEVICE_ID_JOYPAD_X },
+ { "B TURBO ", 1 << RETRO_DEVICE_ID_JOYPAD_Y },
+ { "SELECT ", 1 << RETRO_DEVICE_ID_JOYPAD_START },
+ { "START ", 1 << RETRO_DEVICE_ID_JOYPAD_SELECT },
+ { "DISK CHNG", 1 << RETRO_DEVICE_ID_JOYPAD_L },
+ { "INS DISK ", 1 << RETRO_DEVICE_ID_JOYPAD_R },
+ { "INS COIN ", 1 << RETRO_DEVICE_ID_JOYPAD_R2 },
+ { NULL, 0 }
+};
+
+#define fceumm_overrides { \
+ .core_name = "fceumm", \
+ .actions = fceumm_ctrl_actions, \
+ .action_size = array_size(fceumm_ctrl_actions), \
+ .options = fceumm_core_option_overrides \
+}
diff --git a/patches/fceumm/1000-trimui-build.patch b/patches/fceumm/1000-trimui-build.patch
new file mode 100644
index 0000000..4d52559
--- /dev/null
+++ b/patches/fceumm/1000-trimui-build.patch
@@ -0,0 +1,51 @@
+diff --git a/Makefile.libretro b/Makefile.libretro
+index 2f2bb5a..493149f 100644
+--- a/Makefile.libretro
++++ b/Makefile.libretro
+@@ -445,6 +445,22 @@ else ifeq ($(platform), retrofw)
+ PLATFORM_DEFINES += -ffast-math -march=mips32 -mtune=mips32 -mhard-float -fomit-frame-pointer
+ EXTERNAL_ZLIB = 1
+
++# TRIMUI
++else ifeq ($(platform), trimui)
++ TARGET := $(TARGET_NAME)_libretro.so
++ CC = $(CROSS_COMPILE)gcc
++ CXX = $(CROSS_COMPILE)g++
++ AR = $(CROSS_COMPILE)ar
++ SHARED := -shared -Wl,--version-script=src/drivers/libretro/link.T -Wl,-no-undefined
++ LDFLAGS += -fno-PIC -flto
++ CFLAGS += -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s -mtune=arm926ej-s -fno-PIC -flto
++ OPTIMIZE := -Ofast -DNDEBUG
++ EXTERNAL_ZLIB = 1
++ HAVE_NTSC = 0
++ ifeq (,$(DEBUG))
++ LDFLAGS += -s
++ endif
++
+ # Windows MSVC 2017 all architectures
+ else ifneq (,$(findstring windows_msvc2017,$(platform)))
+ CC = cl.exe
+@@ -708,10 +724,23 @@ else
+ CFLAGS += -MT
+ CXXFLAGS += -MT
+ endif
++ ifneq (,$(OPTIMIZE))
++ CFLAGS += $(OPTIMIZE)
++ CXXFLAGS += $(OPTIMIZE)
++ else
+ CFLAGS += -O2 -DNDEBUG
+ CXXFLAGS += -O2 -DNDEBUG
++ endif
+ endif
+
++ifeq ($(PROFILE), GENERATE)
++ CFLAGS += -fprofile-generate=./profile/fceumm
++ LDFLAGS += -lgcov
++else ifeq ($(PROFILE), APPLY)
++ CFLAGS += -fprofile-use -fprofile-dir=../profile/fceumm -fbranch-probabilities
++endif
++
++
+ ifneq ($(SANITIZER),)
+ CFLAGS += -fsanitize=$(SANITIZER)
+ CXXFLAGS += -fsanitize=$(SANITIZER)
diff --git a/scale.c b/scale.c
index 5db2746..7287d5a 100644
--- a/scale.c
+++ b/scale.c
@@ -396,7 +396,10 @@ static void scale_select_scaler(unsigned w, unsigned h, size_t pitch) {
}
}
- if (!scaler && current_aspect_ratio == 4.0f / 3.0f && w == 256) {
+ if (!scaler &&
+ w == 256 &&
+ (current_aspect_ratio == 4.0f / 3.0f || scale_size == SCALE_SIZE_FULL))
+ {
if (scale_filter == SCALE_FILTER_SHARP) {
scaler = scale_sharp_256xXXX_320xXXX;
return;