English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 21 January 2018, 11:41   #1
bloodline
Registered User
 
bloodline's Avatar
 
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?
bloodline is offline  
Old 21 January 2018, 12:32   #2
Toni Wilen
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).
Toni Wilen is offline  
Old 21 January 2018, 14:26   #3
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by Toni Wilen View Post
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).
Many thanks for your help again, so if low priority int is asserted at the same time as a higher priority one, they will both be executed in priority order?

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
bloodline is offline  
Old 21 January 2018, 14:48   #4
Toni Wilen
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.
Toni Wilen is offline  
Old 21 January 2018, 15:22   #5
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by Toni Wilen View Post
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.
Now I understand, so Paula just holds the IPL pins at the highest enabled Interrupt level. That makes sense and is easy to implement.
Quote:
Yes, you need to emulate blitter because all graphics (and possibly some non-graphics too) stuff use it, including KS insert disk screen.
I naïvely assumed that Kick1.3 would just copy the Kickstart image to chipram and then set up the blp pointers to display it... (since there is no animation).

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.
bloodline is offline  
Old 21 January 2018, 15:36   #6
Toni Wilen
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
Toni Wilen is offline  
Old 21 January 2018, 15:45   #7
bloodline
Registered User
 
bloodline's Avatar
 
Join Date: Jan 2017
Location: London, UK
Posts: 433
Quote:
Originally Posted by Toni Wilen View Post
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").
That's a relief

Quote:
Or just set blitter finished bit when program writes to BLTSIZE and check how far you can get without side-effects
Thanks for the steer, I'll try it and see what happens

Again I appreciate the help with this.
bloodline is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:42.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07086 seconds with 15 queries