mirror of
https://github.com/holub/mame
synced 2025-06-06 21:03:47 +03:00
c140.cpp: add sample status readback, fixes engine sound in suzuka 8 hours, final lap and four trax game series (#8080)
This commit is contained in:
parent
c5860166ae
commit
041c296dec
@ -463,10 +463,23 @@ void c219_device::sound_stream_update(sound_stream &stream, std::vector<read_str
|
||||
}
|
||||
}
|
||||
|
||||
inline u8 c140_device::keyon_status_read(u16 offset)
|
||||
{
|
||||
m_stream->update();
|
||||
C140_VOICE const &v = m_voi[offset >> 4];
|
||||
// suzuka 8 hours and final lap games reads from here,
|
||||
// expecting bit 6 to be an inprogress sample flag.
|
||||
// four trax also expects bit 4 high for some specific channels to make engine noises to work properly
|
||||
// (sounds kinda bogus when player crashes in an object and jump spin, needs real HW verification)
|
||||
return (v.key ? 0x40 : 0x00) | (v.mode & 0x3f);
|
||||
}
|
||||
|
||||
|
||||
u8 c140_device::c140_r(offs_t offset)
|
||||
{
|
||||
offset &= 0x1ff;
|
||||
if ((offset & 0xf) == 0x5)
|
||||
return keyon_status_read(offset);
|
||||
return m_REG[offset];
|
||||
}
|
||||
|
||||
@ -540,6 +553,11 @@ void c140_device::c140_w(offs_t offset, u8 data)
|
||||
u8 c219_device::c219_r(offs_t offset)
|
||||
{
|
||||
offset &= 0x1ff;
|
||||
// assume same as c140
|
||||
// TODO: what happens here on reading unmapped voice regs?
|
||||
if ((offset & 0xf) == 0x5)
|
||||
return keyon_status_read(offset);
|
||||
|
||||
return m_REG[offset];
|
||||
}
|
||||
|
||||
|
@ -97,6 +97,8 @@ protected:
|
||||
C140_VOICE m_voi[MAX_VOICE];
|
||||
|
||||
emu_timer *m_int1_timer;
|
||||
|
||||
u8 keyon_status_read(u16 offset);
|
||||
};
|
||||
|
||||
class c219_device : public c140_device
|
||||
|
Loading…
Reference in New Issue
Block a user