OSDN Git Service

[VM][PC9801][MOUSE] Set clock to 120Hz when resetting.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 16 May 2019 20:36:51 +0000 (05:36 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 16 May 2019 20:36:51 +0000 (05:36 +0900)
source/src/vm/pc9801/mouse.cpp

index e6ecd18..a2f2c22 100644 (file)
@@ -42,6 +42,12 @@ void MOUSE::reset()
 {
        dx = dy = 0;
        lx = ly = -1;
+       if(register_id >= 0) {
+               cancel_event(this, register_id);
+       }
+       register_event(this, EVENT_TIMER, 1000000.0 / 120.0, true, &register_id);
+       cur_freq = 0;
+       freq = 0;
 }
 
 #if !defined(SUPPORT_HIRESO)