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


Forums > C64 Coding > 65816 WAI NMI Edge Case
2021-04-29 10:44
oziphantom

Registered: Oct 2014
Posts: 425
65816 WAI NMI Edge Case

The 65816 has a special mode of WAI, when you Set I it will not fire the IRQB handler and drop to the next instruction.
It does mention that ABORTB will behavior differently, in that it will exit the WAI but not start the processor.

However there is no mention of what happens in the instance of a NMI.

so
SEI
WAI
; NMI fires

does it

a.)handle NMI as per normal and return to the WAI

b.)handle NMI as per normal and exit from the WAI

c.)skip the NMI handler and exit from the WAI

Does anybody know? I can't find any test cases or documented evidence of what it does do. Some things don't mention it, some things say it will trap "any" interrupt.
 
... 7 posts hidden. Click here to view all posts....
 
2021-04-29 15:39
oziphantom

Registered: Oct 2014
Posts: 425
they might have, but if they did, they didn't document their findings.
2021-04-29 16:11
Groepaz

Registered: Dec 2001
Posts: 9828
And why dont you? I mean... isnt it the obvious thing to do? :)
2021-04-29 16:43
oziphantom

Registered: Oct 2014
Posts: 425
I don't have a SuperCPU, I don't have an Apple IIgs, nor a Foniex 256 and I don't have a SDPro for a SNES.

Otherwise I would have.
2021-04-29 16:45
Groepaz

Registered: Dec 2001
Posts: 9828
In such case i'd usually write the test program, post it here (and/or on lemon or irc) and ask someone to run it - works for me :)

Bonus: you'll find out if VICE does the right thing, and we can fix it eventually :)
2021-04-29 17:12
Karmic

Registered: Apr 2015
Posts: 48
I have an FXPak Pro for SNES, if you're willing to write up a test ROM I can run it for you.
2021-04-29 18:10
oziphantom

Registered: Oct 2014
Posts: 425
https://www.dropbox.com/s/z4hw32cps1lzog6/testNMIWAI.sfc?dl=0

not sure if you need to pad it out for FXPak. ROM Is PAL, but it doesn't matter.

It will set the screen colour.

RED - WAI exited no NMI handler
BLUE - NMI handler executed, WAI didn't exit
PURPLE - NMI handler executed and WAI exited
2021-04-29 18:42
Ze Smasher

Registered: Feb 2003
Posts: 484
I put 5$ on purple :)
2021-04-29 23:11
Karmic

Registered: Apr 2015
Posts: 48
Ran it multiple times, and got the purple screen every time. I guess that makes the most sense, NMI is supposed to be non-maskable after all.
2021-04-30 07:59
oziphantom

Registered: Oct 2014
Posts: 425
it does but then having my critical clock perfect interrupt get broken by a stray NMI also sounds bad. I guess either way is not ideal.
Thanks for testing.
2021-04-30 13:06
Groepaz

Registered: Dec 2001
Posts: 9828
Quote:
my critical clock perfect interrupt get broken by a stray NMI also sounds bad

So you either do "nmi lock", or just live with it :) It's a common "problem" in many C64 programs.
Previous - 1 | 2 - 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
MWR/Visdom
Antitrack
Mibri/ATL^MSL^PRX
tNG/FairLight
wbochar
iAN CooG/HVSC
itch/SoS
Guests online: 161
Top Demos
1 Edge of Disgrace  (9.6)
2 Comaland 100%  (9.6)
3 Uncensored  (9.6)
4 Coma Light 13  (9.6)
5 Unboxed  (9.6)
6 Lunatico  (9.5)
7 Memento Mori  (9.5)
8 Wonderland XII  (9.5)
9 Christmas Megademo  (9.5)
10 The Shores of Reflec..  (9.5)
Top onefile Demos
1 Copper Booze  (9.8)
2 Daah, Those Acid Pil..  (9.6)
3 To Norah  (9.5)
4 Lovecats  (9.5)
5 Dawnfall V1.1  (9.5)
6 Square Booze  (9.4)
7 Quadrants  (9.4)
8 Elite Code Mechanics  (9.4)
9 For Your Sprites Only  (9.4)
10 Remembrance  (9.4)
Top Groups
1 Booze Design  (9.4)
2 Censor Design  (9.3)
3 Oxyron  (9.3)
4 Fossil  (9.3)
5 PriorArt  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Horizon  (9.9)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2021
Page generated in: 0.051 sec.