|
ComSquare
|
Contains the rom's memory/instructions. More...
#include <Cartridge.hpp>


Public Member Functions | |
| Cartridge (const std::string &romPath) | |
| Load a rom from it's path. More... | |
| ~Cartridge () | |
| Destructor that free the cartridge data. More... | |
| uint8_t | read_internal (uint24_t addr) override |
| Read from the rom. More... | |
| void | write_internal (uint24_t addr, uint8_t data) override |
| Write data to the rom. More... | |
Public Attributes | |
| Header | header |
| The header of the cartridge. More... | |
Private Member Functions | |
| bool | _loadHeader () |
| Set the public variable header by parsing the header in the ROM. More... | |
| uint32_t | _getHeaderAddress () |
| Get the address of the header. More... | |
| Header | _mapHeader (uint32_t headerAddress) |
| Parse the memory to get a readable header. More... | |
Private Member Functions inherited from ComSquare::Memory::IRectangleMemory | |
| uint8_t | read (uint24_t addr) override |
| Read data from the component using the same method as the basic IMemory. More... | |
| void | write (uint24_t addr, uint8_t data) override |
| Write data to this component using the same method as the basic IMemory. More... | |
| bool | hasMemoryAt (uint24_t addr) override |
| Return true if this component has mapped the address. More... | |
| uint24_t | getStart () override |
| Get the first address mapped to this component. More... | |
| void | setMemoryRegion (uint8_t startBank, uint8_t endBank, uint16_t startPage, uint16_t endPage) |
| Change starting and ending points of this mapped memory. More... | |
Private Member Functions inherited from ComSquare::Memory::IMemory | |
| void | setMemoryRegion (uint24_t start, uint24_t end) |
| Change starting and ending points of this mapped memory. More... | |
Static Private Member Functions | |
| static size_t | getRomSize (const std::string &romPath) |
| Get the size of a rom from it's path. More... | |
Private Attributes | |
| uint8_t * | _data |
| The rom data (contains all the instructions). More... | |
| size_t | _size |
| The size of the rom data. More... | |
Contains the rom's memory/instructions.
|
explicit |
Load a rom from it's path.
| ComSquare::Cartridge::Cartridge::~Cartridge | ( | ) |
Destructor that free the cartridge data.
|
private |
Get the address of the header.
|
private |
Set the public variable header by parsing the header in the ROM.
|
private |
Parse the memory to get a readable header.
| headerAddress | The address you want to parse. |
|
staticprivate |
Get the size of a rom from it's path.
| romPath | The path of the rom to get info from. |
|
overridevirtual |
Read from the rom.
| addr | The address to read from. The address 0x0 should refer to the first byte of the rom's memory. |
| InvalidAddress | will be thrown if the address is more than the size of the rom's memory. |
Implements ComSquare::Memory::IRectangleMemory.
|
overridevirtual |
Write data to the rom.
| addr | The address to write to. The address 0x0 should refer to the first byte of the rom's memory. |
| data | The data to write. |
| InvalidAddress | will be thrown if the address is more than the size of the rom's memory. |
Implements ComSquare::Memory::IRectangleMemory.
|
private |
The rom data (contains all the instructions).
|
private |
The size of the rom data.
| Header ComSquare::Cartridge::Cartridge::header |
The header of the cartridge.
1.8.17