Re: [hatari-devel] DSP for Previous |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
You're welcome! I found some more problems. But now it seems that the DSP works for me! Most problems i found were related to the interrupt system. It does not reflect real behavior. I think i found most issues, but with this method of doing interrupts we will run into further problems sooner or later. I think it needs to be rewritten. My current patch is just a workaround. Now it works like this: The device sends the interrupt to the DSP like some kind of message. If it is not masked, it is then added to a list. The DSP reads the interrupt from the list, removes it and executes the interrupt service routine. If a masked interrupt is unmasked, the interrupt message needs to be re-sent. If an interrupt is on the list while it gets masked, it needs to be removed from the list. If the service routine does not make the device release the interrupt on first try, it needs to be sent again, if it isn't masked. How it should work: The device asserts the interrupt line. The DSP samples the line and sees the interrupt, if it is not masked. It executes the service routine, which then makes the device release the interrupt line. If a masked interrupt is unmasked, the DSP will start seeing it. If a pending interrupt is masked, the DSP will no longer see it. If the service routine does not make the device release the interrupt, the DSP will keep on seeing it, unless it is masked. All these things can be emulated with the current behavior. But it is difficult to understand and can get quite complicated. Another problem i found, is that the register R0 is not set to the correct value after simulated bootstrap. It should be loaded with the actual byte count. Furthermore writing to HF0 should stop the bootstrap early and start execution. Is there a special reason, we don't use the program from the real Boot-ROM? It is documented in the datasheet. Now not to be misunderstood: I think this piece of software is really great! It seems to be very accurate im almost all cases and mostly complete. The problems i found are (with exception of the interrupt handling) only rare edge cases. Almost everything worked out of the box! Thank you very much for this! I appended the patches and workaround for the mentioned problems. You may need to apply the first two manually, as i made some irrelevant changes in between (DMA interface). You may also need to fix some Atari-specific interrupts. I only did it for the host interface interrupts, because i can't test the others. |
Attachment:
dsp_patch3.diff
Description: Binary data
Attachment:
dsp_patch11.diff
Description: Binary data
Attachment:
dsp_patch12.diff
Description: Binary data
Attachment:
dsp_patch13.diff
Description: Binary data
Am 11.06.2015 um 00:10 schrieb Laurent Sallafranque <laurent.sallafranque@xxxxxxx>:
|
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |