Files
rc2014-sid/sid.4th

18 lines
568 B
Forth
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
\ 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