Commit graph

36515 commits

Author SHA1 Message Date
William Wilgus
b16bae6fe6 skin_display.c cleanup - No functional changes
Change-Id: Ib8ce47d9cf33ba6b02d799862f322e481a712dfb
2022-10-16 04:30:22 -04:00
Aidan MacDonald
5e7c34f5b3 lcd: Fix off by one error in clipping check
When I converted all the clipping checks in 4b8fe8acd1 I messed
up the hline and vline checks. This produced some weird panics on
the Shanling Q1, probably memory corruption -- but somehow it got
past AddressSanitizer. Go figure.

Change-Id: I84820c23a491d422218c72d2d5e199e2fc7def0f
2022-10-15 20:56:11 +01:00
William Wilgus
ffdc64bea2 skin_engine fix invalid buflib handle checks
buflib considers handles <= 0 as invalid
skin engine was using handles < 0

Change-Id: Ie156223a43039d48ef4846fe31e6191630fa7c04
2022-10-15 11:17:52 -04:00
William Wilgus
f3d679aefe skin_engine fix free pointer crash
skin_engine uses -1 to signify a free handle 0 causes crash

Change-Id: I1db8743c14dd244fe92973e31bac61efdd12ca7f
2022-10-15 10:56:30 -04:00
William Wilgus
12ef045fdf move buflib_free invalid handle check to the function
allow buflib_free to check for invalid or already freed handles
within the function -- remove all the invalid handle guards thru core_free

Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
2022-10-15 09:26:58 -04:00
Solomon Peachy
9d3d925295 Revert "RFC: Get rid of mpegplayer plugin"
This reverts commit d25d24812e.

Change-Id: I1563223e343fb1e2eda72a45823b38350025ff93
2022-10-13 11:08:11 -04:00
Solomon Peachy
418169aff8 Revert "Remove YUV blitting functions and LCD modes"
This reverts commit fe6aa21e9e.

Change-Id: I8bb1e5d6c52ed1478002d2140ef494ec5d62b8e3
2022-10-13 11:08:06 -04:00
William Wilgus
f9ea1fc79d splash_progress add delay function
I figure this is a better way to allow a delay before showing the
progress meter

Change-Id: I909902a52619023b0b87635d2eb94ed00cb4bcec
2022-10-13 00:10:25 -04:00
Aidan MacDonald
c607bfac6f lcd: Fix update_viewport() for non-default stride viewports
Simplify update_viewport() by calling update_viewport_rect().
The resulting LCD driver calls are the same either way and
for some reason, update_viewport() didn't handle non-default
stride viewports correctly.

Change-Id: Ic34d3d40e4f758db897cb3944d9d7475bbdb4d2c
2022-10-12 08:06:12 -04:00
Aidan MacDonald
9549ddabba lcd: Fix bug in grayscale clear_display() implementation
clear_display() on grayscale LCDs sets the number of scrolling
lines to 0 but that's wrong, the scollers need to be shut down
first. Call scroll_stop() for that, as is done on color LCDs.

Change-Id: I75fb6839ed04f6fe1eb8e2855c8db820fcedddb8
2022-10-12 07:58:57 -04:00
Aidan MacDonald
44b9785465 lcd: Move grayscale clear_viewport() to lcd-bitmap-common.c
All grayscale LCDs have the same clear_viewport() implementation.

Change-Id: I087ac3be824c97a1f42857b4e2fedb0675d453fa
2022-10-12 07:58:57 -04:00
Aidan MacDonald
f737e5025d lcd: Refactor viewport clipping functions
There's no need to generate separate copies of these functions
for main and remote LCDs; we can just pass the viewport directly.

Change-Id: I20aa04a58d327b479a942708e161068bd6a3357b
2022-10-12 07:34:15 -04:00
Aidan MacDonald
6acc8a81a7 lcd: Cosmetic variable renaming
Assign lcd_current_viewport to a local variable for easier typing.

Change-Id: Ib5d4283fd1c5a21c94d3bd3c2c28ce206383fb96
2022-10-12 07:34:15 -04:00
Solomon Peachy
726673c638 toolchains: Enhancements to build scripts
* Explicitly require 'xz' (we've implicitly required it for a while now)
 * Prefer xz files in a few more places
 * Much better logging for native toolchain builds
 * Use -O2 for native toolchain binaries

Change-Id: I401b734882c2c21329624911c09a46168d82f388
2022-10-11 12:41:19 -04:00
Solomon Peachy
eb745d225d toolchains: Get rid of crosstool-ng builds.
Nothing current uses them, and it's surely bitrotten by now.

Change-Id: I5666471896503b71839023a9137ce52ea8cc9e20
2022-10-10 08:24:33 -04:00
Solomon Peachy
2928b71a69 mips: Work around an issue with GCC 8.
Change-Id: I9867674978ab6d4c99f5fa67c93e5b830531aefd
2022-10-10 08:24:33 -04:00
Solomon Peachy
af75619585 usb dwc2: Fix a potential garbage string print in an error path.
Change-Id: I56f8ee9bc883baac8707f136be396bb2669f911b
2022-10-10 08:24:33 -04:00
Solomon Peachy
5c6d6bd612 keyremap: Use '%z' when printing size_t
Change-Id: Ie752c8b8e35b98e52ed8999e92d5c65181109240
2022-10-10 08:24:33 -04:00
Christian Soffke
eb5e15803b Use splash_progress in database when inserting into dynamic playlist
Change-Id: Iaef66cc00a1be0ce3cf869f0e6137a2e9efa2713
2022-10-10 07:49:04 -04:00
William Wilgus
0374dea33a playlist_resume add delay before progress splash
Change-Id: I2927ddc49c3dbe96746237c8577f26f240182eeb
2022-10-10 07:20:07 -04:00
Aidan MacDonald
f8e968991d lcd: Move parameter handling calls to lcd-bitmap-common.c
No need to reimplement the same drawmode, getwidth, etc, calls
for each pixel format.

Change-Id: Ibbe32814f72e1492c190ba578cec303c1cf29b12
2022-10-09 22:07:49 +01:00
Aidan MacDonald
eaccdeeae2 lcd: Remove internal function get_viewport()
Only the scroll engine calls this, but it's easily replaced
by the return value of set_viewport_ex().

Change-Id: I2e2c8234f969bc07c9ff7d864e58551115175e26
2022-10-09 22:07:48 +01:00
Aidan MacDonald
4f9e4ddb99 lcd: Consolidate drawpixel, drawline, and drawrect functions
All three functions are nearly identical regardless of the
LCD pixel format. Consolidate them into a generic version in
lcd-bitmap-common.c.

Change-Id: Iab13429ea27ea2b0150b9004535bd27d4a4121a0
2022-10-09 22:07:46 +01:00
Aidan MacDonald
4b8fe8acd1 lcd: Consolidate in-viewport clipping routines
In-viewport clipping code is duplicated across 8 files, making
it a chore to change anything related to clipping; refactor the
clipping logic into dedicated functions.

Change-Id: I4ab20bb3c59b0406098d0c7d23833025f17a320a
2022-10-09 22:07:44 +01:00
William Wilgus
70d5b2cd45 splash_progress fix red for non-color targets
Change-Id: I6a50264a8edb2745c3d5ecd3cd558c0e83e4a529
2022-10-09 11:00:40 -04:00
William Wilgus
d73aaf3d9e add splash_progress
the loading track splash flashes and is ugly
add a function to display a progressbar along with the splash message

spruce up database commit message as well

Change-Id: I2749b958c1ee5dad2631a5f999a4b00ddca7f225
2022-10-09 08:46:51 -04:00
Aidan MacDonald
e57b4f9099 gui: Remove gui_synclist_item_is_onscreen()
Only the "Rockbox Info" screen uses it for a rather silly purpose,
so remove the function. This helps to decouple things from the GUI.

Change-Id: Icf73e3ee1230c75bf43016c0f1c05c7fe1a24895
2022-10-05 11:23:11 -04:00
Aidan MacDonald
1c5a0497cf gui: Remove list "limit_scroll" member
Get rid of the "limit_scroll" member from lists and make it a
local variable of gui_synclist_do_button().

Bump plugin API version since struct gui_synclist was changed.

Change-Id: Ie3244a85e5a1022a2f6e238a506fdbba67724962
2022-10-05 11:23:01 -04:00
Aidan MacDonald
d5a081cbd1 gui: Remove "enum list_wrap" from list action functions
Removing the "list_wrap" argument is actually pretty easy.
In practice, almost all lists are using LIST_WRAP_UNLESS_HELD
behavior so we can make that the default. A couple of lists
disable wraparound with LIST_WRAP_OFF; this is now achieved
by setting the list "wraparound" flag to false when setting
up the list. LIST_WRAP_ON was unused and is of questionable
value, so it has been removed entirely.

This makes list wraparound behavior a property of the list,
controlled solely by the "wraparound" flag. The result is a
simpler list API and implementation, without changing the
behavior of any lists.

Change-Id: Ib55d17519e6d92fc95ae17b84ab0aaf4233bcb5a
2022-10-05 11:22:55 -04:00
Aidan MacDonald
ff378deb69 gui: Remove gui_synclist_limit_scroll()
Since gui_synclist_do_button() overrides the setting at runtime
there is no reason to have a public API call to set it. Really
it should be a local variable, but it will be simpler to do that
after refactoring how list wraparound behavior is handled.

Change-Id: Id09d42197814102693752a9f64db8325118ca796
2022-10-05 11:22:34 -04:00
Aidan MacDonald
ead172c05d gui: Remove redundant copies of list scrolling settings
gui_list_screen_scroll_step() and gui_list_screen_scroll_out_of_view()
just copy the global setting into a local static variable.
Since they don't do anything special when the setting changes
it's simpler to use the global setting directly.

Change-Id: Ib6a7bf4e09b6dabbc1597cf28ddbafc0bc857526
2022-10-05 10:22:55 -04:00
Aidan MacDonald
fe6aa21e9e Remove YUV blitting functions and LCD modes
None of this is needed now that mpegplayer is gone.

Change-Id: I360366db8513e4d988021e8d7b7d8eb09930efb8
2022-10-03 13:30:01 +01:00
Aidan MacDonald
b371ff1f47 mrobe500: Fix missing parentheses in #define
Change-Id: Ifbba50a951fb3212eabe430dfef6868a7ad5e391
2022-10-03 13:29:52 +01:00
Solomon Peachy
d25d24812e RFC: Get rid of mpegplayer plugin
It might have made sense once upon a time, but in today's world...

Change-Id: I5d638e6f7a2308c50ab12bd901338f02cf426aae
2022-10-02 11:57:20 -04:00
Aidan MacDonald
9ce5b2a2ed gui: Remove show/hide selection option in lists
The implementation of the "show_selection_marker" option in
lists isn't great. It's a cosmetic option used to hide the
selection, but it causes the list to do funny things to the
selected_item and doesn't play nice with voiced menus, since
these rely on the selection to determine what item is spoken.

There are only two user-facing lists that use the option, the
"Rockbox Info" screen and a menu in the superdom plugin. The
rest are debug screens, and cosmetics don't matter much there.

Given how little used the option is, and its issues, removing
it seems reasonable.

Change-Id: I2c70b3e4c74ff3cc6dbac46366a371d271dd2d58
2022-10-02 09:21:25 -04:00
Aidan MacDonald
c1d75a6bcb Fix yellow from 5b0506e9de
Change-Id: I6391a6f13e64fad5c54dd29d8d696a08d45362dc
2022-10-02 13:57:52 +01:00
Aidan MacDonald
5b0506e9de gui: Constify list title text
Use const char* pointers for list titles. Only one debug menu
actually modifies the title, and in that case it's legal to
cast away const because the title points to a known mutable
buffer on the stack.

Change-Id: Idb8ab307b9a6ec23a93d8420c5e19fafd9f59c30
2022-10-02 08:20:10 -04:00
Aidan MacDonald
420fb1163c skin engine: Fix bug with %Vs(color) tag
The %Vs(color) tag doesn't set the text style properly and causes
the background to not be cleared when rendering lines. For static
text this is rarely a problem, but for scrolling text it'll cause
the text to "smear" once it starts scrolling.

Fix this by setting STYLE_DEFAULT, so the background gets redrawn
when the line scrolls.

Bug report: https://forums.rockbox.org/index.php/topic,54320.0.html

Change-Id: I835c806005ea40fd6bac3692e52a9c325581a293
2022-10-01 12:58:00 +01:00
Aidan MacDonald
3bc6408bbe lcd: Fix incorrect use of LCD_STRIDEFORMAT for remote LCDs
The get_address_fn implementations for some remote LCDs were
checking LCD_STRIDEFORMAT unconditionally, but that macro is
only valid for the main LCD. The remote LCD code only supports
horizontal strides, so when compiling for a remote LCD, force
the use of horizontal stride addressing.

This fixes a buffer overflow and out of bounds write that occurs
with the M:Robe 500 remote LCD. (Tested with sim + ASan only.)

Change-Id: I99c6aa11d38f5105b096fc448948b9ec1b27dfe6
2022-09-30 10:49:39 +01:00
Aidan MacDonald
f373c97c90 Define LCD_STRIDEFORMAT unconditionally
Instead of putting "#ifdef LCD_STRIDEFORMAT" at every usage of the
macro it's simpler to have config.h define LCD_STRIDEFORMAT to the
default of horizontal stride when the target leaves it unspecified.

Change-Id: Ib187012aad65ac678dbd837b1464a83bad722411
2022-09-30 10:42:49 +01:00
Solomon Peachy
9ed36ec22f FS#13361: Fix some compilation under MacOS (Michael Landherr)
Change-Id: Id7e0576e355a1d71493fb7b277fd92f38b7edab4
2022-09-27 10:00:03 -04:00
Aidan MacDonald
09cb3c7843 lcd: Remove HAVE_VIEWPORT_CLIP
This was only enabled for the mrobe500 and sansaconnect targets.
Most targets are therefore running without this "safety" measure,
and presumably we'd have noticed long ago if there was a problem.
So in all likelihood this is just a bunch of dead code that we
don't need to carry around.

Change-Id: I7d27701a38b1c2a985ee73fa6f277ad215d8d385
2022-09-27 14:13:15 +01:00
Solomon Peachy
24daa26598 FS13356: Update Polish Translation (Adam Rak)
Change-Id: I6ee55f2a6024411515670fc1249268b66aad09bd
2022-09-25 18:28:04 -04:00
Solomon Peachy
36ea69b27e FS#13365: Updated Italian translation (Alessio Lenzi)
Change-Id: Idbb6d58667a153d0381252da64383423d383471f
2022-09-25 16:15:30 -04:00
Aidan MacDonald
464889ecee Fix red in e75a3fb8
Change-Id: I2e98f68d03df757688b6c556b69d934c12f40a7c
2022-09-25 12:23:40 +01:00
Aidan MacDonald
e75a3fb8c7 usb: add debounce interval for USB status by event
This makes status by event debounce status changes over
a 200ms period, which is what polling was already using.

This is helpful on targets where events are excessively
noisy and generate a lot of transitions during insertion
and extraction.

Change-Id: I0eae2cca93aaa865e33c94a1318c27e91c7f7c4b
2022-09-25 06:49:11 -04:00
Aidan MacDonald
e4aec7d648 key remap: simplify and use movable allocations
Have action.c control the key remap buflib allocation so that it can
be made movable. With memory management offloaded, core_keymap.c only
needs to deal with loading keymap files. Simplify the code there and
use buflib pinning so the file can be loaded directly into the buffer.

Change-Id: Ia654cc05ce6b286f96c1031fa4f7d4b3859a2c1a
2022-09-25 11:05:59 +01:00
Aidan MacDonald
f47aa584a8 buflib: add pin/unpin operation
An allocation is pinned by calling buflib_pin() to up its pin count.
The pin count is like a reference count: when above 0, buflib won't
move the allocation and won't call its move callbacks. This makes it
safe to hold the pointer returned by buflib_get_data() across yields
or allocations.

Note that pinned allocations can still shrink because there are some
use cases where this would be valid, if buffer users coordinate with
the shrink callback.

Change-Id: I0d0c2a8ac7d891d3ad6b3d0eb80c5b5a1b4b9a9d
2022-09-19 15:09:51 -04:00
Aidan MacDonald
ecfec3e9bf buflib: add handle_to_block_end
Change-Id: I598cf32bc8cd08ab4bca3827645e0a38b284468f
2022-09-19 15:09:51 -04:00
Aidan MacDonald
88b21731fc buflib: enable all paranoia checks
Since allocation is infrequent in Rockbox enabling the extra
checks to catch memory corruption is probably worth the time
and code size cost.

Change-Id: If0d701421054328c57b69e4d0af30759d799d158
2022-09-19 15:09:51 -04:00