V-Gears 0
Free Final Fantasy VII engine.
Vram Class Reference

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< VramMakeInstance ()
 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...
 

Detailed Description

Emulates a VRAM block.

The blocks have the same size they had in the Play Station 1 (2048 * 512).

Constructor & Destructor Documentation

◆ ~Vram()

Vram::~Vram ( )
virtual

Destructor.

◆ Vram()

Vram::Vram ( )
private

Constructor.

Member Function Documentation

◆ AddImageBuffer()

void Vram::AddImageBuffer ( u16  x,
u16  y,
u16  width,
u16  height,
u8 buffer 
)

Adds an image buffer to an existing buffer.

Parameters
[in]xX coordinate for the start of the image buffer.
[in]yY coordinate for the start of the image buffer.
[in]widthWidth of the image buffer.
[in]heightHeight of the image buffer.
[out]bufferThe buffer to add the image buffer to.

◆ GetHeight()

u16 Vram::GetHeight ( ) const

Retrieves the block width.

Returns
The block width.

◆ GetU16()

u16 Vram::GetU16 ( u16  x,
u16  y 
) const

Reads 16 bytes from the VRAM block.

Parameters
[in]xX coordinate of the block where to read.
[in]yY coordinate of the block where to read.
Returns
The read bytes.

◆ GetU8()

u8 Vram::GetU8 ( u16  x,
u16  y 
) const

Reads 8 bytes from the VRAM block.

Parameters
[in]xX coordinate of the block where to read.
[in]yY coordinate of the block where to read.
Returns
The read bytes.

◆ GetWidth()

u16 Vram::GetWidth ( ) const

Retrieves the block width.

Returns
The block width.

◆ MakeInstance()

static std::unique_ptr< Vram > Vram::MakeInstance ( )
inlinestatic

Creates a VRAM block.

Returns
The VRAM block.

◆ PutU16()

void Vram::PutU16 ( u16  x,
u16  y,
u16  bytes 
)

Writes 16 bytes to the VRAM block.

Parameters
[in]xX coordinate of the block where to write.
[in]yY coordinate of the block where to write.
[in]bytesThe data to write.

◆ PutU8()

void Vram::PutU8 ( u16  x,
u16  y,
u8  byte 
)

Writes 8 bytes to the VRAM block.

Parameters
[in]xX coordinate of the block where to write.
[in]yY coordinate of the block where to write.
[in]byteThe data to write.

◆ Save()

void Vram::Save ( const Ogre::String &  file)

Saves the contents of the VRAM block to a file.

Parameters
[in]filePath to the file to save.

Member Data Documentation

◆ height_

u16 Vram::height_
private

The VRAM block height.

◆ vram_

u8 Vram::vram_[2048 *512]
private

The data block.

◆ width_

u16 Vram::width_
private

The VRAM block width.


The documentation for this class was generated from the following files: