It is currently Mon Oct 20, 2014 5:23 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Dec 14, 2011 11:38 am 
Offline
 Profile

Joined: Fri Nov 07, 2008 2:28 pm
Posts: 65
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


Top
 
PostPosted: Wed Dec 14, 2011 11:02 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
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."


Top
 
PostPosted: Sat Jan 07, 2012 7:31 pm 
Offline
 Profile

Joined: Fri Nov 07, 2008 2:28 pm
Posts: 65
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


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron