Age | Commit message (Collapse) | Author | Files | Lines |
|
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
|
|
I'll revisit adding enums once I research it a bit more
Change-Id: If10c445cf770e5b90defc543f08d8de0817b2f3d
|
|
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
|
|
Change-Id: Icd6fe0fa1088ab59b8214f7c860f262ce67fe205
|
|
Change-Id: Ia1a9e39b9f203002cbbea85ef965e66c334b83fc
|
|
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
|
|
Change-Id: Id36e765f18234f5a4f3092d090c0adffa3da1612
|
|
Change-Id: I9e2537e4839e2b4f9beddbc887610213ed954a87
|
|
on errors thread stack overflows
yielding before thread_exit() is a bad idea apparently
Change-Id: Iac45d4321fac496738384fdbbeb480356ef2a1bb
|
|
Change-Id: I217f78a9e348a18552563c6c3b235c9aed956f54
|
|
forgot to set new size after realloc
forgot to set sizelineinfo to 0 after free
Change-Id: Iaf7533aafaba1e2abf9599c9e1d0b75d913a8c36
|
|
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
|
|
Change-Id: Ib225ecf9ea64c95e438c4114b23239c118ab19a2
|
|
Change-Id: I980637b1d8aa91d7ac0ed71fd0e7d21bda7876c4
|
|
Change-Id: Ibb530cfa63681727be518173404952e897c9d297
|
|
Change-Id: I67cac5bc4ce5525ab30abf9443f6cc1a33190512
|
|
Uses int arrays and calls luaL_checkint in a loop
Change-Id: Ib73dab886f018c787bd995f64d990981d194069f
|
|
Change-Id: Ie8794e8a487f73952dae43e036787b6972fdbbee
|
|
Should fix a compile-time error on simulator.
Change-Id: I5962479579350ebffe6dcce4f65a629b108ff936
|
|
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
|
|
Change-Id: I04bc38d03b7f0ca65a815685eb6ab0f5ff825c45
|
|
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
|
|
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
|
|
Adds a flag to remove the ability to dump and load lua bytecode
saves 6+kb
Change-Id: I080323df7f03f752e0a10928e22a7ce3190a9633
|
|
didn't consider sims might have reserved enums
Change-Id: Ic404972f0836bc81ba149f4ecdd3ec61bd8bd4b3
|
|
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
|
|
Change-Id: I6566c19a0fee630a5e250c1244159d5b488b57ff
|
|
Change-Id: I376fad0f92f1155698740e1b8599a3385998575c
|
|
Change-Id: Ib9e568ea73a01474facd57cc155e62fa3dc093f7
|
|
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
https://github.com/elua/elua/commit/d54659b5723bcd2b1e3900362398c72c18a9aa0b
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
|
|
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
|
|
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
|
|
the gigabeatS has an embedded struct that needs to be parsed
Change-Id: I88c9101afaaa95182f37ade1410cccb4fb768e33
|
|
moved items to rb.system
added read access to audio_current_track and audio_next_track
Change-Id: Ia055b8cb3848e540067818f596ffd1058da057fb
|
|
Change-Id: Ibe2bc6602ff27524a3b96d9523780acbfbf03c76
|
|
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
|
|
Modify Rocklua towards upstream 5.1.5
Clean up some of the Rocklua implementation
Change-Id: Iac722e827899cf84f5ca004ef7ae7ddce5f7fbbe
|
|
Readline didn't handle lines longer than LUAL_BUFFERSIZE it now
reads these in chunks.
Change-Id: Iffe12447e5441ff6b479ce3de1d36df64c276183
|
|
rb.strncasecmp
strcasecmp just exclude count -> rb.strncasecmp(s1, s2)
rb.backlight_brightness_set
backlight_set_brightness -- redundant
rb.backlight_brightness_use_setting -> rb.backlight_brightness_set()
rb.buttonlight_brightness_set
buttonlight_set_brightness -- redundant
rb.buttonlight_brightness_use_setting -> rb.buttonlight_brightness_set()
rb.mixer_frequency
rb.mixer_set_frequency -> mixer_frequency(freq)
rb.mixer_get_frequency -> mixer_frequency
rb.backlight_onoff
rb.backlight_on -> rb.backlight_onoff(true)
rb.backlight_off -> rb.backlight_onoff(false)
rb.touchscreen_mode
rb.touchscreen_set_mode -> rb.touchscreen_mode(mode)
rb.touchscreen_get_mode -> rb.touchscreen_mode()
rb.schedule_cpu_boost
rb.trigger_cpu_boost -> rb.schedule_cpu_boost(true)
rb.cancel_cpu_boost -> rb.schedule_cpu_boost(false)
Includes rbcompat.lua for backwards compatibility
if your script is broken by this change you simply add
`require("rbcompat")` to the top for the old functionality
Change-Id: Ibffd79a0d9be6d7d6a65cc4af5c0a1c6a0f3f94d
|
|
FB_SCALARPACK(lua_tointeger()) was calling lua_tointeger 3x on color targets
Change-Id: I7b3d73bba5dbc0aa4388b123de11410572fe67c5
|
|
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
|
|
Lessen confusion for end users looking for the underlying function names in
plugin.h
Change-Id: I6662dc7bd9f22d83af372b3d3c5af53d9a1eac9a
|
|
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
|