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:
Angelo Salese 2021-05-21 01:09:23 +02:00 committed by GitHub
parent c5860166ae
commit 041c296dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -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];
}

View File

@ -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