Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > resetting the SID
2011-07-02 23:32
ThunderBlade

Registered: Jan 2002
Posts: 78
resetting the SID

Hi, not sure if this is an awkward question, but... what's the proper way to reset the SID?

When starting various musics, I sometimes, very rarely, notice they sound different like all the other times. It seems to depend which music I played previously!

Inbetween playing musics, currently I just fill $D400 - $D418 with a counting down loop (starting with $D418) with zeroes. Is there a recommended better way?
 
... 44 posts hidden. Click here to view all posts....
 
2011-07-03 18:41
ThunderBlade

Registered: Jan 2002
Posts: 78
Thank you for the hints, yes it's different play routines. I will try the suggested solutions.
2011-07-03 18:49
Frantic

Registered: Mar 2003
Posts: 1661
I haven't really experimented with, or thought closely about, how to reset the sid in the best possible way, but...

Filter regs, frequency regs, and pulse width regs should simply be set to 00.

I would first set ADSR regs to 00, then set the control registers to $08 to set gate off and turn oscillators off (what Jeff suggested, sort of). Then you should preferably wait for a while (2-3 frames should be completely safe) to make sure that the internal ADSR counters are reset properly.

...and finally, if everything is silent when you try to play your tune, just set global sid volume to $0f before initializing the tune. (The tune init routine really should take care of this itself though, so I guess you won't ever need that.)

2011-07-03 19:57
iAN CooG

Registered: May 2002
Posts: 3238
or even $1f as probably is best for most tunes, happened also that some tunes lacked a proper init (yes there are) and setting $0f would make the tune play with one voice muted =)
2011-07-03 20:09
j0x

Registered: Mar 2004
Posts: 215
ian: Am I somehow misunderstanding your post? To me, $0f should be the correct value. Adding $10 just enables the low-pass filter. Are you mixing up bits 3 and 7 here?
2011-07-03 20:28
Frantic

Registered: Mar 2003
Posts: 1661
j0x: I thought just the same.. I think Ian got something wrong here..
2011-07-03 20:28
iAN CooG

Registered: May 2002
Posts: 3238
jox: no, many tunes with muted voices were fixed by setting $1f instead of $0f. I've done quite a bunch of them in the lastest HVSC updates.
one of the many examples
# from iAN CooG: Restored $d418 setting, bassline now it's audible.
/update/fix/MUSICIANS/C/Coolrock/Commercial_Music_3.sid
/MUSICIANS/C/Coolrock/

if you remove the sta $d418 like it was before, sidplay defaults to lda #$0f sta $d418 before jmping to the init. and the bassline is not audible anymore. there were plenty, just check the hvsc updates =)
2011-07-03 20:46
iAN CooG

Registered: May 2002
Posts: 3238
another example
/MUSICIANS/S/Simon_Laszlo/So_Hard.sid
change the lda #$1f sta $d418 to $0f like it was before and hear.
2011-07-03 20:49
Frantic

Registered: Mar 2003
Posts: 1661
Probably enabling the filter for some voice(s) but not selecting any filter type results in silence then.. I guess. Never tried that I think. At least not that I can remember. ...but then this it is not necessarily correct to select low pass filter. It could just as well have been some other type of filter in the original tune, even though low pass filter is probably most common.
2011-07-03 21:02
iAN CooG

Registered: May 2002
Posts: 3238
search for a9 1f 8d 18 d4: 10489 sid files found
search for a9 0f 8d 18 d4: 3987 sid files found
not so uncommon, and i don't want to search for DMC tunes that set d418 in an indirect way =)
2011-07-03 23:07
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
ldx #$1d
lda #0
.sta $d400,x
dex
bpl .
rts
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
AlexC
rime/Fancy Rats
Hok/Remember
Airwolf/F4CG
REBEL 1/HF
RaveGuru/Booze Design
iceout/Avatar/HF
Guests online: 310
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Stinsen  (9.7)
4 LMan  (9.7)
5 Linus  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.074 sec.