![]() |
![]() |
![]() |
![]() |
![]() |
Make 'Ys I & II Eternal Story' playable.
Posted on 2006-01-13 00:00:00 |
Been looking after the FIFO filling problem today... My idea consisted in giving a way to the devices that receive DMA transfers to tell the DMAC that they can't take anymore data and that they'd wish to suspend the transfer. Since the DMA transfers don't run in parallel with the CPU in the emulator, contrarily to what it does in reality, we'd also need to have a way for the devices to tell the DMAC to resume the transfer when they are ready. That's what causing me trouble...
Resuming would be fine if we were only using the normal mode, but we have to support the source chain mode too... So in source chain mode, when we suspend a transfer and finish it after, we need to know if we were done reading DMA tags or not. This can be done by maintaining the most significant 16-bits of the latest tag into the CHCR register and checking it after the transfer is finished. But the source chain mode is also supposed to start a transfer, before processing tags, if the initial QWC is not equal to zero. This initial transfer can also be suspended and resumed, and applying the same decision to decide wether there's more tags to process or not will not work because no previous tags has been read and the higher 16-bits of CHCR are uninitialized. But we could work around this problem by setting a bogus tag value that would cause us to check for the next tag after the transfer. I was also wondering if the MADR and QWC registers were changed while a transfer was currently on-going, but I'm pretty sure they do. TADR is apparently changing only at the end of the current transfer, so that could cause us some problems... It's more bothersome than I thought it would be. I'll think this over and come up with something implemented tomorrow. |