OSDN Git Service

joypad read func bug fixed
authorastoria-d <astoria-d@mail.goo.ne.jp>
Thu, 25 Apr 2013 04:12:11 +0000 (13:12 +0900)
committerastoria-d <astoria-d@mail.goo.ne.jp>
Thu, 25 Apr 2013 04:12:11 +0000 (13:12 +0900)
emulator/joypad.c

index b0e9be4..f3cb0d5 100644 (file)
@@ -47,7 +47,7 @@ void set_joypad_data(unsigned char data) {
 unsigned char get_joypad_data(void) {
     unsigned char data;
     jp_reg.r.button_data = get_button(jp_reg.read_cnt++);
-    memcpy(&data, &jp_reg.w, sizeof(unsigned char));
+    memcpy(&data, &jp_reg.r, sizeof(unsigned char));
     //dprint("get joypad data(%d) %d\n", jp_reg.read_cnt, data);
     return data;
 }