| www.retrosoftware.co.uk http://www.retrosoftware.co.uk/forum/ |
|
| BeebSID - detecting its presence. http://www.retrosoftware.co.uk/forum/viewtopic.php?f=73&t=712 |
Page 1 of 1 |
| Author: | PitfallJ [ Wed Dec 14, 2011 11:38 am ] |
| Post subject: | BeebSID - detecting its presence. |
Hi, Is there a code test I can use to know if BeeSID is present? I'd like to make a program that plays BeebSID music or normal BBC music depending on if it thinks it's there. Thanks PJ |
|
| Author: | MartinB [ Wed Dec 14, 2011 11:02 pm ] |
| Post subject: | Re: BeebSID - detecting its presence. |
Hi PJ Yes, you can use Register 27 ($1B). Referring to the text below, I suggest you set Voice 3 to 'Noise' and then read a few samples of R27 - a changing number means BeebSID is present whereas in the absence of the latter, you would get a fixed value. I deliberately picked a base address and I/O map for BeebSID that is only otherwise used by some very scarce hardware so there wouldn't be any risk of confusion. "Register 27 allows the microprocessor to read the upper 8 output bits of Oscillator 3. The character of the numbers generated is directly related to the waveform selected. If the Sawtooth waveform of Oscillator 3 is selected, this register will present a series of numbers incrementing from 0 to 255 ($FF) at a rate determined by the frequency of Oscillator 3. If the Triangle waveform is selected, the output will increment from 0 up to 255, then decrement down to 0. If the Pulse waveform is selected, the output will jump between 0 and 255. Selecting the Noise waveform will produce a series of random numbers, therefore, this register can be used as a random number generator for games." |
|
| Author: | PitfallJ [ Sat Jan 07, 2012 7:31 pm ] |
| Post subject: | Re: BeebSID - detecting its presence. |
Sorry for the slow reply - I got side tracked over the last month. That works a treat! - I've made a little demo program and once I've finished it I'll post the code. It seems very useful besides - not only as a quick random number generator but in a way it digitizes the sound stream for you (strange it only does it for channel 3) - you could use it to make a spectrum analyzer! Thanks! - PJ |
|
| Page 1 of 1 | All times are UTC [ DST ] |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|