Commit graph

5303 commits

Author SHA1 Message Date
Aidan MacDonald
3a57f2f721 Add "rbfs" prefix to native filesystem functions
Most of the churn here occurs because 'filesize' is one of
the redefined filesystem functions, but some of the structs
used by the native FS code also include a 'filesize' member
variable which gets renamed by the macro in some but not all
source files.

It's easier to rename 'filesize()' to 'ffilesize()' rather
than try to clean up the macro mess or renaming the struct
members.

There is weirdness with root_realpath() which now breaks on
native builds because it was assumed to be unprefixed there.
dir_get_info() was unprefixed everywhere but this just seems
inconsistent; make it follow the FS_PREFIX() convention too.

Change-Id: Ic3700c6234ea45f32679c1a8429d70fdb8f4088a
2026-09-17 16:22:31 -04:00
William Wilgus
a7ab67f459 add backlight_on_button_hold to plugins and backlight_use_settings_helper
backlight_on_button_hold / remote_backlight_on_button_hold

were never added to the Plugin API nor backlight_use_settings() helper

Change-Id: I75999af76f98244a870ab86564e591c8a900e66c
2026-09-13 12:04:10 -04:00
David Cormier
e0136bc7f4 ipod6g: add hardware H.264 video playback
Add S5L8702 VPU-B initialization, reset, bitstream input, frame output,
and cache maintenance to the iPod 6G target. Advertise it with
HAVE_HW_H264 and append a capability-gated decoder interface to the
plugin API.

Keep MP4 parsing, AAC decode and mixer output, A/V synchronization,
playback controls, resume state, and presentation in the multi-file
h264_player plugin. The target layer exposes decoder operations only.

Accept non-fragmented MP4/M4V containing Constrained Baseline H.264
through level 3.0, up to 640x480 at 30 fps, with optional AAC-LC audio.
Validate codec configuration and all sample-table relationships before
activating the hardware.

Read MP4 tables in bulk, boost the CPU while preparing them, and report
staged loading progress so long movies do not appear to hang during
startup.

Register the viewer and document its format limits and controls. The
libm4a compatibility fixes needed by video-first containers remain in
the preceding standalone change.

Tested on an iPod Classic 6G through an isolated Rolo nightly runtime:
H.264/AAC playback and M4V startup succeeded. Normal and
isolated-runtime iPod 6G builds also complete, and git diff --check is
clean.

Change-Id: I1e96c65c7d0b4231a94f602f8052f1b26d6e4a80
2026-09-13 08:07:59 -04:00
Christian Soffke
2ec4760117 disktidy: fix blank "Last Run" screen in some themes
Listen to GUI_EVENT_NEED_UI_UPDATE events and redraw, so
screen doesn't disappear if a theme draws over the  UI vp.
Occurs in situations when the SBS is redrawn after waking
the screen, or when the song changes.

Change-Id: I062e802959ab9d34d8c04b7f82da6b87efb5d739
2026-09-05 19:31:28 -04:00
William Wilgus
45bd2b970b [Bugfix] FS#13975 - Keyremap plugin: text importer allow multiple ACTION_NONE entries
importing discards duplicate entries based on context + action code
however you may want multiple entries to map to the same action
and you can't do it within the same context

instead only consider an entry as a duplicate if they have the same
context, actioncode, button, and prebutton

Change-Id: I5aba3459505987ba37e26758aec62f02fcf8165a
2026-09-05 11:03:27 -04:00
Aidan MacDonald
284af2aee8 lastfm_scrobbler: don't include rbversion.h
I intended to remove this in commit a8f8aa40b9 ("lastfm_scrobbler:
fetch rbversion from plugin API") but apparently forgot to do so,
so the scrobbler plugin was still rebuilding itself when RBVERSION
changes. Removing the header fixes that.

Change-Id: I6740d72ad35f5037a6a4a7580559a6c980b3225b
2026-09-03 16:49:08 +01:00
Marc Andersen
a3e93c496e lua: only define strerror/strcoll on native targets
apps/plugins/lua/rockaux.c defines strerror() and strcoll() so the Lua
plugin has something to link against on native targets, which have no
libc providing them. Hosted targets do have a libc, and defining them
there is at best redundant.

On the Windows simulator it is worse than redundant. Both come from
mingw's libmsvcrt.a, and because that is a static archive the linker
pulls in an archive member for an unrelated symbol, then finds a second
definition of these two, so lua.rock fails to link:

  libmsvcrt.a(...): multiple definition of `strcoll';
  rockaux.o:rockaux.c:244: first defined here
  libmsvcrt.a(...): multiple definition of `strerror';
  rockaux.o:rockaux.c:47: first defined here

On hosted Linux there is no diagnostic, because glibc supplies these
from a shared library where a local definition simply wins. That means
the plugin has been quietly shadowing glibc's strerror() with a stub
that always returned NULL, which is presumably not intended either.

Guard both with CONFIG_PLATFORM & PLATFORM_NATIVE, matching the guard
used a few lines above for errno. Hosted targets now get the real
implementations from their own libc.

This also silences a "redeclared without dllimport attribute" warning
that GCC 16 emits for the same clash.

Verified by building xduoox3 as a Windows simulator, xduoox3 as a Linux
simulator, and sansaclip as a native ARM target: all three link cleanly
with no multiple-definition errors.

Provenance, per the AI disclosure requirement in docs/CONTRIBUTING: this
change was drafted with Claude Code (Anthropic Claude Opus 5) at my
direction. Patch set 2 adopts Aidan MacDonald's review suggestion to key
the guard off PLATFORM_NATIVE rather than _WIN32.

Change-Id: I8ffb6fd792147c9067afa708003b1285fb9d07a4
2026-09-01 15:14:02 -04:00
Mauricio Garrido
e498c0171a 3ds: Port refactor.
This commit does the following changes to the 3ds port:

- Rename the target from ctru to 3ds.
- Rename all files and functions with the ctru naming convention to 3ds.
- Created a new file and folder structure that will better integrate future console ports that share the same codebase.
- Fixed a buffer overflow bug in pcm code.

Change-Id: I17c6f86df64eb99dd2b653485d70832ff46b2ba8
2026-09-01 08:39:07 -04:00
Aidan MacDonald
a8f8aa40b9 lastfm_scrobbler: fetch rbversion from plugin API
This prevents needlessly rebuilding the plugin whenever
RBVERSION changes. (This was introduced by the removal
of CVS $Revision$ tags.)

Change-Id: Ic981c86319edb9c7eb7f0c1de71d4fbaba8989ac
2026-08-25 13:17:08 -04:00
Jerry Shen
51d7d56803 ap80max: New hosted port
HibyOS-based target: keymaps, LED, powermgmt, bootloader and sim support,
plus cabbiev2 for the new 360x640x16 screen. Opus 5 helped w/ debugging
and the initial scaffolding.

Updated name to FB_STRIDE_MISMATCH, added simulator bmp and specs.

Change-Id: If797ac6581cf75d9d1fcf36e615ee03cf6f905d6
2026-08-13 17:55:06 -07:00
Aidan MacDonald
a89e1f999d touchscreen: Add flick detector to touchscreen test
Change-Id: I9b41881e3e9a271f0532cc9c500e0511c606e895
2026-08-13 08:04:01 -04:00
William Wilgus
49600dd77c filebrowse.lua add sort by type, add .bmp, .mod to known filetypes
also extends date and size examples to show the size and timestamp
respectively

Change-Id: Ife2b74a8a60a6da097f1f714ebaf68a60d504287
2026-08-07 09:05:59 -04:00
Skye
290b06c869 plugins/fft: do not starve other threads
Change-Id: If8149086ed6e946d300ecdecf1f47dcf294822cb
2026-08-05 16:18:03 -04:00
William Wilgus
1007216fc4 FS#13961 - Add audio status, file_attr constants to lua
use require "audio_status" to use the new AUDIO_STATUS_ defines
use require "file_attrs" to use the new FILE_ATTR_ defines

Change-Id: If0b3b612e92e9e5b361a9487ccca2d40f79a953e
2026-07-30 07:07:39 -04:00
William Wilgus
24c3779146 rbsettings.lua add routines to write settings
supports most settings and status items allows writing
rockbox settings from lua

Change-Id: I852489fd9819c8f7147c922e1d03c4ed9ebafa53
2026-07-24 12:45:20 -04:00
William Wilgus
f58038b687 luadir small cleanuo
luadir stores if a file was closed, we can get this by checking for a NULL
file handle instead

Change-Id: I95b8cc84afcdfc8515af8012afb1df64d0987fc4
2026-07-17 10:54:38 -04:00
William Wilgus
3ad3fba68e filebrowse.lua don't display parent path for files
when browsing the filename gets cut off due to the
length of the parent path

Instead strip the parent from the beginning for files

Change-Id: Ib9dadffabced89b5895420cb696227ca8cc444a2
2026-07-17 10:54:38 -04:00
William Wilgus
b481c4536e FS#13954 - Extra semicolon in file paths in get_files module
date and size still have them to separate the filename from attribs

Change-Id: I3fcaa7061d14493dab178d68398bea25f8ca67d6
2026-07-17 10:54:38 -04:00
Aidan MacDonald
7e6ae1e0d8 echoplayer: enable plugins
First pass at enabling plugins and setting up keymaps.

Change-Id: I3140160bcc3044850416904840b35065f86ac32d
2026-07-12 08:56:44 -04:00
William Wilgus
ca7399821f FS#13953 - lua add get_files() to its own module
get_files(path, recurse, finddir, findfile, sort_by, cancel_fn, f_t, d_t)

get_files returns a sorted tables of directories and (another) of files

path is the starting path; recurse == false.. only that path will be searched

findfile & finddir are definable search functions
 if not defined all files/dirs are returned if false is passed.. none
  or you can provide your own function

sort_by can be by "name" "size" "date" or "none" to perform no sorting
 note: for "size" and "date" you may need to strip the attribute data to use
 the returned filename

cancel_fn if not defined or not a function no user cancel otherwise supply
    your own cancel function which returns true to cancel searching for files

f_t and d_t allow you to pass your own tables for re-use but isn't necessary

Change-Id: Ic4c2ad9c9b5abeeeeaf572880edbc8873d52066b
2026-07-09 12:45:05 -04:00
William Wilgus
40b9d09022 [bugfix] lua ipod mini gen 2 can't quit scripts while under load
I rewrote some of the problematic scripts to use an event loop which
fixed most of the issues but it turns out the underlying issue is
that when the device is under load the timeout that detects a repeat press
makes the key a repeat press and we miss the initial press completely
due to being under load and under the gun

Adds entries for PLA_EXIT and PLA_CANCEL with a Repeat press

Change-Id: I8247b0ebd37fc58608f6be126c49e56f8375e9cf
2026-07-05 22:19:14 -04:00
William Wilgus
b99b2e98df [Bugfix] lua FS#13940 - FONT_UI using last selected font instead of the UI font
FONT_UI is a placeholder when it gets assigned it isn't resolved
immediately

when its time to resolve the font it is processed with font_get(int font)
first it sets it to the last slot
and then decrements till it gets a valid font

Change-Id: I3c203d58ed2d813d206f5b435e6b55ed196cf213
2026-06-29 01:06:34 -04:00
William Wilgus
d9b1819e0b FS#13942 - Lua strftime os.date("%C")
Change-Id: I5a4cb8d362a69d12c2d7e5013dcf179cc20d01b3
2026-06-28 14:32:33 -04:00
William Wilgus
7a32c8b5e3 [Bugfix] lua splash_scroller line formatting
I accidentally added an extra character wittthe last patch by changing
< to <= in the process of testing this I realized spaces were sometimes
being included at the beginning of the line and also that sometime
sentences were being cut short even though they fit on the screen

Change-Id: Iee0ed64e18defad2acb3c107d334ea2a49bd5b6f
2026-06-18 22:21:16 -04:00
William Wilgus
ca2edad012 [Bugfix] FS#13926 -lua Crash when displaying error splash
fix lua strpbrk function skipping the first accept chr

lua splash_scroller fix NULL pointer in brk due to lastbreak
not being reset on a new line

Change-Id: Ica0c9ee5f9194f5be54ab90ad16309adead1c207
2026-06-17 13:55:43 -04:00
William Wilgus
a81d3fa10e [Bugfix] open_plugins.rock add 'add' item regardless & voice improvements
also fixes a bug where synclist viewport could be empty if the list isn't
initialized

voices path and parameters now

adds the item [Add] as the last item in the list

Change-Id: I1aad62baf3c19a67d04fa1fb3db8a7573e0a467f
2026-06-09 00:39:31 -04:00
William Wilgus
e5c7f0c41c open_plugins.rock add title to main menu, add scroll stop on close
Have a report of a hanging scrolling item, ensure the lists are stopped
on exit with gui_synclist_scroll_stop()

Change-Id: If670806f710118c79377bf8c5de6c1a5168e37fc
2026-06-08 12:03:05 -04:00
William Wilgus
9b0516e4e1 [BugFix] openplugins.rock 0 is a valid file descriptor
Change-Id: Id7d9c2c4b9d13433c8aa2260b20f5d74e4b3add8
2026-06-07 11:19:08 -04:00
William Wilgus
2b96380641 [Feature] FS#13884 #2 allow merging imported native keymaps
allows you to import a file and merge native keymaps

pops a yes no prompt to erase existing

duplicates will be overwritten

Change-Id: I167c6fac65775754b2a9874185d14f65638db9d7
2026-06-05 12:08:53 -04:00
William Wilgus
7517674513 FS#13920 text_editor.c plugin do not terminate last line with \n
you can still add a \n by inserting a blank line

Change-Id: Ic3e69fce83ccc9c050857a03877545a7452ce8a2
2026-06-05 02:17:38 -04:00
William Wilgus
ad05e23b72 [Feature] FS#13884 allow merging imported text keymaps
allows you to import a file and merge text keymaps

pops a yes no prompt to erase existing

duplicates will be overwritten

Change-Id: I0f4425e765f0a2ff6b73b830bcaea1b3f31e83cb
2026-06-04 12:10:03 -04:00
Solomon Peachy
3152beee32 chore: Don't embed $Revision$ tags in auto-generated files
I was going to convert them to a git hash instead, but that would
break builds from tarballs.

Change-Id: I76213b8b65df2c6cfb73cba299a4975a22725f36
2026-06-03 08:31:05 -04:00
Solomon Peachy
d54b9e6f8d chore: Get rid of *all* vestigal CVS '$Id:$' tags
Change-Id: I35c13a9768c582e4851aa252dd3ea5c89f760c8c
2026-06-01 16:01:18 -04:00
William Wilgus
a7754eee71 [Bugfix] FS#13912 - splash_scroller with cyrillic crashes
I think they mean corrupted not crashes as I couldn't repro that

splash_scroller stepped by individual chars and split multibyte
sequences leaving corrupted chars

now it uses the new font_measurestring() to get the max_w and chops
it at break chars instead

this required a bit of a logic change to the function but should be
as good with less complications

Change-Id: I692db8b4737f41aec08dbc122fb844028498326d
2026-05-31 19:05:51 -04:00
Christian Soffke
3507f32d01 plugins: properties: further reduce stack pressure
Follow-up to 9f20c45.

tagtree.c's retrieve_entries has significant stack usage
(>1.5k) and is called from tagtree_entries_iterate.

Further Reduce stack usage of tagtree_entries_iterate,
going from 784 B to 72 B, by using static memory allocation
for the the tagcache_search struct in the Properties plugin.

Change-Id: I75a170bea1c5392c18a891844a0ff31fbd2114eb
2026-05-29 20:40:36 +02:00
Christian Soffke
9f20c45a5e plugins: properties: fix stack overflow in db
Stack overflow in splash_progress called from
tagtree_subentries_do_action with stack protector
enabled on mips

Change-Id: Ia71e0493e279af0531ae792d41442198555664f6
2026-05-28 19:58:21 -04:00
mojyack
abaac894f9 plugins: lastfm_scrobbler: fix build error with LOGF
Change-Id: Iefb4b7e4fefb366987627bfd32c27b3252ca34c8
2026-05-28 17:28:07 +09:00
mojyack
e62ac0d2c6 ovl_offset: use elf symbols instead of refmap
add a plugin_ram_end symbol to plugin.lds and rewrite ovl_offset.pl
to read plugin_ram_end and plugin_load_end_addr from the elf via nm.
this removes all dependence on the linker map file format, which
differs between gnu ld and lld.

Change-Id: I66e623d9a2b44eb84ae7035155c84d8afe46df23
2026-05-27 17:55:33 -04:00
Solomon Peachy
c2344070ac xworld: Fix set-but-unused variable warning with GCC16
Change-Id: I5e20a32d84ebc7ca56278988b8add9ee644138ba
2026-05-25 13:00:30 -04:00
Christian Soffke
c0a8303a9c gui: simplify screen updates
Eliminate the somewhat circuitous skin_defer_rendering
and skin_render_deferred functions introduced in commit
c145d19e85.

skin_render (and thus skin_update and sb_skin_update),
along with skinlist_draw, list_draw (and thus
gui_synclist_draw), and quickscreen_draw, will never
update the screen anymore. Instead, the skin is only
marked as dirty now.

GUI_EVENT_ACTIONUPDATE redraws the skin as necessary,
and updates the screen afterwards, if the skin is dirty.
This event is sent from get_action, just like before.

A new event, GUI_EVENT_ACTIONREDRAW allows you to redraw
the skin without causing an immediate update at the same
time.

Change-Id: Ib20644853ead901e32f639000f044d6935135bae
2026-05-25 07:33:53 -04:00
Solomon Peachy
cfbbf5b488 pdbox: Fix up a pile of set-but-unused variable warnings with GCC16
Change-Id: I8de93d879ade61251fdde205353120a8e583b157
2026-05-23 21:31:25 -04:00
Solomon Peachy
95df5fdec0 doom: Fix set-but-unused warnings with GCC16
Change-Id: Iecd8ea9f5dc95f37955bed5e4892a90a93472cc6
2026-05-23 21:22:52 -04:00
William Wilgus
4ffd098ac9 [bugfix] text_viewer plugin, wonky word wrap, line pos buffer overflow
IpodVT reported odd word wrapping in the case of a perfectly fitting line on a space
which carried over to the next line

in the process I got a ASAN overflow on the line buffer due to
the possibility that lines_per_page - 1 might be -1 and then
reading off in space for an offset into the file
not sure that this would really cause an issue since it would presumably
be bounded within the boundries of the file anyway

Change-Id: Ib5b2c5a30b58faf8bda653f9b9d8d7f76cfb8069
2026-05-23 18:24:01 -04:00
William Wilgus
f456dbfa52 [Bugfix] FS#13902 lua strfrtime wrong month field, did not add one to month
posix month field is called mon not month
mon goes from 0-11 so strfrtime needs to add 1 to the number for %m
day of week goes 0-6 where 0 = sunday
day of year goes 0-365 (365 on a leap year)

according to lua everything starts at 1
so month is 1-12
day of week goes 1-7 1 = sunday
day of year is 1-365 (366 on a leap year)

added some fields in the time_date example

Change-Id: Icd502b172285d23133488aa3456786d756667bfa
2026-05-22 18:10:36 -04:00
Christian Soffke
29d62e933f plugins: text_editor: fix list items that continue to scroll (FS#13900)
When using a theme with custom skinned lists
(e.g. Themify 2), a line in Text Editor will
continue to scroll after opening the context
menu, because you're switching from an un-
skinned list to a skinned list, which means
that list-skinned.c/list_draw isn't calling
scroll_stop_viewport for the list_text_vp,
as would be the case for un-skinned lists.

Change-Id: I952937166d8f17c9d57f4d93e715de970c49e5e8
2026-05-19 12:20:11 -04:00
Solomon Peachy
cae433608f build: Silence a pile of set-but-not-used warnings with GCC16 in apps/
The compiler is smart enough to optimize away dead stores but let's
just get rid of them in the first place

Change-Id: I5c85d7c05ef03b084205356a21248f7b049296b0
2026-05-17 08:03:44 -04:00
mojyack
2c0381a34e plugins: mpegplayer: libmpeg2: idct_armv6.S: use explicit register pair for ldrd
Change-Id: I65c7516f500cfe9f2b4990f769e9d85708f7fc62
2026-05-17 07:36:11 -04:00
William Wilgus
7c2e84ad2f FS#13898 expand date_time.lua example
os.date(*t) did not return table when *t supplied because
require("strfrtime.lua") was not loaded

Change-Id: I89b02adad633dca0106b571bdb4b10ffb39cbcf6
2026-05-16 15:54:42 -04:00
William Wilgus
17d28b96b6 lua rocklib.c add splash_progress function
Change-Id: I864a301368c3144a7808ecfa9644e679af2ac727
2026-05-16 14:56:51 -04:00
Solomon Peachy
89cb41c322 pdbox: Add a keymap for the ErosQ family, enable it in the build
Change-Id: I9df8d8a8eac161aeaa133e234cc0c2a60b2f3f93
2026-05-15 10:54:08 -04:00