Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Harvey ! (Registered 2024-11-25) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > How do I reliably detect 6581/8580 sid?
2006-08-22 14:18
tlr

Registered: Sep 2003
Posts: 1787
How do I reliably detect 6581/8580 sid?

There was an article in C=Hacking, but that does not work very well in VICE for example.
Maybe VICE's emulation is borked though.

I remember seeing a detailed analysis of the waveforms somewhere, but I can't seem to find it now.
 
... 47 posts hidden. Click here to view all posts....
 
2010-10-01 16:51
Hein

Registered: Apr 2004
Posts: 946
What's the idea behind that? Reading a write-only register seems odd. (If it works, it works, though)
2010-10-01 17:43
MC
Account closed

Registered: Jul 2009
Posts: 71
It does actually work so far (on VICE). Good stuff there from iAN CooG. Muchos gracias.
2010-10-01 18:11
iAN CooG

Registered: May 2002
Posts: 3187
of course must be tested against a real c64 before saying it's correct, it could be even that hoxs has already the correct behaviour =)
All I know is that years ago I noticed that Excalibur intro exc-01 was polling $d418 to know when the intro was about to close, because after pressing space the volume fadeout routine set volume to 0. Strangely the intro immediately exited by itself both in CCS 2.0 and Vice with fastsid, and only worked in vice+resid.
2010-10-01 19:07
MC
Account closed

Registered: Jul 2009
Posts: 71
In CCS V3.8 the code finds resid (03) instead of CCS. Does CCS 3.8 actually utilize resid? I can't find the info on the ccs site.

2010-10-01 19:30
iAN CooG

Registered: May 2002
Posts: 3187
it doesn't use resid, ccs3 must be just "more accurate" than ccs2.0, which is the one i tested, and produces a similar result to vice resid. maybe by comparing results of location $0400/$0401 there is a chance to separate resid from ccs3, feel free to enhance the detection code :P
2010-10-02 08:11
Frantic

Registered: Mar 2003
Posts: 1647
Hmm.. funny. I will have a look on this some day.

As far as I remeber you can actually read sid registers in the sense that the value that was last written to the sid can be read back least within a certain time span. So.. While the sid registers aren't generally "readable", they can be sometimes, so to speak..
2010-10-02 10:42
MC
Account closed

Registered: Jul 2009
Posts: 71
; Emulation SID recognition table (responses from iAN CooG's test routine)
;
;    C4:03:00	VICE + RESID 6581
; BC/CF:03:00	VICE + RESID 8580
;    05:00:00	VICE + FASTSID (gets unreliable SID type from ANY testing)
;    D7:07:00	VICE + RESIDFP 6581
; DF/CA:07:00	VICE + RESIDFP 8580
;
;    XX:CC:01	HOXS (Emulates an 8580 always)
;
;    98:03:00	CCS3.X 6581
; A0/8A:03:00	CCS3.x 8580
;    1F:01:00	CCS2.x 6581
; 0F/14:01:00	CCS2.x 8580
;
; 7D-8F:00:00	Real C64 6581
; ???		Real C64 8580


TESTED WITH INTERRUPTS DISABLED (so enable that sei)

Can someone with a real 8580 get me a result please?
iAN (or anyone who feels like it) could you confirm these tests please, I ran it several times on every emulator with every setting and the results SEEM to be conclusive.

Cheers, Marco

2010-10-02 10:54
Frantic

Registered: Mar 2003
Posts: 1647
@MC: While it is nice to know how to check for various things, I get curious about what you will use this for? Will you make custom filter tables to make the tunes sound as similar as possible on different SID models and SID-emulation engines, or what?
2010-10-02 12:20
MC
Account closed

Registered: Jul 2009
Posts: 71
Exactly.
2010-10-02 12:27
iAN CooG

Registered: May 2002
Posts: 3187
ok, here's a new version =)
; Detect fastSID/reSID/reSID-fp/Hoxs/CCS/Frodo
; Just measure how much $d418 takes to decay from $1f to $00
; Experiment by iAN CooG, noticed first time in Excalibur intro exc-01
; Thanks to MC/Dutch USA-Team for checking CCS3 and real C64 timings
; Note: can't detect emulated sidmodel 6581/8580, values overlap.
; values   | Engine
; ---------+--------
; xx xx 01 | hoxs     (1cc00-)
; xx 07 00 | residfp  (7ca-7df)
; bx 03 00 | resid    (3bc-3cf)
; 8x 03 00 | ccs3     (38a-3a0)
; xx 01 00 | ccs2     (10f-11f)
; 7x 00 00 | real c64 (07d-08f)
; 0x 00 00 | fastsid  (003-005)
; 01 00 00 | vice nosound (001)
; ff ff ff | frodo    (never decays)

_id_hoxs     = 0
_id_residfp  = 1
_id_resid    = 2
_id_ccs3     = 3
_id_ccs2     = 4
_id_realc64  = 5
_id_fastsid  = 6
_id_nosound  = 7
_id_frodo    = 8

    *=$0801
    word eop
    word 7102
    byte $9e,"2059"
eop byte 0

    lda #0
    sta $0400
    sta $0401
    sta $0402

    sei
    lda #$1f
    sta $d418
loop
    inc $0400
    bne nohi
    inc $0401
    bne nohi
    inc $0402
    lda $0402
    cmp #$02
    beq check ; or directly: beq frodo
nohi
    lda $d418
    bne loop
check
    lda $0402
    beq vice
    cmp #$02
    beq frodo
    bne hoxs
vice
    lda $0401
    bne chkrs
    lda $0400
    cmp #$70
    bcs realc64
    cmp #$03
    bcs fastsid
    bcc nosound
chkrs
    cmp #$04
    bcs residfp
    cmp #$03
    bcc ccs2
rscc3
    lda $0400
    cmp #$b0
    bcs resid
ccs3
    ldx #_id_ccs3
    byte $2c
ccs2
    ldx #_id_ccs2
    byte $2c
resid
    ldx #_id_resid
    byte $2c
residfp
    ldx #_id_residfp
    byte $2c
fastsid
    ldx #_id_fastsid
    byte $2c
nosound
    ldx #_id_nosound
    byte $2c
hoxs
    ldx #_id_hoxs
    byte $2c
frodo
    ldx #_id_frodo
    byte $2c
realc64
    ldx #_id_realc64
    lda offtablel,x
    ldy #>stringtable
    ;cli ($ffd2 already clears int flag)
    jmp $ab1e

stringtable
shoxs     byte "HOXS64"  ,0
sresidfp  byte "RESID-FP",0
sresid    byte "RESID"   ,0
sccs3     byte "CCS 3"   ,0
sccs2     byte "CCS 2"   ,0
srealc64  byte "REAL C64",0
sfastsid  byte "FASTSID" ,0
snosound  byte "NO SOUND",0
sfrodo    byte "FRODO"   ,0

offtablel
          byte <shoxs
          byte <sresidfp
          byte <sresid
          byte <sccs3
          byte <sccs2
          byte <srealc64
          byte <sfastsid
          byte <snosound
          byte <sfrodo
Previous - 1 | 2 | 3 | 4 | 5 | 6 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Six/G★P
CopAss/Leader
lA-sTYLe/Quantum
Brataccas/HF
Xiny6581/Dees Produc..
Alakran_64
McMeatLoaf
Andy/AEG
Guests online: 74
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 The Demo Coder  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Wonderland XIV  (9.6)
10 Comaland 100%  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Triad  (9.2)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.044 sec.