mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 23:07:46 -04:00
better mmuhack usage
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@184 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
576fc63792
commit
9e68ce27d4
2 changed files with 19 additions and 15 deletions
|
@ -63,7 +63,7 @@ void parse_cmd_line(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unrecognized) {
|
if (unrecognized) {
|
||||||
printf("\n\n\nPicoDrive v" VERSION " (c) notaz, 2006\n");
|
printf("\n\n\nPicoDrive v" VERSION " (c) notaz, 2006-2007\n");
|
||||||
printf("usage: %s [options] [romfile]\n", argv[0]);
|
printf("usage: %s [options] [romfile]\n", argv[0]);
|
||||||
printf( "options:\n"
|
printf( "options:\n"
|
||||||
"-menu <menu_path> launch a custom program on exit instead of default gp2xmenu\n"
|
"-menu <menu_path> launch a custom program on exit instead of default gp2xmenu\n"
|
||||||
|
|
|
@ -12,20 +12,24 @@ extern char **g_argv;
|
||||||
int mmuhack(void)
|
int mmuhack(void)
|
||||||
{
|
{
|
||||||
char kocmd[1024];
|
char kocmd[1024];
|
||||||
int i, mmufd = open("/dev/mmuhack", O_RDWR);
|
int i, mmufd;
|
||||||
|
|
||||||
if(mmufd < 0) {
|
/* some programs like some versions of gpSP use some weird version of mmuhack.o
|
||||||
strcpy(kocmd, "/sbin/insmod ");
|
* which doesn't seem to work. What's even worse they leave their mmuhack loaded on exit.
|
||||||
strncpy(kocmd+13, g_argv[0], 1023-13);
|
* So we must remove whatever may be left and always reload _our_ mmuhack.o */
|
||||||
kocmd[1023] = 0;
|
system("/sbin/rmmod mmuhack");
|
||||||
for (i = strlen(kocmd); i > 0; i--)
|
|
||||||
if (kocmd[i] == '/') { kocmd[i] = 0; break; }
|
strcpy(kocmd, "/sbin/insmod ");
|
||||||
strcat(kocmd, "/mmuhack.o");
|
strncpy(kocmd+13, g_argv[0], 1023-13);
|
||||||
|
kocmd[1023] = 0;
|
||||||
|
for (i = strlen(kocmd); i > 0; i--)
|
||||||
|
if (kocmd[i] == '/') { kocmd[i] = 0; break; }
|
||||||
|
strcat(kocmd, "/mmuhack.o");
|
||||||
|
|
||||||
|
printf("Installing NK's kernel module for Squidge MMU Hack (%s)...\n", kocmd);
|
||||||
|
system(kocmd);
|
||||||
|
mmufd = open("/dev/mmuhack", O_RDWR);
|
||||||
|
|
||||||
printf("Installing NK's kernel module for Squidge MMU Hack (%s)...\n", kocmd);
|
|
||||||
system(kocmd);
|
|
||||||
mmufd = open("/dev/mmuhack", O_RDWR);
|
|
||||||
}
|
|
||||||
if(mmufd < 0) return 0;
|
if(mmufd < 0) return 0;
|
||||||
|
|
||||||
close(mmufd);
|
close(mmufd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue