Open RupertAvery opened 5 years ago
Key presses are handled by the ET-3400 software (Monitor ROM). Keypress detection is not buffered and goes through a software "debounce" i.e. it loops for a few cycles and checks that the key is still pressed. If you slow down the CPU, keypress detection also slows down and so you have to hold the key down much longer.
I was surprised at the "not a bug" classification. The problem is understood and hard to fix, but seems like a big problem -- Normal operation, trying to make the emulator the same speed as the real device, and then clicking on the emulator key gives no response. Dead end. Holding it down for a longer time is not an obvious workaround.
In v1.0.7 Beta 2 I ran into this problem with all default settings and the first thing I tried -- Load RAM, samp123a.s19, click on "DO" (it saw this OK), click on "0" and it appears to not see my mouse clicks. Pressing the "0" key on my keyboard has the same problem. I can see it activating the "0" key in the emulator window, but it doesn't register in the emulator display until I hold down the keyboard key awhile.
Another addition: The title of the issue "set below 20%" no longer applies since it happens at the default 100% setting. Also of note: After writing all the above and playing with the speed setting, I only just now noticed the explanation "Setting the frequency below 70 kHz..." in the window. It explains things well, but I hadn't noticed it until now. Suggestion: If the problem can't be fixed, change the default setting to about 150%. At lease on my PC that is a nice trade-off between execution speed (too fast) and key response (usually works fine). I'd rather have it execute too fast than miss my mouse clicks and key presses. I would guess most users when they first use the emulator are developing new programs and don't care as much about execution speed matching the real device.
With default 100% clock speed, load samp123a.s19 and DO 0000. See the moving single segment. As it runs, slow clock speed to 20%. It slows down, good. Press the emulator RESET key and see CPU uP. Press "DO" and nothing happens. "Reset" the speed to 100% and press "DO". Then it works and shows " do.".