Author Topic: How to detect SID if is present?  (Read 447 times)

0 Members and 1 Guest are viewing this topic.

Offline MIRKOSOFT

  • C128 user
  • ******
  • Posts: 809
  • Age: 33
  • Location: Zvolen
  • Activity:
    4.8%
  • Country: sk
  • Reputation: 188
  • Gender: Male
  • C128 programmer
  • With us since: 13/02/2009
    YearsYearsYearsYears
    • View Profile
    • MIRKOSOFT
How to detect SID if is present?
« on: January 21, 2012, 08:01 PM »
Hi!

I know how to detect SID chip type.

It works also when is SID not present but type is not true (out of motherboard or other).

Can explain me anybody how to check if is SID present?

Many many thanks for every help, reply or comments.

Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster, more intelligent and more powerful... is targetted to programmation...

64ever 128her
sixty-for-ever one-twenty-either

C128 = C64² + more

http://www.mirkosoft.sk

Offline Hydrophilic

  • 128D user
  • *******
  • Posts: 1225
  • Age: 41
  • Location: Earth... still!
  • Activity:
    2.2%
  • Reputation: 232
  • Gender: Male
  • With us since: 25/01/2007
    YearsYearsYearsYearsYearsYears
    • View Profile
    • H2Obsesson
Re: How to detect SID if is present?
« Reply #1 on: January 22, 2012, 05:59 PM »
You sure ask some strange questions!  I mean, it seams if you can determine the type of chip (6581/8580) then simple detection should be simple... Anyway, here is what I would do
 
Code: [Select]
sid = $d700 ;example SID base address
LDA #<sid
LDX #>sid
STA $FE ;any old zero-page address for pointer
STX $FF
LDA #0 ;reset value
LDY #7*2 ;start of voice 3 (frequency registers)
STA ($FE),Y ; voice 3 freq. low
INY
STA ($FE),Y ; voice 3 freq. high
INY
STA ($FE),Y ; voice 3 pulse-width low
INY
STA ($FE),Y; voice 3 pulse-width high
INY
LDA #$41 ;gate voice, pulse waveform
STA ($FE),Y ; gate voice 3
 
LDY #$1B ;voice 3 oscillator read-only register
LDA #$FF ;inversion of $00
CMP ($FE),Y
BNE no_sid
 
LDY #7*2+3 ;voice 3 pulse-width high
STA ($FE),Y ;set to $FF
LDY #$1B ;voice 3 oscillator read-only register
LDA ($FE),Y ;test inversion of $FF (test $00)
BNE no_sid
 
;SID present!

I have tried this in VICE with and without stereo SID.  I also tested against VICE with normal SID and my real C128.  All that works okay, but I do not have a real stereo SID to test.
 
I hope that helps!
 
Edit
I attached the test program.  From MONITOR enter J1300.  If SID is present, nothing happens.  If SID is missing, then border will flash and you have to press STOP.
« Last Edit: January 22, 2012, 06:07 PM by Hydrophilic »
I'm kupo for kupo nuts!

Offline MIRKOSOFT

  • C128 user
  • ******
  • Posts: 809
  • Age: 33
  • Location: Zvolen
  • Activity:
    4.8%
  • Country: sk
  • Reputation: 188
  • Gender: Male
  • C128 programmer
  • With us since: 13/02/2009
    YearsYearsYearsYears
    • View Profile
    • MIRKOSOFT
Re: How to detect SID if is present?
« Reply #2 on: January 22, 2012, 09:37 PM »
Hi Robert!

Thank you very much for source & program.... works correctly...

Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster, more intelligent and more powerful... is targetted to programmation...

64ever 128her
sixty-for-ever one-twenty-either

C128 = C64² + more

http://www.mirkosoft.sk

 



Back to top