µLua DS - Forum officiel | Official forum Forum Index

µLua DS - Forum officiel | Official forum
Le bon endroit pour en savoir plus sur MicroLua et pour parler de vos projets ! | The right place to learn more about MicroLua and talk about your projects !

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MicroLua 4.7

Post new topic   Reply to topic    µLua DS - Forum officiel | Official forum Forum Index -> English section -> Announces
Previous topic :: Next topic  
Author Message


Joined: 24 Nov 2008
Posts: 2,838
Localisation: Toulouse

PostPosted: Tue 17 Sep 2013 - 20:40    Post subject: MicroLua 4.7 Reply with quote


I am happy to present you the brand new version of MicroLua: the 4.7 !

I have a few things I'd like to say here, this is the same text than the one you have under the section "Comments" of the changelog in you package.

Looking behind me, I can see that the last "stable" version, the 4.6, was released in November 2012 (and the 4.6.1 in February 2013). Now we are in September 2013, seven months in the future and I can assure you that it was a little war to get to this.

The 4.6.1 came accross the finding of the time bug on the 3DS, which produced a 4.6.1_a because I could only figure a poor workaround for this bug. Moreover, we managed to include the utilisation of the EFS on about the same period, and all of this resulted in some weird, ugly version "Microlua 4.6.1_a [EFS]". And I was thinking: come on, tidy up this mess. This lasted about five months I think, eh.

So two months ago, I felt like it was the right time to change how things were going. We were too attached to the old period around 2009 when Risike was working alone on this, we need to emancipate from this history. And Google helped us for this, as they decided to remove the upload space they allowed to the projects on GoogleCode. From this point, I migrated MicroLua to SourceForge, I rearranged things up by updating the Wiki, making new issues, designing the lead of MicroLua by building milestones; we have some ideas up to the version 6.0 you know!

When I finally got over this side-work, I pulled my sleeves up and did the things that needed to be done: update the sources of Lua (we were so outdated!), fix some stupid warnings on compilation process, finally fix the function `System.listDirectory()`, and above all, officially add the EFS and the workaround for the 3DS. Add to this a rearrangement of the Timers and the removal of DateTime, which were needed because of the update of the sources of Lua, and some nice small improvements, and you get the version in this folder: Microlua 4.7. Clean, pure version.

As I write these lines I feel like it was some kind of marathon, althought it could have started much sooner than two months ago. And I think this is one of the biggest changelog I have ever written for MicroLua. I'm proud of it, of MicroLua, of what we've done with this and of what we can achieve simply by keeping things up.

Now I'm gonna cry a river like a pussy, but hey this is a great adventure.

Hobie-ho my friends!


I. Downloads

3DS owners : please read carefully the installation instructions below!

II. Installation manual

There is nothing easier than installing MicroLua on your linker!

First of all, download the package then extract it somewhere on your computer. Once done, simply copy the folder lua on the root of your linker along with the binary MicroLua 4.7.nds (although the latter can be put anywhere).

Now test the installation: power your console and run MicroLua! If everything is okay you should see the shell of MicroLua (some king of home homebrew) which look like this:

If you have a 3DS, you will experience a time bug which prevents the date to update during the execution of MicroLua. In order of solving it (or more like going around it), here are the required steps:
  • in the folder lua lies a file named myboot_example; rename it under myboot.lua
  • now open it then delete everything between lines 32 and 49, inclusive
  • save the changes

That is to say the file should be:


Based on Christophe "Grahack" Gragnic's idea in October 2009
Written by Reylak


   Here is the default example of "myboot.lua".
   Please note that it is *NOT* loaded by
   "boot.lua". If you want to, rename it as


--[[ If you are running MicroLua on a 3DS, you are victim of a libnds's bug that prevent
    time of being updated. If this is the case, activate "myboot.lua" as explained above
    so the following lines are used; they replace Lua's built-in functions by corrected
    versions. More information can be found on https://sourceforge.net/p/microlua/wiki/3DSTimeWorkaround/
    You will probably have to comment the other ones for they are not useful and may
    lead to unexpected behaviours. ]]
os.time = os.time3DS
os.date = os.date3DS

-- And finally, if you wish to come back to the "normal" bootstrap (which is the best thing to do).
return "continue"

III. Changelog

Reylak wrote:

I- 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])`

II- 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 (<http://en.wikipedia.org/wiki/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)

III- 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 there : <https://sourceforge.net/p/microlua/wiki/3DSTimeWorkaround/>
* Fix `dsUser.name` and `dsUser.message`: there was a problem while converting the UTF-16 provided by the libnds to simple chars

IV- 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)

IV. Readme please!

Reylak wrote:


> By the MicroLua's forum members, from the original project by Risike
> README file by Reylak

I-..... Package content
II-.... Installation
III-... User guide
IV-.... Developer guide
V-..... Features
VI-.... Links
VII-... Credits and other background informations

I- Package content

This package contains the following files and directories:

* 'Documentation': you can find in this folder all the documentation as it can be found on the SourceForge (link below) of the project. This is an offline version of the Wiki as it was when this package was released; the text setup is done with MarkDown (thus the '.md'), a simple lightweight markup language that is easily readable by a human
* 'lua': this folder is the essential part of uLua with its binary
* 'libs': this directory contains some essential files of uLua; you usually have nothing to do with these ones
* 'scripts': you will place here the uLua scripts you want to play (as it is the default folder uLua will look for the scripts, but you may use any other directory of your wish)
* 'examples': here are some useful examples showing you the more important features of MicroLua
* 'MicroLua.nds': here is the binary file for uLua
* 'README': the file you're now reading. You have all my gratitude for reading it! Wink
* 'CHANGELOG': this file presents you the most recent improvements made on uLua

II- Installation

It is quite easy: just _copy the 'lua' folder_ to the **'root'** (and this is really important, you have to put the 'lua' folder to the 'root', i.e. the '/' folder, the one which contains all the others); and then, _copy the binary file 'microlua.nds'_ wherever you wish on your card.

For more detailed instructions, please look at this page: <https://sourceforge.net/p/microlua/wiki/Installation/>

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/').

III- User guide

When you find a good uLua script (they are actually all good... Wink ), 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. You can freely naviguate through your card using the D-pad Up and Down; use Right to open a folder, and eventually you 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 will be launched.

And that's all, so enjoy yourself with the greatest uLua scripts! Wink

For a complete manual of MicroLua, look at the page <https://sourceforge.net/p/microlua/wiki/Home/>.

IV- Developer guide

If you intend to make your own uLua scripts, here are some tips. These advices are available on our Wiki, more up-to-date and complete (<https://sourceforge.net/p/microlua/wiki/Home/>).

### Utilitaries ###

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

### Testing code on the computer ###

It's so boring to put your script on your uSD card, then in your linker, then boot your DS, then launch MicroLua, then FINALLY test your program and see that it doesn't work because you forgot this little tiny bracket. So you may want to test your scripts on your computer (it would be so convenient!). And guess what... It's possible! You can use MicroLua Simulator (MLS), a really good homebrew made by Ced\_le\_pingouin. Or you can also test with DeSmuME, a NDS emulator which can make MicroLua run.

### Packaging your scripts ###

I hope you will make great projects, so you will distribute a folder containing your project files. The default uLua shell provides a useful feature: it will launch the file named 'index.lua' if you open the folder with the A button. This way you can make your project look better by "hiding" the several files in the directory: the user will only have to press A instead of searching the correct file among the twenty others.

### Good habits are good ###

Last but no least: please, do NOT compile your scripts. It is often useless (as a speed gain), and open source projects are far better (imagine that one day you loose your files). I know there are some bad people outside, who may stole your work, but as long as you publish your projects on the uLua forum, there will be no leeching.

A safe alternative may be to use the Embedded File System (EFS) that provides MicroLua through the EFSLib, which allows you to produce a NDS binary including all your files. I encourage you to read this page then: <https://sourceforge.net/p/microlua/wiki/EFS/>.

V- Features

Here are the main features of MicroLua:

* 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. 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 dynamically change drawing attributes after their creation
* Full Sprites and Maps systems: with automated animations, and dynamic maps (you can change the map constitution through your program)
* Wifi: Microlua provides full access to the Wifi connection of the Nintendo DS
* Nifi: MicroLua allows you to make your console communicate with other ones Ad-hoc
* Sound system: based on the Mixmod library, uLua can play MOD and WAV sounds based on a soundbank system
* Fat access: full access to the content of your card; uLua also implements a built-in library to manage INI config files
* Embedded File System (EFS): you can make a special MicroLua version to embed your scripts inside the Lua interpreter
* Rumble and motion: if you have the required hardware, you can use uLua to make your NDS shake and detect its movements

VI- Links

* <http://www.microlua.xooit.fr>: the main MicroLua's site (actually this is a forum). The active community will help you progress and share your scripts Wink Probably THE place you should check everyday
* <https://sourceforge.net/projects/microlua/>: MicroLua's project hosting on SourceForge. If you want to have the true latest MicroLua release, go check it! There is also a good Wiki with tons of informations
* <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

VII- Credits and other background informations

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.
But we, **the community**, took care of it, and continued the work. MicroLua sources are of course available.

People who must be thanked are _Papymouge_, at least for his great job on Wifi, Nifi, its shell... actually for too many things; _Ced-le-pingouin_, for working on the compilation process and for his great **MLS**, _Grahack_ which have so many good (or not) ideas on how to drive uLua, _Ghuntar_, _thomh@ck_, _thermo__nono_, _geeker_ and myself _Reylak_, for this soooo beautiful README file Wink And last but not least, _all the community_ for creating such magnificent homebrews and supporting us!

One last thing about uLua: some people confuse MicroLua with Lua. _Lua is a language_, basically used on computers either as a 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; we have a detailed explanation here: <https://sourceforge.net/p/microlua/wiki/Lua/>. That's all, folks.

I now just have to thank also you for downloading the sources and maybe improving MicroLua! I hope this way you will enjoy much more MicroLua!

> Reylak


Plein d'infos sur le SourceForge !

Last edited by Reylak on Tue 19 Nov 2013 - 22:21; edited 1 time in total
Back to top
Visit poster’s website MSN Skype

PostPosted: Tue 17 Sep 2013 - 20:40    Post subject: Publicité

PublicitéSupprimer les publicités ?
Back to top


Joined: 12 Apr 2012
Posts: 141
Localisation: Le forum.

PostPosted: Wed 18 Sep 2013 - 12:28    Post subject: MicroLua 4.7 Reply with quote

Bravo Reylak Okay Okay
(bravo to the others too :p)

-- horrible code, but only for Lua 5.2 :p

   if Keys.newPress.Start then
      goto exit

   screen.print(SCREEN_UP, 5, 5, "Hello World with Lua 5.2 !")

goto loop


Long live µLua !

Ouais j'ai changé que 2 phrases et alors...
Publié : ctrµLua, Candran
A publier : TCPDebugger, FastShell
A finir : µPortal, LLUL, µStore, serveur wifis, microlua.js, d'autres trucs
Mon site \o/

Back to top
Visit poster’s website


Joined: 24 Nov 2008
Posts: 2,838
Localisation: Toulouse

PostPosted: Sun 13 Oct 2013 - 21:59    Post subject: MicroLua 4.7 Reply with quote

Some people reported (on the French thread) some minor -- and less minor -- issues found in MicroLua 4.7 :
  • memory leak on System.listDirectory(): FIXED
  • optimization on sorting files and folders in System.listDirectory(): FIXED
  • long start up time: most probably FIXED

Explanation about the last item: MicroLua 4.7 always tries to init the Embedded File System, whether it is available or not, which involves scanning the WHOLE µSD card looking for 'MicroLua.nds'. This usually only happens on the first time, because the binary is then updated with the path and no other scan is necessary unless the file is moved. But if the latter is not patched with some small program (EFS patcher Wink ), the path cannot be stored inside the binary and the scanning is done again and again on each boot. On a huge crowded µSD card this takes a lot of time to be done.
Now MicroLua will try to initialize the EFS system only if it knows beforehand that it is available (i.e. the binary was patched upon compilation with the EFS patcher), and everything goes smooth Wink

Moreover I came across a small issue where I couldn't apply System.listDirectory() properly on a folder which was inside the EFS; now the problem is gone because I eventually understood that the function to get the size of a file couldn't be called on a folder...

Now only remains one issue which was reported to me recently: it looks like there is a problem with Wifi.send() which may not be working properly with UDP sockets (TCP sockets are okay). I estimate that the investigation and correction if needed won't take that much time (at least do I hope it won't) so you may expect MicroLua 4.7.1 to be released on the coming week Smile

Plein d'infos sur le SourceForge !

Back to top
Visit poster’s website MSN Skype


Joined: 24 Nov 2008
Posts: 2,838
Localisation: Toulouse

PostPosted: Wed 6 Nov 2013 - 21:46    Post subject: MicroLua 4.7 Reply with quote

Some official news: the Wifi part of MicroLua has been fixed recently by Thomas99, so there is only left to arrange the presentation (we are going to give so freshness to the API on this side Wink ) and after the tests we are good for releasing MicroLua 4.7.1! Stay tuned Smile

Plein d'infos sur le SourceForge !

Back to top
Visit poster’s website MSN Skype
Contenu Sponsorisé

PostPosted: Today at 16:22    Post subject: MicroLua 4.7

Back to top
Display posts from previous:   
Post new topic   Reply to topic    µLua DS - Forum officiel | Official forum Forum Index -> English section -> Announces All times are GMT + 1 Hour
Page 1 of 1

Jump to:  

Index | Create a forum | Free support forum | Free forums directory | Report a violation | Conditions générales d'utilisation
Powered by phpBB © 2001, 2005 phpBB Group