Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cores/makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# this logic was broken out from picoarch's all-in-one makefile

CORES = fceumm gambatte gpsp pcsx_rearmed picodrive snes9x2005_plus
CORES+= beetle-pce-fast beetle-vb mednafen_supafaust mgba pokemini mame2003-plus # extras
CORES+= beetle-pce-fast beetle-vb mednafen_supafaust mgba pokemini mame2003-plus vice-c64 # extras

###############################

Expand Down Expand Up @@ -39,6 +39,10 @@ snes9x2005_plus_FLAGS = USE_BLARGG_APU=1
mame2003-plus_REPO = https://github.com/libretro/mame2003-plus-libretro
mame2003-plus_CORE = mame2003_plus_libretro.so

vice-c64_REPO = https://github.com/libretro/vice-libretro
vice-c64_FLAGS= EMUTYPE=x64
vice-c64_CORE = vice_x64_libretro.so

###############################

PATCH = git apply
Expand Down
32 changes: 32 additions & 0 deletions cores/patches/vice-c64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/Makefile b/Makefile
index 5f5fd96..949ddbc 100644
--- a/Makefile
+++ b/Makefile
@@ -101,6 +101,27 @@ else ifeq ($(platform), classic_armv7_a7)
endif
endif

+# RG35XX
+else ifeq ($(platform), rg35xx)
+ TARGET := $(TARGET_NAME)_libretro.so
+ CC = $(CROSS_COMPILE)gcc
+ CXX = $(CROSS_COMPILE)g++
+ AR = $(CROSS_COMPILE)ar
+ fpic := -fPIC
+ LDFLAGS += $(fpic) -shared -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,-no-undefined
+ CFLAGS += -Ofast \
+ -flto=4 -fwhole-program -fuse-linker-plugin \
+ -fdata-sections -ffunction-sections -Wl,--gc-sections \
+ -fno-stack-protector -fno-ident -fomit-frame-pointer \
+ -falign-functions=1 -falign-jumps=1 -falign-loops=1 \
+ -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \
+ -fmerge-all-constants -fno-math-errno \
+ -marm -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard
+ CXXFLAGS += $(CFLAGS)
+ CPPFLAGS += $(CFLAGS)
+ ASFLAGS += $(CFLAGS)
+ HAVE_NEON = 1
+
# (armv8 a35, hard point, neon based) ###
# PS Classic
else ifeq ($(platform), classic_armv8_a35)
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ bundle:
cp ./cores/output/mednafen_supafaust_libretro.so ./build/EXTRAS/Emus/rg35xx/SUPA.pak
cp ./cores/output/mednafen_vb_libretro.so ./build/EXTRAS/Emus/rg35xx/VB.pak
cp ./cores/output/pokemini_libretro.so ./build/EXTRAS/Emus/rg35xx/PKM.pak
cp ./cores/output/vice_x64_libretro.so ./build/EXTRAS/Emus/rg35xx/C64.pak
cp ./other/DinguxCommander/output/DinguxCommander ./build/EXTRAS/Tools/rg35xx/Files.pak
cp -R ./other/DinguxCommander/res ./build/EXTRAS/Tools/rg35xx/Files.pak/

Expand Down
Empty file added skeleton/EXTRAS/Bios/C64/.keep
Empty file.
25 changes: 25 additions & 0 deletions skeleton/EXTRAS/Emus/rg35xx/C64.pak/default.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
minarch_screen_scaling = Fullscreen
minarch_cpu_speed = Powersave
minarch_connect_port = On

vice_jiffydos = "enabled"
vice_warp_boost = "enabled"
vice_statusbar_messages = "enabled"
vice_resid_sampling = "fast"

bind Up = UP
bind Down = DOWN
bind Left = LEFT
bind Right = RIGHT
bind Select = SELECT
bind Start = START
bind X = X
bind Y = Y
bind B / Fire = B
bind A = A
bind L = L1
bind L2 = L2
bind L3 = NONE
bind R = R1
bind R2 = R2
bind R3 = NONE
14 changes: 14 additions & 0 deletions skeleton/EXTRAS/Emus/rg35xx/C64.pak/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

EMU_EXE=vice_x64
CORES_PATH=$(dirname "$0")

###############################

EMU_TAG=$(basename "$(dirname "$0")" .pak)
ROM="$1"
mkdir -p "$BIOS_PATH/$EMU_TAG"
mkdir -p "$SAVES_PATH/$EMU_TAG"
HOME="$USERDATA_PATH"
cd "$HOME"
minarch.elf "$CORES_PATH/${EMU_EXE}_libretro.so" "$ROM" &> "$LOGS_PATH/$EMU_TAG.txt"
2 changes: 2 additions & 0 deletions skeleton/EXTRAS/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ Bios files

You'll need to BYOB for the emulator paks included in this zip file.

C64: vice/JiffyDOS_C64.bin and vice/JiffyDOS_1541-II.bin (reccomanded but not needed)
MGBA: gba_bios.bin
PCE: syscard3.pce
PKM: bios.min
SGB: sgb.bios

Empty file.
Empty file added skeleton/EXTRAS/Saves/C64/.keep
Empty file.
35 changes: 28 additions & 7 deletions src/minarch/minarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static int show_debug = 0;
static int max_ff_speed = 3; // 4x
static int fast_forward = 0;
static int overclock = 1; // normal
static int connect_port = 0; //// See retro_set_controller_port_device in libretro.h, most cores will do this automatically.

static struct Renderer {
int src_w;
Expand Down Expand Up @@ -579,6 +580,7 @@ enum {
FE_OPT_OVERCLOCK,
FE_OPT_DEBUG,
FE_OPT_MAXFF,
FE_OPT_CONNECTPORT,
FE_OPT_COUNT,
};

Expand Down Expand Up @@ -811,6 +813,16 @@ static struct Config {
.values = max_ff_labels,
.labels = max_ff_labels,
},
[FE_OPT_CONNECTPORT] = {
.key = "minarch_connect_port",
.name = "Connect RetroPad Device",
.desc = "Connect RetroPad device to input port.\nEnable this, if a core cannot automatically detect\nthe appropriate input device type on its own.",
.default_value = 0,
.value = 0,
.count = 2,
.values = onoff_labels,
.labels = onoff_labels,
},
[FE_OPT_COUNT] = {NULL}
}
},
Expand Down Expand Up @@ -862,13 +874,14 @@ static void setOverclock(int i) {
}
static void Config_syncFrontend(int i, int value) {
switch (i) {
case FE_OPT_SCALING: screen_scaling = value; renderer.src_w = 0; break;
case FE_OPT_SCANLINES: show_scanlines = value; renderer.src_w = 0; break;
case FE_OPT_TEXT: optimize_text = value; renderer.src_w = 0; break;
case FE_OPT_TEARING: prevent_tearing = value; break;
case FE_OPT_OVERCLOCK: overclock = value; break;
case FE_OPT_DEBUG: show_debug = value; break;
case FE_OPT_MAXFF: max_ff_speed = value; break;
case FE_OPT_SCALING: screen_scaling = value; renderer.src_w = 0; break;
case FE_OPT_SCANLINES: show_scanlines = value; renderer.src_w = 0; break;
case FE_OPT_TEXT: optimize_text = value; renderer.src_w = 0; break;
case FE_OPT_TEARING: prevent_tearing = value; break;
case FE_OPT_OVERCLOCK: overclock = value; break;
case FE_OPT_DEBUG: show_debug = value; break;
case FE_OPT_MAXFF: max_ff_speed = value; break;
case FE_OPT_CONNECTPORT: connect_port = value; break;
}
Option* option = &config.frontend.options[i];
option->value = value;
Expand Down Expand Up @@ -2901,6 +2914,14 @@ void Core_init(void) {
}
void Core_load(void) {
LOG_info("Core_load\n");

// See retro_set_controller_port_device in libretro.h
// "It is only a hint to the libretro core when a core cannot automatically detect
// the appropriate input device type on its own."
// This seems to be the case for vice-libretro, but could be true of other cores.
// The new option in the Frontend menu, makes it possible to enabled this if necessary
if (connect_port) core.set_controller_port_device(0,RETRO_DEVICE_JOYPAD);

struct retro_game_info game_info;
game_info.path = game.tmp_path[0]?game.tmp_path:game.path;
game_info.data = game.data;
Expand Down