Commit graph

16427 commits

Author SHA1 Message Date
Aidan MacDonald
4c60bc9e68 New port: Shanling Q1 native
- Audio playback works
- Touchscreen and buttons work
- Bootloader works and is capable of dual boot
- Plugins are working
- Cabbiev2 theme has been ported
- Stable for general usage

Thanks to Marc Aarts for porting Cabbiev2 and plugin bitmaps.

There's a few minor known issues:

- Bootloader must be installed manually using 'usbboot' as there is
  no support in jztool yet.

- Keymaps may be lacking, need further testing and feedback.

- Some plugins may not be fully adapted to the screen size and could
  benefit from further tweaking.

- LCD shows abnormal effects under some circumstances: for example,
  after viewing a mostly black screen an afterimage appears briefly
  when going back to a brightly-lit screen. Sudden power-off without
  proper shutdown of the backlight causes a "dissolving" effect.

- CW2015 battery reporting driver is buggy, and disabled for now.
  Battery reporting is currently voltage-based using the AXP192.

Change-Id: I635e83f02a880192c5a82cb0861ad3a61c137c3a
2021-07-13 22:01:33 +01:00
Tomasz Moń
321680973b
Sansa Connect: Display battery info in debug menu
Show battery temperature, current, discharge power and available energy
in battery debug menu.

Change-Id: I799af4e5ca7ec168d726e689264e0f092ebc2bf7
2021-07-12 14:14:59 +02:00
Tomasz Moń
60e2cd6de9 DM320: Regorganize LCD and TTB memory layout
Do not introduce any change for M:Robe 500 as it uses the two LCD frames
in non-obvious way.

Sansa Connect and Creative ZVM use only single front framebuffer.
Place TTB at DRAM end to minimize memory loss due to alignment.
Reserve as little as possible memory for the LCD frames.
On Sansa Connect this change extends audio buffer by 858 KiB.

Change-Id: I21bdeec4cfba86d71803a39acd651a87e73767e6
2021-07-09 09:24:38 +00:00
Solomon Peachy
2ff3425ab1 build: Rename SHARED_LDFLAG to SHARED_LDFLAGS
Change-Id: Icb81c72fbcfcdad624112a386ba38a40a830d18f
2021-07-08 19:53:05 -04:00
Solomon Peachy
a952cf52d5 voice: Corrections to 24-hour time voicing:
* Voice leading "Oh" if hours is under 10.

 (ie "0900" is read as "oh nine hundred hours"

Change-Id: I09853909221e0dd6da354f7e4bb9733ff5edca90
2021-07-08 10:57:57 -04:00
Solomon Peachy
7f638e54ee RFC: Fix a couple more dangling stack-allocated viewports
They could end up getting referenced after the stack has been popped.

Change-Id: I12abbf3f436ecfde76a37f2623a044915800d2b2
2021-07-07 15:19:43 +00:00
Tomasz Moń
e11fa5f74e Sansa Connect: Initial libertas WiFi driver port
Import non-free firmware image from linux-firmware package.

Firmware loading works but is disabled at compile time because just
loading firmware without configuring device results in higher power
consumption without any benefit to end user.

Change-Id: I8fd252c49385ede1ea4e0f9b1e29adeb331ab8ae
2021-07-04 07:41:44 +00:00
Franklin Wei
d1a92aafff sdl: increase default worker thread size.
This fixes a mysterious, long-standing crash that's been bothering me on
ipod6g for ages: a silent stack overflow in the sound mixing thread (which
is triggered upon loading a new sound, apparently) will thrash the memory
which is located directly before it in the address space.

In this case, it was the SDL_ButtonState variable which stores the mouse
button state that was being trashed. This was manifesting itself by making
the player always run forward, since MOUSE2 is mapped to +forward by
default.

Fix this by quadrupling the stack size of SDL-spawned threads (not the main
thread) from 1 KB to 4 KB.

Change-Id: I2d7901b7cee1e3ceb1ccdebb38d4ac5b7ea730e1
2021-06-28 02:51:48 +00:00
Tomasz Moń
3738510953
Sansa Connect: Implement RTC functionality
Use 32-bit monotime AVR counter for time tracking. Set the time by
adding fixed offset to the counter value. Store the offset in rockbox
directory to make it persistent between reboots.

Do not implement alarm functionality as wakeup is only possible from
sleep and not from complete power off.

Change-Id: I615c7eb4df8ab0619dcbfcff107bc7051a15aace
2021-06-25 16:12:06 +02:00
Aidan MacDonald
6da490099b Touchscreen: absolute point mode scrolling bugfix
Due to this inadequate bounds check, it was possible under certain
conditions to cause a crash by touching & scrolling in the empty
space "after" the last item of a list.

Change-Id: Ic6c30214d887e1c7ccb212de272248ca24f60856
2021-06-22 21:42:02 +01:00
Aidan MacDonald
76e07a7fd2 Touchscreen: adjust how bar padding is handled
The old way of padding out bars was to just create a bigger touch
region, the intent being to make it easier to touch the end of a
bar. Unfortunately, this didn't even accomplish that, and caused
an annoying offset between the bar graphics and the touch point.

New method is to account for padding explicitly and clamp touches
in the padding region so they are within the proper touch region.

Change-Id: Id39e571fc1b033a4da94f0eb1143a2fc276bab03
2021-06-22 21:37:02 +01:00
Aidan MacDonald
02860d67c3 Touchscreen: adjust calculation of bar touch position
Increased the precision of the bar from 100 steps to 1000 steps so
it is possible to make finer adjustments, and made it possible to
pick the maximum value in a bar rather than just the maximum - 1.

Change-Id: I2e694d3e86e4a151e014da1bd15ab3ade4c4b95e
2021-06-22 21:37:02 +01:00
Aidan MacDonald
8a6b2f3abc Touchscreen: make volume bars respect volume step increment
Change-Id: I449b305ec4070e61f3619f8b7ac01a74c3ac59a6
2021-06-22 21:37:02 +01:00
James Buren
fc92081080 rockbox: add a crc32 reverse polynomial function
This uses the reverse of the polynomial used by the current crc_32
function. The code for this was derived from the implementation used
by tinf. This version is space optimized and should be a good way to
reduce code duplication in other parts of rockbox that use the same
crc32 algorithm. This is mainly of use in areas where DEFLATE is in
use.

Change-Id: I918da5b4ea4dc441c0e7e6b5007abcc2da463bcb
2021-06-21 03:37:17 +00:00
Aidan MacDonald
7aade87863 Fix yellow from 9ccae042
Change-Id: Iad4eaab8b766d1d0aad051971fd49a64126ca4be
2021-06-16 21:22:49 +01:00
Moshe Piekarski
9ccae0421a Implement x^y in calculator
Change-Id: I868b703131675876bd91198b8a53a921152aecba
2021-06-16 19:50:14 +00:00
Dana Conrad
c067b344e8 FS#13297: M3K Autolock allows one action before disabling touchpad
Intercept buttonpress and action, and nullify both if the button
is part of the touchpad. Only affects autolock functionality.

Adding removal of note about autolock in the manual - the lock
button no longer needs to be pressed at least once to prime
the autolock, if enabled, since commit 14f7a95

Change-Id: Ic3582764df490d96abc2d78116f23cbe0fdd6173
2021-06-12 21:11:28 +00:00
Dana Conrad
4c94c17913 ErosQ: undo ACTION_YESNO_ACCEPT button release
I accidentally left this in commit 8056b7f, and I think I'm giving
up on this for now - it just gets too complicated in the usb use
case. Revert to BUTTON_PLAY.

Change-Id: I9e392a3d7f2c18f34de54ecbafdb27cdf863b28c
2021-06-06 21:44:24 +00:00
Dana Conrad
14f7a958af Softlock Improvements
Add a check to see if the keys are currently locked and allow
them to be unlocked to ensure we don't get stuck when the current
playlist ends while the WPS is locked.
(Original by Aidan MacDonald)

Adding initialization for unlock_combo and to arm the autolock
(if enabled) without the user needing to press the lock button
at least once every boot (which is the prior behavior).

Removing screen_has_lock check from is_keys_locked()

Change-Id: I0fbf9b9746b011a7086ec8505a7ecc4b84f2d332
2021-06-04 00:00:57 +00:00
Dana Conrad
8056b7fd1a Yes/No Screen: Allow accept to be button release
Allows the ACTION_YESNO_ACCEPT action to be set
to a button release by ignoring certain system events.

Moving USB init in main.c to the last thing to prevent
getting stuck in the USB prompt, if enabled.
Also changing ACTION_YESNO_ACCEPT to button release on erosq

Change-Id: I5e7498521a13cb4e840223dd0b9c8633e99093bc
2021-05-27 19:58:09 -05:00
Dana Conrad
10d199f9d5 Allow Softlock to happen in most contexts
All this tested on erosq, I'm not sure if this will break on other targets or if there is a reason this shouldn't be done.

apps/menu.c:

Added CONTEXT_MAINMENU|ALLOW_SOFTLOCK in do_menu(), this allows the user to lock the keys in most places within the main menu tree.

apps/tree.c:

Added CONTEXT_TREE|ALLOW_SOFTLOCK in dirbrowse(), this allows locking the keys in most other contexts not covered by the above.

Notable exceptions I've found that still cannot be locked: View Playlist, any settings change screen (ex. Shuffle No/Yes, Volume Select dB)

Adding fix for Advanced Key Lock feature brought to light by this change in apps/action.c.

Expected behavior for Advanced keylock is now (according to my testing here):
        Volume:	Can be exempted	from keylock anywhere
        Skip/Scrollwheel: Can only be exempted in WPS
        Seek: Can only be exempted in WPS
        Play: Can only be exempted in WPS

Backlight exemption is same except the Volume exemption doesn't work outside the WPS, but I don't believe that is due to this change.

Change-Id: Ifa3d1a03cf4884520a37dd91ed53a825cdb66778
2021-05-24 02:30:09 +00:00
Aidan MacDonald
5cbeb88541 FiiO M3K: keymap improvements & fixes
- Add support for skip and seek while the player is locked.
  (Thanks to @bahus for the suggestion)
- Fix touch zones because the down button zone ended up being
  a lot smaller than expected due to the touchpad's wonkiness.
  Also added a visual display of the touchpad to its debug menu.
- Fixes the pictureflow keymap because it was mostly unusable.

Change-Id: Ic0da4f8df3613ff7828ce1cb940ed9e77ada3281
2021-05-22 12:20:44 +00:00
Aidan MacDonald
a2bac25a63 Allow alternative keymap when keys are locked
To enable support targets must define HAVE_LOCKED_ACTIONS and then
handle the CONTEXT_LOCKED flag from get_context_mapping().

Change-Id: I92703b534e4a45b4ebbf9bf98af42df9b8ac3b1a
2021-05-22 12:20:23 +00:00
William Wilgus
e910f63bba lua add a way to filter settings on read
rather than dumping all the settings allow a filter function
to choose desired settings

in menucoresettings you can see an how to do exact text matches
or wilcard matches you can even use luas version of regex

Change-Id: I4c7f7592498ea194e06e9a556b77ffd57f5d4223
2021-05-19 23:29:10 -04:00
William Wilgus
dcff9b85a3 lua latebound function update
return the nextfunction and nil instead of pairs it allows a faster
return to lua rather than calling the lua function
pcall(fnpairs) from c and returning the result back
into lua to kick off the search
yeah, no clue why I didn't realize that before..

testing in x86 and ARM..
its more RAM efficient to do the initial creation
of the stack in lua code for the __pairs functon
its not faster but being that its a one time hit per
iter creation the reduced churn alone should be worth it
along with a reduced peak RAM usage

fix bug where a failed module can not be reloaded

optimize filetol

fix potential bug in splash scroller when no break character is found
Change-Id: I42c922e07039a19138b97c0d0e80cf3cf2426471
2021-05-19 23:28:35 +00:00
Solomon Peachy
3ed035769c FS#9093: Database initialization hangs if there's no music file on the player
Original patch by William Poetra Yoga Hadisoeseno

Change-Id: I198a4d1b2899bd9200a35dbefd034a2e9857fa19
2021-05-19 16:30:32 -04:00
Solomon Peachy
64bed8361d FS#13289: Updated Polish translation (Adam Rak)
Change-Id: I6680eac724a480006126d9128f8cc852f6221095
2021-05-15 11:18:59 -04:00
Aidan MacDonald
237919f1c3 Fix invalid use of bool in doom
Settings code tries to cast the bool pointer to an int pointer
and then write through it, which makes AddressSanitizer whine.

Change-Id: I1d6162fc98144cd6b40444016b3b48ef02967324
2021-05-13 18:33:27 +01:00
Dana Conrad
84a3cbe24d ErosQ: Small keymap changes
- Move WPS Stop to Power (Hold)
- Add WPS Hotkey to Wheel scroll Fwd/Back
- Add WPS Quickscreen to Play (Hold)
- Add Tree Hotkey to Play (Hold)

Change-Id: Id74622138353521f736c0de1009a354307b108eb
2021-05-12 11:01:27 +00:00
William Wilgus
adff45ca21 lua -- temp loader
fix a few bugs, improve memory usage

Change-Id: I6ceefd033000a6178eab0dd513679b5d72cec81c
2021-05-06 21:36:55 -04:00
Solomon Peachy
244aad750c Update the english-us "translation"
Change-Id: Ife8dc52dd60fa10e8713f85969cebb6a865fd624
2021-05-04 21:56:41 -04:00
William Wilgus
9b2f23319c lua fix yellow and add temploader
temp loader allows some lua requires to be loaded and
later garbage collected unfortunately the module needs to be formatted
in such a way to pass back a call table in order to keep the functions
within from being garbage collected too early

BE AWARE this bypasses the module loader which would allow code reuse
so if you aren't careful this memory saving tool could spell disaster
for free RAM if you load the same code multiple times

Change-Id: I0b6f81e481b8c779edbd620c8403794f8353926f
2021-05-03 23:13:25 -04:00
William Wilgus
489a5f3ff7 lua add ability to use custom kbd layouts
bring custom keyboard layouts to lua
conversion to the proper format requires create_kbd_layout.lua
just pass a lua string with your desired layout

Change-Id: I14a392410846311a4f3cf8dda0e88d39834d0418
2021-05-04 01:52:08 +00:00
Dana Conrad
4f83e66cd4 FS#13287 - Load a newly saved playlist and resume where it was
Works from any playlist saving operation accessed from the
While Playing Screen, all other playlist saving operations
are unchanged.

Now a user-selectable setting! Located in
General Settings -> Playlists -> Current Playlist ->
Reload After Saving (Yes/No)

Change-Id: I5085c3f4c56c518a812d5ee015d15cc4dca19a28
2021-05-03 20:10:27 +00:00
William Wilgus
20cd89908d lua submenus add a way to dynamically add items
updated example script and renamed some functions as well

fixed bug in printtable cursor position if greater than maxlines for the
screen would reset to item 1

now we move the list start and select it
(and try to center it on the screen)

fixed a few bugs in the add_menu code

Change-Id: I01dead0481ef2e925af8b4cc6c14e36c2859dbba
2021-04-30 13:38:54 +00:00
Aidan MacDonald
20fc928221 x1000: Centralize common definitions, memory layout
Change-Id: I8daad058ae55d4b750b1ae407153e4917de5d095
2021-04-28 20:04:10 +01:00
William Wilgus
63b6281505 lua add submenu module + cleanup
allows menus + submenus + context menus all with simple tables
menu_t which is a table of strings
func_t which are the corresponding functions to go with those strings

see lua_scripts/submenu_demo.lua

Change-Id: I907b74b4abef0ecbe49f181d0ced6e6d20e94de5
2021-04-28 04:37:16 +00:00
Aidan MacDonald
d5695822a7 MIPS: remove .MIPS.abiflags section
The abiflags data is only used to communicate ABI information to a
program loader -- you can see what info is stored with readelf -A.
Dropping it shaves 24 bytes off of every binary (including plugins).

Change-Id: Iae78eeffe5c840ff67717707fb94821d24aac8ec
2021-04-26 12:41:06 +00:00
Solomon Peachy
7d0d32dbc6 Nuke the never-functional iriver ifp-7xx port
It never worked, and hasn't compiled in something like a decade, Given
the HW capabilities (limited onboard flash, no expandability) there's
really no point in trying to fix/complete it.

Change-Id: I7d175089840396f8891645bd10010d730dd5bfdc
2021-04-26 07:42:58 -04:00
Solomon Peachy
3ba2f6e5c7 Nuke all TCC77x targets: iAudio 7, Sansa C100, M200(v1-3), Logik DAX
They were never finished, never saw any release ever, and haven't
compiled for the better part of a decade.  Given their HW capabilities [1],
they are not worth trying to fix.

[1] 1-2MB RAM, ~256MB onboard flash, no expandability

Change-Id: I7b2a5806d687114c22156bb0458d4a10a9734190
2021-04-26 07:41:51 -04:00
Aidan MacDonald
c37555d30d FiiO M3K: remove the bootloader install debug menu
This menu serves no useful purpose anymore. I plan on adding an
improved version of this functionality to the bootloader instead.

Change-Id: I6a93625789f7192031eb6cee6708f9a867318622
2021-04-25 14:42:53 +01:00
William Wilgus
557ff6a981 lua print_button script
also allow splash_scroller to be used as static text display

Change-Id: Idc8c9e60ada920e2d1abd5301b59bd235e21a1c2
2021-04-24 00:00:44 -04:00
Solomon Peachy
75d9393796 rockboy: Properly fix the GCC11 code style warnings.
Change-Id: I69c77717604051052288a2d0f3aab068516d18ef
2021-04-23 09:25:47 -04:00
Solomon Peachy
0271c0ed36 rockboy: Upstream code style trips GCC11 warnings.
Code in cpu.h is correct, so just disable -Wmisleading-indentation for
the specific sections that matter.

Change-Id: I378f3a6fef117ac73edb0d8ce998ef3a818be22e
2021-04-23 08:45:33 -04:00
Solomon Peachy
ebb9090004 xzbox: Fix misleading indentation that triggered GCC11 warnings
Change-Id: Ice462ef188dba3bc8ffc46c32142fc29d70e1a68
2021-04-23 08:42:10 -04:00
Solomon Peachy
03695429cf blackjack: Fix warning triggered by GCC 11
Change-Id: Ifcba0caf059bfa9f833893a1dbf0dc7a1c9b3e61
2021-04-23 08:40:57 -04:00
Aidan MacDonald
75cb8ba8a4 FiiO M3K/X1000: add USB support
This only required a minor patch to the usb-designware driver due
to DMA requiring physical addresses -- on the X1000, these differ
from virtual addresses so we have to do the usual conversion.

Both the mass storage and HID drivers work, but there are a few
issues so this can't be considered 100% stable yet.

- Mass storage might not be detected properly on insertion,
  and USB has to be replugged before it shows up
- HID driver may occasionally panic or hang the machine

Change-Id: Ia3ce7591d5928ec7cbca7953abfef01bdbd873ef
2021-04-21 18:31:55 +00:00
Aidan MacDonald
f6d3680cb8 Make sure battery menu is shown if it contains settings
The #if statement didn't reflect all menu items in the battery
menu, so if the USB charging enable setting was the only one
present, the entire menu would be hidden.

Change-Id: I17a4ed626debf1f61ca140d67d477bdbd52ca180
2021-04-21 18:28:09 +00:00
William Wilgus
acda37edd1 lua print table put_line a do_menu alternative
add stylized lines to lua

the exported do_menu has a severe limitation of 64 items
it also requires double the memory

put_line is the way rockbox builds menus

update printtable

user config from core -- done
code cleanup
fixed for 1-bit screens
changed button behavior
fixed for 2-bit screens

Change-Id: I4de55e42685aa1d2f53a33bc8e980827864e810b
2021-04-20 03:30:41 +00:00
Aidan MacDonald
afe80742a5 Fix Pictureflow bugs
It turns out that aa_cache.buf, used to store decoded album art during
background scanning, was not correctly allocated and overlapped with
memory allocated for buflib. This was what caused all the segfaults.

Also fixed a logic error in read_pfraw(), which returns a buflib handle
on success, but also returned 0 on failure -- since 0 is a valid buflib
handle, it should return -1 on failure instead.

Change-Id: Ifaa1c02ec19b0859e43c40c0462ed7738d07fec3
2021-04-17 13:06:29 +00:00