OSDN Git Service

runtime shell script added. version 0.90 release motonesemu-0.9.0
authorastoria-d <astoria-d@mail.goo.ne.jp>
Thu, 25 Apr 2013 05:49:17 +0000 (14:49 +0900)
committerastoria-d <astoria-d@mail.goo.ne.jp>
Thu, 25 Apr 2013 05:49:17 +0000 (14:49 +0900)
Makefile
bin/nesemu [new file with mode: 0755]
install.sh
libs/vgashm.c

index 3f1e415..a1c90d4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,5 +16,5 @@ clean:
        for dir in $(DIRS); do \
                make -C $$dir clean; \
        done
-       rm -rf bin
+       rm bin/motonesemu bin/vgadisp bin/famicon-controller.jpg
 
diff --git a/bin/nesemu b/bin/nesemu
new file mode 100755 (executable)
index 0000000..3c2d159
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+if [ ! -e vgadisp ] ; then
+    echo vgadisp command not found!
+    exit -1
+fi
+
+if [ ! -e motonesemu ] ; then
+    echo motonesemu command not found!
+    exit -2
+fi
+
+./vgadisp &
+vga_pid="$!"
+
+echo -e "\n\n\n\nWelcome to MOTO NES EMULATOR"
+echo -e "\n\n\n\n       .....press ctl-C to terminate emulator.\n\n\n\n"
+./motonesemu $1
+
+#clean up
+#echo vga: $vga_pid
+
+kill $vga_pid
+
+ipcs -m -p > ipclist
+#cat ipclist
+
+shmid=$(awk "{     if (\$3 == $vga_pid)    print \$1}" < ipclist)
+#echo shmid: $shmid
+rm ipclist
+ipcrm -m $shmid
+
+
index fcc7b6e..61eb5b5 100755 (executable)
@@ -1,6 +1,5 @@
 #!/bin/bash
 
-test ! -e bin && mkdir bin
 cp emulator/motonesemu bin/
 cp display/vgadisp bin/
 cp emulator/joypad/famicon-controller.jpg bin/
index 3312c75..07e0505 100644 (file)
@@ -30,6 +30,7 @@ void *vga_shm_get(void) {
             return NULL;
         }
     }
+    //printf("shmid:%d\n", shmid);
 
     /* Attach (map) the shared memory segment into the current process */
     if((ret = shmat(shmid, 0, 0)) == (void*)-1)