We used 16-bit variables to store the 'character code' everywhere but
this won't let us represent anything beyond U+FFFF.
This patch changes those variables to a custom type that can be 32 or 16
bits depending on the build, and adjusts numerous internal APIs and
datastructures to match. This includes:
* utf8decode() and friends
* font manipulation, caching, rendering, and generation
* on-screen keyboard
* FAT filesystem (parsing and generating utf16 LFNs)
* WIN32 simulator platform code
Note that this patch doesn't _enable_ >16bit unicode support; a followup
patch will turn that on for appropriate targets.
Appears to work on:
* hosted linux, native, linux simulator in both 16/32-bit modes.
Needs testing on:
* windows and macos simulator (16bit+32bit)
Change-Id: Iba111b27d2433019b6bff937cf1ebd2c4353a0e8
Battery time estimation works now.
This commit also changes the mksquashfs path to FUNKEY_SDK_PATH.
Change-Id: Ic0aa4c40011b0716f1c36c014377eaccb486e841
We used 16-bit variables to store the 'character code' everywhere but
this won't let us represent anything beyond U+FFFF.
This patch changes those variables to a custom type that can be 32 or 16
bits depending on the build, and adjusts numerous internal APIs and
datastructures to match. This includes:
* utf8decode() and friends
* on-screen keyboard
* font manipulation, caching, rendering, and generation
* VFAT code parses and generates utf16 dirents
* WIN32 simulator reads and writes utf16 filenames
Note that this patch doesn't _enable_ >16bit unicode support; a followup
patch will turn that on for appropriate targets.
Known bugs:
* Native players in 32-bit unicode mode generate mangled filename
entries if they include UTF16 surrogate codepoints. Root cause
is unclear, and may reside in core dircache code.
Needs testing on:
* windows simulator (16bit+32bit)
Change-Id: I193a00fe2a11a4181ddc82df2d71be52bf00b6e6
Actually power off the handheld with the sleep timer and idle poweroff functions instead of closing rockbox.
This commit also moves setting system volume to max from the launch script to system-sdl.c so it works when running rockbox via instant play.
Change-Id: I174b67c6abef451faa05f4a8f52b8d9eeed98a22
...Except for simulators, those always need the cursor
In practice this only affects the RG Nano as it is currently our
only SDL target that lacks a touchscreen.
Change-Id: I292f923848528c233da518b062d9ccd8a03515dd
Instant play is a Funkey OS feature that allows it to relaunch at boot the last program it was running before shutting down, which means that if the handheld is powered off (holding the power button) while rockbox is running the next time it's powered on rockbox will launch at boot.
This commit also handles system brightness/volume in rockbox itself instead of the launch script, so the values are properly reset when powering off the handheld while rockbox is running.
Change-Id: Ie1adbf71069aeed5fbf6670971718a2f718716a3
A bit of context, this device is a clone of the FunKey-S with a different form factor, hardware is mostly identical, the relevant difference is it has audio out (via usb-c, adapter to 3.5mm is included), this is the reason why the FunKey-SDK is needed for bulding.
This port is based on the old SDL 1.2 code because the device doesn't have SDL2 support. Alongside what was supported in the SDL 1.2 builds this port supports battery level, charging status and backlight control.
Change-Id: I7fcb85be62748644b667c0efebabf59d6e9c5ade
Instead of using the generic hosted sysfs code, which expects
a full path, the ibasso code's sysfs code uses an enumeration.
Unfortunatley the generic power input/charging code used the former
API but linked with the latter. oops.
Correct this by placing a private copy of these functions in
the ibasso-specific port, and removing the generic version from
that build.
(A "proper" fix would be to rework all 17 of the ibasso sysfs calls
to use the generic sysfs API)
Change-Id: Ic13adc9782d85560f0c74d77f60a629619d38668
* Use 16-bit audio output
* More audio tweaks (mute on startup, working volume control)
* Treat the rotary input as a scroll wheel (works now)
To-dos:
* Better global keymap (incorporate touchscreen)
* Turn on plugins and define the approximately eight bajillion keymaps
* Still have some audible pops when we turn on, need to figure out why
* Default Cabbiev2 comes off as rather crappy on this device
...I don't know how much work I will do on this thing, as the limited
number of physical controls (and a lack of a line-out) mean I'd never
want to use this thing myself.
Change-Id: I37229d92766495219ee989d9ae48b5ed79bd45f5
* Add a crude keymap
* Use native "hardware mute" for audiohw_mute()
* Properly handle touchscreen inputs
* Can now play back music, with some warts..
Broken:
* rotary wheel still doesn't work
* audio garbled/distorted a bit
* no volume control
Change-Id: I040217035a7bf3983b0e269fca3408eedd972cd0
Some screens (eg Surfans F28) only report absolute positioning
via "EV_ABS" events, and the actual "touch on, touch off" happens
via a separate "EV_KEY" event. So handle this.
This also fixes a nasty bug introduced in 3270daf2c4.
Change-Id: If73d390679ba6ffe37541442f631c03b73774fbb
* Only bootloader builds
* Plugins disabled
* No keymaps to anything else
* No simulator
* Touchscreen not wired up yet
* Audio still untested
Bugs:
* rotary encoder does nothing in bootloader
(might be bootloader bug, might be something else)
Other stuff pulled in:
* Unify all of the (identical!) hibyos makefiles
* Rename the "bootloader" to more generic name
Change-Id: I6d8a3b58de726db8e89cf193c90960a070a575c2
We expect a fixed FRAMEBUFFER_SIZE that's width*height*bitdepth, and we
mmap()ed that in. However, when doing the initial fb clear, we
were using the hardware-provided 'finfo.smem_len' which could be
larger than FRAMEBUFFER_SIZE. This overran our mmap and triggered
a segfault.
Correct this by mmaping (and clearing) the entire smem_len. As a safety
measure, panic if smem_len is smaller than our expected FRAMEBUFFER_SIZE
Change-Id: I3222139c7aed6e8e8ee232b1730edd5cd70065ff
the YPR1 apparently can do voltage or percent measure
I'm pretty sure its missing logic for disksafe and shutdown,
perhaps the device takes care of it for you?
hopefully someone with the device notices the issue
(perhaps due to a older battery needing capacity tweaked)
Change-Id: I79d3927fa8b154ba231aa6894de7920a4e4dd4c7
when battery_bench is run
exports a file in the rockbox directory called 'battery_levels.default'
if the user wants their own levels they can rename the file battery_levels.cfg
and it will be loaded at boot
some minimal error checking is performed prior to using the values
added manual entry
Change-Id: Ia0126faced0c7229fcf8385a1bcb584b5a9dc378
This enables smooth resizing of the window using a
fixed aspect ratio, instead of snapping into the
correct aspect ratio only when the resize operation
has finished, by using an SDL event filter that gets
events delivered during the resize operation
(whereas SDL_PollEvent blocks until done on macOS).
Change-Id: Ie6614e4b6f49a24469c5ee6a69721c9fbd440dae
On Windows, we need to prevent the event thread
from drawing at the same time as the main thread,
when window is being adjusted.
Change-Id: I2b4e4a50fec427e53e310593850e2a556a594b31
probably doesn't make much of a difference
for our use case but should prevent creation
of temp buffers
Change-Id: Ie2cbefcbd7b8f94bed340f08bf71f764a32ed1ea
No need to create a new texture for every
rendered frame, unless the scaling method
has been adjusted.
We also don't need to upload the (unchanged)
player interface to GPU memory repeatedly.
+ Remove unused lcd_display_redraw &
having_new_lcd variables
Change-Id: I5bff6aa2d54347a3f2c3afba8d8d7eb9e39f77f7
Press 0-3 to to adjust current zoom level
to 50% (0), 100% (1), 200% (2), or 300% (3).
Press 4 to switch between "best" (linear)
and nearest pixel sampling.
Change-Id: Id10d361659855a0ad9c97e6b341f498f72709ef5
SDL 2 lets us take advantage of a fixed logical resolution,
where the renderer scales content up or down automatically.
Relative mouse motion is also affected by renderer scaling
by default (see SDL_HINT_MOUSE_RELATIVE_SCALING).
If window zoom has been enabled from the command line,
set scaling quality to "nearest pixel sampling" instead
of "best" to allow pixel peeping.
Change-Id: I4e5c19d36b55c985c26ac5ae64c4a6b8dd9b308d
Tested on Linux, MacOS, and Windows.
On MacOS and Windows, we constrain the window's aspect
ratio by adjusting the size when responding to resize
events.
On Linux, I've not found a way to do so, that doesn't
result in fairly stuttery behavior and weird jumpy
behavior of the resize handle, possibly depending
on your window manager. So, black bars are displayed
around the content.
Maybe someone, at some point, finds a way.
(SDL3 seems to have SDL_SetWindowAspectRatio)
When the window is in fullscreen, black bars are
display necessarily, of course, on all systems,
unless the player GUI has exactly the same aspect
ratio as the screen...
Change-Id: I535e6617497611ea57a4c19e08e552f990859cfe
SDL_AUDIO_ALLOW_SAMPLES_CHANGE was added in 2.0.6, just
ignore it if we're compiling against an old version
Change-Id: Ia317fe9780b9e39b9fa1f882ada845011d4e8e60
This lets us _demand_ a sane audio configuration that doesn't require
us to convert sample formats.
(Windows always seems to want us to supply 32-bit floating point)
Change-Id: I19113363b33ae99be33afceec50a319c182e9b29