Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

EarthBound/Map Data/Palette Pointer Table: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Clean up description of table and fix category.)
(Document number of palettes per tileset)
Line 16: Line 16:


Each entry is a (little-endian) SNES address pointer into the [[EarthBound:Map_Data:Palettes|map palettes]] (<tt>$DA7CA7</tt> or ROM offset <tt>0x1A7EA7</tt>), representing the start of the block of palettes for a tileset. Entries are indexed by tileset number (from the [[EarthBound:Map_Data:Global_Tileset/Palette_Table|Global_Tileset/Palette_Table]]), so the pointer for a particular tileset can be found using the formula <code>palette_pointer_address = $ef10fb + tileset_number * 4</code> or <code>palette_pointer_offset = 0x2f12fb + tileset_number * 4</code>. There are 32 valid tileset numbers, giving the Palette Pointer Table a total of 32 entries and 128 bytes.
Each entry is a (little-endian) SNES address pointer into the [[EarthBound:Map_Data:Palettes|map palettes]] (<tt>$DA7CA7</tt> or ROM offset <tt>0x1A7EA7</tt>), representing the start of the block of palettes for a tileset. Entries are indexed by tileset number (from the [[EarthBound:Map_Data:Global_Tileset/Palette_Table|Global_Tileset/Palette_Table]]), so the pointer for a particular tileset can be found using the formula <code>palette_pointer_address = $ef10fb + tileset_number * 4</code> or <code>palette_pointer_offset = 0x2f12fb + tileset_number * 4</code>. There are 32 valid tileset numbers, giving the Palette Pointer Table a total of 32 entries and 128 bytes.
==Number of palettes per tileset==
The number of palettes associated with each tileset varies, but because the pointer table points to a contiguous block of palettes, all in order by tileset, and each palette is a consistent <tt>0xc0</tt> bytes, the pointer table values can be used to determine the number of palettes associated with each tileset.  The determination can be made using the formula <code>num_palettes = (tileset_plus_one_table_pointer_value - tileset_table_pointer_value) / 0xc0</code>.
{| border=1 cellspacing=0 cellpadding=3
! Tileset number !! Tileset name !! Num associated palettes
|-
| <tt>00</tt> || Lost Underworld || 4
|-
| <tt>01</tt> || Onett || 3
|-
| <tt>02</tt> || Twoson || 4
|-
| <tt>03</tt> || Threed || 2
|-
| <tt>04</tt> || Fourside || 2
|-
| <tt>05</tt> || Magicant || 4
|-
| <tt>06</tt> || Outdoors || 7
|-
| <tt>07</tt> || Summers || 1
|-
| <tt>08</tt> || Dusty Dunes Desert || 2
|-
| <tt>09</tt> || Dalaam || 6
|-
| <tt>10</tt> || ?? || 8
|-
| <tt>11</tt> || ?? || 8
|-
| <tt>12</tt> || ?? || 8
|-
| <tt>13</tt> || ?? || 4
|-
| <tt>14</tt> || ?? || 8
|-
| <tt>15</tt> || ?? || 8
|-
| <tt>16</tt> || ?? || 4
|-
| <tt>17</tt> || ?? || 8
|-
| <tt>18</tt> || ?? || 1
|-
| <tt>19</tt> || ?? || 7
|-
| <tt>20</tt> || ?? || 8
|-
| <tt>21</tt> || ?? || 5
|-
| <tt>22</tt> || ?? || 5
|-
| <tt>23</tt> || ?? || 4
|-
| <tt>24</tt> || ?? || 5
|-
| <tt>25</tt> || ?? || 8
|-
| <tt>26</tt> || ?? || 6
|-
| <tt>27</tt> || ?? || 5
|-
| <tt>28</tt> || ?? || 6
|-
| <tt>29</tt> || ?? || 6
|-
| <tt>30</tt> || ?? || 3
|-
| <tt>31</tt> || ?? || ??
|}


[[Category:EarthBound:Map_Data|Palette Pointer Table]]
[[Category:EarthBound:Map_Data|Palette Pointer Table]]

Revision as of 03:36, 16 June 2023

This is a sub-page of EarthBound/Map Data.

Palette Pointer Table
Game EarthBound
Start Address 0x2F12FB
End Address 0x2F137A
# of Entries 32
Entry Length 4 bytes (0x4)
Total Length 128 bytes (0x80)
Back to the ROM map

Table mapping between tileset numbers (from the Global_Tileset/Palette_Table) and map palettes for that tileset.

Format

Each entry is a (little-endian) SNES address pointer into the map palettes ($DA7CA7 or ROM offset 0x1A7EA7), representing the start of the block of palettes for a tileset. Entries are indexed by tileset number (from the Global_Tileset/Palette_Table), so the pointer for a particular tileset can be found using the formula palette_pointer_address = $ef10fb + tileset_number * 4 or palette_pointer_offset = 0x2f12fb + tileset_number * 4. There are 32 valid tileset numbers, giving the Palette Pointer Table a total of 32 entries and 128 bytes.

Number of palettes per tileset

The number of palettes associated with each tileset varies, but because the pointer table points to a contiguous block of palettes, all in order by tileset, and each palette is a consistent 0xc0 bytes, the pointer table values can be used to determine the number of palettes associated with each tileset. The determination can be made using the formula num_palettes = (tileset_plus_one_table_pointer_value - tileset_table_pointer_value) / 0xc0.

Tileset number Tileset name Num associated palettes
00 Lost Underworld 4
01 Onett 3
02 Twoson 4
03 Threed 2
04 Fourside 2
05 Magicant 4
06 Outdoors 7
07 Summers 1
08 Dusty Dunes Desert 2
09 Dalaam 6
10 ?? 8
11 ?? 8
12 ?? 8
13 ?? 4
14 ?? 8
15 ?? 8
16 ?? 4
17 ?? 8
18 ?? 1
19 ?? 7
20 ?? 8
21 ?? 5
22 ?? 5
23 ?? 4
24 ?? 5
25 ?? 8
26 ?? 6
27 ?? 5
28 ?? 6
29 ?? 6
30 ?? 3
31 ?? ??