Make 'Ys I & II Eternal Story' playable.
Posted on 2006-02-06 00:00:00
Implemented one of the two missing instructions: PSLLH. The other one is PSRAH and should be easy to implement too. I've seen some uses of the QFSRV instruction with SA not equal to zero, so I'll need to fix that too.

I'll try to have PSRAH and QFSRV done tomorrow.

I've also found out what was causing the infinite loop... The problem is that the FIFO gets totally emptied and that the DMAC has finished to transfer what it had to transfer to the IPU. What would probably happen normally is that the MPEG decoding library would wait till the BUSY bit of the CTRL register is cleared, but would end up calling the custom handler for restarting the DMA transfer since the command is hung.

But allowing this kind of behavior means that some commands could be interrupted at anytime during its processing since all the processing is done at one time by one function call... If VDEC was the only command that could be interrupted, it wouldn't be too bad, but BDEC needs to be interrupted too.

I have some ideas as to how to deal with this (longjmp/setjmp being the most tempting one), but I'll ponder this a little bit more before doing anything...