1
0
Fork 0
forked from len0rd/rockbox
Commit graph

37868 commits

Author SHA1 Message Date
William Wilgus
44e36aba94 skin_render small cleanup
should be no functional changes
looking at the blame for this file shows the buffer was made
static originally due to stack overflow.

Removing static buffer in favor of using the skin buffer
directly shouldn't cause a regression.

Change-Id: I941ed675c5ba8799bea678af61c196eb453a4788
2024-12-31 20:17:56 -05:00
Yakov
832e0fd458 update .gitignore to ignore macos files
dYSM files were generated upon building the simulator

Change-Id: Iff621925c862c784494165ce7d0d145f523fc1da
v
2024-12-31 15:56:28 -05:00
Christian Soffke
fe78b07db6 Playlist Viewer: Address problematic index buffer sharing
Borrowing the index buffer of the current playlist
can be problematic, since it is possible to start
playback of a different playlist from the playlist
viewer without leaving the viewer, thereby causing
a collision.

As long as we have a sufficiently large plugin
buffer, take advantage of it, regardless of
playback state.

When playback is stopped, always resume the playlist
from the control file before loading it, even if the
playlist has finished playing, to prevent running
into invalid indices.

Note:
dcfrefs_handle is initialized to 0 automatically for
the static on_disk_playlist struct.

Change-Id: I2a05a6a51a088ea9ba73858c353525db9e61c36e
2024-12-31 10:08:31 -05:00
Christian Soffke
3389a08d56 dynamic playlist erase warning: skip for finished playlists
Change-Id: I9d209a011024e658ffc4da0a723ae8f9ec407702
2024-12-31 14:59:18 +01:00
Solomon Peachy
a8540390c2 FS#13536: Updated German Translation (Karl Huber)
Change-Id: Ib2a6e03496f9a1a50e853ef4d2edc830af99310b
2024-12-31 07:15:43 -05:00
William Wilgus
727d2ab749 wps skin_parser free up skin ram with int16_t
change ints to int16_t especially image and rect sizes

ditto font_ids

frees ~250 bytes in cabbie

Change-Id: I271be05a26e2090f6e1b11d809afd1c4bee32803
2024-12-31 01:53:20 -05:00
William Wilgus
ea5ca58dc6 optimize language.c lang_english_to_id()
speed up comparisons by getting length of the supplied english string
and filter based on length finally use our length to do memcmp since
we know where the null is already

Change-Id: I595f03ae4b08ee0d59bb9adacbe3b69f08991a9e
2024-12-30 23:17:57 -05:00
William Wilgus
186ad1234b [BugFix] pathfuncs.c path_append_ex basepath_max might cause buffer ovfl
strlcpy returns the length of the string that would have been copied
had there been sufficient space basepath_max might still be
larger than buf_size yet smaller than len
which would result in a null terminator being written past buf[buf_size-1]

Change-Id: I43e8ba9f72ea35bfe4f759ecd102c2e4bd26eb75
2024-12-30 19:35:33 -05:00
William Wilgus
27aff7ec8d strcasestr optimize for speed and size
revisit this and shave a bit more off on code size

Change-Id: I90546b931780c6779960129619a41cc6592c44e1
2024-12-30 16:42:55 -05:00
Solomon Peachy
6f542b6540 libc: We need to define SIZE_MAX in our stdint.h
Change-Id: Ifbf7ad4ea62c5543bcc7e0bd18d612d30d60b63e
2024-12-30 15:22:11 -05:00
William Wilgus
2a825b866a SIMULATOR help text fix yellow
Change-Id: If425ead1c53f8021f6047abc6c440c1343c68e79
2024-12-29 21:46:34 -05:00
William Wilgus
fcbfa494f5 [Feature] Simulator add F1 help text
give a listing of the keys used in the simulator

Change-Id: Ifcb91c59de41c214d050bd175065fabb6cf9eac4
2024-12-29 21:25:48 -05:00
Christian Soffke
9ba59477a1 sdl: improve window resizing on macOS
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
2024-12-30 01:08:12 +01:00
Christian Soffke
8ce9d9e39e simulator: maintain LCD position/size when toggling background
Change-Id: Id76464b77b33d531d6075a83038466e18fab3a7f
2024-12-30 01:08:11 +01:00
William Wilgus
8884284da4 simulator hand icon on button region mouse over
add a hand pointing cursor over the buttons

Change-Id: Idb54e084b5b768de845a94c5bb13e4435d9b82e5
2024-12-29 16:43:21 -05:00
William Wilgus
fc26ba3f20 Simulator ClipZip ClipPlus add power and volume buttons
Change-Id: I6c7997f436bd0d7f5c0421489823d481b0396eea
2024-12-29 01:38:21 -05:00
Christian Soffke
bfef0a2d6c PictureFlow: fix colors for keyboard and full screen tags
Change-Id: I2dfaf1ff982c6b1c7b7387d673818de7428f85a5
2024-12-27 19:15:09 +01:00
Christian Soffke
8bd62e35cc button_queue: fix cpu never unboosted
regression introduced in da9d67a

Change-Id: Id1496873f1ab72fecc225dcfc78e633eea441089
2024-12-27 17:41:34 +01:00
Christian Soffke
5e09a9246c sdl: fix shutdown hang on MacOS when SDL threads are used
Change-Id: I2179d2beed89beba1716072fc06b9cc090118364
2024-12-27 11:45:53 +01:00
William Wilgus
dca70e1816 compressor remove static delay line buffer
core_alloc works well for this and we can allow the alloc to be moved

bugfix compressor_process() possible buffer overflow

Change-Id: I701c6306c39cc1c7aa72b0dbe402b9b0d1a3fcda
2024-12-27 02:34:18 -05:00
William Wilgus
0c4b78c011 [Bugfix] RTC_TOKEN_PRESENT is less than SKIN_TOKENS_RTC_BEGIN
this blocks the check for RTC_TOKEN_PRESENT

thanks, chris_s

Change-Id: I53a7d83d7cd8e5e9b9d6ea6eed016dc35571bcd3
2024-12-26 08:56:14 -05:00
Christian Soffke
fa8b095f29 sdl: fix: concurrent drawing on Windows
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
2024-12-26 12:24:24 +01:00
William Wilgus
0a88b818e9 lua make memcheck script eat all available ram (incld audiobuf)
Change-Id: Ia202c9097324985a3a9a9c96be8422c38e79cb3e
2024-12-26 01:49:01 -05:00
William Wilgus
962e1b2e69 [Bugfix, ASAN] test_mem plugin fix OOB read in read_test()
asan correctly identified an out of bound read in the test_mem plugin
This shouldn't cause any issue in normal use since the data isn't used

Change-Id: I52acabc4649397f9dd2ba7979f9210529ced2071
2024-12-26 01:49:01 -05:00
William Wilgus
1643e0e287 [Bugfix] metadata.c copy_mp3entry() dest and orig may overlap
I meant to add this with the last patch b07d7d6
since it may supply UNBUFFERED_ID3 to the peek function
which uses UNBUFFERED_ID3 and will try to copy it back
wich is undefined behavior for memcpy

Change-Id: I91160570adac22134c84d3b37f8fcecb097d87d6
2024-12-26 01:29:02 -05:00
William Wilgus
b07d7d6af0 skin_token.c, playback.c, add get_temp_mp3entry()
add function get_temp_mp3entry() to return a valid mp3entry from scratch_mem
UNBUFFERED_ID3
or if playback hasn't been started used statically allocated mp3entry
NEXTTRACK_ID3

Change-Id: I3909fb585e0f5ad590f917ce827e991440f1fe75
2024-12-26 00:58:51 -05:00
Christian Soffke
d323d968d8 sdl: adjust texture access pattern to "frequently"
probably doesn't make much of a difference
for our use case but should prevent creation
of temp buffers

Change-Id: Ie2cbefcbd7b8f94bed340f08bf71f764a32ed1ea
2024-12-25 19:24:32 +01:00
Christian Soffke
32cc5ee8f9 simulator: Press Tab to show/hide background
Change-Id: I80e8f629b1bbf37f92d243e190d541e7360e9dea
2024-12-25 08:34:40 -05:00
Christian Soffke
400452180d sdl: Keep texture around, upload LCD-parts only
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
2024-12-25 08:34:40 -05:00
Christian Soffke
7aaa722a5d simulator: Adjust scaling using keyboard shortcuts
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
2024-12-25 08:34:40 -05:00
Christian Soffke
759cbf4e5f sdl: Remove usage of SDL_SoftStretch
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
2024-12-25 08:34:40 -05:00
Christian Soffke
60f3283f48 sdl: make window resizable, enable high DPI
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
2024-12-25 08:34:40 -05:00
Christian Soffke
79191bf9bb simulator: Fix Sansa Clip display position
Change-Id: I23be28e6bfa4ead326416d0457ffa11c3bf18a54
2024-12-25 12:23:27 +01:00
William Wilgus
b44f8f3723 [FixYellow] skin_tokens.c add a preprocessor directive that actually works
Change-Id: I4345093be1d953e80f0043f6edd361517f74069b
2024-12-25 01:40:53 -05:00
William Wilgus
4fe6ce91ec skin_tokens.c use static mp3entry if over 2k
Change-Id: I5c1130673d2caf1198aa65c2b84bc7102f768c3d
2024-12-25 01:27:52 -05:00
William Wilgus
6bec4597bf get_mp3entry_from_offset remove static from struct mp3entry
I think with the recent refactoring we should be able to put mp3entry
on the stack

it should be moved up a level anyway

Change-Id: Idd2af598c48545e3dbc774279b5d2b264012805e
2024-12-25 00:56:49 -05:00
William Wilgus
8981311800 skin_tokens.c break quickscreen items out to a function
rather than a function call for each qs item along with the data
for those calls in the switch for get_token_value()

it makes more sense to just have the qs_token function
handle all of the logic

Change-Id: I3b3072496611fc2c536eec33c7cdf9fb2ec67ee0
2024-12-24 12:43:26 -05:00
William Wilgus
25ab00465e metadata.c don't store encoder filename for all the decoders
there are only 4 encoder capable codecs just make it a function
and add a macro to keep it sane

Change-Id: Iac8833226434f8436bc678f3e409f462764d8fdc
2024-12-24 01:47:18 -05:00
William Wilgus
f6b13c0fd0 skin_tokens.c break rtc code and id3 into own functions
clean-up the switch a bit by putting rtc code in its own function

move the id3 tags to the default branch and only read id3
if its actually needed

Change-Id: I0a6fe9aea646defcfdda731c4c963977173c4133
2024-12-23 22:57:52 -05:00
William Wilgus
dfd01709c5 [Bugfix] theme %ss will overflow buffer, update %ft manual entry
%ss did not check for the size of the resulting string before
copying it to the buffer

%ft has a search text mode

Change-Id: I1321681c249251aafe0e39bcc510b9e81f0cd0d3
2024-12-22 23:59:31 -05:00
William Wilgus
50515de940 [Fix Red] Manuals
Change-Id: Ie61e06b77d1e3ee2fcf06503bc6f487df67ebe64
2024-12-22 10:17:21 -05:00
William Wilgus
7d1cdf3ece small cleanup skin_parser parse_album_art parse_image_load
bugfix parse_font_load() allow fonts with . in filename

Change-Id: Idcd201f624699e184e5181a46848c36b7e3fca49
2024-12-22 09:18:22 -05:00
William Wilgus
7c678f5e7a [Feature] %ft file text tags add prefix search
%ft(filename,search_text)
finds a line beginning with search_text strips search_text and returns
the remainder of the line

Change-Id: I06fe029b89aa60e4dbf34c039d180c75213519a4
2024-12-22 01:11:10 -05:00
William Wilgus
632e72273d small cleanup putsxyofs()
store the vp local rather than using current_viewport
use the flags directly rather storing them

Change-Id: I93391acff4745aae3d5d7e695c0eabd6dbeabb11
2024-12-21 19:11:02 -05:00
William Wilgus
8091477f8d Optimize 16 bit lcd_fillrect()
move switch outside loop

adds ~10000 ops/s in test_gfx

Change-Id: I2204d637282aae4bbc0dde31395c6cc0568f3247
2024-12-21 18:19:38 -05:00
William Wilgus
d6e99178aa lcd-16bit-common optimize bitmap_part
in testing this slightly speeds up any of the draw routines using fg or bg
and slightly slows down the ones that don't
being that these are already faster it serves to bring them closer in
ops per second

.. and slightly speeds up the most general case DRMODE_SOLID

Change-Id: I4ea4898354e8bc9dfa7e96f188108ca77ea0aca9
2024-12-21 16:37:35 -05:00
William Wilgus
9c477e84ff [Bugix] %ft has access to the root of the drive using /
path_append treats a path starting with / as absolute
allowing escape by themes

Change-Id: I8e5fb55f01cacd5ec0fc5538d92dfcfbdceb6892
2024-12-20 22:59:03 -05:00
William Wilgus
774357e722 [Bugfix] Volume, track starting and track ending no default timeout
if no params are given these three supply a default
it wasn't being applied since it was guarded by the else{}

Change-Id: I2966fd7d8daa695d8b214461749c93b3e7883e51
2024-12-20 22:41:07 -05:00
Dana Conrad
48811ed4a8 ErosQ Hosted: Fix maximum volume upon plugging in headphones
Ref. FS#13533

Change-Id: I343df8cd351bb2578dd11894114903eba527f2c7
2024-12-20 12:09:35 -05:00
William Wilgus
660fa3ffdc scroll engine calculate stringsize only when scroll line updated
we calculate the size of the scrolling line every scroll update
the line data doesn't ever change without a call to update
instead calculate the string size when the line is updated
re-use this value while scrolling the line

in theory the current font could change but in practice
I can't find a case when the string size needs to be updated
that the scroll engine isn't already updating the line

if this is later an issue we can recalculate the stringsize each time
the line is finished scrolling which still saves quite a few calculations

Other:
I don't think we have any targets with pixel counts exceeding 65535 pixels
where unsigned short stringsize will be an issue

Change-Id: I83d6374377ed648d9a320d4fd69f9d6a17095b0c
2024-12-20 10:31:46 -05:00