Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return {
- -- environment variables
- -- keys
- TOP_SCREEN = { type = "value",
- description = "Top Screen Image_ID for Screen functions." },
- BOTTOM_SCREEN = { type = "value",
- description = "Bottom Screen Image_ID for Screen functions." },
- LEFT_EYE = { type = "value",
- description = "ID to print for left eye in stereoscopic 3D." },
- RIGHT_EYE = { type = "value",
- description = "ID to print for right eye in stereoscopic 3D." },
- KEY_A = { type = "value",
- description = "Key A value in u32 format for Controls functions." },
- KEY_B = { type = "value",
- description = "Key B value in u32 format for Controls functions." },
- KEY_R = { type = "value",
- description = "Key R value in u32 format for Controls functions." },
- KEY_L = { type = "value",
- description = "Key L value in u32 format for Controls functions." },
- KEY_START = { type = "value",
- description = "Key START value in u32 format for Controls functions." },
- KEY_SELECT = { type = "value",
- description = "Key SELECT value in u32 format for Controls functions." },
- KEY_X = { type = "value",
- description = "Key X value in u32 format for Controls functions." },
- KEY_Y = { type = "value",
- description = "Key Y value in u32 format for Controls functions." },
- KEY_ZL = { type = "value",
- description = "Key ZL value in u32 format for Controls functions." },
- KEY_ZR = { type = "value",
- description = "Key ZR value in u32 format for Controls functions." },
- KEY_DRIGHT = { type = "value",
- description = "Key Digital Right value in u32 format for Controls functions." },
- KEY_DLEFT = { type = "value",
- description = "Key Digital Left value in u32 format for Controls functions." },
- KEY_DUP = { type = "value",
- description = "Key Digital Up value in u32 format for Controls functions." },
- KEY_DDOWN = { type = "value",
- description = "Key Digital Down value in u32 format for Controls functions." },
- KEY_TOUCH = { type = "value",
- description = "Key Touchscreen value in u32 format for Controls functions." },
- KEY_HOME = { type = "value",
- description = "Key Home value in u32 format for Controls functions." },
- KEY_POWER = { type = "value",
- description = "Key Power value in u32 format for Controls functions." },
- -- attributes
- FREAD = { type = "value",
- description = "Attribute for I/O functions for opening a file with Read attribute." },
- FWRITE = { type = "value",
- description = "Attribute for I/O functions for opening a file with Write attribute." },
- FCREATE = { type = "value",
- description = "Attribute for I/O functions for opening a file with Create/Write attributes." },
- LOOP = { type = "value",
- description = "Attribute for Audio/Video functions for looping buffer." },
- NO_LOOP = { type = "value",
- description = "Attribute for Audio/Video functions for no looping buffer." },
- NAND = { type = "value",
- description = "Attribute for CIA NAND managing." },
- SDMC = { type = "value",
- description = " Attribute for CIA SDMC managing." },
- APP_RUNNING = { type = "value",
- description = "Status for homebrew while is not suspended/exiting." },
- APP_EXITING = { type = "value",
- description = "Status for homebrew while is exiting." },
- -- I/O module
- io = {
- type = "class",
- description = "Handles file operations.",
- childs = {
- open = {
- type = "function",
- description = [[Open a file.
- Sample usage: fileStream = io.open("/file.txt",FCREATE)]],
- args = "(string file,int attribute,[u64 extdata_archive])",
- returns = "s64",
- valuetype = "userdata",
- },
- read = {
- type = "function",
- description = [[Read from an opened file.
- Sample usage: text = io.read(fileStream,0,10)]],
- args = "(s64 filestream,u64 offset,u64 size)",
- returns = "string",
- valuetype = "string",
- },
- write = {
- type = "function",
- description = [[Write a text in an opened file.
- Sample usage: io.write(fileStream,0,"Text written with LPP", 21)]],
- args = "(s64 filestream,u64 offset,string text,u64 size)",
- returns = "void",
- valuetype = "nil",
- },
- size = {
- type = "function",
- description = [[Get size of an opened file.
- Sample usage: size = io.size(fileStream)]],
- args = "(s64 filestream)",
- returns = "u64",
- valuetype = "number",
- },
- close = {
- type = "function",
- description = [[Close an opened file.
- Sample usage: io.close(fileStream)]],
- args = "(s64 filestream, [bool extdata_file])",
- returns = "void",
- valuetype = "nil",
- },
- },
- },
- -- System module
- System = {
- type = "class",
- description = "Handles system calls.",
- childs = {
- exit = {
- type = "function",
- description = [[Exit homebrew and returns to Homebrew Menu.
- Sample usage: System.exit()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- getFirmware = {
- type = "function",
- description = [[Returns firmware version.
- Sample usage: fw_ver = System.getFirmware()]],
- args = "(void)",
- returns = "u32",
- valuetype = "number",
- },
- getKernel = {
- type = "function",
- description = [[Returns kernel version.
- Sample usage: kr_ver = System.getKernel()]],
- args = "(void)",
- returns = "u32",
- valuetype = "number",
- },
- getRegion = {
- type = "function",
- description = [[Get console region (1 = USA, 2 = EUR, Other = JPN).
- Sample usage: reg = System.getRegion()]],
- args = "(void)",
- returns = "int",
- valuetype = "number",
- },
- takeScreenshot = {
- type = "function",
- description = [[Take a screenshot in BMP/JPG format.
- Sample usage: System.takeScreenshot("/file.bmp",false)]],
- args = "(string filename,bool jpg_compression)",
- returns = "void",
- valuetype = "nil",
- },
- checkBuild = {
- type = "function",
- description = [[Check current working lpp-3ds build type. (0 = 3DSX, 1 = 3DS/CIA)
- Sample usage: build = System.checkBuild()]],
- args = "(void)",
- returns = "int",
- valuetype = "number",
- },
- currentDirectory = {
- type = "function",
- description = [[Get or set current directory.
- Sample usage: dir = System.currentDirectory() / System.currentDirectory("/lpp-3ds/")]],
- args = "([string path])",
- returns = "[string]",
- valuetype = "[string|nil]",
- },
- deleteFile = {
- type = "function",
- description = [[Delete a file.
- Sample usage: System.deleteFile("/file.txt")]],
- args = "(string path)",
- returns = "void",
- valuetype = "nil",
- },
- deleteDirectory = {
- type = "function",
- description = [[Delete a directory.
- Sample usage: System.deleteDirectory("/dir")]],
- args = "(string path)",
- returns = "void",
- valuetype = "nil",
- },
- renameDirectory = {
- type = "function",
- description = [[Move or rename a directory.
- Sample usage: System.renameDirectory("/path","/path2")]],
- args = "(string path,string path2)",
- returns = "void",
- valuetype = "nil",
- },
- renameFile = {
- type = "function",
- description = [[Move or rename a file.
- Sample usage: System.renameFile("/file.txt","/file.sh")]],
- args = "(string path,string path2)",
- returns = "void",
- valuetype = "nil",
- },
- createDirectory = {
- type = "function",
- description = [[Create a directory.
- Sample usage: System.createDirectory("/test_dir")]],
- args = "(string path)",
- returns = "void",
- valuetype = "nil",
- },
- listDirectory = {
- type = "function",
- description = [[List a directory.
- Sample usage: list_dir = System.listDirectory("/test_dir/")]],
- args = "(string path)",
- returns = "table",
- valuetype = "table",
- },
- isBatteryCharging = {
- type = "function",
- description = [[Check if battery is in charging.
- Sample usage: if (System.isBatteryCharging()) then ... end]],
- args = "(void)",
- returns = "boolean",
- valuetype = "boolean",
- },
- getBatteryLife = {
- type = "function",
- description = [[Get battery life.
- Sample usage: life_battery = System.getBatteryLife()]],
- args = "(void)",
- returns = "int",
- valuetype = "number",
- },
- getModel = {
- type = "function",
- description = [[Get 3DS Model. (0 = 3DS, 1 = 3DS XL, 2 = New 3DS, 3 = 2DS, 4 = New 3DS XL)
- Sample usage: model = System.getModel()]],
- args = "(void)",
- returns = "int",
- valuetype = "number",
- },
- getLanguage = {
- type = "function",
- description = [[Get 3DS system language.
- Sample usage: language = System.getLanguage()]],
- args = "(void)",
- returns = "int",
- valuetype = "number",
- },
- startKeyboard = {
- type = "function",
- description = [[Start a virtual built-in keyboard.
- Sample usage: my_name = System.startKeyboard("Paul")]],
- args = "([string text])",
- returns = "string",
- valuetype = "string",
- },
- launch3DSX = {
- type = "function",
- description = [[Launch a 3DSX homebrew.
- Sample usage: System.launch3DSX("/boot.3dsx")]],
- args = "(string filename)",
- returns = "void",
- valuetype = "nil",
- },
- launchCIA = {
- type = "function",
- description = [[ Launch an imported CIA.
- Sample usage: System.launchCIA(0x00133700,SDMC)]],
- args = "(u32 unique_id,u32 mediatype) ",
- returns = "void",
- valuetype = "nil",
- },
- extractSMDH = {
- type = "function",
- description = [[Extract title, desc, author and icon from a SMDH file.
- Sample usage: smdh = System.extractSMDH("/file.smdh") [smdh.title, smdh.desc, smdh.author, smdh.icon] ]],
- args = "(string filename)",
- returns = "table",
- valuetype = "table",
- },
- listExtdataDir = {
- type = "function",
- description = [[List a folder in extdata.
- Sample usage: banner = System.listExtdataDir("/ExBanner",0x227)]],
- args = "(string path,u64 archive)",
- returns = "table",
- valuetype = "table",
- },
- scanExtdata = {
- type = "function",
- description = [[List all extdata folders and files.
- Sample usage: extdata_dir = System.scanExtdata()]],
- args = "(void)",
- returns = "table",
- valuetype = "table",
- },
- listCIA = {
- type = "function",
- description = [[List all imported CIA files.
- Sample usage: cia_table = System.listCIA()]],
- args = "(void)",
- returns = "table",
- valuetype = "table",
- },
- installCIA = {
- type = "function",
- description = [[Install a CIA file.
- Sample usage: System.installCIA("/file.cia")]],
- args = "(string filename)",
- returns = "void",
- valuetype = "nil",
- },
- uninstallCIA = {
- type = "function",
- description = [[Uninstall a CIA file.
- Sample usage: System.uninstallCIA(1,SDMC)]],
- args = "(u32 delete_id,u32 mediatype)",
- returns = "void",
- valuetype = "nil",
- },
- extractZIP = {
- type = "function",
- description = [[Extract a ZIP file.
- Sample usage: System.extractZIP("/file.zip","/file")]],
- args = "(string file,string path_to_extract,[string password])",
- returns = "void",
- valuetype = "nil",
- },
- extractCIA = {
- type = "function",
- description = [[Extract ProductCode and UniqueID from a CIA file.
- Sample usage: cia_info = System.extractCIA("/file.cia") [cia_info.unique_id , cia_info.title] ]],
- args = "(string file)",
- returns = "void",
- valuetype = "userdata",
- },
- checkStatus = {
- type = "function",
- description = [[Check homebrew status (Like APP_EXITING).
- Sample usage: status = System.checkStatus()]],
- args = "(void)",
- returns = "u8",
- valuetype = "number",
- },
- showHomeMenu = {
- type = "function",
- description = [[Sets up necessary syscall for Home/Power buttons support.
- Sample usage: System.showHomeMenu()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- reboot = {
- type = "function",
- description = [[Reboot Nintendo 3DS.
- Sample usage: System.reboot()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- launchGamecard = {
- type = "function",
- description = [[Launch inserted game cartridge.
- Sample usage: System.launchGamecard()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- getFreeSpace = {
- type = "function",
- description = [[Get SD card free space.
- Sample usage: free_space = System.getFreeSpace(void)]],
- args = "(void)",
- returns = "u64",
- valuetype = "number",
- },
- getTime = {
- type = "function",
- description = [[Get console time.
- Sample usage: h,m,s = System.getTime()]],
- args = "(void)",
- returns = "int,int,int",
- valuetype = "number,number,number",
- },
- getDate = {
- type = "function",
- description = [[Get console date.
- Sample usage: day_value,day,month,year = System.getDate() [day_value: 5 = Friday, 6 = Saturday...] ]],
- args = "(void)",
- returns = "int,int,int,int",
- valuetype = "number,number,number,number",
- },
- getGWRomID = {
- type = "function",
- description = [[Get Product ID for current loaded rom on a Gateway/Mt Card.
- Sample usage: product_id = System.getGWRomID()]],
- args = "(void)",
- returns = "string",
- valuetype = "string",
- },
- },
- },
- -- Screen module
- Screen = {
- type = "class",
- description = "Handles screen updates and drawing.",
- childs = {
- waitVblankStart = {
- type = "function",
- description = [[Wait Screen Refresh.
- Sample usage: Screen.waitVblankStart()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- flip = {
- type = "function",
- description = [[Flip screen (Needed for every Screen function).
- Sample usage: Screen.flip()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- debugPrint = {
- type = "function",
- description = [[Write a string on screen or image.
- Sample usage: Screen.debugPrint(0, 0, "Hello World", Color.new(255,255,255), TOP_SCREEN)]],
- args = "(int x, int y, string text, u32 color, Image_id screen_id, [Eye_id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- refresh = {
- type = "function",
- description = [[Refresh screen buffers.
- Sample usage: Screen.refresh()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- clear = {
- type = "function",
- description = [[Clear screen.
- Sample usage: Screen.clear(TOP_SCREEN)]],
- args = "(Image_id screen_id)",
- returns = "void",
- valuetype = "nil",
- },
- fillRect = {
- type = "function",
- description = [[Draw a rectangle.
- Sample usage: Screen.fillRect(5, 20, 5, 40, Color.new(255,0,0), BOTTOM_SCREEN)]],
- args = "(int x1, int x2, int y1, int y2, u32 color, Image_id screen_id, [Eye_id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- fillEmptyRect = {
- type = "function",
- description = [[Draw a rectangular box.
- Sample usage: Screen.fillEmptyRect(5, 20, 5, 40, Color.new(255,0,0), BOTTOM_SCREEN)]],
- args = "(int x1, int x2, int y1, int y2, u32 color, Image_id screen_id, [Eye_id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- drawLine = {
- type = "function",
- description = [[Draw a line.
- Sample usage: Screen.drawLine(5, 20, 5, 40, Color.new(255,0,0), BOTTOM_SCREEN)]],
- args = "(int x1, int x2, int y1, int y2, u32 color, Image_id screen_id, [Eye_id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- drawPixel = {
- type = "function",
- description = [[Draw a pixel.
- Sample usage: Screen.drawPixel(5, 5, Color.new(255,0,0), BOTTOM_SCREEN)]],
- args = "(int x, int y, u32 color, Image_id screen_id, [Eye_id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- getPixel = {
- type = "function",
- description = [[Get the color of a pixel.
- Sample usage: Screen.getPixel(5, 5, BOTTOM_SCREEN)]],
- args = "(int x, int y, Image_id screen_id, [Eye_id] eye)",
- returns = "u32",
- valuetype = "number",
- },
- loadImage = {
- type = "function",
- description = [[Load a BMP, PNG or JPG image file.
- Sample usage: bitmap = Screen.loadImage("/file.bmp")]],
- args = "(string filename)",
- returns = "Image_id",
- valuetype = "userdata",
- },
- drawImage = {
- type = "function",
- description = [[Draw an image.
- Sample usage: Screen.drawImage(10,20,bitmap,TOP_SCREEN)]],
- args = "(int x,int y,Image_id image,Image_id screen_id, [Eye_id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- drawPartialImage = {
- type = "function",
- description = [[Draw a part of an image.
- Sample usage: Screen.drawPartialImage(10,20,0,0,100,100,bitmap,BOTTOM_SCREEN)]],
- args = "(int x,int y,int image_x,int image_y,int width,int height,Image_id image,Image_id screen_id, [Eye_id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- getImageWidth = {
- type = "function",
- description = [[Get width of an image.
- Sample usage: width = Screen.getImageWidth(bitmap_file)]],
- args = "(Image_id image)",
- returns = "int",
- valuetype = "number",
- },
- getImageHeight = {
- type = "function",
- description = [[Get height of an image.
- Sample usage: height = Screen.getImageHeight(bitmap_file)]],
- args = "(Image_id image)",
- returns = "int",
- valuetype = "number",
- },
- flipImage = {
- type = "function",
- description = [[Flip an image.
- Sample usage: Screen.flipImage(image,flipped_image)]],
- args = "(Image_id source,Image_id destination)",
- returns = "void",
- valuetype = "nil",
- },
- createImage = {
- type = "function",
- description = [[Create an empty image.
- Sample usage: image = Screen.createImage(10,10, Color.new(255,255,255))]],
- args = "(int width, int height, u32 color)",
- returns = "Image_id",
- valuetype = "userdata",
- },
- freeImage = {
- type = "function",
- description = [[Delete an image from memory.
- Sample usage: Screen.freeImage(image)]],
- args = "(Image_id image)",
- returns = "void",
- valuetype = "nil",
- },
- saveImage = {
- type = "function",
- description = [[Save an image as BMP/JPG file.
- Sample usage: Screen.saveImage(image,"/file.bmp",false)]],
- args = "(Image_id image,string file,bool jpg_compression)",
- returns = "void",
- valuetype = "nil",
- },
- enable3D = {
- type = "function",
- description = [[Enable stereoscopic 3D.
- Sample usage: Screen.enable3D()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- disable3D = {
- type = "function",
- description = [[Disable stereoscopic 3D.
- Sample usage: Screen.disable3D()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- get3DLevel = {
- type = "function",
- description = [[Get current stereoscopic 3D slide level.
- Sample usage: lvl_3d = Screen.get3DLevel()]],
- args = "(void)",
- returns = "float",
- valuetype = "number",
- },
- },
- },
- -- Graphics module
- Graphics = {
- type = "class",
- description = "Handles screen updates and drawing.",
- childs = {
- init = {
- type = "function",
- description = [[Init GPU.
- Sample usage: Graphics.init()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- term = {
- type = "function",
- description = [[Terminate GPU.
- Sample usage: Graphics.term()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- initBlend = {
- type = "function",
- description = [[Init GPU blending.
- Sample usage: Graphics.initBlend(TOP_SCREEN)]],
- args = "(int screen, [int side])",
- returns = "void",
- valuetype = "nil",
- },
- termBlend = {
- type = "function",
- description = [[Terminate GPU blending.
- Sample usage: Graphics.termBlend()]],
- args = "(void) ",
- returns = "void",
- valuetype = "nil",
- },
- loadImage = {
- type = "function",
- description = [[Load an image as GPU texture.
- Sample usage: texture = Graphics.loadImage("/file.png")]],
- args = "(string filename)",
- returns = "u32",
- valuetype = "number",
- },
- freeImage = {
- type = "function",
- description = [[Free a GPU texture.
- Sample usage: Graphics.freeImage(texture)]],
- args = "(u32 texture)",
- returns = "void",
- valuetype = "nil",
- },
- flip = {
- type = "function",
- description = [[Swap GPU screens.
- Sample usage: Graphics.flip()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- drawImage = {
- type = "function",
- description = [[Blit a GPU texture.
- Sample usage: Graphics.drawImage(5, 5, texture)]],
- args = "(int x, int y, int texture)",
- returns = "void",
- valuetype = "nil",
- },
- drawPartialImage = {
- type = "function",
- description = [[Blit a part of a GPU texture.
- Sample usage: Graphics.drawPartialImage(5, 5, 0, 10, 100, 100, texture)]],
- args = "(int x, int y, int img_x, int img_y, int width, int height int texture)",
- returns = "void",
- valuetype = "nil",
- },
- fillRect = {
- type = "function",
- description = [[Blit a rectangle using GPU.
- Sample usage: Graphics.fillRect(0,10,0,10,Color.new(255,255,255))]],
- args = "(int x1, int x2, int y1, int y2, u32 color)",
- returns = "void",
- valuetype = "nil",
- },
- fillEmptyRect = {
- type = "function",
- description = [[Blit an empty rectangle using GPU.
- Sample usage: Graphics.fillEmptyRect(0,10,0,10,Color.new(255,255,255))]],
- args = "(int x1, int x2, int y1, int y2, u32 color)",
- returns = "void",
- valuetype = "nil",
- },
- drawLine = {
- type = "function",
- description = [[Blit a line using GPU.
- Sample usage: Graphics.drawLine(0,10,0,10,Color.new(255,255,255))]],
- args = "(int x1, int x2, int y1, int y2, u32 color)",
- returns = "void",
- valuetype = "nil",
- },
- },
- },
- -- Console module
- Console = {
- type = "class",
- description = "Handles console init and updating.",
- childs = {
- new = {
- type = "function",
- description = [[Create a new console.
- Sample usage: console = Console.new(TOP_SCREEN)]],
- args = "(Image_id screen)",
- returns = "u32",
- valuetype = "number",
- },
- clear = {
- type = "function",
- description = [[Clear a console.
- Sample usage: Console.clear(console)]],
- args = "(u32 console)",
- returns = "void",
- valuetype = "nil",
- },
- show = {
- type = "function",
- description = [[Print content of a console.
- Sample usage: real_wrote_characters = Console.show(console)]],
- args = "(u32 console)",
- returns = "int",
- valuetype = "number",
- },
- append = {
- type = "function",
- description = [[Append text to a console.
- Sample usage: Console.append(console,"Hello world!\n")]],
- args = "(u32 console,string text)",
- returns = "void",
- valuetype = "nil",
- },
- destroy = {
- type = "function",
- description = [[Free a console.
- Sample usage: Console.destroy(console)]],
- args = "(u32 console)",
- returns = "void",
- valuetype = "nil",
- },
- },
- },
- -- Font module
- Font = {
- type = "class",
- description = "Handles font loading.",
- childs = {
- load = {
- type = "function",
- description = [[Load a TTF font.
- Sample usage: my_font = Font.load("/font.ttf")]],
- args = "(string filename)",
- returns = "u32",
- valuetype = "number",
- },
- setPixelSizes = {
- type = "function",
- description = [[Set size for a font.
- Sample usage: Font.setPixelSizes(my_font,18)]],
- args = "(u32 font,u32 size)",
- returns = "void",
- valuetype = "nil",
- },
- print = {
- type = "function",
- description = [[Print a text with a font.
- Sample usage: Font.print(my_font, 5, 5, "Hello World!", Color.new(255,255,255), TOP_SCREEN)]],
- args = "(u32 font, int x, int y, string text, u32 color, u32 screen, [u32 side])",
- returns = "void",
- valuetype = "nil",
- },
- unload = {
- type = "function",
- description = [[Free a font.
- Sample usage: Font.unload(my_font)]],
- args = "(u32 font)",
- returns = "void",
- valuetype = "nil",
- },
- },
- },
- -- Color module
- Color = {
- type = "class",
- description = "Object for color values.",
- childs = {
- new = {
- type = "function",
- description = [[Create a new RGB or RGBA color.
- Sample usage: red = Color.new(255,0,0)]],
- args = "(int r, int g, int b,[int a])",
- returns = "u32",
- valuetype = "number",
- },
- getR = {
- type = "function",
- description = [[Get R value of a color.
- Sample usage: red_value = Color.getR(Color.new(255,0,0))]],
- args = "(u32 color)",
- returns = "int",
- valuetype = "number",
- },
- getG = {
- type = "function",
- description = [[Get G value of a color.
- Sample usage: green_value = Color.getG(Color.new(255,0,0))]],
- args = "(u32 color)",
- returns = "int",
- valuetype = "number",
- },
- getB = {
- type = "function",
- description = [[Get B value of a color.
- Sample usage: blue_value = Color.getB(Color.new(255,0,0))]],
- args = "(u32 color)",
- returns = "int",
- valuetype = "number",
- },
- getA = {
- type = "function",
- description = [[Get A value of a color.
- Sample usage: alpha_value = Color.getA(Color.new(255,0,0,0))]],
- args = "(u32 color)",
- returns = "int",
- valuetype = "number",
- },
- },
- },
- -- Controls module
- Controls = {
- type = "class",
- description = "Handles input status.",
- childs = {
- init = {
- type = "function",
- description = [[Sets up controls environment.
- Sample usage: Controls.init()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- read = {
- type = "function",
- description = [[Read controls input.
- Sample usage: pad = Controls.read()]],
- args = "(void)",
- returns = "u32",
- valuetype = "number",
- },
- check = {
- type = "function",
- description = [[Check if a button is pressed.
- Sample usage: if (Controls.check(Controls.read(),KEY_A)) then ... end]],
- args = "(u32 controls,u32 button)",
- returns = "boolean",
- valuetype = "boolean",
- },
- readCirclePad = {
- type = "function",
- description = [[Get X,Y position of Circle Pad.
- Sample usage: x,y = Controls.readCirclePad()]],
- args = "(void)",
- returns = "int,int",
- valuetype = "number,number",
- },
- readCstickPad = {
- type = "function",
- description = [[Get X,Y position of Circle Pad Pro.
- Sample usage: x,y = Controls.readCstickPad()]],
- args = "(void)",
- returns = "int,int",
- valuetype = "number,number",
- },
- readTouch = {
- type = "function",
- description = [[Get X,Y position of touchscreen pixel.
- Sample usage: x,y = Controls.readTouch()]],
- args = "(void)",
- returns = "int,int",
- valuetype = "number,number",
- },
- getVolume = {
- type = "function",
- description = [[Get current console volume.
- Sample usage: vol = Controls.getVolume()]],
- args = "(void)",
- returns = "int",
- valuetype = "number",
- },
- headsetStatus = {
- type = "function",
- description = [[Check if headset is inserted.
- Sample usage: if Controls.headsetStatus() then ... end]],
- args = "(void)",
- returns = "boolean",
- valuetype = "boolean",
- },
- },
- },
- -- Timer module
- Timer = {
- type = "class",
- description = "Timer functionality with millisecond accuracy.",
- childs = {
- new = {
- type = "function",
- description = [[Create a new timer.
- Sample usage: timer = Timer.new()]],
- args = "(void)",
- returns = "u32",
- valuetype = "number",
- },
- getTime = {
- type = "function",
- description = [[Returns time in milliseconds of timer object.
- Sample usage: time = Timer.getTime(timer)]],
- args = "(u32 timer)",
- returns = "u32",
- valuetype = "number",
- },
- destroy = {
- type = "function",
- description = [[Free a timer object.
- Sample usage: Timer.destroy(timer)]],
- args = "(u32 timer)",
- returns = "void",
- valuetype = "nil",
- },
- reset = {
- type = "function",
- description = [[Reset time of a timer object.
- Sample usage: Timer.reset(timer)]],
- args = "(u32 timer)",
- returns = "void",
- valuetype = "nil",
- },
- pause = {
- type = "function",
- description = [[Pause a timer object.
- Sample usage: Timer.pause(timer)]],
- args = "(u32 timer)",
- returns = "void",
- valuetype = "nil",
- },
- resume = {
- type = "function",
- description = [[Resume a timer object.
- Sample usage: Timer.resume(timer)]],
- args = "(u32 timer)",
- returns = "void",
- valuetype = "nil",
- },
- isPlaying = {
- type = "function",
- description = [[Check if a timer is paused or not.
- Sample usage: if Timer.isPlaying(timer) then .. end]],
- args = "(u32 timer)",
- returns = "boolean",
- valuetype = "boolean",
- },
- },
- },
- -- Network module
- Network = {
- type = "class",
- description = "Handles connections to a network.",
- childs = {
- isWifiEnabled = {
- type = "function",
- description = [[Check if WiFi is enabled.
- Sample usage: if (Network.isWifiEnabled()) then ... end]],
- args = "(void)",
- returns = "boolean",
- valuetype = "boolean",
- },
- getMacAddress = {
- type = "function",
- description = [[Get console MAC address.
- Sample usage: mac = Network.getMacAddress()]],
- args = "(void)",
- returns = "string",
- valuetype = "string",
- },
- getIpAddress = {
- type = "function",
- description = [[Get LAN IP address.
- Sample usage: ip = Network.getIpAddress()]],
- args = "(void)",
- returns = "string",
- valuetype = "string",
- },
- initFTP = {
- type = "function",
- description = [[Init FTP on port 5000.
- Sample usage: Network.initFTP()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- termFTP = {
- type = "function",
- description = [[Terminate FTP on port 5000.
- Sample usage: Network.termFTP()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- updateFTP = {
- type = "function",
- description = [[Update FTP state and get last received command.
- Sample usage: cmd = Network.updateFTP()]],
- args = "(void)",
- returns = "string",
- valuetype = "string",
- },
- downloadFile = {
- type = "function",
- description = [[Download a file via HTTP protocol.
- Sample usage: Network.downloadFile("http://rinnegatamante.netsons.org/3DSBriscola.rar","/3DSBriscola.rar")]],
- args = "(string url,string filename)",
- returns = "void",
- valuetype = "nil",
- },
- requestString = {
- type = "function",
- description = [[Request a string via HTTP protocool.
- Sample usage: string = Network.requestString("http://rinnegatamante.netsons.org/ORGANIZ3D.txt")]],
- args = "(string url)",
- returns = "string",
- valuetype = "string",
- },
- sendMail = {
- type = "function",
- description = [[Send e-mail via HTTP protocol.
- Sample usage: is_mail_sent = Network.sendMail("[email protected]","Sample e-mail","This is a sample e-mail.")]],
- args = "(string to,string subject,string body)",
- returns = "boolean",
- valuetype = "boolean",
- },
- },
- },
- -- Sound module
- Sound = {
- type = "class",
- description = "Handles sound system.",
- childs = {
- init = {
- type = "function",
- description = [[Initialize sound system.
- Sample usage: Sound.init()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- term = {
- type = "function",
- description = [[Terminate sound system.
- Sample usage: Sound.term()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- openWav = {
- type = "function",
- description = [[Open a WAV file.
- Sample usage: wav = Sound.openWav("/file.wav",false)]],
- args = "(string filename,[bool use_streaming])",
- returns = "wav_id",
- valuetype = "userdata",
- },
- openAiff = {
- type = "function",
- description = [[Open an AIFF/AIF file.
- Sample usage: aiff = Sound.openAiff("/file.aiff",true)]],
- args = "(string filename,[bool use_streaming])",
- returns = "wav_id",
- valuetype = "userdata",
- },
- openOgg = {
- type = "function",
- description = [[Open an OGG file.
- Sample usage: wav = Sound.openOgg("/file.ogg",true)]],
- args = "(string filename,[bool use_streaming])",
- returns = "wav_id",
- valuetype = "userdata",
- },
- updateStream = {
- type = "function",
- description = [[Update buffer for a sound stream.
- Sample usage: Sound.updateStream()]],
- args = "(void)",
- returns = "void",
- valuetype = "nil",
- },
- isPlaying = {
- type = "function",
- description = [[Get sound playing state.
- Sample usage: if Sound.isPlaying(wav) then ... end]],
- args = "(wav_id wav_file)",
- returns = "boolean",
- valuetype = "boolean",
- },
- play = {
- type = "function",
- description = [[Play a loaded sound.
- Sample usage: Sound.play(wav,NO_LOOP,0x09)]],
- args = "(wav_id wav_file, int loop, u32 channel, [u32 channel2])",
- returns = "void",
- valuetype = "nil",
- },
- close = {
- type = "function",
- description = [[Close and free a loaded sound.
- Sample usage: Sound.close(wav)]],
- args = "(wav_id wav_file)",
- returns = "void",
- valuetype = "nil",
- },
- pause = {
- type = "function",
- description = [[Pause a sound.
- Sample usage: Sound.pause(wav)]],
- args = "(wav_id wav_file)",
- returns = "void",
- valuetype = "nil",
- },
- resume = {
- type = "function",
- description = [[Resume a sound.
- Sample usage: Sound.resume(wav)]],
- args = "(wav_id wav_file)",
- returns = "void",
- valuetype = "nil",
- },
- saveWav = {
- type = "function",
- description = [[Save a sound as WAV file.
- Sample usage: Sound.saveWav(sound,"/test.wav")]],
- args = "(wav_id wav_file,string filename)",
- returns = "void",
- valuetype = "nil",
- },
- register = {
- type = "function",
- description = [[Register a sound with microphone.
- Sample usage: sound = Sound.register(10)]],
- args = "(int seconds)",
- returns = "wav_id",
- valuetype = "userdata",
- },
- getTotalTime = {
- type = "function",
- description = [[Get Total Time of a sound.
- Sample usage: time = Sound.getTotalTime(wav_file)]],
- args = "(wav_id wav_file)",
- returns = "int",
- valuetype = "number",
- },
- getTime = {
- type = "function",
- description = [[Get Current Time of a sound.
- Sample usage: time = Sound.getTime(wav_file)]],
- args = "(wav_id wav_file)",
- returns = "int",
- valuetype = "number",
- },
- getSrate = {
- type = "function",
- description = [[Get samplerate of a sound.
- Sample usage: samplerate = Sound.getSrate(wav_file)]],
- args = "(wav_id wav_file)",
- returns = "int",
- valuetype = "number",
- },
- getTitle = {
- type = "function",
- description = [[Get Title of a sound.
- Sample usage: title = Sound.getTitle(wav_file)]],
- args = "(wav_id wav_file)",
- returns = "string",
- valuetype = "string",
- },
- getAuthor = {
- type = "function",
- description = [[Get Author of a sound.
- Sample usage:author = Sound.getAuthor(wav_file)]],
- args = "(wav_id wav_file)",
- returns = "string",
- valuetype = "string",
- },
- getType = {
- type = "function",
- description = [[Get audiotype of a sound. (1 = Mono, 2 = Stereo)
- Sample usage:atype = Sound.getType(wav_file)]],
- args = "(wav_id wav_file)",
- returns = "int",
- valuetype = "number",
- },
- },
- },
- -- Video module
- BMPV = {
- type = "class",
- description = "Handles BMPV video system.",
- childs = {
- load = {
- type = "function",
- description = [[Load a BMPV file.
- Sample usage: bmpv = BMPV.load("/file.bmpv")]],
- args = "(string filename)",
- returns = "bmpv_id",
- valuetype = "userdata",
- },
- start = {
- type = "function",
- description = [[Start a BMPV video.
- Sample usage: BMPV.start(bmpv, NO_LOOP, 0x08, 0x09)]],
- args = "(bmpv_id bmpv, int loop, u32 channel1, [u32 channel2])",
- returns = "void",
- valuetype = "nil",
- },
- draw = {
- type = "function",
- description = [[Draw BMPV current frame.
- Sample usage: BMPV.draw(0,0,bmpv,TOP_SCREEN)]],
- args = "(int x, int y, bmpv_id bmpv, int screen, [Eye_id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- unload = {
- type = "function",
- description = [[Unload a BMPV file.
- Sample usage: BMPV.unload(bmpv)]],
- args = "(bmpv_id bmpv)",
- returns = "void",
- valuetype = "nil",
- },
- getFPS = {
- type = "function",
- description = [[Get BMPV framerate.
- Sample usage: fps = BMPV.getFPS(bmpv)]],
- args = "(bmpv_id bmpv)",
- returns = "u32",
- valuetype = "number",
- },
- getFrame = {
- type = "function",
- description = [[Get BMPV current frame number.
- Sample usage: cur = BMPV.getFrame(bmpv)]],
- args = "(bmpv_id bmpv)",
- returns = "u32",
- valuetype = "number",
- },
- showFrame = {
- type = "function",
- description = [[Show a selected frame from BMPV file.
- Sample usage: BMPV.showFrame(0,0,bmpv,50,TOP_SCREEN)]],
- args = "(int x,int y,bmpv_id bmpv,int frame_number,int screen,[Eye_Id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- getSrate = {
- type = "function",
- description = [[Get BMPV audio samplerate.
- Sample usage: samplerate = BMPV.getSrate(bmpv)]],
- args = "(bmpv_id bmpv)",
- returns = "u32",
- valuetype = "number",
- },
- getSize = {
- type = "function",
- description = [[Get BMPV total frame number.
- Sample usage: tot = BMPV.getSize(bmpv)]],
- args = "(bmpv_id bmpv)",
- returns = "u32",
- valuetype = "number",
- },
- isPlaying = {
- type = "function",
- description = [[Get BMPV playback state.
- Sample usage: if (BMPV.isPlaying(bmpv)) then ... end]],
- args = "(bmpv_id bmpv)",
- returns = "boolean",
- valuetype = "boolean",
- },
- stop = {
- type = "function",
- description = [[Stop a BMPV video.
- Sample usage: BMPV.stop(bmpv)]],
- args = "(bmpv_id bmpv)",
- returns = "void",
- valuetype = "nil",
- },
- pause = {
- type = "function",
- description = [[Pause a BMPV video.
- Sample usage: BMPV.pause(bmpv)]],
- args = "(bmpv_id bmpv)",
- returns = "void",
- valuetype = "nil",
- },
- resume = {
- type = "function",
- description = [[Resume a BMPV video.
- Sample usage: BMPV.resume(bmpv)]],
- args = "(bmpv_id bmpv)",
- returns = "void",
- valuetype = "nil",
- },
- },
- },
- JPGV = {
- type = "class",
- description = "Handles JPGV video system.",
- childs = {
- load = {
- type = "function",
- description = [[Load a JPGV file.
- Sample usage: jpgv = JPGV.load("/file.jpgv")]],
- args = "(string filename)",
- returns = "jpgv_id",
- valuetype = "userdata",
- },
- start = {
- type = "function",
- description = [[Start a JPGV video.
- Sample usage: JPGV.start(jpgv, NO_LOOP, 0x08, 0x09)]],
- args = "(jpgv_id jpgv, int loop, u32 channel1, [u32 channel2])",
- returns = "void",
- valuetype = "nil",
- },
- draw = {
- type = "function",
- description = [[Draw JPGV current frame.
- Sample usage: JPGV.draw(0,0,jpgv,TOP_SCREEN)]],
- args = "(int x, int y, jpgv_id jpgv, int screen, [Eye_id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- unload = {
- type = "function",
- description = [[Unload a JPGV file.
- Sample usage: JPGV.unload(jpgv)]],
- args = "(jpgv_id jpgv)",
- returns = "void",
- valuetype = "nil",
- },
- getFPS = {
- type = "function",
- description = [[Get JPGV framerate.
- Sample usage: fps = JPGV.getFPS(jpgv)]],
- args = "(jpgv_id jpgv)",
- returns = "u32",
- valuetype = "number",
- },
- getFrame = {
- type = "function",
- description = [[Get JPGV current frame number.
- Sample usage: cur = JPGV.getFrame(jpgv)]],
- args = "(jpgv_id jpgv)",
- returns = "u32",
- valuetype = "number",
- },
- showFrame = {
- type = "function",
- description = [[Show a selected frame from JPGV file.
- Sample usage: JPGV.showFrame(0,0,jpgv,50,TOP_SCREEN)]],
- args = "(int x,int y,jpgv_id jpgv,int frame_number,int screen,[Eye_Id] eye)",
- returns = "void",
- valuetype = "nil",
- },
- getSrate = {
- type = "function",
- description = [[Get JPGV audio samplerate.
- Sample usage: samplerate = JPGV.getSrate(jpgv)]],
- args = "(jpgv_id jpgv)",
- returns = "u32",
- valuetype = "number",
- },
- getSize = {
- type = "function",
- description = [[Get JPGV total frame number.
- Sample usage: tot = JPGV.getSize(jpgv)]],
- args = "(jpgv_id jpgv)",
- returns = "u32",
- valuetype = "number",
- },
- isPlaying = {
- type = "function",
- description = [[Get JPGV playback state.
- Sample usage: if (JPGV.isPlaying(jpgv)) then ... end]],
- args = "(jpgv_id jpgv)",
- returns = "boolean",
- valuetype = "boolean",
- },
- stop = {
- type = "function",
- description = [[Stop a JPGV video.
- Sample usage: JPGV.stop(jpgv)]],
- args = "(jpgv_id jpgv)",
- returns = "void",
- valuetype = "nil",
- },
- pause = {
- type = "function",
- description = [[Pause a JPGV video.
- Sample usage: JPGV.pause(jpgv)]],
- args = "(jpgv_id jpgv)",
- returns = "void",
- valuetype = "nil",
- },
- resume = {
- type = "function",
- description = [[Resume a JPGV video.
- Sample usage: JPGV.resume(jpgv)]],
- args = "(jpgv_id jpgv)",
- returns = "void",
- valuetype = "nil",
- },
- },
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment