Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Coinoperator ! (Registered 2024-06-17) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > NMI delay
2024-02-13 22:34
JackAsser

Registered: Jun 2002
Posts: 1995
NMI delay

How much is an NMI delayed if triggered during IRQ-setup?
 
... 45 posts hidden. Click here to view all posts....
 
2024-02-14 05:50
Martin Piper

Registered: Nov 2007
Posts: 647
To really get an answer to this the PLA ROM needs to be understood.

http://www.visual6502.org/JSSim/expert.html
https://www.pagetable.com/?p=410
https://www.pagetable.com/?p=39
"At the end of each instruction, the PLA causes the T bitfield to reset, so that the next instruction starts with T1=1 again."
"All interrupt and NMI requests are always delayed until the current instruction is finished, i.e. until T gets reset."
2024-02-14 09:33
JackAsser

Registered: Jun 2002
Posts: 1995
Quote: To really get an answer to this the PLA ROM needs to be understood.

http://www.visual6502.org/JSSim/expert.html
https://www.pagetable.com/?p=410
https://www.pagetable.com/?p=39
"At the end of each instruction, the PLA causes the T bitfield to reset, so that the next instruction starts with T1=1 again."
"All interrupt and NMI requests are always delayed until the current instruction is finished, i.e. until T gets reset."


Given that and given that an IRQ really is a BRK-instruction under the hood we can assume the delay can be up to 7 cycles then?
2024-02-14 13:56
chatGPZ

Registered: Dec 2001
Posts: 11154
If only it was that simple :o)

It might be a good idea to simulate and iterate too all possible timings (ie trigger the nmi in every possible half cycle of that "BRK") and then see what happens. If i understood the wiki correctly, there are still special cases to consider.
2024-02-14 14:09
JackAsser

Registered: Jun 2002
Posts: 1995
Quote: If only it was that simple :o)

It might be a good idea to simulate and iterate too all possible timings (ie trigger the nmi in every possible half cycle of that "BRK") and then see what happens. If i understood the wiki correctly, there are still special cases to consider.


Yeah, someday. For now I simply made sure that my IRQs never collides with the NMIs. :)
2024-02-14 14:18
chatGPZ

Registered: Dec 2001
Posts: 11154
BAH! DO IT! :D
2024-02-14 17:01
Martin Piper

Registered: Nov 2007
Posts: 647
Quote: Yeah, someday. For now I simply made sure that my IRQs never collides with the NMIs. :)

There's no real problem as both will trigger eventually.
2024-02-14 17:10
chatGPZ

Registered: Dec 2001
Posts: 11154
The problem is having predictable timing in all cases. Of course they trigger (except when they don't - see the wiki pages).
2024-02-14 17:20
JackAsser

Registered: Jun 2002
Posts: 1995
Quote: The problem is having predictable timing in all cases. Of course they trigger (except when they don't - see the wiki pages).

Exactly. My NMIs must NOT be delayed or this card house will fall completly and ungraceful.
2024-02-14 17:28
Fungus

Registered: Sep 2002
Posts: 631
Quote: The problem is having predictable timing in all cases. Of course they trigger (except when they don't - see the wiki pages).

Yes this is what I was looking at too, to see in which instances the IRQ is "eaten". I need to do some simulations there too and see if this behavior can be documented so we know exactly when and how this can occur.

I was already aware of BRK can eat an IRQ and vice versa, but if NMI is also a BRK instruction then the same thing could happen. It's just a matter of under what circumstances...
2024-02-14 17:34
chatGPZ

Registered: Dec 2001
Posts: 11154
Yes. Those wiki pages are very confusing for that matter, because they also consider cases that can never happen - in a C64 anyway.
Previous - 1 | 2 | 3 | 4 | 5 | 6 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
csabanw
Hend/Protovision (ptv)
Honcho
The Human Co../Maste..
rambo/Therapy/ Resou..
Airwolf/F4CG
Guests online: 77
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Comaland 100%  (9.6)
9 Wonderland XIV  (9.6)
10 Aliens in Wonderland  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Replicate  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 It's More Fun to Com..  (9.5)
8 Dawnfall V1.1  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Stinsen  (9.7)
3 Jeroen Tel  (9.6)
4 Linus  (9.6)
5 psych858o  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.082 sec.