It is currently Fri Oct 18, 2019 4:15 pm

All times are UTC - 7 hours

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Background color
PostPosted: Wed Mar 02, 2005 11:41 pm 
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1849
While we're somewhat on the subject of Micro Machines... I'm noticing it relies on oddball bg color behavior to draw it's multicolored bars. If you just use palette[0], ugly black patches get placed in their stead.

I recall that games have to reset the palette address before using the PPU address. I've seen code like the following in several games:

LDA #$3F
STA $2006
LDA #$00
STA $2006
STA $2006
STA $2006

I'm guessing the first address set resets something relating to the palette which specifies palette[0] to be used as the background color... and the second write moves the ppu address away from the palette so that further PPU action won't change the BG color.

Am I close? I've tried using varying background colors in attempts to get the bars showing up in Micro Machines. I've gotten close to correcting it with the following logic:

On the second $2006 write - set the BG color to (PPU_Address & 0x0C)
On writes to ppu $3F00-$3FFF (through $2007) - set the BG color to the same after the increment.

This gets the bars dispaying properly, but doesn't reset the BG color back to black like it should (messing up the BG color for later in the frame).

Anyway... I know I'm barking up the right tree with this. I've been tinkering with several ideas but I just can't seem to get it to work right. How exactly is the BG color determined?

Thanks in advance for any help any of you can give me.

EDIT ---

Thanks to some info by Hyde, I've been able to get it working! I'm using the methods above... along with the same implimentation on $2007 reads... but I'm only using that BG color when BG rendering is disabled. When BG rendering is enabled... I use $3F00 regardless. This seems to fix the problem.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 7 hours

Who is online

Users browsing this forum: MSN [Bot] and 6 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