It is currently Thu Nov 23, 2017 1:29 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Powerglove
PostPosted: Wed Jun 15, 2016 3:16 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6449
Location: UK (temporarily)
Lazycow wrote:
at the end of the movement, before it jumps back, it seems like one IRQ is missing for one frame. This is a bug, right? What's wrong? How do I avoid this?
It might be easiest to use FCEUX or Nintendulator and set a breakpoint on the NMI so that you can see what's happening on a frame-by-frame basis.

If you are missing an IRQ, it's hard to speculate on why it's being disabled too early; it'd help to see a little more of the IRQ handler source.


Top
 Profile  
 
 Post subject: Re: Powerglove
PostPosted: Wed Jun 15, 2016 10:11 pm 
Offline
User avatar

Joined: Tue Jun 11, 2013 1:04 pm
Posts: 52
Here's the...
Code:
IRQHandler:
  bit $4015 ; not needed?!?
  inc irqs
  pha
   tax
   pha
   ;lda val_4015 ; no effect?!?
   ;sta $4015
   lda #30+65 ; green marker
   sta PPUMASK
   ldx #250 ; waste time (debug)
:   dex
   bne :-
   lda irqs
   cmp #3
   bne :+
   lda #0
   sta $4015
   lda #30 ; standard/black
   sta PPUMASK
:   pla
   tax
   pla
   rti


Top
 Profile  
 
 Post subject: Re: Powerglove
PostPosted: Wed Jun 15, 2016 10:32 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6449
Location: UK (temporarily)
Oh, I see, you just copied the code from dpcmletterbox.

Did you set the DPCM to loop? It looks like tepples's dpcmletterbox doesn't, and restarts it inside the IRQ instead.


Top
 Profile  
 
 Post subject: Re: Powerglove
PostPosted: Thu Jun 16, 2016 10:59 pm 
Offline
User avatar

Joined: Tue Jun 11, 2013 1:04 pm
Posts: 52
Hm... I am not sure if I can read the letterbox code correctly. Does the IRQ handler restart the IRQ every time? Even if the screen has been split? Huh? That would be different to my approach.


Top
 Profile  
 
 Post subject: Re: Powerglove
PostPosted: Fri Jun 17, 2016 12:20 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6449
Location: UK (temporarily)
Yeah, tepples's code always manually restarts the IRQ. Hence your comment about "why does writing to 4015 have no effect?"—if DPCM loop is on, it won't have an effect because the $10s bit in $4015 is still on, so writing to $4015 with that bit on won't do anything. It only restarts sample playback if the previous sample is finishing, indicated by that bit being clear.

I really don't have any more useful advice at this point beyond recommending loading your thing in nintendulator's debugger—you can set a breakpoint on the IRQ and it'll give you the corresponding screen coordinate.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC - 7 hours


Who is online

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