The main CPU.
More...
#include <CPU.hpp>
◆ CPU()
◆ executeInstruction()
| int ComSquare::CPU::CPU::executeInstruction |
( |
| ) |
|
|
private |
Execute a single instruction.
- Returns
- The number of CPU cycles that the instruction took.
◆ read()
| uint8_t ComSquare::CPU::CPU::read |
( |
uint24_t |
addr | ) |
|
|
overridevirtual |
Read from the internal CPU register.
@bref The CPU's internal registers starts at $4200 and finish at $421F.
- Parameters
-
| addr | The address to read from. The address 0x0 should refer to the first byte of the register. |
- Exceptions
-
| InvalidAddress | will be thrown if the address is more than $1F (the number of register). |
- Returns
- Return the value of the register.
Implements ComSquare::Memory::IMemory.
◆ update()
| int ComSquare::CPU::CPU::update |
( |
| ) |
|
This function continue to execute the Cartridge code.
- Returns
- The number of CPU cycles that elapsed
◆ write()
| void ComSquare::CPU::CPU::write |
( |
uint24_t |
addr, |
|
|
uint8_t |
data |
|
) |
| |
|
overridevirtual |
Write data to the internal CPU register.
- Parameters
-
| addr | The address to write to. The address 0x0 should refer to the first byte of register. |
| data | The new value of the register. |
- Exceptions
-
| InvalidAddress | will be thrown if the address is more than $1F (the number of register). |
Implements ComSquare::Memory::IMemory.
◆ _bus
The memory bus to use for read/write.
◆ _internalRegisters
Internal registers of the CPU (accessible from the bus via addr $4200 to $421F).
◆ _isEmulationMode
| bool ComSquare::CPU::CPU::_isEmulationMode = true |
|
private |
Is the CPU running in emulation mode (in 8bits)
◆ _registers
All the registers of the CPU.
The documentation for this class was generated from the following files: