Commit graph

9965 commits

Author SHA1 Message Date
Thomas Martitz
26b317e094 scroll engine: Factor out renderer function so it can be called by lcd code.
This is used by lcd_puts_scroll_worker() to render the line immediately
instead of waiting for the next scroll tick when only the text was updated.
Previously lcd_puts_scroll_worker() did not render anything in this case
which could lead to visible blinking.

This fixes blinking scrolling lines with dynamic text in the skin engine.

Change-Id: I475bde8c8eb7c92f505e3c5ecf4d32bb90690536
2014-01-11 19:17:58 +01:00
Frank Gevaerts
25e50ed8f1 Print `last logf lines on panic().
If logf is enabled, panic() will print the last lines. On small
screens this is more or less useless, but on large screens it
can be very useful for debugging.

Change-Id: I26dfc76e9ac4a2ddc2def8db1616a04f943dbba3
Reviewed-on: http://gerrit.rockbox.org/709
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
Tested: Frank Gevaerts <frank@gevaerts.be>
2014-01-11 11:37:18 +01:00
Marcin Bukat
9cd3444e27 rk27xx: Implement HAVE_INIT_ATTR magic
This reclaims over 7kB of ram.

Change-Id: I4a89c9a673ada7959311f320900060f6db303c07
2014-01-10 09:01:08 +01:00
Frank Gevaerts
837cad0d38 bidi.c: Check buffer sizes.
This could cause a crash with certain themes and long filenames.

Change-Id: I0a48c91bb089b122a56c4e126ba4d7a175399fa2
2014-01-09 23:30:32 +01:00
Thomas Martitz
fde92de224 lcd_nine_segment_bmp: Fixes for non-ideal image dimensions.
1) The 9-segment images need not be multiple of 3 pixels anymore. If it
isn't the inner segments will be smaller than the corners.

2) If the desired actual images is not a multiple of the segment sizes the
function drawed more than the desired rectangle. This is fixed by
drawing the last segment only partially.

Change-Id: Ic918facd8734fa4a4aa72536f0b67de82d81651e
2014-01-09 00:43:46 +01:00
Thomas Martitz
81be2016bb Fix Player red and icons on mono displays.
Change-Id: Ib8adcb4c70f2dd3ddd25da8f0606f48926dfd89e
2014-01-07 23:39:37 +01:00
Thomas Martitz
444d2e508a Add missing kernel.h include (hopefully the last one, really), take #4.
Change-Id: I167e988868b53203ea926540699d587e115635e8
2014-01-07 22:41:26 +01:00
Thomas Martitz
d146970ca1 lcd/grey: Enable viewport fg_pattern and bg_pattern for all bitmap targets.
Greylib performed a horrible hack and stored fg and bg patterns in other
struct viewport fields. One of them was just removed. So instead of
this hack simply enable the *_pattern fields for mono targets as well,
so that greylib can use them normally.

Change-Id: Ib0842ebcc97f5bf9d9382b4471903afa2f96f39f
2014-01-07 22:14:41 +01:00
Thomas Martitz
e1c7b3b8f7 lcd-16bit: Remove {lss,lse,lst}_pattern fields from struct viewport.
These where used for line styling during scrolling, which is now done in apps/,
The  viewport struct doesn't need to record these anymore.

Change-Id: I810d9dcb2644b00a798c6e75acab69c74a78e77f
2014-01-07 14:13:48 +01:00
Thomas Martitz
deb6ac3693 lcd-16bit: Move lcd_gradient_fillrect/_part() to lcd-16bit-common.c.
Change-Id: I6b2d2ba73464610556cfd9ecec52fc62adb007c7
2014-01-07 14:13:48 +01:00
Thomas Martitz
36e469db8b lcd-common: Remove direct style (line decorations) from lcd-puts* functions.
This logic is moved into apps (put_line()) which can better handle line
decorations with respect to scrolling, mulitline and other complications.

Firmware doesn't need this. The remaining drawing function know only one style,
that is foreground on background/backdrop (changing drawmode is still supported).

Change-Id: I707060edc388a7d723a7d09b0cf5cbda6ec56708
2014-01-07 14:13:48 +01:00
Thomas Martitz
ad0985ea1c lcd-common: Remove support for specifying y_offset from lcd_puts* functions.
This main (and only) purpose for it was to adjust the pixel position of the text
in otherwise linebased (scrolling) functions. With pixel-based scrolling
this isnt necessary anymore.

Change-Id: I2a45b8ca6a3f8f50aa2f6630201b30ce9ddfe043
2014-01-07 14:13:48 +01:00
Thomas Martitz
4978094480 lcd-common: Remove support for custom line heights from viewport.
Since scrolling is now pixel-based this is not necessary anymore. custom line
height is handled by put_line() but can also possible to implement with
lcd_puts_scroll_func().

Change-Id: Iee9b12bf99afac93d95d2a1a6f5d5b4db237b21c
2014-01-07 14:13:48 +01:00
Thomas Martitz
9a4686b563 lcd-common/scroll_engine: Remove unused functions lcd_puts_style_xyoffset() and lcd_puts_scroll_style_xyoffset().
With this functions removed there is no exported function in firmware left
that draws line decorations. Also no function supports specifying an y-offset
anymore (was used for pixel accurate positioning of otherwise strictly line-based
API calls).

Both should be handled in apps/ now.

Change-Id: Iba4b28ccc6e686c7db63e34b51ad4badae983fce
2014-01-07 14:13:48 +01:00
Thomas Martitz
775ebe4ff6 lcd-common/scroll_engine: Remove unused functions lcd_puts_scroll_style().
Change-Id: Ia4f943b3738ab6e66b0e3f1507c629b36d7eba94
2014-01-07 14:13:48 +01:00
Thomas Martitz
7cd07290e6 lcd-common: Remove unused function lcd_puts_style_offset().
Change-Id: I24da23d132f933fe647416dc58e8f50879715423
2014-01-07 14:13:48 +01:00
Thomas Martitz
1e324aac36 lcd-common: Remove unused function lcd_puts_style().
Change-Id: Id2c64c116f79b8e61a7af49b9072b3e884ffb455
2014-01-07 14:13:48 +01:00
Thomas Martitz
8f64625888 lcd-common: Remove unused function lcd_puts_offset().
Change-Id: I39749bf3db915e5a8ddb6e6f25eb201ea0aaf981
2014-01-07 14:13:48 +01:00
Thomas Martitz
a422604435 lcd-common/scroll_engine: Remove unused functions lcd_puts_scroll_offset() and lcd_puts_scroll_style_offset().
Change-Id: Ia84ae88020d06a1cb634942ab5e635fd5d10ac66
2014-01-07 14:13:48 +01:00
Thomas Martitz
77836e5736 lcd-16bit: Introduce lcd_gradient_fillrect_part().
It is similar to lcd_gradient_fillrect(), except that it only draws a part
of the complete gradient. This can be used to draw only the bottom half
of a full gradient.

Change-Id: Ib47cc5237f6966e35ba07988bddbb00fd97adf96
2014-01-07 11:36:00 +01:00
Thomas Martitz
6630958533 lcd-common/scroll_engine: Introduce lcd_putsxy_scroll_func().
This function supports installing a custom scroll callback. This will be
called when the scrollengine redraws the line. It allows to draw extended
styles (or anything your can possible imagine) along with the text.

It is also strictly pixel-based, the first pixel-based function that supports
scrolling.

Change-Id: I57f81ac7b3d08b877aea4cb8afa882f175ebcdfc
2014-01-07 11:36:00 +01:00
Thomas Martitz
b8505222c0 scroll_engine: Change header inclusion
Change-Id: I033db3d3a838f0a950ce7707de6a0cd4b2595d93
2014-01-07 11:36:00 +01:00
Frank Gevaerts
204668db89 Make sure usb class driver disconnect() functions are called properly.
disconnect() needs to be called exactly once per call to init_connection().
In case of bus resets, disconnect() was not called, which led to leaking
alloc_maximum() allocated buflib handles, which led to buflib running out
of memory to allocate.

Change-Id: I03025da578dc54e48b6de6bd3e3f40feae7220a6
2014-01-05 22:57:04 +01:00
Frank Gevaerts
2a63502c09 Check that core_alloc_maximum() returned something useful, and panic if not
Change-Id: I7ae40db0f81d1d51742501936b13b387f94a25e5
2014-01-05 20:56:55 +01:00
Thomas Martitz
463d343102 Add missing kernel.h includes (hopefully all of them), take #3.
Change-Id: I68ed0e914239f0caf83082a41c2480a01b69285a
2014-01-05 20:51:25 +01:00
Thomas Martitz
22b33d6eb8 Add missing kernel.h includes (hopefully all of them), take #2.
Change-Id: I62cedf992bb096987050621cfc34f0432e9da170
2014-01-05 20:42:48 +01:00
Thomas Martitz
22a28f9caa Add missing kernel.h includes (hopefully all of them).
Change-Id: I9c1825296a788587b8d494d8514b3314847b0ff0
2014-01-05 20:32:09 +01:00
Thomas Martitz
281d1fadb3 Do not include kernel.h in system.h.
system.h doesn't need it on its own and this change makes it less
dependant on Rockbox internals.

Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
2014-01-05 19:35:23 +01:00
Thomas Martitz
a17a7038c2 lcd: Fix certain drawmode combinations.
Some seldomly used drawmode combinations did not work in conjunction with
alpha bitmaps and backdrops. Now all should work (see comment added) by using
more bits.

Change-Id: I2bc96ecf471fa8c1a608a321a235b9c8527b3dc5
2014-01-05 19:35:23 +01:00
Frank Gevaerts
646edc594f Fix bpb_is_sane() cluster size calculation for non-512 byte sectors.
bpb_is_sane() used to effectively multiplying the sector size (relative
to 512 bytes) twice, which meant that filesystems with e.g. 2K sectors and
32 sectors per cluster were rejected because while this adds up to 64K
clusters (i.e. the upper limit), the calculation wrongly came to 256K.

This bug tends to affect 5.5G ipods when formatted using dosfstools.

Change-Id: Ia3f1e1303b2af953f497ccdbf23cd49c3d72e46a
2014-01-04 21:28:26 +01:00
Frank Gevaerts
da94b6303e Make fat test tool build again, and make its sector size configurable.
Change-Id: Icfe7c4bb880c2f10918a7809f0f1f1c3838f6f48
2014-01-03 23:57:32 +01:00
Andrew Ryabinin
9dbdec14f0 creativezenv: change target_id & MODEL_NUMBER.
85 is already used by HIFI E.T. MA8C.

Change-Id: I7f30d6b1acbebd6152d11fa46ec87d95e6a809e7
Reviewed-on: http://gerrit.rockbox.org/703
Reviewed-by: Purling Nayuki <cyq.yzfl@gmail.com>
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-01-02 13:35:05 +01:00
Amaury Pouly
40fae1d718 zenxfi2: remove unused function
Change-Id: I98acfc9394ac83a45985364fdfad85af2f7d1773
2013-12-24 12:39:58 +01:00
Thomas Martitz
d2ae832eef lcd: Fix scrolling.
Change-Id: I1f8d3d67b224c1c531438b94e3aab640b76770be
2013-12-23 20:25:34 +01:00
Thomas Martitz
22e802e800 playback,talk: Share audiobuffer via core_alloc_maximum().
This fixes the radioart crash that was the result of buffering.c working
on a freed buffer at the same time as buflib (radioart uses buffering.c for the
images). With this change the buffer is owned by buflib exclusively so this
cannot happen.

As a result, audio_get_buffer() doesn't exist anymore. Callers should call
core_alloc_maximum() directly. This buffer needs to be protected as usual
against movement if necessary (previously it was not protected at all which
cased the radioart crash), To get most of it they can adjust the willingness of
the talk engine to give its buffer away (at the expense of disabling voice
interface) with the new talk_buffer_set_policy() function.

Change-Id: I52123012208d04967876a304451d634e2bef3a33
2013-12-23 12:17:38 +01:00
Thomas Martitz
64b9e1fa7b buflib: Add buflib_context_relocate().
This function relocates a buflib back buffer, updating pointers in struct
buflib_context. It does not move any data by itself.

The intended use-case is buflib-on-buflib, where a buflib back buffer is
allocated with buflib and attempted to be moved. The move_callback() can call
this and return BUFLIB_CB_OK on success. No move_callback() is called for the
subordinate buflib buffer, therefore it must not contain non-movable
allocations. The caller is generally responsible moving the data and all its
implications.

Change-Id: I869219f9cff786a172c9e917a5f34470073892e6
2013-12-22 23:11:32 +01:00
Thomas Martitz
d25a512caf buflib: Try harder in buflib_alloc_maximum().
This function will now ask shrinkable allocations to give up all of their
memory. With future support of playback.c this can be used as a safe
replacement for audio_get_buffer().

Change-Id: I290a51d2c75254e66baf5698c41dc444dea6247a
2013-12-22 23:11:32 +01:00
Szymon Dziok
e7499ba981 Fix audio on m:robe 100.
Tested on different revisions and it works reliably.

Change-Id: Ic710236247a17f516c8561429f2da5c9684341b9
2013-12-17 20:20:00 +01:00
Andrew Ryabinin
5b5f0755d6 Introduce IHIFI760/960 targets.
Change-Id: Ie36e48742c0ed9aa3fd6f49aa034a11d2492327c
2013-12-16 00:45:18 +04:00
Andrew Ryabinin
04c59b8a15 rk27xx: Fix ifdef for DEBUG_CANCEL button.
Change-Id: Iebbe518dcaf5c9e1573309b3fee17b52998d941c
2013-12-16 00:18:58 +04:00
Thomas Martitz
ed5b853c18 Fix more reds.
Change-Id: Ie62386a8f3e9986381f96eb83abb69bfc42b42e1
2013-12-15 00:47:21 +01:00
Thomas Martitz
c72b454286 Fix reds. Also apply the new scrolling to lcd charcell (this even uncovered an
error).

Change-Id: I29243bb36b6cec1471bd6c0afc64e00547a68c50
2013-12-15 00:38:48 +01:00
Thomas Martitz
50eb528bc1 scroll_engine: Major rework to support pixel-based scrolling and scroll callbacks.
Much of the scrolling work is moved from lcd-bitmap-common to lcd-scroll.c,
a small scroll callback routine remains. This callback can potentially be
overridden by more extensive scrollers.

The callback also gets fed with pixel-based scrolling information, which
finally removes the strict line-based nature of the scroll engine. Along with
this is the change from scroll_stop_viewport_line() to scroll_stop_viewport_rect()
which works on a pixel-based rectangle instead of lines.

The ultimate goal is to move most of the scroll work to apps, which can
much better decide which line decorations to apply etc. This work is laying
the ground work.

Change-Id: I3b2885cf7d8696ddd9253d5a9a73318d3d42831a
2013-12-14 23:11:31 +01:00
Thomas Martitz
26801b3bd8 scroll_engine: Add STYLE_NONE to allow for drawing lines without styling.
This allows to draw lines without destroying styles that were drawn manually
(e.g. from apps/) beforehand.

Change-Id: I0de290c9343061efb115e1b76da5b76395c2b2af
2013-12-14 23:11:31 +01:00
Thomas Martitz
b094d80dab scroll_engine: Split out common main and remote lcd functions.
Uses a similar technique as lcd_*.c files of #including a common .c file, so
that a unified implementation can be reused for both displays.

Change-Id: I21f6de76df757b093e1a1dff0a4caf96a44fe77e
2013-12-14 23:11:30 +01:00
Thomas Martitz
1c5d0b41ee scroll_engine: Rename scroll_stop* functions to be more consistent with the lcd api.
Change-Id: I8ada10b96bfb628cca0331689e8b936ae47c7e1c
2013-12-14 23:11:30 +01:00
Thomas Martitz
47c8d3c14d lcd-*: Merge common viewport operations into lcd-bitmap-common.c
Change-Id: Ibec2d039ac0ba1214c9bd1b667bc8a9538a0d3d7
2013-12-14 23:11:30 +01:00
Amaury Pouly
01d8cc6f39 Fix yellow
Change-Id: I60cd312c501f2f0fe0c12489c86c856eeb8e1aa8
2013-12-08 11:30:13 +01:00
Amaury Pouly
b163fb9eac rmi/fuze+: add product info in the debug screen
Change-Id: Id06dbe0909e37587a45a2ebf5b0beab93cd44f61
2013-12-08 11:12:39 +01:00
Amaury Pouly
2bf192ee6e imx233: regenerate registers headers
Change-Id: I546177a247646d7a9864d1ec2796ef0708e50667
2013-12-06 02:04:37 +01:00