Whats the best way to start programing homebrew on tubehax for a noob?

Discussion in '3DS - Homebrew Development and Emulators' started by Mr. Elementle, Sep 10, 2015.

  1. Mr. Elementle
    OP

    Mr. Elementle Advanced Member

    Newcomer
    90
    34
    Dec 30, 2014
    United States
    Detroit
    I've been involved in some minor hacks and stuff before, mostly just graphics, but recently i've taken an interest in learning to program my own 3dsx homebrew, my programming knowledge is limited though.

    Whats the best language to program in? I've seen a lot of people use C++ and C# but i keep seeing LUA being tossed around and whats the best way to compile for 3dsx files since i can't get visual studio to run.

    EDIT: I should mention my first project i want to do isn't an original homebrew, it's a port of the ds homebrew IKUreader if it matters, i figured porting might be a bit easier to start with since i can study the already written code and see how it works, correct me if i'm horribly mistaken
     
  2. BurningDesire

    BurningDesire Nepu Nepu Nepu

    Member
    4,943
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
  3. Mr. Elementle
    OP

    Mr. Elementle Advanced Member

    Newcomer
    90
    34
    Dec 30, 2014
    United States
    Detroit
    Thank you very much i didn't realize there was already a site for this
     
  4. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    If you start developing in LUA you don't have to set up any development environment and you don't have to compile anything in 3DSX cause lpp-3ds is just compiled.
     
  5. BurningDesire

    BurningDesire Nepu Nepu Nepu

    Member
    4,943
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    I've tried using llp when i put my homebrew app in the 3ds folder then run it I just get a green pixel and no hello world text This is with ironhax 2.1
     
  6. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    Your probably wrong with paths.
     
  7. BurningDesire

    BurningDesire Nepu Nepu Nepu

    Member
    4,943
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    My homebrew name is llp in the llp folder i have helloworld.lua and a file called LLP.3dsx here is my code

    while true do
    Screen.waitVblankStart()
    Screen.refresh()
    Screen.debugPrint(400,240,"Hello World",Color.new(255,255,255),TOP_SCREEN)
    Screen.flip()
    end
     
  8. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    File must be named index.lua, for the 4th time, have you at least read the OP of lpp-3ds thread? ... http://gbatemp.net/threads/release-lua-player-plus-3ds-lpp-3ds-lua-interpreter-for-3ds.384202/
     
  9. TheSockNaster

    TheSockNaster Kawaii

    Banned
    270
    58
    Feb 7, 2015
    United States
    Stop giving him the wrong information. He needs to learn first.

    I recommend you learn C++ first before going to that website. There is no such thing as learning code specifically for one thing. You think the creators of those emulators went to that website and learned? NO! They learned C++ first and did it themselves. If you want to code like them then follow what I am saying. If you want to learn only specific things then you can go to that website, but if you want to learn how to do your own custom things then learn C++ first.
     
  10. BurningDesire

    BurningDesire Nepu Nepu Nepu

    Member
    4,943
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    I tried finding it after about the eight page i gave up

    — Posts automatically merged - Please don't double post! —

    How is that wrong information? I gave him a tutorial on how to set up the environment and if he want's a few crash courses in c if he want's legit lessons.
     
  11. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna

    Eight page? OP = Opening post = first post...
     
  12. TheSockNaster

    TheSockNaster Kawaii

    Banned
    270
    58
    Feb 7, 2015
    United States
    He will never code properly with that website. If he learns legit first then he can create something no one has created before. Learn C++ legit then look at the tutorials. Stop being stupid. He won't understand a thing if he starts there first. He will be really confused.

    — Posts automatically merged - Please don't double post! —

    Your good at coding. Can you agree with me? He will be confused and won't understand a thing if he starts there.
     
  13. BurningDesire

    BurningDesire Nepu Nepu Nepu

    Member
    4,943
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    I always that that meant original poster xD. So i got it to work but i get a error about out abound buffors

    400 x 240 is the screen size for the top 3ds

    my code :
    while true do
    Screen.waitVblankStart()
    Screen.refresh()
    Screen.debugPrint(240,400,"Hello World",Color.new(255,255,255),TOP_SCREEN)
    Screen.flip()
    end
    Also, everytime i leave the program i have to reboot the netloader via the y button

     
  14. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    void Screen.debugPrint(int x, int y, string text, u32 color, Image_id screen_id, [Eye_id] eye) - Write a string on screen or image.

    Sample usage: Screen.debugPrint(0, 0, "Hello World", Color.new(255,255,255), TOP_SCREEN)
     
  15. BurningDesire

    BurningDesire Nepu Nepu Nepu

    Member
    4,943
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    So is the while loop in lua equivalent to a void function in c

    — Posts automatically merged - Please don't double post! —

    Nevermind, didn't work the way i thought it would i'll continue experimenting.
     
  16. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    while loop in lua are the equivalent of while loop in C...
     
  17. BurningDesire

    BurningDesire Nepu Nepu Nepu

    Member
    4,943
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    You had me thinking it was a void because you put.

    void Screen.debugPrint(int x, int y, string text, u32 color, Image_id screen_id, [Eye_id] eye)

    which i figured would go in the while loop then outside the while loop i would put

    Screen.debugPrint(0, 0, "Hello World", Color.new(255,255,255), TOP_SCREEN)

    to have it drawn
     
  18. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    Ok, i'll restart from another point of view.
    Do you know basic of C?

    void is a type which means a generic variable substantially when used as a pointer and a null variable when used as a variable.
    Functions in a documentation (like in header C/C++ files) are reported like this:

    return_type name_of_function(type_of_argument name_argument);

    so

    void Screen.debugPrint(int x, int y, string text, u32 color, Image_id screen_id, [Eye_id] eye)

    means that Screen.debugPrint doesn't return any kind of result.
     
  19. BurningDesire

    BurningDesire Nepu Nepu Nepu

    Member
    4,943
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    Yaye i fixed it! Thank you for your help. I will definitely use Lua3DS for Osu3DS!