vic10: Implemented MultiMAX cartridge. [Curt Coder]

This commit is contained in:
Curt Coder 2018-04-24 22:46:04 +03:00
parent d43d8bcecf
commit 0759197457
3 changed files with 50 additions and 6 deletions

View File

@ -322,16 +322,16 @@
</part>
</software>
<software name="multimax" supported="no">
<description>MultiMax</description>
<software name="multimax">
<description>MultiMAX</description>
<year>2014</year>
<publisher>Rob Clarke &amp; Michal Pleban</publisher>
<part name="cart" interface="c64_cart">
<part name="cart" interface="vic10_cart">
<feature name="slot" value="multimax" />
<dataarea name="roml" size="0x100000">
<dataarea name="lorom" size="0x100000">
<rom name="multimax.bin" size="0x100000" crc="4853de57" sha1="1d8b0b111af7cbd1e4bffd58d4c22d8f49de3741" offset="0x0000" />
</dataarea>
<dataarea name="exram" size="0x800" />
</part>
</software>

View File

@ -28,7 +28,8 @@ DEFINE_DEVICE_TYPE(MULTIMAX, multimax_t, "multimax", "MultiMAX Cartridge")
//-------------------------------------------------
multimax_t::multimax_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, MULTIMAX, tag, owner, clock), device_vic10_expansion_card_interface(mconfig, *this)
device_t(mconfig, MULTIMAX, tag, owner, clock), device_vic10_expansion_card_interface(mconfig, *this),
m_latch(0)
{
}
@ -39,6 +40,18 @@ multimax_t::multimax_t(const machine_config &mconfig, const char *tag, device_t
void multimax_t::device_start()
{
// state saving
save_item(NAME(m_latch));
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void multimax_t::device_reset()
{
m_latch = 0;
}
@ -48,6 +61,22 @@ void multimax_t::device_start()
uint8_t multimax_t::vic10_cd_r(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram)
{
if (!lorom)
{
data = m_lorom[((m_latch & 0x3f) << 14) | (offset & 0x1fff)];
}
else if (!uprom)
{
data = m_lorom[((m_latch & 0x3f) << 14) | 0x2000 | (offset & 0x1fff)];
}
else if (!exram)
{
if (m_latch)
{
data = m_exram[offset & 0x7ff];
}
}
return data;
}
@ -58,4 +87,15 @@ uint8_t multimax_t::vic10_cd_r(address_space &space, offs_t offset, uint8_t data
void multimax_t::vic10_cd_w(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram)
{
if (!exram)
{
if (m_latch)
{
m_exram[offset & 0x7ff] = data;
}
else
{
m_latch = data;
}
}
}

View File

@ -31,10 +31,14 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
// device_vic10_expansion_card_interface overrides
virtual uint8_t vic10_cd_r(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) override;
virtual void vic10_cd_w(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) override;
private:
uint8_t m_latch;
};