return the nextfunction and nil instead of pairs it allows a faster
return to lua rather than calling the lua function
pcall(fnpairs) from c and returning the result back
into lua to kick off the search
yeah, no clue why I didn't realize that before..
testing in x86 and ARM..
its more RAM efficient to do the initial creation
of the stack in lua code for the __pairs functon
its not faster but being that its a one time hit per
iter creation the reduced churn alone should be worth it
along with a reduced peak RAM usage
fix bug where a failed module can not be reloaded
optimize filetol
fix potential bug in splash scroller when no break character is found
Change-Id: I42c922e07039a19138b97c0d0e80cf3cf2426471
checks button_status in rockev
strpbrk_n custom implementation allows setting max search len in source string
add some branch prediction where appropriate
fix formatting in splash_scroller script
Change-Id: Id5d8e9d83f4b3e361ccb67b403af8f9a8a31b8f0
lua currently splashes a stack traceback on error
for deep tracebacks and especially on devices with smaller screens
this leaves out a lot of vital information
in the past I have resorted to splitting the traceback string or
even saving the return to a file
This patch provides a scrollable buffer with rudimentary text reflow
to allow you to read the whole traceback string
Upon traceback if you press nothing the screen will display for 5 seconds
If you press OK or CANCEL it will quit immediately
PREV/NEXT scrolls the list on button press timeout is disabled
lua now provides rb.splash_scroller(timeout, str)
example script provided too
Change-Id: Idbc8ce0c514196f0fae48c43aeaea8b60d6da1a5
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
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
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR).
The new define is to (de-)select code to compile on hosted platforms generally.
Should be no functional change to targets or the simulator.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657