It is currently Wed Nov 14, 2018 7:11 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Palette color > $3f
PostPosted: Fri Jul 04, 2014 8:26 am 
Offline

Joined: Wed Apr 16, 2014 2:01 pm
Posts: 5
I noticed that Mike Tyson's Punch-Out writes a value of $8f into the background palette ($3f00). I assume this value should be masked by $3f and thus displayed as color $0f.

But now I'm wondering, if the value is read back through $2007, do you get $8f or $0f?


Top
 Profile  
 
 Post subject: Re: Palette color > $3f
PostPosted: Fri Jul 04, 2014 8:41 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7567
Location: Chexbres, VD, Switzerland
You get $0f.
The high 2 bits aren't even stored anywhere.

Also palette read-back in general is somewhat un-reliable.


Top
 Profile  
 
 Post subject: Re: Palette color > $3f
PostPosted: Fri Jul 04, 2014 9:01 am 
Offline

Joined: Wed Apr 16, 2014 2:01 pm
Posts: 5
All right, thanks much.


Top
 Profile  
 
 Post subject: Re: Palette color > $3f
PostPosted: Fri Jul 04, 2014 9:02 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20765
Location: NE Indiana, USA (NTSC)
I thought palette readback was fine (due to use of SRAM) and OAM readback was unreliable (due to a half-@$$ed DRAM controller). Is there a test ROM?

Anyway, assuming that palette readback is reliable: Because palette reads come from inside the PPU, they aren't subject to the 1-byte delay for video memory readback. Bits 5-0 of the read palette value come from CGRAM (the palette memory inside the PPU), and I seem to remember that bits 7 and 6 of the read palette value come from open bus, which is the last value on the data bus (which in this case is $20, the high byte of the address).


Top
 Profile  
 
 Post subject: Re: Palette color > $3f
PostPosted: Fri Jul 04, 2014 9:12 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3135
Location: Tampere, Finland
From my experience making the PowerPak save state mappers, palette readback doesn't seem to work on all PPU revisions. It does work on PAL PPU.

Here's a relevant post: viewtopic.php?p=64340#p64340

BTW, the post refers to Famicom Titler, which uses the RGB PPU, but I'm pretty sure I've had problems with palette readback on some NTSC composite PPUs also.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi


Top
 Profile  
 
 Post subject: Re: Palette color > $3f
PostPosted: Fri Jul 04, 2014 9:22 am 
Offline

Joined: Wed Apr 16, 2014 2:01 pm
Posts: 5
Interesting. Palette read is tested in Blargg's palette_ram.nes, so I had assumed it was reliable.


Top
 Profile  
 
 Post subject: Re: Palette color > $3f
PostPosted: Sat Jul 05, 2014 7:01 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1440
tepples wrote:
I seem to remember that bits 7 and 6 of the read palette value come from open bus, which is the last value on the data bus (which in this case is $20, the high byte of the address).

"Open bus" for the PPU is different from the CPU - as I recall, what you actually get for bits 6 and 7 is the last value asserted on the PPU I/O data pins, just like when you read any write-only register.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group