Search found 59 matches

by Dartht33bagger
Sat Apr 11, 2015 1:00 am
Forum: NESemdev
Topic: Attribute shift register reloading
Replies: 1
Views: 1779

Attribute shift register reloading

It's been almost a year since I've looked at my old NES emulator (and the code is ugly....ugh) but I want to get back in the swing of things. First off, I'd like to solve an issue that had been plaguing me for a while. I still cannot figure out how to correctly load the two attribute shift registers...
by Dartht33bagger
Sun Jan 05, 2014 1:08 am
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

Joe wrote:The next adjacent tile might change all the bits in the coarse X, but what about the previous adjacent tile?
Wouldn't the previous adjacent tile also potentially have all coarse X bits flipped?
by Dartht33bagger
Sun Jan 05, 2014 12:12 am
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

That makes perfect sense, but I'm not exactly sure how to remedy the issue. Potentially, every bit in the coarse X could flip by time the next attribute reload happens (which would be an adjacent tile). The only possible fix I can think of is only reloading the attribute registers every 16 cycles to...
by Dartht33bagger
Sat Jan 04, 2014 11:41 pm
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

Honestly, not so much. I can't seem to find anything on the wiki about how the attribute shift registers are filled. I wrote that piece of code in August and I want to say that I found the information in a thread on here somewhere. I can't find that thread either of course.
by Dartht33bagger
Sat Jan 04, 2014 11:10 pm
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

This is how I am fetching the attribute byte: attAddress = 0x23C0 | (ppuAddress & 0x0C00) | ((ppuAddress >> 4) & 0x38) | ((ppuAddress >> 2) & 0x07); attFetch = VRAM->readVRAM(attAddress); And this is how I'm filling the two attribute shift registers: { bool xBit, yBit; //Holds the coarse...
by Dartht33bagger
Sat Jan 04, 2014 10:24 pm
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

I flipped the way my shift registers were shifting and the order I was grabbing my tile bits and nothing is flipped anymore. Thanks guys!

The color on the top of the screen is still off on the demo screen. Could I have a bit issue again?
by Dartht33bagger
Sat Jan 04, 2014 9:01 pm
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

Alternatively, do you have the endianness of the PPU tiles backwards? PPU bits are big end first/on the left. I wasn't aware that the PPU was big endian. Where exactly would this effect things? The multiplexors for the shift registers maybe? The bit order in individual CHR tiles. It looks like each...
by Dartht33bagger
Sat Jan 04, 2014 8:41 pm
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

Joe wrote:Wait a minute, are all graphics horizontally flipped? You might be interpreting bit order backwards.
The "Donkey Kong" title seems to be correct and the demo stage seems to be the right way. The rest looks flipped. Which bit order do you mean exactly?
by Dartht33bagger
Sat Jan 04, 2014 8:32 pm
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

Thanks. I fixed those errors. I've been slowly removing repeated code as I see it, but sometimes it does slip by me. I'm insanely close now. I'm finally getting the title screen and the demo screen to show up. For some reason, the text below the Donkey Kong title is backwards and the demo screen is ...
by Dartht33bagger
Sat Jan 04, 2014 2:41 am
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

I've been working on my emulator quite a bit and I've made quite a bit of progress. I switched to SDL 2.0 for easier pixel manipulation, confirmed that my pattern tables, nametables, attribute tables and palettes are being filled correctly for Donkey Kong, confirmed that I am fetching the correct by...
by Dartht33bagger
Tue Dec 24, 2013 3:07 am
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

I made quite a bit of progress today. I switched from freeglut to SDL 1.2 because SDL's input looked much easier. I then took a dump of VRAM at the Donkey Kong title screen and compared my dump to a VRAM dump from Nintendulator. The good news is that I am writing to VRAM correctly because my pattern...
by Dartht33bagger
Mon Dec 23, 2013 9:29 pm
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

Ah yes! That is what I meant. My lower and upper background tile names came from my own code, which was obviously confusing. Where does the bitplane bit come from?
by Dartht33bagger
Mon Dec 23, 2013 8:04 pm
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

I think my main issue right now is that I don't know how to calculate the address for the lower background tile. The skinny on NES scrolling gives the formulas for calculating the nametable address and the attribute address: tile address = 0x2000 | (v & 0x0FFF) attribute address = 0x23C0 | (v &a...
by Dartht33bagger
Mon Dec 23, 2013 2:05 pm
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Re: Fixing my PPU

2. bit $10 of $2000 is correct but I don't really understand the rest of that code. How closely are you following loopy's PPU information? I've implemented everything from this document: http://wiki.nesdev.com/w/index.php/The_skinny_on_NES_scrolling . I can't find anything on the wiki about how to ...
by Dartht33bagger
Mon Dec 23, 2013 2:53 am
Forum: NESemdev
Topic: Fixing my PPU
Replies: 38
Views: 11131

Fixing my PPU

Alright guys, I'm back. School is over and I'm ready to work on my NES emulator again. I'm still working on getting backgrounds to render correctly. I've tested the individual functions of my PPU and they *seem* to work correctly on their own. With that said, rendering still isn't correct, so I have...