Commit graph

34889 commits

Author SHA1 Message Date
William Wilgus
60f642ba4f lcd_framebuffer bugfixes, sanity checks
several issues I saw that could pontentially cause problems
scroll engine doesn't take text height into account when checking bounds

NBELEMS was one whole row too large hopefully I got them right this time

Change-Id: If303da8320429c3964fc675351cb088d46303745
2020-10-31 01:11:30 -04:00
William Wilgus
202f9df0c1 Test_Viewports BUGFIX
putting a framebuffer on the stack is never a good idea

Added comments

Change-Id: I5553050785b74cb847db03957c6377cab11e816c
2020-10-31 00:30:55 -04:00
Solomon Peachy
7eee526e6a fix red introduced in the android pcm driver (rev fe2d52c)
Change-Id: I2fa160fd39842a5434cf11573b50061786e610ca
2020-10-31 01:44:48 +00:00
Solomon Peachy
fe2d52cc7d pcm: Get rid of pcm_play_pause() and associated APIs
Nothing in the core has used it for some time.  It's exported to the
plugin API but the last plugins to use it were switched to the mixer API
back in 2011.

This allows us to get rid of pcm_play_dma_pause() from all audio drivers

Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
2020-10-31 01:18:27 +00:00
James Buren
2d85c72151 iriver_flash: fix issues with DoUserDialog
First the argument should be const since the original parameter is.

Second the pointer arithmetic for detecting whether rockbox is running
from ROM or not is incorrect. It ends up being at a location twice as
far as intended since the arithmetic does not account for the pointer
type's underlying size. It should also be dependent on the target's
FLASH_SIZE.

Third the LCD setup is moved to the entry point since it is the best
place to setup and restore the LCD changes.

Change-Id: If9ddaf2cd937f1edf61c82a8a27f48d01807068a
2020-10-30 15:55:36 +00:00
James Buren
fa3184f951 iriver_flash: make most remaining functions static
This increases opportunities for optimizations as well.

Change-Id: I4105990d7d1fca93c735762721cfc293973c5344
2020-10-30 06:25:49 +00:00
James Buren
7c498b9043 iriver_flash: revise valid_bootloaders and detect_valid_bootloader
The main change is revising how the checksums are guarded by macros.
But both are also converted to static linkage so they can be better
optimized by GCC. I also change the types around to reflect how the
space the data types actually need. Furthermore I make use of C99
changes to how variables can be declared to move them closer to where
they are used.

Change-Id: I0b21b655f3f4a7c4bbd4365a384a551e75451159
2020-10-30 05:40:29 +00:00
James Buren
6bc6af6a0e iriver_flash: revise load_firmware_file function
This moves the checksum into the local stack and turns the second
parameter into an optional argument. This also reads the model
segment that was previously unused so it can also be checked as
an extra safeguard in the event the checksum somehow matches
yet the model is incorrect.

Change-Id: I9a8c2d731e4f1818e6e4aee3c3978777c16ccf19
2020-10-30 05:20:42 +00:00
Amaury Pouly
07fcced4fb Fix volume handling of steps in radio
Change-Id: I6d91c5ebc90f9303c71005f3b954df3a101ab732
2020-10-29 20:26:30 -04:00
Johannes Rauh
44023eb430 Volume adjustment in LISTS ignored AUDIOHW_SETTING values
AUDIOHW_SETTING() defines number of decimals and step size.
This is taken into account in sound menu but ignored in lists
(had been recently fixed in WPS).
This was not a problem so far since all drivers used 0 decimal
places and step size equal 1.

Change-Id: I8807d5b6f2f3d412a2bc5769905bd776553ece0b
2020-10-29 20:08:50 -04:00
James Buren
f1bfbb52f1 iriver_flash: revise cfi_read_id and cfi_get_flash_info
First neither of these functions can fail on supported targets
so they have become void functions. Their return values were
not being used anyway.

Second support for other flash chips not even used on the
supported targets has been removed. It appears they were
only ever used on the discontinued Arch devices.

Third cfi_read_id was restructured to remove obsolete code
for error checking that is not necessary at all. The datasheets
appear to indicate that the commands used cannot fail.

Fourth cfi_get_flash_info was restructured to use a new approach
to initializing the flash_info struct. It no longer initializes
the structure twice.

Fifth the relevant code has been updated to use the full 16 bits
that are exposed by the flash rom ID interface.

Change-Id: I25b1ada3d4621e2d80ac66d3d9a964964268cb3b
2020-10-29 23:01:25 +00:00
Dominik Riebeling
96f82f828a rbutil: More Qt6 compatibility.
Qt6 doesn't contain QTextCodec anymore but instead provides it in the
optional core5compat module.

Change-Id: Ia45985a32df3826faf041981b8935c839946e5c9
2020-10-29 21:28:29 +01:00
Dominik Riebeling
4594541b5f rbutil: Simplify search.
No need to get keys from the map to search a key, we can check directly.

Change-Id: Ia96286e441c3d03864bd7b152065576d26acad87
2020-10-29 21:28:28 +01:00
Dominik Riebeling
2d62f2d017 rbutil: More Qt6 compatibility.
Replace QProcess::pid() which has been replaced with
QProcess::processId() starting with Qt5.3 and removed from Qt6.

Change-Id: I9b2d38f8e490e2e4c0afb5cbb409f6a17a98efbd
2020-10-29 21:28:28 +01:00
Dominik Riebeling
86420bbe2b rbutil: Remove unused assignment.
Change-Id: I6445e13472ae856acda1890056fd933d7d810bd5
2020-10-29 21:28:28 +01:00
James Buren
f65e410497 iriver_flash: rewrite how the flash commands wait for the ROM
This uses the toggle bit method referenced in the datasheets for the
supported ROM chips and moves the code to a reusable subroutine. It
also introduces a short delay to give the bus a chance to recover. The
older ROM datasheet doesn't mention this delay as necessary but the
newer one does so it now does this for both.

Change-Id: Ie9dc8833bbd3ee545072b0c724ab220d13208d3d
2020-10-29 05:30:28 +00:00
William Wilgus
c5c17fa799 Fix display regression from c85d8e2
Basically setting a null buffer is valid but it must be selected
into a screen to initialize to the default buffer

I wrongly assumed screen type wouldn't matter but since I decided to
reference backdrops directly to the default buffer
(since they are saved as an offset from what it later assumes to be the
default framebuffer)
SCREEN_MAIN/SCREEN_REMOTE are not longer optional

Change-Id: I8a8afbbe1e3ed0bfe6abd40ce287638e9fc6da60
2020-10-28 22:55:27 -04:00
Solomon Peachy
c7fb319151 fix checkwps build (introduced in a5a8e00)
Change-Id: Ibc8bced6721b3711e465320a537e15244b2b11b2
2020-10-28 19:38:27 -04:00
Solomon Peachy
a5a8e00b6d Fix a crash introduced in a605cdf70
Pretty subtle problem; looks like the skin core was relying on a
destructor to actually help initialize things.

Change-Id: Ieb4b9e4f11377dec7be61d13759590fc5f4bc921
2020-10-28 18:51:57 -04:00
Solomon Peachy
8c8284bbe6 Fix statusbar display regression from a605cdf700
Change-Id: I4d02ac28e05080458eea6e3f52498321199ecbd3
2020-10-28 17:53:03 -04:00
William Wilgus
c85d8e2865 Framebuffer_viewport Rewrite -- BUG FIX
stride was not initialized for the skin_viewport

fixed a few other questionable areas

Change-Id: I9cc7830a4406857bf3aba26a328c288e3702cddd
2020-10-28 13:25:12 -04:00
Solomon Peachy
a605cdf700 Fix multiple potential null pointer dereferencess
GCC's optimizer thinks all of these _will_ fail at some point

Change-Id: I287eeb574162a5d3b3347654d25aa1f53e9f5563
2020-10-28 08:42:49 -04:00
Solomon Peachy
621e363e70 libgme: Fix yellow in hosted MIPS builds
Change-Id: I6d25c014cc519ddc5d1619c25d48331f512c2f2f
2020-10-28 07:30:10 -04:00
Solomon Peachy
41a6da6043 builds: Enable -fno-delete-null-pointer-checks globally
* arm failures in lua, wolf3d, quake, flac
 * m68k failures in lua, wmapro
 * mips ???

I still think that most of these are actually due to latent bugs or
ambiguous code.

Change-Id: I4c9751d2b5c7a66253b313bfbc75fcd721b118d6
2020-10-28 04:10:29 +00:00
Solomon Peachy
bcbf8bbf0a wmapro: Backport multiple fixes
upstream commits:

 780d454
 b28c678
 9166f48
 97a5add
 b21ba20
 f734671
 b86dd1
 b4027d9
 50f0a6b
 4c0080b
 c7a7605
 5dcb990
 7ad698e

Change-Id: I8e6d74316e1eaf22217a57ddb54c1ea8303e6788
2020-10-28 02:12:01 +00:00
Solomon Peachy
a5a19a3370 dircache: Fix a NULL pointer dereference
if idx == 0, get_idx_dcvolp() will return NULL.

Change-Id: I4eafa71bb1f77ef8c865570bf8f124cdd9326d3e
2020-10-27 21:57:40 -04:00
Solomon Peachy
7dbfda6c55 iaudiom5: Fix build.
Basically we're overflowing IRAM by 48 bytes.  Shrink the stack
by 48 bytes to compensate.

Fixing this properly will require careful decisions about what
(code and/or data) to eject from IRAM.

Change-Id: Ia3054280bcbd9813b9cce83f16ba4fbd15085110
2020-10-27 14:49:19 -04:00
James Buren
bee736f3ea iriver_flash: make cfi_read_id use FB directly
Change-Id: Id747b0846515443871a0df10d83e3b1fc4731e7c
2020-10-27 16:01:16 +00:00
James Buren
e5b963b8e1 iriver_flash: remove trailing whitespaces
Change-Id: I5f32ba177a2ca559768e621bbad1d896c9adcafa
2020-10-27 16:00:15 +00:00
Solomon Peachy
61f698715d coldfire: We need -fno-delete-null-pointer-checks in flash controller code
Change-Id: I9a3e4ced2c3d41f6a31a968af72659a1a14f702e
2020-10-27 10:29:59 -04:00
Solomon Peachy
f62eee569c iriver_flash: we need -fno-delete-null-pointer-checks
Change-Id: I36bbfc81d9cb79a9627e5ba7ee50e1305f54848b
2020-10-26 21:27:46 -04:00
Solomon Peachy
804a49886a statusbar: Make statusbar height equal SYSFONT_HEIGHT
And size elements horizaontally based on SYSFONT_WIDTH

Unfortunately we need 16px icons to make 16px statusbar look right
but at least it _works_ properly now.

Also: all targets currently use 8-px SYSFONT, except some hosted bootloaders

Change-Id: I0cdf97e6ef47ec49693ef79667b200595b4fe075
2020-10-26 19:52:40 +00:00
William Wilgus
299c237075 'Fix RED e200 Framebuffer_viewport_rewrite
Free malloc in checkwps too

Change-Id: I2b8fcbc94beb0644b643d3b7a9cb53bc26fc8a51
2020-10-26 15:50:42 -04:00
William Wilgus
04e7bacc4c FIX RED Framebuffer_viewport_rewrite
Change-Id: I716929fbee48bef68d7383efb944f9d491fdfe4d
2020-10-26 15:25:07 -04:00
William Wilgus
ada919fc11 FIX RED framebuffer viewport rewrite
Change-Id: I4cb8f580e15440d06f8d5fabb2fbf5147c67b49c
2020-10-26 14:35:30 -04:00
William Wilgus
9b295ce135 FIX RED/YELLOW framebuffer viewport rewrite
Change-Id: Icfd3b00b646c593991f73550d8a316a80e5930a1
2020-10-26 14:02:49 -04:00
William Wilgus
40e98a2e49 Whitespace cleanup on fb_viewport Rewrite
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
2020-10-26 12:38:22 -04:00
William Wilgus
3237ae4a4f LCD core move buf ptr and address look up function viewport struct
I'm currently running up against the limitations of the lcd_draw functions
I want these functions to be able to be used on any size buffer not
just buffers with a stride matching the underlying device

[DONE] allow the framebuffer to be decoupled from the device framebuffer
[DONE need examples] allow for some simple blit like transformations
[DONE] remove the device framebuffer from the plugin api
[DONE}ditto remote framebuffer
[DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr

while remote lcds may compile (and work in the sim) its not been tested on targets

[FIXED] backdrops need work to be screen agnostic

[FIXED] screen statusbar is not being combined into the main viewport correctly yet

[FIXED] screen elements are displayed incorrectly  after switch to void*

[FIXED] core didn't restore proper viewport on splash etc.

[NEEDS TESTING] remote lcd garbled data

[FIXED] osd lib garbled screen on bmp_part

[FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport

[FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer

[FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw)
[UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear
scrolling viewports no longer trigger wps refresh
also fixed a bug where guisyncyesno was displaying and then disappearing

[ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes
(LCD_ and LCD_REMOTE_)
LCD_STRIDE(w, h) same as STRIDE_MAIN
LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H
LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H
LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH)
test_viewports.c has an example of usage

[FIXED!!] 2bit targets don't respect non-native strides
[FIXED] Few define snags

Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2020-10-26 12:28:48 -04:00
Moshe Piekarski
12f3ed1699 make the plugin API frambuffer agnostic
Change-Id: I5abdc231093054c517ff53b9a456997e440e3f6e
2020-10-26 12:28:48 -04:00
Solomon Peachy
5d5f8169b5 statusbar: Respect 'numdecimals' when displaying the volume setting
eg with numdecimals=1, a value of "-300" actually means "-30.0" So
divide it down appropriately, and only display the whole integer
portion.

Change-Id: I62927d2e64b224f3c11640b9bb9e84d60dbde34b
2020-10-26 08:28:34 -04:00
Solomon Peachy
845e5a4f03 sonynwz: A10 and A20 series support high bitrates
Change-Id: I6b33368ed5d7800b79dafbb736e6ed079accbd25
2020-10-26 07:42:48 -04:00
James Buren
dd3ea521ad iriver_flash: correctly calculate when to stop erasing the bootloader
It was originally hard-coded at 0x200 which is 512 sectors. This
only works for the H100 and H120. The larger ROM of the H300 is 1024
sectors in size. In either case the bootloader starts 16 sectors before
the end of the ROM so rely on this fact to correctly calculate where to
stop the bootloader erasure.

Change-Id: Iec4112ebf24379f80a7bf1363035e005c434907e
2020-10-26 02:29:01 +00:00
James Buren
c5d7cd5f9f h300: add support for ROM image generation
Change-Id: I6e0985de370609bae98ba6eab487bf43eb4191b6
2020-10-26 01:37:42 +00:00
Solomon Peachy
28b9c8bfeb rocker: Disable mute-on-pause, due to a platform kernel bug.
In short, the display fading back in after a pause resuming interferes
with the audio codec, causing BadThings(tm) that cannot be recovered from

This really is just avoiding a known trigger; there's no guarantee this
condition won't occur under random circumstances during normal use,
and there's no good way to work around this from within rockbox.

I suspect the underlying problem is that both the display control and
codec control share an i2c bus, but the kernel drivers implementing them
isn't using proper linux bus access/locking.

Change-Id: Id4f56f9cb269ed74aac2f041146b3630cef09030
2020-10-26 01:07:59 +00:00
James Buren
bde72efa30 coldfire: make the RAM and ROM image locations configurable by macros
Change-Id: Ie27e39c34947b0391be621dafb8711c44e863a1c
2020-10-26 01:07:14 +00:00
James Buren
129001909d h300: enable support for iriver_flash
This also modifies the configuration file to include macros
defined in the H100 / H120 implementation.

Change-Id: Iae845889c98661ec548c04fc57e733dcc346c0f1
2020-10-26 01:07:14 +00:00
James Buren
f7e0ce8fb9 h300: expose the firmware functions in the plugin API
Change-Id: Ieff0aa0a4134e347b2ee690d60b25fdac5958a6b
2020-10-26 01:07:14 +00:00
Solomon Peachy
39a0d8bf86 x3ii/x20/rocker: Fix volume scaling.
Change-Id: Ie70d709b4c18f16cdd67aa05d9183b4ace2e66b4
2020-10-26 00:12:54 +00:00
Solomon Peachy
49c4577fa6 Get rid of another vestigal SH remnant in the rom linker script
Change-Id: Id7509ad4affc4d72fbfdd11b39a404ad54c76f1b
2020-10-26 00:12:54 +00:00
James Buren
1419070b3d iriver_flash: add support for SST39VF3201 ROM chips
These are used in the iRiver H300 series.

Change-Id: Iafbd165bdfd71b691698156d3fd91243c50b3b61
2020-10-25 23:18:21 +00:00