CamelForth SID init and test

This commit is contained in:
2025-11-06 20:10:48 +00:00
parent 760475f22d
commit a981e8ba74

17
sid.4th Normal file
View File

@@ -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