Micro Lua DS: Difference between revisions

From GameBrew
No edit summary
m (Text replacement - "Category:Utility homebrews on DS" to "Category:Utility Applications on DS")
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Infobox homebrew
{{Infobox DS Homebrews
| title       = Macro Lua DS
|title=Macro Lua DS
| image       = [[File:Macroluads.png|300px]]
|image=Microlua.png
| type       = Utility
|description=A Lua interpreter.
| version     = 4.6 3November2012
|author=Cid2Mizard
| licence    = GPL
|lastupdated=2014/01/04
| author      = Cid2Mizard
|type=Utilities
| website     = http://code.google.com/p/microlua/
|version=4.7.2
| download    = Media:Microlua46ds.zip
|license=GPL
| source     = http://code.google.com/p/microlua/downloads/detail?name=MicroLua%204.6%20-%20Sources.zip&can=2&q=
|download=https://dlhb.gamebrew.org/dshomebrew/microlua.7z?k33p0fil35
|website=http://code.google.com/p/microlua
|source=https://sourceforge.net/projects/microlua
}}
}}
MicroLua brings the programming language Lua on the Nintendo DS for homebrew development. Based on brunni's µLibrary, µLua is a Lua interpreter featuring fast drawings and many important functionalities. You can exploit your Nintendo DS with the simplistic yet powerful Lua language.


Micro Lua DS is a Lua interpreter for the Nintendo DS.  
On your cartridge, MicroLua is a NDS executable that shows as its frontend a great graphical shell from which you can explore your cartridge and run Lua scripts written for µLua.


==Features==
==Features==
*Fast drawing: as MicroLua is based on Brunni's library, the uLibrary, MicroLua provides fast 2D drawing using the 3D GPU.But that also means there will probably not be any 3D drawing with MicroLua. If you are not happy with that, just delete this package and go to see PALib.
* Fast drawing: as MicroLua is based on Brunni's library, the µLibrary, MicroLua provides fast 2D drawing using the 3D GPU. This also includes alpha transparency, and PNG/GIF transparency (as MicroLua can load PNG, JPEG and GIF image formats).
* Full sprites and maps systems: with automated animations, and dynamic maps (you can change the map constitution through your program).
* Even faster drawing: MicroLua also features Canvas, an object-oriented drawing system with high performances while allowing you to change drawing attributes after their creation.
* Wifi: Microlua provides full access to the Wifi connection of the Nintendo DS.
* Complete Sprites and Maps systems: with automated animations and dynamic maps, that is to say you can change the map composition through you program.
* Nifi: MicroLua allows you to make your console communicate with other ones on Adhoc.
* Wifi and Nifi: this project provides full access to the Web with the Wifi connection of the Nintendo DS, and also to the console-to-console connectivity.
* Sound system: based on the Mixmod library, uLua can play MOD and WAV sounds based on a soundbank system.
* Sound system: based on the Mixmod library, µLua can play MOD and WAV sounds.
* Fat access: full access to the content of your card; uLua also implements a built-in library to manage INI config files.
* Access to FAT: MicroLua gives you full access to the content of your card, and features a built-in library to handle INI-like config files.
* Rumble and motion: if you have the required hardware, you can use uLua to make your NDS shake and detect its movements ;)
* Rumble and motion features: if you have the required hardwware, you can exploit it thanks to MicroLua to shake your console and make it feel your movements.


==Installation==
==Installation==
Copy the <lua> folder to the _<root>_ (and this is really important, you have to put the <lua> folder to the <root> – the </> folder, the one which contains all the others); and then, copy the right binary file wherever you wish on your card:
Copy the lua folder to the root (and this is really important, you have to put the lua folder to the root, ie. the / folder, the one which contains all the others). Then copy the binary file microlua.nds wherever you wish on your card.
:'microlua.nds': probably the one you will choose; this one works on about all the linkers.
:'microlua.sc.nds': choose this one if you have a Supercard.
:'microlua.ds.gba': choose this one if you have a SLOT2 linker.


If you have troubles while launching uLua, like "Unable to load libs.lua", check that the <lua> folder is at the right place, that is to say in the <root> (and that the 'libs.lua' file is in this directory)
If you have troubles while launching uLua, like Unable to load libs.lua, check that the lua folder is at the right place, that is to say in the root (and that the libs.lua file is in /lua/libs/ directory).
 
For more detailed instructions, please look at [https://sourceforge.net/p/microlua/wiki/Installation this page].


==User guide==
==User guide==
When you find a uLua script, you will have probably either a single file (little script) or a directory. Just copy what you get in the <scripts> folder.
When you find a good uLua script, you will have probably either a single file (little script) or a directory. Just copy what you get into the scripts folder.
 
Then, boot your Nintendo DS, launch MicroLua. You can see on the bottom screen a file list: this is the content of your scripts folder.
 
For a complete manual of MicroLua, look at [https://sourceforge.net/p/microlua/wiki/Home the page].
 
'''Developer guide:'''
 
If you intend to make your own uLua scripts, here are some tips. These advices are available on the [https://sourceforge.net/p/microlua/wiki/Home official page], more up-to-date and complete.
 
Some utilitaries (Windows only) are available for download on the SourceForge; they include:
* A Lua compiler, which precompiles your scripts for faster execution. However, this is not often useful, and other people will not be able to look at the code
* A font converter, to use your own fonts in your scripts
* A map converter, from GBA graphics to NDS
* A soundbank maker, to make your scripts more vivid with some sound
 
You can test code on the computer with [https://sourceforge.net/p/microlua/wiki/MicroLuaSimulator/ MicroLua Simulator (MLS)], a good homebrew made by Ced\_le\_pingouin. Or you can also test with DeSmuME, a NDS emulator which can make MicroLua run.


Then, boot Nintendo DS, launch MicroLua. You can see on the
==Controls==
bottom screen a file list: this is the content of your <scripts>
D-Pad Up/Down - Navigate through your card
folder. You can freely naviguate through your card using the
 
D-pad Up and Down; use Right to open a folder, and eventually you
Right - Open a folder
can use the A button to launch a script. Note that if you use A
 
on a folder which contains a file named 'index.lua', this file
A - Launch a script (file), Launch file (on folder that contains index.lua)
will be launched.
 
==Known issues==
Please refer to https://sourceforge.net/p/microlua/tickets.


==Changelog==
==Changelog==
'''MICROLUA 4.6'''  
'''4.7.2'''
*Featuring a cute blinking LED and a better Debug system.
* Fix the Sprite module which was using a deprecated function that was removed from Lua.
 
'''4.7'''


'''MICROLUA 4.5.2'''
New features:
* Improve the example about Nifi.
* Support for the EFS lib: you can embed some files into the binary of MicroLua, which makes a nice way to distribute your scripts (available through the sources of MicroLua).
* Fix text bug in Canvas displaying weird characters.
* Our INI lib can now crypt the tables (Motus algorithm) before saving them.
* Upon creating a Timer, you can pass as an argument an initial time, so the timer will be set to this time (in milliseconds) instead of 0; this is also available for the method ':reset([time])'.


'''MICROLUA 4.5 '''
Improvements:
* MicroLua now has Nifi connection! You can make several consoles communicate with each other locally.
* The INI library can seamlessly handle table with a simple structure, that is to say raw 'key = value' pairs without any '[example]' sections; thus an argument has been added to 'INI.load()' so the function knows what to do ('INI.save()' automatically detects the structure).
* When an image can't be loaded, the function will now make a specific BSoD.
* Already loaded Image can be used while creating a new Sprite instance; just give it to the function in place of the path (giving a path is still supported).
* Canvas.setAttr() and Canvas.getAttr() now have a correct behavior regarding to ATTR_VISIBLE case.
* All the user-readable files are now presented with [http://en.wikipedia.org/wiki/Markdown MarkDown].
* The Timers' method ':time()' is now ':getTime()' as part of the goal of giving better names to the getters and setters.
* Instead of the whole DateTime system, you can now use the Lua's functions 'os.time()' and 'os.date()'; thus DateTime does no longer exists.
* Some variables in 'boot.lua' are now destroyed before running the shell.
* 'io.open()' accept the character "t" in is mode argument (this was the default behaviour anyway).
* The default shell now displays the version of Lua.
* The way the EFS is handled upon compilation has been improved: the folder 'efsroot' is no longer necessary if the EFS is not needed.
* The BAT files for Windows now make a better use of the make command (the general behaviour is unchanged).
 
Bug fixes:
* Fix the display of memory usage in Debug mode (it was in kilobytes, not in bytes).
* Fix 'System.listDirectory()': the function now works properly in an folder different than the current one.
* Fix the time functions now working on 3DS: MicroLua implements a workaround for this problem (which comes from the fundamental libnds that Microlua has no power on it), you can find it [https://sourceforge.net/p/microlua/wiki/3DSTimeWorkaround here].
* Fix 'dsUser.name' and 'dsUser.message': there was a problem while converting the UTF-16 provided by the libnds to simple chars
 
Changes for Microlua developers:
* The Makefile has been cleaned and improved:
** the part for the EFS has been improved.
** there are a few more targets: all, cleanall, export.
* With the migration to SourceForge, the whole repository structure has changed (and the 'docs' folder has been removed).
* Out Lua sources have been updated to Lua 5.2.2; its folder is now simply called 'lua' to ease future updates.
* The warnings from our code have been fixed (the ones from the EFSlib are too weird).


==Credits==
==Credits==
Line 65: Line 109:
[http://www.lua.org The official Lua website]. You can find here all the informations relative to the language; this will probably be useful to you if you intend to make some homebrews with uLua unless you already know by heart the language.
[http://www.lua.org The official Lua website]. You can find here all the informations relative to the language; this will probably be useful to you if you intend to make some homebrews with uLua unless you already know by heart the language.


[[Category:Homebrew applications]]
==External links==
* Official website - https://microlua.vraiforum.com/index.php
* Google Code - http://code.google.com/p/microlua
* SourceForge - https://sourceforge.net/projects/microlua
 
 
[[Category:Utility Applications on DS]]

Latest revision as of 06:36, 4 May 2024

Macro Lua DS
Microlua.png
General
AuthorCid2Mizard
TypeUtilities
Version4.7.2
LicenseGPL
Last Updated2014/01/04
Links
Download
Website
Source

MicroLua brings the programming language Lua on the Nintendo DS for homebrew development. Based on brunni's µLibrary, µLua is a Lua interpreter featuring fast drawings and many important functionalities. You can exploit your Nintendo DS with the simplistic yet powerful Lua language.

On your cartridge, MicroLua is a NDS executable that shows as its frontend a great graphical shell from which you can explore your cartridge and run Lua scripts written for µLua.

Features

  • Fast drawing: as MicroLua is based on Brunni's library, the µLibrary, MicroLua provides fast 2D drawing using the 3D GPU. This also includes alpha transparency, and PNG/GIF transparency (as MicroLua can load PNG, JPEG and GIF image formats).
  • Even faster drawing: MicroLua also features Canvas, an object-oriented drawing system with high performances while allowing you to change drawing attributes after their creation.
  • Complete Sprites and Maps systems: with automated animations and dynamic maps, that is to say you can change the map composition through you program.
  • Wifi and Nifi: this project provides full access to the Web with the Wifi connection of the Nintendo DS, and also to the console-to-console connectivity.
  • Sound system: based on the Mixmod library, µLua can play MOD and WAV sounds.
  • Access to FAT: MicroLua gives you full access to the content of your card, and features a built-in library to handle INI-like config files.
  • Rumble and motion features: if you have the required hardwware, you can exploit it thanks to MicroLua to shake your console and make it feel your movements.

Installation

Copy the lua folder to the root (and this is really important, you have to put the lua folder to the root, ie. the / folder, the one which contains all the others). Then copy the binary file microlua.nds wherever you wish on your card.

If you have troubles while launching uLua, like Unable to load libs.lua, check that the lua folder is at the right place, that is to say in the root (and that the libs.lua file is in /lua/libs/ directory).

For more detailed instructions, please look at this page.

User guide

When you find a good uLua script, you will have probably either a single file (little script) or a directory. Just copy what you get into the scripts folder.

Then, boot your Nintendo DS, launch MicroLua. You can see on the bottom screen a file list: this is the content of your scripts folder.

For a complete manual of MicroLua, look at the page.

Developer guide:

If you intend to make your own uLua scripts, here are some tips. These advices are available on the official page, more up-to-date and complete.

Some utilitaries (Windows only) are available for download on the SourceForge; they include:

  • A Lua compiler, which precompiles your scripts for faster execution. However, this is not often useful, and other people will not be able to look at the code
  • A font converter, to use your own fonts in your scripts
  • A map converter, from GBA graphics to NDS
  • A soundbank maker, to make your scripts more vivid with some sound

You can test code on the computer with MicroLua Simulator (MLS), a good homebrew made by Ced\_le\_pingouin. Or you can also test with DeSmuME, a NDS emulator which can make MicroLua run.

Controls

D-Pad Up/Down - Navigate through your card

Right - Open a folder

A - Launch a script (file), Launch file (on folder that contains index.lua)

Known issues

Please refer to https://sourceforge.net/p/microlua/tickets.

Changelog

4.7.2

  • Fix the Sprite module which was using a deprecated function that was removed from Lua.

4.7

New features:

  • Support for the EFS lib: you can embed some files into the binary of MicroLua, which makes a nice way to distribute your scripts (available through the sources of MicroLua).
  • Our INI lib can now crypt the tables (Motus algorithm) before saving them.
  • Upon creating a Timer, you can pass as an argument an initial time, so the timer will be set to this time (in milliseconds) instead of 0; this is also available for the method ':reset([time])'.

Improvements:

  • The INI library can seamlessly handle table with a simple structure, that is to say raw 'key = value' pairs without any '[example]' sections; thus an argument has been added to 'INI.load()' so the function knows what to do ('INI.save()' automatically detects the structure).
  • Already loaded Image can be used while creating a new Sprite instance; just give it to the function in place of the path (giving a path is still supported).
  • All the user-readable files are now presented with MarkDown.
  • The Timers' method ':time()' is now ':getTime()' as part of the goal of giving better names to the getters and setters.
  • Instead of the whole DateTime system, you can now use the Lua's functions 'os.time()' and 'os.date()'; thus DateTime does no longer exists.
  • Some variables in 'boot.lua' are now destroyed before running the shell.
  • 'io.open()' accept the character "t" in is mode argument (this was the default behaviour anyway).
  • The default shell now displays the version of Lua.
  • The way the EFS is handled upon compilation has been improved: the folder 'efsroot' is no longer necessary if the EFS is not needed.
  • The BAT files for Windows now make a better use of the make command (the general behaviour is unchanged).

Bug fixes:

  • Fix the display of memory usage in Debug mode (it was in kilobytes, not in bytes).
  • Fix 'System.listDirectory()': the function now works properly in an folder different than the current one.
  • Fix the time functions now working on 3DS: MicroLua implements a workaround for this problem (which comes from the fundamental libnds that Microlua has no power on it), you can find it here.
  • Fix 'dsUser.name' and 'dsUser.message': there was a problem while converting the UTF-16 provided by the libnds to simple chars

Changes for Microlua developers:

  • The Makefile has been cleaned and improved:
    • the part for the EFS has been improved.
    • there are a few more targets: all, cleanall, export.
  • With the migration to SourceForge, the whole repository structure has changed (and the 'docs' folder has been removed).
  • Out Lua sources have been updated to Lua 5.2.2; its folder is now simply called 'lua' to ease future updates.
  • The warnings from our code have been fixed (the ones from the EFSlib are too weird).

Credits

All the thanks will first go to Risike, the true owner of the project, the Creator, our God (let's stop here), as the project originally comes from him. He released the first version of MicroLua in 2008, and maintained it until 2009 (v3.0). At this point, he stated that he didn't want to continue this project and released it open source.

One last thing about uLua: some people confuse MicroLua with Lua. Lua is a language, basically used on computers either stand-alone or as a plugin engine. uLua is meant to be an adaptation of Lua for the Nintendo DS. So please, MicroLua is NOT a language; LUA is the language.

The main MicroLua's site (actually this is a forum). The active community will help you progress and share your scripts.

MicroLua's project hosting on Google servers. If you want to have the real last MicroLua release, go check it!

The official Lua website. You can find here all the informations relative to the language; this will probably be useful to you if you intend to make some homebrews with uLua unless you already know by heart the language.

External links

Advertising: