summaryrefslogtreecommitdiff
path: root/src/wiz_mmuhack.c
diff options
context:
space:
mode:
authorToad King2012-06-14 03:21:06 -0400
committerToad King2012-06-14 03:21:06 -0400
commit6fb0c7a7a53e1eba7a0f5dc5b1ade312a0d76119 (patch)
tree885cf7f507139b795ba7b2a6fb829dc044da39dd /src/wiz_mmuhack.c
downloadsnes9x2002-6fb0c7a7a53e1eba7a0f5dc5b1ade312a0d76119.tar.gz
snes9x2002-6fb0c7a7a53e1eba7a0f5dc5b1ade312a0d76119.tar.bz2
snes9x2002-6fb0c7a7a53e1eba7a0f5dc5b1ade312a0d76119.zip
initial pocketsnes commit
Diffstat (limited to 'src/wiz_mmuhack.c')
-rw-r--r--src/wiz_mmuhack.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/wiz_mmuhack.c b/src/wiz_mmuhack.c
new file mode 100644
index 0000000..f2204d6
--- /dev/null
+++ b/src/wiz_mmuhack.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <linux/fb.h>
+#include <unistd.h>
+#include <stropts.h>
+#include <string.h>
+#include <errno.h>
+
+void wiz_mmuhack(int mem_fd)
+{
+ int mmufd = open("/dev/mmuhack", O_RDWR);
+
+
+ if(mmufd < 0) {
+ printf ("Installing NK's kernel module for Squidge MMU Hack...\n");
+ system("/sbin/insmod mmuhack.ko");
+ mmufd = open("/dev/mmuhack", O_RDWR);
+ }
+ if(mmufd < 0) return 0;
+
+ close(mmufd);
+ return 1;
+}
+