check if any buttons are waiting in the queue before triggering
the event thread for action & button events
makes button events quicker and also spend less time interrupting lua
both wins
Change-Id: I38346c084afdd99e4608f40b52053ee39730fb40
cool little lua based audio player
creates dynamic playlist of 10 mp3s found on device if no music loaded
I had to limit the depth of search to 3 levels due to the recursive
nature of the current dirbrowser functions this could be rectified with a
bit more code
fixed a bug in print.lua that kept scrolling text even after screen clear
Change-Id: Ifd285332df41a409ecaeb1ea447ad15537b5d04c
I had previously added the fuctionality to luadir but I didn't update
the examples
also breaks out the file_browser function to be a bit more accessible
Change-Id: I14067256b9d76a757f732840cbee1cf84d775b1b
Remove mp3_is_playing() entirely, in favor of pcm_is_playing()
Remove mp3_play_pause() entirely, as it's a dummy/no-op call
Remoce some archos-specific comments
Change-Id: I4e9ff323490a93add00809efd19e0d4e3f198b2d
Fixes deficiencies with the button system on the X3
The x3 has an interesting button layout.
Multiple key presses are NOT supported unless
[BUTTON_POWER] is one of the combined keys
As you can imagine this causes problems as the power button takes
precedence in the button system and initiates a shutdown if the
key is held too long
instead of BUTTON_POWER use BUTTON_PWRALT in combination with other keys
IF using as a prerequsite button then BUTTON_POWER should be used
Multiple buttons are emulated by button_read_device but there are a few
caveats to be aware of:
Button Order Matters!
different keys have different priorities, higher priority keys 'overide'
the lower priority keys
VOLUP[7] VOLDN[6] PREV[5] NEXT[4] PLAY[3] OPTION[2] HOME[1]
There will be no true release or repeat events, the user can let off the
button pressed initially and it will still continue to appear to be
pressed as long as the second key is held
Tree scrolling is PLAY+NEXT or PLAY+PREV
Change-Id: I88dfee1c70a6a99659e8227f5becacc50cc43910
shortcuts can be exported as .opx; now they can import as well
if parameter is a valid file..
plugins with parameters are now hashed on the parameter path
fix bug with empty parameters not overwriting last valid parameter
Change-Id: I149519811f07cb4ba22b7113449e2f89f77f1eee
OP allows you to use Open With.. to call plugins with parameters
called directly it acts as a shortcut list for plugins
open_plugins.rock interfaces with the open_plugin core
When opened directly it acts as a viewer for the plugin.dat file
this allows you to edit the paths and parameters for
core shortcuts as well as your added plugins
If a plugin is supplied to the viewer it is added to the dat file
If instead the plugin has previously been added then it is run
with the parameters you previously supplied
-----------------------------------------------------------------------------
Added export to .opx files
this allows shortcuts to plugins with parameters to be called from
the file browser
Change-Id: Ib8b05a60b049fb1d5881031ca09a07e3307d375a
open_plugin allows arbitrary plugins to be called
in hotkey and start screen
replaces PictureFlow Integration
shortcuts menu plays plugins now too
rather than store paths and parameters in the settings
that reside in memory instead entries in a file are searched by hash.
after all, the plugin has to be loaded from disk anyways
----------------------------------------------------------------------------
shortcut_viewer.rock-- can now call plugins rather than taking you to them
in the browser
-----------------------------------------------------------------------------
Added a new option to menus:
F_CB_ON_SELECT_ONLY
instead of option callback every time a item is accessed
F_CB_ON_SELECT_ONLY fires callback only when item is selected
-----------------------------------------------------------------------------
Added manual entries
-----------------------------------------------------------------------------
Change-Id: I078b57b1d2b4dd633c89212c1082fcbc1b516e6a
* Get rid of the non-functional GT2 loader
* Add the UMX loader
* Add HQ mixer routines (and make it configurable)
* Allow samplerate to be configured at run/playtime
* Support >64KHz mixing/playback
* Correctly restore non-boost status
(The diff to upstream is much smaller now too!)
Change-Id: Iaa4ac901ba9cd4123bb225656976e78271353a72
I'd overlooked this code path earlier. In the case of an unknown GRP, the
game would poll SDL for keyboard input, which it never received. Remove
that, and just warn the user instead.
Change-Id: Ibbabc0f8d43cb1276ed2fcfc3c6138517582e936
allows user to run plugin in background that voices
status messages
grouping is now working it counts ; as the end of a group
sleep timer remaining is not voiced if sleep timer is not active
TODO
manual entries
Change-Id: I39e8500df6440c07d2a3347513c749d5e155d1cc
As the PP series has no sense of cache coherency between its multiple
cores, we need to ensure the vo_data structure does not share cachelines
with anything else.
This was previously done by defining a uint8_t array and trying to
access it via typecasting hell, triggering a large pile of aliasing
violation warnings on newer toolchains and/or higher optimization
levels.
Instead of violating the C spec in an undefined-behaviour-sort-of-way,
create a union of the right size and alignment, and make one of its members
the structure we care about. Voila, everyone is happy.
Change-Id: Iad78f8132225437cd4aa10e6e5f6ae58ba996c19
Note: I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.
Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.
Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
HAVE_LCD_BITMAP is now redundant.
lcd_bitmap is always-on in features.txt so manual and lang strings
don't have to change
Change-Id: I08eeb20de48099ffc2dc23782711af368c2ec794
rb core allows you to load custom keyboard layouts
this patch adds the ability to load a keyboard layout in a buffer
the custom layout is temporary and does not overwrite the current layout
use like so:
unsigned short kbd[64];
unsigned short *kbd_p = kbd;
if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
kbd_p = NULL;
rb->kbd_input(buf,sizeof(buf), kbd_p);
Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
keep running into the rigid nature of do_menu
it isn't too bad when you don't need voice but once
you do the fun awaits
do_menu likes to talk on menu enter which is in a loop when you use do_menu
I would like to move the processing to the callback
TOO BAD you only get an action and the menu_item_ex struct
you sent it when calling the function
Change-Id: Iaefd0cc133435d675b7dd27a558c504d6ccb327a
We were improperly conditioning the state reset with `do_pausemenu'. We
should reset the input state no matter what.
Change-Id: Iaafc59b95e9f1f053b57a34f0f28f7c672c0e327
First I discovered a bug in the code to display the currently playing
album from the WPS
--on a NULL id3->albumartist field PF would crash
now checks for a match in id3->albumartist and then id3->artist
if neither exists then the search uses <untagged>
ditto for album
The album index feature (recently added) did not check for enough
room in the buffer on restore
--save and restore code cleaned up a bit
moved all buffers to their own struct
tracks with no title now show filename rather than <UNTAGGED>
Reworked album search function
album search was going quadriatic resulting in some outrageous
index build times [40mins+ for 4000 albums]
building now done in stages and duplicates removed at end
*MUCH FASTER*
Album art
empty album art is no longer stored in the art cache
PF will now allow you to cancel building album art without
forcing a rebuild next run,
it will continue searching for album art in the background
album art is now updated in the background on each start as well
tracklist now rolls over at the end
artist_index is now discarded after album_index is created
Cleaned up some of the myriad of global variables
Added quit prompt for index building
Added sanity checking for album_index loaded from disk
Change-Id: I8494cb7abcb1ae8645c223fc3c11dc0ee749883a
This works around an odd issue in Mines involving the zoom feature. The
chain of events leading to it is rather convoluted:
1. No save game is found, so no fonts are loaded from disk.
2. A new game is started.
3. The user selects the "Zoom" option.
4. The allocation of the zoom framebuffer causes the malloc code to grab
the audiobuffer. This causes all further font_load() calls to FAIL, due
to buflib allocations no longer working.
5. The user goes back to the normal view and uncovers a square.
6. Font loading fails, causing the drawing code to fall back to the system
font.
7. An unrelated bug (not yet tracked down) causes font_get(FONT_UI) to
return a different font.
8. font_getstringsize() returns the right size of the "wrong" font, leading
to centering issues upon rb_draw_text().
The real solution to this would be to fix font_get(), but this fix should
prevent the issue from happening if Mines has been run and saved at least
once before.
Change-Id: Ib9ad51376eeb3ca1113a1f3786124b612db88cd7
Frontends now have a way to retrieve the backend cursor position with some
changes I've submitted upstream. With this information, we can now follow
the cursor around in "interaction mode" while zoomed in, eliminating (most)
need for mode switching.
Also does some cleanup of the frontend code.
Change-Id: I1ba118f67564a3baed95435f5619b73cfa3ae87a
- zoom now remembers position between activations (but not when exiting the
plugin)
- key repeat enabled when panning
- moving mouse out of frame while zoomed will pan
- mouse can be moved diagonally
Change-Id: I39380ef7f36238700b6baa54cac036832933df67
We had some issues in Keen with the arithmetic operators not being rendered
properly. This is still a kludge (we should intelligently search the font)
but is still less ugly than the garbage it was drawing before.
Change-Id: I5b957c7371b659ea6d64847145f9913b2a892e48
We have a couple games like Untangle and mouse-mode games in which the
software poweroff is very annoying.
Change-Id: I554b89aecf8c7cc20c6c7f305be1b8807dc9283b
On some devices, the button driver allows a "software poweroff" by long-
pressing a certain key. This behavior is inconvnient when that button needs
to be held down for other purposes, such as moving the cursor in rockpaint
or sgt-untangle.
This patch allows selectively disabling the software poweroff (enabled by
default) from both core and plugin code.
Change-Id: I7580752888ae5c7c7c5eb1be5966e3d67f17d4b4
For some reason lcd_getstringsize was occasionally reverting to the system
font, rather than the loaded font. This was leading to improper font sizes
being reported.
Change-Id: Ie5fc31de9a6a7af739beb22efc3ec1383206eaea
I can't believe this has gone unnoticed for so long... We need to update
the game size upon loading games. Who knew?
Change-Id: I929f8139457853440ae687bd937af989fa7c6f93
The name buffer is using too much ram for some targets
will revisit later...
removed extraneous call to set_scrol_lline
Change-Id: I56d658149bcb0c50857d25924e37bcb46a612c75
- Extra data structure to store artist info.
- Create_album_index modified to perform a different query.
- Added load and save functions to store the data index in HDD.
- Album collisions fixed.
- New config options to perform rescans.
- Extra fields added to lang files: english and spanish.
Update CREDITS
Change-Id: I31814b38d8b4e7fa4b65f5e6e51aa5f00d271ece
using rockev for button presses
misc code refactoring, comments
drawing code is now split from game logic
cpu boost for targets that support it
removed quite a few if then statements by using dynamic functions
for ball draw, step, hit_check
shows two ways to do OO functions (closure and reference)
Change-Id: I63e795bbe90b033eabadc1f519cf3b635cf5e1a7
just a few tweaks to the RockEv backend to allow tighter event timing
originally there was a timeout where events would be consolidated
prior to running the event thread, this slowed the faster events
but it turns out this isn't really a big waster of time
The callback from C => lua is a far bigger bottleneck
Change-Id: Iffacbe49c4b83155099b1304590450f746576fa4
WIP for passing arguments to lua scripts
args are recognized by adding ?arg to the end of the script path
The easiest way to do this currently is to use the function rb.restart_lua
local sfile = rawget(_G, "_fullpath") or ""
local sArgs = rawget(_G, "_arguments")
if not sArgs then
rb.restart_lua(sfile .. "?my arguments")
else
rb.splash(1000, sfile .. "?" .. sArgs)
end
I'd eventually like to figure out a sensible way to do this from a
shortcut / quick list
Change-Id: I2b60fe3b8f1d04b57361fe532510bd6afee59fbf
(A lot of work was done on this thing, for a target that hasn't been compileable
at least since we moved to git..)
Change-Id: Ibface9392f3251b5be4bf1e0c4d12639c4f1662d
Provided by Roman Stolyarov
Integration, Refactoring, and Upstreaming by Solomon Peachy
X3II confirmed working by forum tester, X20 is nearly identical.
This includes bootloader, main firmware, and the flash image patcher.
Eventual Todo:
* Further refactor AGPTek Rocker & xduoo hiby bootloaders
* Further refactor AGPTek Rocker & xduoo hosted platform code
Change-Id: I34a674051d368efcc75d1d18c725971fe46c3eee
After a few issues with the timer code in the hosted players
I realized a few shortcomings in the original rockev code...
This rewrite gives thread_exit an explicit flag instead of 0
custom events now have a set-able timeout
previous lua hooks are restored
flags are stored in uint8_t
Change-Id: I9ca45246ac9233a2faa581e26a8cc5e5fb512e88
-Make pacbox AI score agnostic.
-Fix corner case of Game Over/reset with AI on.
-AI can now start on level where pattern starts facing right.
Change-Id: Ibc5416a53ebc07506c31434051b6d47b276cf668
This makes wolf3d work with the shareware files available on the wiki. This
will make things work out-of-the-box with Rockbox Utility.
Change-Id: I9118ecf8715c688565982fc4feb29a8641d68b6a
with the addition of suspending all events on thread start and exit
we don't really need to block on THREAD_QUIT in so many places
Removed suspend clearing on event unregister and updated comments
Change-Id: Id9c6a460def558c5331ee292035691a9f82b2c43
report of call after free on event thread on Agptek Rocker
I'm guessing its a race condition between the thread and the timer
but can't say for sure without some more testing
Change-Id: If11bd718b3cfa81ea13fff378df56d12afa17a7f
rb.strip_extension and rb.create_numbered_filename
have been moved to include_lua/files.lua
to use simply add require('files') to your script
Change-Id: I95af7b312c8614cb10da4b71b22714b3e282e08a
everything that would have been added has already been added or
needs more supporting functions so they've been excluded for the time being
Change-Id: I4ae4753c543287934702a3bd2eeccce5b032235d
removes some usless / duplicated functions
removes atoi - lua tonumber() does this for you
removes strlen - lua string.len does this for you
removes system_memory_guard - if a device that actually implements
system_memory_guard needs it we can add it back conditionally
consolidates talk_number and talk_spell (on backend)
consolidates talk_shutup and talk_force_shutup talk_shutup(bForce)
Change-Id: Id132642f087975a7c132e99a668a41c977942b81
for fname, isdir, attrib in luadir.dir(scrpath, true) do
passing true for the second argument returns table of
file/dir attributes in attrib
Change-Id: I7c999e2fc5dac95b8ccbe169f2119c31b63f6a41
forum user fprockboxer asked for a way to detect long presses within the
do_menu routine this adds that functionality
result = rb.do_menu("Title",t_items, start, menu_callback)
function menu_callback(action)
...
return action
end
Change-Id: I110c590095a743a57d0a7d45b24309899a4629cf
Adds example scripts for reading track metadata + dumping albumart
and rockbox settings
settings are now stored as a table of strings rather than a table of tables
as it saves ~15 kb of ram without adding much complexity
Change-Id: I611c312b2a60ab96e595e4710b17aedbd6c0689b
back when I wrote this I was running the sim on a 32 bit machine
I didn't catch the hardcoded LONG_MAX reference or the fact that
lua_tointeger maxes ot at 32 bits
on 64 bit machines strtol caused all kinds of issues especially since
it returned the real LONG_MIN/MAX values
Change-Id: I3571ebbd9df333f7cbf4077562412c27429bfadc
* Properly account for ID3v1 tags
* Play time computation fixes
* Add speech feedback
Patch by Igor Poretsky
Change-Id: Ia6df8fb171882a88527cfa9d3b76b705f09becdd
This boosts performance to 13.0FPS on ipod6g for `timedemo demo1'. That's a
+34% increase from baseline.
Change-Id: I50bae7783ff2fce46e8257c251c6b639c069e7cb
I didn't do _OPT3 because it's disabled in the PQ source.
This gives as +0.2FPS boost over the last commit.
Change-Id: I9c3c8fb7bd23262beb810da6e9469d6b6c4b2a81
The PocketQuake project, available below, has some nice fixed-point code:
https://web.archive.org/web/20150412233306/http://quake.pocketmatrix.com/PocketQuake0062_src.zip
I'd like to see most of them merged into our Quake port. This commit
gives +0.9FPS on ipod6g. (A big change given that it was running at
only 9.7FPS to begin with!)
Change-Id: I91931bdd5c22f14fb28616de938a03b4e7d7b076
Gives us the lowest HW sample rate that's >= 22KHz.
Needed because some targets that don't support 22K support 11K or 8K, so
HW_SAMPR_MIN will give us much lower quality than is acceptable.
Take advantage of this new macro in the SDL, MIDI, and MIKMOD plugins,
and implement a crude "fast enough" test to enable higher sample rates
on more capable targets.
Change-Id: I6ad38026fb3410c62da028e78512e027729bb851
LCD developed 9/2015 by Terry Ellison
We've already discarded the ldebug module from lua
it only makes sense to discard the debug info as well
adds 1.5 K to the binary
saves 8 Kb on the base state
once scripts start getting called i've seen 10-50Kb savings but it all depends on
what exactly you are running
Change-Id: Ibb74f344df1c4c96380ec6c98b010a810e9ae9cc
- Improved sound quality (use 44.1KHz)
- Conventional mixer is now used
- Playback is performed in a separate thread
- Speech feedback in menus
Patch by Igor Poretsky
Change-Id: I13baa224cefd67aefe6d62b988971bfbd421757d
This is not a very pretty fix, but code that doesn't crash is better than
code that crashes... "If it runs, it's done."
Change-Id: Ia1d0c537e5e5e60fb80cf7d7de2332e1c712806f
Forgot a return statement in Sys_FileRead (which slipped by since I've made
the questionable decision to disable all warnings...)
Change-Id: Ia0f3da52b43765b8e0e9953893ac7957ec2f6c2e
For some reason a NULL pointer creeps in, on the simulator only, it seems.
This makes sure that if it happens on target we'll know about it.
Change-Id: I7a5bc9dd3ef71f28d58d0d456d23007dc0d49ce3
COM_LoadStackFile was not thread-safe since it relied on a global variable
to pass the loadbuf parameter to COM_LoadFile. This was causing mysterious
crashes when model loading and audio mixing were happening simultaneously.
Change-Id: I505c5ef0ed49d0c4aa4b11cfed05647c75b5b40d
- Unfinished game is now saved along with current position.
- All savings are automatically done on shutdown.
- Implemented facility to view played games.
- Fixed bug that prevented program from the very first move.
Patch by Igor Poretsky
Change-Id: I997b97752e4362ed953309bea985d071f9db229b
paths.
If ROOTDIR=/rockbox and BUILDDIR=/rockbox/build-something, it is now possible to
successfully build both target binaries and simulators.
Change-Id: If12d1d5933c5a15feebf627a4f1636dc1e3a67fa
Derivative of work by RobertGabrielJakabosky
http://lua-users.org/wiki/EmergencyGarbageCollector
I've only implemented the not enough memory part and
expanded this idea to adding a mechanism to signal
the OOM condition of the plugin buffer which allows us to only
grab the playback buffer after garbage collection fails
(SO THE MUSIC KEEPS PLAYING AS LONG AS POSSIBLE)
Change-Id: I684fb98b540ffc01f7ba324ab5b761ceb59b9f9b
This caches large files (arbitrarily defined as >1MB) in memory, which
reduces the delay when a new model or sound is needed.
Change-Id: I0f96449555a32f05d771fe900c10eaf21ecbb4f6
The quake commit tried to optimize lcd updates but inadvertently broke
wolf3d (which always uses a 320x200 screen size). This fixes that and also
lets direct mode truly exit early to hopefully save some cycles.
Change-Id: I41d96cd584257fe25e791c7f615812849f348e4f
add defines for sound functions
SOUND_VOLUME, SOUND_BALANCE, SOUND_CHANNELS, SOUND_STEREO_WIDTH ...
defines depend on target
require "sound_defines" to add them to rb.sound_settings[]
consolidates:
sound_set, sound_current, sound_default, sound_min, sound_max,
sound_unit, sound_pitch, sound_val2phys to a single function
rb.sound("name", setting, [value])
require "sound.lua" for old functionality
Change-Id: Ice695218aa433f4fcbb48fbd6b8a9bf29c994110
ef9ee89 introduced Read{Big,Little}{Short,Long,Float} functions to safely
read a value in memory. These incorrectly take char*, which causes them to
output erroneous 0xff bytes when given bytes with bit 7 set.
Change-Id: I9531172301aecfdacae405d2f782f662608ce6df
The d*_t structs are from "d"isk, which means they could be
unaligned. Packing them saves me from having to rewrite every single
access to them.
Change-Id: I6d5a9525fff368bf29bdb85cf1672fce02ce3396
As rbcompat.h is -include'd on the command line, the mkdep script doesn't
pick it up. Explicitly add the dependency to lang_enum.h to the makefile.
Also add lang_enum.h to the 'make clean' target!
Change-Id: I33c8ed0cd5c1d44dce02ac9285469c0e4feac00e
Original patch by Mario Lang
Heavily updated by Igor Poretsky
Further updated by myself
This patch breaks binary API compatibility by placing the new
functions where they make the most logical sense. IMO this is
the better approach to take given the scope of the changes needed
for talk support.
Since binary API is changing, the patch also moves some other
functions around to more logical locations.
As well as voice support in plugins, this patch voice-enables several
simple plugins. There will be follow-up patches for many plugins that
build on this one.
Change-Id: I18070c06e77e8a3c016c2eb6b6c5dbe6633b9b54
This ports id Software's Quake to run on the SDL plugin runtime. The
source code originated from id under the GPLv2 license. I used
https://github.com/ahefner/sdlquake as the base of my port.
Performance is, unsurprisingly, not on par with what you're probably
used to on PC. I average about 10FPS on ipod6g, but it's still
playable.
Sound works well enough, but in-game music is not supported. I've
written ARM assembly routines for the inner sound loop. Make sure you
turn the "brightness" all the way down, or colors will look funky.
To run, extract Quake's data files to /.rockbox/quake. Have fun!
Change-Id: I4285036e967d7f0722802d43cf2096c808ca5799
This library allows events to be subscribed / recieved within a lua script
most events in rb are synchronous so flags are set and later checked by a
secondary thread to make them (semi?) asynchronous.
There are a few caveats to be aware of:
FIRST, The main lua state is halted till the lua callback(s) are finished
Yielding will not return control to your script from within a callback
Also, subsequent callbacks may be delayed by the code in your lua callback
SECOND, You must store the value returned from the event_register function
you might get away with it for a bit but gc will destroy your callback
eventually if you do not store the event
THIRD, You only get one cb per event type
["action", "button", "custom", "playback", "timer"]
(Re-registration of an event overwrites the previous one)
Usage:
possible events =["action", "button", "custom", "playback", "timer"]
local evX = rockev.register("event", cb_function, [timeout / flags])
cb_function([id] [, data]) ... end
rockev.suspend(["event"/nil][true/false]) passing nil affects all events
stops event from executing, any but the last event before
re-enabling will be lost, passing false, unregistering or re-registering
an event will clear the suspend
rockev.trigger("event", [true/false], [id])
sets an event to triggered,
NOTE!, CUSTOM_EVENT must be unset manually
id is only passed to callback by custom and playback events
rockev.unregister(evX)
Use unregister(evX) to remove an event
Unregistering is not necessary before script end, it will be
cleaned up on script exit
Change-Id: Iea12a5cc0c0295b955dcc1cdf2eec835ca7e354d
Rockbox constants are auto generated by a perl script like the majority
of the plugin functions.
Constants are contained in rb_defines.lua, if the file exists it is auto loaded
by the lua state for backwards compatibility
Frees ~1k
Change-Id: I237700576c748f468249e501c839d89effca3f39
We have quite a bit of ram tied up in lua with our c libraries
I was searching for a way to free up some of this when I came
across read only tables in e-lua but that involved a lot of patching
through the source
Instead I came up with this..
it frees about 15k ram without much slowdown in code execution
since after a function gets called it is automatically added to the table
If you have a performance issue you can call the bind method
to bind a specific function or the whole table in one shot
for instance rb table
rb("lcd_clear") -- binds/returns function rb.lcd_clear()
rb(nil) -- binds every function in rb table + removes latebind metatable ..
-- added pairs and ipairs code from lua 5.2
-- cleaned up code + made more seamless
existing fields are now saved rather than overwritten when table is bound
Change-Id: I1c20e76b736c032dedc727d2e58928641e40191d
Allows saving of ram by reusing strings already stored in the binary
and storing a pointer instead of malloc and copy to get them inside
the lua state
Saves about 1.5K overall
Derivative of work by bogdanm
RAM optimizations: pseudo RO strings, functions in Flash
d54659b572
Change-Id: I21d6dcfa32523877efd9f70fb0f88f2a02872649
track elapsed is needed to use fast-forward and rewind effectively
track length might as well be added too..
Change-Id: I906c92eb5260164c6177d8c0a8ff879b1fad7898
wl_def.h has a #pragma pack(1), which causes issues when we take the
address of an unaligned struct field. This fixes the issue by
disabling packing in fmopl_gpl.c.
Change-Id: I526880fa73226e8028855896f7efc3a66571b3ec
This is a port of Wolf4SDL, which is derived from the original id
software source release. The port runs on top of the SDL plugin
runtime and is loaded as an overlay.
Licensing of the game code is not an issue, as discussed below
(essentially, the Debian project treats Wolf4SDL as GPLv2, with an
email from John Carmack backing it up):
http://forums.rockbox.org/index.php?topic=52872
Included is a copy of MAME's Yamaha OPL sound chip emulator
(fmopl_gpl.c). This file was not part of the original Wolf4SDL source
(which includes a non-GPL'd version), but was rather rebased from from
a later MAME source which had been relicensed to GPLv2.
Change-Id: I64c2ba035e0be7e2f49252f40640641416613439
Prevents system SDL from interfering with thread driver selection. Also
adds test code for alignment faults.
Change-Id: I8bc181922c4a9e764429897dbbaa1ffaabd01126
We don't have the functionality in the viewer to run pre-compiled chunks
plus if anyone ever wants to add it its easy enough to remove the define
frees 3K
Change-Id: I8d2086e04b51e3ce147ab8741a7d354cb9bf1ade
The simulator build will pull in the host SDL headers, which we can't
filter out easily. A simple workaround is to simply remove the pthread
include from our SDL.
Change-Id: I09de0f2e85b891aa88958e21426ab450af516e76
There is no easy way to determine iram available for
test_mem plugin and PLUGIN_BUFFER_SIZE is definitely wrong.
Restore previous IRAM buffer sizing
Change-Id: Ia563efd46497438c111efc8d7d2bf65904ca9847
This brings the puzzles source to upstream commit e2135d5. (I've made my own
changes on top of that.)
This brings in a couple bugfixes and a new solver for Dominosa.
Change-Id: I11d46b43171787832330a5e2e0d2f353f36f727d
- fix double down wins/looses too much money
- fix splitting doubles lost/won amount of first split
- fix insurance pays out too litle
- fix splitting allows to overdraw account
- fix insurance allows to overdraw account
Change-Id: Ib58954d6b960fb2a78f5b4d29496974b7c58fb65
rewrite the logic of boomshine to make it more difficult
especially small screens
rewrite of the game engine to make memory usage more consistent
throught the level and decrease overall memory usage
this also removes most of the stuttering in play
Add test of device speed this should improve very slow devices
but the threshold might still need tweaked
Change-Id: I49f5269c69405f6b6060ab18f52c96e3f69ebb14
- Synchronized with actual state of Vortex version in general.
- Playback resume has been moved to the Power button.
- Option button acts identically in most contexts: main menu on short
press and quickscreen on long press.
- Defined A-B repeat mode control buttons.
- Level change action in chessbox has been moved to the volume down button.
(Patch by Igor Poretsky)
Change-Id: I48046ff123d2bccdc0d0c4ed8b088e2053aefa5e
In newer builds line markers prevent lua helper scripts
from grabbing some inputs especially _bool
This patch adds the -P switch
Inhibit generation of linemarkers in the output from the preprocessor.
This might be useful when running the preprocessor on something that
is not C code, and will be sent to a program which might be confused
by the linemarkers.
Change-Id: I66c3b099729f6651300f9fcf4670533a20cc90c1
This brings the code to upstream commit 3ece3d6 (I've made my own Rockbox-
specific changes on top of that).
Changes include using C99 `bool' throughout, and minor logic fixes for some
puzzles.
Change-Id: Ie823e73ae49a8ee1de411d6d406df2ba835af541
dsoundfile.c used memcpy for overlapping memory regions switched to memmove
Suppress the 160+ warnings for cast-function-type
This plugin would require major work to fix these warnings
Change-Id: I309d914839c1e70126a05b387863fd21613497a9
This is a seemingly random bug that only affects (as far as I can tell)
arm devices it isn't actually random as code changes cause it to
appear/disappear based on alignment
Change-Id: I4cbc4370677959319f8589fe454e854c45623468
When loading a file, Lua may call the reader function again after it
returned end of input
https://www.lua.org/bugs.html#5.1.5-2
Change-Id: Ic2f4d727705a0b8f48ce792f6a9f7af25a503037
pixel-painter was depending on the old readline code that
returned nil for empty lines however empty lines should
have returned an empty string
Change-Id: Ic06ce920a7ab38e1fb8f7197d637e74ed9e35653
added a few more levels and increased difficulty based on level
Rliimage allows us to use circles in boomshine
Optimized some of the code to exceed the speed of the original
Change-Id: I68eb74f8b68fcdc8a9d022cd172374744425f15d
String constants were already expanded in the first macro
pcm functions were looking for stack position #1 when they needed stack pos #2
Change-Id: I7b4fb90953ab2395b77cbd550fdd257fafca6aae
The auto generated utf8/16 encode/decode functions did not work.
Upon implementing them correctly I found that lua handles the utf-8
form properly but I could not get utf-16 to work without crashing
maybe someone can come along later and implement utf-16 safe string
functions but for now utf-16 is removed.
Change-Id: I97a044e200dc27f683a45487cd93fce667c670c4
The way to call the pcm functions has changed
rb.pcm("option", var)
rb.pcm_set_frequency(freq) = becomes rb.pcm("pcmsetfrequency", freq)
added pcm.lua to the includes for conversion to old functions
if your script is broken by this change you simply add
`require("pcm")` to the top for the old functionality
added rb.pcm("calculatepeaks")
Change-Id: I092057b0c0b5575e567862661f122da1ca2680e8
Did not mean to wipe out these function when I consolidated audio
Made the regex for audio_ and playlist_ exact matches instead of fuzzy
Change-Id: I7537d1b494afb114c8b6333ea177b1e482f6b672
Adds %F -- %Y-%m-%d
Fixes possible buffer overflow when writing final \0
Frees a bit of code on NON-RTC targets
Change-Id: I1c2600a68ee88c6c99f411ae6646861578683f90
Rocklua was using the full fscanf implementation
to simply read %ld for the file:read("*n") function
wasting 1k on unneeded/unused functionality
Instead, I've implemented a filetol function to duplicate it
without the extra overhead using strtol which as an added bonus
ERANGE errors now resolve to LONG_MIN and LONGMAX instead of
integer overflow
filetol()
reads long int from an open file, skips preceding
whitespaces returns -1 if error, 1 on success.
*num set to LONG_MAX or LONG_MIN on overflow.
If number of digits is > than LUAI_MAXNUMBER2STR
filepointer will continue till the next non digit
but buffer will stop being filled with characters.
Preceding zero is ignored.
Change-Id: Ia42d0f73c63a894625bca4581e9b7e1cc7387fd2
Some of the lcd functions had support for multiple screens but this wasn't
very safe since the screen number wasn't bounded within the screens[] array
This adds support for all the lcd functions along with checking that screen#
is bounded properly, adds around 600 bytes to devices with a remote screen
devices without a remote screen lock to SCREEN_MAIN
Change-Id: I618bbc7b3919c7b0ff375fb2d71949d7cab43c87
rli_marshal and rli_copy allow the use of a custom lua function
instead of the built-ins, this custom function can signal to stop
before the whole image is iterated.
Originally it was checking for a return of 0
which was additional overhead for the built-in functions
(which never stop early) as well.
Now custom_transform sets the x & y deltas to 0 to indicate early
exit removing an extra 'if' per cycle and return from all of the
rli_transform functions
The lcd_xxx_bitmap functions all require x, y, w, h, screen these calls
have been consolidated into a single function get_bmp_bounds()
Change-Id: I88de3149c58d1bfb40e9d1a91341fb86cbd63b51
While luaL_addstring() works perfectly fine for the
final buffer once Lual_pushresult() is called
kbd_input doesn't display a previous input properly
since the buffer hasn't been finalized yet
Change-Id: Ic50acaa8b7b17077dec8750dd2b6382624e8a549
Removes unneeded functions from kbd_input
Consolidates message filling function for gui_syncyesno_run & do_menu
Change-Id: If3c3cea3cbf37a8dc52983c0db174de6d54b35f8
The way to call the playlist functions has changed
rb.playlist("option", var)
rb.playlist_add(filename) = becomes rb.playlist("add", filename)
added playlist.lua to the includes for conversion to old functions
if your script is broken by this change you simply add `require("playlist")`
to the top for the old functionality
added rb.playlist_tracks(dir, filename) to playlist.lua
this will allow you to add all tracks in a playlist.m3u8
to a lua table
Change-Id: I87fcc56be365d8495d214f069331b6ddbfbef1db
audio_play was removed from the rocklib I assume due to inconsistent
behavior I've readded it with a check for audio paused which instead
uses rewind/ff and then resumes audio
the way to call the audio functions has changed as well
rb.audio("option", var)
so rb.audio_play(0, 0) becomes rb.audio("play", 0, 0)
audio_audio_flush_and_reload_tracks becomes
rb.audio("flushandreloadtracks")
all functions except audio("getfilepos") return the previous (or still current)
status
added audio.lua to the includes for conversion to old functions
if your script is broken by this change you simply add `require("audio")`
to the top for the old functionality
Change-Id: I364adf0c85d9c12b98cde29c26fbe5ee05b9d331
Both of these functions modified the string in the lua stack
per lua manual:
'When a C function receives a string argument from Lua,
there are only two rules that it must observe: Not to pop the string
from the stack while accessing it and never to modify the string'
strip_extension will still work with old parameters
and is thus backwards compatible
strip_extension("filename")
create_numbered_filename has changed slightly and IS NOT backwards compatible
create_numbered_filename(path, prefix, suffix, [number])
(number defaults to -1)
Change-Id: I34cf7e2f6f691f33d5ac2b2e995855a171fb99b3
allows rocklib_img to be excluded if needed
stops rocklib_aux from generating redundant prototypes for
lcd_mono_bitmap[_part]
Change-Id: Ie208ad71ab5f9a7deb026dc01a5b0a0631a0d29c
rocklib_aux is auto generated from plugin.h
there are a few functions that get added automatically that
are unusable without their companion functions or duplicate
functionality already supplied by lua
Duplicated functionality:
rb->rand, rb->srand
-- see math.rand math.srand
rb->remove, rb->rename
-- see os.remove, os.rename
Unusable:
rb->open_utf8
-- this should be added to the lua file open routines (if at all)
rb->codec_run_proc, rb->codec_close
-- without rb->codec_load_file these are pointless
rb->timer_set_period, timer_unregister
-- even with timer_register implemented lua is not
-- reentrant and crashes the state when timer fires
Shouldn't be used!:
rb->strlcpy, rb->strlcat, rb->strcpy, rb->strcat
-- lua reuses strings by hashed values you break this contract if
-- you change strings behind its back plus lua provides a way to
-- do these functions safely within the strings api
Change-Id: I2f65704a90930378cbbceb254e52f61e8074471e
int is an incompatible type for targets that have 32bit fb_data
need to use FB_SCALARPACK for them
Change-Id: Ib3b5ff19c54d8d1bb76af33d0538a17a71301514
removes tslf allocations from do_menu and gui_syncyesno_run in favor of
lua_newuserdata
removes some luaL_opt functions in favor of equivalent lua_to functions
moves some definitions to the rocklib.h file
Change-Id: Iaacc3249b8f1af2c220ce59dead0050c66cb3b04
On Classic, IRAM1 (second 128Kb of a total of 256KB available IRAM) is
slower than DRAM. Codecs that actually are using regions of IRAM1 runs
faster when DRAM is used, so IRAM1 is disabled and only IRAM0 remains
enabled: 48KB for core and 80KB for codecs/plugins.
The next test_codec results shows how decode time is decreased:
file boosted unboosted
*.ra ~1.5% ~0.5%
*.mpc ~21% ~4.5%
*.ogg ~0.5% ~0%
nero_he*.m4a ~8% ~1%
nero*.m4a ~25% ~7%
wmapro*.wma ~4.5% ~0%
wma*.wma ~25% ~7%
In addition there is a small power save when IRAM1 HW is disabled.
Change-Id: I102adee11458e82037f23076d5d5956e23235de8
Cleaned up, rebased, and forward-ported from the xvortex fork.
(original credit to vsoftster@gmail.com)
Change-Id: Ibcc023a0271ea81e901450a88317708c2683236d
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
I previously noticed that manually clearing the framebuffer while scroll
function was active caused lua to crash
I could reproduce in sim and on device but I thought using the plugin
supplied rb->lcd_clear_screen was immune to this issue
Unfortunately some devices exhibit this behavior with the plugin function
as well
This patch adds rb->lcd_scroll_stop() before lcd_clear_screen at lua start-up
and to the supplied include file lcd.lua
Change-Id: I9800145e5c834ea27df5db5f1bca50b0d40faa49
Last commit was just a test to see if it work this one cleans it up
a bit and should be a bit faster
Change-Id: Ifdff5c5b78bcc6889506de607193246beccdde6b
Some devices(1-bit / 2-bit displays) have packed bit formats that
need to be unpacked in order to work on them at a pixel level.
This caused a few issues on 1 & 2-bit devices:
Greatly Oversized data arrays for bitmaps
Improper handling of native image data
Framebuffer data was near unusable without jumping through hoops
Conversion between native addressing and per pixel addressing
incurs extra overhead but it is much faster to do it
on the 'C' side rather than in lua.
Not to mention the advantage of a unified interface for the end programer
-------------------------------------------------------------------
Adds a sane way to access each pixel of image data
Adds:
--------------------------------------------------------------------
img:clear([color],[x1],[y1],[x2],[y2])
(set whole image or a portion to a particular value)
--------------------------------------------------------------------
img:invert([x1],[y1],[x2],[y2])
(inverts whole image or a portion)
--------------------------------------------------------------------
img:marshal([x1],[y1],[x2],[y2],[funct])
(calls funct for each point defined by rect of x1,y1 x2,y2
returns value and allows setting value of each point return
nil to terminate early)
--------------------------------------------------------------------
img:points([x1],[y1],[x2],[y2],[dx],[dy])
(returns iterator function that steps delta-x and delta-y pixels each call
returns value of pixel each call but doesn't allow setting to a new value
compare to lua pairs method)
--------------------------------------------------------------------
img:copy(src,[x1],[y1],[x2],[y2],[w],[h],[clip][operation][clr/funct])
(copies all or part of an image -- straight copy or special ops
optionally calls funct for each point defined by rect of
x1, y1, w, h and x2, y2, w, h for dest and src images
returns value of dst and src and allows setting value of
each point return nil to terminate early)
--------------------------------------------------------------------
img:line(x1, y1, x2, y2, color)
--------------------------------------------------------------------
img:ellipse(x1, y1, x2, y2, color, [fillcolor]
--------------------------------------------------------------------
Fixed handling of 2-bit vertical integrated screens
Added direct element access for saving / restoring native image etc.
Added more data to tostring() handler and a way to access individual items
Added equals method to see if two variables reference the same image address
(doesn't check if two separate images contain the same 'picture')
Optimized get and set routines
Fixed out of bound x coord access shifting to next line
Added lua include files to expose new functionality
Finished image saving routine
Static allocation of set_viewport struct faster + saves ram over dynamic
Cleaned up code
Fixed pixel get/set for 1/2 bit devices
Fixed handling for 24-bit devices (32?)
-------------------------------------------------------------------------
Example lua script to follow on forums
-------------------------------------------------------------------------
Change-Id: I8a9ff0ff72aacf4b1662767ccb2b312fc355239c
Some devices(1-bit / 2-bit displays) have packed bit formats that
need to be unpacked in order to work on them at a pixel level.
This caused a few issues on 1 & 2-bit devices:
Greatly Oversized data arrays for bitmaps
Improper handling of native image data
Framebuffer data was near unusable without jumping through hoops
Conversion between native addressing and per pixel addressing
incurs extra overhead but it is much faster to do it
on the 'C' side rather than in lua.
Not to mention the advantage of a unified interface for the end programer
-------------------------------------------------------------------
Adds a sane way to access each pixel of image data
Adds:
--------------------------------------------------------------------
img:clear([color],[x1],[y1],[x2],[y2])
(set whole image or a portion to a particular value)
--------------------------------------------------------------------
img:invert([x1],[y1],[x2],[y2])
(inverts whole image or a portion)
--------------------------------------------------------------------
img:marshal([x1],[y1],[x2],[y2],[funct])
(calls funct for each point defined by rect of x1,y1 x2,y2
returns value and allows setting value of each point return
nil to terminate early)
--------------------------------------------------------------------
img:points([x1],[y1],[x2],[y2],[dx],[dy])
(returns iterator function that steps delta-x and delta-y pixels each call
returns value of pixel each call but doesn't allow setting to a new value
compare to lua pairs method)
--------------------------------------------------------------------
img:copy(src,[x1],[y1],[x2],[y2],[w],[h],[clip][operation][clr/funct])
(copies all or part of an image -- straight copy or special ops
optionally calls funct for each point defined by rect of
x1, y1, w, h and x2, y2, w, h for dest and src images
returns value of dst and src and allows setting value of
each point return nil to terminate early)
--------------------------------------------------------------------
img:line(x1, y1, x2, y2, color)
--------------------------------------------------------------------
img:ellipse(x1, y1, x2, y2, color, [fillcolor]
--------------------------------------------------------------------
Fixed handling of 2-bit vertical integrated screens
Added direct element access for saving / restoring native image etc.
Added more data to tostring() handler and a way to access individual items
Added equals method to see if two variables reference the same image address
(doesn't check if two separate images contain the same 'picture')
Optimized get and set routines
Fixed out of bound x coord access shifting to next line
Added lua include files to expose new functionality
Finished image saving routine
Static allocation of set_viewport struct faster + saves ram over dynamic
Cleaned up code
Fixed pixel get/set for 1/2 bit devices
-------------------------------------------------------------------------
Example lua script to follow on forums
-------------------------------------------------------------------------
Change-Id: I7b9c1fd699442fb683760f781021091786c18509
This brings the source to upstream commit 506b073 (though I have made some
extra commits on top of that). Notably this includes a fix for a double-free
bug that I myself introduced upstream.
Change-Id: I02671586bbc34d63e05398ee971271fed42538cf
When zoomed in, the original commit made a mono bitmap (a.k.a. text) always
have the red component set to 255. This would cause drawn text to always be
red. Fixed.
Change-Id: Iec06256a3a783948c60c70557de042b375224448
I can only assume in the course of the original conversion to fixed point
math in RbLua the fact that division by zero and NaN handling was to be
caught as a graceful exception by the floating point handler was overlooked.
As a result lua doesn't handle these exceptions and instead results in a
panic on the device.
This patch fixes this handling in the lexer for compile time Inf and Nan
results and in the luavm for runtime division by zero (Inf)
I missed the runtime exception of n%0 added checks for that as well..
Change-Id: I7746c087ea93678e5875f15ec6fe3f29f26bdb31
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
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
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
This brings the upstream version to b3da238 (though some of my own
changes are included on top of that).
Change-Id: Ida73e8cd86765413147ce891af3cc2b7aeda2b2a
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
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
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
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
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
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
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
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
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
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
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
This adds no functionality, but instead cleans up the source and adds
some more substantial documentation.
Change-Id: I77328c171a61db7729bdf928ba094cfbed4ec0dd
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
This makes it possible to play the game while zoomed in. Read the
manual entry if you want to know more.
Change-Id: Iff8bab12f92ebd2798047c25d1fde7740aa543ce
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
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
Simply extends the current isqrt() to be able to do fractional bits
and improves the initial estimate using clz(). iqrt() itself is
no more and is equivalent to fp_sqrt(x, 0). The original also had
a small bug where the guess comparision should have been >=, not >.
Uses no large integer math or division and is very accurate
(simply returns a truncated fraction).
Change-Id: I2ae26e6505df1770dc01e56220f7385369f90ae9
Aims to provide a lib/keymaps.h for plugins needing simple button
functionality beyond that provided by PLA. Currently used by puzzles
and xworld.
Change-Id: Icb3493aaf176d401762de834dd48fc76a3824c5a
The dereference of entry->name was originally omitted, which meant
that only the password would ever be displayed.
Change-Id: If368a2d3dd9ddf0a253d28b9db5b98d639cfb30b
This brings puzzles up-to-date with Simon's tree, along with the
rockbox-specific changes I made. Note that I also got rid of some
of the ugly floating-point code in rbwrappers.c and replaced it
with wrappers for our fixed-point library.
Change-Id: Ibfb79acb15517116a26de1c3ea89e025146b9e2e
This patch disables the (deliberate) feature of "Select Level",
that selecting the current level wouldn't restart but rather
resume. (i.e. now selecting any level will always start this
from scratch).
There definitely should be a way to restart the current level
via menu. Currently the only possibility to do this is via
button presses, but (a) these are hard to remember combos, and
(b) they are not defined on all targets.
This patch is meant as a lightwight alternative to g#1356
(adding a "restart level" option to the menu).
Change-Id: I18ee5aff5c922f95c28d1edf2ba71dd2e50687d2
* Changed keymaps to PLA and added to SOURCES and CATEGORIES file
* improved keymaps: implement wrap-around and key repeat
* change keymap according to screen orientation
* fix font size calculation
* use blocking button query in main loop
* replace tabs with spaces
* added manual entry
* added original author to CREDITS
Change-Id: Id67ae99cbb7a737c7f4608e278b77a389ac2ffa6
This is pretty ad-hoc, but the only other ways are to rewrite
sprintf (which would use too much memory on the c200v2), or
implement support for floats in rockbox's formatter, neither of
which are acceptable.
Change-Id: I70d59fd3e90a16e2db9ae0a84cd8c14807f50b46
This is only really needed to save a few bytes on the c200v2, but
since it adds negligible overhead, so it's implemented for all
targets.
A stripped down version of the LZ4 reference implementation is found
in lz4tiny.c.
Change-Id: Ib914ba71c84e04da282328662c752e533912e197
- font caching is disabled
- font table is dynamically allocated
- side effect: tlsf isn't reset between runs anymore, memory leaks will have a bigger impact
Change-Id: I0b25c22665d956895e8007883d522256010d04ab