Compare commits

..

13 commits

46 changed files with 2511 additions and 268 deletions

View file

@ -37,9 +37,11 @@ on top of MinUI.
- Add to Favorites
- Clear "Recently Played"
- Battery efficiency improvements
- Power saving improvements
- Performance improvements
- Multi-core CPU support
- Battery reading adjustments
- Additional emulators (MAME)
- Base and Extras are merged into one Full release
- Native macOS installation instructions
- Developer experience improvements
@ -52,14 +54,15 @@ on top of MinUI.
### Build project
Run `./start-toolchain.sh` and then `make all` in the Docker container shell.
Run `./start-toolchain.sh` and then run `make all` in the Docker container shell.
### TODO
### Debug project
- Improve battery capacity reading accuracy
- Show battery percentage number overlay
- Change boot logo
- [...things in the old todo?...](./todo.txt)
Create a file with the name `enableADB` on the `misc` disk to enable ADB.
### Install release
Update `DISK_PATH` and then run `./install-release.sh`.
## Disclaimer

View file

@ -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 # extras
CORES+= beetle-pce-fast beetle-vb fake-08 mednafen_supafaust mgba pokemini mame2003-plus race # extras
###############################
@ -19,13 +19,20 @@ beetle-pce-fast_CORE = mednafen_pce_fast_libretro.so
beetle-vb_REPO = https://github.com/libretro/beetle-vb-libretro
beetle-vb_CORE = mednafen_vb_libretro.so
fake-08_REPO = https://github.com/jtothebell/fake-08
fake-08_CORE = fake08_libretro.so
fake-08_BUILD_PATH = fake-08/platform/libretro
fceumm_REPO = https://github.com/libretro/libretro-fceumm
gambatte_REPO = https://github.com/libretro/gambatte-libretro
gpsp_HASH = 8745bf3 # last known working save states
mednafen_supafaust_REPO = https://github.com/libretro/supafaust
pcsx_rearmed_MAKEFILE = Makefile.libretro
pcsx_rearmed_HASH = 672e715 # last known working build
picodrive_REPO = https://github.com/irixxxx/picodrive
picodrive_MAKEFILE = Makefile.libretro
@ -36,6 +43,9 @@ pokemini_MAKEFILE = Makefile.libretro
snes9x2005_plus_REPO = https://github.com/libretro/snes9x2005
snes9x2005_plus_FLAGS = USE_BLARGG_APU=1
mame2003-plus_REPO = https://github.com/libretro/mame2003-plus-libretro
mame2003-plus_CORE = mame2003_plus_libretro.so
###############################
PATCH = git apply

34
cores/patches/fake-08.patch Executable file
View file

@ -0,0 +1,34 @@
diff --git forkSrcPrefix/platform/libretro/Makefile forkDstPrefix/platform/libretro/Makefile
index be0f1b46bb3ab10be4a9f896f5e8841dd630b35b..cc7a7249135bb690885e7f5fda09f9eb8fdeac22 100644
--- forkSrcPrefix/platform/libretro/Makefile
+++ forkDstPrefix/platform/libretro/Makefile
@@ -123,7 +123,16 @@ else ifeq ($(platform), miyoomini)
CXXFLAGS += -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve -D_NEED_FULL_PATH_
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T
-
+else ifeq ($(platform), rg35xx)
+ TARGET := $(TARGET_NAME)_libretro.so
+ CC = $(CROSS_COMPILE)gcc
+ CXX = $(CROSS_COMPILE)g++
+ AR = $(CROSS_COMPILE)ar
+ STRIP = $(CROSS_COMPILE)strip
+ CXXFLAGS += -marm -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -march=armv7-a
+ CXXFLAGS += -fomit-frame-pointer -ffast-math -fno-common -ftree-vectorize -funswitch-loops
+ fpic := -fPIC
+ SHARED := -shared -Wl,--version-script=link.T
else ifeq ($(platform), gcw0)
TARGET := $(TARGET_NAME)_libretro_gcw0.so
CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc
diff --git forkSrcPrefix/platform/libretro/libretro.cpp forkDstPrefix/platform/libretro/libretro.cpp
index d95ccb6cab52abfe7620ff84dd5cbb450bafe750..24687335ad410096aa48f29e13dcb479171a06fc 100644
--- forkSrcPrefix/platform/libretro/libretro.cpp
+++ forkDstPrefix/platform/libretro/libretro.cpp
@@ -636,6 +636,7 @@ EXPORT bool retro_load_game(struct retro_game_info const *info)
else {
_vm->QueueCartChange(info->path);
}
+ _vm->UpdateAndDraw();
return true;
}

View file

@ -0,0 +1,35 @@
diff --git a/Makefile b/Makefile
index 21129613..eaf61b92 100644
--- a/Makefile
+++ b/Makefile
@@ -525,6 +525,30 @@ else ifeq ($(platform), miyoo)
PLATCFLAGS += -fomit-frame-pointer -march=armv5te -mtune=arm926ej-s -ffast-math
CXXFLAGS += -fno-rtti -fno-exceptions
+# 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=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
+ ARCH = arm
+ CPU_ARCH := arm
+ ARM = 1
+
# Emscripten
else ifeq ($(platform), emscripten)
TARGET := $(TARGET_NAME)_libretro_$(platform).bc

23
cores/patches/race.patch Normal file
View file

@ -0,0 +1,23 @@
diff --git forkSrcPrefix/Makefile forkDstPrefix/Makefile
index 792a6d82915c32edd3df6ceec541499f6ca25ac5..dc02b361d7db47e011b6d3addf89cfb31503575a 100644
--- forkSrcPrefix/Makefile
+++ forkDstPrefix/Makefile
@@ -373,6 +373,18 @@ else ifeq ($(platform), miyoo)
CFLAGS += -fomit-frame-pointer -ffast-math -march=armv5te -mtune=arm926ej-s
CXXFLAGS += $(CFLAGS)
+# RG35XX
+else ifeq ($(platform), rg35xx)
+ TARGET := $(TARGET_NAME)_libretro.so
+ CC = $(CROSS_COMPILE)gcc
+ CXX = $(CROSS_COMPILE)g++
+ AR = $(CROSS_COMPILE)ar
+ fpic := -fPIC
+ SHARED := -shared -Wl,-version-script=$(LIBRETRO_DIR)/link.T
+ PLATFORM_DEFINES := -DCC_RESAMPLER -DCC_RESAMPLER_NO_HIGHPASS
+ CFLAGS += -fomit-frame-pointer -ffast-math -marm -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -march=armv7-a
+ CXXFLAGS += $(CFLAGS)
+
# Windows MSVC 2010 x64
else ifeq ($(platform), windows_msvc2010_x64)
CC = cl.exe

47
install-release.sh Executable file
View file

@ -0,0 +1,47 @@
#!/bin/bash
set -euo pipefail
DISK_PATH="/dev/disk2"
FIRMWARE_NAME="35XX-64GB230309EN.IMG"
RELEASE_NAME="FinUI-*-0-full.zip"
WORKING_DIRECTORY="./releases/"
echo "[*] PREPARING INSTALLATION"
cd $WORKING_DIRECTORY
echo
echo "[*] INSTALLING FIRMWARE"
diskutil unmountDisk $DISK_PATH
sleep 3
sudo dd bs=1m if=$FIRMWARE_NAME of=$DISK_PATH
sleep 3
sudo diskutil eraseVolume FAT32 ROMS ${DISK_PATH}s4
sleep 3
echo
echo "[*] INSTALLING FinUI"
unzip -o ${RELEASE_NAME[0]}
cp -R dmenu.bin /Volumes/misc/
cp -R MinUI.zip /Volumes/ROMS/
cp -R Bios/ /Volumes/ROMS/Bios
cp -R Emus/ /Volumes/ROMS/Emus
cp -R Roms/ /Volumes/ROMS/Roms
cp -R Saves/ /Volumes/ROMS/Saves
cp -R Tools/ /Volumes/ROMS/Tools
echo
echo "[*] CLEANING FILES"
dot_clean -m /Volumes/misc
rm -fr /Volumes/misc/.fseventsd /Volumes/misc/.Spotlight-V100 /Volumes/misc/.Trashes /Volumes/misc/._.Trashes
mkdir /Volumes/misc/.fseventsd
touch /Volumes/misc/.fseventsd/no_log /Volumes/misc/.metadata_never_index /Volumes/misc/.Trashes
dot_clean -m /Volumes/ROMS
rm -fr /Volumes/ROMS/.fseventsd /Volumes/ROMS/.Spotlight-V100 /Volumes/ROMS/.Trashes /Volumes/ROMS/._.Trashes
mkdir /Volumes/ROMS/.fseventsd
touch /Volumes/ROMS/.fseventsd/no_log /Volumes/ROMS/.metadata_never_index /Volumes/ROMS/.Trashes
echo

View file

@ -14,18 +14,19 @@ endif
BUILD_HASH!=git rev-parse --short HEAD
RELEASE_TIME!=date +%Y%m%d
RELEASE_TIME!=TZ=GMT date +%Y%m%d
RELEASE_BASE=FinUI-$(RELEASE_TIME)b
RELEASE_DOT!=find ./releases/. -regex ".*/$(RELEASE_BASE)-[0-9]+-base\.zip" -printf '.' | wc -m
RELEASE_NAME=$(RELEASE_BASE)-$(RELEASE_DOT)
#in case BUILD_HASH is empty, put something to avoid crashing
ifeq (,$(BUILD_HASH))
BUILD_HASH="devRelease"
BUILD_HASH="unknown release"
endif
# TODO: this needs to consider the different platforms, eg. rootfs.ext2 should only be copied in rg35xx-toolchain
all: lib sys all-cores tools bundle readmes zip report
all: lib sys all-cores tools dtb bundle readmes zip report
repack: bundle readmes zip report
@ -48,6 +49,9 @@ tools:
cd ./src/toggle_adb && make
cd ./other/DinguxCommander && make -j
dtb:
cd ./src/dts/ && make
bundle:
# ready build
rm -rf ./build
@ -67,6 +71,9 @@ bundle:
# populate system
cp ~/buildroot/output/images/rootfs.ext2 ./build/SYSTEM/rg35xx
cp ./src/dts/kernel.dtb ./build/SYSTEM/rg35xx/dat
cp ./src/ramdisk/patched-ramdisk.img ./build/SYSTEM/rg35xx/dat/ramdisk.img
cp ./src/ramdisk/charging.png ./build/SYSTEM/rg35xx/dat/
cp ./src/libmsettings/libmsettings.so ./build/SYSTEM/rg35xx/lib
cp ./src/keymon/keymon.elf ./build/SYSTEM/rg35xx/bin
cp ./src/minarch/minarch.elf ./build/SYSTEM/rg35xx/bin
@ -85,12 +92,16 @@ bundle:
cp ./cores/output/snes9x2005_plus_libretro.so ./build/SYSTEM/rg35xx/cores
# extras
cp ./cores/output/mame2003_plus_libretro.so ./build/EXTRAS/Emus/rg35xx/MAME.pak
cp ./cores/output/fake08_libretro.so ./build/EXTRAS/Emus/rg35xx/P8.pak
cp ./cores/output/mgba_libretro.so ./build/EXTRAS/Emus/rg35xx/MGBA.pak
cp ./cores/output/mgba_libretro.so ./build/EXTRAS/Emus/rg35xx/SGB.pak
cp ./cores/output/mednafen_pce_fast_libretro.so ./build/EXTRAS/Emus/rg35xx/PCE.pak
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/race_libretro.so ./build/EXTRAS/Emus/rg35xx/NGP.pak
cp ./cores/output/race_libretro.so ./build/EXTRAS/Emus/rg35xx/NGPC.pak
cp ./other/DinguxCommander/output/DinguxCommander ./build/EXTRAS/Tools/rg35xx/Files.pak
cp -R ./other/DinguxCommander/res ./build/EXTRAS/Tools/rg35xx/Files.pak/
@ -108,14 +119,14 @@ zip:
cd ./build/PAYLOAD && zip -r MinUI.zip .system
mv ./build/PAYLOAD/MinUI.zip ./build/BASE
cd ./build/BASE && zip -r ../../releases/$(RELEASE_NAME)-base.zip Bios Roms Saves Screenshots dmenu.bin MinUI.zip README.txt INSTALL.txt SHORTCUTS.txt
cd ./build/EXTRAS && zip -r ../../releases/$(RELEASE_NAME)-extras.zip Bios Emus Roms Saves Screenshots Tools README.txt
cd ./build/BASE && zip -r ../../releases/$(RELEASE_NAME)-base.zip Bios Roms Saves dmenu.bin MinUI.zip README.txt INSTALL.txt SHORTCUTS.txt
cd ./build/EXTRAS && zip -r ../../releases/$(RELEASE_NAME)-extras.zip Bios Emus Roms Saves Tools README.txt
rm -fr ./build/FULL
mkdir ./build/FULL
cp -fR ./build/BASE/* ./build/FULL/
cp -fR ./build/EXTRAS/* ./build/FULL/
cd ./build/FULL && zip -r ../../releases/$(RELEASE_NAME)-full.zip Bios Emus Roms Saves Screenshots Tools dmenu.bin MinUI.zip INSTALL.txt SHORTCUTS.txt
cd ./build/FULL && zip -r ../../releases/$(RELEASE_NAME)-full.zip Bios Emus Roms Saves Tools dmenu.bin MinUI.zip INSTALL.txt SHORTCUTS.txt
echo "$(RELEASE_NAME)" > ./build/latest.txt

View file

@ -0,0 +1,26 @@
minarch_cpu_speed = Performance
minarch_prevent_tearing = Off
mame2003-plus_skip_disclaimer = enabled
mame2003-plus_skip_warnings = enabled
-mame2003-plus_display_setup = disabled
-mame2003-plus_input_interface = retropad
-mame2003-plus_tate_mode = disabled
-mame2003-plus_xy_device = disabled
-mame2003-plus_display_artwork = disabled
-mame2003-plus_tate_mode = disabled
bind Up = UP
bind Down = DOWN
bind Left = LEFT
bind Right = RIGHT
bind Select = SELECT
bind Start = START
bind X Button = X
bind Y Button = Y
bind B Button = B
bind A Button = A
bind L1 Button = L1
bind L2 Button = L2
bind R1 Button = R1
bind R2 Button = R2

View file

@ -0,0 +1,14 @@
#!/bin/sh
EMU_EXE=mame2003_plus
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" DMG &> "$LOGS_PATH/$EMU_TAG.txt"

View file

@ -0,0 +1,9 @@
race_dark_filter_level = 50
bind Up = UP
bind Down = DOWN
bind Left = LEFT
bind Right = RIGHT
bind A Button = B
bind B Button = A
bind Option = START

View file

@ -0,0 +1,14 @@
#!/bin/sh
EMU_EXE=race
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"

View file

@ -0,0 +1,8 @@
bind Up = UP
bind Down = DOWN
bind Left = LEFT
bind Right = RIGHT
bind A Button = B
bind B Button = A
bind Option = START

View file

@ -0,0 +1,14 @@
#!/bin/sh
EMU_EXE=race
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"

View file

@ -0,0 +1,7 @@
bind Up = UP
bind Down = DOWN
bind Left = LEFT
bind Right = RIGHT
bind A Button = A
bind B Button = B
bind Start = START

View file

@ -0,0 +1,14 @@
#!/bin/sh
EMU_EXE=fake08
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"

View file

View file

@ -0,0 +1,527 @@
#Avoid complex names
#Separator is '~'. Do not include that in the alias
#Lines starting with '#' are comments and are not count
#Keep below 1000 including comments
#
#Works for any list (collections, favorites, consoles, etc)
#Real filename will be shown on game's menu. This only affects main menu listing.
#
#NEOGEO~##
2020bb~2020 Super Baseball
sonicwi2~Aero Fighters 2
sonicwi3~Aero Fighters 3
aodk~Aggressors of Dark KombatWold
alpham2~Alpha Mission II
androdun~Andro Dunos
aof2~Art of Fighting 2
aof~Art of Fighting
bangbead~Bang Bead
bstars2~Baseball Stars 2
bstars~Baseball Stars Professional
flipshot~Battle Flip Shot
blazstar~Blazing Star
bjourney~Blue's Journey
breakrev~Breakers Revenge
breakers~Breakers
burningf~Burning Fight
ctomaday~Captain Tomaday
gowcaizr~Chojin Gakuen Gowcaizer
crsword~Crossed Swords
cyberlip~Cyber-Lip
doubledr~Double Dragon
eightman~Eight Man
kabukikl~Far East of Eden: Kabuki Klash
fatfury1~Fatal Fury: King of Fighters
fatfury2~Fatal Fury 2
fatfury3~Fatal Fury 3: Road to the Final Victory
fatfursp~Fatal Fury Special
fightfev~Fight Fever
karnovr~Fighter's History Dynamite
wjammers~Flying Power Disc
fbfrenzy~Football Frenzy
galaxyfg~Galaxy Fight: Universal Warriors
ganryu~Ganryu
garou~Garou: Mark of the Wolves
gpilots~Ghost Pilots
ghostlop~Ghostlop
goalx3~Goal! Goal! Goal!
gururin~Gururin
kotm2~King of the Monsters 2 - The Next Thing
kotm~King of the Monsters
kizuna~Kizuna Encounter - Super Tag Battle
lresort~Last Resort
lbowling~League Bowling
legendos~Legend of Success Joe
magdrop2~Magical Drop II
magdrop3~Magical Drop III
maglord~Magician Lord
matrim~Matrimelee
mslug~Metal Slug - Super Vehicle-001
mslug2~Metal Slug 2 - Super Vehicle-001/II
mslug3~Metal Slug 3
mslug4~Metal Slug 4
mslug5~Metal Slug 5
mslugx~Metal Slug X - Super Vehicle-001
mutnat~Mutation Nation
nam1975~NAM-1975
neobombe~Neo Bomberman
neodrift~Neo Drift Out - New Technology
neomrdo~Neo Mr. Do!
turfmast~Neo Turf Masters
neocup98~Neo-Geo Cup '98 - The Road to the Victory
nitd~Nightmare in the Dark
ncombat~Ninja Combat
ncommand~Ninja Commando
ninjamas~Ninja Master's: Haō Ninpō Chō
zedblade~Operation Ragnarok
overtop~Over Top
panicbom~Panic Bomber
pgoal~Pleasure Goal
pnyaa~Pochi and Nyaa
popbounc~Pop 'n Bounce
pspikes2~Power Spikes II
preisle2~Prehistoric Isle 2
pulstar~Pulstar
pbobbl2n~Puzzle Bobble 2
pbobblen~Puzzle Bobble
puzzledp~Puzzle De Pon!
joyjoy~Puzzled
rotd~Rage of the Dragons
ragnagrd~Ragnagard
rbff2~Real Bout Fatal Fury 2 - The Newcomers
rbffspec~Real Bout Fatal Fury Special
rbff1~Real Bout Fatal Fury
ridhero~Riding Hero
roboarmy~Robo Army
aof3~Ryuuko no Ken Gaiden
samsho2~Samurai Shodown II
samsho3~Samurai Shodown III
samsho4~Samurai Shodown IV - Amakusa's Revenge
samsho5~Samurai Shodown V
samsh5sp~Samurai Shodown V Special
samsho~Samurai Shodown
savagere~Savage Reign
sengoku2~Sengoku 2
sengoku3~Sengoku 3
sengoku~Sengoku
shocktr2~Shock Troopers: 2nd Squad
shocktro~Shock Troopers
socbrawl~Soccer Brawl
spinmast~Spin Master
stakwin2~Stakes Winner 2
stakwin~Stakes Winner
strhoop~Street Hoop
s1945p~Strikers 1945 Plus
sdodgeb~Super Dodge Ball
ssideki2~Super Sidekicks 2 - The World Championship
ssideki3~Super Sidekicks 3 - The Next Glory
ssideki~Super Sidekicks
svc~SVC Chaos - SNK Vs. Capcom
irrmaze~The Irritating Maze
kof2000~The King of Fighters 2000
kof2001~The King of Fighters 2001
kof2002~The King of Fighters 2002
kof2003~The King of Fighters 2003
kof94~The King of Fighters '94
kof95~The King of Fighters '95
kof96~The King of Fighters '96
kof97~The King of Fighters '97
kof98~The King of Fighters '98 - The Slugfest
kof99~The King of Fighters '99: Millennium Battle
lastbld2~The Last Blade 2
lastblad~The Last Blade
superspy~The Super Spy
ssideki4~The Ultimate 11: SNK Football Championship
trally~Thrash Rally
tophuntr~Top Hunter: Roddy & Cathy
tpgolf~Top Player's Golf
totc~Treasure of the Caribbean
twinspri~Twinkle Star Sprites
viewpoin~Viewpoint
vliner~V-Liner
wakuwak7~Waku Waku 7
wh2j~World Heroes 2 Jet
wh2~World Heroes 2
whp~World Heroes Perfect
wh1~World Heroes
zupapa~Zupapa!
neogeo~ZZZ
#ARCADE~##
1941~1941: Counter Attack
1942~1942
1943kai~1943 Kai: Midway Kaisen
1943~1943: The Battle of Midway
1944~1944: The Loop Master
19xx~19XX: The War Against Destiny
720~720 Degrees
actfancr~Act-Fancer: Cybernetick Hyper Weapon
aburner2~After Burner II
aburner~After Burner
airwolf~Airwolf
typhoon~Ajax
lwings~Ales no Tsubasa: The Legendary Soldiers
astorm~Alien Storm
aliensyn~Alien Syndrome
aliensu~Aliens
avspu~Aliens Versus Predator
aligatun~Alligator Hunt
altbeast~Altered Beast
amidar~Amidar
aquajack~Aqua Jack
unsquad~Area 88
rygar~Argus no Senshi
arknoid2~Arkanoid - Revenge Of Doh
arknoidu~Arkanoid
batrider~Armed Police Batrider
asterix~Asterix
asteroid~Asteroids
avspirit~Avenging Spirit
bankp~Bank Panic
batman~Batman
batcir~Battle Circuit
bzone~Battle Zone
btoads~Battletoads
blswhstl~Bells & Whistles
berzerk1~Berzerk
biomtoy~Biomechanical Toy
blktiger~Black Tiger
bwidow~Black Widow
blstroid~Blasteroids
bogeyman~Bogey Manor
bombjack~Bomb Jack
bosco~Bosconian
bubbobr1~Bubble Bobble
bubsympu~Bubble Symphony
bubbles~Bubbles
buckrog~Buck Rogers: Planet of Zoom
buckyua~Bucky O'Hare
bnj~Bump 'n' Jump
btime~Burger Time
bbros~Buster Bros.
cabal~Cabal
dinou~Cadillacs Kyouryuu-Shinseiki
dino~Cadillacs and Dinosaurs
captavnu~Captain America And The Avengers
captcomu~Captain Commando
centtime~Centipede
chasehq~Chase H.q.
chplft~Choplifter
circusc~Circus Charlie
citycon~City Connection
columns~Columns
commandu~Commando
congo~Congo Bongo
contra~Contra
cclimber~Crazy Climber
crimfgt2~Crime Fighters
cbuster~Crude Buster
ccastles~Crystal Castles
cybots~Cyberbots: Fullmetal Madness
cyvern~Cyvern - The Dragon Weapons
ddcrew~D. D. Crew
ghoulsu~Dai Makai-Mura
darkseal~Dark Seal
pow~Datsugoku: Prisoners of War
deadconx~Dead Connection
defendg~Defender
dassault~Desert Assault
digdug~Dig Dug
digdug2~Dig Dug II
dogyuun~Dogyuun
dondokod~Don Doko Don
dkongo~Donkey Kong
dkong3~Donkey Kong 3
dkongjr~Donkey Kong Junior
donpachi~DonPachi
ddragonu~Double Dragon
ddragn2u~Double Dragon II - The Revenge
drtoppel~Dr. Toppel's Adventure
dbreed~Dragon Breed
dsaber~Dragon Saber
baddudes~Dragonninja
lightbr~Dungeon Magic
ddsomu~Dungeons & Dragons: Shadow over Mystara
ddtodu~Dungeons & Dragons: Tower of Doom
dw~Dynasty Wars
ecofghtr~Eco Fighters
elevator~Elevator Action
elvactr~Elevator Action Returns
enduror~Enduro Racer
exedexes~Exed Exes
fantzone~Fantasy Zone
fantzn2~Fantasy Zone II: The Tears of Opa-Opa
ffightu~Final Fight
ffight~Final Fight
flicky~Flicky
foodf~Food Fight
forgottn~Forgotten Worlds
frogger~Frogger
funkyjet~Funky Jet
gijoeu~G.I. Joe
galaga~Galaga
galaga88~Galaga ´88
galaxian~Galaxian
galmedes~Galmedes
gangwars~Gang Wars
gaplus~Gaplus
gaunt2p~Gauntlet
gaunt22p~Gauntlet 2
gigawing~Giga Wing
godzilla~Godzilla
goldnaxe~Golden Axe
ga2~Golden Axe: The Revenge of Death Adder
gorf~Gorf
gradius~Gradius
gradius2~Gradius II: Gofer no Yab
grdius3e~Gradius III
dimahoo~Great Mahou Daisakusen
growlu~Growl
grdians~Guardians: Denjin Makai II
gunsmoku~Gun.Smoke
gnbarich~Gunbarich
gunbird2~Gunbird 2
gunforc2~GunForce II
gunlock~Gunlock
gunnail~GunNail
guwange~Guwange
gyruss~Gyruss
hharryu~Hammerin' Harry
hangon~Hang-on
hattrick~Hat Trick
heatbrlu~Heated Barrel
hvysmsh~Heavy Smash
hitice~Hit The Ice
hooku~Hook
horizon~Horizon
trackfld~Hyper Olympic
irobot~I, Robot
ikari3nr~Ikari III - The Rescue
ikarijpb~Ikari Warriors
imgfight~Image Fight
inthunt~In the Hunt
offroad~Ironman Ivan Stewart's Super Off-road
jailbrek~Jail Break
journey~Journey
joust~Joust
jungleh~Jungle King
junofrst~Juno First
kangaroo~Kangaroo
kchamp~Karate Dou
karnov~Karnov
kick~Kick
shaolins~Kicker
klax~Klax
knightsu~Knights of the Round
kungfum~Kung-fu Master
landmkrp~Land Maker
loht~Legend of Hero Tonma
lethalth~Lethal Thunder
lifefrce~Life Force
liquidk~Liquid Kids
ldrun~Lode Runner
ldrun2~Lode Runner II - The Bungeling Strikes Back
ldrun4~Lode Runner IV - Teikoku Karano Dasshutsu
loderndf~Lode Runner: The Dig Fight
looping~Looping
llander~Lunar Lander
macrossp~Macross Plus
mswordu~Magic Sword
mgcrystl~Magical Crystals
mhavoc~Major Havoc
gngt~Makai-Mura
mappy~Mappy
marble~Marble Madness
mario~Mario Bros.
mmatrix~Mars Matrix: Hyper Solid Shooting
mshvsf~Marvel Super Heroes vs. Street Fighter
mshvsfj~Marvel Super Heroes vs. Street Fighter
mvsc~Marvel vs. Capcom: Clash of Super Heroes
mazinger~Mazinger Z
mtwins~Mega Twins
mercs~Mercs
metmqstr~Metamoqester
metamrph~Metamorphic Force
moonwalk~Michael Jackson's Moonwalker
gtmr2~Mille Miglia 2: Great 1000 Miles Rally
milliped~Millipede
missile~Missile Command
monsterb~Monster Bash
mpatrol~Moon Patrol
mk~Mortal Kombat
mk2~Mortal Kombat 2
mk3~Mortal Kombat 3
mrdo~Mr. Do!
docastle~Mr. Do's Castle
mspacman~Ms. Pac-Man
mbombrd~Muscle Bomber Duo: Ultimate Team Battle
mystwaru~Mystic Warriors
narc~Narc
nbajam~Nba Jam
nbajamte~NBA Jam Tournament Edition
nemo~Nemo
nrallyx~New Rally X
nibbler~Nibbler
nslasher~Night Slashers
nbbatman~Ninja Baseball Bat Man
gaiden~Ninja Gaiden
nspirit~Ninja Spirit
ninjakd2~Ninja-Kid II
nitrobal~Nitro Ball
noboranb~Noboranka
candance~Osman
outrunb~Out Run
outzone~Out Zone
pacland~Pac-Land
pacman~Pac-Man
pang3~Pang! 3
paperboy~Paperboy
parodius~Parodius Da!
pengo~Pengo
peterpak~Peter Pack Rat
phoenix~Phoenix
pipedrm~Pipe Dream
pitfight~Pit Fighter
sgemf~Pocket Fighter
polepos~Pole Position
polepos2~Pole Position II
pooyan~Pooyan
popeyef~Popeye
armwaru~Powered Gear: Strategic Variant Armor Equipment
progear~Progear No Arashi
punchout~Punch-out!!
punksht2~Punk Shot
puyopuya~Puyo Puyo
puyopuy2~Puyo Puyo 2
puzloopu~Puzz Loop
qbert~Q*bert
qix~Qix
rallyx~Rally X
rampage~Rampage
ramprt2p~Rampart
rastanu~Rastan
renegade~Renegade
ringking~Ring King
robocop~Robocop
robocp2u~Robocop 2
robotron~Robotron: 2084
megaman2~Rockman 2: The Power Fighters
rocnrope~Roc'n Rope
rohgau~Rohga Armor Force
rthunder~Rolling Thunder
rthun2~Rolling Thunder 2
rtypeu~R-Type
rtype2~R-Type II
rtypeleo~R-Type Leo
rushatck~Rush'n Attack
chinagat~Sai Yu Gou Ma Roku
stdragon~Saint Dragon
shollow~Satan's Hollow
slammasu~Saturday Night Slam Masters
seawolf~Sea Wolf
seganinu~Sega Ninja
sonic~Segasonic The Hedgehog
samuraia~Sengoku Aces
shdancer~Shadow Dancer
shadfrce~Shadow Force
shinobi~Shinobi
sidearmr~Side Arms - Hyper Dyne
sinistar~Sinistar
slyspy~Sly Spy
smashtv~Smash T.V.
snowbrob~Snow Bros. - Nick & Tom
solomon~Solomon no Kagi
sonson~Son Son
aerofgt~Aero Fighters
sharrier~Space Harrier
invaders~Space Invaders
spidey~Spider-Man: The Videogame
splatter~Splatter House
spyhunt~Spy Hunter
starcas~Star Castle
starwars~Star Wars
stmblade~Storm Blade
sf1us~Street Fighter
sf2t~Street Fighter II': Champion Edition
sf2~Street Fighter II: The World Warrior
sfa2~Street Fighter Zero 2
sfa3~Street Fighter Zero 3
strider~Strider Hiryu
s1945~Strikers 1945
s1945ii~Strikers 1945 II
s1945iii~Strikers 1945 III
ssrdrubc~Sunset Riders
scontra~Super Contra
shangon~Super Hang-on
ringdest~Super Muscle Bomber: The International Blowout
superpac~Super Pac-Man
spnchout~Super Punch-out!!
spf2t~Super Puzzle Fighter II X
macross2~Super Spacefortress Macross II
macross~Super Spacefortress Macross
ssprint~Super Sprint
ssf2t~Super Street Fighter II Turbo
superman~Superman
tapper~Tapper
trojan~Tatakai no Banka
wildfang~Tecmo Knight
tmnt2po~Teenage Mutant Ninja Turtles
tmnt22p~Teenage Mutant Ninja Turtles: Turtles in Time
tekken~Tekken
tekken2~Tekken 2
tekken3~Tekken 3
tempest~Tempest
wofu~Tenchi wo Kurau II: Sekiheki no Tatakai
tetris~Tetris
edrandy~The Cliffhanger: Edward Randy
ctribe~The Combatribes
boogwing~The Great Ragtime Show
kodu~The King of Dragons
lkage~The Legend of Kage
mainev2p~The Main Event
tnzsb~The NewZealand Story
ninjak~The Ninja Kids
outfxies~The Outfoxies
punishru~The Punisher
ghostb~The Real Ghostbusters
simpsn2p~The Simpsons
3wonderu~Three Wonders
thndrbld~Thunder Blade
timeplt~Time Pilot
tokiu~Toki
toobin~Toobin
bionicc~Top Secret
tigeroad~Tora e no Michi
tron~Tron
truxton2~Truxton II
tumblep~Tumble Pop
vball~U.S. Championship V'ball
cawingu~U.S. Navy
umk3~Ultimate Mortal Kombat 3
uccops~Undercover Cops
upndown~Up'n Down
valkyrie~Valkyrie no Densetsu
nwarr~Vampire Hunter: Darkstalkers Revenge
vsav2~Vampire Savior 2: The Lord of Vampire
vsavu~Vampire Savior: The Lord of Vampire
dstlku~Vampire: The Night Warriors
varthu~Varth: Operation Thunderstorm
vendet2p~Vendetta
vigilntu~Vigilante
viostorm~Violent Storm
vf~Virtua Fighter
volfied~Volfied
mooua~Wild West C.o.w.-boys Of Moo Mesa
willow~Willow
wow~Wizard Of Wor
wboyu~Wonder Boy
wb3~Wonder Boy III - Monster Lair
wbmlb~Wonder Boy In Monster Land
xmultipl~X Multiply
xevious~Xevious
xexex~Xexex
xmen2p~X-Men
xmvsfu~X-Men vs. Street Fighter
xmcotau~X-Men: Children of the Atom
zaxxon~Zaxxon
zerowing~Zero Wing
zookeep~Zoo Keeper

View file

View file

View file

@ -1,4 +1,3 @@
minarch_cpu_speed = Powersave
minarch_prevent_tearing = Strict
bind Up = UP

View file

@ -7,7 +7,6 @@ export SYSTEM_PATH="$SDCARD_PATH/.system/rg35xx"
export CORES_PATH="$SYSTEM_PATH/cores"
export USERDATA_PATH="$SDCARD_PATH/.userdata/rg35xx"
export LOGS_PATH="$USERDATA_PATH/logs"
export SCREENSHOTS_PATH="$SDCARD_PATH/Screenshots"
#######################################

View file

@ -6,8 +6,8 @@ TARGET = clear_recent
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Os -marm -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -march=armv7-a -fomit-frame-pointer
CFLAGS += -I. -I../common -DPLATFORM=\"$(UNION_PLATFORM)\"
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread
CFLAGS += -I. -I../common -DPLATFORM=\"$(UNION_PLATFORM)\" -Ofast
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread -lm -lz
all:
$(CC) $(TARGET).c ../common/utils.c ../common/api.c -o $(TARGET).elf $(CFLAGS) $(LDFLAGS)

View file

@ -6,8 +6,8 @@ TARGET = clock
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Os -marm -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -march=armv7-a -fomit-frame-pointer
CFLAGS += -I. -I../common -DPLATFORM=\"$(UNION_PLATFORM)\"
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread
CFLAGS += -I. -I../common -DPLATFORM=\"$(UNION_PLATFORM)\" -Ofast
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread -lm -lz
all:
$(CC) $(TARGET).c ../common/utils.c ../common/api.c -o $(TARGET).elf $(CFLAGS) $(LDFLAGS)

View file

@ -90,6 +90,7 @@ static void ion_alloc(int fd_ion, ion_alloc_info_t* info) {
static void ion_free(int fd_ion, ion_alloc_info_t* info) {
struct ion_handle_data ihd;
munmap(info->vadd, info->size);
close(info->fd);
ihd.handle = (uintptr_t)info->handle;
if (ioctl(fd_ion, ION_IOC_FREE, &ihd)<0) fprintf(stderr, "ION_FREE failed %s\n",strerror(errno));
fflush(stdout);
@ -442,6 +443,11 @@ SDL_Surface* GFX_init(int mode) {
font.small = TTF_OpenFont(FONT_PATH, SCALE1(FONT_SMALL));
font.tiny = TTF_OpenFont(FONT_PATH, SCALE1(FONT_TINY));
TTF_SetFontStyle(font.large, TTF_STYLE_BOLD);
TTF_SetFontStyle(font.medium, TTF_STYLE_BOLD);
TTF_SetFontStyle(font.small, TTF_STYLE_BOLD);
TTF_SetFontStyle(font.tiny, TTF_STYLE_BOLD);
return gfx.screen;
}
@ -1401,26 +1407,12 @@ static void POW_quitOverlay(void) {
ioctl(gfx.fd_fb, OWLFB_OVERLAY_DISABLE, &pow.oargs);
}
static int POW_readBatteryStatus(void) {
#define BATTERY_2100MAH 1
#define BATTERY_2600MAH 2
#define BATTERY_3500MAH 3
#define UNKNOWN 9
int battery = BATTERY_2600MAH; // Default
int battery_txt = getInt(BATTERY_PATH);
if (battery_txt > 0) {
battery = battery_txt;
}
int POW_readBatteryStatus(void) {
#define READ_VOLTAGE 1
if (READ_VOLTAGE > 0) {
int voltage_now = getInt("/sys/class/power_supply/battery/voltage_now");
if (battery == BATTERY_2100MAH) {
return ((voltage_now / 10000) - 310); // 310-410
} else if (battery == BATTERY_2600MAH) {
return ((voltage_now / 10000) - 308); // 308-414? Seems incorrect...
} else if (battery == BATTERY_3500MAH) {
// ???-???
}
// Fallback
@ -1560,8 +1552,11 @@ void POW_update(int* _dirty, int* _show_setting, POW_callback_t before_sleep, PO
void POW_disablePowerOff(void) {
pow.can_poweroff = 0;
}
void POW_sync(char* msg) {
GFX_clear(gfx.screen);
void POW_powerOff(void) {
if (pow.can_poweroff) {
GFX_resize(FIXED_WIDTH,FIXED_HEIGHT,FIXED_PITCH);
char* msg = exists(AUTO_RESUME_PATH) ? "Quicksave created,\npowering off" : "Powering off";
GFX_blitMessage(font.large, msg, gfx.screen, NULL);
GFX_flip(gfx.screen);
@ -1571,11 +1566,6 @@ void POW_sync(char* msg) {
system("sync");
sleep(2);
}
void POW_powerOff(void) {
if (pow.can_poweroff) {
char* msg = exists(AUTO_RESUME_PATH) ? "Quicksave created,\npowering off" : "Powering off";
POW_sync(msg);
// actual shutdown
system("echo o > /proc/sysrq-trigger");
@ -1583,12 +1573,11 @@ void POW_powerOff(void) {
}
void POW_reboot(void) {
char* msg = "Rebooting";
POW_sync(msg);
// trigger reboot
system("sync");
system("echo b > /proc/sysrq-trigger");
system("sync");
}
#define BACKLIGHT_PATH "/sys/class/backlight/backlight.2/bl_power"
void POW_setCPUSpeed(int speed) {

View file

@ -59,9 +59,8 @@
#define FAVORITE_PATH USERDATA_PATH "/.minui/favorite.txt"
#define FAUX_FAVORITE_PATH SDCARD_PATH "/Favorites"
#define COLLECTIONS_PATH SDCARD_PATH "/Collections"
#define BATTERY_PATH SDCARD_PATH "/battery.txt"
#define SCREENSHOTS_PATH SDCARD_PATH "/Screenshots"
#define ADB_FLAG_PATH SDCARD_PATH "/enableADB"
#define ALIASES_PATH SDCARD_PATH "/Roms/aliases.txt"
#define LAST_PATH "/tmp/last.txt" // transient
#define CHANGE_DISC_PATH "/tmp/change_disc.txt"

View file

@ -117,7 +117,7 @@ void trimSortingMeta(char** str) { // eg. `001) `
char* safe = *str;
while(isdigit(**str)) *str += 1; // ignore leading numbers
if (*str[0]==')') { // then match a closing parenthesis
if (*str[0]==')' || *str[0]=='.') { // then match a closing parenthesis or dot
*str += 1;
}
else { // or bail, restoring the string to its original value

1463
src/dts/kernel.dts Normal file

File diff suppressed because it is too large Load diff

4
src/dts/makefile Executable file
View file

@ -0,0 +1,4 @@
all:
dtc -O dtb -o kernel.dtb kernel.dts
clean:
rm -f kernel.dtb

View file

@ -14,6 +14,8 @@ if [ ! -f $FLAG_PATH ]; then
BAK_PATH=$TF1_PATH/bak
mkdir -p $BAK_PATH
cp /misc/boot_logo.bmp.gz $BAK_PATH
cp /misc/kernel.dtb $BAK_PATH
cp /misc/ramdisk.img $BAK_PATH
fi
was_updated() {
@ -27,6 +29,11 @@ was_updated() {
continue
fi
if [[ "$A_NAME" == "charging.png" ]]; then
# we don't care if the user has changed their charging image
continue
fi
if [ ! -f "$B_PATH" ]; then
continue
fi
@ -46,9 +53,13 @@ if [ ! -f $FLAG_PATH ] || was_updated; then
echo "updating misc partition"
mount -o remount,rw /dev/block/actb /misc
cp $SYSTEM_PATH/dat/dmenu.bin /misc
cp $SYSTEM_PATH/dat/kernel.dtb /misc
cp $SYSTEM_PATH/dat/ramdisk.img /misc
# graphics are only installed, never updated
if [ ! -f $FLAG_PATH ]; then
# only replace boot logo on install not update!
cp $SYSTEM_PATH/dat/boot_logo.bmp.gz /misc
cp $SYSTEM_PATH/dat/charging.png /misc
fi
touch $FLAG_PATH
sync && reboot

View file

@ -25,8 +25,8 @@ typedef struct Settings {
} Settings;
static Settings DefaultSettings = {
.version = SETTINGS_VERSION,
.brightness = 2,
.headphones = 4,
.brightness = 4,
.headphones = 8,
.speaker = 8,
.jack = 0,
};
@ -47,12 +47,12 @@ void InitSettings(void) {
shm_fd = shm_open(SHM_KEY, O_RDWR | O_CREAT | O_EXCL, 0644); // see if it exists
if (shm_fd==-1 && errno==EEXIST) { // already exists
puts("Settings client");
// puts("Settings client");
shm_fd = shm_open(SHM_KEY, O_RDWR, 0644);
settings = mmap(NULL, shm_size, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, 0);
}
else { // host
puts("Settings host"); // keymon
// puts("Settings host"); // keymon
is_host = 1;
// we created it so set initial size and populate
ftruncate(shm_fd, shm_size);
@ -72,7 +72,7 @@ void InitSettings(void) {
// these shouldn't be persisted
// settings->jack = 0;
}
printf("brightness: %i\nspeaker: %i \n", settings->brightness, settings->speaker);
printf("brightness: %i\nspeaker: %i \nheadphones: %i \n", settings->brightness, settings->speaker, settings->headphones);
SetVolume(GetVolume());
SetBrightness(GetBrightness());

View file

@ -6,8 +6,9 @@ TARGET = minarch
CC = $(CROSS_COMPILE)gcc
CFLAGS = -marm -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -march=armv7-a -fomit-frame-pointer
CFLAGS += -I. -I../common -I./libretro-common/include -DPLATFORM=\"$(UNION_PLATFORM)\" -Ofast
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread -lz
CFLAGS += -I. -I../common -I./libretro-common/include -DPLATFORM=\"$(UNION_PLATFORM)\" -Ofast -std=gnu99
CFLAGS += -Os -flto
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread -lm -lz
# CFLAGS += -Wall -Wno-unused-variable -Wno-unused-function -Wno-format-overflow
# CFLAGS += -fsanitize=address -fno-common
# LDFLAGS += -lasan

View file

@ -47,7 +47,6 @@ enum {
// default frontend options
static int screen_scaling = SCALE_ASPECT; // aspect
static int show_scanlines = 0;
static int optimize_text = 0;
static int prevent_tearing = 1; // lenient
static int show_debug = 0;
static int max_ff_speed = 3; // 4x
@ -435,6 +434,55 @@ static void SRAM_write(void) {
///////////////////////////////////////
static void RTC_getPath(char* filename) {
sprintf(filename, "%s/%s.rtc", core.saves_dir, game.name);
}
static void RTC_read(void) {
size_t rtc_size = core.get_memory_size(RETRO_MEMORY_RTC);
if (!rtc_size) return;
char filename[MAX_PATH];
RTC_getPath(filename);
printf("rtc path (read): %s\n", filename);
FILE *rtc_file = fopen(filename, "r");
if (!rtc_file) return;
void* rtc = core.get_memory_data(RETRO_MEMORY_RTC);
if (!rtc || !fread(rtc, 1, rtc_size, rtc_file)) {
LOG_error("Error reading RTC data\n");
}
fclose(rtc_file);
}
static void RTC_write(void) {
size_t rtc_size = core.get_memory_size(RETRO_MEMORY_RTC);
if (!rtc_size) return;
char filename[MAX_PATH];
RTC_getPath(filename);
printf("rtc path (write) size(%u): %s\n", rtc_size, filename);
FILE *rtc_file = fopen(filename, "w");
if (!rtc_file) {
LOG_error("Error opening RTC file: %s\n", strerror(errno));
return;
}
void *rtc = core.get_memory_data(RETRO_MEMORY_RTC);
if (!rtc || rtc_size != fwrite(rtc, 1, rtc_size, rtc_file)) {
LOG_error("Error writing RTC data to file\n");
}
fclose(rtc_file);
sync();
}
///////////////////////////////////////
static void Downsample(void* __restrict src, void* __restrict dst, uint32_t w, uint32_t h, uint32_t pitch, uint32_t dst_pitch) {
uint32_t ox = 0;
uint32_t oy = 0;
@ -461,6 +509,9 @@ static void State_read(void) { // from picoarch
size_t state_size = core.serialize_size();
if (!state_size) return;
int was_ff = fast_forward;
fast_forward = 0;
void *state = calloc(1, state_size);
if (!state) {
LOG_error("Couldn't allocate memory for state\n");
@ -478,7 +529,9 @@ static void State_read(void) { // from picoarch
goto error;
}
if (state_size != fread(state, 1, state_size, state_file)) {
// some cores report the wrong serialize size initially for some games, eg. mgba: Wario Land 4
// so we allow a size mismatch as long as the actual size fits in the buffer we've allocated
if (state_size < fread(state, 1, state_size, state_file)) {
LOG_error("Error reading state data from file: %s (%s)\n", filename, strerror(errno));
goto error;
}
@ -491,11 +544,16 @@ static void State_read(void) { // from picoarch
error:
if (state) free(state);
if (state_file) fclose(state_file);
fast_forward = was_ff;
}
static void State_write(void) { // from picoarch
size_t state_size = core.serialize_size();
if (!state_size) return;
int was_ff = fast_forward;
fast_forward = 0;
void *state = calloc(1, state_size);
if (!state) {
LOG_error("Couldn't allocate memory for state\n");
@ -526,6 +584,8 @@ error:
if (state_file) fclose(state_file);
sync();
fast_forward = was_ff;
}
static void State_autosave(void) {
int last_state_slot = state_slot;
@ -549,46 +609,6 @@ static void State_resume(void) {
State_read();
state_slot = last_state_slot;
}
static void Take_screenshot(void) {
char bmp_path[256];
char screenshot_dir[256];
sprintf(screenshot_dir, SCREENSHOTS_PATH);
mkdir(screenshot_dir, 0755);
SDL_Surface* backing = GFX_getBufferCopy();
SDL_Surface* snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, FIXED_WIDTH,FIXED_HEIGHT,FIXED_DEPTH,0,0,0,0);
if (backing->w==FIXED_WIDTH && backing->h==FIXED_HEIGHT) {
SDL_BlitSurface(backing, NULL, snapshot, NULL);
}
else {
Downsample(backing->pixels,snapshot->pixels,backing->w,backing->h,backing->pitch,snapshot->pitch);
}
// Get the current date and time for the screenshot filename
time_t currentTime = time(NULL);
struct tm* timeinfo = localtime(&currentTime);
int day = timeinfo->tm_mday;
int month = timeinfo->tm_mon + 1;
int year = timeinfo->tm_year + 1900;
int hours = timeinfo->tm_hour;
int minutes = timeinfo->tm_min;
int seconds = timeinfo->tm_sec;
// Convert hours and minutes to strings
char timeStr[16];
snprintf(timeStr, sizeof(timeStr), "%04d%02d%02d_%02d%02d%02d", year, month, day, hours, minutes, seconds);
sprintf(bmp_path, "%s/%s.bmp", screenshot_dir, timeStr);
SDL_RWops* out = SDL_RWFromFile(bmp_path, "wb");
SDL_SaveBMP_RW(snapshot, out, 1);
SDL_FreeSurface(snapshot);
SDL_FreeSurface(backing);
}
///////////////////////////////
@ -650,7 +670,6 @@ static char* max_ff_labels[] = {
enum {
FE_OPT_SCALING,
FE_OPT_SCANLINES,
FE_OPT_TEXT,
FE_OPT_TEARING,
FE_OPT_OVERCLOCK,
FE_OPT_DEBUG,
@ -666,7 +685,6 @@ enum {
SHORTCUT_TOGGLE_SCANLINES,
SHORTCUT_TOGGLE_FF,
SHORTCUT_HOLD_FF,
SHORTCUT_TAKE_SCREENSHOT,
SHORTCUT_COUNT,
};
@ -838,16 +856,6 @@ static struct Config {
.values = onoff_labels,
.labels = onoff_labels,
},
[FE_OPT_TEXT] = {
.key = "minarch_optimize_text",
.name = "Optimize Text",
.desc = "Prioritize a consistent stroke width when upscaling single\npixel lines using nearest neighbor scaler. Increases CPU load.\nOnly applies to native scaling.",
.default_value = 0,
.value = 0,
.count = 2,
.values = onoff_labels,
.labels = onoff_labels,
},
[FE_OPT_TEARING] = {
.key = "minarch_prevent_tearing",
.name = "Prevent Tearing",
@ -906,7 +914,6 @@ static struct Config {
[SHORTCUT_TOGGLE_SCANLINES] = {"Toggle Scanlines", -1, BTN_ID_NONE, 0},
[SHORTCUT_TOGGLE_FF] = {"Toggle FF", -1, BTN_ID_NONE, 0},
[SHORTCUT_HOLD_FF] = {"Hold FF", -1, BTN_ID_NONE, 0},
[SHORTCUT_TAKE_SCREENSHOT] = {"Take Screenshot", -1, BTN_ID_NONE, 0},
{NULL}
},
};
@ -942,7 +949,6 @@ 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;
@ -1491,9 +1497,6 @@ static void input_poll_callback(void) {
Config_syncFrontend(FE_OPT_SCANLINES, !show_scanlines);
}
break;
case SHORTCUT_TAKE_SCREENSHOT:
Take_screenshot();
break;
default: break;
}
@ -2400,125 +2403,6 @@ static void scaleNN_scanline(void* __restrict src, void* __restrict dst, uint32_
row += 1;
}
}
static void scaleNN_text(void* __restrict src, void* __restrict dst, uint32_t w, uint32_t h, uint32_t pitch, uint32_t dst_pitch) {
int dy = -renderer.dst_h;
unsigned lines = h;
bool copy = false;
size_t cpy_w = renderer.dst_w * FIXED_BPP;
int screen_p = screen->pitch;
int safe = w - 1; // don't look behind when there's nothing to see
uint16_t l1,l2;
while (lines) {
int dx = -renderer.dst_w;
const uint16_t *psrc16 = src;
uint16_t *pdst16 = dst;
l1 = l2 = 0x0;
if (copy) {
copy = false;
memcpy(dst, dst - screen_p, cpy_w);
dst += screen_p;
dy += h;
} else if (dy < 0) {
int col = w;
while(col--) {
int d = 0;
if (col<safe && l1!=l2) {
// https://stackoverflow.com/a/71086522/145965
uint16_t r = (l1 >> 10) & 0x3E;
uint16_t g = (l1 >> 5) & 0x3F;
uint16_t b = (l1 << 1) & 0x3E;
uint16_t luma = (r * 218) + (g * 732) + (b * 74);
luma = (luma >> 10) + ((luma >> 9) & 1); // 0-63
d = luma > 24;
}
uint16_t s = *psrc16;
while (dx < 0) {
*pdst16++ = d ? l1 : s;
dx += w;
l2 = l1;
l1 = s;
d = 0;
}
dx -= renderer.dst_w;
psrc16++;
}
dst += screen_p;
dy += h;
}
if (dy >= 0) {
dy -= renderer.dst_h;
src += pitch;
lines--;
} else {
copy = true;
}
}
}
static void scaleNN_text_scanline(void* __restrict src, void* __restrict dst, uint32_t w, uint32_t h, uint32_t pitch, uint32_t dst_pitch) {
int dy = -renderer.dst_h;
unsigned lines = h;
int row = 0;
int safe = w - 1; // don't look behind when there's nothing to see
uint16_t l1,l2;
while (lines) {
int dx = -renderer.dst_w;
const uint16_t *psrc16 = src;
uint16_t *pdst16 = dst;
l1 = l2 = 0x0;
if (row%2==0) {
int col = w;
while(col--) {
int d = 0;
if (col<safe && l1!=l2) {
// https://stackoverflow.com/a/71086522/145965
uint16_t r = (l1 >> 10) & 0x3E;
uint16_t g = (l1 >> 5) & 0x3F;
uint16_t b = (l1 << 1) & 0x3E;
uint16_t luma = (r * 218) + (g * 732) + (b * 74);
luma = (luma >> 10) + ((luma >> 9) & 1); // 0-63
d = luma > 24;
}
uint16_t s = *psrc16;
while (dx < 0) {
*pdst16 = *(pdst16 + dst_pitch) = d ? l1 : s;
pdst16 += 1;
dx += w;
l2 = l1;
l1 = s;
d = 0;
}
dx -= renderer.dst_w;
psrc16 += 1;
}
}
dst += dst_pitch;
dy += h;
if (dy >= 0) {
dy -= renderer.dst_h;
src += pitch;
lines--;
}
row += 1;
}
}
static SDL_Surface* scaler_surface;
static void selectScaler_PAR(int width, int height, int pitch) {
@ -2633,8 +2517,8 @@ static void selectScaler_PAR(int width, int height, int pitch) {
renderer.dst_offset = (oy * device_pitch) + (ox * FIXED_BPP);
if (use_nearest)
if (show_scanlines) renderer.scaler = optimize_text ? scaleNN_text_scanline : scaleNN_scanline;
else renderer.scaler = optimize_text ? scaleNN_text : scaleNN;
if (show_scanlines) renderer.scaler = scaleNN_scanline;
else renderer.scaler = scaleNN;
else {
sprintf(scaler_name, "%iX", scale);
if (show_scanlines) {
@ -2691,7 +2575,7 @@ static void selectScaler_AR(int width, int height, int pitch) {
// if (scale>6) scale = 6;
// else
if (scale>2) scale = 4; // TODO: pillar/letterboxing at 3x produces vertical banding (some kind of alignment issue?)
if (scale>2) scale = 2; // TODO: pillar/letterboxing at 3x produces vertical banding (some kind of alignment issue?)
// reduce scale if we don't have enough memory to accomodate it
// scaled width and height can't be greater than our fixed page width or height
@ -2987,11 +2871,13 @@ void Core_load(void) {
core.load_game(&game_info);
SRAM_read();
RTC_read();
// NOTE: must be called after core.load_game!
struct retro_system_av_info av_info = {};
core.get_system_av_info(&av_info);
// FIX: some cores need configure a default controller.
core.set_controller_port_device(0, 1);
core.fps = av_info.timing.fps;
core.sample_rate = av_info.timing.sample_rate;
double a = av_info.geometry.aspect_ratio;
@ -3009,6 +2895,7 @@ void Core_unload(void) {
void Core_quit(void) {
if (core.initialized) {
SRAM_write();
RTC_write();
core.unload_game();
core.deinit();
core.initialized = 0;
@ -3102,6 +2989,7 @@ void Menu_quit(void) {
}
void Menu_beforeSleep(void) {
SRAM_write();
RTC_write();
State_autosave();
putFile(AUTO_RESUME_PATH, game.path + strlen(SDCARD_PATH));
POW_setCPUSpeed(CPU_SPEED_MENU);
@ -3901,6 +3789,7 @@ static void Menu_loop(void) {
}
SRAM_write();
RTC_write();
POW_warn(0);
POW_setCPUSpeed(CPU_SPEED_MENU); // set Hz directly
GFX_setVsync(VSYNC_STRICT);
@ -3908,7 +3797,6 @@ static void Menu_loop(void) {
int rumble_strength = VIB_getStrength();
VIB_setStrength(0);
fast_forward = 0;
POW_enableAutosleep();
PAD_reset();
@ -4357,19 +4245,23 @@ static void trackFPS(void) {
}
static void limitFF(void) {
static uint64_t ff_frame_time = 0;
static uint64_t last_time = 0;
const uint64_t now = getMicroseconds();
static int last_max_speed = -1;
if (last_max_speed!=max_ff_speed) {
last_max_speed = max_ff_speed;
ff_frame_time = 1000000 / (core.fps * (max_ff_speed + 1));
}
uint64_t now = getMicroseconds();
if (fast_forward && max_ff_speed) {
if (last_time == 0) last_time = now;
int elapsed = now - last_time;
if (elapsed>0 && elapsed<0x80000) {
uint64_t ff_frame_time = 1000000 / (core.fps * (max_ff_speed + 1)); // TODO: define this only when max_ff_speed changes
if (elapsed<ff_frame_time) {
int delay = (ff_frame_time - elapsed) / 1000;
if (delay>0) {
// TODO: huh, this isn't causing the Tekken 3 hangs...
// printf("limitFF delay: %i\n", delay); fflush(stdout);
if (delay>0 && delay<17) { // don't allow a delay any greater than a frame
SDL_Delay(delay);
}
}

View file

@ -6,8 +6,8 @@ TARGET = minui
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Os -marm -mtune=cortex-a9 -mfpu=neon-fp16 -mfloat-abi=hard -march=armv7-a -fomit-frame-pointer
CFLAGS += -I. -I../common -DPLATFORM=\"$(UNION_PLATFORM)\"
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread
CFLAGS += -I. -I../common -DPLATFORM=\"$(UNION_PLATFORM)\" -Ofast -std=gnu99
LDFLAGS = -ldl -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread -lm -lz
# CFLAGS += -fsanitize=address -fno-common
# LDFLAGS += -lasan

View file

@ -114,6 +114,7 @@ typedef struct Entry {
char* path;
char* name;
char* unique;
char* alias; // for neogeo and others where you cannot change the rom filename
int type;
int alpha; // index in parent Directory's alphas Array, which points to the index of an Entry in its entries Array :sweat_smile:
} Entry;
@ -125,6 +126,7 @@ static Entry* Entry_new(char* path, int type) {
self->path = strdup(path);
self->name = strdup(display_name);
self->unique = NULL;
self->alias = NULL;
self->type = type;
self->alpha = 0;
return self;
@ -133,6 +135,7 @@ static void Entry_free(Entry* self) {
free(self->path);
free(self->name);
if (self->unique) free(self->unique);
if (self->alias) free(self->alias);
free(self);
}
@ -280,7 +283,7 @@ static Directory* Directory_new(char* path, int selected) {
else if (exactMatch(path, FAUX_FAVORITE_PATH)) {
self->entries = getFavorites();
}
else if (!exactMatch(path, COLLECTIONS_PATH) && prefixMatch(COLLECTIONS_PATH, path)) {
else if (!exactMatch(path, COLLECTIONS_PATH) && prefixMatch(COLLECTIONS_PATH, path) && suffixMatch(".txt", path)) {
self->entries = getCollection(path);
}
else if (suffixMatch(".m3u", path)) {
@ -1299,6 +1302,37 @@ int main (int argc, char *argv[]) {
POW_setCPUSpeed(CPU_SPEED_MENU);
GFX_setVsync(VSYNC_STRICT);
FILE *aliases = fopen(ALIASES_PATH, "r");
int aIndex = 0;
char* original[1000];
char* alias[1000];
char line[75];
if (aliases) {
while(fgets(line, sizeof line, aliases)!=NULL) {
if (line[0] != '\0' && line[0] != '#') {
original[aIndex] = malloc(sizeof(line));
alias[aIndex] = malloc(sizeof(line));
int set_alias = 0;
char* split = strtok(line, "~");
while(split) {
if (!set_alias) {
strcpy(original[aIndex], split);
set_alias = 1;
} else {
strcpy(alias[aIndex], split);
}
split = strtok(NULL, "~");
}
aIndex++;
}
}
fclose(aliases);
}
PAD_reset();
int dirty = 1;
int show_version = 0;
@ -1536,6 +1570,7 @@ int main (int argc, char *argv[]) {
Entry* entry = top->entries->items[i];
char* entry_name = entry->name;
char* entry_unique = entry->unique;
char* entry_alias = entry->alias;
int available_width = screen->w - SCALE1(PADDING * 2);
if (i==top->start) available_width -= ow + CLOCK_SIZE;
@ -1544,6 +1579,23 @@ int main (int argc, char *argv[]) {
text_color = COLOR_GOLD;
}
if (aIndex > 0) {
for(int a = 0; a < aIndex; ++a)
{
if(!strcmp(original[a], entry_name))
{
entry_alias = strdup(alias[a]);
}
}
}
if (entry_alias!=NULL) {
// has alias, we display these over the others
entry_unique = NULL;
entry_name = strdup(entry_alias);
LOG_info("new entry name: %s\n", entry_name);
}
trimSortingMeta(&entry_name);
char display_name[256];

BIN
src/ramdisk/charging.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

View file

@ -0,0 +1,3 @@
patched version of ramdisk.img
from the official stock TF1 image
released on or around 2023-03-09

35
src/ramdisk/readme.txt Normal file
View file

@ -0,0 +1,35 @@
can't just hexedit a ramdisk.img because of the internal CRC checksum
make sure we have mkimage
apt update && apt install u-boot-tools
(the following steps are slow if performed in the shared workspace folder,
move ramdisk.img somewhere above that directory to do the work, eg. ~)
strip the header from ramdisk.img
dd bs=1 skip=64 if=ramdisk.img of=ramdisk-no-header.img
unpack the image
mkdir ramdisk && cd ramdisk
cpio -i --no-absolute-filenames < ../ramdisk-no-header.img
patch charger to use /misc/charging.png for _every_ charging image :sweat_smile:
sed -i 's,/res/images/%s.png,/misc/charging.png,' charger
pack it up and recreate the image
shopt -s dotglob
find . | cpio -H newc -o > ../ramdisk.cpio
mkimage -A arm -O linux -T ramdisk -n "Initial RAM Disk" -d ../ramdisk.cpio ../ramdisk.img.new
based on
https://boundarydevices.com/hacking-ram-disks/
---
if I decide to use this will need to copy charging.png and patched-ramdisk.img (as ramdisk.img) to /.system/rg35xx/dat

View file

@ -1,4 +1,4 @@
FROM debian:buster-slim
FROM debian/eol:buster-slim
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=America/New_York

View file

@ -16,7 +16,7 @@ NORM=$(shell tput sgr0)
ifeq ($(CONTAINER_NAME),)
shell: .build
$(info $(BOLD)Starting $(TOOLCHAIN_NAME)...$(NORM))
docker run -it --rm -v "$(WORKSPACE_DIR)":/root/workspace $(TOOLCHAIN_NAME) /bin/bash
docker run -it --rm -v "$(WORKSPACE_DIR)":/root/workspace $(TOOLCHAIN_NAME) /bin/bash -c "git config --global --add safe.directory '*' && exec bash"
else
shell:
$(info $(BOLD)Connecting to running $(TOOLCHAIN_NAME)...$(NORM))