Primary Zelda Hacking
April 21, 2014, 09:26:04 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: There is now an official Primary Zelda Hacking Press!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: A Brief Overview on Palette Fades  (Read 238 times)
Lin
ZOLE Creator
Administrator
Hero Member
*****
Online Online

Posts: 580



View Profile
« on: July 18, 2011, 04:10:16 AM »

Warning: This is kind of confusing, but it was even harder to figure out, so if you're not up to the challenge, back off.

Okay. In the games, there is a few bytes in the RAM that control a palette fade, and is probably used during the palette transitions, but I don't know for sure. Now, this guide will only cover Oracle of Ages since I don't know any memory addresses for Seasons.

Memory address C4AB is a very important byte. It's a procedure index and will point to procedures that do math to some more values we'll cover and mess with the palette. For this guide, I'll only be using 03, since it's used strictly for fading to black and I'm sure the same things apply to 01, and then partially 02/04. But anyway, let's begin.

After C4AB is C4AC, and this is the "subtraction factor". C2FF and C4AC are together in which C4AC is subtracted from C2FF, and when a second carry is reached (so it seems) or the result is 00, the palette should be black, and if the second carry is reached, it will stop (This is how you get near-black results). I recommend you leave C2FF as 00 and set C4AC to 01-03. The lower the value, the faster.

There are 4 more important values next. They control which palettes change, and are paired in two's, meaning the pairs have to have the same values. Pair 1's values are at C4B1 and C4B3, and they control the background palette indexes to fade. For example, bit 0 controls the first 4 colors, bit 1 controls the second 4 colors, and so on. If C4B1 is FF (Which would mean all colors), then C4B3 would have to be FF as well. The other pair's values are C4B2 and C4B4, and they control the sprite palettes to fade. If you wanted to fade the background to black and leave sprites visible, you'd set these values to 00.

Now example time - if you wanted to make the screen fade to black while having the top header and all sprites visible, here's how the values would go.

C4AB = 03
C4AC = 01+
C4B1 = FC
C4B2 = 00
C4B3 = FC
C4B4 = 00
C2FF = 00

And that's all. Enjoy, learn from it. I do know some more stuff but I mainly just wanted to go over this.

~Lin
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!