build: Fix build

This commit is contained in:
robshape 2023-04-14 22:21:55 +02:00
parent 6373955e86
commit 540a30f719
9 changed files with 63 additions and 105 deletions

24
.gitignore vendored
View file

@ -1,14 +1,16 @@
.DS_Store
build
cores/src
cores/output
private
releases
src/boot/output
build/
cores/output/
cores/src/
private/
releases/
src/boot/output/
*.dtb
*.elf
*.o
*.so
*.elf
*.dtb
*.zip
*.zip
.build
.DS_Store
rg35xx-toolchain.tar.xz

View file

@ -6,7 +6,9 @@ top of MinUI.
![MinUI](./github/minui-menu-gbc.png)
## MinUI features
## Features
### MinUI features
- Simple launcher, simple SD card
- No settings or configuration
@ -33,11 +35,11 @@ top of MinUI.
You can [grab the latest version here](https://github.com/shauninman/union-minui/releases).
## FinUI additional features
### Additional FinUI features
-
## Installation guide
## Installation
The following section explains how to install MinUI using macOS, without having to
download any additional tools.
@ -54,31 +56,41 @@ for the app `Terminal.app`
### Install MinUI
1. Connect your microSD card to your Mac
2. Start the app `Terminal`
3. Run the command `diskutil list` and identify your microSD by looking at the `SIZE`
1. Start the app `Terminal`
1. Run the command `diskutil list` and identify your microSD by looking at the `SIZE`
column. It is `/dev/disk4` in this example.
4. Run the command `diskutil unmountDisk /dev/disk4`
5. Unzip the RG35XX firmware to your desktop and then run the command `cd ~/Desktop`
1. Run the command `diskutil unmountDisk /dev/disk4`
1. Unzip the RG35XX firmware to your desktop and then run the command `cd ~/Desktop`
in the Terminal
6. Run the command `sudo dd bs=1m if=35XX-64GB230309EN.IMG of=/dev/disk4` to flash
1. Run the command `sudo dd bs=1m if=35XX-64GB230309EN.IMG of=/dev/disk4` to flash
the firmware onto your microSD. Enter your user account password if prompted. Wait.
7. Run the command `diskutil list` again and identify the largest partition on your
1. Run the command `diskutil list` again and identify the largest partition on your
microSD by looking at the `SIZE` column. It is `/dev/disk4s4` in this example. Note
that it differs from the previous path!
8. Run `sudo diskutil eraseVolume FAT32 ROMS /dev/disk4s4` to format that partition
1. Run `sudo diskutil eraseVolume FAT32 ROMS /dev/disk4s4` to format that partition
as `FAT32` with the name `ROMS`. Enter your user account password if prompted. Wait.
9. You should now have a `misc` and a `ROMS` disk connected to your Mac. If you
1. You should now have a `misc` and a `ROMS` disk connected to your Mac. If you
don't then try reconnecting your microSD card to your Mac.
10. Unzip the MinUI release to your desktop
11. Copy `dmenu.bin` to the root of the `misc` disk. Copy `MinUI.zip` and the `Bios`,
1. Unzip the MinUI release to your desktop
1. Copy `dmenu.bin` to the root of the `misc` disk. Copy `MinUI.zip` and the `Bios`,
`Roms`, `Saves` folders to the root of the `ROMS` disk. Optionally, follow the additional
instructions in the MinUI README if you wish.
12. Finally, run `dot_clean -m /Volumes/misc` and `dotclean -m /Volumes/ROMS` to
1. Finally, run `dot_clean -m /Volumes/misc` and `dotclean -m /Volumes/ROMS` to
remove any dot-underscore files created by macOS on your microSD.
Done. Insert your microSD to your RG35XX and boot it up!
## FinUI TODO
## Development
### Prerequisites
- [Docker Desktop](https://docker.com/products/docker-desktop)
### Build project
Run `./start-toolchain.sh` and then `make all` in the Docker container shell.
### TODO
- Add "mark as finished" OR "add as favorite" to menu
- Improve battery capacity readings (2100 mAh, 2600 mAh, 3500 mAh)
@ -87,7 +99,6 @@ Done. Insert your microSD to your RG35XX and boot it up!
- Adjust recently played count
- Adjust overclocking
- Include extras in release by default
- Move toolchain to repo: <https://github.com/shauninman/union-rg35xx-toolchain>
- Release using GitHub action: <https://github.com/JoeStaff/devilutionX/commit/a0fe502e70767ca8e2921d5580d4d4dec9e15cc1>
- Automate installation guide

View file

@ -1,7 +1,7 @@
# this logic was broken out from picoarch's all-in-one makefile
CORES = fceumm gambatte gpsp pcsx_rearmed picodrive snes9x2005_plus
CORES+= beetle-pce-fast beetle-vb fake-08 mednafen_supafaust mgba pokemini # extras
CORES+= beetle-pce-fast beetle-vb mednafen_supafaust mgba pokemini # extras
###############################
@ -19,10 +19,6 @@ 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
@ -67,7 +63,7 @@ output/$(1)_libretro.so: src/$(1)/.patched
mv src/$$($1_BUILD_PATH)/$(if $($(1)_CORE),$($(1)_CORE),$(1)_libretro.so) ./output
clone-$(1): src/$(1)
patch-$(1): src/$(1)/.patched
clean-$(1):
@ -85,9 +81,9 @@ all: cores
$(foreach CORE,$(CORES),$(eval $(call TEMPLATE,$(CORE))))
cores: $(foreach CORE,$(CORES),$(CORE))
clean: $(foreach CORE,$(CORES),clean-$(CORE))
nuke:
rm -rf ./output
rm -rf ./src
rm -rf ./src

View file

@ -1,34 +0,0 @@
diff --git forkSrcPrefix/platform/libretro/Makefile forkDstPrefix/platform/libretro/Makefile
index 420f9b7ae42d95b0dee150bd02a5ab5a854a7f77..c757dfa3dca2ecf627a91078b7b8ddf47aff4161 100644
--- forkSrcPrefix/platform/libretro/Makefile
+++ forkDstPrefix/platform/libretro/Makefile
@@ -123,6 +123,16 @@ else ifeq ($(platform), miyoomini)
CXXFLAGS += -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve
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
diff --git forkSrcPrefix/platform/libretro/libretro.cpp forkDstPrefix/platform/libretro/libretro.cpp
index 927ea8d4b8d1658a1d7521fe7e9abcbdede0ba5f..55fdd37925b26ac362ab2ad99c0739a405727b56 100644
--- forkSrcPrefix/platform/libretro/libretro.cpp
+++ forkDstPrefix/platform/libretro/libretro.cpp
@@ -463,6 +463,7 @@ EXPORT bool retro_load_game(struct retro_game_info const *info)
}
_vm->QueueCartChange(info->path);
+ _vm->UpdateAndDraw();
return true;
}

View file

@ -47,15 +47,15 @@ bundle:
rm -rf ./build
mkdir -p ./releases
cp -R ./skeleton ./build
# remove authoring detritus
cd ./build && find . -type f -name '.keep' -delete
cd ./build && find . -type f -name '*.meta' -delete
cp ./src/boot/output/dmenu.bin ./build/BASE
cp ./src/boot/output/dmenu.bin ./build/SYSTEM/rg35xx/dat
cp ./src/install/install.sh ./build/SYSTEM/rg35xx/bin
# prepare boot logo
cd ./build/SYSTEM/rg35xx/dat && convert boot_logo.png -type truecolor boot_logo.bmp && rm boot_logo.png && gzip -n boot_logo.bmp
@ -67,7 +67,7 @@ bundle:
cp ./src/overclock/overclock.elf ./build/SYSTEM/rg35xx/bin
cp ./src/minui/minui.elf ./build/SYSTEM/rg35xx/paks/MinUI.pak
cp ./src/clock/clock.elf ./build/EXTRAS/Tools/rg35xx/Clock.pak
# stock cores
cp ./cores/output/fceumm_libretro.so ./build/SYSTEM/rg35xx/cores
cp ./cores/output/gambatte_libretro.so ./build/SYSTEM/rg35xx/cores
@ -77,7 +77,6 @@ bundle:
cp ./cores/output/snes9x2005_plus_libretro.so ./build/SYSTEM/rg35xx/cores
# extras
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
@ -86,7 +85,7 @@ bundle:
cp ./cores/output/pokemini_libretro.so ./build/EXTRAS/Emus/rg35xx/PKM.pak
cp ./other/DinguxCommander/output/DinguxCommander ./build/EXTRAS/Tools/rg35xx/Files.pak
cp -R ./other/DinguxCommander/res ./build/EXTRAS/Tools/rg35xx/Files.pak/
readmes:
fmt -w 40 -s ./skeleton/BASE/README.txt > ./build/BASE/README.txt
fmt -w 40 -s ./skeleton/EXTRAS/README.txt > ./build/EXTRAS/README.txt
@ -96,11 +95,11 @@ zip:
./commits.sh > ./build/SYSTEM/commits.txt
cd ./build && find . -type f -name '.DS_Store' -delete
mkdir -p ./build/PAYLOAD
mv ./build/SYSTEM ./build/PAYLOAD/.system
mv ./build/SYSTEM ./build/PAYLOAD/.system
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 dmenu.bin MinUI.zip 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
@ -118,4 +117,3 @@ clean:
cd ./cores && make clean
cd ./src/clock && make clean
cd ./other/DinguxCommander && make clean

View file

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

View file

@ -1,14 +0,0 @@
#!/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"

7
start-toolchain.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
git submodule init
git submodule update
cd toolchain
make shell

View file

@ -1,8 +1,8 @@
.PHONY: shell
.PHONY: clean
TOOLCHAIN_NAME=rg35xx-toolchain-new
WORKSPACE_DIR := $(shell pwd)/workspace
WORKSPACE_DIR := $(shell cd .. && pwd)
CONTAINER_NAME=$(shell docker ps -f "ancestor=$(TOOLCHAIN_NAME)" --format "{{.Names}}")
BOLD=$(shell tput bold)
@ -10,7 +10,6 @@ NORM=$(shell tput sgr0)
.build: Dockerfile
$(info $(BOLD)Building $(TOOLCHAIN_NAME)...$(NORM))
mkdir -p ./workspace
docker build -t $(TOOLCHAIN_NAME) .
touch .build
@ -21,7 +20,7 @@ shell: .build
else
shell:
$(info $(BOLD)Connecting to running $(TOOLCHAIN_NAME)...$(NORM))
docker exec -it $(CONTAINER_NAME) /bin/bash
docker exec -it $(CONTAINER_NAME) /bin/bash
endif
clean: