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 > SID output analisys
2006-10-18 16:25
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.
2006-10-18 16:36
Oswald

Registered: Apr 2002
Posts: 5027
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.
2006-10-18 17:20
The Syndrom

Registered: Aug 2005
Posts: 56
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.
2006-10-18 18:10
chatGPZ

Registered: Dec 2001
Posts: 11145
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 =)
2006-10-18 18:36
Oswald

Registered: Apr 2002
Posts: 5027
oh my how many debates did we have already about this? atleast I'm glad noone could find an error in my suggestions ;)
2006-10-18 18:51
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.
2006-10-18 18:55
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
2006-10-18 19:02
Frantic

Registered: Mar 2003
Posts: 1629
@ready:
The value you are reading is the value that was last written to sid (no matter what register), if I remember correctly.
2006-10-18 19:36
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.
2006-10-18 23:45
Stryyker

Registered: Dec 2001
Posts: 465
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.
2006-10-19 08:28
JackAsser

Registered: Jun 2002
Posts: 1990
@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
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
Martin Piper
Guests online: 89
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Layers  (9.7)
2 It's More Fun to Com..  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Performers  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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