Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

CtruLua 3DS: Difference between revisions

From GameBrew
(Created page with "{{Infobox 3DS homebrew | title = ctruLua | image = https://dlhb.gamebrew.org/3dshomebrew/ctrulua-01.png|250px | type = Game engine | version = V1.0 | licence = Mixed | author...")
 
No edit summary
Line 12: Line 12:
<youtube>Pc3rhzx25_A</youtube>
<youtube>Pc3rhzx25_A</youtube>


What is ctr�Lua? ctr�Lua, note the case, is, as you can deduce, a Lua parser for 3DS. It's born within the �Lua community as an attempt to bring their favorite piece of software to the 3DS. The result ended being mighty different from what was �Lua itself.
What is ctrµLua? ctrµLua, note the case, is, as you can deduce, a Lua parser for 3DS. It's born within the µLua community as an attempt to bring their favorite piece of software to the 3DS. The result ended being mighty different from what was µLua itself.
 
What can it do? You'll have to ask the guys at development. Or check the TODO list on GitHub. Most of the features we wanted are in, there may be a few bugfixes left to do though.
What can it do? You'll have to ask the guys at development. Or check the TODO list on GitHub. Most of the features we wanted are in, there may be a few bugfixes left to do though.
What about the lads that made it? - Organization members Firew0lf We're... pretty sure he's a huge nerd. No, more like nerd king. He's one of the two developers on the project, and probably the one most eager to expand it. He also goes by geeker and I personally believe he must be yelling at all times IRL.
What about the lads that made it? - Organization members Firew0lf We're... pretty sure he's a huge nerd. No, more like nerd king. He's one of the two developers on the project, and probably the one most eager to expand it. He also goes by geeker and I personally believe he must be yelling at all times IRL.
Reuh Same, a developer. Pretty mature and really silent, I mean it, sometimes I wonder if he died in front of his screen. Also probably a nerd.
Reuh Same, a developer. Pretty mature and really silent, I mean it, sometimes I wonder if he died in front of his screen. Also probably a nerd.
Negi Loud-mouthed and pretty much useless. He did the shitty icon. A giga-nerd and self-proclaimed "community"-manager because no one takes care of this damned website and because it's fun. He never participates in code and unintentionally got credited.
 
Negi Loud-mouthed and pretty much useless. He did the shitty icon. A giga-nerd and self-proclaimed ""community""-manager because no one takes care of this damned website and because it's fun. He never participates in code and unintentionally got credited.
 
With Special Thanks To... - Non-member contributors VideahGams Oh, and...The lads before that? - Projects built upon Please note that this list is almost certainly incomplete.
With Special Thanks To... - Non-member contributors VideahGams Oh, and...The lads before that? - Projects built upon Please note that this list is almost certainly incomplete.
smea, for the ctrulib. And...Credits to whoever made the code they might have helped themselves on, if they did, that is. They don't really keep me updated on that.
smea, for the ctrulib. And...Credits to whoever made the code they might have helped themselves on, if they did, that is. They don't really keep me updated on that.
= ctr�Lua =
 
= ctrµLua =
 
[[File:https://www.dropbox.com/s/cqmtoohyx6t7q7c/banner.png?raw=1|frame|none|alt=|caption banner]]
[[File:https://www.dropbox.com/s/cqmtoohyx6t7q7c/banner.png?raw=1|frame|none|alt=|caption banner]]
Warning: the 'u' in the repo's name is a '', not a 'u'.
 
Warning: the 'u' in the repo's name is a 'µ', not a 'u'.
 
=== Users part ===
=== Users part ===
==== How to install ====
==== How to install ====
* Download ctruLua.zip from the [https://github.com/ctruLua/ctruLua/releases releases] (for something stable) or the [http://ci.reuh.tk/ctrulua CI server] (for more features)
* Download ctruLua.zip from the [https://github.com/ctruLua/ctruLua/releases releases] (for something stable) or the [http://ci.reuh.tk/ctrulua CI server] (for more features)
* Unzip it on your SD card, in a folder inside your homebrews folder; if you use HBL, extract it in <code>/3ds/ctrulua/</code>
* Unzip it on your SD card, in a folder inside your homebrews folder; if you use HBL, extract it in <code>/3ds/ctrulua/</code>
* Put some scripts wherever you want, just remember where
* Put some scripts wherever you want, just remember where
* Launch Ctr�Lua from your homebrew launcher
* Launch CtrµLua from your homebrew launcher
* Use the shell to run your scripts
* Use the shell to run your scripts
=== Homebrewers part ===
=== Homebrewers part ===
==== Builds [[File:http://ci.reuh.tk/ctrulua.png|build status]] ====
 
==== Builds ====
 
* Most recent working build: [http://ci.reuh.tk/ctrulua/builds/latest/artifacts/ctruLua.3dsx ctruLua.3dsx]
* Most recent working build: [http://ci.reuh.tk/ctrulua/builds/latest/artifacts/ctruLua.3dsx ctruLua.3dsx]
* See http://ci.reuh.tk/ctrulua for all the builds.
* See http://ci.reuh.tk/ctrulua for all the builds.
==== Hello world ====
==== Hello world ====
<source lang="lua">local ctr = require("ctr")
 
local gfx = require("ctr.gfx")
<source lang="lua">local ctr = require(""ctr"")
local hid = require("ctr.hid")
local gfx = require(""ctr.gfx"")
local hid = require(""ctr.hid"")
 
while ctr.run() do
while ctr.run() do
hid.read()
hid.read()
local keys = hid.keys()
local keys = hid.keys()
if keys.held.start then break end
if keys.held.start then break end
gfx.start(gfx.TOP)
  gfx.text(2, 2, ""Hello, world !"")
gfx.stop()
gfx.render()
end</source>
This script will print ""Hello, world !"" on the top screen, and will exit if the user presses Start. This is the ""graphical"" version; there's also a text-only version, based on the console:


gfx.start(gfx.TOP)
<source lang="lua">local ctr = require(""ctr"")
gfx.text(2, 2, "Hello, world !")
local gfx = require(""ctr.gfx"")
gfx.stop()
local hid = require(""ctr.hid"")


gfx.render()
end</source>
This script will print "Hello, world !" on the top screen, and will exit if the user presses Start. This is the "graphical" version; there's also a text-only version, based on the console:
<source lang="lua">local ctr = require("ctr")
local gfx = require("ctr.gfx")
local hid = require("ctr.hid")
gfx.console()
gfx.console()
print("Hello, world !")
print(""Hello, world !"")
 
while ctr.run() do
while ctr.run() do
hid.read()
hid.read()
local keys = hid.keys()
local keys = hid.keys()
if keys.held.start then break end
if keys.held.start then break end
gfx.render()
end


gfx.render()
end
gfx.disableConsole()</source>
gfx.disableConsole()</source>
==== Lua API Documentation ====
==== Lua API Documentation ====
* An online version of the documentation can be found [http://reuh.tk/ctrulua here]
* An online version of the documentation can be found [http://reuh.tk/ctrulua here]
* To build the documentation, run <code>make build-doc-html</code> (requires [https://github.com/stevedonovan/LDoc LDoc]).
* To build the documentation, run <code>make build-doc-html</code> (requires [https://github.com/stevedonovan/LDoc LDoc]).
=== Developers part ===
=== Developers part ===
==== Build instructions ====
==== Build instructions ====
* Setup your environment as shown here : http://3dbrew.org/wiki/Setting_up_Development_Environment
* Setup your environment as shown here : http://3dbrew.org/wiki/Setting_up_Development_Environment
* Clone this repository and run the command <code>make build-all</code> to build all the dependencies.
* Clone this repository and run the command <code>make build-all</code> to build all the dependencies.
* If you only made changes to ctr�Lua, run <code>make</code> to rebuild ctr�Lua without rebuilding all the dependencies.
* If you only made changes to ctrµLua, run <code>make</code> to rebuild ctrµLua without rebuilding all the dependencies.
 
May not work under Windows.
May not work under Windows.
=== Credits ===
=== Credits ===
* '''Smealum''' and everyone who worked on the ctrulib: https://github.com/smealum/ctrulib
* '''Smealum''' and everyone who worked on the ctrulib: https://github.com/smealum/ctrulib
* '''Xerpi''' for the [https://github.com/xerpi/sf2dlib sf2dlib], [https://github.com/xerpi/sftdlib sftdlib] and [https://github.com/xerpi/sfillib sfillib]
* '''Xerpi''' for the [https://github.com/xerpi/sf2dlib sf2dlib], [https://github.com/xerpi/sftdlib sftdlib] and [https://github.com/xerpi/sfillib sfillib]
Line 78: Line 107:
* '''Nothings''' for the [https://github.com/nothings/stb stb] libs
* '''Nothings''' for the [https://github.com/nothings/stb stb] libs
* Everyone who worked on the other libs we use
* Everyone who worked on the other libs we use
With this release, ctr�Lua supports all the most common features needed to create a 2D game or app. See the README.md for installation and usage instructions.
 
With this release, ctrµLua supports all the most common features needed to create a 2D game or app. See the README.md for installation and usage instructions.
 
Build f118baa.
Build f118baa.
Working features:
Working features:
HID (everything) 2D graphics 3D support (with 2D graphics) Texture loading and saving (PNG, JPEG, BMP, a lot of other formats) Fonts (TTF, a lot of other formats) Maps (.csv) Sound (WAV and OGG with/without streaming) Sockets (TCP and UDP) HTTP contexts (with/without SSL) Infrared communication (untested on hardware) UDS services (local wireless communication) Filesystem LZLib (zlib compression) ROMFS Camera Microphone Threads PTM services Head tracking APT services User and system informations News Lua scripts included with the release:
HID (everything) 2D graphics 3D support (with 2D graphics) Texture loading and saving (PNG, JPEG, BMP, a lot of other formats) Fonts (TTF, a lot of other formats) Maps (.csv) Sound (WAV and OGG with/without streaming) Sockets (TCP and UDP) HTTP contexts (with/without SSL) Infrared communication (untested on hardware) UDS services (local wireless communication) Filesystem LZLib (zlib compression) ROMFS Camera Microphone Threads PTM services Head tracking APT services User and system informations News Lua scripts included with the release:
Sprite library Configurable filepicker Shell to select and launch scripts Configurable keyboard library Text editor with Lua syntax highlighting Code examples Not working at the moment:
Sprite library Configurable filepicker Shell to select and launch scripts Configurable keyboard library Text editor with Lua syntax highlighting Code examples Not working at the moment:
TCP server socket (#10) Returning to the HB menu when exiting ctr�Lua (#5). Use L+R+Down+B to return to the HB launcher instead. Todo:
 
TCP server socket (#10) Returning to the HB menu when exiting ctrµLua (#5). Use L+R+Down+B to return to the HB launcher instead. Todo:
 
Maybe h.264 decoding. Maybe. 3D drawing / migrating to citro3D
Maybe h.264 decoding. Maybe. 3D drawing / migrating to citro3D

Revision as of 14:14, 11 April 2020

Template:Infobox 3DS homebrew

What is ctrµLua? ctrµLua, note the case, is, as you can deduce, a Lua parser for 3DS. It's born within the µLua community as an attempt to bring their favorite piece of software to the 3DS. The result ended being mighty different from what was µLua itself.

What can it do? You'll have to ask the guys at development. Or check the TODO list on GitHub. Most of the features we wanted are in, there may be a few bugfixes left to do though.

What about the lads that made it? - Organization members Firew0lf We're... pretty sure he's a huge nerd. No, more like nerd king. He's one of the two developers on the project, and probably the one most eager to expand it. He also goes by geeker and I personally believe he must be yelling at all times IRL.

Reuh Same, a developer. Pretty mature and really silent, I mean it, sometimes I wonder if he died in front of his screen. Also probably a nerd.

Negi Loud-mouthed and pretty much useless. He did the shitty icon. A giga-nerd and self-proclaimed ""community""-manager because no one takes care of this damned website and because it's fun. He never participates in code and unintentionally got credited.

With Special Thanks To... - Non-member contributors VideahGams Oh, and...The lads before that? - Projects built upon Please note that this list is almost certainly incomplete.

smea, for the ctrulib. And...Credits to whoever made the code they might have helped themselves on, if they did, that is. They don't really keep me updated on that.

ctrµLua

Warning: the 'u' in the repo's name is a 'µ', not a 'u'.

Users part

How to install

  • Download ctruLua.zip from the releases (for something stable) or the CI server (for more features)
  • Unzip it on your SD card, in a folder inside your homebrews folder; if you use HBL, extract it in /3ds/ctrulua/
  • Put some scripts wherever you want, just remember where
  • Launch CtrµLua from your homebrew launcher
  • Use the shell to run your scripts

Homebrewers part

Builds

Hello world

local ctr = require(""ctr"")
local gfx = require(""ctr.gfx"")
local hid = require(""ctr.hid"")

while ctr.run() do
 hid.read()
 local keys = hid.keys()
 if keys.held.start then break end
 
 gfx.start(gfx.TOP)
  gfx.text(2, 2, ""Hello, world !"")
 gfx.stop()
 
 gfx.render()
end

This script will print ""Hello, world !"" on the top screen, and will exit if the user presses Start. This is the ""graphical"" version; there's also a text-only version, based on the console:

local ctr = require(""ctr"")
local gfx = require(""ctr.gfx"")
local hid = require(""ctr.hid"")

gfx.console()
print(""Hello, world !"")

while ctr.run() do
 hid.read()
 local keys = hid.keys()
 if keys.held.start then break end
 
 gfx.render()
end

gfx.disableConsole()

Lua API Documentation

  • An online version of the documentation can be found here
  • To build the documentation, run make build-doc-html (requires LDoc).

Developers part

Build instructions

  • Setup your environment as shown here : http://3dbrew.org/wiki/Setting_up_Development_Environment
  • Clone this repository and run the command make build-all to build all the dependencies.
  • If you only made changes to ctrµLua, run make to rebuild ctrµLua without rebuilding all the dependencies.

May not work under Windows.

Credits

With this release, ctrµLua supports all the most common features needed to create a 2D game or app. See the README.md for installation and usage instructions.

Build f118baa.

Working features:

HID (everything) 2D graphics 3D support (with 2D graphics) Texture loading and saving (PNG, JPEG, BMP, a lot of other formats) Fonts (TTF, a lot of other formats) Maps (.csv) Sound (WAV and OGG with/without streaming) Sockets (TCP and UDP) HTTP contexts (with/without SSL) Infrared communication (untested on hardware) UDS services (local wireless communication) Filesystem LZLib (zlib compression) ROMFS Camera Microphone Threads PTM services Head tracking APT services User and system informations News Lua scripts included with the release:

Sprite library Configurable filepicker Shell to select and launch scripts Configurable keyboard library Text editor with Lua syntax highlighting Code examples Not working at the moment:

TCP server socket (#10) Returning to the HB menu when exiting ctrµLua (#5). Use L+R+Down+B to return to the HB launcher instead. Todo:

Maybe h.264 decoding. Maybe. 3D drawing / migrating to citro3D

Advertising: