-
Notifications
You must be signed in to change notification settings - Fork 0
/
Spu.hpp
32 lines (25 loc) · 885 Bytes
/
Spu.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include "Dma.hpp"
#include "Bus.hpp"
class Spu : public DMA_interface, public Bus::BusDevice
{
public:
static Spu * get_instance();
bool init();
virtual bool is_address_for_device(unsigned int address) final;
virtual unsigned char get_byte(unsigned int address) final;
virtual void set_byte(unsigned int address, unsigned char value) final;
void reset();
private:
Spu() = default;
~Spu();
static const unsigned int SPU_RAM_SIZE = 512 * 1042;
static const unsigned int SPU_CONTROL_SIZE = 64;
static const unsigned int SPU_VOICE_SIZE = 576;
static const unsigned int SPU_START = 0x1F801C00;
static const unsigned int SPU_END = SPU_START + SPU_VOICE_SIZE + SPU_CONTROL_SIZE;
bool initialized = false;
unsigned char spu_control[SPU_CONTROL_SIZE] = { 0 };
unsigned char spu_voice_registers[SPU_VOICE_SIZE] = { 0 };
unsigned char * spu_ram = nullptr;
};