aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneonloop2021-10-21 00:19:07 +0000
committerneonloop2021-10-21 00:19:07 +0000
commita1b4714da9b135a864ebe1b53b8bf4c67b8b18d5 (patch)
tree5c26ecaa9595e2af7e46512bfc6dc67bf87b0512
parent7c003401f4f1e5463f20af1dc63b25ad8a15e3c1 (diff)
downloadpicoarch-a1b4714da9b135a864ebe1b53b8bf4c67b8b18d5.tar.gz
picoarch-a1b4714da9b135a864ebe1b53b8bf4c67b8b18d5.tar.bz2
picoarch-a1b4714da9b135a864ebe1b53b8bf4c67b8b18d5.zip
Adds gme (Game Music Emu) core
-rw-r--r--.gitignore1
-rw-r--r--Makefile12
-rw-r--r--overrides.c2
-rw-r--r--overrides/gme.h15
-rw-r--r--patches/gme/0001-fix-sample-size.patch26
-rw-r--r--patches/gme/1000-trimui-build.patch32
6 files changed, 85 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 7170363..70183e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@ picoarch
/fbalpha2012
/fceumm
/gambatte
+/gme
/gpsp
/mame2000
/mame2003_plus
diff --git a/Makefile b/Makefile
index e8fb0f2..6064832 100644
--- a/Makefile
+++ b/Makefile
@@ -20,18 +20,20 @@ LDFLAGS = -lc -ldl -lgcc -lm -lSDL -lasound -lpng -lz -Wl,--gc-sections -flto
# EXTRA_CORES += fbalpha2012
# EXTRA_CORES += mame2003_plus
-CORES = beetle-pce-fast fceumm gambatte gpsp mame2000 pcsx_rearmed quicknes snes9x2002 snes9x2005 $(EXTRA_CORES)
+CORES = beetle-pce-fast fceumm gambatte gme gpsp mame2000 pcsx_rearmed quicknes 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
+fbalpha2012_BUILD_PATH = fbalpha2012/svn-current/trunk
+fbalpha2012_MAKEFILE = makefile.libretro
+
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
-fbalpha2012_MAKEFILE = makefile.libretro
+gme_REPO = https://github.com/libretro/libretro-gme
mame2000_REPO = https://github.com/libretro/mame2000-libretro
mame2003_plus_REPO = https://github.com/libretro/mame2003-plus-libretro
@@ -164,6 +166,10 @@ needs-swap
endef
+gme_ROM_DIR = MUSIC
+gme_TYPES = ay,gbs,gym,hes,kss,nsf,nsfe,sap,spc,vgm,vgz,zip
+gme_PAK_NAME = Game Music
+
mame2000_ROM_DIR = ARCADE
mame2000_TYPES = zip
mame2000_PAK_NAME = Arcade
diff --git a/overrides.c b/overrides.c
index 2cc9488..7e6b61b 100644
--- a/overrides.c
+++ b/overrides.c
@@ -2,6 +2,7 @@
#include "overrides/beetle-pce-fast.h"
#include "overrides/fceumm.h"
#include "overrides/gambatte.h"
+#include "overrides/gme.h"
#include "overrides/gpsp.h"
#include "overrides/mame2000.h"
#include "overrides/pcsx_rearmed.h"
@@ -14,6 +15,7 @@ static const struct core_override overrides[] = {
beetle_pce_fast_overrides,
fceumm_overrides,
gambatte_overrides,
+ gme_overrides,
gpsp_overrides,
mame2000_overrides,
pcsx_rearmed_overrides,
diff --git a/overrides/gme.h b/overrides/gme.h
new file mode 100644
index 0000000..e8c8a2f
--- /dev/null
+++ b/overrides/gme.h
@@ -0,0 +1,15 @@
+#include "overrides.h"
+
+me_bind_action gme_ctrl_actions[] =
+{
+ { "PREV TRK ", 1 << RETRO_DEVICE_ID_JOYPAD_L },
+ { "NEXT TRK ", 1 << RETRO_DEVICE_ID_JOYPAD_R },
+ { "PAUSE ", 1 << RETRO_DEVICE_ID_JOYPAD_START },
+ { NULL, 0 }
+};
+
+#define gme_overrides { \
+ .core_name = "gme", \
+ .actions = gme_ctrl_actions, \
+ .action_size = array_size(gme_ctrl_actions), \
+}
diff --git a/patches/gme/0001-fix-sample-size.patch b/patches/gme/0001-fix-sample-size.patch
new file mode 100644
index 0000000..27cc6b1
--- /dev/null
+++ b/patches/gme/0001-fix-sample-size.patch
@@ -0,0 +1,26 @@
+diff --git a/src/libretro.c b/src/libretro.c
+index 1e2b37f..d393a5a 100644
+--- a/src/libretro.c
++++ b/src/libretro.c
+@@ -180,7 +180,7 @@ void retro_run(void)
+ draw_ui();
+ video_cb(framebuffer->pixel_data, framebuffer->width, framebuffer->height, framebuffer->bytes_per_pixel * framebuffer->width);
+ //audio handling
+- audio_batch_cb(play(),1470);
++ audio_batch_cb(play(),735);
+ }
+
+ // File Loading
+diff --git a/src/player.c b/src/player.c
+index 1daf980..e7c69be 100644
+--- a/src/player.c
++++ b/src/player.c
+@@ -86,7 +86,7 @@ short *play(void)
+ is_playing_ = false;
+ }
+ else
+- gme_play( emu, 2048, audio_buffer );
++ gme_play( emu, 1470, audio_buffer );
+ }
+ else
+ memset(audio_buffer,0,8192 * sizeof(short));
diff --git a/patches/gme/1000-trimui-build.patch b/patches/gme/1000-trimui-build.patch
new file mode 100644
index 0000000..0c20db3
--- /dev/null
+++ b/patches/gme/1000-trimui-build.patch
@@ -0,0 +1,32 @@
+diff --git a/Makefile b/Makefile
+index fa45fb3..9e20a41 100644
+--- a/Makefile
++++ b/Makefile
+@@ -39,6 +39,7 @@ ifeq ($(platform), unix)
+ ifneq ($(findstring Haiku,$(shell uname -a)),)
+ LIBM :=
+ endif
++ CFLAGS += -D_GNU_SOURCE
+
+ # OS X
+ else ifeq ($(platform), osx)
+@@ -214,6 +215,19 @@ else ifeq ($(platform), switch)
+ include $(LIBTRANSISTOR_HOME)/libtransistor.mk
+ STATIC_LINKING=1
+
++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
++ CFLAGS += -fomit-frame-pointer -march=armv5te -mtune=arm926ej-s -ffast-math -fno-PIC -flto -D_GNU_SOURCE
++ CXXFLAGS += -fomit-frame-pointer -march=armv5te -mtune=arm926ej-s -ffast-math -fno-PIC -flto -D_GNU_SOURCE
++ LDFLAGS += -flto
++ ifeq (,$(DEBUG))
++ LDFLAGS += -s
++ endif
++
+ # ARM
+ else ifneq (,$(findstring armv,$(platform)))
+ TARGET := $(TARGET_NAME)_libretro.so