diff --git a/README.md b/README.md index 04f0094..2d20e70 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/cores/makefile b/cores/makefile index 15aa89c..14f9d01 100644 --- a/cores/makefile +++ b/cores/makefile @@ -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 diff --git a/cores/patches/fake-08.patch b/cores/patches/fake-08.patch new file mode 100755 index 0000000..dff15be --- /dev/null +++ b/cores/patches/fake-08.patch @@ -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; + } diff --git a/cores/patches/mame2003-plus.patch b/cores/patches/mame2003-plus.patch new file mode 100644 index 0000000..fa90ad4 --- /dev/null +++ b/cores/patches/mame2003-plus.patch @@ -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 diff --git a/cores/patches/race.patch b/cores/patches/race.patch new file mode 100644 index 0000000..bf1af3d --- /dev/null +++ b/cores/patches/race.patch @@ -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 diff --git a/install-release.sh b/install-release.sh new file mode 100755 index 0000000..85e370a --- /dev/null +++ b/install-release.sh @@ -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 diff --git a/makefile b/makefile index ac81fb2..7d19f19 100644 --- a/makefile +++ b/makefile @@ -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) -ifeq (,$(BUILD_HASH)) -BUILD_HASH="devRelease" +#in case BUILD_HASH is empty, put something to avoid crashing +ifeq (,$(BUILD_HASH)) +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 diff --git a/skeleton/EXTRAS/Roms/Game Gear (GG)/.keep b/skeleton/EXTRAS/Bios/MAME/.keep similarity index 100% rename from skeleton/EXTRAS/Roms/Game Gear (GG)/.keep rename to skeleton/EXTRAS/Bios/MAME/.keep diff --git a/skeleton/EXTRAS/Emus/rg35xx/GG.pak/default.cfg b/skeleton/EXTRAS/Emus/rg35xx/GG.pak/default.cfg index 393096e..2f3f583 100644 --- a/skeleton/EXTRAS/Emus/rg35xx/GG.pak/default.cfg +++ b/skeleton/EXTRAS/Emus/rg35xx/GG.pak/default.cfg @@ -17,4 +17,4 @@ bind Left = LEFT bind Right = RIGHT bind Button 1 = B bind Button 2 = A -bind Pause = START \ No newline at end of file +bind Pause = START diff --git a/skeleton/EXTRAS/Emus/rg35xx/MAME.pak/default.cfg b/skeleton/EXTRAS/Emus/rg35xx/MAME.pak/default.cfg new file mode 100644 index 0000000..0b21787 --- /dev/null +++ b/skeleton/EXTRAS/Emus/rg35xx/MAME.pak/default.cfg @@ -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 diff --git a/skeleton/EXTRAS/Emus/rg35xx/MAME.pak/launch.sh b/skeleton/EXTRAS/Emus/rg35xx/MAME.pak/launch.sh new file mode 100755 index 0000000..a776940 --- /dev/null +++ b/skeleton/EXTRAS/Emus/rg35xx/MAME.pak/launch.sh @@ -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" diff --git a/skeleton/EXTRAS/Emus/rg35xx/NGP.pak/default.cfg b/skeleton/EXTRAS/Emus/rg35xx/NGP.pak/default.cfg new file mode 100644 index 0000000..bed4529 --- /dev/null +++ b/skeleton/EXTRAS/Emus/rg35xx/NGP.pak/default.cfg @@ -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 diff --git a/skeleton/EXTRAS/Emus/rg35xx/NGP.pak/launch.sh b/skeleton/EXTRAS/Emus/rg35xx/NGP.pak/launch.sh new file mode 100755 index 0000000..8e16b89 --- /dev/null +++ b/skeleton/EXTRAS/Emus/rg35xx/NGP.pak/launch.sh @@ -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" diff --git a/skeleton/EXTRAS/Emus/rg35xx/NGPC.pak/default.cfg b/skeleton/EXTRAS/Emus/rg35xx/NGPC.pak/default.cfg new file mode 100644 index 0000000..7f86f8e --- /dev/null +++ b/skeleton/EXTRAS/Emus/rg35xx/NGPC.pak/default.cfg @@ -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 diff --git a/skeleton/EXTRAS/Emus/rg35xx/NGPC.pak/launch.sh b/skeleton/EXTRAS/Emus/rg35xx/NGPC.pak/launch.sh new file mode 100755 index 0000000..8e16b89 --- /dev/null +++ b/skeleton/EXTRAS/Emus/rg35xx/NGPC.pak/launch.sh @@ -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" diff --git a/skeleton/EXTRAS/Emus/rg35xx/P8.pak/default.cfg b/skeleton/EXTRAS/Emus/rg35xx/P8.pak/default.cfg new file mode 100644 index 0000000..d74bfc7 --- /dev/null +++ b/skeleton/EXTRAS/Emus/rg35xx/P8.pak/default.cfg @@ -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 diff --git a/skeleton/EXTRAS/Emus/rg35xx/P8.pak/launch.sh b/skeleton/EXTRAS/Emus/rg35xx/P8.pak/launch.sh new file mode 100755 index 0000000..aac8158 --- /dev/null +++ b/skeleton/EXTRAS/Emus/rg35xx/P8.pak/launch.sh @@ -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" diff --git a/skeleton/EXTRAS/Roms/Master System (SMS)/.keep b/skeleton/EXTRAS/Roms/Arcade (MAME)/.keep similarity index 100% rename from skeleton/EXTRAS/Roms/Master System (SMS)/.keep rename to skeleton/EXTRAS/Roms/Arcade (MAME)/.keep diff --git a/skeleton/EXTRAS/Roms/Neo Geo Pocket Color (NGPC)/.keep b/skeleton/EXTRAS/Roms/Neo Geo Pocket Color (NGPC)/.keep new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/EXTRAS/Roms/Pico-8 (P8)/.keep b/skeleton/EXTRAS/Roms/Pico-8 (P8)/.keep new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/EXTRAS/Roms/Sega Game Gear (GG)/.keep b/skeleton/EXTRAS/Roms/Sega Game Gear (GG)/.keep new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/EXTRAS/Roms/Sega Master System (SMS)/.keep b/skeleton/EXTRAS/Roms/Sega Master System (SMS)/.keep new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/EXTRAS/Roms/aliases.txt b/skeleton/EXTRAS/Roms/aliases.txt new file mode 100644 index 0000000..204a303 --- /dev/null +++ b/skeleton/EXTRAS/Roms/aliases.txt @@ -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 diff --git a/skeleton/EXTRAS/Saves/MAME/.keep b/skeleton/EXTRAS/Saves/MAME/.keep new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/EXTRAS/Saves/P8/.keep b/skeleton/EXTRAS/Saves/P8/.keep new file mode 100644 index 0000000..e69de29 diff --git a/skeleton/SYSTEM/rg35xx/paks/Emus/SFC.pak/default.cfg b/skeleton/SYSTEM/rg35xx/paks/Emus/SFC.pak/default.cfg index 3b5568c..6f3b92d 100644 --- a/skeleton/SYSTEM/rg35xx/paks/Emus/SFC.pak/default.cfg +++ b/skeleton/SYSTEM/rg35xx/paks/Emus/SFC.pak/default.cfg @@ -1,4 +1,3 @@ -minarch_cpu_speed = Powersave minarch_prevent_tearing = Strict bind Up = UP diff --git a/skeleton/SYSTEM/rg35xx/paks/MinUI.pak/launch.sh b/skeleton/SYSTEM/rg35xx/paks/MinUI.pak/launch.sh index bf76d21..0eaae24 100755 --- a/skeleton/SYSTEM/rg35xx/paks/MinUI.pak/launch.sh +++ b/skeleton/SYSTEM/rg35xx/paks/MinUI.pak/launch.sh @@ -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" ####################################### diff --git a/src/clear_recent/makefile b/src/clear_recent/makefile index 5fbc76d..c0d01f9 100644 --- a/src/clear_recent/makefile +++ b/src/clear_recent/makefile @@ -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) diff --git a/src/clock/makefile b/src/clock/makefile index 71c416d..0497d92 100644 --- a/src/clock/makefile +++ b/src/clock/makefile @@ -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) diff --git a/src/common/api.c b/src/common/api.c index c816c16..212cbed 100644 --- a/src/common/api.c +++ b/src/common/api.c @@ -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); @@ -441,7 +442,12 @@ SDL_Surface* GFX_init(int mode) { font.medium = TTF_OpenFont(FONT_PATH, SCALE1(FONT_MEDIUM)); 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; } @@ -716,8 +722,8 @@ void GFX_blitClockAndBattery(SDL_Surface* dst, SDL_Rect* dst_rect) { clip.y = 0; GFX_blitAsset(percent<=20?ASSET_BATTERY_FILL_LOW:ASSET_BATTERY_FILL, &clip, dst, &(SDL_Rect){x+SCALE1(3)+clip.x,y+SCALE1(2)}); - } - + } + // Get the current time time_t currentTime = time(NULL); struct tm* timeinfo = localtime(¤tTime); @@ -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 POW_readBatteryStatus(void) { + #define READ_VOLTAGE 1 - int battery = BATTERY_2600MAH; // Default - int battery_txt = getInt(BATTERY_PATH); - if (battery_txt > 0) { - battery = battery_txt; - } - - int voltage_now = getInt("/sys/class/power_supply/battery/voltage_now"); - - if (battery == BATTERY_2100MAH) { + if (READ_VOLTAGE > 0) { + int voltage_now = getInt("/sys/class/power_supply/battery/voltage_now"); 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,22 +1552,20 @@ 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); - GFX_blitMessage(font.large, msg, gfx.screen, NULL); - GFX_flip(gfx.screen); - - system("sync"); - system("echo s > /proc/sysrq-trigger"); - system("echo u > /proc/sysrq-trigger"); - system("sync"); - - sleep(2); -} 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"; - POW_sync(msg); + GFX_blitMessage(font.large, msg, gfx.screen, NULL); + GFX_flip(gfx.screen); + + system("sync"); + system("echo s > /proc/sysrq-trigger"); + system("echo u > /proc/sysrq-trigger"); + system("sync"); + + sleep(2); // 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) { diff --git a/src/common/defines.h b/src/common/defines.h index c8c405c..9dbb8e3 100644 --- a/src/common/defines.h +++ b/src/common/defines.h @@ -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" diff --git a/src/common/utils.c b/src/common/utils.c index 901ac27..b222a55 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -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 diff --git a/src/dts/kernel.dts b/src/dts/kernel.dts new file mode 100644 index 0000000..0c98417 --- /dev/null +++ b/src/dts/kernel.dts @@ -0,0 +1,1463 @@ +/dts-v1/; + +/ { + #address-cells = <0x01>; + #size-cells = <0x01>; + compatible = "actions,gs705a\0actions,atm7059a"; + interrupt-parent = <0x01>; + model = "Actions GS705A board"; + + chosen { + bootargs = "earlyprintk clk_ignore_unused selinux=0"; + }; + + aliases { + serial0 = "/serial@b0120000"; + serial1 = "/serial@b0122000"; + serial2 = "/serial@b0124000"; + serial3 = "/serial@b0126000"; + serial4 = "/serial@b0128000"; + serial5 = "/serial@b012a000"; + serial6 = "/serial@b012c000"; + i2c0 = "/i2c@b0170000"; + i2c1 = "/i2c@b0174000"; + i2c2 = "/i2c@b0178000"; + i2c3 = "/i2c@b017c000"; + spi0 = "/spi@b0200000"; + spi1 = "/spi@b0204000"; + spi2 = "/spi@b0208000"; + spi3 = "/spi@b020c000"; + dcdc1 = "/i2c@b0174000/atc2603c@65/dcdc1"; + dcdc2 = "/i2c@b0174000/atc2603c@65/dcdc2"; + dcdc3 = "/i2c@b0174000/atc2603c@65/dcdc3"; + dcdc4 = "/i2c@b0174000/atc2603c@65/dcdc4"; + ldo1 = "/i2c@b0174000/atc2603c@65/ldo1"; + ldo2 = "/i2c@b0174000/atc2603c@65/ldo2"; + ldo3 = "/i2c@b0174000/atc2603c@65/ldo3"; + ldo4 = "/i2c@b0174000/atc2603c@65/ldo4"; + ldo5 = "/i2c@b0174000/atc2603c@65/ldo5"; + ldo6 = "/i2c@b0174000/atc2603c@65/ldo6"; + ldo7 = "/i2c@b0174000/atc2603c@65/ldo7"; + ldo8 = "/i2c@b0174000/atc2603c@65/ldo8"; + ldo9 = "/i2c@b0174000/atc2603c@65/ldo9"; + ldo10 = "/i2c@b0174000/atc2603c@65/ldo10"; + ldo11 = "/i2c@b0174000/atc2603c@65/ldo11"; + switch1 = "/i2c@b0174000/atc2603c@65/switch1"; + switch2 = "/i2c@b0174000/atc2603c@65/switch2"; + isp0 = "/isp@b0270000"; + sdboot = "/mmc@b0230000"; + mmc0 = "/mmc@b0230000"; + mmc1 = "/mmc@b0234000"; + mmc2 = "/mmc@b0238000"; + usb0 = "/usb@b0600000"; + usb1 = "/usb@b0700000"; + }; + + memory { + device_type = "memory"; + reg = <0x00 0x00>; + }; + + cpus { + #size-cells = <0x00>; + #address-cells = <0x01>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0x00>; + transition-latency = <0xee6c>; + cpuvdd-supply = <0x02>; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0x01>; + }; + }; + + interrupt-controller@b0021000 { + compatible = "arm,cortex-a9-gic"; + interrupt-controller; + #interrupt-cells = <0x03>; + reg = <0xb0021000 0x1000 0xb0020100 0x100>; + linux,phandle = <0x01>; + phandle = <0x01>; + }; + + pmu { + compatible = "arm,cortex-a9-pmu"; + interrupts = <0x00 0x04 0x04 0x00 0x05 0x04 0x00 0x06 0x04 0x00 0x07 0x04>; + }; + + cache-controller@b0022000 { + compatible = "arm,pl310-cache"; + reg = <0xb0022000 0x1000>; + cache-unified; + cache-level = <0x02>; + interrupts = <0x00 0x37 0x04>; + arm,tag-latency = <0x03 0x03 0x02>; + arm,data-latency = <0x05 0x03 0x03>; + }; + + twd-watchdog@b0020600 { + compatible = "actions,atm7059-wdt"; + reg = <0xb0020600 0x100 0xb0160000 0x20>; + interrupts = <0x01 0x0e 0xf01>; + wd_type = "soft"; + status = "disabled"; + }; + + serial@b0120000 { + compatible = "actions,owl-uart\0actions,owl-uart-irc"; + reg = <0xb0120000 0x2000>; + interrupts = <0x00 0x1d 0x04>; + clock-frequency = <0x2dc6c00>; + pinctrl-names = "default"; + pinctrl-0 = <0x03>; + status = "okay"; + }; + + serial@b0122000 { + compatible = "actions,owl-uart"; + reg = <0xb0122000 0x2000>; + interrupts = <0x00 0x1e 0x04>; + clock-frequency = <0x2dc6c00>; + pinctrl-names = "default"; + pinctrl-0 = <0x04>; + status = "disabled"; + }; + + serial@b0124000 { + compatible = "actions,owl-uart"; + reg = <0xb0124000 0x2000>; + interrupts = <0x00 0x1f 0x04>; + clock-frequency = <0x2dc6c00>; + pinctrl-names = "default"; + pinctrl-0 = <0x05>; + status = "disabled"; + }; + + serial@b0126000 { + compatible = "actions,owl-uart"; + reg = <0xb0126000 0x2000>; + interrupts = <0x00 0x20 0x04>; + clock-frequency = <0x2dc6c00>; + pinctrl-names = "default"; + pinctrl-0 = <0x06>; + status = "okay"; + }; + + serial@b0128000 { + compatible = "actions,owl-uart"; + reg = <0xb0128000 0x2000>; + interrupts = <0x00 0x21 0x04>; + clock-frequency = <0x2dc6c00>; + pinctrl-names = "default"; + pinctrl-0 = <0x07>; + status = "disabled"; + }; + + serial@b012a000 { + compatible = "actions,owl-uart"; + reg = <0xb012a000 0x2000>; + interrupts = <0x00 0x22 0x04>; + clock-frequency = <0x2dc6c00>; + status = "okay"; + }; + + serial@b012c000 { + compatible = "actions,owl-uart"; + reg = <0xb012c000 0x2000>; + interrupts = <0x00 0x23 0x04>; + clock-frequency = <0x2dc6c00>; + pinctrl-names = "default"; + pinctrl-0 = <0x08>; + status = "disabled"; + }; + + i2c@b0170000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-i2c"; + reg = <0xb0170000 0x4000>; + interrupts = <0x00 0x19 0x04>; + }; + + i2c@b0174000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-i2c"; + reg = <0xb0174000 0x4000>; + interrupts = <0x00 0x1a 0x04>; + i2c_num = <0x01>; + clock-frequency = <0x61a80>; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <0x09>; + + atc2603c@65 { + compatible = "actions,atc2603c"; + reg = <0x65>; + interrupt-parent = <0x0a>; + interrupts = <0x02 0x04>; + interrupt-controller; + #interrupt-cells = <0x01>; + losc_32k_output_enable = <0x01>; + losc_32k_output_voltage = <0x1f>; + + pm { + compatible = "actions,atc2603c-pm"; + }; + + onoff { + compatible = "actions,atc2603c-onoff"; + }; + + atc260x-pwm { + compatible = "actions,atc2603c-pwm"; + }; + + rtc { + compatible = "actions,atc2603c-rtc"; + }; + + atc260x_gpio { + compatible = "actions,atc2603c-gpio"; + gpio-controller; + #gpio-cells = <0x02>; + }; + + atc260x_sgpio { + compatible = "actions,atc2603c-sgpio"; + gpio-controller; + #gpio-cells = <0x02>; + interrupt-controller; + #interrupt-cells = <0x02>; + linux,phandle = <0x1f>; + phandle = <0x1f>; + }; + + atc260x-adckeypad { + keymapsize = <0x04>; + filter_dep = <0x03>; + variance = <0x0a>; + poll_interval = <0x0a>; + left_adc_val = <0x00 0x5a 0xaf 0x10e>; + right_adc_val = <0x1e 0x78 0xdc 0x140>; + key_val = <0x66 0x8b 0x73 0x72>; + adc_channel_name = "AUX0"; + compatible = "actions,atc2603c-adckeypad"; + status = "disabled"; + }; + + atc260x-audio { + compatible = "actions,atc2603c-audio"; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <0x0b>; + earphone_detect_gpios = <0x0c 0x1c 0x00>; + earphone_detect2_gpios = <0x0c 0x51 0x01>; + speaker_en_gpios = <0x0c 0x28 0x01>; + earphone_output_mode = <0x01>; + mic_num = <0x01>; + mic0_gain = <0x07 0x07>; + speaker_gain = <0xb4 0xb4>; + earphone_gain = <0xbe 0xbe>; + mic_mode = <0x01>; + earphone_detect_method = <0x03>; + }; + + atc260x-hwmon { + compatible = "actions,atc2603c-hwmon"; + }; + + atc260x-power { + compatible = "actions,atc2603c-power"; + bl_on_usb_pc_max_charge_current = <0x64>; + bl_off_usb_pc_max_charge_current = <0x1f4>; + bl_on_usb_adp_max_charge_current = <0x3e8>; + bl_off_usb_adp_max_charge_current = <0x4b0>; + bl_on_wall_adp_max_charge_current = <0x3e8>; + bl_off_wall_adp_max_charge_current = <0x4b0>; + bl_on_voltage_diff = <0x15e>; + bl_off_voltage_diff = <0x190>; + support_adaptor_type = <0x01>; + usb_adapter_as_ac = <0x00>; + boot_cap_threshold = <0x00>; + ext_dcdc_exist = <0x00>; + pwms = <0x0d 0x02 0x7a120 0x01>; + pwm-names = "ext_moto"; + moto_pwm_gpio = <0x0c 0x27 0x01>; + ext_charger_exist = <0x00>; + charger_led_exist = <0x01>; + charger_led_ctl = <0x0c 0x16 0x00>; + charger_led2_ctl = <0x0c 0x4e 0x00>; + low_power_led_ctl = <0x0c 0x15 0x01>; + low_power_led2_ctl = <0x0c 0x4f 0x01>; + work_led_ctl = <0x0c 0x12 0x01>; + work_led2_ctl = <0x0c 0x50 0x01>; + myotg_id = <0x0c 0x6a 0x00>; + otg_1_ctl = <0x0c 0x17 0x00>; + otg_2_ctl = <0x0c 0x5f 0x00>; + no_screen = <0x01>; + temp_ctl_enable = <0x00>; + temp_shutdown_low = <0x3ed>; + temp_stop_low = <0x00>; + temp_shutdown_high = <0x32>; + temp_stop_high = <0x2d>; + temp_diff_restart = <0x02>; + }; + + atc260x-cap-gauge { + compatible = "actions,atc2603c-cap-gauge"; + icm_available = <0x01>; + icm_ohm_val = <0x14>; + taper_voltage = <0x1068>; + taper_current = <0x12c>; + min_over_chg_protect_voltage = <0x10b3>; + ch_resistor = <0x78>; + disch_resistor = <0xb4>; + terminal_voltage = <0xc80>; + suspend_current = <0x578>; + shutdown_current = <0x32>; + print_switch = <0x00>; + log_switch = <0x00>; + capacity = <0xa28>; + ocv_soc_00 = <0xc5c 0xc7f 0xc96 0xc9c 0xca8 0xccb 0xce2 0xce8 0xcee 0xcfa>; + ocv_soc_10 = <0xd05 0xd0b 0xd11 0xd17 0xd23 0xd29 0xd2f 0xd34 0xd3a 0xd46>; + ocv_soc_20 = <0xd4c 0xd52 0xd58 0xd63 0xd69 0xd6f 0xd75 0xd7b 0xd86 0xd8c>; + ocv_soc_30 = <0xd92 0xd98 0xda4 0xdaa 0xdaf 0xdb5 0xdbb 0xdc7 0xdcd 0xdd3>; + ocv_soc_40 = <0xdd8 0xde4 0xdea 0xdf0 0xdf6 0xdfc 0xe07 0xe0d 0xe13 0xe19>; + ocv_soc_50 = <0xe25 0xe2a 0xe36 0xe42 0xe48 0xe53 0xe59 0xe5f 0xe65 0xe6b>; + ocv_soc_60 = <0xe77 0xe7c 0xe82 0xe8e 0xe9a 0xea0 0xea6 0xeab 0xeb1 0xebd>; + ocv_soc_70 = <0xec3 0xec9 0xecf 0xee0 0xee6 0xeec 0xef2 0xef8 0xf0f 0xf15>; + ocv_soc_80 = <0xf1b 0xf21 0xf38 0xf3e 0xf44 0xf4a 0xf4f 0xf61 0xf67 0xf6d>; + ocv_soc_90 = <0xf73 0xf84 0xf8a 0xf90 0xfad 0xfb3 0xfbf 0xfc5 0xfdc 0xfe2>; + }; + + atc260x-backup { + compatible = "actions,atc2603c-backup"; + status = "disabled"; + }; + + dcdc1 { + compatible = "actions,atc2603c-dcdc1\0actions,atc2603c-dcdc"; + regulator-name = "dcdc1"; + regulator-min-microvolt = <0xaae60>; + regulator-max-microvolt = <0x155cc0>; + regulator-always-on; + linux,phandle = <0x02>; + phandle = <0x02>; + }; + + dcdc2 { + compatible = "actions,atc2603c-dcdc2\0actions,atc2603c-dcdc"; + regulator-name = "dcdc2"; + regulator-min-microvolt = <0x13d620>; + regulator-max-microvolt = <0x2191c0>; + regulator-always-on; + }; + + dcdc3 { + compatible = "actions,atc2603c-dcdc3\0actions,atc2603c-dcdc"; + regulator-name = "dcdc3"; + regulator-min-microvolt = <0x27ac40>; + regulator-max-microvolt = <0x325aa0>; + regulator-always-on; + }; + + dcdc4 { + status = "disabled"; + }; + + dcdc5 { + status = "disabled"; + }; + + ldo1 { + compatible = "actions,atc2603c-ldo1\0actions,atc2603c-ldo"; + regulator-name = "ldo1"; + regulator-min-microvolt = <0x2ab980>; + regulator-max-microvolt = <0x2ab980>; + regulator-always-on; + }; + + ldo2 { + compatible = "actions,atc2603c-ldo2\0actions,atc2603c-ldo"; + regulator-name = "ldo2"; + regulator-min-microvolt = <0x27ac40>; + regulator-max-microvolt = <0x325aa0>; + regulator-always-on; + }; + + ldo3 { + compatible = "actions,atc2603c-ldo3\0actions,atc2603c-ldo"; + regulator-name = "ldo3"; + regulator-min-microvolt = <0x16e360>; + regulator-max-microvolt = <0x1e8480>; + regulator-always-on; + }; + + ldo4 { + status = "disabled"; + }; + + ldo5 { + compatible = "actions,atc2603c-ldo5\0actions,atc2603c-ldo"; + regulator-name = "ldo5"; + regulator-min-microvolt = <0x2f4d60>; + regulator-max-microvolt = <0x325aa0>; + regulator-suspend-off; + }; + + ldo6 { + compatible = "actions,atc2603c-ldo6\0actions,atc2603c-ldo"; + regulator-name = "ldo6"; + regulator-min-microvolt = <0xaae60>; + regulator-max-microvolt = <0x155cc0>; + regulator-always-on; + }; + + ldo7 { + compatible = "actions,atc2603c-ldo7\0actions,atc2603c-ldo"; + regulator-name = "ldo7"; + regulator-min-microvolt = <0x1b7740>; + regulator-max-microvolt = <0x1b7740>; + regulator-suspend-off; + }; + + ldo8 { + compatible = "actions,atc2603c-ldo8\0actions,atc2603c-ldo"; + regulator-name = "ldo8"; + regulator-min-microvolt = <0x231860>; + regulator-max-microvolt = <0x325aa0>; + }; + + ldo9 { + status = "disabled"; + }; + + ldo10 { + status = "disabled"; + }; + + ldo11 { + compatible = "actions,atc2603c-ldo11\0actions,atc2603c-ldo"; + regulator-name = "ldo11"; + regulator-min-microvolt = <0x27ac40>; + regulator-max-microvolt = <0x325aa0>; + regulator-always-on; + }; + + switch1 { + compatible = "actions,atc2603c-switch1\0actions,atc2603c-switch"; + regulator-name = "switch1"; + regulator-min-microvolt = <0x2f4d60>; + regulator-max-microvolt = <0x325aa0>; + regulator-always-on; + }; + + switch2 { + status = "disabled"; + }; + }; + }; + + i2c@b0178000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-i2c"; + reg = <0xb0178000 0x4000>; + interrupts = <0x00 0x1b 0x04>; + i2c_num = <0x02>; + clock-frequency = <0x61a80>; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <0x0e>; + linux,phandle = <0x1d>; + phandle = <0x1d>; + + hdmi_read_edid@30 { + compatible = "actions,hdmi_read_edid"; + reg = <0x30>; + }; + }; + + i2c@b017c000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-i2c"; + reg = <0xb017c000 0x4000>; + interrupts = <0x00 0x1c 0x04>; + i2c_num = <0x03>; + clock-frequency = <0x61a80>; + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <0x0f>; + + eg2801_eeprom@14 { + compatible = "actions,eg2801_eeprom"; + reg = <0x14>; + }; + + eg2801_ram@55 { + compatible = "actions,eg2801_ram"; + reg = <0x55>; + }; + }; + + spi@b0200000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-spi"; + reg = <0xb0200000 0x4000>; + interrupts = <0x00 0x13 0x04>; + status = "disabled"; + }; + + spi@b0204000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-spi"; + reg = <0xb0204000 0x4000>; + interrupts = <0x00 0x14 0x04>; + status = "disabled"; + }; + + spi@b0208000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-spi"; + reg = <0xb0208000 0x4000>; + interrupts = <0x00 0x15 0x04>; + }; + + spi@b020c000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-spi"; + reg = <0xb020c000 0x4000>; + interrupts = <0x00 0x16 0x04>; + }; + + gpio@b01b0000 { + compatible = "actions,atm7059a-gpio"; + reg = <0xb01b0000 0x40>; + interrupts = <0x00 0x24 0x04 0x00 0x25 0x04 0x00 0x26 0x04 0x00 0x27 0x04 0x00 0x28 0x04>; + #gpio-cells = <0x02>; + gpio-controller; + #interrupt-cells = <0x02>; + interrupt-controller; + status = "okay"; + linux,phandle = <0x0c>; + phandle = <0x0c>; + }; + + sirq@b01b0200 { + compatible = "actions,owl-sirq"; + reg = <0xb01b0200 0x04>; + interrupts = <0x00 0x0d 0x04 0x00 0x0e 0x04 0x00 0x0f 0x04>; + #interrupt-cells = <0x02>; + interrupt-controller; + linux,phandle = <0x0a>; + phandle = <0x0a>; + }; + + pwm@b01b0050 { + compatible = "actions,atm7059a-pwm"; + reg = <0xb01b0050 0x10>; + #pwm-cells = <0x03>; + linux,phandle = <0x0d>; + phandle = <0x0d>; + + pwm0 { + id = <0x00>; + pinctrl-names = "default"; + pinctrl-0 = <0x10>; + }; + + pwm1 { + id = <0x01>; + pinctrl-names = "default"; + pinctrl-0 = <0x11>; + }; + + pwm2 { + id = <0x02>; + pinctrl-names = "default"; + pinctrl-0 = <0x12>; + }; + + pwm3 { + id = <0x03>; + pinctrl-names = "default"; + pinctrl-0 = <0x13>; + }; + }; + + ethernet@b0310000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-ethernet"; + reg = <0xb0310000 0x10000>; + }; + + mmc@b0230000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-mmc"; + reg = <0xb0230000 0x38>; + pinctrl-names = "default\0share_uart2_5"; + pinctrl-0 = <0x14>; + pinctrl-1 = <0x15>; + card_type = "memory"; + card_detect_mode = "gpio"; + card_detect_gpios = <0x0c 0x29 0x00>; + interrupts = <0x00 0x2a 0x04>; + status = "okay"; + sd_vcc = "switch1"; + sdio3_0_not_supported; + }; + + mmc@b0234000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-mmc"; + reg = <0xb0234000 0x38>; + interrupts = <0x00 0x2b 0x04>; + pinctrl-names = "default"; + pinctrl-0 = <0x16>; + card_type = "wifi"; + status = "disabled"; + }; + + mmc@b0238000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-mmc"; + reg = <0xb0238000 0x38>; + interrupts = <0x00 0x2c 0x04>; + pinctrl-names = "default"; + pinctrl-0 = <0x17>; + card_type = "memory"; + card_detect_mode = "command"; + status = "okay"; + }; + + usb@b0600000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-usb-2.0-0"; + reg = <0xb0600000 0x1000>; + interrupts = <0x00 0x18 0x04>; + status = "disabled"; + }; + + usb@b0700000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,owl-usb-2.0-1"; + reg = <0xb0700000 0x1000>; + interrupts = <0x00 0x3d 0x04>; + status = "disabled"; + }; + + usb@b0400000 { + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "actions,atm7059tc-usb"; + reg = <0xb0400000 0xcd00 0xb040cd00 0x59>; + interrupts = <0x00 0x17 0x04>; + usb_serialnumber_config = <0x01>; + usb_hs_output_strength = <0x02>; + status = "okay"; + }; + + isp@b0270000 { + #address-cells = <0x01>; + #size-cells = <0x01>; + compatible = "actions,owl-isp"; + reg = <0xb0270000 0x400 0xb0160020 0x04>; + interrupts = <0x00 0x0c 0x04>; + avdd-src = "regulator"; + avdd-regulator = "ldo1"; + avdd-regulator-scope = <0x2ab980 0x2ae090>; + dvdd-gpios = <0x0c 0x39 0x00>; + sensors = "rear"; + pwdn-rear-gpios = <0x0c 0x49 0x00>; + pwdn-front-gpios = <0x0c 0x46 0x00>; + rear-reset-gpios = <0x0c 0x72 0x01>; + status = "disabled"; + linux,phandle = <0x1c>; + phandle = <0x1c>; + }; + + pinctrl@b01b0040 { + compatible = "actions,atm7059a-pinctrl"; + pinctrl-names = "default"; + pinctrl-0 = <0x18>; + + pinctrl_default { + linux,phandle = <0x18>; + phandle = <0x18>; + }; + + serial0_default { + + serial_0 { + actions,groups = "mfp2_2_0\0mfp3_21_19"; + actions,function = "uart0"; + }; + }; + + serial0_d { + linux,phandle = <0x03>; + phandle = <0x03>; + + serial_d { + actions,groups = "mfp2_22\0mfp2_23"; + actions,function = "uart0"; + }; + }; + + serial1_default { + linux,phandle = <0x04>; + phandle = <0x04>; + + serial_1 { + actions,groups = "mfp2_13_11"; + actions,function = "uart1"; + }; + }; + + serial2_default { + linux,phandle = <0x05>; + phandle = <0x05>; + + serial_2 { + actions,groups = "mfp2_23\0mfp2_22\0uart2_dummy"; + actions,function = "uart2"; + }; + }; + + serial3_default { + linux,phandle = <0x06>; + phandle = <0x06>; + + serial_3 { + actions,groups = "mfp2_21\0mfp2_20\0uart3_dummy"; + actions,function = "uart3"; + }; + }; + + serial4_default { + linux,phandle = <0x07>; + phandle = <0x07>; + + serial_4 { + actions,groups = "uart4_dummy"; + actions,function = "uart4"; + }; + }; + + serial5_default { + + serial_5 { + actions,groups = "mfp2_19_17\0mfp2_16_14"; + actions,function = "uart5"; + }; + }; + + serial6_default { + linux,phandle = <0x08>; + phandle = <0x08>; + + serial_6 { + actions,groups = "mfp0_18_16_eth_txd0\0mfp0_18_16_eth_txd1"; + actions,function = "uart6"; + }; + }; + + ethernet_default { + + ethernet_smi { + actions,groups = "eth_smi_dummy"; + actions,function = "eth_rmii"; + }; + + ethernet_rmii_txd01 { + actions,groups = "mfp0_18_16_eth_txd0\0mfp0_18_16_eth_txd1"; + actions,function = "eth_rmii"; + }; + + ethernet_rmii_txen_rxer { + actions,groups = "mfp0_15_13_rmii_txen\0mfp0_15_13_rmii_rxen"; + actions,function = "eth_rmii"; + }; + + ethernet_rmii_crs_dv { + actions,groups = "mfp0_22_20"; + actions,function = "eth_rmii"; + }; + + ethernet_rmii_rxd10 { + actions,groups = "mfp0_10_8_rmii_rxd1\0mfp0_10_8_rmii_rxd0"; + actions,function = "eth_rmii"; + }; + + ethernet_rmii_ref_clk { + actions,groups = "mfp0_7_6"; + actions,function = "eth_rmii"; + }; + }; + + mmc_share_uart { + linux,phandle = <0x15>; + phandle = <0x15>; + + sd0_mfp_cmd_clk { + actions,groups = "mfp2_8_7\0mfp2_6_5"; + actions,function = "sd0"; + }; + + sd0_pull_d0_d3_cmd { + actions,pins = "P_SD0_CMD"; + actions,pull = <0x02>; + }; + + sd0_pull_clk { + actions,pins = "P_SD0_CLK"; + actions,pull = <0x00>; + }; + + sd0_d0_d3_cmd_clk_paddrv { + actions,groups = "paddrv1_19_18\0paddrv1_17_16"; + actions,paddrv = <0x01>; + }; + + serial_5 { + actions,groups = "mfp2_19_17\0mfp2_16_14"; + actions,function = "uart5"; + }; + }; + + mmc0_default { + linux,phandle = <0x14>; + phandle = <0x14>; + + sd0_mfp_d0_d3_cmd_clk { + actions,groups = "mfp2_19_17\0mfp2_16_14\0mfp2_13_11\0mfp2_8_7\0mfp2_6_5"; + actions,function = "sd0"; + }; + + sd0_pull_d0_d3_cmd { + actions,pins = "P_SD0_D0\0P_SD0_D1\0P_SD0_D2\0P_SD0_D3\0P_SD0_CMD"; + actions,pull = <0x02>; + }; + + sd0_pull_clk { + actions,pins = "P_SD0_CLK"; + actions,pull = <0x00>; + }; + + sd0_d0_d3_cmd_clk_paddrv { + actions,groups = "paddrv1_23_22\0paddrv1_19_18\0paddrv1_17_16"; + actions,paddrv = <0x01>; + }; + }; + + mmc1_default { + linux,phandle = <0x16>; + phandle = <0x16>; + + sd1_mfp_d0_d3_cmd_clk { + actions,groups = "mfp2_10_9\0mfp2_4_3\0sd1_dummy"; + actions,function = "sd1"; + }; + + sd1_pull_d0_d3_cmd { + actions,pins = "P_SD1_D0\0P_SD1_D1\0P_SD1_D2\0P_SD1_D3\0P_SD1_CMD"; + actions,pull = <0x02>; + }; + + sd1_d0_d3_cmd_clk_paddrv { + actions,groups = "paddrv1_21_20\0paddrv1_15_14\0paddrv1_13_12"; + actions,paddrv = <0x01>; + }; + }; + + mmc2_default { + linux,phandle = <0x17>; + phandle = <0x17>; + + sd2_mfp_d0_d3_cmd_clk { + actions,groups = "mfp3_3"; + actions,function = "sd2"; + }; + + sd2_pull_d0_d3_cmd { + actions,pins = "P_DNAND_D0\0P_DNAND_D1\0P_DNAND_D2\0P_DNAND_D3\0P_DNAND_D4\0P_DNAND_D5\0P_DNAND_D6\0P_DNAND_D7\0P_DNAND_RDBN"; + actions,pull = <0x02>; + }; + }; + + isp0_csi_dvp { + linux,phandle = <0x1e>; + phandle = <0x1e>; + + isp0_csi_dvp_mfp { + actions,groups = "mfp3_29_28\0mfp3_23_22\0mfp3_15_14\0mfp3_13_12"; + actions,function = "sens0"; + }; + + sens0_clk_out_pdrv { + actions,groups = "paddrv2_13_12"; + actions,paddrv = <0x00>; + }; + }; + + isp0_csi_mipi { + + isp0_csi_mipi_mfp { + actions,groups = "mfp3_29_28\0mfp3_15_14"; + actions,function = "mipi_csi"; + }; + + isp0_csi_mipi_clkout_mfp { + actions,groups = "mfp3_23_22"; + actions,function = "sens0"; + }; + }; + + spi0_dsi_d { + + spi0_mfp { + actions,groups = "mfp1_9_7\0mfp1_20_19\0mfp1_18_17\0mfp2_26_24"; + actions,function = "spi0"; + }; + + spi0_paddrv { + actions,groups = "paddrv1_25_24"; + actions,paddrv = <0x02>; + }; + }; + + i2c0_default { + + i2c0_default_mfp { + actions,groups = "mfp3_18_16"; + actions,function = "i2c0"; + }; + + i2c0_default_paddrv { + actions,groups = "paddrv2_24_23"; + actions,paddrv = <0x00>; + }; + + i2c0_default_pull_up { + actions,pins = "P_I2C0_SCLK\0P_I2C0_SDATA"; + actions,pull = <0x02>; + }; + }; + + i2c0_over_uart0 { + + i2c0_over_uart0_mfp { + actions,groups = "mfp2_2_0\0mfp3_21_19"; + actions,function = "i2c0"; + }; + + i2c0_over_uart0_paddrv { + actions,groups = "paddrv2_31_30\0paddrv2_29_28"; + actions,paddrv = <0x00>; + }; + + i2c0_over_uart0_pull_up { + actions,pins = "P_UART0_RX\0P_UART0_TX"; + actions,pull = <0x02>; + }; + }; + + i2c1_default { + linux,phandle = <0x09>; + phandle = <0x09>; + + i2c1_default_mfp { + actions,groups = "i2c1_dummy"; + actions,function = "i2c1"; + }; + + i2c1_default_paddrv { + actions,groups = "paddrv2_22_21"; + actions,paddrv = <0x00>; + }; + + i2c1_default_pull_up { + actions,pins = "P_I2C1_SCLK\0P_I2C1_SDATA"; + actions,pull = <0x00>; + }; + }; + + i2c2_default { + linux,phandle = <0x0e>; + phandle = <0x0e>; + + i2c2_default_mfp { + actions,groups = "i2c2_dummy"; + actions,function = "i2c2"; + }; + + i2c2_default_paddrv { + actions,groups = "paddrv2_22_21"; + actions,paddrv = <0x00>; + }; + + i2c2_default_pull_up { + actions,pins = "P_I2C2_SCLK\0P_I2C2_SDATA"; + actions,pull = <0x02>; + }; + }; + + i2c3_over_spi0 { + linux,phandle = <0x0f>; + phandle = <0x0f>; + + i2c3_over_spi0_mfp { + actions,groups = "mfp1_4_3"; + actions,function = "i2c3"; + }; + + i2c3_over_spi0_paddrv { + actions,groups = "paddrv1_11_10"; + actions,paddrv = <0x01>; + }; + + i2c3_over_spi0_pull_up { + actions,pins = "P_SPI0_SCLK\0P_SPI0_MOSI"; + actions,pull = <0x00>; + }; + }; + + spi0_default { + + spi0_mfp { + actions,groups = "mfp1_2_0\0mfp1_4_3"; + actions,function = "spi0"; + }; + }; + + spi2_nand_d { + linux,phandle = <0x1b>; + phandle = <0x1b>; + + spi2_mfp { + actions,groups = "mfp3_2"; + actions,function = "spi2"; + }; + }; + + pwm0_default { + linux,phandle = <0x10>; + phandle = <0x10>; + + pwm0_mfp { + actions,groups = "mfp1_31_29_ks_in2"; + actions,function = "pwm0"; + }; + }; + + pwm1_default { + linux,phandle = <0x11>; + phandle = <0x11>; + + pwm1_mfp { + actions,groups = "mfp1_28_26_ks_in3"; + actions,function = "pwm1"; + }; + }; + + pwm2_default { + linux,phandle = <0x12>; + phandle = <0x12>; + + pwm2_mfp { + actions,groups = "mfp1_28_26_ks_out0"; + actions,function = "pwm2"; + }; + }; + + pwm3_default { + linux,phandle = <0x13>; + phandle = <0x13>; + + pwm3_mfp { + actions,groups = "mfp1_28_26_ks_out1"; + actions,function = "pwm3"; + }; + }; + + lvds_default { + + lvds_mux { + actions,groups = "mfp1_22_21\0mfp1_6_5\0mfp2_28_27"; + actions,function = "lvds"; + }; + }; + + i2s0_default { + linux,phandle = <0x0b>; + phandle = <0x0b>; + + i2s0_default_mfp { + actions,groups = "mfp0_2_1_i2s0\0mfp0_4_3\0mfp0_5"; + actions,function = "i2s0"; + }; + }; + + rgb_default { + linux,phandle = <0x19>; + phandle = <0x19>; + + rgb_mux { + actions,groups = "mfp0_25_23\0mfp1_16_14\0mfp1_22_21\0mfp1_13_12\0mfp1_11_10\0mfp1_6_5\0mfp2_30_29\0mfp2_28_27"; + actions,function = "lcd0"; + }; + }; + + pcm0_spi0 { + + pcm0_spi0_mfp { + actions,groups = "mfp1_2_0\0mfp1_4_3"; + actions,function = "pcm0"; + }; + }; + + dsi_default { + + dsi_mux { + actions,groups = "mfp1_20_19\0mfp1_18_17\0mfp1_13_12\0mfp1_11_10\0mfp1_9_7\0mfp2_30_29"; + actions,function = "dsi"; + }; + }; + }; + + lcd0@b02a0000 { + compatible = "actions,owl-lcd"; + reg = <0xb02a0000 0x20c>; + interrupts = <0x00 0x2d 0x04>; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <0x19>; + lcd_power_gpios = <0x0c 0x24 0x00>; + lcd_reset_gpios = <0x0c 0x23 0x00>; + lcd_spics_gpios = <0x0c 0x11 0x01>; + lcd_spics2_gpios = <0x0c 0x1f 0x01>; + lcd_spiclk_gpios = <0x0c 0x78 0x01>; + lcd_spidat_gpios = <0x0c 0x79 0x01>; + port_type = "rgb"; + data_width = <0x00>; + videomode-0 = <0x1a>; + vsync_inversion = <0x01>; + hsync_inversion = <0x01>; + dclk_inversion = <0x01>; + lde_inversion = <0x00>; + lightness = <0x80>; + saturation = <0x07>; + contrast = <0x05>; + + mode@640x480p60 { + refresh = <0x3c>; + xres = <0x280>; + yres = <0x1e0>; + pixclock = <0xc350>; + left_margin = <0x10>; + right_margin = <0x14>; + upper_margin = <0x0f>; + lower_margin = <0x05>; + hsync_len = <0x1e>; + vsync_len = <0x02>; + vmode = <0x00>; + linux,phandle = <0x1a>; + phandle = <0x1a>; + }; + }; + + dsi@b0220000 { + compatible = "actions,owl-dsi"; + reg = <0xb0220000 0x8c>; + interrupts = <0x00 0x33 0x04>; + status = "disabled"; + }; + + backlight { + compatible = "actions,owl-pwm-backlight"; + pwms = <0x0d 0x00 0xc350 0x00>; + total_steps = <0x400>; + min_brightness = <0x00>; + max_brightness = <0x400>; + dft_brightness = <0x190>; + delay_bf_pwm = <0xc8>; + delay_af_pwm = <0x0a>; + }; + + gpu@b0300000 { + compatible = "actions,atm7039c-gpu"; + reg = <0xb0300000 0x10000>; + interrupts = <0x00 0x03 0x04>; + normal_value = <0x02>; + status = "disabled"; + }; + + vde@b0280000 { + compatible = "actions,atm7059a-vde"; + reg = <0xb0280000 0x108>; + interrupts = <0x00 0x32 0x04>; + }; + + vce@b0288000 { + compatible = "actions,atm7059a-vce"; + reg = <0xb0288000 0x94>; + interrupts = <0x00 0x31 0x04>; + }; + + hdmi@b02c0000 { + compatible = "actions,atm7059a-hdmi"; + reg = <0xb02c0000 0x160>; + status = "okay"; + hdcp_onoff = <0x00>; + channel_invert = <0x00>; + bit_invert = <0x00>; + hotplugable = <0x01>; + bootable = <0x01>; + i2cbus = <0x02>; + bootrotate = <0x00>; + default_resolution = "1280x720p-60"; + }; + + hdmi_cec@b02c011c { + compatible = "actions,atm7059a-hdmi-cec"; + reg = <0xb02c0000 0x160>; + }; + + cvbs@b02b0000 { + compatible = "actions,atm7059a-cvbs"; + reg = <0xb02b0000 0x80>; + default_mode = "PAL"; + status = "disabled"; + }; + + de@b02e0000 { + compatible = "actions,atm7059a-de"; + reg = <0xb02e0000 0x100e 0xb0500108 0x04>; + }; + + nand@b0210000 { + #address-cells = <0x01>; + #size-cells = <0x01>; + compatible = "actions,atm7059a-nand"; + reg = <0xb0210000 0xb4 0xb0160000 0xfc 0xb01b0000 0x90 0xb0260000 0xd00>; + interrupts = <0x00 0x29 0x04>; + }; + + dma@b0260000 { + compatible = "actions,owl-dma"; + reg = <0xb0260000 0xd00>; + interrupts = <0x00 0x39 0x04 0x00 0x3a 0x04 0x00 0x3b 0x04 0x00 0x3c 0x04>; + }; + + thermal { + #address-cells = <0x01>; + #size-cells = <0x01>; + compatible = "actions,atm7059a-thermal"; + reg = <0xb01b00e8 0x08>; + }; + + reserved { + + tiny { + fb_heap_size = <0x09>; + kinfo_heap_size = <0x01>; + carveout_heap_size = <0x00>; + dma_heap_size = <0x20>; + }; + + normal { + fb_heap_size = <0x08>; + kinfo_heap_size = <0x01>; + carveout_heap_size = <0x40>; + dma_heap_size = <0x80>; + }; + }; + + dual_logo { + value = <0x00>; + }; + + spinand@b0208000 { + compatible = "actions,atm7059a-spinand"; + clock-frequency = <0x2faf080>; + pinctrl-names = "default"; + pinctrl-0 = <0x1b>; + status = "disabled"; + }; + + gl5203-audio-i2s { + #address-cells = <0x01>; + #size-cells = <0x01>; + compatible = "actions,owl-audio-i2s"; + reg = <0xb0100000 0x34 0xb0110000 0x8010>; + pcm = <0x00>; + }; + + usb@b02b8000 { + vbus-src = "gpio"; + vbus-regulator = "LDO1"; + regulator-scope = <0x325aa0 0x3567e0>; + status = "disabled"; + }; + + monitor { + compatible = "actions,atm7059tc-usbmonitor"; + detect_type = <0x03>; + idpin_type = <0x00>; + vbus_type = <0x02>; + vbus_otg_en_gpios = <0x0c 0x19 0x00>; + status = "okay"; + }; + + isp-sensor { + compatible = "sensor_common"; + rear_bus_type = "dvp"; + front_bus_type = "dvp"; + rear_data_type = "yuv"; + front_data_type = "yuv"; + host = <0x1c>; + rear_channel = <0x00>; + front_channel = <0x00>; + i2c_adapter = <0x1d>; + pinctrl-names = "default"; + pinctrl-0 = <0x1e>; + status = "disabled"; + }; + + sensor-detect { + compatible = "sensor_detect"; + status = "disabled"; + hot_plugin_enable = <0x00>; + + sensor_detect_list { + gc0308 = <0x01>; + gc0328 = <0x01>; + gc0329 = <0x01>; + gc0312 = <0x01>; + gc2035 = <0x01>; + gc2145 = <0x01>; + gc2155 = <0x01>; + hi708 = <0x01>; + hi257 = <0x01>; + ov2686 = <0x01>; + ov5640 = <0x01>; + sp0718 = <0x01>; + sp0a19 = <0x01>; + sp2519 = <0x01>; + siv121du = <0x01>; + soc5140 = <0x01>; + }; + }; + + matrix_keypad@0 { + compatible = "gpio-matrix-keypad"; + status = "disabled"; + debounce-delay-ms = <0x14>; + col-scan-delay-us = <0x0a>; + row-gpios = <0x0c 0x2d 0x00 0x0c 0x2e 0x00>; + col-gpios = <0x0c 0x32 0x00 0x0c 0x33 0x00 0x0c 0x30 0x00 0x0c 0x2f 0x00>; + linux,keymap = <0x8b 0x1009e 0x2009f 0x30069 0x1000080 0x1010077 0x1020078 0x1030079>; + }; + + framebuffer { + compatible = "actions,framebuffer"; + def_display = "lcd"; + xres = <0x280>; + yres = <0x1e0>; + bpp = <0x04>; + mode = <0x01>; + }; + + vibrator { + compatible = "actions,vibrator"; + status = "disabled"; + }; + + wifi_bt_power_ctl { + compatible = "wifi,bt,power,ctl"; + status = "disabled"; + wifi_bt_power_gpios = <0x1f 0x05 0x00>; + wifi_vol_range = <0x325aa0 0x325aa0>; + wifi_en_gpios = <0x0c 0x5a 0x00>; + bt_en_gpios = <0x0c 0x5b 0x00>; + wifi_wakeup_host_gpios = <0x0c 0x73 0x00>; + }; + + gsensor_detect { + compatible = "owl-gsensor-detect"; + status = "disabled"; + i2c_adapter_id = <0x02>; + + gsensor_detect_list { + compatible = "gsensor_detect_list"; + afa750 = <0x00>; + bma220 = <0x00>; + bma222 = <0x01>; + bma250 = <0x00>; + dmard10 = <0x00>; + kxtj9 = <0x00>; + lis3dh = <0x00>; + mc3210 = <0x00>; + mc3230 = <0x00>; + mc3232 = <0x01>; + mc3236 = <0x01>; + mma7660 = <0x00>; + mma8452 = <0x00>; + stk8312 = <0x01>; + stk8313 = <0x01>; + }; + }; + + ctp_detect { + compatible = "owl-ctp-detect"; + status = "disabled"; + i2c_adapter_id = <0x01>; + tp_vcc = "ldo5"; + reset_gpios = <0x0c 0x23 0x01>; + interrupt-parent = <0x0a>; + interrupts = <0x00 0x04>; + vol_range = <0x2f4d60 0x2f7470>; + + ctp_detect_list { + compatible = "ctp_detect_list"; + ICN83XX = <0x00>; + GSLX6X0 = <0x01>; + FT52-406 = <0x00>; + FT5606 = <0x00>; + GT813 = <0x00>; + AW5206 = <0x00>; + AW5209 = <0x00>; + CT36X = <0x00>; + HL3X06 = <0x00>; + ILITEK = <0x00>; + ili2672 = <0x00>; + ft5x06 = <0x00>; + MT395 = <0x00>; + NT1100X = <0x00>; + SSD254X = <0x00>; + }; + }; + + pcm-audio { + compatible = "actions,pcm-audio"; + status = "okay"; + }; +}; diff --git a/src/dts/makefile b/src/dts/makefile new file mode 100755 index 0000000..62efc2b --- /dev/null +++ b/src/dts/makefile @@ -0,0 +1,4 @@ +all: + dtc -O dtb -o kernel.dtb kernel.dts +clean: + rm -f kernel.dtb diff --git a/src/install/install.sh b/src/install/install.sh index ade8580..81dde15 100755 --- a/src/install/install.sh +++ b/src/install/install.sh @@ -13,7 +13,9 @@ if [ ! -f $FLAG_PATH ]; then echo "backing up" BAK_PATH=$TF1_PATH/bak mkdir -p $BAK_PATH - cp /misc/boot_logo.bmp.gz $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 diff --git a/src/libmsettings/msettings.c b/src/libmsettings/msettings.c index 9f7a4fc..1ab223f 100644 --- a/src/libmsettings/msettings.c +++ b/src/libmsettings/msettings.c @@ -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()); diff --git a/src/minarch/makefile b/src/minarch/makefile index b417157..992b69c 100644 --- a/src/minarch/makefile +++ b/src/minarch/makefile @@ -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 @@ -19,4 +20,4 @@ CFLAGS += -DBUILD_DATE=\"${BUILD_DATE}\" -DBUILD_HASH=\"${BUILD_HASH}\" all: $(CC) $(TARGET).c ../common/scaler_neon.c ../common/utils.c ../common/api.c -o $(TARGET).elf $(CFLAGS) $(LDFLAGS) clean: - rm -f $(TARGET).elf \ No newline at end of file + rm -f $(TARGET).elf diff --git a/src/minarch/minarch.c b/src/minarch/minarch.c index 947dabc..9edbd5a 100644 --- a/src/minarch/minarch.c +++ b/src/minarch/minarch.c @@ -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(¤tTime); - 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> 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> 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); - + 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 (elapsed0) { - // 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); } } diff --git a/src/minui/makefile b/src/minui/makefile index 692350e..ccc41c1 100644 --- a/src/minui/makefile +++ b/src/minui/makefile @@ -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 diff --git a/src/minui/minui.c b/src/minui/minui.c index 79cdd4c..68fa19d 100644 --- a/src/minui/minui.c +++ b/src/minui/minui.c @@ -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; @@ -1543,7 +1578,24 @@ int main (int argc, char *argv[]) { if (isFavorite(entry->path)) { 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]; diff --git a/src/ramdisk/charging.png b/src/ramdisk/charging.png new file mode 100644 index 0000000..bc8a67d Binary files /dev/null and b/src/ramdisk/charging.png differ diff --git a/src/ramdisk/patched-ramdisk.img b/src/ramdisk/patched-ramdisk.img new file mode 100644 index 0000000..8bd4fbc Binary files /dev/null and b/src/ramdisk/patched-ramdisk.img differ diff --git a/src/ramdisk/patched-ramdisk.meta b/src/ramdisk/patched-ramdisk.meta new file mode 100644 index 0000000..5656c2f --- /dev/null +++ b/src/ramdisk/patched-ramdisk.meta @@ -0,0 +1,3 @@ +patched version of ramdisk.img +from the official stock TF1 image +released on or around 2023-03-09 diff --git a/src/ramdisk/readme.txt b/src/ramdisk/readme.txt new file mode 100644 index 0000000..19659d4 --- /dev/null +++ b/src/ramdisk/readme.txt @@ -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 diff --git a/toolchain/Dockerfile b/toolchain/Dockerfile index 3f75538..32a0cfd 100644 --- a/toolchain/Dockerfile +++ b/toolchain/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster-slim +FROM debian/eol:buster-slim ENV DEBIAN_FRONTEND noninteractive ENV TZ=America/New_York @@ -39,4 +39,4 @@ RUN cat ./setup-env.sh >> .bashrc VOLUME /root/workspace WORKDIR /root/workspace -CMD ["/bin/bash"] \ No newline at end of file +CMD ["/bin/bash"] diff --git a/toolchain/makefile b/toolchain/makefile index 102a27e..47babe4 100644 --- a/toolchain/makefile +++ b/toolchain/makefile @@ -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))