Difference between revisions of "FF7/Kernel/Memory management"

From Final Fantasy Inside
< FF7‎ | Kernel
Jump to navigation Jump to search
my_wiki>Halkun
 
my_wiki>Halkun
Line 4: Line 4:
  
 
Within the save map there are 5 banks of memory that are directly accessible by the field scripting language. These can either be accessed 8 bits or 16 bits at a time depending on the field command argument. The following table is basic memory map of the banks and how they relate to the save map. There is also an allocation for 256 bytes for temporary field variables. These are not used between field files and are not saved.
 
Within the save map there are 5 banks of memory that are directly accessible by the field scripting language. These can either be accessed 8 bits or 16 bits at a time depending on the field command argument. The following table is basic memory map of the banks and how they relate to the save map. There is also an allocation for 256 bytes for temporary field variables. These are not used between field files and are not saved.
 +
 +
 +
<table CELLSPACING="0">
 +
<tr>
 +
<th style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 43px; background-color: rgb(230, 230, 230);">
 +
Offset</th>
 +
<th style="border: 1px solid rgb(0, 0, 0); text-align: center; vertical-align: middle; width: 83px; height: 43px; background-color: rgb(230, 230, 230);">
 +
8 Bit Field Bank</th>
 +
<th style="border: 1px solid rgb(0, 0, 0); text-align: center; vertical-align: middle; width: 99px; height: 43px; background-color: rgb(230, 230, 230);">
 +
16 Bit Field Bank</th>
 +
<th style="border: 1px solid rgb(0, 0, 0); width: 281px; height: 43px; background-color: rgb(230, 230, 230);">
 +
Description</th>
 +
</tr>
 +
 +
<tr>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 25px;">
 +
0x0000</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 83px; height: 25px;">
 +
N/A</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 99px; height: 25px;">
 +
N/A</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 281px; height: 25px;">
 +
Beginning of Save Map</td>
 +
</tr>
 +
 +
<tr>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x0BA4</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 83px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x1</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 99px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x2</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 281px; height: 25px; background-color: rgb(152, 204, 255);">
 +
Field Script Bank 1</td>
 +
</tr>
 +
 +
<tr>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x0CA4</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 83px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x3</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 99px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x4</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 281px; height: 25px; background-color: rgb(152, 204, 255);">
 +
Field Script Bank 2</td>
 +
</tr>
 +
 +
<tr>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x0DA4</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 83px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0xB</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 99px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0xC</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 281px; height: 25px; background-color: rgb(152, 204, 255);">
 +
Field Script Bank 3</td>
 +
</tr>
 +
 +
<tr>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x0EA4</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 83px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0xD</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 99px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0xE</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 281px; height: 25px; background-color: rgb(152, 204, 255);">
 +
Field Script Bank 4</td>
 +
</tr>
 +
 +
<tr>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x0FA4</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 83px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0x7</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 99px; height: 25px; background-color: rgb(152, 204, 255);">
 +
0xF</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 281px; height: 25px; background-color: rgb(152, 204, 255);">
 +
Field Script Bank 5</td>
 +
</tr>
 +
 +
<tr>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 25px;">
 +
0x10F4</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 83px; height: 25px;">
 +
N/A</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 99px; height: 25px;">
 +
N/A</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 281px; height: 25px;">
 +
End of Save Map</td>
 +
</tr>
 +
 +
<tr>
 +
<td style="border-style: solid none solid solid; border-color: rgb(0, 0, 0); border-width: 1px; vertical-align: top; width: 68px; height: 25px;">
 +
</td><td style="border-style: solid none; border-color: rgb(0, 0, 0); border-width: 1px; text-align: center; vertical-align: top; width: 83px; height: 25px;">
 +
</td><td style="border-style: solid none; border-color: rgb(0, 0, 0); border-width: 1px; text-align: center; vertical-align: top; width: 99px; height: 25px;">
 +
</td><td style="border-style: solid solid solid none; border-color: rgb(0, 0, 0); border-width: 1px; vertical-align: top; width: 281px; height: 25px;">
 +
</td></tr>
 +
 +
<tr>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 25px;">
 +
N/A</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 83px; height: 25px;">
 +
0x5</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); text-align: center; width: 99px; height: 25px;">
 +
0x6</td>
 +
<td style="border: 1px solid rgb(0, 0, 0); width: 281px; height: 25px;">
 +
Temporary field variables (256 bytes)</td>
 +
</tr>
 +
</table>
 +
 +
 +
A more complete and annotated save map is in the MENU section.

Revision as of 08:41, 7 March 2005

RAM management

No matter what module is banked into memory, there is a section of memory 4,340 bytes long (0x10F4 bytes) that is reserved for all the variables for the entire game. This entire image is called the "Save Map". When it's time to save a game, this section of memory is copied to non-volatile ram, such as a hard disk or memory card.

Within the save map there are 5 banks of memory that are directly accessible by the field scripting language. These can either be accessed 8 bits or 16 bits at a time depending on the field command argument. The following table is basic memory map of the banks and how they relate to the save map. There is also an allocation for 256 bytes for temporary field variables. These are not used between field files and are not saved.


Offset 8 Bit Field Bank 16 Bit Field Bank Description
0x0000 N/A N/A Beginning of Save Map
0x0BA4 0x1 0x2 Field Script Bank 1
0x0CA4 0x3 0x4 Field Script Bank 2
0x0DA4 0xB 0xC Field Script Bank 3
0x0EA4 0xD 0xE Field Script Bank 4
0x0FA4 0x7 0xF Field Script Bank 5
0x10F4 N/A N/A End of Save Map
N/A 0x5 0x6 Temporary field variables (256 bytes)


A more complete and annotated save map is in the MENU section.