It is currently Mon Oct 16, 2017 5:45 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Tue Dec 06, 2016 10:28 pm 
Offline
User avatar

Joined: Sat Jun 27, 2009 11:05 pm
Posts: 710
Location: New Mexico, USA
I just ran the burn-in test on my FPGA SNES and there were 6 failing tests. 5 out of those 6 tests are features that I haven't implemented yet and so the failures make perfect sense. However, the H/V timer test also failed, and I have already (or at least I thought I did) implemented the logic for the H/V timers. So I'm bummed that it failed.

Does anyone have any details on what specifically this H/V timer test is doing or looking for? I can throw it in the BSNES debugger but just figuring out where/when the test is happening and what it's doing is going to take some effort. I thought I'd try and ping the forums and see if I get lucky first.
Attachment:
burn-in test result.png
burn-in test result.png [ 338.76 KiB | Viewed 944 times ]


Top
 Profile  
 
PostPosted: Wed Dec 07, 2016 2:00 am 
Offline
User avatar

Joined: Sat Jul 04, 2009 2:28 pm
Posts: 140
Location: Wunstorf, Germany
It sets up various H/V IRQs using $4207-$420a and $4200. The IRQ ISR only reads $2137 once to have the PPU's H/V registers load the count values. It then disables H/V IRQ and waits for VBlank (via NMI ISR setting a flag that is polled in the main loop) to actually do the comparison.

The routine to read the previously-latched PPU counters resets the odd/even byte count of the PPU H/V counters by reading $213f, then reads $213c and $213d twice each.

Comparison is successful if 'carry set' for H count and 'equal' for V count.
H/V target values are:
$80/$01
$40/$02
$20/$04
$10/$08
$08/$10
$04/$20
$02/$40
$01/$80


Top
 Profile  
 
PostPosted: Wed Dec 07, 2016 2:08 am 
Offline
User avatar

Joined: Sat Jun 27, 2009 11:05 pm
Posts: 710
Location: New Mexico, USA
That is immensely helpful - thank you so much!
ikari_01 wrote:
Comparison is successful if 'carry set' for H count and 'equal' for V count.
I'm not entirely clear on what you mean here. Do you mean the C and Z flags of the CPU PS register? So it's comparing the values it read from the $213C/D registers against each of the 8 pairs of values that you listed right?


Top
 Profile  
 
PostPosted: Wed Dec 07, 2016 2:19 am 
Offline
User avatar

Joined: Sat Jul 04, 2009 2:28 pm
Posts: 140
Location: Wunstorf, Germany
Yes. Basically it stores its wanted and "measured" values in RAM, then does

Code:
(m=0)
  lda v_measured
  cmp v_reference
  beq ok
  bra error
ok:
  lda h_measured
  cmp h_reference
  bcc error
[...]


Top
 Profile  
 
PostPosted: Wed Dec 07, 2016 4:21 am 
Offline

Joined: Wed Nov 30, 2016 9:59 pm
Posts: 53
Might want to be careful with testing against benchmarks or diagnostic tools, because you might "fix" the reporting only but not the actual problem. This is how hardware vendors end up shipping products that catch fire when actually used even though it passed tests :)

My only worry here (other than trying to be funny) is that if you're using a flash cart, you may actually induce bugs in the cart and fix those that only affect the diagnostic tool running on that cart.

_________________
I come from the net. Through systems, peoples and cities to this place.


Top
 Profile  
 
PostPosted: Wed Dec 07, 2016 4:38 am 
Offline
User avatar

Joined: Sat Jul 04, 2009 2:28 pm
Posts: 140
Location: Wunstorf, Germany
Oh, good point. I assume you disabled the in-game hooks on the sd2snes for running the tests. ;) Otherwise the hook routine will postpone latching of the PPU H/V counters by about half a scanline (because it hijacks the ISR), enough to make the test fail.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: AWJ, Google [Bot] 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