It is currently Sun Oct 22, 2017 5:59 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Tue Jun 03, 2014 7:30 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 251
I'm using fceux 2.2.1. I got alot of help/assistance from users here, in getting my custom mmc5 irq to fire up.

in my Zelda hack, I have 2 separate irq sequences, and they work perfectly within fceux.

Now someone tested my rom on an etrom board, and one of my irq sequences wouldn't fire up.

I then loaded nintendulator & nestopia, and I went to the 2 separate irq sequences in my game, and neither emulator fired up my irqs.

I am completely lost now at this point...

edit: this is strange. Nintendulators debugger. One of my irq sequences obviously isn't working. I randomly clicked the debug box, and my entire BG was gittery garbage. But when I unclicked the debug box, my irq sequence appeared and functioned the way its supposed to. Am I missing something?


Last edited by infidelity on Mon Sep 01, 2014 7:02 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Jun 03, 2014 10:20 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1390
infidelity wrote:
edit: this is strange. Nintendulators debugger. One of my irq sequences obviously isn't working. I randomly clicked the debug box, and my entire BG was gittery garbage. But when I unclicked the debug box, my irq sequence appeared and functioned the way its supposed to. Am I missing something?


The PPU debugger can behave "strangely" with mappers like the MMC5, since it's constantly changing CHR banks as the screen is rendered and the debugger doesn't take that into account (it just looks at the currently mapped banks and uses them to preview the entire nametable). Actually requesting the CHR data through the MMC5 wouldn't work, since the mere act of reading from memory would change the mapper's internal state (just as it would with the MMC2 and MMC4).

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


Top
 Profile  
 
PostPosted: Tue Jun 03, 2014 10:44 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 251
Oh that's interesting.

I just have a feeling I'm missing something, still can't figure it out why they don't work.


Top
 Profile  
 
PostPosted: Wed Jun 04, 2014 3:41 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 251
Please, does anyone know what is causing my issue? I've still been unable to solve this.


Top
 Profile  
 
PostPosted: Wed Jun 04, 2014 5:01 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5732
Location: Canada
How would anyone have any idea? You haven't shared any source code or a ROM to look at. You're asking people to guess what you might be doing wrong.


Top
 Profile  
 
PostPosted: Wed Jun 04, 2014 10:37 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5732
Location: Canada
These were suggestions made in a PM, putting them here in case someone else wants to help in the future:

1. You don't seem to be Initializing RAM in your reset code. Doing this would eliminate a large potential source of differences between emulators.

2. You must always read $5204 in your IRQ routine before RTI, or it gets stuck in an infinite loop firing the IRQ over and over again (until the NMI overrides it).

3. Write to $5203 before you turn on the scanline IRQ.


Top
 Profile  
 
PostPosted: Wed Jun 04, 2014 11:27 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 251
Ok,
I added the ram initialization at the beginning of my reset vector.

At the end of my irq, where my pull registers are and my rti are, I placed LDA $5204 just before my pulls and rti.

And right when my desired irq is initialized, I add my write to $5203.

With these changes, nintendulator & nestopia still won't display my irq, only fceux continues to do so.

Im still lost. :(


Top
 Profile  
 
PostPosted: Wed Jun 04, 2014 3:56 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5732
Location: Canada
Create a trace log in FCEUX and one in Nintendulator from power on. Read them side by side, and figure out where they start to diverge. My guess, based on the last version of your ROM I saw is that they will start to diverge before the second NMI fires). Once you know what is different, you can work on fixing it so that they are both the same.

Remember all the conditions for an IRQ to fire, and check each of them. Is the scanline set via $5023? Is the IRQ enabled via $5024? Is the IRQ inhibit flag on or off, etc. ? Also make sure all of the other IRQs are inactive.


Top
 Profile  
 
PostPosted: Fri Jun 06, 2014 6:21 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 251
Got it!

The only issue, was $5203. I realized that this needs to be constantly written to within the NMI. I have my writes to $5203 within my irq routines.

So as a test, I forced a value within $5203 in the NMI, I fired up both nintendulator & nestopia, and the irq fired up!

Thank you again for your help/guidance!


Top
 Profile  
 
PostPosted: Mon Sep 01, 2014 1:57 pm 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 251
Hello again! I'm back again with my irq for mmc5.

My romhack ive worked on, im at the very end of finishing this, but I'm running into an issue that's springing up and I don't know how to stop it from happening.

My irq will violently fluctutate if Link shoots his sword zap, or any other type of sprite action. my split screen works properly, can be adjusted at any height with not issue.

If I do a read breakpoint of $5204, and constantly hit run while the irq is in mid screwup, I can see the scanline #fluctuate all over the place, then once the error stops, the scanline is doing it's correct positions.


The scanline values that are correct properly within the debugger are..
66, near top, 106, middle, 144, near bottom

But, if decide to shot my sword zap, then perform the read breakpoint, and click run, the scanline goes all over the place.

Id appreciate any help, this is the only thing stopping me from finishing my project, idk if im missing something or what. Thanks for reading!

edit

oh man....

I just did this as a test. I froze my ram register that loads a dpcm sfx id..... My irq no longer fluctuates.... But my sword zap is a dpcm sfx which I need. As long as no dpcm is taking place, my mmc5 irq is ok....

Now I don't know what to do. :-(

Idk how to make the dpcm and my custom mmc5 irq coexist?


Top
 Profile  
 
PostPosted: Tue Sep 02, 2014 4:30 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1390
Are you sure you aren't accidentally enabling DPCM IRQs when playing samples?

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


Top
 Profile  
 
PostPosted: Tue Sep 02, 2014 4:41 am 
Offline

Joined: Fri Mar 01, 2013 4:46 am
Posts: 251
I honestly don't know. Does it have anything to do with $4010? I can't remember the dpcm register off the top of my head. The Zelda engine never had a constant split screen going on during dpcm playback, so idk if the engine is intact lacking something, or if I'm just overlooking something. The only thing I've ever messed with in regards to dpcm, is shifting the sample sfx positions and sizes.

So I need to turn something off within dpcm?

Hmm, I think I got it! After my cli, I added LDA #$00 $STA $4017.

my sword zap works still, and my mmc5 scanline isn't going haywire! I'll keep trying different sprite actions to make absolute sure I got this. Thank you very much for helping with this!


Top
 Profile  
 
PostPosted: Tue Sep 02, 2014 7:51 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19115
Location: NE Indiana, USA (NTSC)
If bit 7 of $4010 is true while the DMC is fetching the last byte of the sample, the DMC will assert IRQ.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 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