21 January 2018, 11:41 | #1 |
Registered User
Join Date: Jan 2017
Location: London, UK
Posts: 433
|
How does Paula handle pending interrupts?
I think I've found a proble with my code.
In this thought experiment assume all ints are enabled. If a VBL interrupt bit is set, the CPU interrupt level is set to 3, if during the processing of that exception, a timer interrupt bit is set, does Paula wait for the int_ack from the CPU before she sets the lower pri level? |
21 January 2018, 12:32 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,535
|
Paula does not wait anything, IPL signals change instantly (there is one or two clock delay, probably to guarantee no spurious interrupts but you don't need to care about that).
CPU starts new interrupt exception if new IPL is higher than current interrupt mask in SR (=interrupts can stack). |
21 January 2018, 14:26 | #3 | |
Registered User
Join Date: Jan 2017
Location: London, UK
Posts: 433
|
Quote:
Assuming the above to be true, my Emulator now just gets to a loop where is appears to be testing bit 6 in the the DMACONR reg... am I going to need to emulate the Blitter? I was only ever planning to implement the very minimum to get the OS booting |
|
21 January 2018, 14:48 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,535
|
There is no "interrupt state" in CPU, CPU does nothing more than check between each instruction if external interrupt level (IPL pins from Paula) are higher than SR register interrupt mask. If it is higher, new interrupt exception starts and mask is updated to current level. (Level 7 works differently but it is not needed, Amiga can't generate it without extra hardware)
You can even write to SR and lower interrupt mask in interrupt routine, if current IPL is higher than new mask (=enabled and active in Paula), new interrupt starts immediately. Yes, you need to emulate blitter because all graphics (and possibly some non-graphics too) stuff use it, including KS insert disk screen. |
21 January 2018, 15:22 | #5 | ||
Registered User
Join Date: Jan 2017
Location: London, UK
Posts: 433
|
Quote:
Quote:
The Blitter is going to take quite a bit of work... and I suspect I will need to make my timings far more accurate, with some proper DMA emulation too... I strongly suspect it would have been easier just to use UAE sources but that would have been much less fun for me. I'll have to publish the sources as an example of how NOT to write an Amiga emulator. |
||
21 January 2018, 15:36 | #6 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,535
|
Blitter timing is 100% unimportant in your use case. You can emulate whole blit in a single pass when program writes to BLTSIZE. (Same as UAE "immediate blitter").
Or just set blitter finished bit when program writes to BLTSIZE and check how far you can get without side-effects |
21 January 2018, 15:45 | #7 | ||
Registered User
Join Date: Jan 2017
Location: London, UK
Posts: 433
|
Quote:
Quote:
Again I appreciate the help with this. |
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
External interrupts generated by TCP/IP stacks | dissident | Coders. Asm / Hardware | 37 | 09 January 2019 10:27 |
CIA interrupts... | bloodline | Coders. System | 6 | 18 January 2018 10:33 |
CIA Interrupts and Timers and Ports | nocash | Coders. Asm / Hardware | 7 | 13 April 2016 12:09 |
Interrupts and Multitasking: Examples? | tygre | Coders. General | 13 | 22 December 2015 04:56 |
Advice on interrupts and jumps | alexh | Coders. General | 11 | 20 May 2008 09:42 |
|
|