OSDN Git Service

status reg bug fix
authorU-ASIAPACIFIC\motooka <motooka@MOTOOKA2.asiapacific.hpqcorp.net>
Fri, 26 Feb 2016 10:44:27 +0000 (19:44 +0900)
committerU-ASIAPACIFIC\motooka <motooka@MOTOOKA2.asiapacific.hpqcorp.net>
Fri, 26 Feb 2016 10:44:27 +0000 (19:44 +0900)
emulator/6502core.c

index 90261b3..6dce2a5 100644 (file)
@@ -1812,10 +1812,6 @@ int func_PHP(void) {
     int done = FALSE;
     unsigned char st;
     memcpy(&st, &cpu_reg.status, sizeof(struct status_reg));
-    /* researved bit always 1*/
-    cpu_reg.status.researved = 1;
-    /* decimal always 0*/
-    cpu_reg.status.decimal = 0;
     ret = push_op(st, &done);
     exec_done = done;
     return ret;
@@ -1876,6 +1872,10 @@ int func_PLP(void) {
         st = get_cpu_data_buf();
         memcpy(&cpu_reg.status, &st, sizeof(struct status_reg));
     }
+    /* researved bit always 1*/
+    cpu_reg.status.researved = 1;
+    /* decimal always 0*/
+    cpu_reg.status.decimal = 0;
     exec_done = done;
     return ret;
 }