7#define BIOS_RANGE 0x1fc00000, 0x1fc7ffff
8#define MEM_CTRL_RANGE 0x1f801000, 0x1f801023
9#define RAM_SIZE_RANGE 0x1f801060, 0x1f801063
10#define CACHE_CTRL_RANGE 0xfffe0130, 0xfffe0133
11#define RAM_RANGE 0x00000000, 0x001fffff
12#define SPU_RANGE 0x1f801c00, 0x1f801ffc
13#define EXPANSION2_RANGE 0x1f802000, 0x1f803fff
14#define EXPANSION1_RANGE 0x1f000000, 0x1f7fffff
15#define INTERRUPT_RANGE 0x1f801070, 0x1f801077
16#define TIMER_RANGE 0x1f801100, 0x1f801131
80 Bus(std::string bios_path);
Class to emulate the BIOS.
Class to implement the Bus.
void clock()
Clocks the PSX.
Range mem_ctrl_range
Range of the Memory Control Registers.
RAM * ram
Pointer to the RAM object.
Range expansion1_range
Range of the Expansion 1.
Range ram_size_range
Range of the RAM Size Register.
CPU * cpu
Pointer to the CPU object.
uint16_t read16_cpu(uint32_t addr)
Reads a 16-bit word from the given address.
uint32_t read32_cpu(uint32_t addr)
Reads a 32-bit word from the given address.
Bus(std::string bios_path)
Construct a new Bus:: Bus object.
Range ram_range
Range of the RAM.
Range bios_range
Range of the BIOS.
Range timer_range
Range of the Timer Registers.
Range cache_ctrl_range
Range of the Cache Control Register.
BIOS * bios
Pointer to the BIOS object.
void write8_cpu(uint32_t addr, uint8_t data)
Writes a 8-bit word to the given address.
uint32_t region_mask(uint32_t addr)
Returns the region mask for a given address.
Range expansion2_range
Range of the Expansion 2.
void write32_cpu(uint32_t addr, uint32_t data)
Writes a 32-bit word to the given address.
void write16_cpu(uint32_t addr, uint16_t data)
Writes a 16-bit word to the given address.
Range interrupt_range
Range of the Interrupt Registers.
Range spu_range
Range of the SPU (Sound Processing Unit) Registers.
uint8_t read8_cpu(uint32_t addr)
Reads a 8-bit word from the given address.
Class to emulate the CPU.
Class to emulate the RAM.
Structure to store a range of addresses to allow easy checking.
Range(uint32_t start, uint32_t end)
Construct a new Range object.
uint32_t end
End of the range (inclusive)
bool contains(uint32_t addr)
Checks if the given address is in the range.
uint32_t offset(uint32_t addr)
Gets the offset of the given address from the start of the range.
uint32_t start
Start of the range (inclusive)