Making a homebrew ds rpg, need help!

Discussion in 'NDS - Emulation and Homebrew' started by TheHunterManX, Feb 9, 2016.

  1. TheHunterManX
    OP

    TheHunterManX Newbie

    Newcomer
    9
    0
    Dec 23, 2015
    Gambia, The
    I am currently making a nds rpg, and this rpg is based around multiplayer. I have set it up to where there is saving and loading. Now all I need is ni-fi(local wireless communications) in the game. Can someone post a example of nifi? also please dont reference the nifi example in the devkitpro examples, I need some new examples. Project M is made in DS game maker, and is posted below.
    (Also if you dont know how to make saving or loading, my file has it. Only on a flashcard).
     

    Attached Files:

  2. Technicmaster0

    Technicmaster0 GBAtemp Psycho!

    Member
    3,289
    681
    Oct 22, 2011
    Gambia, The
    Can you please upload the raw .nds file?
     
  3. TheHunterManX
    OP

    TheHunterManX Newbie

    Newcomer
    9
    0
    Dec 23, 2015
    Gambia, The
    Please specify. If you are talking about a plain old nds file then here it is.
    it is Project M.nds
     

    Attached Files:

  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,865
    9,773
    Nov 21, 2005
    United Kingdom
    Why nifi and not local wifi?
     
  5. TheHunterManX
    OP

    TheHunterManX Newbie

    Newcomer
    9
    0
    Dec 23, 2015
    Gambia, The
    Nifi is local wifi(wireless communications).
     
  6. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,865
    9,773
    Nov 21, 2005
    United Kingdom
    Not unless the homebrew world redefined it since I last looked. I was under the impression nifi was the custom/kind of headerless protocol that pictochat, download play and local play tended to use for commercial games. Not strictly wifi compliant so most things that were not a DS would not do it, and even those that might would still need raw mode/custom drivers and fun and games to get sorted (see something like wifime).
    Local wifi was just that and runs the usual TCP-IP comms and will need a local access point/router/whatever (not sure what might go with a DS and ad hoc connections) but does simplify things a bit for emulators or if you wanted to build a PC client. Most DS homebrew I ever saw opted for this method instead, mainly as it then made it easy to also do remote servers.
     
  7. TheHunterManX
    OP

    TheHunterManX Newbie

    Newcomer
    9
    0
    Dec 23, 2015
    Gambia, The
    Well, anyhow I need to add it into the game. I dont think it is possible to add it to dsgm 5.2. I have looked into the source code, main.c, and tried to add it there. Sadly, no luck.
    If someone could explain to me a few things, I can get it working.
    <code>
    Taken from the nifi code in devkitpro:

    void hello_loop(helloObjectInstance *me) {
    // Buffer must be aligned to 2 bytes, so use unsigned short
    unsigned short buffer[(2 * sizeof(int)) / sizeof(unsigned short)];

    //First off, I do not understand the unsigned short buffer.

    if(DSGM_held.Right) {
    me->x =[X]+2;
    me->y =[Y];
    memcpy(buffer, &me->x, 2 * sizeof(int));
    DSGM_SendWirelessData(buffer, 2 * sizeof(int));

    //I dont understand what this is, But I understand It is sending the x to the other game, though
    //I dont understand where the other DSGM_held.Left, DSGM_held.Up and DSGM_held.Down is.
    //Also the memcpy I dont understand. I think it is preparing the x var to be sent?
    }

    if(DSGM_newWirelessData) {
    if(DSGM_wirelessDataLength == 2 * sizeof(int)) memcpy(&me->x, DSGM_wirelessData, 2 * sizeof(int));
    //I dont understand the size or the memcpy, though I know it is recieving new data from the other ds.
    }
    }

    </code>