Commit graph

33783 commits

Author SHA1 Message Date
Michael Sevakis
aced667f48 Undo hacks to meant to get around string formatting limitations
The new vuprintf makes unnecessary workarounds due to formatting
limitations. I checked grep output for whatever appeared to fit
but it's possible I missed some instances because they weren't
so obvious.

Also, this means sound settings can dynamically work with any
number of decimals rather than the current assumption of one or
two. Add an ipow() function to help and take advantage of dynamic
field width and precision. Consolidate string formatting of sound
settings.

Change-Id: I46caf534859dfd1916cd440cd25e5206b192fcd8
2017-11-21 05:01:14 -05:00
Michael Sevakis
5c9688961e Implement a much more capable vuprintf()
New support as well as some buggy support fixed.

Still no floating point support if ever that would be desired.

Support (*):
* Flags: '-', '+', ' ', '#', '0'

* Width and precision: 'n', '.n', '*' and '.*'

* Length modifiers: 'hh', 'h', 'j', 'l', 'll', 't', 'z'

* Radix: 'c', 'd', 'i', 'n', 'o', 'p/P', 's', 'u', 'x/X'

(*) Provision exists to switch lesser-used stuff on or off or when
certain functionality isn't desired (bootloader?). The compulsory
radixes are everything but 'o', 'n', 'p/P' and 'x/X' with length
modifiers being optional. The default setup is 'l', 'z', 'c', 'd',
'p/P', 's', 'u', 'x/X'.

* Move fdprintf() to its own file. It was in a strange place.

* Make callers compatible and fix a couple snprintf() bugs while
at it.

Could smush it down in size but I'm gonna get over the binsize
neurosis and just the let optimizer do its thing.

Change-Id: Ibdc613a9b6775802c188b29b9dd46c568c94f7c3
2017-11-21 05:00:27 -05:00
William Wilgus
52af55eee8 Action Rewrite - Fix red
Change-Id: Iaa3e452994295b381297c1b6c9f61407e8ba0296
2017-11-18 17:06:40 +01:00
William Wilgus
b10c0e5b90 Action.c FIX / Rework / Clean-up Action System
FIX - softlock not allowing power button to shutdown device when active
FIX - autolock not working unless Selective backlight enabled

Rework - get_action_worker split into more managable chunks

Rework - moved all static variables to a single struct action_last
         to be passed through all internal functions

Rework - current action state moved to struct action_current
         to be initialized at each get_action /get_action_custom call

Rework - action lookup in button maps changed slightly to prefer fully formed actions
         rather than  blindly returning action with BUTTON_NONE as pre_button
         this should allow actions defined in keymaps positional independence

Rework / Clean-up - moved conditionals on internal functions to inside the functions
                  -Allows much cleaner code & empty functions should be optimized
                   out by compiler

Rework / Clean-up - softlock and backlight exemptions code

Clean-up - remove a lot of (now) unused defines

Clean-up - organize / move all exported functions to their own section in the file

Comments added to all internal functions to better explain their purpose

Change-Id: I0ac02d1a2b45826843611513fea3c20a819d2fed
2017-11-18 16:08:07 +01:00
Amaury Pouly
ff08c5287d nwz: improve keymap
- enable various features in radio screen (like mode switch)
- improve keyboard (short play to select, long play to finish, power to abort)
- enable volume keys in radio screen if available

Change-Id: I01e71291cfd783763ffd55d4fa60610b6900c726
2017-11-14 16:49:36 +01:00
Amaury Pouly
5da0cbea31 nwz: enable plugins on all targets except NWZ-A860
Keymap might be suboptimal.

Change-Id: Ibaf51e91cf935c96b7f419647fe1147dee6cc8be
2017-11-14 00:28:00 +01:00
Amaury Pouly
bd8dd62db7 nwz: fix tuner on older players (also fixes audio because Sony)
Change-Id: I1915bcfc27708d34a9dde81fce1e0bc0b01e1040
2017-11-14 00:27:28 +01:00
William Wilgus
7272f821da Imx233 Disable Autoslow only at maximum cpu frequency
At normal loads:
- disabling auto slow boosts performance at the cost of runtime (~ -5%)
- disabling at max cpu does not noticibly decrease runtime

Change-Id: I5de80201c9a24ce556862151cbd6b21b01708b63
2017-11-12 14:28:03 +01:00
Amaury Pouly
ec4fa0333c hwstub: add code to dump STMP rom
Change-Id: I083024662f3c085f7bcd2f85b0a68de85725b0f3
2017-11-12 14:14:30 +01:00
Amaury Pouly
dd6b8427f9 hwstub: expose read/write functions
Previously only atomic read/write 8/16/32 were exposed. But it is useful to
be able to read a whole buffer at once, this is more efficient than N times
read8.

Change-Id: I06e331641e1ab1f74c0e16e8c432eafb398e8e6d
2017-11-12 14:13:21 +01:00
Amaury Pouly
df0edba18e hwstub: fix horrible bug
It's a wonder it worked, basically any big transfer returned garbage

Change-Id: Ic2b2fc1805423c70db8eac40692ba842c72462ab
2017-11-12 14:12:44 +01:00
Michael Sevakis
63eae4339a rolo.c: Change 'int errno' to 'int err'
It can cause issues if errno.h finds itself included there

Change-Id: Id5d2be66cd3af4c2760e4a37d3332853e9b54f95
2017-11-07 16:48:07 -05:00
Michael Sevakis
826f99e187 libpcm: Get unbranded structure tag out of my way.
No functional changes.

Change-Id: If372023cb605389a203a635b700eca20685ad49b
2017-11-06 20:06:08 -05:00
Amaury Pouly
1015e1f5ca fix red
Change-Id: If18080a1525591f803e2cb6dd0f28b4f1e286bdb
2017-11-06 21:53:38 +01:00
Amaury Pouly
0fe7b8becf nwzlinux: add support for radio
None of the Sony up to A15 seem to support RDS (they use either Si4702 or Si4708),
thus I did not add any code to support RDS.

Change-Id: I64838993b9705b36b94665f8470c7a89c772c961
2017-11-06 21:37:06 +01:00
Amaury Pouly
ee2eb13b74 mkimxboot: small fixes and display a human readable error
Change-Id: I9362b62351925aef5b14656635875123942fe7e4
2017-11-05 18:30:11 +01:00
Amaury Pouly
5a3b30d8fd Add support for ZEN Mozaic firmware Version 1.06.01 to mkzenboot
Change-Id: I7d912c50ae14e186cb2a2d0f66b876cfe9ff3028
2017-11-04 22:58:29 +01:00
Amaury Pouly
8a925d283d fuzep: fix rds
Change-Id: I15900f638f8f45cb7035a0e7b1caecb62d1d70e8
2017-11-04 19:28:40 +01:00
Franklin Wei
d9a55ac816 puzzles: fix blitting when zoomed
Both blitter_save() and blitter_load() functioned incorrectly when
zoomed in -- blitter_save() would copy from the wrong location, and
blitter_load() would ignore the y-coordinate of the destination.

Change-Id: I7c85debf5953575f72c4a81e3dbcf514202c3aed
2017-11-04 12:09:16 -04:00
Franklin Wei
7f1dd6f593 puzzles: clarify code and documentation
This adds no functionality, but instead cleans up the source and adds
some more substantial documentation.

Change-Id: I77328c171a61db7729bdf928ba094cfbed4ec0dd
2017-11-04 11:14:18 -04:00
Franklin Wei
9f62373735 puzzles: fix title drawing
This fixes two separate bugs: The first was that the drawmode was not
reliably set when drawing the title, occasionally leading to a black
rectangle where the title should be; the second that the title bar's
space wasn't being cleared before drawing, leading to artifacts when
the length of the title string changed.

Change-Id: I3859125b14d568e1098b095ab134645a504b2d45
2017-11-04 11:14:17 -04:00
Amaury Pouly
07d3b3c1fb nwztools/scsitools: print device list when listing series
Change-Id: Ic46c724c5d89a775dc20853410c8fe6f0ff9a4c8
2017-11-01 12:43:33 +01:00
Amaury Pouly
62f0ba1c30 nwztools: add NW-A46 to the database
Change-Id: I85dc2080e0be07ff689384c0445f4f1595baf4ac
2017-11-01 12:43:33 +01:00
Michael Sevakis
8ef33f479e AMS: Convert ascodec_endofch() to use bit mod function's return value.
It cleans up the code and it was the initial inspiring reason to
change them.

Change-Id: I299499117b8a12d93d13d6563683bab89ab80555
2017-10-30 22:12:58 -04:00
Michael Sevakis
f728559bf9 Make atomic bit modification functions return previous value.
Change-Id: I19a94cf946735e1d9e51c3207cd82198fd4dfc1a
2017-10-30 21:43:15 -04:00
Franklin Wei
65e7617ab6 puzzles: add an interaction mode to the "Zoom In" feature
This makes it possible to play the game while zoomed in. Read the
manual entry if you want to know more.

Change-Id: Iff8bab12f92ebd2798047c25d1fde7740aa543ce
2017-10-30 21:25:33 -04:00
Franklin Wei
1f3e70aafc puzzles: sync with upstream
This includes the fix for Map's incorrect cursor positioning when
zoomed in.

Change-Id: I7d7d1f3031bbe1390e89340039996f99efaa8ef5
2017-10-29 17:39:29 -04:00
Franklin Wei
2423d3d4ae Revert "tlsf: pack info structs"
This reverts commit 8a6d7cefc9.

Packing the structs was mostly a precautionary measure, tlsf should
still work without it.
2017-10-29 16:51:33 -04:00
William Wilgus
e9de9c1452 Add boot from other volumes in bootloader on targets with HAVE_MULTIVOLUME
Adds the ability to load firmware from other drives on MULTIVOLUME targets
Mihail Zenkov <mihail.zenkov@gmail.com> had posted a hard coded patch
to allow this on several Sansa players, I made it more universal

Redirect file rockbox_main.<name> should placed in root of
drive you would like to be main, if this file empty or there a single
slash '/' firmware will be loaded from /.rockbox in root of this drive
If instead a /<*DIRECTORY*> is supplied in rockbox_main.<name> then
firmware will be loaded from /<dir>/.rockbox/

NOTES*

The directory can have multiple levels however..
leading slash MUST be included
trailing slash can be omitted
(eg. /test/.rockbox would be simply '/test' in the redirect file)

Redirect file will not work on internal drive (whatever is default boot drive)

Volume with the highest index containing redirect file will be loaded
first.

Firmware file is checked for boot data region, if missing, firmware
image will not be loaded.

On failure or if no redirect file is found load will fallback to
internal drive

Currently only Sansa Fuze+, Sansa Clip+,
Sansa Clip Zip, Sansa Fuzev2, and Sansa Fuzev1 are implemented.

Players (with HAVE_MULTIVOLUME)
will need #define HAVE_BOOTDATA and #define BOOT_REDIR "rockbox_main.<name>"
added to their config file

boot_data is implemented in crt0.s file (See g#1552)
ARM and IMX233 have aleady been implemented

Once these conditions are met <HAVE_MULTIBOOT> will be defined by config.h

Partitions on the drives are able to have a redirect as
well.

Change-Id: Iada3263919f6bcad7d0d7d8279b4239aafa07ee9
2017-10-29 17:53:04 +01:00
William Wilgus
efb71ed0ce Add boot data to MOST AS3525 Devices
Adds boot data to as3525 devices Sansa C200v2 E200v2 Clip Clipv2 Clip+ ClipZip
fuze, fuzev2 m200v4

Adds boot_data to features.txt

default arm crt0.s now had boot data if HAVE_BOOTDATA is defined

Change-Id: I614a556696540511a69fc12a4520b01c268bf8a9
2017-10-29 17:52:40 +01:00
William Wilgus
41869a6534 Add boot data support to rockbox.
Bootdata is a special location in the Firmware marked by a magic header
The bootloader is able to copy information to the firmware by locating
this struct and passing data to the firmware when it is loaded but
before it is actually executed

Data is verified by a crc of the bootdata


Change-Id: Ib3d78cc0c3a9d47d6fe73be4747a11b7ad6f0a9e
2017-10-29 17:50:59 +01:00
Franklin Wei
60e5cd7276 tlsf: remove memset() call in add_new_area()
This call was not needed in the first place, but was causing crashes in
sgt-puzzles. Removing it fixes the crashes.

Change-Id: I1149d5600e1c97e0e848fdd34bf65d54c930adab
2017-10-29 12:49:39 -04:00
Franklin Wei
8a6d7cefc9 tlsf: pack info structs
This should make it build cleanly under -Wcast-align, which should
hopefully avoid any alignment issues on ARM.

Change-Id: Ie147323d2d8cb980dcbb94710387b7ee80826c4d
2017-10-29 12:49:39 -04:00
Franklin Wei
47ebf623cb puzzles: improve zoom rendering
This adds colored font rendering, as well as a workaround for font
loading while zoomed. Additionally, the frontend has been modified to
match the new upstream API.

Change-Id: I8c3fe57e6854f176485bf792cf4778cd54a21674
2017-10-29 12:49:39 -04:00
William Wilgus
b2c470719a imx233: Implement mutex for cpu_boost_lock/unlock
Playing AAC-HE files resulted in a race condition between
audio/codec/buffering for set_cpu_frequency

Change-Id: I35e1c1fd18db623e2990c305acdca03f57184d0d
2017-10-28 14:47:21 +02:00
Szymon Dziok
428464774f SVG image of the Sony NWZ-E580 and other formats for the manual.
Change-Id: I30453398ab317f5c263371aa5798463f26ac4dbb
2017-10-28 14:46:42 +02:00
Franklin Wei
9ba899f850 puzzles: fix clipping and 24-bit handling
Should fix the build.

Change-Id: I68f06702570389c2c9d0d76acc064c324cac457b
2017-10-27 20:17:28 -04:00
Franklin Wei
8b8e25f195 puzzles: add "Zoom In" option to improve usability
This adds a "Zoom In" option to the pause menu of each puzzle, which
displays the puzzle at triple size (subject to change). This should
help with tiny screens, modulo memory concerns associated with
allocating the temporary framebuffer to which drawing operations are
redirected. Coincidentally, there's an upstream bug with Map that
causes the cursor's positioning to be incorrectly displayed when
zoomed.

Change-Id: Ic8b7c2942acf558e295f4271dd7dc458cd336895
2017-10-27 19:10:53 -04:00
Michael Sevakis
e4a46c8d88 Fix a few missed things in 16454efc (and hopefully clear the red).
Change-Id: I2ce88e4c41e6e08efbfbdf261122318dfb0f8b0f
2017-10-26 16:32:53 -04:00
Michael Sevakis
1654efc313 Unify storage threads into one
* Editing a bunch of drivers' thread routines in order to
implement a new feature is tedious.

* No matter the number of storage drivers, they share one thread.
No extra threads needed for CONFIG_STORAGE_MULTI.

* Each has an event callback called by the storage thread.

* A default callback is provided to fake sleeping in order to
trigger idle callbacks. It could also do other default processing.
Changes to it will be part of driver code without editing each
one.

* Drivers may sleep and wake as they please as long as they give
a low pulse on their storage bit to ask to go into sleep mode.
Idle callback is called on its behalf and driver immediately put
into sleep mode.

* Drivers may indicate they are to continue receiving events in
USB mode, otherwise they receve nothing until disconnect (they
do receive SYS_USB_DISCONNECTED no matter what).

* Rework a few things to keep the callback implementation sane
and maintainable. ata.c was dreadful with all those bools; make
it a state machine and easier to follow. Remove last_user_activity;
it has no purpose that isn't served by keeping the disk active
through last_disk_activity instead.

* Even-out stack sizes partly because of a lack of a decent place
to define them by driver or SoC or whatever; it doesn't seem too
critical to do that anyway. Many are simply too large while at
least one isn't really adequate. They may be individually
overridden if necessary (figure out where). The thread uses the
greatest size demanded. Newer file code is much more frugal with
stack space. I barely see use crack 50% after idle callbacks
(usually mid-40s). Card insert/eject doesn't demand much.

* No forcing of idle callbacks. If it isn't necessary for one or
more non-disk storage types, it really isn't any more necessary for
disk storage. Besides, it makes the whole thing easier to implement.

Change-Id: Id30c284d82a8af66e47f2cfe104c52cbd8aa7215
2017-10-26 14:35:41 -04:00
Amaury Pouly
7807934a27 atjboottool: document more header fields and crypto code
The encryption definitely uses some standard elliptic curve encryption over
binary fields (163 and 233 bits, standard polynomials). It is still unclear
how this is used in the actual encryption, the key authentification and
derivation do not look standard.

Change-Id: I6b9180ff7e6115e1dceca8489e986a02a9ea6fc9
2017-10-26 18:17:59 +01:00
Franklin Wei
3ad9caeb2a puzzles: make Untangle's input code return UI_UPDATE instead of ""
This was changed upstream and slipped by when I was merging the
changes.

Change-Id: I3a53cd2db5a5cd2ffef52719a048b8ff4c80d1aa
2017-10-24 19:36:19 -04:00
Amaury Pouly
819d3ee02e nwztools: add NW-A45
Change-Id: I75a7723498564ee73c3682391582e354ad672fd7
2017-10-24 17:47:28 +01:00
Amaury Pouly
2ae792c2f5 nwztools: add NW-ZX300A
Change-Id: I8b311ed6b48b92b9ecf4fb25c19119cfb2d5beb1
2017-10-24 11:46:19 +01:00
Franklin Wei
a644489ccf puzzles: adapt frontend to upstream changes
Change-Id: Idd911ac4ac6c2efa3c6b064be6058979d7a15447
2017-10-23 17:41:11 -04:00
Franklin Wei
ef1306764e puzzles: resync with upstream
There have been some improvements with regard to small screen sizes,
which will be nice to have.

Change-Id: I30c740514156258d2818fde325c1a751500f7611
2017-10-23 17:19:29 -04:00
Amaury Pouly
7a8c9daf7e test_mem: increase dram buffer if possible, cap number of iterations
Change-Id: Ie034433184d0dfcd50e3b783b2b6d0b6a44d001f
2017-10-22 15:36:13 +02:00
Amaury Pouly
e441c2696d nwztools/upgtools: make the tool print the whole kas, not just 16 bytes
Change-Id: I9daca9148b7aaea905a765dfeb95faf6fb7198b1
2017-10-22 15:35:10 +02:00
Amaury Pouly
7e42e90294 atjboottool: add support for FwuTail
Change-Id: Ib01a2ff92294dd0bb59439c23f26bc31eafa4a39
2017-10-20 23:57:58 +02:00
Amaury Pouly
6e79c4cb7c nwztools: add KAS for NW-A40 series
Change-Id: I6e22ba0a58eb62dcc9f2025ee7233f5afae1bbec
2017-10-20 19:46:35 +02:00