mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
tms57002: Add dready callback for superctr (nw)
This commit is contained in:
parent
41232a9105
commit
d70a5a2522
@ -26,6 +26,7 @@ tms57002_device::tms57002_device(const machine_config &mconfig, const char *tag,
|
||||
: cpu_device(mconfig, TMS57002, tag, owner, clock)
|
||||
, device_sound_interface(mconfig, *this)
|
||||
, macc(0), st0(0), st1(0), sti(0), txrd(0)
|
||||
, m_dready_callback(*this)
|
||||
, program_config("program", ENDIANNESS_LITTLE, 32, 8, -2, address_map_constructor(FUNC(tms57002_device::internal_pgm), this))
|
||||
, data_config("data", ENDIANNESS_LITTLE, 8, 20)
|
||||
{
|
||||
@ -80,6 +81,7 @@ void tms57002_device::device_reset()
|
||||
ST0_PBCO | ST0_CNS);
|
||||
st1 &= ~(ST1_AOV | ST1_SFAI | ST1_SFAO | ST1_MOVM | ST1_MOV |
|
||||
ST1_SFMA | ST1_SFMO | ST1_RND | ST1_CRM | ST1_DBP);
|
||||
update_dready();
|
||||
|
||||
xba = 0;
|
||||
xoa = 0;
|
||||
@ -152,6 +154,7 @@ READ8_MEMBER(tms57002_device::data_r)
|
||||
if(hidx == 4) {
|
||||
hidx = 0;
|
||||
sti &= ~S_HOST;
|
||||
update_dready();
|
||||
}
|
||||
|
||||
return res;
|
||||
@ -167,6 +170,11 @@ READ_LINE_MEMBER(tms57002_device::dready_r)
|
||||
return sti & S_HOST ? 0 : 1;
|
||||
}
|
||||
|
||||
void tms57002_device::update_dready()
|
||||
{
|
||||
m_dready_callback(sti & S_HOST ? 0 : 1);
|
||||
}
|
||||
|
||||
READ_LINE_MEMBER(tms57002_device::pc0_r)
|
||||
{
|
||||
return pc == 0 ? 0 : 1;
|
||||
@ -814,6 +822,11 @@ void tms57002_device::sound_stream_update(sound_stream &stream, stream_sample_t
|
||||
sync_w(1);
|
||||
}
|
||||
|
||||
void tms57002_device::device_resolve_objects()
|
||||
{
|
||||
m_dready_callback.resolve_safe();
|
||||
}
|
||||
|
||||
void tms57002_device::device_start()
|
||||
{
|
||||
sti = S_IDLE;
|
||||
|
@ -16,6 +16,8 @@ class tms57002_device : public cpu_device, public device_sound_interface {
|
||||
public:
|
||||
tms57002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
auto dready_callback() { return m_dready_callback.bind(); }
|
||||
|
||||
DECLARE_READ8_MEMBER(data_r);
|
||||
DECLARE_WRITE8_MEMBER(data_w);
|
||||
|
||||
@ -28,6 +30,7 @@ public:
|
||||
|
||||
void internal_pgm(address_map &map);
|
||||
protected:
|
||||
virtual void device_resolve_objects() override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
|
||||
@ -136,6 +139,8 @@ private:
|
||||
|
||||
cd cache;
|
||||
|
||||
devcb_write_line m_dready_callback;
|
||||
|
||||
const address_space_config program_config, data_config;
|
||||
|
||||
address_space *program, *data;
|
||||
@ -158,6 +163,8 @@ private:
|
||||
inline int movm(uint32_t st1);
|
||||
inline int sfma(uint32_t st1);
|
||||
|
||||
void update_dready();
|
||||
|
||||
void xm_init();
|
||||
void xm_step_read();
|
||||
void xm_step_write();
|
||||
|
@ -240,6 +240,7 @@ lpc 2b 31 1 n
|
||||
host[3] = c;
|
||||
hidx = 0;
|
||||
sti |= S_HOST;
|
||||
update_dready();
|
||||
|
||||
lpd 2b 30 1 n
|
||||
lpd %d
|
||||
|
Loading…
Reference in New Issue
Block a user