Add support for TrimUI Smart Pro S (tg5050)#116
Merged
Conversation
New platform for the Allwinner A523-based Smart Pro S device. Key differences from TG5040: sysfs backlight control, DAC Volume mixer, GPIO 236 rumble, dual-cluster CPU with schedutil governor. Includes platform implementation, libmsettings, boot scripts, init configuration, and tool pak support.
Use cached emulator lookups in hasRoms() instead of filesystem exists() calls.
SDL_ttf 2.0.18's NORMAL hinting mode has a major performance regression in TTF_SizeUTF8 (~5x slower than 2.0.15). This caused 11+ second boot delays on tg5050 during option initialization. Changes: - Set TTF_HINTING_NONE for all fonts (restores performance) - Optimize GFX_truncateText with binary search (O(log n) vs O(n)) - Optimize GFX_wrapText with word-based measurement - Add character-precise partial word fitting for small screens - Add millisecond-precision timestamps to log.c for debugging - Add comprehensive tests for text wrapping optimizations Result: tg5050 boot time reduced from 11.2s to 195ms (57x faster).
Enhanced clean target to remove platform-specific build artifacts: - All .o and .elf files in workspace - Platform-specific third-party binaries (DinguxCommander, 351files) - Added .so files to .gitignore for libmsettings builds Fixes issue where 615+ object files were left after clean, causing toolchain version conflicts when switching compilers.
Changed from = to += to allow platform-specific flags to be appended rather than overridden. Enables platforms to add EXTRA_CFLAGS without losing base compilation flags. Also fixed buffer size in launcher.c (auto_path, m3u_path) to use MAX_PATH constant instead of hardcoded 256.
Platform configuration: - Allwinner A523 SoC (8x Cortex-A55 dual-cluster, ARM64) - 1280x720 display with Mali GPU (OpenGL ES 3.2) - Optimized build flags: -mcpu=cortex-a55 -O3 -Ofast -flto - OpenGL ES 2.0 rendering support - Uses custom GCC 10.3 ARM64 toolchain (linux/arm64)
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive support for the TrimUI Smart Pro S (tg5050), a new handheld gaming device based on the Allwinner A523 SoC. Despite sharing the same form factor as the Smart Pro (tg5040), the Smart Pro S uses completely different hardware requiring platform-specific implementations for backlight, audio, rumble, and CPU management.
Key changes:
- New tg5050 platform implementation with hardware abstraction layer for A523 SoC
- Optimizations to common code including binary search for text truncation and word-based text wrapping for improved performance
- Enhanced logging with millisecond-precision timestamps and detailed SDL initialization debug logging
Reviewed changes
Copilot reviewed 45 out of 54 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| workspace/tg5050/show/show.c | Boot splash screen display utility using SDL2 with rotation support for install/update screens |
| workspace/tg5050/platform/platform.h | Hardware definitions including button mappings, GPIO pins, display specs, and joystick axis assignments |
| workspace/tg5050/platform/platform.c | Platform implementation for video, input, power, audio, and LED control using shared SDL2 backend |
| workspace/tg5050/libmsettings/msettings.c | Settings library with A523-specific controls for volume (tinyalsa), backlight (sysfs), and speaker mute |
| workspace/tg5050/install/boot.sh | Boot/install/update handler with schedutil governor configuration for dual-cluster CPU |
| workspace/tg5050/install/update.sh | Post-install script for updating system files |
| workspace/tg5050/Makefile | Platform build orchestration |
| workspace/all/paks/LessUI/platforms/tg5050/init.sh | Platform initialization script with GPIO setup, audio unmuting, and daemon startup |
| workspace/all/common/log.c | Enhanced timestamp format with milliseconds (HH:MM:SS.mmm) |
| workspace/all/common/gfx_text.c | Performance optimizations using binary search for truncation and word-based wrapping |
| workspace/all/common/api.c | Additional SDL initialization debug logging and font hinting configuration |
| workspace/all/player/player.c | Debug logging additions for core loading and initialization tracking |
| workspace/all/launcher/launcher.c | Optimized ROM detection using cached emulator lookup instead of repeated filesystem checks |
| workspace/all/paks/Tools/*/pak.json | Added tg5050 to supported platforms for WiFi, Input, Clock, and Bootlogo tools |
| skeleton/SYSTEM/tg5050/* | System configuration files, binaries, and directory structure |
| toolchains.json | Toolchain configuration for tg5050 (uses linux/arm64 platform) |
| Makefile | Added tg5050 to default platform list and enhanced clean targets |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix rumble off-by-one: max strength (0xFFFF) now works correctly - Add error handling for shm_open/mmap failures in msettings - Add getenv NULL check with fallback path for USERDATA_PATH - Fix show.c rotation rectangle for portrait displays - Quote command substitution in boot.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.