YM2612 takes it when i stuff shit in its face. Why?

For hardware talk only (please avoid ROM dumper stuff)
Post Reply
Oerg866
Very interested
Posts: 211
Joined: Sat Apr 19, 2008 10:58 am
Location: Frankfurt, Germany
Contact:

YM2612 takes it when i stuff shit in its face. Why?

Post by Oerg866 » Fri Apr 13, 2012 3:03 pm

So I made this thing:

http://www.sega-16.com/forum/showthread.php?20691

But i discovered something interesting. I wrote a z80 program that plays a sinewave over the pcm channel.

Here is the code:

Code: Select all

                                                                                                                            
stack: equ $1ff0

    ld sp, stack

    ld a, $0

    ld ix, $4000

    ld (ix), $2B
    ld (ix+1), $FF

    ld (ix), $2A
redo:
    ld hl, sine
    ld a, $FF
loop:
    ld b, (hl)
    ld (ix+1), b
    inc hl
    dec a
    jp z, redo
    jp loop
sine:
    incbin "sine.bin"
Incidentally this is my first time really interfacing with the YM chip so this is all new territory for me.

I don't wait for the ready bit to become set and I accidentally made it so one period is 256 bytes. So basically if I have a 440hz sinewave that would be ~112khz i'd be stuffing into that poor YM.

Now, the curious thing is, that it actually doesn't crash. It's probably missing a shitload of writes, but it doesn't crash. My question is: why?

Because lots of people said that after like 52khz the thing will just crash hard. And this is not happening for me.

Cheers,
Oerg866

EDIT: I then took 1 second of 48KHz music and let the 68k doit this time.

Result is this: http://www.mdscene.net/~pvt/Untitled7.wav

This is ~10 times the speed of the original 48khz sample. So for some reason, even at like 480khz the thing is not crashing. What is going on down here?!

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Apr 13, 2012 5:41 pm

What people said it would crash? I've never heard that before from anyone.
:?

Oerg866
Very interested
Posts: 211
Joined: Sat Apr 19, 2008 10:58 am
Location: Frankfurt, Germany
Contact:

Post by Oerg866 » Fri Apr 13, 2012 6:32 pm

Chilly Willy wrote:What people said it would crash? I've never heard that before from anyone.
:?
TmEE and Sik are among them...

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Apr 13, 2012 8:49 pm

Oerg866 wrote:
Chilly Willy wrote:What people said it would crash? I've never heard that before from anyone.
:?
TmEE and Sik are among them...
Really? I can't remember any posts by either saying that storing to the DAC too fast will crash the chip.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Fri Apr 13, 2012 8:59 pm

When I began messing with MD I got such results. The chip would play at ~60KHz for few seconds and then stops outputting any sound until a power cycle was done.
I did not have a whole lot of HW to test things on, so it may very happen only on certain YMs (the chips are made by various companies... NEC, Sharp, Toshiba among others, Yamaha had no fab).

I have verified that writes past half of chip sample rate get missed. So ~26KHz is as high as you should go, anything beyond is worthless waste of space and CPU power.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Apr 13, 2012 10:04 pm

TmEE co.(TM) wrote:When I began messing with MD I got such results. The chip would play at ~60KHz for few seconds and then stops outputting any sound until a power cycle was done.
I did not have a whole lot of HW to test things on, so it may very happen only on certain YMs (the chips are made by various companies... NEC, Sharp, Toshiba among others, Yamaha had no fab).

I have verified that writes past half of chip sample rate get missed. So ~26KHz is as high as you should go, anything beyond is worthless waste of space and CPU power.
Ah, okay. Thanks for the clarification. I don't remember seeing that... perhaps an older thread from before I joined.

Oerg866
Very interested
Posts: 211
Joined: Sat Apr 19, 2008 10:58 am
Location: Frankfurt, Germany
Contact:

Post by Oerg866 » Fri Apr 13, 2012 11:17 pm

Everybody who can run this program:

http://www.mdscene.net/~pvt/RAMDEV_BUILT.BIN

And tell me if his machine crashes. It stuffs ~152000 bytes per second into the YM while playing a FM instument. tell me if your machine crashes!

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Sat Apr 14, 2012 12:21 am

I've tried it and it looks like it's crashed.

I've got "Start transfer.exe and send a program!", then the same note playing over and over.

I'm running on a Genesis II. No idea what kind of chips it has inside.

Oerg866
Very interested
Posts: 211
Joined: Sat Apr 19, 2008 10:58 am
Location: Frankfurt, Germany
Contact:

Post by Oerg866 » Sat Apr 14, 2012 3:51 am

djcouchycouch wrote:I've tried it and it looks like it's crashed.

I've got "Start transfer.exe and send a program!", then the same note playing over and over.

I'm running on a Genesis II. No idea what kind of chips it has inside.
Thats normal. Because the rate is so high the PCM sample played is very short. If you get some extremely high pitched noises and a bass voice being playedin regular intervals, the chip did not crash. Thanks for your help

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Apr 14, 2012 6:16 pm

No crash on my CDX.

EDIT: Also, no crash on my Model 2.

Post Reply