summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/rocklib.c (follow)
Commit message (Collapse)AuthorAge
* lcd-24bit: Introduce a 24-bit mid-level LCD driverThomas Martitz2014-06-21
| | | | | | | | | | | | | | | | | With LCD driver all calculation will be performed on RGB888 and the hardware/OS can display from our 24bit framebuffer. It is not yet as performance optimized as the existing drivers but should be good enough.The vast number of small changes is due to the fact that fb_data can be a struct type now, while most of the code expected a scalar type. lcd-as-memframe ASM code does not work with 24bit currently so the with 24bit it enforces the generic C code. All plugins are ported over. Except for rockpaint. It uses so much memory that it wouldnt fit into the 512k plugin buffer anymore (patches welcome). Change-Id: Ibb1964545028ce0d8ff9833ccc3ab66be3ee0754
* Revert "Update lua plugin to 5.2.3"Marcin Bukat2014-04-02
| | | | | | FILE typedef to *void needs more work to not break sim and application builds. I checked only a few random native builds unfortunately. Sorry for inconvenience.
* Update lua plugin to 5.2.3Richard Quirk2014-04-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this patch the Lua plugin used version 5.1.4. This change reduces the number of modifications in the Lua source using some new defines and because the upstream source is now more flexible. Unless otherwise stated, l*.[ch] files are taken unmodified from the upstream lua-5.2.3. fscanf.c: file descriptors in rockbox are just ints, they are hidden behind a void* now so liolib requires less modifications. fscanf is updated to use void* too. getc.c: this is a new file required for getc implementation in lauxlib.c lauxlib.c: LoadF replaced FILE* with int, the rockbox file descriptor int are cast to FILE* (actually void* due to typedef). getc uses the PREFIX version. stdin is not used, as per 5.1.4. lbaselib.c: now uses strspn in the number parsing. print uses DEBUGF now rather than being commented out. lbitlib.c: use the built-in version from 5.2.3 rather than Reuben Thomas's external library. Backwards compatible and adds some new bit operations. ldo.c: the LUAI_THROW/TRY defines are now in the core lua code, so have been removed from rockconf.h liolib.c: here the implementation has changed to use the LStream from the original source, and cast the FILE* pointers to int. This has reduced the number of modifications from the upstream version. llex.c: the only change from upstream is to remove the locale include. lmathlib.c: updated from the 5.2.3 version and re-applied the changes that were made vs 5.1.4 for random numbers and to remove unsupported float functions. loadlib.c: upstream version, with the 5.1.4 changes for missing functions. lobject.c: upstream version, with ctype.h added and sprintf changed to snprintf. loslib.c: upstream version with locale.h removed and 5.1.4 changes for unsupportable functions. lstrlib.c: sprintf changed to snprintf. ltable.c: upstream with the hashnum function from 5.1.4 to avoid frexp in luai_hashnum. luaconf.h: updated to 5.2.3 version, restored relevant parts from the original 5.1.4 configuration. The COMPAT defines that are no longer available are not included. lundump.c: VERSION macro conflicts with the core Rockbox equivalent. rocklib.c: luaL_reg is no longer available, replaced by luaL_Reg equivalent. Moved checkboolean/optboolean functions to this file and out of core lua files. luaL_getn is no longer available, replaced by luaL_rawlen. luaL_register is deprecated, use the newlib/setfuncs replacements. rli_init has to be called before setting up the newlib to avoid overwriting the rb table. rocklib_aux.pl: use rli_checkboolean from rocklib.c. rocklua.c: new default bits library used, update the library loading code with idiomatic 5.2 code. strcspn.c: no longer needed, but strspn.c is required for strspn in lbaselib.c Change-Id: I0c7945c755f79083afe98ec117e1e8cf13de2651 Reviewed-on: http://gerrit.rockbox.org/774 Tested: Richard Quirk <richard.quirk@gmail.com> Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
* lcd-16bit: Remove {lss,lse,lst}_pattern fields from struct viewport.Thomas Martitz2014-01-07
| | | | | | | These where used for line styling during scrolling, which is now done in apps/, The viewport struct doesn't need to record these anymore. Change-Id: I810d9dcb2644b00a798c6e75acab69c74a78e77f
* lua: Switch memory allocator from dl to tlsfMarcin Bukat2013-08-26
| | | | | | | | | | | | | | | | | | Instead of providing yet another memory allocator implementation use tlsf and simply link tlsf library. Another small improvement is to *grow* memory pool by grabbing audiobuffer instead of just switching to use audiobuf exclusively. Tested with simple lua 'memory eater' script. This patch extends tlsf lib slightly. You can provide void *get_new_area(size_t * size) function which will override weak dummy implementation provided in lib itself. This allows to automaticaly initialize memory pool as well as grow memory pool if needed (for example grab audiobuffer when pluginbuffer is exhaused). Change-Id: I841af6b6b5bbbf546c14cbf139a7723fbb982f1b
* Fix lua unused-variable warning by introducing UNUSED_ATTR.Thomas Martitz2012-02-17
| | | | Change-Id: If19393db123e89e58545c9e0736e6fa32fccb810
* Add playlist wrappers for luaAlbert Bloomfield2012-02-17
| | | | | | | | | | | | | | | | | | | | | | adds wrappers for the functions playlist_sync, playlist_remove_all_tracks, and playlist_insert_track, playlist_insert_directory playlist_{sync,remove_all_tracks} take no arguments playlist_insert_{track,directory} only have one required argument (either the filename or directory name) They take as optional arguments position, queue, and either sync or recurse They all just pass NULL to work with the current playlist also adds constants for: PLAYLIST_PREPEND, PLAYLIST_INSERT, PLAYLIST_INSERT_LAST, PLAYLIST_INSERT_FIRST, PLAYLIST_INSERT_SHUFFLED, PLAYLIST_REPLACE, and PLAYLIST_INSERT_LAST_SHUFFLED Change-Id: Ib7464cba50e7a250edf092e50668f11010f2b737 Reviewed-on: http://gerrit.rockbox.org/109 Reviewed-by: Thomas Martitz <kugel@rockbox.org>
* Export runtime detected paths to lua scripts. Adapt stopwatch to not useThomas Martitz2012-01-29
| | | | | | hardcoded path. Change-Id: I5b843002d63a332b3fad02973d00b9863d283062
* Lua: Add pluginlib_actions wrapper for lua scripts.Thomas Martitz2012-01-27
| | | | | | Scripts can now make use of PLA_* actions to be more target independant. Change-Id: I1b9f69e07f41b2187ecc1bad25a2c20eaaef92b4
* Add touchscreen_get_mode() to plugin and lua.Thomas Martitz2012-01-27
| | | | Change-Id: I44b8693c689da00f57c14622f4ba3dc554dbbfc9
* FS#12273 - use buflib for font storage. thanks to the testers :)Jonathan Gordon2011-09-24
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
* Lua: document rocklib_aux.pl a bit, so it's easier to find out about it when ↵Maurus Cuelenaere2010-06-18
| | | | | | stumbling over a CC error in rocklib_aux.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26912 a1c6a512-1295-4272-9138-f99709370657
* Lua: return nil when function failed instead of returning nothingMaurus Cuelenaere2009-10-29
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23405 a1c6a512-1295-4272-9138-f99709370657
* Boomshine plugin : port to Greyscale and B/W targets, and targets without ↵Kevin Ferrare2009-10-29
| | | | | | touchscreen (currently using the virtual keyboard keymap) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23397 a1c6a512-1295-4272-9138-f99709370657
* Lua: add lib/helper.c wrappersMaurus Cuelenaere2009-10-26
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23360 a1c6a512-1295-4272-9138-f99709370657
* Lua: add do_menu() wrapper. Also fix potential NULL pointer dereferenceMaurus Cuelenaere2009-10-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23320 a1c6a512-1295-4272-9138-f99709370657
* Lua: return nil when kbd_input() gets aborted and make it possible to preset ↵Maurus Cuelenaere2009-07-23
| | | | | | the input string (based on FS#10455 by Christophe Gragnic) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22008 a1c6a512-1295-4272-9138-f99709370657
* Lua: expose SCREEN_MAIN & SCREEN_REMOTE (for rb.lcd_*() functions)Maurus Cuelenaere2009-07-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21712 a1c6a512-1295-4272-9138-f99709370657
* Lua: use rb->screens[] to do paintingMaurus Cuelenaere2009-07-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21676 a1c6a512-1295-4272-9138-f99709370657
* Lua: implement gui_syncyesno_runMaurus Cuelenaere2009-07-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21662 a1c6a512-1295-4272-9138-f99709370657
* Lua: add script which wraps not-yet ported C functions to LuaMaurus Cuelenaere2009-07-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21657 a1c6a512-1295-4272-9138-f99709370657
* Lua: always expose BUTTON_TOUCHSCREEN and remove BUTTON_ constants from ↵Maurus Cuelenaere2009-07-03
| | | | | | rocklib.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21630 a1c6a512-1295-4272-9138-f99709370657
* Lua: because Rockbox doesn't support any current working directory ↵Maurus Cuelenaere2009-07-01
| | | | | | functionality, 'hack' loadlib so it replace '$' in LUA_PATH_DEFAULT with the directory wherein the current script is. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21595 a1c6a512-1295-4272-9138-f99709370657
* Lua: remove BUTTON_TOUCHSCREEN as this constant is available in buttons.luaMaurus Cuelenaere2009-06-28
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21544 a1c6a512-1295-4272-9138-f99709370657
* Lua:Maurus Cuelenaere2009-06-28
| | | | | | | | | | * add IO lib (adapted to Rockbox) * remove old IO wrappers * rework helloworld.lua to work with the IO lib * do some stuff in helloworld.lua better (part of FS#10379, by James Callahan) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21541 a1c6a512-1295-4272-9138-f99709370657
* Lua: add the package libraryMaurus Cuelenaere2009-06-25
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21506 a1c6a512-1295-4272-9138-f99709370657
* Fix yellowMaurus Cuelenaere2009-06-15
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21292 a1c6a512-1295-4272-9138-f99709370657
* Fix helloworld.lua for mono targets (+ add lcd_mono_bitmap() & ↵Maurus Cuelenaere2009-06-15
| | | | | | lcd_mono_bitmap_part() to Lua API) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21291 a1c6a512-1295-4272-9138-f99709370657
* Lua: add touchscreen_set_mode & current_path (+ some constants)Maurus Cuelenaere2009-06-01
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21165 a1c6a512-1295-4272-9138-f99709370657
* Lua: re-use the viewport pointer; also use the shorter lua_getfield() & ↵Maurus Cuelenaere2009-05-25
| | | | | | lua_setfield() notations (thanks Antoine Cellerier) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21080 a1c6a512-1295-4272-9138-f99709370657
* Fix some typosMaurus Cuelenaere2009-05-25
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21077 a1c6a512-1295-4272-9138-f99709370657
* Lua: port viewports + add test_viewports.luaMaurus Cuelenaere2009-05-25
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21076 a1c6a512-1295-4272-9138-f99709370657
* * read_bmp_*(): add FORMAT_RETURN_SIZEMaurus Cuelenaere2009-05-25
| | | | | | | | * Lua: add luaL_checkboolean() & luaL_optboolean() * Lua: add read_bmp_file git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21074 a1c6a512-1295-4272-9138-f99709370657
* Lua: /me should learn about C arrays.. :/Maurus Cuelenaere2009-05-24
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21065 a1c6a512-1295-4272-9138-f99709370657
* Lua: fix rocklua_image issue + add LCD_RGBPACK & LCD_RGBUNPACK wrappersMaurus Cuelenaere2009-05-24
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21064 a1c6a512-1295-4272-9138-f99709370657
* Lua: add image handling + some other wrappersMaurus Cuelenaere2009-05-24
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21063 a1c6a512-1295-4272-9138-f99709370657
* Lua:Maurus Cuelenaere2009-05-22
| | | | | | | | | | * add action_get_touchscreen_press wrapper * fix kbd_input wrapper * rework luaL_loadfile * add rb.contexts git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21046 a1c6a512-1295-4272-9138-f99709370657
* Lua:Maurus Cuelenaere2009-05-22
| | | | | | | | | * remove debug statement from llex.c * add DEBUGF to rocklua.c on parse error * add file_exists wrapper git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21025 a1c6a512-1295-4272-9138-f99709370657
* Lua: add file handlingMaurus Cuelenaere2009-05-22
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21024 a1c6a512-1295-4272-9138-f99709370657
* Lua: fix some issues with rocklibMaurus Cuelenaere2009-05-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21022 a1c6a512-1295-4272-9138-f99709370657
* Commit FS#9174: Lua scripting language by Dan EvertonMaurus Cuelenaere2009-05-21
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21020 a1c6a512-1295-4272-9138-f99709370657