Search found 59 matches

by Dartht33bagger
Wed Sep 25, 2013 3:21 am
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

For some reason my BRK instruction is not working correctly. I can't for the life of me figure out why. For some reason, the PC just goes to some crazy wrong value. What am I doing wrong? case 0x00: //BRK data = ((PC & 0xFF00) >> 8); //Push high byte first pushStack(memory, data, ppu); data = PC...
by Dartht33bagger
Sat Sep 21, 2013 12:47 am
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

Almost no progress to report this week. I spent a lot of time trying to figure out some financial problems that I had for school, so I didn't really work on this at all. I'm starting school again a week, so I doubt I'll get this thing running anything before then. I'll be taking systems programming ...
by Dartht33bagger
Thu Sep 12, 2013 12:48 am
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

Well Grapeshot, you were right. The ppu timing is off just enough that I'm not passing the BIT tests when I need to. Time to figure out why my ppu timing isn't right like I had thought it was. Edit: I'm happy to report that I do get output now on 03-immedaite. I'm missing the illegal opcodes but non...
by Dartht33bagger
Thu Sep 12, 2013 12:22 am
Forum: NESemdev
Topic: Techniques for skipping unofficial instructions
Replies: 11
Views: 3897

Re: Techniques for skipping unofficial instructions

This thread gave me the kick in the butt I needed to finally sit down and make a lookup table for instruction lengths and cycle numbers :D
by Dartht33bagger
Wed Sep 11, 2013 12:08 am
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

I'll mess with that tomorrow I suppose. I have a PPU written that has code for displaying nametables, but it doesn't work nearly as well as I'd hoped. When a test passes, I just get a solid white line down down the right side of the screen. Donkey Kong used to display a bunch of light blue rectangle...
by Dartht33bagger
Tue Sep 10, 2013 11:35 pm
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

It'd be better to make a log of the core CPU test that doesn't do any PPU stuff. It has a different starting address. Hmmm, I see that the one mentioned on the wiki does just this, and has no $2002 reads in the log. This is the way to go. My cpu passes that test up until the illegal opcodes come in...
by Dartht33bagger
Tue Sep 10, 2013 8:44 pm
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

Nintendulator's log doesn't even make sense, or it's lying about the value read from $2002. Exactly. I have no idea what how it's getting those results since they look nothing like what I'm expecting. I suspect some confusion may have arisen from the fact that Nintendulator's debugger displays valu...
by Dartht33bagger
Tue Sep 10, 2013 1:57 pm
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

Alright, I'm just going to post the lines in question from the two logs files the best that I can. My log file will be using code that doesn't not the V and N bits and clears bit 7 of $2002 after read. From Nintendulator's log: E944 2C 02 20 BIT $2002 = FF A:00 X:01 Y:18 P:24 SP:FB CYC: 0 SL:171 E94...
by Dartht33bagger
Tue Sep 10, 2013 12:31 am
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

$2002 should definitely not return $FF forever. At the very least, the MSB should be cleared after you read from it. That's what my code originally did but it was wrong according to Nintendulator. Nintendulator kept $FF in $2002 and I had $7F in $2002, which vimdiff didn't like since the log files ...
by Dartht33bagger
Mon Sep 09, 2013 11:35 pm
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

I took Grapeshot's suggestion and went with it. I'm running through 03-immediate right now. Somehow my $2C BIT test isn't working right. Everything matches up for 9000+ lines until Nestendulator just randomly switches up how $2C works. I can't post the lines in question because the formatting gets m...
by Dartht33bagger
Mon Sep 09, 2013 1:04 pm
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

I tried a variant of my cpu core once before that moved the PC counter accordingly for the unoffical opcodes but nothing more. This caused a lot of issues on the nestest, however, because the processor status flags weren't correct when branch instructions came up. Maybe it would have a different aff...
by Dartht33bagger
Sun Sep 08, 2013 11:11 pm
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Re: Debugging the cpu core

I was using that test originally, but I switched over to yours because the nestest tests illegal opcodes. My cpu is correct up until the illegal opcodes start. Some of my illegal opcodes aren't right and I couldn't figure out the correct behavior for their flags, so I turned them off.
by Dartht33bagger
Sun Sep 08, 2013 7:30 pm
Forum: NESemdev
Topic: Debugging the cpu core
Replies: 30
Views: 10616

Debugging the cpu core

I thought I'd just make a new thread for this. I've been trying for weeks now to debug my cpu core and I just don't know where to go from here. My core passes some of blarg's tests. Here are what each of the tests do: 01-basics: passes 02-implied: passes 03-immediate: Doesn't pass. $6000 = $80 no ma...
by Dartht33bagger
Sat Aug 31, 2013 1:45 am
Forum: NESemdev
Topic: Need some help with the PPU
Replies: 73
Views: 30758

Re: Need some help with the PPU

Ok. I sat down tonight and wrote functions to get addresses in the CPU instead of having each instruction get the address. Could you guys check my functions out to make sure everything is right (it should be)? //Get address functions const unsigned short cpu::zeroPageX(memory* memory, ppu* ppu) { un...
by Dartht33bagger
Fri Aug 30, 2013 1:50 pm
Forum: NESemdev
Topic: Need some help with the PPU
Replies: 73
Views: 30758

Re: Need some help with the PPU

I've looked over another core a few weeks ago and it looked to be doing the same thing that mine does. I'll try your dumping method though and see if I can't figure this out. Here are $81 and $91: case 0x81: //Indirect,X store A to memory temp1 = (memory->readRAM(PC, ppu) + X) & 0xFF; //Wraps ar...