Commit graph

33909 commits

Author SHA1 Message Date
William Wilgus
0d41e13cf4 Fix lua lseek command / io lib
lua would not return or set arbitrary file positions
file:seek("set", 0) worked file:seek("cur") worked
but setting an offset or file:seek("end") failed

I tracked this down to a bug checking the return of rb->lseek

on error lseek returns a negative number and returns the file
position otherwise, the function was checking for if(N) instead of
if(N < 0)

Fixed - limited size of lseek to size of signed LuaNumber

Fixed - io:lines() stopped after first line containing only a newline
        instead of returning a blank line and continuing till EOF
        this fixes file:read("*l") as well

Fixed - ssize_t for read() with error checking

Change-Id: Ie859b288fb8f6814f1b3ae30992ecf78f2669de7
2018-05-27 17:55:10 +02:00
William Wilgus
1f63604e2c Fuze PLUS Fix lcd_update_rect()
Lcd_update rect was hanging during horizontal screen update x = 238 and width = 2
which was within the bounds of the screen, this seems to be a weird corner case
but more testing needs done.

Update_rect now properly bounded between 0 - screen w/h
--Cleaned up code

Pixels in x are now multiples of 4.

Datasheet states:
-------------------------------------------------------------------------------------------
WORD_LENGTH=0 implies the input frame buffer is RGB 16 bits per pixel.
DATA_FORMAT_16_BIT field indicates if the pixels are in RGB 555 or RGB 565 format.
Limitations:
— BYTE_PACKING_FORMAT [3:0] should be 0x3 or 0xC if there is only one pixel per word.
— If there are two pixels per word, BYTE_PACKING_FORMAT [3:0] should be 0xF and
H_COUNT will be restricted to be a multiple of 2 pixels.

and

WORD_LENGTH=3 indicates that the input frame-buffer is RGB 24 bits per pixel (RGB 888). If
BYTE_PACKING_FORMAT [3:0] is 0x7, it indicates that there is only one pixel per 32-bit word
and there is no restriction on H_COUNT.
Limitations:
— If BYTE_PACKING_FORMAT [3:0] is 0xF, it indicates that the pixels are packed, i.e. there
are 4 pixels in 3 words or 12 bytes. In that case, H_COUNT must be a multiple of 4 pixels.
-------------------------------------------------------------------------------------------

We are using 16 bits per pixel and byte_packing = 0xF but device crashes with multiple of 2 pixels

Behaviour can be verified with plugin - oscilloscope, Horizontal mode device hangs as indicator
reaches right of screen

Change-Id: I1445f5334f4e7fe59304c65c76b47d0daa0614b2
2018-05-25 22:48:01 +02:00
William Wilgus
038a10220e Fix Remove lcd_scroll_worker from bootloader except remote displays/charcell
This patch was supposed to only remove scroll worker from devices without
remote displays, the build system said otherwise

Change-Id: I240db89ee6b55818dbd2567338515b53ebe09300
fixed: conditional define
2018-05-25 19:16:45 +02:00
William Wilgus
0999a22ef8 Remove lcd_scroll_worker from bootloader except remote displays and charcell
Removes unneeded scrolling fuctionality from bootloaders

Change-Id: Iebe308144cc11c9139399702e3dcd1a548cb9831
2018-05-23 00:37:27 +01:00
Michael Giacomelli
0b2f5187a3 Don't enable full vuprintf file in bootloader. Saves ~2KB packed space when patching clip+ OF.
Change-Id: Ie03714778918bfb4a1087f60534d60ff349a8330
2018-05-23 00:07:57 +01:00
Franklin Wei
992a12670e puzzles: update frontend for new upstream, misc. changes
The upstream code changed a little bit with regard to the request_keys()
API. Also, we save some bytes (especially on the c200v2) by compiling with
-ffunction-sections and -fdata-sections, which allows Net to fit once again.

Change-Id: I3ab30127169c73e4cd8996f0c12e1223ee18d79f
2018-04-24 19:06:30 -04:00
Franklin Wei
b29611fe2c puzzles: update help text, make generation and testing cleaner
This includes an upstream change to the Galaxies help text. `genhelp.sh'
no longer leaves temporary files sitting around, and the self-test feature
of lz4tiny.c works again.

Change-Id: I787f4cb3c258baade31638d6be18f95b7aa0705e
2018-04-24 19:06:30 -04:00
Franklin Wei
8f23493e08 puzzles: resync with upstream
This brings the upstream version to b3da238 (though some of my own
changes are included on top of that).

Change-Id: Ida73e8cd86765413147ce891af3cc2b7aeda2b2a
2018-04-24 19:06:30 -04:00
Franklin Wei
ef0fb52113 puzzles: silence some warnings
Change-Id: Id6fd9d8dd3021f5e2cb93565d7e419aaf07f9af0
2018-04-24 19:06:30 -04:00
Michael Giacomelli
56803c80d0 Add battery calibration for Sony NWZ A10. 2018-04-20 20:14:46 +01:00
Franklin Wei
22823e2f78 puzzles: save some bytes
This should cut just enough size off the binary to let Net still compile
for the c200v2. This is probably close to the last time I'll be able to do
this; I'm already resorting to dirty hacks like writing super terse error
messages.

Change-Id: I43344b9a601696d7ca56fc02af4a611fd9d1a150
2018-04-17 22:13:31 -04:00
Franklin Wei
e84fc26fb8 puzzles: clean up for rockbox
Disabled vprintf() call in Filling, and reordered vertices in Unequal.

Change-Id: Ia3d8cd46ae3a7909b7dc2a8de762aa3173634d1e
2018-04-17 18:46:05 -04:00
Franklin Wei
6dc9d1d730 puzzles: enable all the remaining games
They all work now :). I merged in part of Chris Boyle's Android port of
Puzzles to give the front end a way to know what keys the back end needs.
This also re-syncs to the latest upstream sources.

Change-Id: Ie0409bbb32f617ae5abf4f81be3b45d1552db9bb
2018-04-17 18:20:12 -04:00
Sebastian Leonhardt
7a12e796a6 Oscilloscope plugin: bundle #define NEED_LASTBUTTON to a single place
This fixes a warning that was introduced with enabling plugins for
the Zen XFi-2.

Change-Id: I8fe9a4be301f2c4643d04ae42d2189e62c191592
2018-04-03 14:58:34 +02:00
Sebastian Leonhardt
0486e5b93e Zen XFi2: Enable Plugins
Keymaps aren't tested, there may be room for improvement.


Change-Id: I6b8fe697899b241ea6e96f4fe446d88671ad7818
2018-04-03 11:34:01 +02:00
Sebastian Leonhardt
fb3f7651fd pacbox for small screens, up to 75x96
Change-Id: I6e9adf2f6923f4d0078a54e9857fc8eacef259a6
2018-04-03 00:21:40 +02:00
Sebastian Leonhardt
96335a7eb2 pacbox: clean-up screen size code
removes the code duplication for lcd scaling in
pacbox.h/pacbox_lcd.h

Change-Id: Ib0aeacc9934351c5e32cd4b7576cdc840e6ff7da
2018-04-02 20:29:01 +02:00
Franklin Wei
d5847e8cb2 duke3d: add manual entry
Oops. Apparently I neglected to add this and it's gone unnoticed until
now.

Change-Id: I938f14c3dfcc4336acca1517988fd096e11ab241
2018-03-18 19:23:57 -04:00
Franklin Wei
9006e75cde puzzles: fix typo
Change-Id: I6b8c18472749248508d4e5b1595b8903e687f67c
2018-03-18 13:07:39 -04:00
Franklin Wei
77641d59a7 puzzles: add formatting to help viewer
The help text is now processed to generate a style array to pass to the
display_text library in addition to the text itself. The help text is still
compressed using LZ4, and still fits on the c200v2.

Change-Id: I7a3a664f90f67a1a018956c72d2b62d92b8ffd17
2018-03-17 22:54:21 -04:00
Franklin Wei
6039eb05ba sdl: remove non-rockbox drivers
We never use any of these other drivers, so having them around just takes
up space.

Change-Id: Iced812162df1fef3fd55522b7e700acb6c3bcd41
2018-03-12 20:52:01 -04:00
Franklin Wei
ef373c03b9 sdl: clean up audio driver
This prevents a (highly improbable) race condition when exiting, and uses
pcm_set_frequency() instead of mixer_set_frequency(), since that seems like
the Right Thing to Do (TM).

Change-Id: Icb6a4597843215f08b3835490ac63f67c9a04736
2018-01-15 19:47:49 -05:00
Franklin Wei
beaeb28a29 duke3d: bump audio sample rate to 22.1KHz
Recent optimizations to sound mixing should allow this, up from 16KHz.

Change-Id: I0ba5742c934118a3a6505b8dc58578b0cfe8ea77
2018-01-15 19:45:57 -05:00
Franklin Wei
cf07bb328d duke3d: further optimize audio mixing
Rather than holding intermediate results as fixed-point, this converts them
directly to normal integers (in the range of the PCM sample) while mixing,
instead of waiting till the end to perform a separate shifting step. Also,
this precalculates some constants in the reverb code.

Change-Id: Ie04e444d145bc28ce67eef9ae0ead6d328acf28a
2018-01-15 19:45:28 -05:00
Franklin Wei
69ff35ac49 sdl: correct misleading comments
Change-Id: Ieb33d3fec1e0d834c5e294b79f280959497acb6a
2018-01-14 19:32:13 -05:00
Michael Sevakis
769d73d734 Use sleep(0) instead of yield() in SDL_WaitAudio
This allows CPU load to drop below 100%, which is good for anything
that scales frequency and voltage based on CPU load. Also conserves
some energy by letting the core go idle if there aren't any available
buffers.

Change-Id: I9385ac9e030f97010b12eb825875a900463ab0ac
2018-01-14 19:32:13 -05:00
Michael Sevakis
a1123de28f Gigabeat S: Remove unwanted partitions on the fly
Windows now ignores the hidden flag, so just nullify the entries
to hide depending upon whether or not bootloader install mode is
activated.

Change-Id: I00d0797e40ea3b5f5d5d8e1243b50cfcdd029bb4
2018-01-14 08:23:48 -05:00
Amaury Pouly
11437662c4 nwztools/scsitool: fix completely stupid code
Change-Id: I3771388d24fe5fa249dcb40b231d7a4e06d3c3c8
2018-01-13 19:12:43 +01:00
Amaury Pouly
4d988d43d8 nwztools/scsitool: print clearer message when nvp info is incomplete
Change-Id: I13b20b88b35e825da929a31e71ff42d68a79f131
2018-01-13 12:18:01 +01:00
Amaury Pouly
6c856c412a Add information for NWZ-S630 and NWZ-S730
Change-Id: I4c48c9a8d862eaf67ec27c1c13b9b7f1fb204fc0
2018-01-13 12:07:21 +01:00
Franklin Wei
ccd612345c sdl: fix freeze on startup on PP targets
Using the coprocessor was a good idea in theory, but didn't actually work.
This moves all SDL threads to the main core, which isn't ideal, but at
least works. Additionally, this also adds some good-practice stuff such as
setting the default sample rate on exit.

Change-Id: If1636b33d439000ec7c4e50f46e8d002708d3121
2018-01-11 19:45:31 -05:00
Amaury Pouly
0d794c0c06 sonynwz: Add NVP information for NWZ-A810
Change-Id: I37671ddf15ee1a4b469f97fe06ec86249ff9ce60
2018-01-07 23:24:58 +01:00
Franklin Wei
896c828152 duke3d: unregister timer on exit
This was leading to a crash upon audio playback after running the game.

Change-Id: I1e9961da443c21e3eff38bcf9877ffa75a922715
2018-01-05 18:05:10 -05:00
Franklin Wei
9f6ce046cb duke3d: rewrite sound mixing to use fixed-point
Gives significant performance improvement on ipod6g.

Change-Id: I1e8462bec197acb10e770c796240b5001df52440
2017-12-26 23:42:42 -05:00
Franklin Wei
78db1d9502 duke3d: use hardware FPU if available
Change-Id: Idd9fad7bc0604a553c282a0f8c663ad44030ecac
2017-12-26 23:40:16 -05:00
Franklin Wei
6a843ca2b2 Revert "Support floating-point formatting"
This reverts commit 01c6dcf6c7.

The hack isn't used in duke, so having it is redundant.

Change-Id: Ieb36d75718e0c2d1305440d08021744625117886
2017-12-24 19:22:17 -05:00
Franklin Wei
8a705f696e duke3d: Credit the authors
Change-Id: Id27ea4e124b41e819de9218488564a036a01efe2
2017-12-24 18:32:58 -05:00
Franklin Wei
56d14b0a0e duke3d: restrict manual building to enabled targets
Change-Id: I1a66bf5184c9e1f53212f97b097a542f794f2721
2017-12-24 18:01:33 -05:00
Franklin Wei
54d8e67530 duke3d: restrict targets to ARM only
Change-Id: I484d6de2d5d4a495ed54e8ee2a80459785b5f5e8
2017-12-24 18:01:28 -05:00
Franklin Wei
8d3e3056f7 fix red once more
Change-Id: I6290cc6cca468c197656236d3dd31c3f72c53842
2017-12-24 17:43:30 -05:00
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