Hacking BAGSFC R3 source with arg loading support

  • Thread starter Thread starter BassAceGold
  • Start date Start date
  • Views Views 3,748
  • Replies Replies 7
  • Likes Likes 1

BassAceGold

Testicles
Member
Joined
Aug 14, 2006
Messages
496
Reaction score
127
Trophies
1
XP
442
Country
Canada
This is just a modified version of the latest BAGSFC release that will check for a "plgargs.dat" file on the root of the card, and launch the file path written on the second line of the file. eg:

plgargs.dat
QUOTE said:
/BAGSFC/bagsfc.plg
/BAGSFC/gamepak/super mario world.rar

The new version of iMenu that has yet to be released will support plugin args along with the new plugin menu I am creating.
Emulator Source Here

For those who are curious about adding plugin arg support to their programs, this code can be used to parse the plgargs.dat file. The first line or filebuf[0] will be the file path to the launched plugin while filebuf[1] will be the file to launch in the program if supported.

CODEint Get_Args(char *file, char **filebuf)
{
FILE* dat = fat_fopen(file, "rb");
if(dat)
{
int i = 0;
while(!fat_feof (dat))
{
fat_fgets(filebuf, 512, dat);
int len = strlen(filebuf);

if(filebuf[len - 1] == '\n')
filebuf[len - 1] = '';
i++;
}

fat_fclose(dat);
fat_remove(file);
return i;
}
return 0;
}
 
  • Like
Reactions: Margen67
Thanks!
biggrin.gif
 
  • Like
Reactions: Margen67
Oh, cool! So SCDS2 developement got moved over to here.
Did you already find out anything about why the game slows down so horribly on the overworld in the Mario hack I had sent you?
I would take a look at all this SCDS2 stuff myself, but all this Linux environment stuff is way too complicated for me, especially since my computer is rather old. Virtual Machine wouldn't run very smoothly, while cygwin wouldn't be very compatible.
 
RPG Hacker said:
Oh, cool! So SCDS2 developement got moved over to here.
Did you already find out anything about why the game slows down so horribly on the overworld in the Mario hack I had sent you?
I would take a look at all this SCDS2 stuff myself, but all this Linux environment stuff is way too complicated for me, especially since my computer is rather old. Virtual Machine wouldn't run very smoothly, while cygwin wouldn't be very compatible.

The only thing I can think of that is causing the slow down would the be auto sram saving. Nothing else I have modified could result in such a drastic change as they have all been menu related fixes. I do not intend to continue updating this emulator, however someone else with this info can hopefully make the fix.
 
Does it write the SRAM to disc every frame? Couldn't this be avoided with a simple fix? Maybe a flag that is set whenever SRAM is written to and then activates the transfer of RAM to SD. Well then again I don't know anything of SCDS2 developement, so maybe I'm talking crap.
 
  • Like
Reactions: Margen67
See, if only there were open plg loader, adding sfc support to MoonShell2 would be quite easy (extlink.dat -> plgargs.dat converting is easy)...
 

Site & Scene News

Popular threads in this forum