| |
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.... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11108 |
you should definately post that kind of stuff on the vice bugtracker. yes resid is maintained :) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1378 |
Thanks Groepaz, I'll shrink my test code a little and get on it. |
| |
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. :) |
| |
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 :) |
| |
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 |
| |
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) |
| |
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. |
| |
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. |
| |
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. |
| |
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 |