Commit graph

36346 commits

Author SHA1 Message Date
Christian Soffke
246152a671 Database: Fix possible crash
The File Browser and Database apparently share
the same selected_item_history, which means that
selected_item can be -1 even in the context of the
database,

This leads to tree_get_file_position being called in
id3db mode, which isn't safe to do.

Change-Id: I46151e8a823afab0b57ad839cde13f6072b8917b
2022-10-30 11:57:33 -04:00
Aidan MacDonald
b4e7c60c6d Shanling Q1: Disable recovery kernel boot option
The Q1 handles firmware updates by unpacking the firmware image
from the player app, then rebooting into the recovery kernel.
The recovery kernel reflashes the player kernel and rootfs with
the unpacked update files on the SD card.

Booting the recovery kernel directly is therefore not useful to
the vast majority of users; remove the option from the recovery
menu and remove the key combo.

Change-Id: I6cebfb6a3514ff2ae7d6f3904ac93b481773799b
2022-10-29 12:51:05 +01:00
Aidan MacDonald
a5b08d0af7 Shanling Q1: Support OF-initiated firmware updates
It's now possible to install OF updates on a rockboxed Shanling Q1.
Previously these didn't work because the RB bootloader interrupted
the update process.

Updates will proceed as they normally do on a non-Rockboxed Q1,
except at the end of the update you'll reboot to Rockbox instead
of the OF. This is only a minor inconvienience and doesn't affect
the update process.

Change-Id: I0f8fc96f073c50c1512bf60e0927491be8178eb0
2022-10-29 12:51:02 +01:00
Aidan MacDonald
d09fb6bb6b x1000: Pass CPM scratch register to the bootloader
Change-Id: Iaef4606dc6f3cb9904d87ee92db69fb9ef48bcb0
2022-10-28 20:58:26 +01:00
Aidan MacDonald
744ea2ff43 x1000: Allow SPL and bootloader to pass arguments to next stage
Change-Id: I61591d704c14acf06cd192a6e9355f0a9c25d0d8
2022-10-28 20:32:38 +01:00
Aidan MacDonald
9e258652c4 x1000: Add a basic sanity check for bootloader backups
The bootloader backup is intentionally simple, but it's a little
*too* simple. Add a sanity check to make sure what we're backing
up or restoring contains the first 8 bytes of the SPL header.
This isn't going to catch all possible problems, but it'll stop
obviously non-functional backups from being restored.

Change-Id: I6e80351aeb96c467f0514bd0ecd77d94ff72a8f8
2022-10-28 20:32:38 +01:00
roman.artiukhin
202eb8c06a Fix wrong formatting in WPS
Fixes FS#13354 and FS#12980

Change-Id: I4ec4cb57cfb64494e633d0bb92e733d92593c075
2022-10-27 18:21:49 -04:00
Aidan MacDonald
4b7b7a0a83 shortcuts: Reduce SHORTCUTS_PER_HANDLE to 4
The current value of 32 per handle seems excessive. Buflib overhead
per handle is only 20 bytes and a single shortcut is > 500 bytes.
Reducing SHORTCUTS_PER_HANDLE means that minimum memory usage can
be lower when there are a few shortcuts, at the cost of marginally
increased usage for large numbers of shortcuts. This is helpful to
keep memory usage under control for low-memory targets, where 16 KiB
is almost 1% of system RAM!

Change-Id: I47dbe0da874ae512cf50a0bd8350576ab2fabdf4
2022-10-27 11:10:47 +01:00
Aidan MacDonald
b677da6595 shortcuts: Increase max shortcut name to 64 bytes
32 bytes is a little small, and it's also good to have extra
space to accommodate non-English languages.

Change-Id: Iced38fd5140e219b16dcfa6d30cc4191266926bd
2022-10-27 10:49:58 +01:00
Christian Soffke
f8d1f791be manual: update quickscreen defaults
'Show Files' hasn't been a default
QuickScreen setting for a while

Change-Id: I9ed95897bef5c3b95d38e3ee5a7db3cb723cb17b
2022-10-25 03:26:53 +02:00
Christian Soffke
193ebb5a36 Enable access to Shortcuts Menu from QuickScreen
Offers a quick way of switching to the Shortcuts Menu
by pressing the 'context menu' button while QuickScreen
is active (e.g. long press Select on iPods and some other
players)

Change-Id: I38292c7070cf093a81e1db688809b1f0d6a8764a
2022-10-25 03:26:51 +02:00
Christian Soffke
498988d34a PictureFlow: Minor fixes & changed defaults
- Fix FPS counter overlapping
the artist string when
"Show album title" was set to
"Show album and artist at the top"

- Fix disappearance of center album
if certain Settings menus had been
accessed while list of tracks was
showing and you then returned to the
list of albums

- Fix disappearing album artwork after
cache had been created until you started
scrolling

- Enable context menu even if WPS
integration is disabled

- Make splash screen appear only
on first launch and for database
updates, when it is actually on screen
for long enough

- Eliminate 'Loading' splash if tagcache
is in RAM

- Show both album and artist by default on
displays whose height > 100px

Change-Id: Ie70c0d9093789294d288a4f88338ee4a588bf4a5
2022-10-22 09:33:50 +02:00
Christian Soffke
653082ad1d Database: Adjust "Play Selected First"&"Shuffle" behavior
- With "Play Selected First" and "Shuffle" enabled,
another item was randomly selected when returning
to the list. This appears to be a bug

- With "Play Selected First" disabled, the first item was
selected. This appeared to be intentional, since, at least with
"Shuffle" disabled, that is the item that was played
back. This may not be helpful either, since it makes you lose
your place in what can be a long list. It is also  not
consistent with the behavior of the File Browser. The current
selection should probably be maintained in all cases.

- At least according to the manual and the behavior of the File
Browser, "Play Selected First" should only apply when "Shuffle"
is enabled.

Change-Id: Ic1205477d5bf8b22f8f32dd6d31d3b9ceb5a2d24
2022-10-21 03:59:49 +02:00
Aidan MacDonald
e27a6bad4f skin engine: Remove redundant argument from do_non_text_tags()
The skin viewport is already passed in info->skin_vp.

Change-Id: I5369684ba2a743d7bd804b33845bdb6ac17c46d0
2022-10-18 12:56:28 +01:00
Aidan MacDonald
015101bb2c Remove prototype for nonexistent sb_skin_data_load()
Change-Id: If4551cd10850c10ce091792da8770e0886aa20b9
2022-10-18 12:56:28 +01:00
Aidan MacDonald
14fbefdf39 Move skin global state to the WPS
This state is actually specific to the WPS and it makes more
sense to put it there.

Change-Id: I5dfee237fdcbae944806501ff3127a930820d68a
2022-10-18 12:56:28 +01:00
Aidan MacDonald
13da1ba785 Remove is_fading from the global WPS state
Turns out it was never assigned and always false.

Change-Id: I8cd9118682e7a0785c262d4c0594f8f51412c18b
2022-10-18 12:56:28 +01:00
Aidan MacDonald
33a47e4a49 Remove ff_rewind from global WPS state
Turns out it's local to ffwd_rewind() in the WPS.

Change-Id: Iaa6e69185db67b8aad61f1d2ad29c98f15f37370
2022-10-18 12:56:28 +01:00
Aidan MacDonald
6e4c866756 Remove unused 'may_fade' argument of pause/unpause_action
Change-Id: I4eedcf30fa704521e751732a56775c43e9a8bd99
2022-10-18 12:56:28 +01:00
Aidan MacDonald
e03bc66594 Correct typo DEFAULT_SKIP_TRESH -> DEFAULT_SKIP_THRESH
Change-Id: If8f7d11301a07a7f63adfac618f07cfed9516eef
2022-10-18 12:56:28 +01:00
Aidan MacDonald
46c3d1e030 Cleanup unused cruft in wps.h
Change-Id: I4278bea7342a859b18b72a9a4b1918b403842bb8
2022-10-18 12:56:28 +01:00
Christian Soffke
0761532d09 Don't autoload bookmarks after saving dynamic playlist
4f83e66 (FS#13287) introduced a useful option to
immediately re-load the saved dynamic playlist, so that
bookmark creation becomes possible.
(Current Playlist->Reload After Saving)

It seems unnecessary and won't produce the intended
effect to autoload bookmarks after the playlist is saved,
since playback position will be restored to where
it was previously.

Additionally, with "Load last Bookmark" set to "Ask",
the dialog  for choosing a stored bookmark will appear
after the playlist has been saved. The dialog is
unwanted, since:

- Selecting a bookmark doesn't have expected effect
- Selecting "Don't resume" will actually resume
- Cancelling out of the screen will prevent the
saved playlist from being loaded, without this being
obvious to the user
- It causes a crash if the dynamic playlist is saved
from within the Playlist Viewer (both the Playlist Viewer
and the bookmark selection screen use the plugin
buffer)

Change-Id: I7d696e56c89394b3cd10ef6acfed4ddc7e814118
2022-10-18 07:23:25 -04:00
Aidan MacDonald
55185277ba Fix red for Android builds (c6ee9dc883)
Change-Id: I416fbd24bd2dd91738cb8664b8f3f4877905336d
2022-10-17 15:20:28 +01:00
Aidan MacDonald
f805b492d5 Fix red for !HAVE_ALBUMART targets (c6ee9dc883)
Change-Id: Icdd6e051e5f9b31b287d53d9480f445df884d9d1
2022-10-17 15:20:19 +01:00
Aidan MacDonald
c6ee9dc883 Limit exposure of skin engine internals
Drop wps_internals.h from skin_engine.h. The WPS and to a lesser
extent the radio screen are too tightly integrated to drop their
dependency on wps_internals.h, unfortunately. Skinned lists, for
obvious reasons, also need access to the internals.

Change-Id: I00a55aa423900f9ad22edccbe2fc1910af380e38
2022-10-17 14:29:12 +01:00
Aidan MacDonald
4bd97c6535 mips: consolidate exception handling, add exception backtraces
Merge the x1000 and jz47xx exception handling code since they use
the same exception vectors and handlers. The interrupt handler is
now called from the common exception vector, but remains separate
for each board since they have different IRQ layouts.

The new exception handler can provide a stack traceback from the
interrupted code, rather than the (uninteresting) caller traceback
displayed by panicf. This allows you to see what led up to a null
pointer deref or division by zero, which makes it _much_ easier to
track down errors that occur in common leaf functions like strcmp.

Change-Id: I59a0ebb5e40fcb36505c3bfdb47f8cac2f9936b1
2022-10-17 09:04:18 -04:00
William Wilgus
56d4227897 yesno_res gui_syncyesno_run fix scroll run-on bug
the GUI_EVENT_NEED_UI_UPDATE event was not canceled till
after the call to scroll_stop this resulted in the scrolled line
being re-added after the function was done causing a crash

thanks spork, amachronic

Change-Id: I2e484a2b877f6da63171eb997f62a21e95ca9bfc
2022-10-16 13:02:12 -04:00
Aidan MacDonald
5e864ecde9 linked list: add lld_insert_prev/next()
Change-Id: I55ff061ccc0e6e2dad3125a8150c082c163db329
2022-10-16 16:10:24 +01:00
Aidan MacDonald
ee9679993b linked list: inline list init functions
These functions are so trivial it's always cheaper to inline them.

Change-Id: Ie0c77c8b6e7a716312105445a22e62ff57a76d90
2022-10-16 16:10:24 +01:00
Aidan MacDonald
8bf8036021 lcd: Fix clear_viewport on grayscale displays
The original drawmode change was "x = (~x & INVERSEVID) | SOLID"
which is essentially XOR'ing the INVERSEVID bit, but I changed it
to mask out INVERSEVID by mistake.

Fixes 44b9785465.

Change-Id: I87b059b89aea9c31a8ff408016264285e67ca80c
2022-10-16 15:41:50 +01:00
Aidan MacDonald
1718cf5f8a Convert a number of allocations to use buflib pinning
Several places in the codebase implemented an ad-hoc form of pinning;
they can be converted to use buflib pinning instead.

Change-Id: I4450be007e80f6c9cc9f56c2929fa4b9b85ebff3
2022-10-16 14:50:39 +01:00
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