Argh. Lame transcribing problems. Sorry, Maarten. Here's the corrected
version I actually ran:

> > ORG #9000
> >     DI
> >     IN A, (#A8)
> >     PUSH AF
> >     OR #03
> >     OUT (#A8), A
> >     LD A, <address>
> >     LD (#3FF0), A
> > BSY LD A, (#3FF0)
> >     AND #80
> >     JRNZ BUSY
> >     LD A, <data>
> >     LD (#3FF1), A
> >     POP AF
> >     OUT (#A8), A
> >     EI
> >     RET
> >
> > This routine simply hung, presumably on the loop that waits for the YM2164
> > status register to return a not busy signal (bit 7 = 0). Any ideas why,
> > and what I should do differently / add to this?
>
> First of all, you forgot the "DI" statement at the start. Switching the
> interrupt routine (#0038) away is a bad idea. Maybe your actual program did
> have "DI" though, since you do have an "EI" at the end of the program.

Yes, correct.

> Second, the BUSY loop does not read any status register. So it will be
> executed either once or forever, depending on bit7 of <address>.

I forgot the LD A, (#3FF0). The address register and the status register
are the same location on the YM2164; just write and read modes.


Richard

--
For info, see http://www.stack.nl/~wynke/MSX/listinfo.html

Reply via email to