gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > launching a specific .nds file

#123953 - tondopie - Mon Apr 02, 2007 1:36 am

i was wondering how to launch a specific .nds file. so far I have this and it doesn't do anything.

Code:
// Includes
#include <PA9.h>       // Include for PA_Lib
#include <fat.h>

char text[200]; // This will be our text...

void dscart(void){ // Function to execute when the button0 is pressed...
   FILE* ndsFile = fopen ("/DSLaunch.nds", "rb");

}   

// Function: main()
int main(int argc, char ** argv)
{
   PA_Init();    // Initializes PA_Lib
   PA_InitVBL(); // Initializes a standard VBL
   
   PA_Init8bitBg(0, 3);
   PAPI_Init(0); // Init the API on the bottom screen

   PA_InitText(0, 0);  // Initialize the text system on the bottom screen   
   
   PA_InitText(1, 0);  // Initialize the text system on the top screen
   
   fatInitDefault();

   PAPI_CreateButton(0, 120, 40, 64, 16, &dscart, "DS Launch", 1, 1);

   while (1)
   {
      PAPI_CheckButton(); // Check the buttons   
         
      PA_WaitForVBL();
   }
   
   return 0;
} // End of main()


when I run the file on my GBAMP and press the button, nothing happens...

#123954 - kusma - Mon Apr 02, 2007 2:17 am

opening a file and launching it is not the same thing.

#123955 - felix123 - Mon Apr 02, 2007 2:18 am

Read this
http://forum.gbadev.org/viewtopic.php?t=10390
_________________
Nintendo DS homebrew on Wikipedia

#123957 - tondopie - Mon Apr 02, 2007 2:36 am

thank this seems helpful for making a menu but i was wanting to launch a specific .nds file by its name

#123968 - GrizzlyAdams - Mon Apr 02, 2007 5:05 am

You can wait a couple days for me to release a lib you can import which uses the exec stubs from dschannels.

#124202 - tondopie - Wed Apr 04, 2007 1:39 am

GrizzlyAdams wrote:
You can wait a couple days for me to release a lib you can import which uses the exec stubs from dschannels.



I don't think that will help me. I just need to start one specific .nds file at the ckick of a button. I dont need any menus or anything.

#124203 - chuckstudios - Wed Apr 04, 2007 1:40 am

tondopie wrote:
GrizzlyAdams wrote:
You can wait a couple days for me to release a lib you can import which uses the exec stubs from dschannels.



I don't think that will help me. I just need to start one specific .nds file at the ckick of a button. I dont need any menus or anything.


Exec stubs are what is used to execute a file :-/

#124204 - tondopie - Wed Apr 04, 2007 1:43 am

chuckstudios wrote:
tondopie wrote:
GrizzlyAdams wrote:
You can wait a couple days for me to release a lib you can import which uses the exec stubs from dschannels.



I don't think that will help me. I just need to start one specific .nds file at the ckick of a button. I dont need any menus or anything.


Exec stubs are what is used to execute a file :-/



so there s not just a few lines of code that will launch a file. I guess I better go make me one then.

#124210 - tyraen - Wed Apr 04, 2007 2:16 am

I think you'll find out that making you one will take a bit of effort. :) But I'm sure it'll be an awesome learning experience!

#124211 - tondopie - Wed Apr 04, 2007 2:18 am

tyraen wrote:
I think you'll find out that making you one will take a bit of effort. :) But I'm sure it'll be an awesome learning experience!


when you're recovering from surgery, you have time. :)