diff --git a/system/ps2_keyboard.s65 b/system/ps2_keyboard.s65 index 880357f..9736af0 100644 --- a/system/ps2_keyboard.s65 +++ b/system/ps2_keyboard.s65 @@ -293,18 +293,20 @@ scancode_handler: .res 2 ; pointer to a function that handles new scancod _DisableClock ; set shift register to output + ; shift out the startbit = data low + ; set SR to shift out with PHI2 and shift out zeros lda ps2kb::VIA + IO::ACR and #<~IO::ACR_MASK::SR - ora #IO::ACR::SR_SOUT_PHIE + ora #IO::ACR::SR_SOUT_PHI2 sta ps2kb::VIA + IO::ACR stz ps2kb::VIA + IO::SR - ; shift out the startbit = data low - _EnableClock - _DisableClock + ; reset shift register to start the count at 0 again - lda #IO::ACR::SR_SOUT_PHIE - trb ps2kb::VIA + IO::ACR - tsb ps2kb::VIA + IO::ACR + and #<~IO::ACR_MASK::SR + sta ps2kb::VIA + IO::ACR + ; set SR to shift out with external clock + ora #IO::ACR::SR_SOUT_PHIE + sta ps2kb::VIA + IO::ACR ; setup the low timer byte lda #