Redband GB

Smart Band 10 en
Si prega di notare che tutti i quadranti orologio disponibili su questo sito sono opere creative dei nostri utenti e non sono affiliati con marchi ufficiali o marchi registrati. Sono creati da fan per fan, ispirati da fenomeni culturali popolari, giochi, film o serie.
Il nostro obiettivo è fornire una piattaforma per la creatività e lo scambio, ma ci impegniamo anche a rispettare i diritti intellettuali. Se detiene i diritti d'autore su qualsiasi contenuto che ritiene infranga i suoi diritti su questo sito, contattaci per un'azione appropriata.
Descrizione
This is a watchface, not an RPK app. It needs no custom firmware, no root, no modified system and no hardware changes. It makes use of the band's own official Lua watchface engine (luavgl, Lua on top of LVGL) and installs like any other custom watchface file. As far as I know, it is the first project to show that a full console emulator can run inside a Lua watchface on this band without custom firmware or hardware modifications.
It is not perfect. It can still crash in some situations, and then the watchface or the band simply restarts. Your game is protected by the save system described below, so save often in the game.
HOW IT WORKS ON THE BAND
The Band 10 firmware (3.1.33 was analysed) runs watchfaces in Lua 5.4.0 on top of LVGL 9.1. Drawing is done by a VeriSilicon VG-Lite graphics chip. The main chip is a BES2700 series SoC with a Cortex-M33 core, which has no hardware support for double precision numbers, so the emulator keeps floating point out of its hot loops.
What the firmware analysis showed:
- The watchface Lua engine is created without a per-watchface memory limit. Lua shares the band's system memory with everything else (Bluetooth, sensors, graphics buffers). There is no fixed number for how much memory a watchface can use; it depends on what is free at that moment.
- The free memory can be read at runtime from /proc/meminfo, so the emulator measures it instead of guessing.
- LVGL has its own separate 6 MB image cache that keeps decoded pictures.
- The Lua graphics binding passes a Lua string straight to the image widget. If the string starts with a byte below 0x20, LVGL treats it as an image description in memory, not as a file path.
- The graphics chip's native format is indexed (palette) images. About 90 percent of Xiaomi's own watchface images use it.
- Box shadows are drawn by the CPU, not the graphics chip, so the design uses none.
- /tmp is a RAM disk, while the watchface files and saves live on slower NAND flash.
- The band has a hardware watchdog that restarts it if the system stops responding.
The display trick (the key to the speed): each shown frame is built as one Lua string holding a palette plus the pixels. A small descriptor that points at it is handed to the image widget. LVGL's VG-Lite decoder copies the pixels into its own buffer and the graphics chip draws them with its palette hardware. No files are written, and Lua never converts pixels to colours. Drawing a frame costs about 2 ms on the band.
The address of a Lua string's bytes is found with string.format( '%p' ) plus the size of Lua's string header. That size is measured at runtime from the exact memory counter, so it works on any Lua 5.4 build. LVGL caches decoded frames by that address, so the last 2048 descriptors are kept alive. This makes sure an old cached frame can never be shown by mistake.
THE EMULATOR
- A full Game Boy CPU, picture unit, timers, memory bank controller (MBC3) and battery RAM, written in Lua.
- Compiled blocks: the most used parts of the game's code are translated ahead of time into Lua functions, so they don't have to be interpreted instruction by instruction.
- Three engine sizes: S, L and XL. The bigger engines compile more of the game: L uses about 25 percent less emulation time and XL about 35 percent less, but they need more memory.
- The engines ship as precompiled Lua 5.4.0 bytecode. It loads about 10 times faster and uses about 20 percent less memory than source code. If the band ever refuses it, the next smaller engine or the plain source is used.
- The engine size is chosen at POWER from the band's free memory, and can be switched while playing (see modes below).
- Catch-up rendering: picture lines are drawn only for frames that will actually be shown, and they come out exactly as the real hardware would draw them.
- The ROM is stored as 64 bank files of 16 KB. A cache keeps 14 to 32 banks in memory depending on engine and free memory. A bank that has to be dropped has its memory reused, so loading a bank creates no garbage.
- Accuracy is checked with Blargg's CPU test ROMs, reference frames compared with another emulator, and lockstep runs where the compiled engines must match the plain interpreter exactly through battles.
SPEED AND SMOOTHNESS
- The game runs on a real time clock (the band's microsecond clock), separate from the screen. If drawing is slow, fewer frames are shown, but the game itself stays at full speed (59.7 frames per second) whenever the CPU allows.
- Frame locked showing: only every 2nd to 6th game frame is drawn, and always the same interval. Every shown frame is the same distance apart in game time, so movement looks even. The interval adapts automatically to how busy the band is.
- Three views (long press the screen):
- BIG: crisp full width, 212x189, exact pixel mapping.
- SMOOTH: full width, scaled by the graphics chip, slightly soft, cheapest.
- 1:1: 160x144, no scaling.
- Breathing room: the emulator never keeps the band's CPU busy more than 80 percent of the time (85 percent in UNSAFE). The band's own services and the watchdog always get CPU time. In the heaviest scenes the game slows down a little instead of starving the band.
SAVES
- Pokemon writes its save over several frames and its checksum last. The watchface writes the save file only after the game has finished saving (checksum valid, nothing changed for 1 second). Nothing is ever saved on its own.
- Pokemon also uses its save memory as scratch space for battle and menu sprites. That part is ignored, so battles never trigger a file write.
- Every save goes to a temporary file, is read back and checked, and only then replaces the old save. The previous good save is kept as a backup. If anything goes wrong mid-write, the backup or temp file is loaded automatically.
- This is what protects you if the watchface or band ever crashes: you lose at most what you played since your last in-game save.
- After saving in the game, wait about 2 seconds before leaving the watchface.
MEMORY SAFETY
- The emulator plans its memory from the band's real free memory:
- The largest engine is used only with at least 6 MB free, the medium one from 4 MB, otherwise the small one.
- Lua memory may grow at most 1.5 MB above what it needs and never into the last 4 MB the band has free.
- When the band gets short of memory, the ROM bank cache and picture caches are given back first.
- If memory still runs out, the frame is skipped, caches are freed and play continues. If even that fails, the game waits (low memory - waiting) until memory is back. It never just stops.
- A recovery point (save state) is taken every 30 seconds. If an error happens inside a game frame, the game returns to it.
- Every button handler and timer is protected, so an error cannot take the watchface down.
- Black box: every 10 seconds one line of figures is kept. After a crash, the next POWER shows "last run: ..." for 8 seconds, so the cause can be reported. A tap on the LED shows the live figures.
MODES AND BUTTONS
- POWER: start or stop the game. With the game off, the screen shows the Poketch clock: Red, hours over minutes, weekday and date.
- PAUSE: pause or continue.
- TURBO: fast forward up to 4 times game speed. Only every 8th game frame is shown and the LED blinks fast. Normal play runs the game in real time and shows as many frames as the band can draw smoothly. Use TURBO for long walks, text and grinding, and switch it off for battles and precise movement.
- BROWSE (game off): a small file browser for the save files on the band: game save, save backup, save temp and settings. DELETE needs two taps (SURE?). Deleting the game save also deletes its backup and temp copy, so it cannot come back. CLOSE returns to the clock.
- UNSAFE (game on): the same button switches between SAFE and UNSAFE mode while playing.
SAFE mode (recommended):
- Every POWER starts in SAFE.
- Tested through long play sessions, including Oak's lab and the battles up to Viridian City, without a crash.
- Use it for normal play, long sessions, crowded places with many sprites, battles and whenever you save.
UNSAFE mode (fast mode):
- Faster and smoother: the largest engine from only 3 MB free memory, more ROM banks kept in memory, more memory headroom for Lua, CPU busy up to 85 percent.
- It can still crash because it leaves less room for the band itself. If the band suddenly needs memory or CPU (a notification, a Bluetooth sync, its own services), a fast spike can restart the band before the watchface can react. The CPU limit is also higher, so the band's own services get less time.
- UNSAFE drops back to SAFE automatically as soon as free memory gets low, but it cannot catch every sudden spike.
- Recommended only for short sessions of walking and exploring. Save often in the game and switch back to SAFE for long battles.
- Switching between modes hands the running game to another engine size through a save state, so nothing is lost. This was tested to give exactly the same game.
Other controls:
- D-pad in the centre, B on the top left and A on the top right, SELECT and START below. All controls stay at least 20 px away from the band's edges, so side swipes don't trigger band gestures by accident.
- LED tap: live figures (game speed, CPU busy share, Lua memory, free memory, engine, ROM banks, game map).
- LED long press: switch the display method between memory and files. Only needed if the game screen ever stays black.
ALWAYS ON DISPLAY
The always-on screen shows Poketch style hours over minutes, the date and the Red trainer sprite in light Poketch green on black. Since Lua cannot run there, it is built from the watchface format's own static image and digit widgets (hour, minute, month, day).
WHAT WAS TRIED ALONG THE WAY
- Early versions wrote every frame as up to 9 image strip files and let LVGL read them back. This was limited to about 3 to 4 frames per second, and the game clock was tied to the screen, so the game itself ran slowly. Replaced by the in-memory indexed images and the real time clock.
- Full colour (RGB565) images straight from memory were rejected: the graphics chip needs aligned, cache flushed buffers, which Lua strings cannot guarantee.
- GPU scaling always uses bilinear filtering, so the crisp BIG view is built in Lua with a cache of picture rows. GPU scaling is kept as the SMOOTH view.
- A strict memory budget that showed fewer frames under pressure made the game feel slow, so it was replaced by the reactive safety described above.
- A 12-bank ROM cache reloaded banks about 700 times in 8 battles, which caused memory spikes. It became 14 to 32 banks with memory reuse: 7 reloads with 32 banks.
- Old versions wrote the save in the middle of the game's own save routine, which could leave "The file data is destroyed!" after a crash. Replaced by finished-only, verified saves with a backup.
- A bigger picture row cache and a table based battery RAM did not make busy scenes faster. The cost of crowded scenes is the game's own work, so they were not kept.
Testing: every change was tested on a desktop Lua 5.4.0 set up like the band (32-bit pointers), with a stand-in for LVGL that reads images from raw memory the way the band does. Long stress runs covered battles, random screen off, pause, TURBO, view changes, power cycles and deliberate memory failures.
STATUS, KNOWN LIMITS AND HOW YOU CAN HELP
I have worked on this for weeks, and this version is the best balance I found between the band's available memory and gameplay speed. It is not perfect:
- Very busy scenes (many sprites, battle animations, crowded buildings) can run slower than normal, because the band's CPU is the limit there.
- A crash can still happen, mostly in UNSAFE mode or when the band suddenly needs memory for itself. The watchface or band simply restarts, and the save system keeps your game, so save often in the game.
- Only Pokemon Red has been tested.
If you can make it perform better on the band, please do. Drop your questions in the comments, or take the project files, tweak them and try your own ideas. Bug reports, suggestions, improvements and feedback of any kind are very welcome and highly useful. When reporting a crash, include the "last run" line shown after pressing POWER and what was happening in the game.
Thanks for trying it.
CREDITS
Created by Ryntra(me)
- Poketch clock and always-on display digits: from the Poketch Mi Band 6 watchface by zantfaul.
- Watchface container and AOD format: based on AIR-pixel's miband11-watchface-maker (MIT licence).
- Hardware research: atc1441's Mi Band 10 (BES2700) work.
- Pokemon, the Red trainer sprite and Game Boy are trademarks of Nintendo, Creatures and GAME FREAK. This is a non-commercial fan project, not affiliated with them.
Updates:
- Added landscape layout and controls.
GitHub: https://github.com/sahilsingh2402/RedBand-GB/
Tag
Condividi questo quadrante
Commenti
Per rispondere ai commenti devi essere loggato .
Discussioni recenti della comunità
Heart rate ONLY face for Xiaomi Band 10
And even then, after getting my hands on a Windows laptop and an Android phone - I STILL can't get my designed face to upload to the Band 10. I'm using Notify for Xiaomi - I can get other 3rd-party faces to upload, but not all ........ and...
Please help with an issue regarding installing watchfaces on iOS (Band 10)
Hello, An iOS update for AmazFaces has been released, and Band 10 can now be selected. I still haven’t figured out how to install it yet. I think there may be a problem related to Bluetooth. Why am I getting this error, as shown in th...
How do I install apps to Xiaomi Smart Band 10 with iPhone?
Hi, I downloaded the amazfaces app on my iPhone but there is no option for the Smart Band 10, I downloade...
Simple watchface for the Redmi Watch 5 Lite with a big font for readability
Oh, thanks asoo, I'll post it there then. I have no idea if the binary will work with the Redmi Watch 5, this was done with Easy Face and in theory the layout should work with th...
Xiaomi Mi Band 4 - Help to find this watch face (solved)
Hello. I used to have this watch face shown in the image, but I don't remember the author's name, and I no longer have the file saved. https://i.imgur.com/II0XZXW.png I'd appreciate some help finding it—or ...
Watch face Xiaomi Redmi Watch 6 NFC
Redmi Watches: https://amazfitwatchfaces.com/redmi-watch/fresh Upload new: https://amazfitwatchfaces.com/upload?d=redmi-watch&next...
Xiaomi Watch S4 - Which Device to select
Thank you for the quick response. A....