Skip to content

Commit

Permalink
beta changes for mini plus
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpndable committed Mar 21, 2023
1 parent 59c5334 commit fc110df
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 154 deletions.
53 changes: 6 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,13 @@
# MiniUI
# DotUI

_MiniUI is a custom launcher and integrated in-game menu for the [Miyoo Mini](https://lemiyoo.cn/product/143.html) handheld emulator_
_DotUI is a port of the popular [MiniUI](https://github.com/shauninman/MiniUI) custom launcher and integrated in-game menu, compatible with the [Miyoo Mini Plus](https://www.aliexpress.com/item/1005005215387485.html) handheld emulator_

<img src="github/main.png" width=320 /> <img src="github/menu.png" width=320 />

MiniUI is simple, some might say to a fault. That's okay. I think it's one of those things where, if you like it, even just a little bit, you'll love it. (For the uninitiated, MiniUI is a direct descendent of [MinUI](https://github.com/shauninman/MinUI) which itself is a distillation of the stock launcher and menu of the [Trimui Model S](http://www.trimui.com).)
# Important Notice

MiniUI is defined by no. No boxart. No video previews. No background menu music. No custom themes. No runners-up. MiniUI wants to disappear and speed you on your way. MiniUI is unapologetically opinionated software. Sorry not sorry.
All support for this port on the Mini Plus will be provided on this project by Xpndable. Please raise issues here, or discuss them on the [Retro Gaming Handhelds discord server](https://discord.gg/retro-game-handhelds-529983248114122762).

Check the [Releases](https://github.com/shauninman/MiniUI/releases) for the latest and if you want more info about features and setup before downloading, the readme included in every release is also available [here](https://github.com/shauninman/MiniUI/tree/main/skeleton) (without formatting).
# Project Information

MiniUI maybe be simple but it's also extensible. See the [Extras readme](https://github.com/shauninman/MiniUI/tree/main/extras) for info on adding additional paks or creating your own.

## Key features

- Simple launcher, simple SD card
- No launcher settings or configuration
- Automatically hides extension and region/version cruft in display names
- Consistent in-emulator menu with quick access to save states, disc changing, and emulator options
- Automatically sleeps after 30 seconds or press POWER to sleep (and later, wake)
- Automatically powers off while asleep after two minutes or hold POWER for one second
- Automatically resumes right where you left off if powered off while in-game
- Resume from manually created, last used save state by pressing X in the launcher instead of A
- Streamlined emulator frontend (picoarch + libretro cores)

## Stock systems

- Game Boy
- Game Boy Color
- Game Boy Advance
- Nintendo Entertainment System
- Super Nintendo Entertainment System
- Sega Genesis
- Sony PlayStation

## Extras

- Sega Game Gear
- Sega Master System
- Pokémon mini
- TurboGrafx-16

## Extra Extras

The community has created a bunch of additional paks, some tools and utilities, others paks based on cores created for Onion. I do not support these paks, nor have I done any sort of quality checks on them. They may lack the polish, features, and performance of my official stock and extras paks.

- [tiduscrying](https://github.com/tiduscrying/MiniUI-Extra-Extras)
- [westoncampbell](https://github.com/westoncampbell/MiyooMini/releases/tag/MiniUI-OnionPAKs)
- [eggs](https://www.dropbox.com/sh/hqcsr1h1d7f8nr3/AABtSOygIX_e4mio3rkLetWTa?preview=MiniUI_Tools.zip)

## What happened to Union?

The Miyoo Mini happened. The idea behind [Union](https://github.com/shauninman/Union) was the result of having a few of these handhelds but never being fully happy with any one of them in every context. One had a beautiful screen but was too heavy to carry casually. One was perfectly pocketable and had amazingly clicky buttons but the tiny screen wasn't great for long play sessions. So Union allowed easily moving games and save data between devices depending on context. Literally just swapping the SD card from one device to the other. But the Miyoo Mini is pocketable enough, its screen gloriously 640 by 480 enough, that I stopped using the other devices supported by Union. In a past life I learned not to develop features I won't use. Maybe I'll revisit the Union idea in the future or maybe the Mini will remain enough for a long while.
Currently, this project is in open beta and feedback is welcomed. Any features related to WiFi capabilities of the Mini Plus will be considered once the port has had a full release.
Binary file modified github/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BUILD_REPO=https://github.com/shauninman/MiniUI
BUILD_GCC:=$(shell $(CROSS_COMPILE)gcc -dumpfullversion -dumpversion)

RELEASE_TIME!=date +%Y%m%d
RELEASE_BASE=MiniUI-$(RELEASE_TIME)
RELEASE_BASE=DotUI-$(RELEASE_TIME)
RELEASE_DOT!=find ./releases/. -regex ".*/$(RELEASE_BASE)-[0-9]+-base\.zip" -printf '.' | wc -m
RELEASE_NAME=$(RELEASE_BASE)-$(RELEASE_DOT)

Expand Down Expand Up @@ -55,7 +55,7 @@ core:

emu:
cd ./third-party/picoarch && make platform=miyoomini -j
cd ./third-party/vvvvvv && make -j
# cd ./third-party/vvvvvv && make -j
./bits/commits.sh > ./commits.txt

tools:
Expand All @@ -75,7 +75,7 @@ payload:
mkdir -p ./build
cp -R ./skeleton/. ./build/PAYLOAD
cp -R ./extras/. ./build/EXTRAS
mv ./build/PAYLOAD/miyoo/app/keymon.sh ./build/PAYLOAD/miyoo/app/keymon
mv ./build/PAYLOAD/miyoo354/app/keymon.sh ./build/PAYLOAD/miyoo354/app/keymon
cd ./build && find . -type f -name '.keep' -delete
cd ./build && find . -type f -name '.DS_Store' -delete
cp ./src/libmsettings/libmsettings.so ./build/PAYLOAD/.system/lib/
Expand All @@ -93,8 +93,8 @@ payload:
cp ./src/confirm/confirm ./build/PAYLOAD/.system/bin/
cp ./src/say/say ./build/PAYLOAD/.system/bin/
cp ./src/blank/blank ./build/PAYLOAD/.system/bin/
cp ./src/say/say ./build/PAYLOAD/miyoo/app/
cp ./src/blank/blank ./build/PAYLOAD/miyoo/app/
cp ./src/say/say ./build/PAYLOAD/miyoo354/app/
cp ./src/blank/blank ./build/PAYLOAD/miyoo354/app/
cp ./third-party/picoarch/output/picoarch ./build/PAYLOAD/.system/bin/
cp ./third-party/picoarch/output/fceumm_libretro.so ./build/PAYLOAD/.system/cores/
cp ./third-party/picoarch/output/gambatte_libretro.so ./build/PAYLOAD/.system/cores/
Expand All @@ -113,7 +113,7 @@ payload:
cp ./third-party/picoarch/output/mgba_libretro.so ./build/EXTRAS/Emus/SGB.pak/
cp ./third-party/picoarch/output/fake-08_libretro.so ./build/EXTRAS/Emus/P8.pak/
cp ./third-party/picoarch/output/nxengine_libretro.so "./build/EXTRAS/Roms/Native Games (SH)/Cave Story/"
cp ./third-party/vvvvvv/vvvvvv "./build/EXTRAS/Roms/Native Games (SH)/VVVVVV/"
# cp ./third-party/vvvvvv/vvvvvv "./build/EXTRAS/Roms/Native Games (SH)/VVVVVV/"
# cp -R ./bits/bootlogos/pak/. ./build/EXTRAS/Tools/Single-use/bootlogo.tmp
# cp ./third-party/logotweak/logomake/logomake ./build/EXTRAS/Tools/Single-use/bootlogo.tmp/
# cp ./third-party/logotweak/logowrite/logowrite ./build/EXTRAS/Tools/Single-use/bootlogo.tmp/
Expand All @@ -139,8 +139,8 @@ zip:
cd ./build/PAYLOAD/.system/paks/MiniUI.pak && echo "$(RELEASE_NAME)-base.zip\n$(BUILD_HASH)" > version.txt
cp ./commits.txt ./build/PAYLOAD/.system/paks/MiniUI.pak
cd ./build/PAYLOAD && zip -r MiniUI.zip .system .tmp_update
mv ./build/PAYLOAD/MiniUI.zip ./build/PAYLOAD/miyoo/app/
cd ./build/PAYLOAD && zip -r ../../releases/$(RELEASE_NAME)-base.zip Bios Roms Saves miyoo README.txt
mv ./build/PAYLOAD/MiniUI.zip ./build/PAYLOAD/miyoo354/app/
cd ./build/PAYLOAD && zip -r ../../releases/$(RELEASE_NAME)-base.zip Bios Roms Saves miyoo354 README.txt
cd ./build/EXTRAS && zip -r ../../releases/$(RELEASE_NAME)-extras.zip Bios Emus Roms Saves Tools README.txt
echo "$(RELEASE_NAME)" > ./build/latest.txt

Expand All @@ -161,4 +161,4 @@ clean:
cd ./src/say && make clean
cd ./src/blank && make clean
cd ./third-party/picoarch && make platform=miyoomini clean
cd ./third-party/DinguxCommander && make clean
cd ./third-party/DinguxCommander && make clean
4 changes: 2 additions & 2 deletions skeleton/.system/paks/MiniUI.pak/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ fi

lumon & # adjust lcd luma and saturation

CHARGING=`cat /sys/devices/gpiochip0/gpio/gpio59/value`
if [ "$CHARGING" == "1" ]; then
CHARGING=`/customer/app/axp_test | awk -F'[,: {}]+' '{print $7}'`
if [ "$CHARGING" == "3" ]; then
batmon
fi

Expand Down
Binary file modified skeleton/.system/res/charging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified skeleton/.system/res/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 24 additions & 14 deletions skeleton/README.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MiniUI is a minimal launcher for the Miyoo Mini
DotUI is a minimal launcher for the Miyoo Mini Plus, adapted from Shaun Inman's MiniUI

Source: https://github.com/shauninman/MiniUI
DotUI Source: https://github.com/Xpndable/DotUI

MiniUI Source: https://github.com/shauninman/MiniUI

----------------------------------------
Features
Expand Down Expand Up @@ -30,14 +32,14 @@ Features
----------------------------------------
Install

MiniUI works on all known versions of the official firmware, no need to upgrade. Save yourself a headache.
DotUI works on all known versions of the official firmware, no need to upgrade. Save yourself a headache.

Copy the contents of this archive to the root of a fresh FAT32 formatted SD card. Don't forget the "miyoo" folder. Insert your SD card into the device and power it on. MiniUI will install automatically and be ready to go in about 10 seconds.
Copy the contents of this archive to the root of a fresh FAT32 formatted SD card. Don't forget the "miyoo354" folder. Insert your SD card into the device and power it on. DotUI will install automatically and be ready to go in about 10 seconds.

----------------------------------------
Update

To install an update copy just the "miyoo" folder to the root of your SD card. Insert your SD card into the device and power it on. MiniUI will update automatically and be ready to go in about 10 seconds.
To install an update copy just the "miyoo354" folder to the root of your SD card. Insert your SD card into the device and power it on. DotUI will update automatically and be ready to go in about 10 seconds.

----------------------------------------
Shortcuts
Expand All @@ -46,15 +48,16 @@ Reduce/increase brightness:
START + L or R

Reduce/increase volume:
SELECT + L or R
Volume Buttons
(To show volume level, hold SELECT in menus)

Force power off (in case of hangs):
MENU + POWER

----------------------------------------
Roms

Included in this zip is a Roms folder containing folders for each console MiniUI currently supports. You can rename these folders but you must keep the uppercase tag name in parentheses in order to retain the mapping to the correct emulator (eg. "Nintendo Entertainment System (FC)" could be renamed to "Nintendo (FC)", "NES (FC)", or "Famicom (FC)").
Included in this zip is a Roms folder containing folders for each console DotUI currently supports. You can rename these folders but you must keep the uppercase tag name in parentheses in order to retain the mapping to the correct emulator (eg. "Nintendo Entertainment System (FC)" could be renamed to "Nintendo (FC)", "NES (FC)", or "Famicom (FC)").

You should probably preload these folders with roms and copy each one to the Roms folder on your SD card before installing. Or not, I'm not the boss of you.

Expand All @@ -63,7 +66,7 @@ When one or more folder share the same display name (eg. "Game Boy Advance (GBA)
----------------------------------------
Bios

Some emulators require or perform much better with official bios. MiniUI is strictly BYOB. Place the bios for each system in a folder that matches the tag in the corresponding Roms folder name (eg. bios for "Sony PlayStation (PS)" roms goes in "/Bios/PS/"),
Some emulators require or perform much better with official bios. DotUI is strictly BYOB. Place the bios for each system in a folder that matches the tag in the corresponding Roms folder name (eg. bios for "Sony PlayStation (PS)" roms goes in "/Bios/PS/"),

Bios file names are case-sensitive:

Expand All @@ -76,13 +79,13 @@ Bios file names are case-sensitive:
----------------------------------------
Disc-based games

To streamline launching multi-file disc-based games with MiniUI place your bin/cue (and/or iso/wav files) in a folder with the same name as the cue file. MiniUI will automatically launch the cue file instead of navigating into the folder when selected, eg.
To streamline launching multi-file disc-based games with DotUI place your bin/cue (and/or iso/wav files) in a folder with the same name as the cue file. DotUI will automatically launch the cue file instead of navigating into the folder when selected, eg.

Harmful Park (English v1.0)/
Harmful Park (English v1.0).bin
Harmful Park (English v1.0).cue

For multi-disc games, put all the files for all the discs in a single folder and create an m3u file (just a text file containing the relative path to each disc's cue file on a separate line) with the same name as the folder. Instead of showing the entire messy contents of the folder, MiniUI will launch the appropriate cue file, eg. For a Policenauts folder structured like this:
For multi-disc games, put all the files for all the discs in a single folder and create an m3u file (just a text file containing the relative path to each disc's cue file on a separate line) with the same name as the folder. Instead of showing the entire messy contents of the folder, DotUI will launch the appropriate cue file, eg. For a Policenauts folder structured like this:

Policenauts (English v1.0)/
Policenauts (English v1.0).m3u
Expand All @@ -96,7 +99,7 @@ the m3u file would contain just:
Policenauts (Japan) (Disc 1).cue
Policenauts (Japan) (Disc 2).cue

MiniUI also reportedly supports chd files and official pbp files (multi-disc pbp files larger than 2GB are not supported).
DotUI also reportedly supports chd files and official pbp files (multi-disc pbp files larger than 2GB are not supported).

----------------------------------------
Collections
Expand All @@ -111,12 +114,19 @@ A collection is just a text file containing an ordered list of full paths to rom
----------------------------------------
Advanced

MiniUI can automatically run a user-authored shell script on boot (eg. for starting daemons like screenshots). Just place a file named "auto.sh" to "/.userdata/".
DotUI can automatically run a user-authored shell script on boot (eg. for starting daemons like screenshots). Just place a file named "auto.sh" to "/.userdata/".

Just keep in mind, syntax errors in auto.sh may prevent DotUI from launching which will allow the stock system to modify your SD card, polluting the root of the card and your Roms folder with unnecessary subfolders, and removing the hook that allows DotUI to boot. If this happens you will need to reinstall DotUI (well, really just its "./tmp_update/" folder). No userdata is lost when this happens, it's just kinda annoying.

----------------------------------------
DotUI Thanks

Huge thanks to Shaun Inman from whom this code base is ported for the Miyoo Mini Plus and will be adapted to suit over time. His efforts on MinUI and MiniUI are monumental for the entire community, and we would be poorer without his efforts.

Just keep in mind, syntax errors in auto.sh may prevent MiniUI from launching which will allow the stock system to modify your SD card, polluting the root of the card and your Roms folder with unnecessary subfolders, and removing the hook that allows MiniUI to boot. If this happens you will need to reinstall MiniUI (well, really just its "./tmp_update/" folder). No userdata is lost when this happens, it's just kinda annoying.
Check out Shaun's repos: https://github.com/shauninman

----------------------------------------
Thanks
MiniUI Thanks (from Shaun)

To eggs for his example middleware code, countless bug fixes, neon scalers, and patience in the face of my endless questions.

Expand Down
10 changes: 5 additions & 5 deletions skeleton/miyoo/app/MainUI → skeleton/miyoo354/app/MainUI
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# {

DIR=/mnt/SDCARD/miyoo/app
DIR=/mnt/SDCARD/miyoo354/app
cd "$DIR"

export LD_LIBRARY_PATH=/lib:/config/lib:/customer/lib
Expand Down Expand Up @@ -40,8 +40,8 @@ fi

# then do it
./blank
./say "$VERB MiniUI"
unzip -o "/mnt/SDCARD/miyoo/app/MiniUI.zip" -d "/mnt/SDCARD"
./say "$VERB DotUI"
unzip -o "/mnt/SDCARD/miyoo354/app/MiniUI.zip" -d "/mnt/SDCARD"

# post-install
POST_INSTALL=/mnt/SDCARD/.system/post-install.sh
Expand All @@ -66,9 +66,9 @@ fi
./say "$NOUN complete"

rm -rf "$OLD_SYSTEM_PATH"
rm -rf /mnt/SDCARD/miyoo
rm -rf /mnt/SDCARD/miyoo354

# } > /mnt/SDCARD/miyoo.txt 2>&1

# let's do this
/mnt/SDCARD/.tmp_update/updater
/mnt/SDCARD/.tmp_update/updater
File renamed without changes.
20 changes: 13 additions & 7 deletions src/batmon/batmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ void screenOff(void) {
screen_on = 0;
}
void checkCharging(void) {
int i = 0;
FILE *file = fopen("/sys/devices/gpiochip0/gpio/gpio59/value", "r");
if (file!=NULL) {
fscanf(file, "%i", &i);
fclose(file);
// Code adapted from OnionOS
char *cmd = "cd /customer/app/ ; ./axp_test";
int batJsonSize = 100;
char buf[batJsonSize];
int charge_number;

FILE *fp;
fp = popen(cmd, "r");
if (fgets(buf, batJsonSize, fp) != NULL) {
sscanf(buf, "{\"battery\":%*d, \"voltage\":%*d, \"charging\":%d}", &charge_number);
is_charging = (charge_number==3);
}
is_charging = i;
pclose(fp);
}
static pthread_t charging_pt;
void* chargingThread(void* arg) {
Expand Down Expand Up @@ -101,7 +107,7 @@ int main(void) {
close(fb0_fd);

if (!launch) {
system("shutdown");
system("poweroff");
while (1) pause();
}

Expand Down
20 changes: 18 additions & 2 deletions src/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,22 @@ void fauxSleep(void) {
}

int isCharging(void) {
return getInt("/sys/devices/gpiochip0/gpio/gpio59/value");
// Code adapted from OnionOS
char *cmd = "cd /customer/app/ ; ./axp_test";
int batJsonSize = 100;
char buf[batJsonSize];
int charge_number;
int result;

FILE *fp;
fp = popen(cmd, "r");
if (fgets(buf, batJsonSize, fp) != NULL) {
sscanf(buf, "{\"battery\":%*d, \"voltage\":%*d, \"charging\":%d}", &charge_number);
result = (charge_number==3);
}
pclose(fp);

return result;
}

#define GOVERNOR_PATH "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
Expand Down Expand Up @@ -840,7 +855,8 @@ void powerOff(void) {
SDL_FillRect(screen, NULL, 0);
GFX_blitBodyCopy(screen, msg, 0,0,Screen.width,Screen.height);
SDL_Flip(screen);
system("shutdown");
sleep(1);
system("poweroff");
while (1) pause();
}
}
Loading

0 comments on commit fc110df

Please sign in to comment.