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: 75
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?
 
... 40 posts hidden. Click here to view all posts....
 
2011-07-09 22:23
chatGPZ

Registered: Dec 2001
Posts: 11108
you should definately post that kind of stuff on the vice bugtracker. yes resid is maintained :)
2011-07-12 19:02
ChristopherJam

Registered: Aug 2004
Posts: 1378
Thanks Groepaz, I'll shrink my test code a little and get on it.
2011-07-12 20:07
Frantic

Registered: Mar 2003
Posts: 1627
ChrisJam: Interesting. Even though your finding is related to ADSR envelope, could the "one cycle off" phenomenon possibly be related to the following (which is rather about the waveform oscillators than the ADSR envelope):

http://codebase64.org/doku.php?id=base:detecting_sid_type_-_saf..

?

If it is, then maybe you should take care to test whether the behavior is actually the same on 8580 as on 6581. I am not sure whether the "one cycle off" thing for waveform oscillators is emulated in resid now. (Apparently resid-fp does emulate it).

Nice to see you around btw. Still remember when you first turned up on one of the LCP parties and released that very nice demo with the escher zoomer etc. :)
2011-07-13 12:14
ChristopherJam

Registered: Aug 2004
Posts: 1378
Hmm, good point about SID revisions - according to the test code you posted I've been testing on a 6581, though I should probably open up the c64 in question to double check (I only just retrieved it from my stash in the cupboard last week :)

VICE shows the same 'wrong' behaviour regardless of whether I set it to a ReSID-fp 6581 or a ReSID-fp 8580.

Glad Effluvious made an impression :)
2021-06-01 15:48
Bacchus

Registered: Jan 2002
Posts: 154
Picking up this thread, can we agree this piece of code is the utter and complete SID init? It's basically the above but also optimised to minimise memory footprint.


sidinit:
lda #$00
ldx #$18 //00
!: sta $d400,x
dex
bpl !-

lda #$08
jsr sidset

ldx #$03
!: bit $d011
bpl *-3
bit $d011
bmi *-3
dex
bpl !-

lda #$00
sidset: sta $d404
sta $d40b
sta $d412
rts

/Bacchus
2021-06-01 16:01
chatGPZ

Registered: Dec 2001
Posts: 11108
For broken music players you want $1f in $d418. Also to really reset the noise lfsr, you gotta wait kindof long with testbit set (but thats probably not required for most things)
2021-06-01 19:30
Frantic

Registered: Mar 2003
Posts: 1627
@gpz: What constitutes a "broken music player" in this context, and why enable the lo pass filter? Looks strange to me, but I guess I am missing something obvious here.
2021-06-01 20:25
TheRyk

Registered: Mar 2009
Posts: 2062
I also tend to leave $D418 alone, normally, because older .SID files (done with ancient trackers, that's what gpz means I guess) can't deal with $d418 muted and (re-)setting $d418 ain't essential anyway, when $D400-$d417 are restted, unless you wanna do some good old $d418 samples on 6581 :)

For sure, it all depends on what you're aiming at. Most possible "universality" or 2020 modern approach that makes most sense.
2021-06-01 21:01
chatGPZ

Registered: Dec 2001
Posts: 11108
Frantic: see ians comment above (#8). It seems to work best :) There are a bunch of old players that dont init "enough", and with those $1f in $d418 is often what seems right.
2021-06-01 23:18
Frantic

Registered: Mar 2003
Posts: 1627
Ah.. haha.. thanks gpz. Amusing to see that I was involved in the discussion you refer to in those old posts too, and even kind of asked the same question. Memory is short I suppose. At least mine. :)
Previous - 1 | 2 | 3 | 4 | 5 - 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
zscs
Durandal
Guests online: 101
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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