SegaPCM: implement getSamplePos()

This commit is contained in:
tildearrow 2023-03-19 16:49:31 -05:00
parent 62b9b98300
commit 591cd633d7
4 changed files with 27 additions and 1 deletions

View file

@ -134,6 +134,18 @@ uint8_t* segapcm_device::get_ram() {
return m_ram;
}
unsigned int segapcm_device::get_addr(int ch) {
uint8_t *regs = &m_ram[8*ch];
int offset = (regs[0x86] & m_bankmask) << m_bankshift;
uint32_t addr = (regs[0x85] << 8) | (regs[0x84]) | offset;
return addr;
}
bool segapcm_device::is_playing(int ch) {
uint8_t *regs = &m_ram[8*ch];
return !(regs[0x86]&1);
}
void segapcm_device::mute(int ch, bool doMute) {
m_muted[ch&15]=doMute;
}
}

View file

@ -34,6 +34,8 @@ public:
void write(unsigned int offset, uint8_t data);
uint8_t read(unsigned int offset);
uint8_t* get_ram();
unsigned int get_addr(int ch);
bool is_playing(int ch);
void mute(int ch, bool doMute);
// device-level overrides