![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
Emulates a VRAM block. More...
#include <Vram.h>
Public Member Functions | |
virtual | ~Vram () |
Destructor. More... | |
u16 | GetWidth () const |
Retrieves the block width. More... | |
u16 | GetHeight () const |
Retrieves the block width. More... | |
void | Save (const Ogre::String &file) |
Saves the contents of the VRAM block to a file. More... | |
void | AddImageBuffer (u16 x, u16 y, u16 width, u16 height, u8 *buffer) |
Adds an image buffer to an existing buffer. More... | |
void | PutU8 (u16 x, u16 y, u8 byte) |
Writes 8 bytes to the VRAM block. More... | |
u8 | GetU8 (u16 x, u16 y) const |
Reads 8 bytes from the VRAM block. More... | |
void | PutU16 (u16 x, u16 y, u16 bytes) |
Writes 16 bytes to the VRAM block. More... | |
u16 | GetU16 (u16 x, u16 y) const |
Reads 16 bytes from the VRAM block. More... | |
Static Public Member Functions | |
static std::unique_ptr< Vram > | MakeInstance () |
Creates a VRAM block. More... | |
Private Member Functions | |
Vram () | |
Constructor. More... | |
Private Attributes | |
u8 | vram_ [2048 *512] |
The data block. More... | |
u16 | width_ |
The VRAM block width. More... | |
u16 | height_ |
The VRAM block height. More... | |
Emulates a VRAM block.
The blocks have the same size they had in the Play Station 1 (2048 * 512).
|
virtual |
Destructor.
|
private |
Constructor.
Adds an image buffer to an existing buffer.
[in] | x | X coordinate for the start of the image buffer. |
[in] | y | Y coordinate for the start of the image buffer. |
[in] | width | Width of the image buffer. |
[in] | height | Height of the image buffer. |
[out] | buffer | The buffer to add the image buffer to. |
u16 Vram::GetHeight | ( | ) | const |
Retrieves the block width.
Reads 16 bytes from the VRAM block.
[in] | x | X coordinate of the block where to read. |
[in] | y | Y coordinate of the block where to read. |
Reads 8 bytes from the VRAM block.
[in] | x | X coordinate of the block where to read. |
[in] | y | Y coordinate of the block where to read. |
u16 Vram::GetWidth | ( | ) | const |
Retrieves the block width.
|
inlinestatic |
Creates a VRAM block.
Writes 16 bytes to the VRAM block.
[in] | x | X coordinate of the block where to write. |
[in] | y | Y coordinate of the block where to write. |
[in] | bytes | The data to write. |
Writes 8 bytes to the VRAM block.
[in] | x | X coordinate of the block where to write. |
[in] | y | Y coordinate of the block where to write. |
[in] | byte | The data to write. |
void Vram::Save | ( | const Ogre::String & | file | ) |
Saves the contents of the VRAM block to a file.
[in] | file | Path to the file to save. |
|
private |
The VRAM block height.
|
private |
The data block.
|
private |
The VRAM block width.