Class to emulate the RAM.
More...
#include <ram.hpp>
|
| | RAM (uint32_t size) |
| | Construct a new RAM:: RAM object.
|
| |
| uint32_t | read32_cpu (uint32_t offset) |
| | Reads a 32-bit word from the RAM.
|
| |
| void | write32_cpu (uint32_t offset, uint32_t data) |
| | Writes a 32-bit word to the RAM.
|
| |
| uint16_t | read16_cpu (uint32_t offset) |
| | Reads a 16-bit word from the RAM.
|
| |
| void | write16_cpu (uint32_t offset, uint16_t data) |
| | Writes a 16-bit word to the RAM.
|
| |
| uint8_t | read8_cpu (uint32_t offset) |
| | Reads a byte from the RAM.
|
| |
| void | write8_cpu (uint32_t offset, uint8_t data) |
| | Writes a byte to the RAM.
|
| |
|
| std::vector< uint8_t > | data |
| | Data of the RAM.
|
| |
Class to emulate the RAM.
Implements the RAM of the PSX.
Definition at line 12 of file ram.hpp.
◆ RAM()
| RAM::RAM |
( |
uint32_t | size | ) |
|
Construct a new RAM:: RAM object.
Initializes the RAM with 0xca.
- Parameters
-
| size | Size of the RAM in bytes |
Definition at line 13 of file ram.cpp.
◆ read16_cpu()
| uint16_t RAM::read16_cpu |
( |
uint32_t | offset | ) |
|
Reads a 16-bit word from the RAM.
- Parameters
-
| offset | Offset to read from |
- Returns
- uint16_t Data read
- Exceptions
-
| std::runtime_error | If the offset is unaligned |
| std::runtime_error | If the offset is out of bounds |
Definition at line 117 of file ram.cpp.
◆ read32_cpu()
| uint32_t RAM::read32_cpu |
( |
uint32_t | offset | ) |
|
Reads a 32-bit word from the RAM.
- Parameters
-
| offset | Offset to read from |
- Returns
- uint32_t Data read
- Exceptions
-
| std::runtime_error | If the offset is unaligned |
| std::runtime_error | If the offset is out of bounds |
Definition at line 27 of file ram.cpp.
◆ read8_cpu()
| uint8_t RAM::read8_cpu |
( |
uint32_t | offset | ) |
|
Reads a byte from the RAM.
- Parameters
-
| offset | Offset to read from |
- Returns
- uint16_t Data read
- Exceptions
-
| std::runtime_error | If the offset is out of bounds |
Definition at line 78 of file ram.cpp.
◆ write16_cpu()
| void RAM::write16_cpu |
( |
uint32_t | offset, |
|
|
uint16_t | data ) |
Writes a 16-bit word to the RAM.
- Parameters
-
| offset | Offset to write to |
| data | Data to write |
- Exceptions
-
| std::runtime_error | If the offset is unaligned |
| std::runtime_error | If the offset is out of bounds |
Definition at line 143 of file ram.cpp.
◆ write32_cpu()
| void RAM::write32_cpu |
( |
uint32_t | offset, |
|
|
uint32_t | data ) |
Writes a 32-bit word to the RAM.
- Parameters
-
| offset | Offset to write to |
| data | Data to write |
- Exceptions
-
| std::runtime_error | If the offset is unaligned |
| std::runtime_error | If the offset is out of bounds |
Definition at line 53 of file ram.cpp.
◆ write8_cpu()
| void RAM::write8_cpu |
( |
uint32_t | offset, |
|
|
uint8_t | data ) |
Writes a byte to the RAM.
- Parameters
-
| offset | Offset to write to |
| data | Data to write |
- Exceptions
-
| std::runtime_error | If the offset is out of bounds |
Definition at line 97 of file ram.cpp.
◆ data
| std::vector<uint8_t> RAM::data |
|
private |
The documentation for this class was generated from the following files: