It is currently Wed Oct 17, 2018 8:26 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Sep 05, 2018 9:50 am 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2004
Location: Fukuoka, Japan
I have one scenario where the text color clashes with the rest of the background. This cause that I cannot set that background tile to the proper color because of the overlap.

Since I will need to change mid-frame the chr bank to display the text (it doesn't fit with the rest of the background), maybe it would be possible to change the color to alleviate this issue?

What are the things that I should be careful about? I think if I only change 1 color of the palette by closing rendering then in vblank put back the BG color then it would be fine?

What are the pitfalls?


Top
 Profile  
 
PostPosted: Wed Sep 05, 2018 10:08 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10897
Location: Rio de Janeiro - Brazil
The main pitfalls with changing the palette mid-frame are:

1- You have to disable rendering mid-frame, which can corrupt OAM on the next frame (the corruption will happen at the start of the next frame, so even a full OAM DMA during vblank won't prevent that). It seems it's safe to disable rendering in scanlines where there are no sprites or if you do it as close to the end of the scanline as possible (I don't know the details).

2- Accessing palette RAM during rendering time will cause the color pointed by the VRAM address register to be displayed on screen, so if you don't want any color glitches, you only have the time of hblank to change colors.

The good news is that you don't want to do it in the middle of the action, so you'll probably be able to avoid the sprite problem, and can also spare a few scanlines to make sure that the critical stuff is done during successive hblanks.


Top
 Profile  
 
PostPosted: Wed Sep 05, 2018 11:45 am 
Offline
User avatar

Joined: Fri Feb 27, 2009 2:35 pm
Posts: 294
Location: Fort Wayne, Indiana
If you can (and I'm understanding correctly that you'd be able to do what you wanted if the 16 pixel tall size were smaller), I'd probably look into mid-frame scrolling changes first, since they seem a lot less messy. Klax uses them to achieve 16x8 attributes, just skipping every other row in the nametable.


Top
 Profile  
 
PostPosted: Wed Sep 05, 2018 11:53 am 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1250
I'll be the person that asks the dumb question. Are there more than four total background palette sets on screen? If not, the bg attribute limitation probably doesn't need to be a huge factor:
Image
You'll see the text scroll up "off grid" seemingly ignoring the attribute grid. No palette changes are needed.

So is the issue that the palettes for the scene itself don't contain the text color/background color in the same palette? If there IS a palette that contains them both, it's a much easier problem.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Wed Sep 05, 2018 12:25 pm 
Offline
User avatar

Joined: Fri Nov 24, 2017 2:40 pm
Posts: 82
That has to be a screen split. You can't get pixel perfect scrolling like that otherwise.


Top
 Profile  
 
PostPosted: Wed Sep 05, 2018 1:13 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1250
I know it's a screen split, but it's NOT is a palette change mid frame which is what the topic is asking about. I was trying to get information about whether a scroll change would suffice, because a palette change is a little harder and maybe not necessary for the end goal.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Wed Sep 05, 2018 7:35 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2004
Location: Fukuoka, Japan
Unexpected answers in the thread but actually it would make sense for that screen. Since I need to split it 3 times, the last part where the bank must be switched could have a gap of 8 pixels, allowing the text to be in the next row where attributes are fine and I would just switch the bank and scroll the Y 8 pixel lower to make it looks like to original target.

Now I know about what possible with palette and tricks for attributes. thanks everyone!


Top
 Profile  
 
PostPosted: Thu Sep 06, 2018 2:28 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7548
Location: Chexbres, VD, Switzerland
You should definitely look at Wizards & Warrior games and see how they do this for their status bar, basically you'll have to do the same. (If I remember well W&W1 and 3 does this, but not W&W 2; I could be wrong). Personally if I'd want to "do things the NES way" I'd avoid doing this whether possible, and only use this at last ressort if I really badly need more colours. Using trickery to re-use the same colours for different objects is more "the NES way to do it".


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: TmEE 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