cpu_timing_test6 by Blargg

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
cmoh89
Posts: 4
Joined: Sat Feb 12, 2011 10:57 am

cpu_timing_test6 by Blargg

Post by cmoh89 » Sun Feb 27, 2011 1:16 pm

The read me said to post Unknown Erros to the forum, so the following is the error I'm getting when testing my emulation.


6502 Timing Test (16 Seconds)
Official Instructions Only
Fail OP :$00
Unknown Error
$019B

If you have any advice/knowledge on what could possibly be wrong with my emulation that would cause this error, that would be great if you could share that to me.

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

Post by Zepper » Sun Feb 27, 2011 5:23 pm

- It's the BRK. Do you know the BRK timing diagram?

Code: Select all

        1    PC     R  fetch opcode, increment PC
        2    PC     R  read next instruction byte (and throw it away),
                       increment PC
        3  $0100,S  W  push PCH on stack, decrement S
        4  $0100,S  W  push PCL on stack, decrement S
        5  $0100,S  W  push P on stack (with B flag set), decrement S
        6   $FFFE   R  fetch PCL
        7   $FFFF   R  fetch PCH

cmoh89
Posts: 4
Joined: Sat Feb 12, 2011 10:57 am

Post by cmoh89 » Sun Mar 20, 2011 1:29 pm

I do not know the BRK timing diagram. Can you point me in the right direction to find more infomation about it?

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

Post by Zepper » Tue Mar 22, 2011 6:19 am

Perhaps I wasn't crystal clear. Look at my message: it has how the BRK works, cycle by cycle (first column at left).

cmoh89
Posts: 4
Joined: Sat Feb 12, 2011 10:57 am

Post by cmoh89 » Tue Mar 22, 2011 7:05 am

Thank you. I didn't understand what the code was representing originally. Now, it makes sense to me.

User avatar
cartlemmy
Posts: 193
Joined: Fri Sep 24, 2010 4:41 pm
Location: California, USA
Contact:

Post by cartlemmy » Tue Mar 22, 2011 8:09 am

Zepper wrote:...the BRK timing diagram
That's pretty cool, is there similar diagrams for all the instructions, or did you just create this for this case?

tepples
Posts: 21748
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Tue Mar 22, 2011 8:26 am

I don't know about the 6502 data sheet (don't have it in front of me), but the 65C816 data sheet that I often referred to back when I coded for an Apple IIGS has similar diagrams.

albailey
Posts: 177
Joined: Thu Jul 13, 2006 3:15 pm

Post by albailey » Tue Mar 22, 2011 8:55 am

About halfway down this document it looks to describe most of what is wanted:

http://nesdev.com/6502_cpu.txt

Al

Hamburgler
Posts: 36
Joined: Wed Jul 04, 2007 8:40 am

Post by Hamburgler » Tue Mar 22, 2011 10:55 am

Also useful:

http://users.telenet.be/kim1-6502/6502/hwman.html#AA
Appendix A - SUMMARY OF SINGLE CYCLE EXECUTION

Post Reply