Commit graph

33246 commits

Author SHA1 Message Date
Franklin Wei
dbee727664 puzzles: fix a minor bug in the configuration screen
- when an invalid string setting was entered, the string value would
  continue to be used after being freed

Change-Id: I3a9da016f6f32eac8636b9f55e4e09006bc6059e
2017-01-04 21:12:17 -05:00
Franklin Wei
1464cb942b puzzles: minor polishing touches on the user interface
- the debug menu has been neatly hidden away in the classic Android style ;)
- playback control option added to the pause menu when possible
- also fixes a minor redraw issue

Change-Id: I00d0186986a8e659991948336b26b4f2e2a0ce66
2017-01-04 20:53:21 -05:00
Franklin Wei
31907283a4 puzzles: fix a few things
- old acos() function was broken, replaced with a call to atan2(); this fixes "Cube!"
- Makefile extended to support building "unfinished games", but not enabled
- a backdrop issue fixed in rockbox.c

Change-Id: I9393e958d43de32f4ccf18e1cb409f75c2e1ed3c
2017-01-04 20:36:04 -05:00
Amaury Pouly
ad2297d353 nwztools/scsitool: add option to force/specify series
We cannot auto-detect a device if we don't know its model ID, but we can't know
the model ID if we haven't decrypted the upgrade which requires the key. The only
way to solve this chicken-and-egg problem is to get the NVP table from kernel,
create an empty series in the database (no model ID), then get the key using
scsitool and forcing the model (using this commit), then decrypt the upgrade
and get the model ID list.

Change-Id: I8eced486a5f6a1a99028b25fdc4f87a3b11e31a8
2017-01-04 17:14:31 +01:00
Amaury Pouly
dbeb6db1b5 nwztools: cleanup crypto, switch MD5 to Crypto++
We already use Crypto++ for DES anyway, and using OpenSSL is not great because
of its incompatible licence.

Change-Id: I78771b84c1708795a0c0c30afa5bdfe4885dea4e
2017-01-04 17:05:15 +01:00
Amaury Pouly
92ecbd5fb8 nwztools/upg: move upg handling to its own file, completely rework kas handling
This was a huge mess, the new is much cleaner hopefully.

Change-Id: I43663d021dc8bc31662d3923e1c3da22d987ebf9
2017-01-04 17:04:38 +01:00
Amaury Pouly
5cfd4a5b8e nwztools/upgtools: add more brute force algorithms
Allow to search for hex with upper case and alphanumeric. This is *much* slower
of course.

Change-Id: I41a2fc63c4b2220c21147b711098ebc37ddb3527
2017-01-04 17:04:19 +01:00
Amaury Pouly
bfd5704749 nwztools: add NW-WM1 nvp table, regenerate database
Change-Id: If5781f0a98b3f2fee08a2daed383064cc59f1680
2017-01-04 17:03:54 +01:00
Amaury Pouly
3c3e133f99 nwztools: small fixes
Make sure scripts use bash, make nwz database generator more deterministic

Change-Id: I26812b697abe0406fb3c60d6eb231cb27edc81d5
2017-01-04 17:03:14 +01:00
Franklin Wei
d7770a1cdd puzzles: rename bcopy() to bcopy_wrapper() and make static
- fixes a name collision on linux

Change-Id: I9f162b5c8a1f319fa6495ff9343fb6007cc20edf
2017-01-03 00:15:28 +01:00
Amaury Pouly
e25983607c mkimxboot: add NWZ-E380 firmware 1.00.200
Change-Id: I0c949a464a0e5880d1215db571aac402ca81eae9
2017-01-02 21:44:22 +01:00
Amaury Pouly
23ecdebf97 mkimxboot: implement firmware unpatching
Change-Id: Idfd68c06f89cdef8e95865e3ff177a6daa072c1a
2017-01-02 21:43:51 +01:00
Amaury Pouly
ff946f1f69 imxtools: completely rework patching logic to prepare unpatching
The old code was working but a mess to maintain. The new code is cleaner
and always simpler handling of all the different options. Extraction of the
OF is no longer a standalone function but just one particular output type.
This commit prepares the ground for firmware "unpatching" (aka OF extraction
from patched OF). The patching code itself did not change so this commit
should still produce the exact same images as before.

Change-Id: I3840793d4b78b8435e38c08f558840925085ead1
2017-01-02 21:43:10 +01:00
Amaury Pouly
782d9c0d80 mkimxboot: add the concept of soft MD5 sum
Change-Id: I7e83218ce0dccc1f4c4a7a6bb9c1df00dacf260b
2017-01-02 21:42:01 +01:00
Franklin Wei
6e5f287606 Fixes and re-sync for puzzles
- Updates to latest upstream (7cae89fb4b22c305b3fd98b4e1be065ad527a9f7).
- Also fixes a bug relating to updating parts of the display.
- Adds some docs.

Change-Id: Idfcce66e0cf3c59e467bab42eafc161df2e495bb
2017-01-01 15:00:09 -05:00
Amaury Pouly
985f6e6935 imxtools: fix bug aes128 (did not update cbc-macp)
Although this does bug is never triggered because we never decrypt and use the
resulting CBC-MAC, it's a major overlook.

Change-Id: I3c5d318e6428d528483bf888ea284e9ded3889f0
2017-01-01 19:52:00 +01:00
Amaury Pouly
b772782ce5 mkimxboot: don't forget to pass model if given on command line
Change-Id: I1d20b38ff5b0f337d9a2eef6e2e1d6c170aabce7
2016-12-19 18:46:40 +01:00
Amaury Pouly
622088c940 zenxfistyle: enable dualboot stub api
The ZEN X-Fi Style doesn't have an updater like the other stmp targets but at
least the stub enables rebooting to the OF.

Change-Id: I630653a37b94b77210ffdd0d30e1748b13eca96a
2016-12-19 18:32:51 +01:00
Franklin Wei
575bd890e7 work around little bugs in puzzles
Change-Id: I80d72a6bb0189eb842385aa622506d5efe319053
2016-12-18 12:51:40 -05:00
Franklin Wei
90f1370bbf Add circle drawing/filling to xlcd
Change-Id: I5d28ade42145d9d82babcf62c0db7948927cafec
2016-12-18 18:35:52 +01:00
Franklin Wei
c6996ab731 add missing file to puzzles
Change-Id: I63b80718f48eede54c3312d9e66c77bfd2472a79
2016-12-18 12:24:33 -05:00
Franklin Wei
1a6a8b52f7 Port of Simon Tatham's Puzzle Collection
Original revision: 5123b1bf68777ffa86e651f178046b26a87cf2d9

MIT Licensed. Some games still crash and others are unplayable due to
issues with controls. Still need a "real" polygon filling algorithm.

Currently builds one plugin per puzzle (about 40 in total, around 100K
each on ARM), but can easily be made to build a single monolithic
overlay (800K or so on ARM).

The following games are at least partially broken for various reasons,
and have been disabled on this commit:

Cube:     failed assertion with "Icosahedron" setting
Keen:     input issues
Mines:    weird stuff happens on target
Palisade: input issues
Solo:     input issues, occasional crash on target
Towers:   input issues
Undead:   input issues
Unequal:  input and drawing issues (concave polys)
Untangle: input issues

Features left to do:
 - In-game help system
 - Figure out the weird bugs

Change-Id: I7c69b6860ab115f973c8d76799502e9bb3d52368
2016-12-18 18:13:22 +01:00
Dominik Riebeling
3ee79724f6 Fix linking with C++ files.
When linking with C++ files the linker also needs to link against the C++
libraries. This is done automatically when invoking the compiler upon linking.
Since we don't want C++ dependencies on C-only projects we check if we actually
have C++ files and use either the C or C++ compiler.

Rename CFLAGS since it's now used for both C and C++ compiler and add dedicated
CFLAGS, CXXFLAGS and LDFLAGS variables.

Change-Id: I9cc068a8038f21e8fd96b20173a8f790e6ab4b6e
2016-12-16 21:50:36 +01:00
Dominik Riebeling
78cb7f0cf0 Support C++ in libtools.make and rewrite dependency handling.
- Change suffix of objects and depencency files to keep the original file
  suffix. This makes it easy to distinguish between C and C++ files when
  building and avoids implicit make rules trying to build in a way we don't
  want to.
- Implicitly handle dependencies instead of having an explicit rule. Simplifies
  things a bit.
- Support C++ files by adding an explicit rule for them. With keeping the
  original file suffixes this becomes quite simple.
  To use C++ files simply add them to SOURCES (or LIBSOURCES).

Change-Id: I22c56a6e153e281cfa675e91ad4a70fd18e2c43c
2016-12-16 19:46:08 +01:00
Dominik Riebeling
6f4beaa52c Don't add LIBSOURCES to SOURCES.
Split source files for library and stand-alone binary and use library as
dependency when building the stand-alone binary. This avoids dependencies
getting added multiple times.

Remove outdated RBARCH handling, we always create fat binaries on OS X these
days.

Change-Id: Ia15a731296edcbe90869a1bf66dda2c3d6c7e317
2016-12-16 19:46:07 +01:00
Dominik Riebeling
efe3775145 Create local file URL using QUrl.
Don't construct the local file URL from string. On Windows the URL needs to
start with file:/// instead of file://. QUrl handles this.

Change-Id: I3dea29a8d368ebdc20eeff6b1f1cf5058d1b5d05
2016-12-16 19:46:00 +01:00
Dominik Riebeling
14ef6079c0 Fix various unit test compilation.
There's now a dependency on Logger.h, add stub folder to includes to stub it.

Change-Id: I1afdc6bd878182b03cb3c1f3538779eaa9f83f28
2016-12-16 19:44:41 +01:00
Amaury Pouly
ac0fc74d56 imx233: don't print disabled IRQs in debug screen
There are lot IRQ and most are unused most of the time, this is annoying on
devices with small screens.

Change-Id: I7f3453f2768b8e35a5a367fbcf1e4cf3cf73bcd7
2016-12-12 13:25:41 +01:00
Amaury Pouly
17277fa1bf imx233: add more icoll statistics
Those new statistics give the maximum time an IRQ took and also the total
time spent in IRQ, for each IRQ. Hopefully those do not take took much time
or space to collect. If this is the case, it can be enabled in debug builds only
the future.

Change-Id: I05af172897c5cb7ffcc9322452f974d8f968e29d
2016-12-12 13:20:10 +01:00
Amaury Pouly
a523c3fcfe imx233: fix IRQ handler w.r.t unwinder
The IRQ handler saves registers on the IRQ stack, saves the old PC to imx233
HW_DIGCTL_SCRATCH0 register and switcht to SVC for the actual handling. The
old code had a problem in that if the unwinder is called during the IRQ (for
example by the watchdog), then __get_sp() will use SPSR_svc to discover the
previous mode, switch to it and recover SP. But SPSR_svc is invalid, it should
be SPSR_irq but we switch from IRQ to SVC mode. The new code copies SPSR_irq
to SPSR_svc in IRQ to fix this problem. It also saves/restore SCRATCH0 in
case I one day renable nested interrupts or use SCRATCH0 for other purposes.
I also changed the old watchdog code to call UIE directly instead of trying
to make the code crash with a SWI.

Change-Id: Id87462d410764b019bd2aa9adc71cb917ade32e3
2016-12-12 13:17:33 +01:00
Amaury Pouly
7e0820fe21 unwinder: in get__sp(), use the more correct "msr cpsr_c, ..." form
Change-Id: I9cfdca80536fc9fb6e8983a81219ccdf5c0b3c42
2016-12-12 13:15:47 +01:00
Amaury Pouly
89e6189dcb uda1380: document audiohw setting based on uda1380.c
Change-Id: Ia799e47249b4b0008bfe8e633c61548a667b9288
2016-12-12 13:14:22 +01:00
Amaury Pouly
4304d47d3b tlv320: document audiohw setting based on tlv320.c
Change-Id: I7cf354cb948444595ca541a4bf70dfbcf01147f2
2016-12-12 13:13:52 +01:00
Amaury Pouly
4d526df7ac wm8975: document audiohw settings
Change-Id: I0456f85e4ebc821c23e25026fbee3d8cf7526ee7
2016-12-12 13:13:13 +01:00
Amaury Pouly
69ea311398 wm8758: document and fix audiohw settings
It looks like a copy and paste error to me, those were completely wrong.

Change-Id: Id6ae025f4216ffccb1a8b8b790916d8b6c4694bd
2016-12-12 13:12:47 +01:00
Amaury Pouly
90a32ccad6 wm8751: document and fix audiohw settings
Document 3D depth range. Fix mismatch in recording volume: the displayed volume
is completely off the chart

Change-Id: I4c363f369e5d72f332391a6f96457b4e450404f9
2016-12-12 13:12:15 +01:00
Amaury Pouly
cc031d41ab wm8731: document audiohw settings
Change-Id: I78ec26a00a3e14a95c591ac81d96e1b480b9138e
2016-12-12 13:11:25 +01:00
Amaury Pouly
b55adf1ca2 as3514: document hardware setting based on as3514.c
Change-Id: Ifc3c4cf75f7091da0b4c4ce5b0c291b373cf9a3a
2016-12-12 13:10:52 +01:00
Amaury Pouly
9ca8bd64cd manual: document 3D enhancement
3D "enhancement" is available on all imx233 platform, and also on platforms
with the WM8978 codec (gigabeats) and WM8750 codec (MPIO HD 200/300). I used
different texts for different codecs because (in theory) they do different
"things".

Change-Id: I62ecb075f7594427491b6be83cfa80f763566aba
2016-12-12 13:10:36 +01:00
Amaury Pouly
af81cc4a93 imx233: slightly rework 3D audio setting
The old code made the setting appear as 0dB, 1.5dB, 3dB and 4.5dB when
in fact it is 0dB, 3dB, 4.5dB and 6dB. This commit clarifies the code and
also fix this at the same time. This imx233 3D enhancement is complete crap anyway
but now you can satisfy yourself with 6 dB of pure crap, clearly an enhancement.

Change-Id: Ia3e088987c1ff0cdde228905ff70f46476a499a2
2016-12-12 12:15:24 +01:00
Amaury Pouly
bfd3b08312 Document AUDIOHW_SETTING
Everytime I use it, I get highly confused because it's complicated and
undocumented. The code is spread all over the place and some targets clearly
use incorrect values. This is the first step of a series to cleanup audio settings
and document it properly.

Change-Id: I20cb7af2bfa33986cb8b0bf8573f17a92227f893
2016-12-12 12:15:07 +01:00
Amaury Pouly
1c97083ca7 imx233: refactor power off and reboot
There is no reason to use different code paths

Change-Id: I4894c7963c802b56b5d3576909e1008a7c401935
2016-12-12 12:06:42 +01:00
Amaury Pouly
9aeb6f48b8 Make it clear that the NWZ-E370 port also handles NWZ-E380
Change-Id: Icc061f15f4cac3d8bd9f95ea3b583556a9402f0b
2016-12-12 12:06:29 +01:00
Amaury Pouly
a983859291 imx233: add capability to boot OF or updater instead of Rockbox
This commit adds the necessary code in the dualboot stub (bootloader) to
let rockbox control the boot process. In particular, rockbox can now choose
if the next boot will be normal (boot rockbox or OF on magic key), to OF
or to updater.

The intents (to be added in follow-up commits) are:
1) Let the user more easily reboot to the OF. On some targets it is not trivial,
especially in USB mode.
2) Automatically reboot to updater when the user drop firmware.sb at the root
of the drive (currently, the user needs to do that in OF USB mode)
3) Document this OF magic

Change-Id: I86df651dec048c318c6a22de74abb8c6b41aa9ad
2016-12-12 12:03:08 +01:00
Amaury Pouly
5c50efc9ce hwstub/tools: always run make for the libraries
This ensures that the libs are always up-to-date hopefully.

Change-Id: I790302fcabc91457091006de749b76735fdd510f
2016-12-12 11:53:41 +01:00
Amaury Pouly
8e82839fe2 hwstub: various cleanups
- hwstub load now properly stops reading the log when the device returns a 0
  size buffer instead of STALLing
- add debug output option to hwstub_load
- correctly report transfered size on write error
- add some debug error message in usb code so that some errors can be diagnosed
  more easily
- add a batch mode to hwstub_shell to disable the interactive shell
- increase usb control timeout to 1sec, 100ms was really tight
- cap usb buffer size to ~4000 bytes because libusb has a hardwired limit of
  4096 bytes for control transfers

Change-Id: Id3200ab99ce70a7a3b09ce7faeaafa4a0fac64c7
2016-12-12 11:35:16 +01:00
Franklin Wei
5b52ff2c93 Add myself to COMMITTERS
Change-Id: I1702c3fc8cd282221213251463cff329b5cfb869
2016-12-11 15:59:59 +01:00
Franklin Wei
16e22b5b9f Add tentative new element names, IUPAC approval expected around November
Change-Id: I40adb1adb27894b15d3bc3a2388bd2059e75636e
2016-12-04 18:05:51 +01:00
Amaury Pouly
906a95ccbf rockoxdev.sh: fix compilation of ARM toolchain
This will breaks mips but mips is already super hard to build anyway.

Change-Id: Ia481a22440758fe72a87e2808f4fb8d31c49cb53
2016-12-04 15:11:58 +01:00
Amaury Pouly
bbf4ff2c91 Fix DEBUG build codecs
In DEBUG build, the codec API struct is consider with DEBUG flag in apps/
but without DEBUG flah in rbcodecs/, leading to unmatched structure and horrible
crashes in some cases (mostly encoders). I have no idea why the codecs Makefile
removes the DEBUG flag (maybe for performance reasons?) but it cannot be right.

Change-Id: Idb2c5f66741408ec2939624590fc39c4cf69fc2b
2016-12-03 23:07:32 +01:00