| |
Mace
Registered: May 2002 Posts: 1799 |
Writing twice to same $D4xx register?
Is there a useful purpose for writing twice to the same SID register with different values within one call of a player routine?
In other words: if I'd capture the output of a SID player routine to RAM and write that to the SID later, would that work?
Obviously, 'doubles' would be missed, then. |
|
| |
j0x
Registered: Mar 2004 Posts: 215 |
RanSID does this, and it works for many music players. However, as you say, doubles would be missed, e.g., setting and subsequently clearing the gate bit within the same player call. Also, the order of register writes would be missed (important for ADSR restart and general player "flavour"). |
| |
Mixer
Registered: Apr 2008 Posts: 422 |
In the past some players may have cleared gate in the beginning and set it on same call. Well, at least I made some without knowing any better.
Nowadays, I believe testbit restart sounds are the main reason for two or more writes to control register during one call.
There has been demo routines that have I/O off and later on collect sid values from RAM under I/O for later writing.
Anyway, if there is a replay of stored values, ADSR should be written before ctrl register, often these go hand in hand. Especially in hardrestarted or ADSR manipulated sounds.
Then there are the various sample play routines, which are altogether a different story. These require cycle exact sampling and replay of register values.
Is this about using Resid to play tunes? as a test, I've successfully played jsidplay-sid-dumps of single and multispeed tunes with resid, with no significant errors to original. Imho, important thing is to use same register write order(ctrl register vs. adsr) as in original. |
| |
JackAsser
Registered: Jun 2002 Posts: 1994 |
Quote: Is there a useful purpose for writing twice to the same SID register with different values within one call of a player routine?
In other words: if I'd capture the output of a SID player routine to RAM and write that to the SID later, would that work?
Obviously, 'doubles' would be missed, then.
Why not make a proper debugger, i.e. insert a BRK infront of the current instruction and have a ISR parse the instruction and determine the OP-code. It's quite easy to see if it would result in a write to $d4xx. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1381 |
Yes, there is frequently a useful purpose in writing twice. As others have said, blipping test bit is significant.
There's no hard and fast rule about the 'correct' ordering of ADSR vs gate, either - if a routine writes ctrl before ADSR but you play the writes back the other way round, you can easily jam the envelope for 30ms. |
| |
Mace
Registered: May 2002 Posts: 1799 |
The reason why I ask this is that I'd like to read the values written to $D4xx to make some sort of visual response to what is happening inside the SID.
In restrospect, I was aware of that ADSR thing. |
| |
theWizard Account closed
Registered: Jul 2007 Posts: 109 |
use a memory buffer delay write it to the sid also usefull if your sids actually under the d400 range or de00 to dfff, io1 and 2. |
| |
theWizard Account closed
Registered: Jul 2007 Posts: 109 |
Quote: The reason why I ask this is that I'd like to read the values written to $D4xx to make some sort of visual response to what is happening inside the SID.
In restrospect, I was aware of that ADSR thing.
ok like i said write to somewhere else in memory , read what you need to then direct it back to the sid.
example instead of
tya
sta $d4xx
..
tya
sta $40xx
read...
lda $40xx
sta $d4xx
etc or disable the sid , read it , enable the sid and write it which would be easier.
just do it from 0 to 1f in a loop but check for changed values only or it will sound a bit knackerd.
btw matey il tell you a trick , most players you can find locations where they activate each voice etc in the player its self , good for graphical effects in time to the voices and sounds its much easier the second way. |
| |
Rough Account closed
Registered: Feb 2002 Posts: 1829 |
Quote:btw matey il tell you a trick , most players you can find locations where they activate each voice etc in the player its self , good for graphical effects in time to the voices and sounds its much easier the second way.
Wow. Great trick. lol |
| |
theWizard Account closed
Registered: Jul 2007 Posts: 109 |
call me paul daniels blondie.lol |
| |
Rough Account closed
Registered: Feb 2002 Posts: 1829 |
Someone delete this lamer. He's starting to send illiterate mails to me.
"[picture of my csdb entry]
sup blondie =)
TROLOLOL!"
Don't need no moron stalking me. |