It is currently Sat Oct 21, 2017 1:45 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Thu Nov 04, 2004 3:45 pm 
Offline

Joined: Mon Sep 20, 2004 11:13 am
Posts: 134
Location: Sweden
(Wow, i'm using phpbb!) ;)

I recently added a little thing to my emu:
If $2000.7 toggles 0->1 when $2002.7 is high, an NMI is triggered.
This seems 100% logical to me, but it screwed up Laser Invasion:

Before:ImageAfter:Image
(The VRAM address gets screwed up during nametable filling)

I was just wondering if anybody's found any other game where this functionality makes a difference, or else I'll just omit it.
Perhaps someone doesn't have this problem at all with Laser Invasion?

/Martin


Top
 Profile  
 
PostPosted: Thu Nov 04, 2004 4:33 pm 
Offline

Joined: Mon Sep 27, 2004 11:51 pm
Posts: 101
Nessie wrote:
I recently added a little thing to my emu:


Not so little when it comes to games such as Dynamite Bowl and Spelunker (probably lots of others too). If these two games work fine on your emulator then I don't know what could be the problem (perhaps the fact that the game uses MMC5 has to do something with it).

_________________
http://hydesprojects.cjb.net/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 04, 2004 4:56 pm 
Offline

Joined: Mon Sep 20, 2004 11:13 am
Posts: 134
Location: Sweden
Hmm, they both work, regardless of the NMI thing. Where are they supposed to glitch?
Did you get Laser Invasion to work with this NMI thing?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 04, 2004 6:15 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
I use said 'NMI thing' in my emulator, and Laser Invasion works perfectly.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 04, 2004 8:13 pm 
Offline

Joined: Mon Sep 20, 2004 11:13 am
Posts: 134
Location: Sweden
Ok, thanks. I guess it's my MMC5 code then. Probably the IRQs... :?
- $5204.7 is set on the scanline ($5203) if rendering is enabled.
- If IRQs are enabled, an IRQ is also triggered.
- Both the bit and the pending IRQ are cleared when reading $5204.
- Are they cleared under any other condition? I tried clearing them on scanline 240, without luck.

Or else i'll just ignore that 'NMI thing' and hope most games work anyway :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 13, 2004 1:23 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7232
Location: Chexbres, VD, Switzerland
Try to clear both $5204.7 and the IRQ if the scanline ($5203)+1 is reatched without clearing it by reading.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 8:47 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
I know I'm bumping a very old topic with this... but I've recently been running into problems with this implimentation.

Not with Laser Invasion... but with Eggerland, and Adventures of Lolo 2 & 3.. causing hangups in all 3 games. I've been looking at Eggerland, specifically... and it seems to do a large drawing routine in when rendering is turned off, during which times it enables, then shortly after disables NMIs (without waiting for NMIs). It does it several times in the frame, spilling into next frame's VBlank, where enabling NMIs triggers an NMI... which screws the whole thing up -- it eventually goes in a wait-for-NMI infinite loop without NMIs enabled (locking up the game)

Is there some sort of delay between the $2000 write and the following NMI? Or does it happen immediately? Did anyone else have these problems with these games? Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 9:40 pm 
Offline

Joined: Mon Sep 27, 2004 11:51 pm
Posts: 101
Try triggering the NMI right after the instruction that follows sta $xxxx or whatever. Like so:

sta $2000
(some instruction)
jsr 8000; trigger the NMI right before this occurs

_________________
http://hydesprojects.cjb.net/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 9:45 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
I thought about doing that -- from what I looked at Eggerland's code it looks like it would solve its problem. However that seems awfully hackish....

edit: I guess -- if there's a short delay between the start of VBlank and an NMI... perhaps it does make sense that there's a delay between the $2000 write and an NMI.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 9:57 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
Hyde wrote:
Try triggering the NMI right after the instruction that follows sta $xxxx or whatever. Like so:

sta $2000
(some instruction)
jsr 8000; trigger the NMI right before this occurs


This is exactly what should be done - a small test I wrote verifies this behaviour on a real NES.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group