The current URL is datacrystal.tcrf.net.
EarthBound/Palette Memory: Difference between revisions
(Start creating page) |
(Finish documenting memory) |
||
Line 21: | Line 21: | ||
===<tt>$7E43DA</tt>: Onett average blue<span class="anchor" id="$7E43DA"></span>=== | ===<tt>$7E43DA</tt>: Onett average blue<span class="anchor" id="$7E43DA"></span>=== | ||
Average | Average blue value in all non-zero colors in the [[EarthBound:Map_Data:Global_Tileset/Palette_Table#Onett|Onett daytime palette]]. Always <tt>#$0074</tt> in unmodified EarthBound. Computed by subroutine at [[EarthBound:ASM:Palette_Routines#$C005E7|$C005E7]]. Used for comparisons between map palettes in order to adjust sprite palettes. | ||
''Note: EarthBound is rather wasteful by loading this palette and computing this average on every sector graphics load. It is all based on constant ROM data, so the developers could have just hardcoded the result.'' | ''Note: EarthBound is rather wasteful by loading this palette and computing this average on every sector graphics load. It is all based on constant ROM data, so the developers could have just hardcoded the result.'' | ||
===<tt>$7E445C</tt>: Animation palette remaining frames<span class="anchor" id="$7E445C"></span>=== | |||
If the current map palette is animated, stores the number of remaining frames for the current animation palette. Upon reaching zero, the next animation palette is loaded from [[#7EB800|Decompressed Map Animation Palettes]], and the remaining frames value is set from [[#$7E4460|Map Animation Palette Frame Durations]]. | |||
===<tt>$7E445E</tt>: Map animation palette number<span class="anchor" id="$7E445E"></span>=== | |||
If the current map palette is animated, stores the current animation palette number, that is the current index into [[#$7E4460|Map Animation Palette Frame Durations]] and [[#7EB800|Decompressed Map Animation Palettes]]. | |||
===<tt>$7E4460-$7E4471</tt>: Map animation palette frame durations<span class="anchor" id="$7E4460"></span>=== | |||
If the current map palette is animated, contains a table of the number of frames each animation palette will be active before loading the next. 2-byte entries for each of up to 8 animation palettes, followed by at least 1 zero entry, for a total of 9 entries. | |||
Indexed by the [[#$7E445E|Map Animation Palette Number]]: <code>duration_pointer = #$7E4460 + animation_palette_number * #2</code>. | |||
===<tt>$7EB800-$7EBDFF</tt>: Decompressed map animation palettes<span class="anchor" id="$7EB800"></span>=== | |||
If the current map palette is animated, contains the animation palettes decompressed from an entry in the [[EarthBound:Map_Data:Palette_Animation_Table|Palette Animation Table]]. Up to 8 animation palettes, each containing 6 subpalettes at 16 colors each for a total of <tt>0xC0</tt> bytes per animation palette, just like normal non-animated map palettes. | |||
Indexed by the [[#$7E445E|Map Animation Palette Number]]: <code>animation_palette_pointer = #$7EB800 + animation_palette_number * #$C0</code>. These pointers are precomputed in the [[EarthBound:Map_Data:Decompressed_Map_Animation_Palette_Pointer_Table|Decompressed Map Animation Palette Pointer Table]]. | |||
[[Category:EarthBound|Palette memory]] | [[Category:EarthBound|Palette memory]] | ||
Revision as of 15:46, 1 July 2023
This is a sub-page of EarthBound.
$7E43D0: Map palette average red
Average red value in all non-zero colors in the current map palette. Computed by subroutine at $C00391. Used for comparisons between map palettes in order to adjust sprite palettes.
$7E43D2: Map palette average green
Average green value in all non-zero colors in the current map palette. Computed by subroutine at $C00391. Used for comparisons between map palettes in order to adjust sprite palettes.
$7E43D4: Map palette average blue
Average blue value in all non-zero colors in the current map palette. Computed by subroutine at $C00391. Used for comparisons between map palettes in order to adjust sprite palettes.
$7E43D6: Onett average red
Average red value in all non-zero colors in the Onett daytime palette. Always #$008A in unmodified EarthBound. Computed by subroutine at $C005E7. Used for comparisons between map palettes in order to adjust sprite palettes.
Note: EarthBound is rather wasteful by loading this palette and computing this average on every sector graphics load. It is all based on constant ROM data, so the developers could have just hardcoded the result.
$7E43D8: Onett average green
Average green value in all non-zero colors in the Onett daytime palette. Always #$0096 in unmodified EarthBound. Computed by subroutine at $C005E7. Used for comparisons between map palettes in order to adjust sprite palettes.
Note: EarthBound is rather wasteful by loading this palette and computing this average on every sector graphics load. It is all based on constant ROM data, so the developers could have just hardcoded the result.
$7E43DA: Onett average blue
Average blue value in all non-zero colors in the Onett daytime palette. Always #$0074 in unmodified EarthBound. Computed by subroutine at $C005E7. Used for comparisons between map palettes in order to adjust sprite palettes.
Note: EarthBound is rather wasteful by loading this palette and computing this average on every sector graphics load. It is all based on constant ROM data, so the developers could have just hardcoded the result.
$7E445C: Animation palette remaining frames
If the current map palette is animated, stores the number of remaining frames for the current animation palette. Upon reaching zero, the next animation palette is loaded from Decompressed Map Animation Palettes, and the remaining frames value is set from Map Animation Palette Frame Durations.
$7E445E: Map animation palette number
If the current map palette is animated, stores the current animation palette number, that is the current index into Map Animation Palette Frame Durations and Decompressed Map Animation Palettes.
$7E4460-$7E4471: Map animation palette frame durations
If the current map palette is animated, contains a table of the number of frames each animation palette will be active before loading the next. 2-byte entries for each of up to 8 animation palettes, followed by at least 1 zero entry, for a total of 9 entries.
Indexed by the Map Animation Palette Number: duration_pointer = #$7E4460 + animation_palette_number * #2
.
$7EB800-$7EBDFF: Decompressed map animation palettes
If the current map palette is animated, contains the animation palettes decompressed from an entry in the Palette Animation Table. Up to 8 animation palettes, each containing 6 subpalettes at 16 colors each for a total of 0xC0 bytes per animation palette, just like normal non-animated map palettes.
Indexed by the Map Animation Palette Number: animation_palette_pointer = #$7EB800 + animation_palette_number * #$C0
. These pointers are precomputed in the Decompressed Map Animation Palette Pointer Table.