New demo uploaded: Off The Floor (music demo)
- kliepatsch
- Posts: 247
- Joined: Thu Oct 08, 2020 9:54 pm
New demo uploaded: Off The Floor (music demo)
Wow, the audio debugger views are indeed awesome in Box16!
And it's healthy to know that Concerto doesn't work properly with -ymstrict enabled. Even though I have put much thought into how to limit communication with the YM2151, it might require more work to fix it.
Edit: found the issue. I have attached another patch that works in Box16 even with -ymstrict enabled (i.e., the real behavior of the YM2151 being "busy" after writing a byte is emulated).
OFFTFL392.PRG
New demo uploaded: Off The Floor (music demo)
On 11/15/2021 at 2:03 PM, kliepatsch said:
And it's healthy to know that Concerto doesn't work properly with -ymstrict enabled. Even though I have put much thought into how to limit communication with the YM2151, it might require more work to fix it.
I figured it wouldn't when I was patching your program. Firstly, I didn't read back far enough to see whether you were checking the busy flag or not, but I didn't notice any reads from $9FE1. Reading this address (or $9F41 on R39) returns the status byte, which contains the IRQ status flags (the two least-significant bits) and the busy flag (most significant bit.) If the MSB is high, then the chip is busy and will drop any data you attempt to write to it.
My typical code looks like this:
: bit YM_data
bmi :-
sta YM_addr
nop
stx YM_data
The NOP is because the YM needs a moment to re-settle the latch after having it pointed at a new internal register. Just one seems to be enough.
-
- Posts: 952
- Joined: Fri Mar 19, 2021 9:06 pm
New demo uploaded: Off The Floor (music demo)
Sounds similar to trying to use the VDC on the C128.
- kliepatsch
- Posts: 247
- Joined: Thu Oct 08, 2020 9:54 pm
New demo uploaded: Off The Floor (music demo)
On 11/15/2021 at 7:55 PM, ZeroByte said:
SBC #3 seems odd to me - the YM is off by one whole step from what I can tell, not 3 semitones.
Found the reason behind this: for some reason, the YM starts an octave with C#, not C (see Fig. 2.4 in the manual of the YM). That explains why I have to subtract not 2 but 3 to get from the MIDI note to the YM's note value (and then after that still do this weird 0...11 to 0...15 range conversion)
New demo uploaded: Off The Floor (music demo)
On 11/22/2021 at 4:29 AM, kliepatsch said:
for some reason, the YM starts an octave with C#, not C
Yeah, and why that oddball spacing instead of simply note=0x00..0x0C ?
There are lots of head-scratchers in the design of YM2151 that I'm sure would make more sense if you knew what specific hardware design issues were being addressed.
Others that confound me:
Why aren't AMD and PMD two different registers? For those who don't know - Register 0x19 = AMD/PMD. If you write a value 00-7F, that sets the AMD. If you write a value 80-FF, that sets the PMD. Yet, register 0x1A is unused - why not just make 0x19=AMD, and 0x20=PMD?
Why are the per-operator ADSR gate bits in the KeyUP/DN register not shifted by one more bit to make them nybble aligned? It'd be so much more obvious that $F2 = key dn for on all 4 operators on voice 2. Nope. It's $7A to do that.
New demo uploaded: Off The Floor (music demo)
On 11/15/2021 at 4:51 PM, Scott Robison said:
Sounds similar to trying to use the VDC on the C128.
After watching your video, I agree it's quite similar. You need to set the data port to point at a particular internal address, then write a value into that slot, and then wait for the chip to chew and swallow. ?
VERA, on the other hand is like a frat boy funneling beer. Once you have your data port configured, you can hit it with the fire hose.