diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-03-13 03:32:16 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-03-13 03:32:16 -0400 |
| commit | 5c3f9502bcda72dd4202a5a752441abcdf246ad1 (patch) | |
| tree | 3294cd6570520a4134b334f2b437d3b5f005c7f2 /src | |
| parent | cdc45d44b4d96d147cda026df283a9bb0fcb3018 (diff) | |
| download | fujinet-chat-5c3f9502bcda72dd4202a5a752441abcdf246ad1.tar.gz | |
Fix keyclick for real.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyclick.c | 8 | ||||
| -rw-r--r-- | src/keyclick.s | 49 |
2 files changed, 8 insertions, 49 deletions
diff --git a/src/keyclick.c b/src/keyclick.c new file mode 100644 index 0000000..d1e7505 --- /dev/null +++ b/src/keyclick.c @@ -0,0 +1,8 @@ +#include <atari.h> +#include <conio.h> + +/* sound the keyclick. obeys the NOCLIK flag on XL/XE. */ +void keyclick(void) { + OS.ch = 0; + cgetc(); +} diff --git a/src/keyclick.s b/src/keyclick.s deleted file mode 100644 index 3b4a591..0000000 --- a/src/keyclick.s +++ /dev/null @@ -1,49 +0,0 @@ - .include "atari.inc" - .export _keyclick - .import _cgetc - -; keyclick.s - just what you think it is. - -; How do you make it possible to disable the keyclick on the 400/800? -; Don't use the OS K: handler. - - ;.ifdef REAL_KEYCLICK - .if 1 - - ; used to my own STA WSYNC loop, but that didn't respect NOCLIK on - ; XL/XE machines. - lda #0 - sta CH - jsr _cgetc - rts - - .else - -; Fake keyclick. 25 bytes of code. Sounds just like the real one, but -; it won't mess up your DLIs because it's interruptible (though DLIs -; might mess it up). Loop timing assumes a GR.0 type display list -; with playfield DMA enabled and P/M DMA disabled. -; Preserves A, returns with X=$ff, Y=0, N set, Z clear. -_keyclick: -@wcount: - ldx VCOUNT ; To make the timing consistent, wait until we're sure - cpx #$10 ; that ANTIC is doing DMA. - bne @wcount - - ldx #$7f -@click: ; I tuned this by ear, then cycle-counted afterward. - stx CONSOL ; 4 - ldy #$07 ; 2 - ;lda #0 ; 2 - nop -@c1: - dey ; inner: 2 - nop ; 2 - bne @c1 ; 3 - ; 7 cycles/loop, *7 = 49, -1 for failed BNE - ; 48 - dex ; 2 - bpl @click ; 3 = 61 - rts - - .endif |
