From 08cd83e4b09e18b1107d5f216c97eb9beb09e40e Mon Sep 17 00:00:00 2001 From: neonloop Date: Sun, 28 Nov 2021 17:58:58 +0000 Subject: Adds blueMSX core --- .gitignore | 1 + Makefile | 9 ++++- overrides.c | 2 ++ overrides/bluemsx.h | 59 +++++++++++++++++++++++++++++++++ patches/bluemsx/1000-trimui-build.patch | 49 +++++++++++++++++++++++++++ 5 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 overrides/bluemsx.h create mode 100644 patches/bluemsx/1000-trimui-build.patch diff --git a/.gitignore b/.gitignore index 8120fdf..be4722c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ picoarch /system /beetle-pce-fast +/bluemsx /fbalpha2012 /fceumm /gambatte diff --git a/Makefile b/Makefile index 90afbd6..b7852d6 100644 --- a/Makefile +++ b/Makefile @@ -19,11 +19,13 @@ LDFLAGS = -lc -ldl -lgcc -lm -lSDL -lasound -lpng -lz -Wl,--gc-sections -flto # Unpolished or slow cores that build # EXTRA_CORES += fbalpha2012 # EXTRA_CORES += mame2003_plus -CORES = beetle-pce-fast fceumm gambatte gme gpsp mame2000 pcsx_rearmed picodrive quicknes smsplus-gx snes9x2002 snes9x2005 $(EXTRA_CORES) +CORES = beetle-pce-fast bluemsx fceumm gambatte gme gpsp mame2000 pcsx_rearmed picodrive quicknes smsplus-gx 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 +bluemsx_REPO = https://github.com/libretro/blueMSX-libretro + fbalpha2012_BUILD_PATH = fbalpha2012/svn-current/trunk fbalpha2012_MAKEFILE = makefile.libretro @@ -148,6 +150,11 @@ beetle-pce-fast_ROM_DIR = PCE beetle-pce-fast_TYPES = pce,cue,ccd,chd,toc,m3u beetle-pce-fast_PAK_NAME = TurboGrafx-16 +bluemsx_NAME = blueMSX +bluemsx_ROM_DIR = MSX +bluemsx_TYPES = rom,ri,mx1,mx2,dsk,col,sg,sc,cas,m3u +bluemsx_PAK_NAME = MSX + fbalpha2012_NAME = fba2012 fbalpha2012_ROM_DIR = ARCADE fbalpha2012_TYPES = zip diff --git a/overrides.c b/overrides.c index 8a37332..e5670f1 100644 --- a/overrides.c +++ b/overrides.c @@ -1,5 +1,6 @@ #include "overrides.h" #include "overrides/beetle-pce-fast.h" +#include "overrides/bluemsx.h" #include "overrides/fceumm.h" #include "overrides/gambatte.h" #include "overrides/gme.h" @@ -15,6 +16,7 @@ static const struct core_override overrides[] = { beetle_pce_fast_overrides, + bluemsx_overrides, fceumm_overrides, gambatte_overrides, gme_overrides, diff --git a/overrides/bluemsx.h b/overrides/bluemsx.h new file mode 100644 index 0000000..daa633b --- /dev/null +++ b/overrides/bluemsx.h @@ -0,0 +1,59 @@ +#include "overrides.h" + +static const struct core_override_option bluemsx_core_option_overrides[] = { + { + .key = "bluemsx_msxtype", + .desc = "Machine (Restart)", + .options = { + [8] = { "SVI-318", NULL }, + [9] = { "SVI-328", NULL }, + [10] = { "SVI-328 MK2", NULL }, + [12] = { "SVI-603", NULL }, + }, + }, + { + .key = "bluemsx_vdp_synctype", + .desc = "VDP Sync (Restart)", + }, + { + .key = "bluemsx_ym2413_enable", + .desc = "YM2413 (Restart)", + .info = "Enable YM2413 sound", + }, + { + .key = "bluemsx_cartmapper", + .desc = "Mapper (Restart)", + .info = "Manually select the correct mapper when a cart is not yet in the database.", + }, + { + .key = "bluemsx_auto_rewind_cas", + .desc = "Auto Rewind", + }, + { NULL } +}; + +me_bind_action bluemsx_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 }, + { "BTN 1 ", 1 << RETRO_DEVICE_ID_JOYPAD_A }, + { "BTN 2 ", 1 << RETRO_DEVICE_ID_JOYPAD_B }, + { "BTN 3 ", 1 << RETRO_DEVICE_ID_JOYPAD_Y }, + { "BTN 4 ", 1 << RETRO_DEVICE_ID_JOYPAD_X }, + { "BTN 5 ", 1 << RETRO_DEVICE_ID_JOYPAD_L }, + { "BTN 6 ", 1 << RETRO_DEVICE_ID_JOYPAD_R }, + { "COL 5 ", 1 << RETRO_DEVICE_ID_JOYPAD_R2 }, + { "COL 6 ", 1 << RETRO_DEVICE_ID_JOYPAD_L2 }, + { "COL # ", 1 << RETRO_DEVICE_ID_JOYPAD_START }, + { "COL * ", 1 << RETRO_DEVICE_ID_JOYPAD_SELECT }, + { NULL, 0 } +}; + +#define bluemsx_overrides { \ + .core_name = "bluemsx", \ + .actions = bluemsx_ctrl_actions, \ + .action_size = array_size(bluemsx_ctrl_actions), \ + .options = bluemsx_core_option_overrides \ +} diff --git a/patches/bluemsx/1000-trimui-build.patch b/patches/bluemsx/1000-trimui-build.patch new file mode 100644 index 0000000..d4026df --- /dev/null +++ b/patches/bluemsx/1000-trimui-build.patch @@ -0,0 +1,49 @@ +diff --git a/Makefile.libretro b/Makefile.libretro +index 0e8b073..040e734 100644 +--- a/Makefile.libretro ++++ b/Makefile.libretro +@@ -428,6 +428,20 @@ else ifneq (,$(findstring armv,$(platform))) + endif + PLATFORM_DEFINES += -DARM + ++# 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=link.T ++ LDFLAGS += -fno-PIC -flto ++ CFLAGS += -fomit-frame-pointer -ffast-math -mcpu=arm926ej-s -mtune=arm926ej-s -fno-PIC -flto ++ OPTIMIZE := -Ofast -DNDEBUG ++ ifeq (,$(DEBUG)) ++ LDFLAGS += -s ++ endif ++ + # emscripten + else ifeq ($(platform), emscripten) + TARGET := $(TARGET_NAME)_libretro_$(platform).bc +@@ -678,6 +692,9 @@ endif + ifeq ($(DEBUG), 1) + CFLAGS += -O0 -g + CXXFLAGS += -O0 -g ++else ifneq (,$(OPTIMIZE)) ++ CFLAGS += $(OPTIMIZE) ++ CXXFLAGS += $(OPTIMIZE) -fno-exceptions -fno-rtti -DHAVE_STDINT_H -DNDEBUG + else + CFLAGS += -O2 + CXXFLAGS += -O2 -fno-exceptions -fno-rtti -DHAVE_STDINT_H -DNDEBUG +@@ -698,6 +715,13 @@ ifeq ($(LOG_PERFORMANCE), 1) + CXXFLAGS += -DLOG_PERFORMANCE + 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 ++ + include Makefile.common + + DEFINES := $(PLATFORM_DEFINES) $(COREDEFINES) -- cgit v1.2.3