FF7/Kernel/Memory management

From Final Fantasy Inside
< FF7‎ | Kernel
Revision as of 09:39, 7 March 2005 by my_wiki>Halkun (VRAM management)

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.


VRAM management

The kernel is in charge of allocating, caching, and displaying in Video RAM. The the case if the PSX, port, the Playstation only has 1 megabyte of VRAM which makes this task a little complex. This is alleviated somewhat by using the PSX's VRAM caching system.

The PSX video memory can best be seen as a rectangular "surface" made up of 2048x512 pixels. A slight caveat to this model is that the PSX can hold multiple color depths in VRAM at the same time. To make the VRAM a little easier to visualize, This document represents VRAM as a 1024x512 matrix to allow for some color depth in either direction and to minimize some extreme skewing of the video buffers.

The following is a typical state of VRAM during game play.