Commit graph

33819 commits

Author SHA1 Message Date
Franklin Wei
2b49724c3a attempt to fix sysfont.h errors
Change-Id: Icc67dc777d3a2269ececbf4fbe34d78d7bd34087
2017-12-24 13:29:09 -05:00
Franklin Wei
581a82e854 Undef potentially conflicting macros in stdio_compat.h
Change-Id: If4af3e3cc16a947127e6253d0b81b684b5abb0c9
2017-12-24 13:00:26 -05:00
Franklin Wei
7ea37bb806 fix red
Change-Id: Ib28cfd9037901c7b8bc9b2960ad2c1c9a1e25a69
2017-12-24 12:58:33 -05:00
Franklin Wei
6416d96fbc fix red
Change-Id: I20f1bd6f0208f6108d68fb59206b09dd9da4f1af
2017-12-23 21:28:20 -05:00
Franklin Wei
a855d62025 Port of Duke Nukem 3D
This ports Fabien Sanglard's Chocolate Duke to run on a version of SDL
for Rockbox.

Change-Id: I8f2c4c78af19de10c1633ed7bb7a997b43256dd9
2017-12-23 21:01:26 -05:00
Franklin Wei
01c6dcf6c7 Support floating-point formatting
This is just a quick and dirty way to get %f formatting to work for
some games. It works.

Change-Id: I75585e0c6a0f9d6db41a87b71ca405b067d8b85d
2017-12-23 20:55:02 -05:00
Marcin Bukat
a8423321b8 stdio compat layer for plugins
This is attempt to simplify porting programs to rockbox (as plugins).
Currently this compat layer implements:
fopen(), fclose(), fflush(), fread(), fwrite(), fseek(), fseeko(),
ftell(), ftello(), fgetc(), ungetc(), fputc(), fgets(), clearerr(),
ferror(), feof(), fprintf()

In order to use it you need to include in ported sources
"lib/stdio_compat.h"

Change-Id: I5add615dd19c5af9c767ccbfb1bd5a4e466741cb
2017-12-23 20:54:56 -05:00
Michael Sevakis
d35a18f6b4 Buffering: Missed converting one case assuming const handle size.
Must now be h->size, not sizeof (type).

Change-Id: Ia0b1b552a486ddbc28b80542cfa76bed9e7cfdb3
2017-12-19 14:19:39 -05:00
William Wilgus
71e3f6c077 Fix error with action subsystem and custom context mapping
I removed the mechanism to fall through to internally mapped contexts
after plugin contexts were exhausted

Change-Id: Id287248184fd67cb2a2242475296247ac86af807
2017-12-18 22:23:18 +01:00
Michael Sevakis
786fbbfa20 Buffering: Get rid of disabled code I have no intention of using
Change-Id: I0e5a20e042291180391b0b0059e44705c256d3e5
2017-12-17 18:49:24 -05:00
Michael Sevakis
95ec1f7a6f Remove buffering functions from plugin API.
They aren't used by anything. Must bump min API version.

Change-Id: I9851ab255fc779fff13cb778517f554e5dd20e28
2017-12-17 18:43:23 -05:00
Michael Sevakis
dfff938dff Get rid of useless playlist probing and fix up some data types.
Playback checked the files' presence before attempting to buffer
the track. Just get rid of that and save an extra open/close call.
It will find out if the path is bad when the metadata fails.

Fix some size_t/off_t conflation. No need to update plugin version
because no plugin actually uses bufopen().

Change-Id: I3db112449dc0b2eeb91c546f308880ac82494fc7
2017-12-17 16:33:50 -05:00
Franklin Wei
d14e3f45a8 Fix last commit
Change-Id: Ie3b3fad702e8c03d33b4a264139b6de74736e058
2017-12-16 16:41:20 -05:00
Franklin Wei
430534b1fc Change button mappings in plugins/lib/keymaps.h
Some of the previous mappings didn't make much sense.

Change-Id: If373e7d5f28b572523856763c999eb7c5180aced
2017-12-16 16:23:25 -05:00
Michael Sevakis
02d20ebc25 Fix big WTF when closing the current track.
It must be set to something else valid (unless it's the only one
left) when closing it, IN ALL CASES, not just if it's first or last.
Don't know what was in my head. Hopefully takes care of a reported
issue. Even if it's not causing any issues, it was still incorrect.

Change-Id: I594af8b35d774ec222dadce80dfa8b95138f037e
2017-12-15 22:39:46 -05:00
Michael Sevakis
c8564f1ca8 Get voice event out of playback.c
Purpose: A step in removing all voice references from playback code
and prelude to other changes.

Change-Id: Ic3ad7f7a33b979693e18a3456ced37eb1d2281a4
2017-12-12 20:28:56 -05:00
Michael Sevakis
838ff9c67d Add a 32 byte read buffer to read_line.
Do as with fdprintf and avoid filesystem calls for every single
byte. If it overreads, just put the excess back with lseek, which
does no I/O itself.

Change-Id: Ifd5d21b5dca7183346e44d365d3f7d45e8cc6438
2017-12-12 15:57:51 -05:00
Michael Sevakis
cd3ea086ec Buffering: Remove statically-sized path buffer from handle struct
Paths are stored after the structure at their actual length plus
any aligment padding. In principle, any type of auxilliary data
could go there.

Change-Id: Ic5487dc4089781b5cc52414d1691ba6d9dc1893c
2017-12-10 14:51:43 -05:00
Michael Sevakis
6ee3b6feee buffering.c: Fix oopses with caching handle pointer
The location of the handle cannot be kept across calls to
shrink_handle() since it may move the structure. The error was
there in one place at the inception, corrected, then reintroduced.

Make shrink_handle() return the new location and use it, which
makes the side effects of the function clearer.

Change-Id: Icae6a0ad6f7bb0d6645b044cccfa4aef88db42ad
2017-12-09 23:45:53 -05:00
Michael Sevakis
8be40746b8 Remove recursion from shrink_buffer()
There's no need for it any longer since the list is now doubly-
linked. As a bonus, stack limits pose no barrier to the length of
the list.

Change-Id: I41c567f946b640ef1e3c2d93da2f5aef9a763c66
2017-12-09 21:57:01 -05:00
Michael Sevakis
65515f32b6 Fix yellow on hosted targets from c1a01be
Change-Id: I4c63efc6570368df76b6c4bbfb5b673dd081145b
2017-12-09 17:34:33 -05:00
Michael Sevakis
c1a01beded Playback: Move internal track list onto buffer
Does away the statically-allocated track list which frees quite
a fair amount of in-RAM size.

There's no compile-time hard track limit.

Recommended TODO (but not right away): Have data small enough use
the handle structure as its buffer data area. Almost the entire
handle structure is unused for simple allocations without any
associated filesystem path.

Change-Id: I74a4561e5a837e049811ac421722ec00dadc0d50
2017-12-09 17:05:59 -05:00
Michael Sevakis
e86ea6bdb9 Get test_codec synced with changes in 6c868dd
Change-Id: I47c5ae09ff620b46e42463654e1a073b59fb2191
2017-12-08 21:32:54 -05:00
Michael Sevakis
6c868dd48f Remove explicit 'enum codec_command_action' in codec API
Just use long so the compiler potentially doesn't complain about
use of other values not in the enum. It's also the type used
around the system for event ids.

Increase min codec API version.

No functional changes.

Change-Id: If4419b42912f5e4ef673adcdeb69313e503f94cc
2017-12-07 14:41:59 -05:00
Michael Sevakis
83e8e35a58 Ensure ci is properly updated if seeking before track load completes
If in the middle of a manual skip, playback would try to seek, and
therefore start, the codec before the audio handle was available.
This wasn't really a problem since the codec would just bail out
and be retried later. But, it is a problem for a change I was working
on with seeking where the codec could get caught in a full-speed
loop trying to seek itself (stoppable, not lockup).

The main side effect of this change that you may notice, if using an
HDD with dircache turned on and the disk is not spinning, is that you
can keep holding down prev/next if dir skipping and the WPS will
start FF/RW mode. By the time the new track shows up, you will have
seeked into it some amount.

Well, the PBE is getting the info ASAP anyway and as far as it's
concerned, the next track is under way. On that end of things, it's
correct. Perhaps WPS should lock out its own seek mode at certain
times.

Change-Id: Ifc7409a886df399cec189d1bae2adba3872e857a
2017-12-07 11:33:29 -05:00
Michael Sevakis
bef75a94f8 Playback: C99-ize FOREACH_ALBUMART; make loop counter local
Change-Id: Ie6d571ef217246e22b465ef39097ad9d9d1a6436
2017-12-04 12:59:15 -05:00
Michael Sevakis
055e2115de Add a small 32-byte write buffer to fdprintf.
Avoids a call to write() for every output character. It doesn't
need to be very large to have a great effect on speed and realize
most of the potential.

Change-Id: I11820c1968ed7b20aa00e106a022c1b864b03d21
2017-11-28 09:01:17 -05:00
Franklin Wei
d728b9775b puzzles: fix off-by-one in blitter clipping
Nobody to blame except myself for this one...

Change-Id: I8446b564c3c060411c46675e9baac1c72437c39a
2017-11-24 20:31:45 -05:00
Franklin Wei
f51544a0e5 puzzles: polish mouse mode
Reduces lag when dragging. Also throws some comments in.

Change-Id: Ibd0d95e94200ae6de8258ce8d2e001c931161385
2017-11-24 20:31:45 -05:00
Franklin Wei
ab6e40b977 puzzles: fix copy-paste typo
Change-Id: I09d065574a02a541c43c1a78d92e50a80b5e2ae0
2017-11-24 20:31:45 -05:00
Michael Sevakis
abef236081 Do playback restarts the proper way
It isn't necessary to explicitly stop and restart playback to
force it to update something that must cause rebuffering.

Change-Id: I6ff5394fcafc7374af67ef9fbf9022bb4a79b773
2017-11-24 08:55:49 -05:00
Franklin Wei
75d2e1f35c puzzles: add missing file
Change-Id: I72444b57abb7b7327891b17a22fbe2cafdf724a6
2017-11-21 19:54:14 -05:00
Franklin Wei
c1dc957195 puzzles: clean junk files
These are really not needed.

Change-Id: I8aa8d648c363c657ca104fc9876b3c63558c5608
2017-11-21 19:29:46 -05:00
Franklin Wei
e8e85c5762 puzzles: resync with upstream; add Loopy and Palisade, mouse mode
This brings a various small changes to the drawing and input code,
as well as a brand new "mouse mode", where input goes to a virtual
mouse cursor. Only Loopy has this mouse mode enabled by default,
while other games have it hidden away under the debug menu. Some
changes by me to Palisade were required to make it playable; those
are included here as well. Right now, sgt-net is pushing the c200v2's
upper limit on size and may have to be dropped in a future commit.

Change-Id: I495d2a2125462c2985aec1ffbc54bbe3fe5133bd
2017-11-21 19:29:45 -05:00
Michael Sevakis
f4c4221306 Convert i.MX31 and AMS target to use RTC interrupt
Instead of checking ticks, set a sticky dirty flag that indicates
that the RTC needs to be read. This gives a timely update and more
accurate readout without actually reading the RTC until it changes.
The implementation should atomically read the flag and clear it.
Setting the flag would typically happen in an RTC tick ISR.

Change-Id: I6fd325f22845029a485c502c884812d3676026ea
2017-11-21 07:52:02 -05:00
Michael Sevakis
12bc24adbf aced667 forgot about those pesky __PCTOOL__ things.
It was so close to aced666.

Change-Id: I2b952a0704bb2d006db5e3ea4a929db3118cf390
2017-11-21 06:08:23 -05:00
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