Search found 248 matches

by Bisqwit
Tue Mar 27, 2012 9:44 am
Forum: NESemdev
Topic: Planning a test for BRK and IRQ concurrency glitch
Replies: 23
Views: 30209

Do you know if the IRQ is acknowledged only in the last cycle of the current instruction? Do you write to $4017 before writing to $4015? How many cycles should be elapsed? At no point do I write to $4015 in this test, not even in Blargg's library code (except in the end thereof). I do write to $401...
by Bisqwit
Tue Mar 27, 2012 7:18 am
Forum: NESemdev
Topic: Planning a test for BRK and IRQ concurrency glitch
Replies: 23
Views: 30209

From my emulator: TEST:test_cpu_flag_concurrency Verifying that basic CPU flag operations work properly DFL: 30 ; 30 OK NMI: 20 -> 30 OK IRQ: 20 -> 30 OK BRK: 30 -> 30 OK Finding APU IRQ timings OK, 29823<= 29823 <29823 Invoking a BRK-IRQ collision Offs #INTs Flags 4015 B n 033 1 $30,$30 $00 1 34 <-...
by Bisqwit
Tue Mar 27, 2012 7:02 am
Forum: NESemdev
Topic: Planning a test for BRK and IRQ concurrency glitch
Replies: 23
Views: 30209

With RockNES: Same results as on Nintendulator and Famicom (the HVC-001, not an emulator by that name), except that the it looks like in your emulator, an early read of $4015 cancels the upcoming IRQ even 5 cycles before the fact. But why a 100 kilobyte JPG for something that compresses into less t...
by Bisqwit
Tue Mar 27, 2012 6:12 am
Forum: NESemdev
Topic: Planning a test for BRK and IRQ concurrency glitch
Replies: 23
Views: 30209

You make use of unofficial opcodes...? Where they are entirely consistent and a consequence of processor's logical design rather than subject to temperature-variant analog processes, yes. They are an unseparable part of the NES hardware. In this test, I used the two-byte NOP opcode $F4 (which is re...
by Bisqwit
Tue Mar 27, 2012 5:04 am
Forum: NESemdev
Topic: Planning a test for BRK and IRQ concurrency glitch
Replies: 23
Views: 30209

http://bisqwit.iki.fi/kala/test1.zip If someone has a real NES, I would be thankful of reports of this test ROM being run. Its purpose is to collect the reference data for the actual test. It works on both NTSC and PAL systems, but I am now focusing on NTSC. EDIT: Test results collected (again). Nin...
by Bisqwit
Tue Mar 27, 2012 12:29 am
Forum: NESemdev
Topic: Planning a test for BRK and IRQ concurrency glitch
Replies: 23
Views: 30209

Planning a test for BRK and IRQ concurrency glitch

I am planning a test for the BRK and IRQ concurrency glitch. My initial attempt , however, failed, because I was assuming that when the IRQ supersedes the BRK, the B flag will be cleared, which is not actually the case. Apparently, when the IRQ supersedes the BRK, the actual interrupt will be indist...
by Bisqwit
Mon Mar 26, 2012 5:33 pm
Forum: NESemdev
Topic: CPU-test: cpu_dummy_writes [DONE]
Replies: 35
Views: 36147

Here is the first run of the opcode loop, beginning from stx num_fails and ending at the first successful invocation of opcode_buffer. EA46 86 21 stx $21 = 00 A:20 X:00 Y:00 P:26 SP:FB CYC:137 SL:254 EA48 86 22 stx $22 = 00 A:20 X:00 Y:00 P:26 SP:FB CYC:146 SL:254 EA4A 86 23 stx $23 = 00 A:20 X:00 Y...
by Bisqwit
Mon Mar 26, 2012 5:15 pm
Forum: NESemdev
Topic: CPU-test: cpu_dummy_writes [DONE]
Replies: 35
Views: 36147

Here is a "egrep -A2 'st[axy] \$2[789ABCDE]|jsr \$00' " of the assembly trace of my emulator running the test, capturing all the JSRs into RAM locations, as well as the writes into the opcode_buffer. Full log here EAEA 20 2B 00 jsr $002B A:00 X:00 Y:00 P:26 SP:F8 CYC:208 SL:256 002B 0E F0 ...
by Bisqwit
Mon Mar 26, 2012 4:32 pm
Forum: NESemdev
Topic: CPU-test: cpu_dummy_writes [DONE]
Replies: 35
Views: 36147

My emu is hanging on the "Verifying opcodes.." part of the ppuwrite test :( Do you know what might be wrong? The culprit seems to be the "jsr opcode_buffer+4" at the @opcode_test_once routine... The "jsr opcode_buffer+4" is a dry-run of the opcode. The purpose is to al...
by Bisqwit
Mon Mar 26, 2012 12:13 am
Forum: NESemdev
Topic: CPU-test: cpu_exec_space [DONE]
Replies: 10
Views: 10806

Zepper wrote:OK, you probably knows this info, but I'm double-checking my code.
The only way of reading bit 6 ($40) set is activating frame IRQ by writing to $4017:$40.
My bad, I thought I had APU IRQs disabled, but I only had the CPU's I flag on which is why I was not noticing them.
by Bisqwit
Sun Mar 25, 2012 6:30 pm
Forum: NESemdev
Topic: CPU-test: cpu_exec_space [DONE]
Replies: 10
Views: 10806

Passed. :) When I enable the jmp to $4015, your emulator (and also puNES, and Nintendulator, and Nestopia) still passes the test even though they should not. I wonder how that is possible. For that to happen, $4015 would have to yield a $40 value, which happens when a frame IRQ is pending, but that...
by Bisqwit
Sun Mar 25, 2012 5:56 pm
Forum: NESemdev
Topic: CPU-test: cpu_exec_space [DONE]
Replies: 10
Views: 10806

Allright, added a test in which the APU space ($4010..$4017) is also tested (with exception of $4015, which is a readable port), but also the unallocated space from $4018 to $40FF. The link in the first post has both tests.
by Bisqwit
Sun Mar 25, 2012 5:06 pm
Forum: NESemdev
Topic: CPU-test: cpu_exec_space [DONE]
Replies: 10
Views: 10806

Anyway, much interesting that a readvalue(cpu->PC) makes difference, instead of just clocking the PPU. Only in such a contrived example as this. But technically, if the cartridge can monitor reads, it can also act on whether the CPU does this stuff or not. The same "rule" probably occurs ...
by Bisqwit
Sun Mar 25, 2012 3:29 pm
Forum: NESemdev
Topic: CPU-test: cpu_exec_space [DONE]
Replies: 10
Views: 10806

Nice. I updated the test and added test also for the RTI and BRK opcodes.

I have no idea why, but Nintendulator fails #18.
by Bisqwit
Sun Mar 25, 2012 2:42 pm
Forum: NESemdev
Topic: CPU-test: cpu_exec_space [DONE]
Replies: 10
Views: 10806

CPU-test: cpu_exec_space [DONE]

In case anyone ever gets an urge to write "JSR $2001" to their NES code, this test verifies that everything works as it should. Download test at: http://bisqwit.iki.fi/src/nes_tests/cpu_exec_space.zip NES Memory Execution Tests ---------------------------------- These tests verify that the...