Search found 38 matches

by davecom
Thu Jan 31, 2019 12:25 am
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

Re: SMB Crash at End of Second NameTable

Okay I solved it! As I suspected it did have to do with pulling from the wrong nametable address and it also was a one liner! For nametable byte address fetch I was using: address = (0x2000 + NAME_TABLE_ADDRESS) | (V & 0x0FFF); Where NAME_TABLE_ADDRESS was ((((word)PPU_CONTROL1) & 0b00000011) * 0x40...
by davecom
Wed Jan 30, 2019 11:08 pm
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

Re: SMB Crash at End of Second NameTable

Okay I finished building my nametables debugger. You can find a "just before the crash" screenshot of both the game (small window) and the 4 nametables (big window) here: before.png Then you will find an "after the crash" screenshot here: after.png As you can see from the screenshots, the text and c...
by davecom
Tue Jan 29, 2019 10:49 am
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

Re: SMB Crash at End of Second NameTable

Right, name tables get written by $2007. I can see incorrect tiles being written there right before the crash.
by davecom
Tue Jan 29, 2019 1:44 am
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

Re: SMB Crash at End of Second NameTable

I did a lot of investigating tonight. I'm pretty sure at this point that it's the nametables getting overwritten. Now, I need to figure out where they're getting overwritten from. I see the last action of my emulator before the game gets stuck is writing a column of tiles. Cleary these tiles are bei...
by davecom
Sat Jan 26, 2019 5:17 pm
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

Re: SMB Crash at End of Second NameTable

Thanks for helping me think through it. Yeah quite confident it's not a CPU bug—have passed all the CPU tests: blarg, nestest, nestress, etc. I've run quite a few and a few games run perfectly (Donkey Kong, Tennis, Baseball), so I don't think it's that. I do think you might be right about an increme...
by davecom
Sat Jan 26, 2019 1:02 pm
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

Re: SMB Crash at End of Second NameTable

Interesting possibly unrelated detail. I pass all of blarg's vram_access tests, but I am failing #3 of his sprite_ram tests. Notably "Address should increment on $2004 write." I doubt this is related, but I will look into it. Edit: Yeah it was unrelated. I fixed that and now pass all of blarg's spri...
by davecom
Sat Jan 26, 2019 12:54 pm
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

Re: SMB Crash at End of Second NameTable

Perhaps I don't fully understand how SMB utilizes the two nametables. One thing I notice looking at the debugger in Nintaco is that the status bar is always coming from the first nametable. So the fact that it disappears, says to me that maybe my first nametable is getting overwritten after I reach ...
by davecom
Sat Jan 26, 2019 12:41 pm
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

Re: SMB Crash at End of Second NameTable

edit: let me restate that. I'm guessing the sprite 0 isn't the cause of the bug, but is instead the symptom that leads to a crash instead of some other flaw. Yeah that's what I've been thinking too. That the sprite 0 isn't the cause of the bug, but the symptom of something wrong in the name-tables.
by davecom
Sat Jan 26, 2019 12:23 pm
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

Re: SMB Crash at End of Second NameTable

Sorry, I should have been more clear. The game crashes, not my emulator. When I look at what's going on in my emulator, it just gets into the usual checking for sprite zero hit loop and continues to execute. As you can see in the video, the other thing that happens is the sceen takes on a green tint...
by davecom
Sat Jan 26, 2019 7:08 am
Forum: NESemdev
Topic: SMB Crash at End of Second NameTable
Replies: 17
Views: 10485

SMB Crash at End of Second NameTable

I've attached a Quicktime video of the crash I'm experiencing when trying to run Super Mario Brothers 1. During either the title demo or actual execution of the game, my emulator crashes when the screen starts showing the area just beyond the first pipe. Looking in a debugger on Nintaco this appears...
by davecom
Wed Jan 23, 2019 1:55 am
Forum: NESemdev
Topic: Thank You and Reflections on Implementing a Basic NES Emu
Replies: 3
Views: 6349

Thank You and Reflections on Implementing a Basic NES Emu

I'm writing to extend a big thank you to the kind and patient people on this forum who took the time to share their knowledge with aspiring emu devs like myself. I appreciate all of the help you offered me and others as we dove into this esoteric and idiosyncratic world. I started an NES emulator pr...
by davecom
Fri Jan 18, 2019 9:41 pm
Forum: NESemdev
Topic: Donkey Kong Score Going the Wrong Way in Demo
Replies: 9
Views: 6432

Re: Donkey Kong Score Going the Wrong Way in Demo

I had so much trouble with SDC that I ended up copying a line of code from someone else's emulator to make it work. Not my proudest moment, I have attributed the line in my source code, but still. Yeah same I ended up looking up the line for the overflow in mynes and attributing it in my README. He...
by davecom
Fri Jan 18, 2019 1:49 pm
Forum: NESemdev
Topic: Donkey Kong Score Going the Wrong Way in Demo
Replies: 9
Views: 6432

Re: Donkey Kong Score Going the Wrong Way in Demo

I agree it's the most confusing thing to implement CPU wise. I had no problem with the carry (which the linked to threads go into in some detail). I had a lot more trouble with overflow, which the linked posts go into a lot less detail about. As mentioned in the linked threads, nestest will pass, bu...
by davecom
Fri Jan 18, 2019 6:16 am
Forum: NESemdev
Topic: Donkey Kong Score Going the Wrong Way in Demo
Replies: 9
Views: 6432

Re: Donkey Kong Score Going the Wrong Way in Demo

Turns out it was a bug in ADC/SBC. Specifically, overflow was not set correctly. Thanks.
by davecom
Thu Jan 17, 2019 7:46 am
Forum: NESemdev
Topic: Donkey Kong Score Going the Wrong Way in Demo
Replies: 9
Views: 6432

Donkey Kong Score Going the Wrong Way in Demo

Hi All, So, during the title screen demo, my Donkey Kong bonus score starts at 5000, but then goes to FF00, then F700, then 5800 and keeps going up. It should of course instead be going down to 4900, 4800, etc. I think this is probably caused by a CPU bug, but I don't see an obvious bug in the tests...