I've come to the conclusion that maybe my project isn't possible.
If you have two files, a dol forwarder and a program:
forwarder.dol
char* test = "world!";
FILE* inputFile;
inputFile = fopen( "/apps/usbloader/boot.dol", "rb");
and
boot.dol
char* test;
printf("Hello %s",test);
It more or less doesn't work. And thinking about it for a while, I've concluded that it's because you're basically loading an already-compiled bit of code, so there is no way to pass variables to it in the manner that I want. Is this a correct conclusion? Is there any way to set a variable in forwarder.dol, and have boot.dol be able to read it after forwarder.dol has opened boot.dol?
Do you have the source for the boot.dol and the dol loader? If so, use exec. Like this:
forwarder.dol
Code:
int main(int args, char *argv[])
{
ÂÂchar* test = "Hello";
ÂÂexecl("sd:/apps/usbloader/boot.dol","sd:/apps/usbloader/boot.dol", test, "world!");
ÂÂreturn;
}
This would be equivalent to doing sd:/apps/usbloader/boot.dol hello word. If you wanted more parameters, just add more commas and more strings.
and
boot.dol
CODEint main(int args, char *argv[])
{
ÂÂ if(args > 0) {
ÂÂÂÂÂÂprintf("my name is: %s\n",argv[0])
ÂÂ }
ÂÂ printf("I was passed\n");
ÂÂ if(args > 1){
ÂÂÂÂÂÂfor(i=1;i