K007232: acquireDirect()
This commit is contained in:
parent
804e8b7fb8
commit
85981822fa
4 changed files with 66 additions and 44 deletions
|
|
@ -8,15 +8,15 @@
|
|||
|
||||
#include "k007232.hpp"
|
||||
|
||||
void k007232_core::tick()
|
||||
void k007232_core::tick(int cycles)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
m_voice[i].tick(i);
|
||||
m_voice[i].tick(i,cycles);
|
||||
}
|
||||
}
|
||||
|
||||
void k007232_core::voice_t::tick(u8 ne)
|
||||
void k007232_core::voice_t::tick(u8 ne, int cycles)
|
||||
{
|
||||
if (m_busy)
|
||||
{
|
||||
|
|
@ -26,12 +26,12 @@ void k007232_core::voice_t::tick(u8 ne)
|
|||
// update counter
|
||||
if (is4bit)
|
||||
{
|
||||
m_counter = (m_counter & ~0x0ff) | (bitfield(bitfield(m_counter, 0, 8) + 1, 0, 8) << 0);
|
||||
m_counter = (m_counter & ~0xf00) | (bitfield(bitfield(m_counter, 8, 4) + 1, 0, 4) << 8);
|
||||
m_counter = (m_counter & ~0x0ff) | (bitfield(bitfield(m_counter, 0, 8) + cycles, 0, 8) << 0);
|
||||
m_counter = (m_counter & ~0xf00) | (bitfield(bitfield(m_counter, 8, 4) + cycles, 0, 4) << 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_counter++;
|
||||
m_counter+=cycles;
|
||||
}
|
||||
|
||||
// handle counter carry
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class k007232_core : public vgsound_emu_core
|
|||
|
||||
// internal state
|
||||
void reset();
|
||||
void tick(u8 ne);
|
||||
void tick(u8 ne, int cycles);
|
||||
|
||||
// accessors
|
||||
void write(u8 address, u8 data);
|
||||
|
|
@ -67,7 +67,7 @@ class k007232_core : public vgsound_emu_core
|
|||
// getters
|
||||
inline s8 out() { return m_out; }
|
||||
|
||||
private:
|
||||
public:
|
||||
// registers
|
||||
k007232_core &m_host;
|
||||
bool m_busy = false; // busy status
|
||||
|
|
@ -98,7 +98,7 @@ class k007232_core : public vgsound_emu_core
|
|||
|
||||
// internal state
|
||||
void reset();
|
||||
void tick();
|
||||
void tick(int cycles);
|
||||
|
||||
// output for each voices, ASD/BSD pin
|
||||
inline s32 output(u8 voice) { return m_voice[voice & 1].out(); }
|
||||
|
|
@ -106,7 +106,7 @@ class k007232_core : public vgsound_emu_core
|
|||
// getters for debug, trackers, etc
|
||||
inline u8 reg_r(u8 address) { return m_reg[address & 0xf]; }
|
||||
|
||||
private:
|
||||
public:
|
||||
std::array<voice_t, 2> m_voice;
|
||||
|
||||
k007232_intf &m_intf; // common memory interface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue