Make 'Ys I & II Eternal Story' playable.
Posted on 2006-01-10 00:00:00
Rigged up something so that the DMA enabler function gets called. My solution was to raise the BUSY bit of registers IPU_CMD and IPU_CTRL when a FDEC command is issued when no data is present in the FIFO so that a waiting loop gets executed and that the DMA enabler function get called. Once some data get sent through DMA, the FDEC command is executed again returning the wanted result and clearing the BUSY bits.

Now that this seems to work, I need to figure out what FDEC does really. What I'm sure about is that it returns the first 32-bits present in the FIFO, but I'm not quite sure what the BP parameter should do:

- The FDEC command is executed the first time to find out if an MPEG marker is present at the current position. The values for BP provided for this is 0 for the first time and 8 otherwise.
- Then the actual marker is fetched and a value of 32 is provided for BP.

What I'm not sure about is if the FIFO bit stream pointer should be incremented after or before... The documentation says before, but it wouldn't work good with the second use of FDEC. I'll be studying this more in details tomorrow.