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....
 
2021-06-03 07:06
Flavioweb

Registered: Nov 2011
Posts: 466
But... what does "proper" really mean?
Reset Sid as it is on machine power up, or what?
I guess after power up all internal regs are set to $FF except $D418 that kernal put at $00 during startup...
2021-06-03 12:38
chatGPZ

Registered: Dec 2001
Posts: 11510
by "properly" i was referring to clean "by the book" code that only writes exactly the values needed only to the registers that require it.
2021-06-03 12:49
Flavioweb

Registered: Nov 2011
Posts: 466
Quote: by "properly" i was referring to clean "by the book" code that only writes exactly the values needed only to the registers that require it.

Ok.
But musicians out there start composing from an "after power up" state and not from a "by the book" Sid setup.
Some examples have been given, including "Cybernoid", so i guess the goal is "how to make play already made tunes same way, everywhere".
Maybe a "by the book" setup make "power up setup" tunes sound different.
Anyway, if is it, this mean that some tunes out there have no proper self Sid Setup code.
2021-06-03 13:56
chatGPZ

Registered: Dec 2001
Posts: 11510
You lost it - both would reset the SID the same way, just the code to do it would be different.
2021-06-03 14:12
TheRyk

Registered: Mar 2009
Posts: 2468
Quoting Flavioweb
some tunes out there have no proper self Sid Setup code.

varies a lot of course.

As you can already seen by nowadays
LDA #$SUBTUNE No.
JSR $INIT

being perfectly fine for Goattracker, whereas
TAX
TAY

before the JSR $INIT makes it more universal as older players expect X and/or Y regs set.

Slightly offtopic of course, so what has this to do with anything? Well, it's an example why not to rely on .SID-file immanent Init routine doing the I/O init job for you, especially if tunes are done with older or exotic trackers.
2021-06-03 18:47
iAN CooG

Registered: May 2002
Posts: 3236
TheRyk: that is the tune init, to init its internal counters, especially to restart playing it from pattern 0, and doesn't have anything to do with SID chip regs init. Also not all inits require A, X or Y, some just require some value stored in some address, it only depends on the tracker used.
Then, the tune init isn't even guaranteed to set all SID chip regs correctly and could rely on a SID chip just as it is at power up. There are TOO MANY sid files and each is made in its own special way =)
The typical problem is on cracks, or multipart demos made with different single parts linked together. After an intro played some music, then the next part sounds weird/wrong/not at all.
Reiniting manually the sid registers before starting the next tune is the only way.
2024-06-29 11:12
ThunderBlade

Registered: Jan 2002
Posts: 78
Quote: by "properly" i was referring to clean "by the book" code that only writes exactly the values needed only to the registers that require it.

Do we have this code? If so I suggest we put it on Codebase?
2024-06-29 13:16
Jammer

Registered: Nov 2002
Posts: 1343
Putting certain values above $81 to waveform register, e.g. $91, followed by testbit in the subsequent frame resets noise random seed - that's a little neat thing used by GRG, me and surely other musicians as well. It might come handy in CSDb music compo to be launched very soonish ;)
2024-06-29 16:04
chatGPZ

Registered: Dec 2001
Posts: 11510
Quote:
Do we have this code? If so I suggest we put it on Codebase?

For those rare cases when it is really super important to reset the SID completely in all aspects, i suggest something like #22 - plus explicit noise LFSR reset (which you can steal from some VICE test program, or the SID detection in some recent censor demo :))
2024-07-02 02:14
algorithm

Registered: May 2002
Posts: 707
When writing to the waveform register after the c64 is turned on initially (e.g $71,$21,$11,$41) - The output with frequency set to zero is $00,$55,$aa,$ff. Some demos which utilise d404 for digi playback (censor stuff) as well as just 2bit d404 digi's will need specific values. (Setting testbit to initialise sid will clear these all) and may be an issue for some stuff that does not initialise and seek/stop to get the waveforms back to the correct phase
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
codise
Case/Padua
Martin Piper
Oxbow/Xenon
Guests online: 152
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 Graphicians
1 Mirage  (9.7)
2 Archmage  (9.7)
3 Sulevi  (9.6)
4 Pal  (9.6)
5 Hein  (9.6)

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