| |
ready.
Registered: Feb 2003 Posts: 441 |
SID output analisys
I put this into coding since in my opinion the topic is more coder concerning, rather than composer.
Let's say I have a tune playing, normal interrupt implemented and I want to know what's going on inside the SID to use this info to sync demo effects with the music.
There's the 3rd voice output, ok, but this is not enough. I tried to do the following:
jsr music_call
lda $d400
sta var1
lda $d401
sta var2
....
....
So I stored the SID registers in a serie of variables at every music_call (50Hz). But I don't get much, the values seem not to change much for a while, then they suddenly change and then stay the same for some more.
I also read that except for the last 4, SID registers are write-only. Is there the problem?
So how do certain coders manage to do players like Cubic Player or Amazing Player? Well, Cubic Player is maybe even too much, since I don't need spectrum analisys, I just want something of what the SID is doing in each voice.
thanx
Ready. |
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
you can not read registers like that. you can only read the waveform and adsr output of the 3rd channel, this two has 2 dedicated registers.
you have 2 options(others will bring up more:)
1. you turn on d000 ram, and call the player like that. then you can read the values from ram, and write them back to the sid regs afterwards. but this will distort the player's output. (mostly noticable to music people, or at specific players)
2. you recode all sta $d400 (generally any sid write) to jsr someroutine, where someroutine can store the value and then update the sid register. cubic player does this, it automatically recodes every player. |
| |
The Syndrom
Registered: Aug 2005 Posts: 59 |
I'd suggest method 1, and if you take care of storing the values well ordered (freq + pulse first, then adsr, and wave-register last), nothing will get distorted. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
first method will actually not work with a bunch of players (those who store registers more than once in a frame, and possibly in different order each frame). the other method will always work =) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
oh my how many debates did we have already about this? atleast I'm glad noone could find an error in my suggestions ;) |
| |
ready.
Registered: Feb 2003 Posts: 441 |
Thanx people!!! I looked in old CSDb forums, but I could not find anything about it.
But, using VICE, I can read something from write-only SID registers...so what is that value? It also changes from time to time, so it's surely not $d000 RAM. Any idea?
Ready. |
| |
Inge
Registered: Nov 2003 Posts: 144 |
As Groepaz stated, method two will always work. By changing some STA $D400/01/04 to JSR you can catch the SID-values before they are set.
Here is an example of how I visualize the tunes: http://home.c2i.net/ingehp/matunes1.zip |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
@ready:
The value you are reading is the value that was last written to sid (no matter what register), if I remember correctly. |
| |
ready.
Registered: Feb 2003 Posts: 441 |
Frantic: it makes sense, since all write-only adresses have the same value, exactly the last written one. Interesting. |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
Get a tool where it will play the music normally but will show you the player memory live. It also helps if it has super slow playback functions. Watch for patterns at about the right time. I wouldn't bother with watching SID or RAM under SID but watch/read the player code memory. You may need to process the player data like the player as sometimes there can be 1 or 2 frame desync but you'll eventually get there. That way you can synch on particular patterns, instruments, tune repeat etc. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
@strykker: I do the same. poke $d011,#$45 is a classic for tunes at $1000-
|
... 2 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 - Next |