Someone help me out with some noob homebrew programming pls

Discussion in '3DS - Homebrew Development and Emulators' started by jamieyello, Dec 2, 2014.

  1. jamieyello
    OP

    jamieyello Professional Dumbass

    Member
    377
    255
    Mar 11, 2013
    United States
    Like I've made it as far as getting a pixel displayed on the screen, I could do a for loop to draw a little square to move around, but that would be very inefficient. How to I get it to draw whole pictures using this template?
    Code:
    #include <3ds.h>
     
    int main()
    {
      // Initializations
      srvInit();        // services
      aptInit();        // applets
      hidInit(NULL);    // input
      gfxInit();        // graphics
      gfxSet3D(false);  // stereoscopy (true: enabled / false: disabled)
      u32 kDown;        // pressed keys data
     
      // Main loop
      while (aptMainLoop())
      {
     
        // Wait for next frame
        gspWaitForVBlank();
     
        // Read which buttons are currently pressed
        hidScanInput();
        kDown = hidKeysDown();
     
        // If START is pressed, break loop and quit
        if (kDown & KEY_START){
          break;
        }
     
     
        /** Your code goes here **/
     
     
        // Flush and swap framebuffers
        gfxFlushBuffers();
        gfxSwapBuffers();
      }
     
      // Exit
      gfxExit();
      hidExit();
      aptExit();
      srvExit();
     
      // Return to hbmenu
      return 0;
    }
    If someone could help me out that would be amazing. This is someone's tutorial template that I found here btw if that wasn't obvious. Also has anyone actually gotten ftpony to work correctly? I can get it connected and all that but it doesn't seem to want to actually write or delete anything off the sd card, swapping out sd's is such a pain.
     
  2. mygbatempaccount

    mygbatempaccount Newbie

    Newcomer
    3
    1
    Nov 29, 2014
    United States
    ftpony is trash in my experience: always freezing. Somebody added a network loading function to the latest version of the homebrew launcher. Build from that and at the homebrew menu press Y. Then send the 3dsx file you want to launch over a socket. It works for me.

    There are sprite drawing functions in 3ds_hb_menu, too, in gfx.c.
     
    Margen67 likes this.
  3. jamieyello
    OP

    jamieyello Professional Dumbass

    Member
    377
    255
    Mar 11, 2013
    United States
    Hmmm.. the built in network loader crashes every time I try to connect. /: Updated ctrulib and all that and still.

    FTP protocol, 192.168.200.31 port 9000 no encryption username or password, am I doing it right? Not a big deal for now since someone's probably working out bugs, but my 32gb sd has taken so much abuse the plastic dividers are starting to fall off and the worn out sticker with no ink just fell off cause' the little trooper had no stick left in it.

    As for the sprites that stuff looks just over my head but not by a lot. I've never seen this "u16 u32 u8" witchcraft before but I'm assuming it's a 16 32 bit variable type. Should be able to figure it out easily enough though, thanks.
     
  4. mygbatempaccount

    mygbatempaccount Newbie

    Newcomer
    3
    1
    Nov 29, 2014
    United States
    You just send the file over. Here's the python script I threw together:

    Code:
    import socket
    HOST = '192.168.200.31' # I changed this to your IP
    PORT = 9000
    FILENAME = "n.3dsx"    # Path to the file I want to send.
                            # My file is "n.3dsx" and it's in the
                            # current working directory.
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((HOST, PORT))
    s.sendall(open(FILENAME, "rb").read())
    s.close()
    I think when I tried to send over 3ds_hb_menu the launcher just crashed. But it works on other things for me. I dunno, maybe mine is a special case.

    Yeah the types are defined in types.h in ctrulib.
     
  5. caprathebest

    caprathebest GBAtemp Regular

    Member
    113
    32
    May 15, 2014
    Italy
  6. shinyquagsire23

    shinyquagsire23 SALT/Sm4sh Leak Guy

    Member
    1,966
    3,249
    Nov 18, 2012
    United States
    Las Vegas
    If you need FTP, use FTBrony, it's a lot better than FTPony and actually works with Linux FTP clients (or FTP clients in general). And it's more magical.
     
    Margen67 likes this.
  7. Cid2mizard

    Cid2mizard GBAtemp Fan

    Member
    364
    210
    Aug 16, 2007
    France
    Maubeuge
    I have error with FTBrony too => Copying files to remote side failed.

    FTPony and FTbrony are not stable both !!!
     
  8. hippy dave

    hippy dave BBMB

    Member
    2,598
    1,809
    Apr 30, 2012
    United Kingdom
    Oh that's some good shit, thanks! Anyone have a .cia version, or a .rsf, handy?
     
    Margen67 likes this.
  9. jamieyello
    OP

    jamieyello Professional Dumbass

    Member
    377
    255
    Mar 11, 2013
    United States
    Ftbrony is the only one that actually works, but it works perfectly. Awesome. Now if I can get a crappy mario test game working that would be great.
     
  10. jamieyello
    OP

    jamieyello Professional Dumbass

    Member
    377
    255
    Mar 11, 2013
    United States
    Look at my amazing game! (d-pad to move)

    (used this template https://gbatemp.net/threads/toolbox...e-ninjhax-and-make-your-own-homebrews.374693/ thanks xem!)
    I'm working on using the text on the bottom to create a print function. Amazing right? I'm kind of learning c/c++ at the same time, the most I did before this was cmd prompt calculators and BASIC.

    Now how do I get sound to play? It's not complete until I get Groose's theme playing in the background.

    The next thing I work on will be a simple file browser. (with less profanity. probably.)
     

    Attached Files: