Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!evax!cs4344af From: cs4344af@evax.arl.utexas.edu (Fuzzy Fox) Newsgroups: comp.sys.cbm Subject: Re: random numbers in ML Message-ID: <1990Dec3.072647.28822@evax.arl.utexas.edu> Date: 3 Dec 90 07:26:47 GMT References: <6389@minyos.xx.rmit.oz.au> Distribution: comp Organization: Computer Science Engineering Univ. of Texas at Arlington Lines: 27 In article <6389@minyos.xx.rmit.oz.au> s887212@minyos.xx.rmit.oz.au (Stephen Riehm [Romulis]) writes: >According to some books I have it IS POSSIBLE to use the >oscillator for the third voice... While I don't have any specific code to show you, you should be able to generate random numbers with the following setup... Set the frequency on Voice 3 of the SID to a very high value (like $FFFF). Then turn on Voice 3 using the Noise waveform. If you don't want to hear the voice, either turn on the "silence voice 3" bit, or set the volume to zero. However, the oscillator will still oscillate randomly, and you should be able to pick up its waveform samplings by reading the oscillator output at $D41B. Here's some untested code written from the above: INIT: LDA #$FF STA $D40E STA $D40F LDA #$80 STA $D412 LDA #$8F ; Volume = 15, but no voice 3 output STA $D418 RTS RAND: LDA $D41B RTS ; Random number returned in A.