This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

did I miss something?

did I miss something?
by on (#60368)
I figure this is one of those questions that may or not be mentioned in the Wiki or the messageboards but is obscure enough to come out and ask. can I read the PPU pallette? I thought it was possible, but it seems this block of code

Code:

   lda   $2002
   lda   #$3F
   sta   $2006
   ldx   #$01
   stx   $2006
   
   ldx   $2007
   ldx   $2007
   inx
   stx   $2007


has no effect on x. unless it's got something to do with the x register or my emulator (FCEUXd 1.0), am I correct in assuming that it's the palette region of the NES PPU that just can't be read?

by on (#60369)
Well I think you can read the palette, but that reads are NOT delayed like VRAM reads. I'm not exactly sure tough.
This code would have the effect to make palette color [3] = color [2] +1

by on (#60370)
+1 to what Bregalad said.

by on (#60371)
What they said. While other parts of VRAM need two read instructions before the first byte of actual data is returned, the palette area doesn't have this delay.

Also, be sure to use more than one emulator to test your programs, specially when this one emulator is not particularly known for its accuracy.

by on (#60373)
Got it. the Emulator was the problem affter all. I noticed after I ran the program in FCEUX 2.1.1

could it also have something to do with the mapper (ines 002) that I'm using, or the way the emulator handles it?

by on (#60375)
Roni wrote:
could it also have something to do with the mapper (ines 002) that I'm using, or the way the emulator handles it?

Not at all, mapper 2 is one of the simplest mappers around, and its functions have nothing to do with the video hardware (except for the fact that it uses CHR-RAM, but that's completely unrelated).

This is just how palette RAM works. Palette RAM stays inside the PPU chip (unlike the pattern, name and attribute tables), so maybe it can retrieve that data faster than data from other parts of video memory.

by on (#60410)
tokumaru wrote:
Palette RAM stays inside the PPU chip (unlike the pattern, name and attribute tables), so maybe it can retrieve that data faster than data from other parts of video memory.


I thought the nametable and attribute table as well as palette were stored in the PPU's internal RAM...if not then where are they held?

by on (#60419)
There is no such a thing as PPU internal RAM. The RAM for nametable is a separate 2k chip inside the NES, and CHR-ROM or CHR-RAM is on cartridge (yeah technically the 2k chip inside the NES could also be used as CHR-RAM, as the cartridge can control it's higher adress line and enable line) but I don't think anyone ever did that.

The confusion comes because so many people here (as well as FCEU and Nintendulator emulators) MISTAKENLY call pattern table and name table RAM "PPU RAM" when this is a completely wrong name - the correct name should be VRAM (Video RAM), or "WRAM-that-is-acceded-by-the-PPU" (which sounds too long to me).

The only "RAM" that is inside the PPU is palette and OAM memory, and both of those are typically stored somewhere in RAM and transfered to the PPU every VBlank.

by on (#60421)
har har

Bregalad wrote:
There is no such a thing as PPU internal RAM.
[snip]
The only "RAM" that is inside the PPU is palette and OAM memory


=P

by on (#60426)
Roni wrote:
I thought the nametable and attribute table as well as palette were stored in the PPU's internal RAM...if not then where are they held?

If you look at the mainboard of a NES you'll see two 2KB RAM chips: one is the work RAM and the other is for the name and attribute tables. Even though that memory is only accessible by the PPU, it's not internal to the PPU (just like work RAM isn't internal to the CPU either).