Class handling all DMA/HDMA transfers (Direct Memory Access or H-Blank Direct Memory Access)
More...
#include <DMA.hpp>
|
| unsigned | _writeOneByte (uint24_t aAddress, uint24_t bAddress) |
| | Write one byte using the A address, the port and the _direction. Handle special cases where no write occurs. More...
|
| |
| int | _getModeOffset (int index) const |
| | Get an offset corresponding to the current DMAMode and the index of the currently transferred byte. More...
|
| |
Class handling all DMA/HDMA transfers (Direct Memory Access or H-Blank Direct Memory Access)
◆ Direction
◆ DMAMode
The first three bytes of the DMA's control register. Used to tell how many bytes/registers there is.
| Enumerator |
|---|
| OneToOne | 1 byte is transferred to 1 register (write once)
|
| TwoToTwo | 2 byte is transferred to 2 register (write once)
|
| TwoToOne | 2 byte is transferred to 1 register (write twice)
|
| FourToTwo | 4 byte is transferred to 2 register (write twice)
|
| FourToFour | 4 byte is transferred to 4 register (write once)
|
| TwoToTwoBis | Exactly the same as TwoToTwo (not implemented on the SNES so this fallbacks)
|
| TwoToOneBis | Exactly the same as TwoToOne (not implemented on the SNES so this fallbacks)
|
| FourToTwoBis | Exactly the same as FourToTwo (not implemented on the SNES so this fallbacks)
|
◆ DMA() [1/2]
Create a DMA channel with a given bus.
- Parameters
-
| bus | The memory bus to use. |
◆ DMA() [2/2]
| ComSquare::CPU::DMA::DMA |
( |
const DMA & |
| ) |
|
|
default |
A DMA is copy constructable.
◆ ~DMA()
| ComSquare::CPU::DMA::~DMA |
( |
| ) |
|
|
default |
◆ _getModeOffset()
| int ComSquare::CPU::DMA::_getModeOffset |
( |
int |
index | ) |
const |
|
private |
Get an offset corresponding to the current DMAMode and the index of the currently transferred byte.
◆ _writeOneByte()
| unsigned ComSquare::CPU::DMA::_writeOneByte |
( |
uint24_t |
aAddress, |
|
|
uint24_t |
bAddress |
|
) |
| |
|
private |
Write one byte using the A address, the port and the _direction. Handle special cases where no write occurs.
- Returns
- The number of cycles used.
◆ getBus()
Get the memory bus used by this CPU.
◆ operator=()
| DMA& ComSquare::CPU::DMA::operator= |
( |
const DMA & |
| ) |
|
|
delete |
◆ read()
| uint8_t ComSquare::CPU::DMA::read |
( |
uint8_t |
addr | ) |
const |
Bus helper to read from this channel.
- Parameters
-
| addr | The address to read from |
- Returns
- The value at the given address.
◆ run()
| unsigned ComSquare::CPU::DMA::run |
( |
unsigned |
cycles | ) |
|
Run the DMA for x cycles.
- Parameters
-
| cycles | The maximum number of cycles this DMA should run. |
- Returns
- the number of cycles taken
◆ setBus()
Set the memory bus used by this CPU.
- Parameters
-
◆ write()
| void ComSquare::CPU::DMA::write |
( |
uint8_t |
addr, |
|
|
uint8_t |
data |
|
) |
| |
Bus helper to write to this channel.
- Parameters
-
| addr | The address to write to |
| data | The data to write. |
| bool ComSquare::CPU::DMA::_ |
◆ _aAddress
| union { ... } ComSquare::CPU::DMA::_aAddress |
The absolute long address of the data from the A bus.
◆ _bus
The memory bus to use for read/write.
◆ _controlRegister
| union { ... } ComSquare::CPU::DMA::_controlRegister |
DMA Control register (various information about the transfer)
◆ _count
| union { ... } ComSquare::CPU::DMA::_count |
The number of bytes to be transferred.
◆ _port
| uint8_t ComSquare::CPU::DMA::_port {} |
|
private |
If this is 'xx', the register accessed will be $21xx.
◆ bank
| uint8_t ComSquare::CPU::DMA::bank |
◆ bytes
| uint8_t ComSquare::CPU::DMA::bytes[2] |
◆ direction
The direction of the transfer.
◆ enabled
| bool ComSquare::CPU::DMA::enabled |
Is this channel set to run?
◆ fixed
| bool ComSquare::CPU::DMA::fixed |
If this flag is set, no increment/decrement will be done.
◆ increment
| bool ComSquare::CPU::DMA::increment |
if this flag is 0: increment. Else: decrement. (The A address)
◆ mode
DMA's mode: how many bytes/registers there is, how many writes...
◆ page
| uint16_t ComSquare::CPU::DMA::page |
◆ raw [1/3]
| uint8_t ComSquare::CPU::DMA::raw |
◆ raw [2/3]
◆ raw [3/3]
| uint16_t ComSquare::CPU::DMA::raw |
The documentation for this class was generated from the following files: