Commit graph

15486 commits

Author SHA1 Message Date
Michael Sevakis
7373cf518f Restore dircache hookup in the database ramcache.
Do a few other changes to dircache and file code flags to
accomodate its demands.

Change-Id: I4742a54e8cfbe4d8b9cffb75faaf920dd907cf8a
2017-02-10 05:05:23 -05:00
Franklin Wei
abd75a17d1 puzzles: fix up makefile
- rewrote a bunch of repetitive rules with a pattern rule

Change-Id: I86a61a7ed8398f18789e5efaf4996d9eafd50651
2017-02-09 22:36:05 -05:00
Amaury Pouly
d7871914ac Fix dangerous casts
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is
not valid. In any case, one should use intptr_t and ptrdiff_t when casting
to integers. This commit attempts to fix all instances reported by GCC.
When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h

Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
2017-02-04 17:24:47 +01:00
Amaury Pouly
1245c5fe61 Implement speaker enable/disable on jack (un)plug
The implementation is not very complicated but there are a few things worth
noting. There was a previous "speaker enable" setting but it was a boolean.
I decided to replace it with a choice setting that has 2 options (on, off)
if headphones cannot be detect on this target, or 3 options (on, off, auto)
if we can detect headphones. This will break the old setting on target that
cannot detect jack but it makes the code more uniform and avoid maintaining
two settings with more #ifdef. The third option (auto) uses the LANG_AUTO
text, which I think is clear enough (disable speaker on jack plug).
In order to avoid code duplication (both in apps and firmware), I decided to
keep the audiohw_enable_speaker function as-is: it takes a boolean and doesn't
care about the speaker policy. I introduced a new audio_enable_speaker that
takes directly the mode (which follows the setting encoding): 0=off, 1=on
and 2=auto. This way one calls audio_enable_speaker and it changes the speaker
once to reflect the request mode. The apps code then uses this function in the
places where it makes sense: on setting load, setting change and jack (un)plug
event.

Change-Id: I027873f698eb4bc365d7c02b515297806355d9e2
2017-02-04 17:22:08 +01:00
William Wilgus
1fa7c56351 Fix for Chessbox bug FS#10363
Chessbox was overflowing GameList[240] causing the board to flip + crash

GameCnt changed to unsigned char which allows the array to roll over
to 0 after 255

define MAX_GAME_CNT 256 and GameList[MAX_GAME_CNT] along with 1 byte GameCnt
should fix this issue

dbg save routine left in for now to help identify any other problems

Added bounds checking to prevent second bug found when loading .pgn files

Change-Id: I2b615c8ecbed4368724412f80ce07346f3cf30a7
2017-02-01 01:33:48 +01:00
William Wilgus
37522ec63a Remove Whitespaces from chessbox
Remove 1616 Whitespaces from chessbox

Change-Id: I84c0dbd4a177eba50b9f7427f5695ae4b266aa5e
2017-01-31 01:09:23 +01:00
Michael Sevakis
783c77531c AMS: Return ascodec to interrupt-based I2C2 driver
1. Slightly revised and regularized internal interface. Callback is used
for read and write to provide completion signal instead of having two
mechanisms.

2. Lower overhead for asynchronous or alterate completion callbacks. We
now only init what is required by the transfer. A couple unneeded
structure members were also nixed.

3. Fixes a bug that would neglect a semaphore wait if pumping the I2C
interrupts in a loop when not in thread state or interrupts are masked.

4. Corrects broken initialization order by defining KDEV_INIT, which
makes kernel_init() call kernel_device_init() to initialize additional
devices _after_ the kernel, threading and synchronization objects are
safe to use.

5. Locking set_cpu_frequency has to be done at the highest level in
system.c to ensure the boost counter and the frequency are both set in
agreement. Reconcile the locking inteface between PP and AMS (the only
two currently using locking there) to keep it clean.

Now works fine with voltages in GIT HEAD on my Fuze v2, type 0.
Previously, everything crashed and died instantly. action.c calling
set_cpu_frequency from a tick was part of it. The rest may have been
related to 3. and 4. Honestly, I'm not certain!

Testing by Mihail Zenkov indicates it solves our problems. This will
get the developer builds running again after the kernel assert code
push.

Change-Id: Ie245994fb3e318dd5ef48e383ce61fdd977224d4
2017-01-25 00:05:13 +01:00
Michael Sevakis
c6299b268d action.c must desist in calling set_cpu_frequency from a tick
The function is neither reentrant nor ISR callable. Instead of
using a ticked-based timeout, have the button driver provide the
unboost after a delay when waiting for a button.

HAVE_GUI_BOOST gets immediate boost after dequeuing any message,
otherwise the queue has to have at least three messages waiting
for it to trigger a boost-- essentially the behavior that existed
but now combined in one place.

Change-Id: I1d924702840f56a1a65abe41fa92b4e753c4e75a
2017-01-21 12:03:23 -05:00
William Wilgus
6103d4d83d Selective Backlight Softlock Fix misleading indentation.
Change-Id: Iffbdd3c5bd8d2d23f4f7e3af42e16ab0c1dc312b
2017-01-17 23:50:38 +01:00
William Wilgus
dc87e9e9f3 Selective Backlight/Advanced Softlock - Selective actions based on context
Selective backlight allows the user to choose actions that will not
enable the backlight when pressed.

Advanced softlock allows user to choose actions that  will not be
blocked by screenlock on devices without a hold button.

Both only occur in FM and WPS Contexts.

Update:
Back from the dead
-Cleaned up code, removed unnecessary calls, re-arranged last filter action
  timeout conditional to work in case last_filtered_action_tick was never set
-Added entries to the manual
-Fixed back button on some menus not activating backlight
-Made menus more intuitive, no actions selected now changes menu item to off.
-Added talk fuctionality.
-Added option to disable selective backlight while on external power.
-Rewrote backlight and softlock handling code to fix issue with scrollwheels
-Menu changed to have toggle(yes/no) and settings
-Optimized selective actions lookup
-Added option to disable notification of 'buttons locked' while softlocked
-Removed uneeded code, consolidated action lookup to single function
-Fixed incorrect name on selective softlock menu
-Added option to disable touch on touchscreen devices
-Fixed backlight on original screenlock without selective screenlock active
-Added text selection in mask_select for when show_icons is off
-Fixed voice in mask_select to speak if voice is defined instead of spelling
-Added more lang defines (play skip seek)
-Added option to disable unknown keys turning on backlight
-Fixed Conditional argument In wrong place causing players without
	backlight to fail to build
-Fixed Disable Unknown blocking detection of context change
-Fixed canceling menu didn't update new settings
-Added Autolock on backlight off
-Removed backlight_on_force from backlight.c, Now sets ignore next to false
	and uses backlight_on
-Cleaned up autolock code added strings to lang file
-Fixed issue where rapid presses would bypass softlock
-Removed old softlock code, Cleaned selective actions code
-Changed menu to match existing RB menus
-Fixed Backlight_on_Hold blocked by backlight_ignore_next
-Fixed ignore_next for ipod
-Fixed bug allowing context with softlock to bypass selective backlight
-Changed mask_select to no longer prompt for changes to be saved
-Changed menu names
-Added ignore timeout to allow ipod scroll wheel to work properly and other
 players to still work properly, removed some previous code including
 ignore_event
-Increased ignore timeout to prevent sd card accesses from interrupting action
 code and turning on backlight
-Changed Unknown action to unmapped action in menu, changed handling code
-Removed unneeded logic and variables for handling unfiltered actions
-Reverted unmapped action code to previous functionality
-Added manual entries (thanks JohnB)
-Removed elusive unhandled unicode character from manual, changed formatting slightly

Actions:
Volume,Play,Seek,Skip

Extras:
Disable unmapped actions
Disable selective backlight on external power
Disable touch during softlock on touchscreen devices
Disable softlock notifications (power button still notifies)
Autolock on backlight off

Method:
Adds a function to ignore backlight on next call
 If selected action occurs backlight is forced on,
 Filter_first_keypress stays intact.

Selective softlock allows selected actions through, bypasses the normal
 softlock routine.

ToDo:
DONE

previous commit (#1) has attribution for folder_select.c which mask_select
is based from.

Change-Id: I08132ddcfd64c81751ef23b720f3ec6d68695fe4
2017-01-17 23:06:17 +01:00
Michael Sevakis
16a9f84571 Reenable database ramcache and playlist dircache
Playlist dircache references should be back in working order.

Reenabling dircache references in the database ramcache is not
yet done as it requires quite a bit of rework. Otherwise, the
database in RAM is functional again.

Some buffer compatibility changes have been made for database
commit because the dircache buffer can no longer be stolen, only
freed by an API call.

Change-Id: Ib57c3e98cb23e798d4439e9da7ebd73826e733a4
2017-01-17 15:27:47 -05:00
Franklin Wei
0056ea8a25 puzzles: more accurate sin() and cos()
- now uses fp_sincos()

Change-Id: I20c8224cac98fc677097161737d25dd9038bede2
2017-01-16 20:54:56 +01:00
Franklin Wei
1b882cb156 puzzles: change default optimization to -O2
Change-Id: I606df468f92f8d550827c122a9cfd5248866afdb
2017-01-16 20:54:37 +01:00
Franklin Wei
39434309d0 puzzles: fix copyright year
Change-Id: Iaa02e7a1fe4c17be7c4decbd5eb71206469710e9
2017-01-16 20:54:15 +01:00
Franklin Wei
2bc5173d45 puzzles: fix overlay loader (monolithic builds only)
Change-Id: I7f27e96036b5d22e946cc72146cd0f5a791deaf7
2017-01-16 20:53:13 +01:00
Franklin Wei
fb2da13cd2 puzzles: disable unplayable puzzles (Solo and Loopy)
- accidentally enabled in c200v2 fix

Change-Id: I252191fc47da9fe1a664a260cb53f6a5a1eea437
2017-01-16 20:25:03 +01:00
Matthias Mohr
d984725cbf Renamed defines UNALIGNED to ROCKBOX_UNALIGNED - UNALIGNED is already
defined in mingw environments.

Renamed defines of UNALIGNED to ROCKBOX_UNALIGNED so that they don't
conflict with definitions in mingw32 cross-compiling environments
(defined in _mingw.h).

Change-Id: I369848c0f507e6bf5ff9ab4a60663bbbda6edc52
2017-01-15 21:32:49 +01:00
Franklin Wei
a724dbbe91 fix whitespace
Change-Id: I9b0659c218f92051a4de99ec03b97a2b1d067e29
2017-01-15 14:32:24 -05:00
Franklin Wei
0bdb255a4e puzzles: fix building on c200v2
- disables Solo and Loopy

Change-Id: I3de15c0ad001683a4303950972af2f5988d438d0
2017-01-15 14:29:24 -05:00
Franklin Wei
d221ca6e5b puzzles: antialiased line drawing via Wu's algorithm and optional "shortcuts" for undo/redo
- line drawing should eventually be moved to xlcd, but for now it's very unportable code
- also fixes a minor issue with the configuration screens

Change-Id: I897f01b7210cbbec32665c2bc67920c965ea0bec
2017-01-15 14:29:24 -05:00
Amaury Pouly
793c0411be Fix compilation of puzzles on Windows
mingw exports vsscanf and that clashes with rbwrappers' definition.

Change-Id: I87481ff4e93547059b2e1fa8083bedcf8633343a
2017-01-15 18:30:30 +01:00
Franklin Wei
c1b913bb7d Revert "puzzles: antialiased line drawing and optional "shortcuts" for undo/redo"
This reverts commit 8e4429853d.

Change-Id: Id622d58ad4b3b9dd3313811c8a2f83202d21f5ee
2017-01-13 23:52:04 -05:00
Franklin Wei
823f726f83 puzzles: fix configuration menu (again!)
Change-Id: I440f3cea1bbeb3e7bda4aebefaaece3e8f3d44fd
2017-01-13 23:22:51 -05:00
Franklin Wei
8e4429853d puzzles: antialiased line drawing and optional "shortcuts" for undo/redo
- line drawing should eventually be moved to xlcd, but for now it's very nonportable code
- fixes a minor issue with the configuration screens

Change-Id: I897f01b7210cbbec32665c2bc67920c965ea0bec
2017-01-13 23:22:51 -05:00
Franklin Wei
637c7414a9 puzzles: enable fallback to audiobuf when smalloc() fails
- upon a failed smalloc(), the audio buffer will be used for further allocations
- should fix things on low-memory targets (c100 and c200v2), but breaks playback
- playback should still be intact on other targets

Change-Id: Ic239f1316efadc957050afacf5c614dbbca3f805
2017-01-13 19:00:09 -05:00
Michael Sevakis
5c6ccb43b5 Fix track formatting problems in playlist.c
Some changes in behavior were made with filesystem code commit
for the sake of compatibility that changed expected behavior.

* Restore substitution of drive spec in fully-qualified DOS paths
with the playlists's volume spec (or root on univolume targets).
Drive-relative paths of the form "c:foo" (no separator after
':') will be treated as purely relative.

* Restore old behavior of preserving leading whitespace in the
source path and trimming only trailing tabs and spaces.

* Multivolume: Volume substition on fully-qualified UNIX/RB paths
has NOT been reintroduced (and perhaps wasn't intended in the
first place). They will not be modified because there is no
ambiguity to resolve. Doing so would prevent a playlist on
external storage from referencing a file on main storage without
qualifying it with "/<0>...".

* Plain relative paths are and always have been interpreted as
relative to the location of the playlist.

Change-Id: Ic0800cea79c59563b7bac20f8b08abb5051906c7
2017-01-07 19:10:02 -05:00
Franklin Wei
2915370b7d puzzles: add cursor interface to untangle
- makes it playable
- submitted to upstream

Change-Id: Ib672ee374d500a994bc8e78eb01fea529ec5132f
2017-01-07 15:32:35 -05:00
Sebastian Leonhardt
1728565e24 Midiplay: only boost cpu in sensible code parts
Change-Id: I9aaf7f2844e9f90030dbf0a63ebec80db4851e18
2017-01-06 21:39:56 +01:00
Sebastian Leonhardt
5279d60e0a Midi Player: fix premature stopping of audio buffer playback
Change-Id: I3794e8d8837722442b25e2b48db1b5b3c3c2dc51
2017-01-06 20:44:25 +01:00
Sebastian Leonhardt
69e9738a1c Midi Player: fix playback of buffer remains when seeking
Change-Id: Iccf4444b9c8ae421b9e44332791a789a767ae411
2017-01-06 20:18:42 +01:00
Sebastian Leonhardt
e813c3f50b Fix red (midi plugin: action rename)
Change-Id: Ie21711cbf98aad1fbfc24924c9281caf39f22af5
2017-01-06 20:01:45 +01:00
Sebastian Leonhardt
e05545bc2b Midi Player: give button actions meaningful names
Change-Id: I53183e024c202f6c35903fc9a74db7e49d4bdc20
2017-01-06 19:43:59 +01:00
Frank Gevaerts
afd482f51b midi: Recalculate (and rename) the note frequency table.
gustable[] contained plain note frequencies in milliHertz, but
was named and documented to appear like a table of magic numbers.
The values also seemed to be slightly inaccurate (up to about
0.01Hz, so probably irrelevant).

This changes the name to freqtable to make the purpose clearer, and
uses slightly better values.

Change-Id: I6b568d834c8c2c92161bed5290572a29733e28dc
2017-01-06 19:29:00 +01:00
Michael Sevakis
bc4c13ee8a Fix previous errors for targets with no crossfade.
Change-Id: I1c10f5588f3fe06c7071f3f07b68e3d552c44f05
2017-01-05 03:22:47 -05:00
Michael Sevakis
6c837394ca Playback: Fix problems with crossfade on short tracks.
Addresses issues brought up in this thread:
http://forums.rockbox.org/index.php/topic,51605.0.html

While we're at it, improve the quality with a sample-level fader.

Change-Id: I73dde60d6858a1c9042812e26d490739e3906a1e
2017-01-05 02:37:14 -05:00
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
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
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
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
Franklin Wei
16e22b5b9f Add tentative new element names, IUPAC approval expected around November
Change-Id: I40adb1adb27894b15d3bc3a2388bd2059e75636e
2016-12-04 18:05:51 +01:00
Franklin Wei
e7d952db07 remove debug macro
Change-Id: I1bf6ecc5bb5275fd4addd3fdb62a89df441afe81
2016-11-19 13:41:46 -05:00
Franklin Wei
05733649bc XWorld: some fixes
Fixes sound on most platforms, original root cause was bad menu code
as well as DMA callbacks taking too long. Worked around with smaller
chunk sizes. Permanent fix would include moving mixing out of the
callback. Rewrites input with code from rockboy/doom. Cherry-picks a
change from Gregory Montoir's `rawgl' to patch the code wheel
screen. Finally, adds a motion blur filter on select targets.

Change-Id: I8df549c923c5075800c6625c36c8202e53de1d27
2016-11-19 19:17:14 +01:00
Frank Gevaerts
2a2800b528 pdbox: fix bug shown by new gcc warning
Change-Id: Ife308a3090f9bc62f2e98d2d979fdf393c22054d
2016-10-12 16:52:49 +02:00
Sebastian Leonhardt
e6687c11f2 Rockboy: revert FS#11745 patch
William Shipley sent this patch via mailing list. Original Message:
  "There was a patch to rockboy in 2010 that fixed a problem where
  the bottom tile row would be rendered at the top.

  Here's the relevant issue from that time:
  http://www.rockbox.org/tracker/11745

  Note that Stummi openly admits it was a hack, not a true fix.

  Sometime in the 6 years since, the root cause was fixed. Currently,
  rockboy on the Clip+ and other 64px models shows the top of the gb
  screen along the bottom of the display.

  I confirmed that reversing this patch fixes the issue on my own
  Clip+"

I don't have any of the mentioned targets, so someone else has to test.

Change-Id: Id29b78c4ece0af53ba1280029c18b76808a21da2
2016-10-03 18:16:47 +02:00
Amaury Pouly
5918e18e81 zenxfi3: fix recording keymap and simulator keymap
Change-Id: I246834b5244d4e0f672633d2960db45278e12ec4
2016-09-21 00:29:42 +01:00