I'm reverse-engineering the driver for a printer port device, and as such I want to generate acknowledgement interrupts on the busy pin in response to data written.
So far, I've added the following line to PSG_Set_DataRegister() in psg.c:
MFP_GPIP_Set_Line_Input(0, ((val & 0x20) >> 5) ^ 1 );
This loops the strobe pin back to the busy pin with inversion.
This isn't working 100% correctly with the driver - the driver does not expect an interrupt for every byte. Instead, I need to generate an interrupt 0.32ms after the byte is written. Or alternatively, generate periodic 0.32ms interrupts constantly (I'm not sure which the driver needs).
What's the best way to go about this? I'm not familiar with the Hatari source and its interrupt handling. Is there a function I can call to set an interrupt n cycles away in the future?
Thanks for any help ^.^