Emulator failing ppu_vbl_nmi test #2

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
clueless
Posts: 498
Joined: Sun Sep 07, 2008 7:27 am
Location: Seatlle, WA, USA

Emulator failing ppu_vbl_nmi test #2

Post by clueless » Sun Aug 19, 2018 4:50 pm

Hello. My emulator currently passes blargg's CPU opcode test, but fails some of the "ppu_vbl_nmi.nes" tests.

Test #2 documentation (from the source):

Code: Select all

; Verifies time VBL flag is set.
;
; Reads $2002 twice and prints VBL flags from
; them. Test is run one PPU clock later each time,
; around the time the flag is set.
;
; ^@T+ 1 2
; 00 - V
; 01 - V
; 02 - V
; 03 - V   ; after some resets this is - -
; 04 - -   ; flag setting is suppressed
; 05 V -
; 06 V -
; 07 V -
; 08 V -
My output:

Code: Select all

$ ./output/testsuite
Unhandled PPU.write(0002, 00)
FAIL: src/emulator/test/PpuVblNmiCart_t.cc:86  0x00(0x00) != status(0x01)
  T+ 1 2
  00 - V
  01 - V
  02 - V
  03 - V
  04 - V
  05 V -
  06 V -
  07 V -
  08 V -
  4103C340
  02-vbl_set_time
  Failed
  While running test 2 of 10
Total tests: 354
Failed tests: 1
My own PPU VBL timing unit test [1] passes.

I assume that test #2 is testing that the emulator properly implements the race condition described in [2]. Can anyone confirm this hypothesis?

[1] https://pastebin.com/rD4PTeG6
[2] https://wiki.nesdev.com/w/index.php/NMI

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Emulator failing ppu_vbl_nmi test #2

Post by Zepper » Sun Aug 19, 2018 5:36 pm

If I'm not wrong, it's the same question here.
viewtopic.php?f=3&t=17663

zzzz898
Posts: 4
Joined: Mon Aug 20, 2018 1:23 am

Re: Emulator failing ppu_vbl_nmi test #2

Post by zzzz898 » Mon Aug 20, 2018 1:33 am

I'm trying to fix the exact same bug right now in my emu.
Some info: check out "VBL FLag Timing" at this page http://wiki.nesdev.com/w/index.php/PPU_frame_timing

Post Reply