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 a few questions I'd like to ask.
1. On the PPU rendering diagram on the wiki, there is a line that states that the PPU doesn't output a pixel until cycle 4. If the final pixel is rendered on cycle 256 and the screen is 256 pixels wide, shouldn't the first pixel be rendered on cycle 1 (this is what I'm doing).
2. Am I getting my background tile addresses correctly? I'll include the current code that I am using, but I cannot for the life of me find where I found the document that gave me this information (namefetch holds the data at the nametable address):
3. Do the attribute registers actually shift? Since each attribute register is just filled up with either eight 1's or eight 0's, isn't it okay to just leave the registers until the next 8 cycles pass?
4. I'm currently using the RGB color values for the NES pallete from the NESDOC.pdf from 2004. Are these correct? Or is a there a better source for the RGB values?
Those are all the questions I can come up with for now. I'll include two pictures that show what my screen looks like. The blue blocks is the screen I get when I first load the game, and the white blocks occur once the demo starts. The right half of blocks on the white screen do move up and down slowly, so I know at least something is happening.
If it helps, here is all my code on Github: https://github.com/Dartht33bagger/NES-Emulator. I'm not really looking for anyone to do the work for me - just put me in the right direction. Thanks!
1. On the PPU rendering diagram on the wiki, there is a line that states that the PPU doesn't output a pixel until cycle 4. If the final pixel is rendered on cycle 256 and the screen is 256 pixels wide, shouldn't the first pixel be rendered on cycle 1 (this is what I'm doing).
2. Am I getting my background tile addresses correctly? I'll include the current code that I am using, but I cannot for the life of me find where I found the document that gave me this information (namefetch holds the data at the nametable address):
Code:
if(reg2000 & 0x10) tileAddress = 0x1000 | (nameFetch << 4) | ((ppuAddress & 0x7000) >> 12);
else tileAddress = 0x0000 | (nameFetch << 4) | ((ppuAddress & 0x7000) >> 12);
else tileAddress = 0x0000 | (nameFetch << 4) | ((ppuAddress & 0x7000) >> 12);
3. Do the attribute registers actually shift? Since each attribute register is just filled up with either eight 1's or eight 0's, isn't it okay to just leave the registers until the next 8 cycles pass?
4. I'm currently using the RGB color values for the NES pallete from the NESDOC.pdf from 2004. Are these correct? Or is a there a better source for the RGB values?
Those are all the questions I can come up with for now. I'll include two pictures that show what my screen looks like. The blue blocks is the screen I get when I first load the game, and the white blocks occur once the demo starts. The right half of blocks on the white screen do move up and down slowly, so I know at least something is happening.
If it helps, here is all my code on Github: https://github.com/Dartht33bagger/NES-Emulator. I'm not really looking for anyone to do the work for me - just put me in the right direction. Thanks!