From a981e8ba7429890a84e7f81a085d6a6baa768356 Mon Sep 17 00:00:00 2001 From: Hexa Dust Date: Thu, 6 Nov 2025 20:10:48 +0000 Subject: [PATCH] CamelForth SID init and test --- sid.4th | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sid.4th diff --git a/sid.4th b/sid.4th new file mode 100644 index 0000000..29e8368 --- /dev/null +++ b/sid.4th @@ -0,0 +1,17 @@ +\ PS2!   c c p-addr --   Data byte (A), high address byte (B), port address (C) - OUT to port with A and B registers set +: PC2! SWAP >< OR PC! ; +\ SIDSEND c c -- Data value, register (0-31); bits 5,6 are for interrupt settings; bit 7 (/CS) is handled +: SIDSEND 2DUP 128 OR 84 PC2! 2DUP 127 AND 84 PC2! 128 OR 84 PC2! ; +\ SIDRST -- Reset SID chip +: SIDRST 0 24 SIDSEND 0 4 SIDSEND ; +: SIDTEST 15 24 SIDSEND 10 0 DO 255 0 DO I 1 SIDSEND LOOP LOOP 0 24 SIDSEND ; + +SIDRST +15 24 SIDSEND +0 5 SIDSEND +240 6 SIDSEND +17 4 SIDSEND + +SIDTEST + +