diff --git a/CHANGELOG b/CHANGELOG index d7ef511c..9910e2fb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +1.6.0-bacon21 + Added TG5040 and TG5050 targets for TrimUI handhelds running NextUI + * TG5040 covers the Brick, Brick Pro and Smart Pro; TG5050 is its own + platform with a separate toolchain and sysroot + * Both reuse the existing SDL2 adapter set; no new adapter code + * SDL2 window now takes the panel's full mode on these platforms, + so the scaled grid is centred in the real screen + 1.6.0-bacon20 Fixed MIDI muting Added MIDI chord command (MCHD) diff --git a/docs/wiki/What-is-LittlePiggyTracker.md b/docs/wiki/What-is-LittlePiggyTracker.md index 14e9161d..57dc664e 100644 --- a/docs/wiki/What-is-LittlePiggyTracker.md +++ b/docs/wiki/What-is-LittlePiggyTracker.md @@ -34,6 +34,7 @@ Getting lgpt to run depends on your platform: - **gp32:** place LGPT.fxe, lgptNew, and lgpt10k in \GPMM - **gp2x/caanoo:** place LGPT.gpe, lgptNew, and lgpt10k in the same folder (anywhere on your SD card) - **win/mac/\*nix :** everything should be in the right spot, just run the executable in \install\bin\ (for fullscreen run “lgpt.exe -fullscreen”) +- **trimui (Brick / Brick Pro / Smart Pro / tg5050, NextUI firmware):** NextUI organises add-ons as "paks". Put the files in a folder called LGPT.pak under Tools/tg5040/ (or Tools/tg5050/) at the root of the SD card, alongside a launch.sh that runs the binary, then start it from the Tools menu. The package's INSTALL_HOW_TO.txt has a working launch.sh, including the LD_LIBRARY_PATH line these devices need to find their own SDL2. ## Importing Samples diff --git a/projects/Makefile b/projects/Makefile index 9fc7e43d..cf6e1c22 100644 --- a/projects/Makefile +++ b/projects/Makefile @@ -108,6 +108,8 @@ BEAGLEBOARDDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(RTAUDIODIRS) $(SDLDIRS) DEBDIRS := $(DBDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) RASPIDIRS := $(DBDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) RG35XXPLUSDIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) +TG5040DIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) +TG5050DIRS := $(LINUXDIRS) $(DUMMYMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) STEAMDIRS := $(LINUXDIRS) $(JACKDIRS) $(RTAUDIODIRS) $(RTMIDIDIRS) $(SDLDIRS) X64DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) X86DIRS := $(LINUXDIRS) $(RTMIDIDIRS) $(SDL2DIRS) $(SDL2AUDIODIRS) @@ -327,6 +329,8 @@ DEBFILES := $(DBFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) BEAGLEBOARDFILES := $(LINUXFILES) $(DUMMYMIDIFILES) RASPIFILES := $(DBFILES) $(RTAUDIOFILES) $(RTMIDIFILES) RG35XXPLUSFILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) +TG5040FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) +TG5050FILES := $(LINUXFILES) $(SDLAUDIOFILES) $(DUMMYMIDIFILES) STEAMFILES := $(LINUXFILES) $(RTAUDIOFILES) $(RTMIDIFILES) $(JACKFILES) X64FILES := $(LINUXFILES) $(RTMIDIFILES) $(SDLAUDIOFILES) X86FILES := $(LINUXFILES) $(RTMIDIFILES) $(SDLAUDIOFILES) diff --git a/projects/Makefile.TG5040 b/projects/Makefile.TG5040 new file mode 100644 index 00000000..924c2375 --- /dev/null +++ b/projects/Makefile.TG5040 @@ -0,0 +1,68 @@ +-include $(PWD)/rules_base + +#--------------------------------------------------------------------------------- +# TrimUI handhelds running NextUI: "tg5040". +# +# tg5040 is NextUI's platform name for the whole Allwinner A133p family - the +# Brick, the Brick Pro and the Smart Pro all build and ship as tg5040, and all +# install to Tools/tg5040/ on the SD card. There is deliberately no separate +# Brick target: NextUI tells the devices apart at runtime, exporting +# DEVICE=brick / brickpro / smartpro, and the display code below just takes +# whatever mode the panel reports (1024x768 on a Brick, 1280x720 on a Smart +# Pro). tg5050 is a different platform with its own toolchain; see +# Makefile.TG5050. +# +# Built against the NextUI cross toolchain plus the TrimUI SDK sysroot, the +# same pair NextUI's own container image uses. Unpack them into DEVKIT (see +# the header comment in the other TrimUI makefile for the archive URLs), or +# point DEVKIT at your own copy: +# +# make PLATFORM=TG5040 DEVKIT=/path/to/aarch64-nextui-linux-gnu +#--------------------------------------------------------------------------------- + +DEFINES := \ + -DPLATFORM_$(PLATFORM) \ + -D_64BIT \ + -DBUFFERED \ + -DCPP_MEMORY \ + -DHAVE_STDINT_H \ + -D_NDEBUG \ + -D_NO_JACK_ \ + -DSDL2 \ + -DSDLAUDIO \ + -DDUMMYMIDI + +DEVKIT ?= /opt/tg5040-nextui-toolchain +TRIPLET := aarch64-nextui-linux-gnu +CROSS_COMPILE := $(DEVKIT)/bin/$(TRIPLET)- + +# The shared Makefile prepends $(DEVKITARM)/bin to PATH. Left unset that +# becomes a bare "/bin", which on an FHS-compat host (NixOS) shadows the +# build shell's python3 with one that has no Pillow, breaking mkfont.py. +DEVKITARM := $(DEVKIT) + +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +STRIP = $(CROSS_COMPILE)strip +TOOLPATH = $(DEVKIT)/bin + +# The crosstool-NG compiler already resolves its own sysroot, so a bare -lSDL2 +# links; the explicit include path is only so style includes also work. +SYSROOT := $(shell $(CC) -print-sysroot) +SDL_CFLAGS := -D_REENTRANT -I$(SYSROOT)/usr/include/SDL2 +SDL_LIBS := -lSDL2 + +OPT_FLAGS = -O3 -march=armv8-a+crypto+crc -fasynchronous-unwind-tables \ + -fstack-protector-strong -Wformat -Wformat-security + +INCLUDES = -Iinclude $(SDL_CFLAGS) -I$(PWD)/../sources +CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall +CXXFLAGS := $(CFLAGS) -std=gnu++03 +LIBS := $(SDL_LIBS) -lpthread + +OUTPUT = ../lgpt-tg5040 +EXTENSION := elf + +%.elf: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) + @$(STRIP) $@ diff --git a/projects/Makefile.TG5050 b/projects/Makefile.TG5050 new file mode 100644 index 00000000..bebb1718 --- /dev/null +++ b/projects/Makefile.TG5050 @@ -0,0 +1,58 @@ +-include $(PWD)/rules_base + +#--------------------------------------------------------------------------------- +# TrimUI "tg5050" (1280x720) running NextUI. +# +# Same adapter set and flags as TG5040; only the toolchain and the output name +# differ. NextUI ships tg5050 as its own platform with its own cross toolchain +# (gcc 10.3) and SDK sysroot, so the tg5040 binary is not reusable here. +# +# Unpack the tg5050 toolchain and sysroot into DEVKIT, or point it elsewhere: +# +# make PLATFORM=TG5050 DEVKIT=/path/to/tg5050/aarch64-nextui-linux-gnu +#--------------------------------------------------------------------------------- + +DEFINES := \ + -DPLATFORM_$(PLATFORM) \ + -D_64BIT \ + -DBUFFERED \ + -DCPP_MEMORY \ + -DHAVE_STDINT_H \ + -D_NDEBUG \ + -D_NO_JACK_ \ + -DSDL2 \ + -DSDLAUDIO \ + -DDUMMYMIDI + +DEVKIT ?= /opt/tg5050-nextui-toolchain +TRIPLET := aarch64-nextui-linux-gnu +CROSS_COMPILE := $(DEVKIT)/bin/$(TRIPLET)- + +# The shared Makefile prepends $(DEVKITARM)/bin to PATH. Left unset that +# becomes a bare "/bin", which on an FHS-compat host (NixOS) shadows the +# build shell's python3 with one that has no Pillow, breaking mkfont.py. +DEVKITARM := $(DEVKIT) + +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ +STRIP = $(CROSS_COMPILE)strip +TOOLPATH = $(DEVKIT)/bin + +SYSROOT := $(shell $(CC) -print-sysroot) +SDL_CFLAGS := -D_REENTRANT -I$(SYSROOT)/usr/include/SDL2 +SDL_LIBS := -lSDL2 + +OPT_FLAGS = -O3 -march=armv8-a+crypto+crc -fasynchronous-unwind-tables \ + -fstack-protector-strong -Wformat -Wformat-security + +INCLUDES = -Iinclude $(SDL_CFLAGS) -I$(PWD)/../sources +CFLAGS := $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -Wall +CXXFLAGS := $(CFLAGS) -std=gnu++03 +LIBS := $(SDL_LIBS) -lpthread + +OUTPUT = ../lgpt-tg5050 +EXTENSION := elf + +%.elf: $(OFILES) + $(CXX) $(LDFLAGS) -o $@ $(OFILES) $(LIBS) + @$(STRIP) $@ diff --git a/projects/resources/TG5040/INSTALL_HOW_TO.txt b/projects/resources/TG5040/INSTALL_HOW_TO.txt new file mode 100644 index 00000000..1d5797e3 --- /dev/null +++ b/projects/resources/TG5040/INSTALL_HOW_TO.txt @@ -0,0 +1,36 @@ +Installation (TrimUI Brick / Brick Pro / Smart Pro, NextUI firmware) +=================================================================== + +NextUI organises add-ons as "paks": a folder ending in .pak containing a +launch.sh. Tools live in Tools// at the root of the SD card, and +this build's platform is "tg5040". + +1. Make a folder on the SD card: /Tools/tg5040/LGPT.pak/ +2. Copy into it: lgpt-tg5040.elf, config.xml, mapping.xml, custom_font.xml +3. Add a launch.sh in the same folder: + + #!/bin/sh + cd "$(dirname "$0")" + chmod +x ./lgpt-tg5040.elf + export LD_LIBRARY_PATH="/usr/trimui/lib:$LD_LIBRARY_PATH" + exec ./lgpt-tg5040.elf + + The LD_LIBRARY_PATH line is required. /etc/ld.so.conf is empty on these + devices and /usr/trimui/lib is not on the default search path, so without + it SDL2 either resolves to whatever another pak happened to leave behind + or is not found at all. It must be the device's own SDL2: other builds + are known to fail on the Brick's unsupported SDL_GetDisplayDPI query. + +4. Put your samplelib/ and lgpt_* project folders next to the binary, or set + ROOTFOLDER in config.xml to keep them elsewhere on the card. +5. Launch LGPT from the Tools menu. + +Controls +-------- +D-pad navigate, A edit, B back, L/R modifiers, START play. SELECT and the +menu button are deliberately unmapped. + +Notes +----- +Renders at a 3x integer scale: 960x720, centred on a 1024x768 Brick and +exactly full height on a 1280x720 Smart Pro. diff --git a/projects/resources/TG5040/config.xml b/projects/resources/TG5040/config.xml new file mode 100644 index 00000000..11ef863e --- /dev/null +++ b/projects/resources/TG5040/config.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/projects/resources/TG5040/mapping.xml b/projects/resources/TG5040/mapping.xml new file mode 100644 index 00000000..300a777f --- /dev/null +++ b/projects/resources/TG5040/mapping.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + diff --git a/projects/resources/TG5050/INSTALL_HOW_TO.txt b/projects/resources/TG5050/INSTALL_HOW_TO.txt new file mode 100644 index 00000000..e3c1514f --- /dev/null +++ b/projects/resources/TG5050/INSTALL_HOW_TO.txt @@ -0,0 +1,36 @@ +Installation (TrimUI tg5050, NextUI firmware) +=================================================================== + +NextUI organises add-ons as "paks": a folder ending in .pak containing a +launch.sh. Tools live in Tools// at the root of the SD card, and +this build's platform is "tg5050". + +1. Make a folder on the SD card: /Tools/tg5050/LGPT.pak/ +2. Copy into it: lgpt-tg5050.elf, config.xml, mapping.xml, custom_font.xml +3. Add a launch.sh in the same folder: + + #!/bin/sh + cd "$(dirname "$0")" + chmod +x ./lgpt-tg5050.elf + export LD_LIBRARY_PATH="/usr/trimui/lib:$LD_LIBRARY_PATH" + exec ./lgpt-tg5050.elf + + The LD_LIBRARY_PATH line is required. /etc/ld.so.conf is empty on these + devices and /usr/trimui/lib is not on the default search path, so without + it SDL2 either resolves to whatever another pak happened to leave behind + or is not found at all. It must be the device's own SDL2: other builds + are known to fail on the Brick's unsupported SDL_GetDisplayDPI query. + +4. Put your samplelib/ and lgpt_* project folders next to the binary, or set + ROOTFOLDER in config.xml to keep them elsewhere on the card. +5. Launch LGPT from the Tools menu. + +Controls +-------- +D-pad navigate, A edit, B back, L/R modifiers, START play. SELECT and the +menu button are deliberately unmapped. + +Notes +----- +Renders at a 3x integer scale: 960x720, centred on a 1024x768 Brick and +exactly full height on a 1280x720 Smart Pro. diff --git a/projects/resources/TG5050/config.xml b/projects/resources/TG5050/config.xml new file mode 100644 index 00000000..11ef863e --- /dev/null +++ b/projects/resources/TG5050/config.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/projects/resources/TG5050/mapping.xml b/projects/resources/TG5050/mapping.xml new file mode 100644 index 00000000..300a777f --- /dev/null +++ b/projects/resources/TG5050/mapping.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + diff --git a/projects/resources/packaging/lgpt_package.sh b/projects/resources/packaging/lgpt_package.sh index 968f7731..6174048f 100755 --- a/projects/resources/packaging/lgpt_package.sh +++ b/projects/resources/packaging/lgpt_package.sh @@ -22,6 +22,8 @@ collect_resources() { #1PLATFORM #2lgpt.*-exe if [ "$1" == "PSP" ] || [ "$1" == "GARLIC" ] || [ "$1" == "RG35XXPLUS" ] || + [ "$1" == "TG5040" ] || + [ "$1" == "TG5050" ] || [ "$1" == "BITTBOY" ]; then # All files go in the root folder zip -9 $PACKAGE -j $CONTENTS elif [ "$1" == "MACOS" ]; then # .app is a folder @@ -54,6 +56,8 @@ collect_resources CHIP lgpt.chip-exe collect_resources BITTBOY lgpt-bittboy.elf collect_resources GARLICPLUS lgpt-garlicplus.elf collect_resources RG35XXPLUS lgpt-rg35xxplus.elf +collect_resources TG5040 lgpt-tg5040.elf +collect_resources TG5050 lgpt-tg5050.elf collect_resources MACOS LittleGPTracker.app # collect_resources RS97 lgpt.dge # collect_resources STEAM lgpt.steam-exe diff --git a/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp b/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp index 7f4eb05a..d9763cb6 100644 --- a/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp +++ b/sources/Adapters/SDL2/GUI/SDLGUIWindowImp.cpp @@ -52,6 +52,14 @@ SDLGUIWindowImp::SDLGUIWindowImp(GUICreateWindowParams &p) int screenWidth = displayMode.w; int screenHeight = displayMode.h; #endif + + #if defined(PLATFORM_TG5040) || defined(PLATFORM_TG5050) + /* TrimUI handhelds under NextUI (Brick and Brick Pro at 1024x768, Smart Pro + and tg5050 at 1280x720) have no window manager, so keep the panel's full + mode taken above and let appAnchorX_/Y_ centre the scaled grid inside it. + Left windowed, SDL opens a 960x720 window on a 1024x768 panel. */ + windowed_ = false; + #endif #if defined(RS97) /* Pick the best bitdepth for the RS97 as it will select 32 as its default, even though that's slow */ diff --git a/sources/Application/Model/Project.h b/sources/Application/Model/Project.h index 38c43493..05d585c5 100644 --- a/sources/Application/Model/Project.h +++ b/sources/Application/Model/Project.h @@ -21,7 +21,7 @@ #define PROJECT_NUMBER "1" #define PROJECT_RELEASE "6" -#define BUILD_COUNT "0-bacon20" +#define BUILD_COUNT "0-bacon21" #define MAX_TAP 3