(MESS) cbm8096: Emulated the 64KB memory expansion card, and promoted driver to working. [Curt Coder]

This commit is contained in:
Curt Coder 2013-02-22 19:43:35 +00:00
parent e5334898c4
commit 7a3fd3f102
7 changed files with 24 additions and 18 deletions

View File

@ -213,6 +213,8 @@ READ8_MEMBER( pet_state::read )
int norom = m_exp->norom_r(space, offset, sel);
UINT8 data = 0;
data = m_exp->read(space, offset, data, sel);
switch (sel)
{
case SEL0: case SEL1: case SEL2: case SEL3: case SEL4: case SEL5: case SEL6: case SEL7:
@ -260,7 +262,7 @@ READ8_MEMBER( pet_state::read )
break;
}
return m_exp->read(space, offset, data, sel);
return data;
}
@ -272,6 +274,8 @@ WRITE8_MEMBER( pet_state::write )
{
int sel = offset >> 12;
m_exp->write(space, offset, data, sel);
switch (sel)
{
case SEL0: case SEL1: case SEL2: case SEL3: case SEL4: case SEL5: case SEL6: case SEL7:
@ -314,8 +318,6 @@ WRITE8_MEMBER( pet_state::write )
}
break;
}
m_exp->write(space, offset, data, sel);
}

View File

@ -123,7 +123,7 @@ int pet_64k_expansion_device::pet_norom_r(address_space &space, offs_t offset, i
// pet_bd_r - buffered data read
//-------------------------------------------------
UINT8 pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data, int sel)
UINT8 pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel)
{
if (BIT(m_ctrl, 7))
{
@ -133,6 +133,7 @@ UINT8 pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, UI
if (!BIT(m_ctrl, 5))
{
data = read_ram(offset);
sel = pet_expansion_slot_device::SEL_NONE;
}
break;
@ -140,6 +141,7 @@ UINT8 pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, UI
if (!BIT(m_ctrl, 6) || !BIT(offset, 11))
{
data = read_ram(offset);
sel = pet_expansion_slot_device::SEL_NONE;
}
break;
@ -162,7 +164,7 @@ UINT8 pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, UI
// pet_bd_w - buffered data write
//-------------------------------------------------
void pet_64k_expansion_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, int sel)
void pet_64k_expansion_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel)
{
if (BIT(m_ctrl, 7))
{
@ -172,6 +174,7 @@ void pet_64k_expansion_device::pet_bd_w(address_space &space, offs_t offset, UIN
if (!BIT(m_ctrl, 5))
{
write_ram(offset, data);
sel = pet_expansion_slot_device::SEL_NONE;
}
break;
@ -179,6 +182,7 @@ void pet_64k_expansion_device::pet_bd_w(address_space &space, offs_t offset, UIN
if (!BIT(m_ctrl, 6) || !BIT(offset, 11))
{
write_ram(offset, data);
sel = pet_expansion_slot_device::SEL_NONE;
}
break;
@ -195,7 +199,6 @@ void pet_64k_expansion_device::pet_bd_w(address_space &space, offs_t offset, UIN
if (offset == 0xfff0)
{
printf("CTRL %02x\n", data);
m_ctrl = data;
}
}

View File

@ -38,8 +38,8 @@ protected:
// device_pet_expansion_card_interface overrides
virtual int pet_norom_r(address_space &space, offs_t offset, int sel);
virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int sel);
virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int sel);
virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel);
virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel);
private:
inline UINT8 read_ram(offs_t offset);

View File

@ -114,7 +114,7 @@ int pet_expansion_slot_device::norom_r(address_space &space, offs_t offset, int
// read - buffered data read
//-------------------------------------------------
UINT8 pet_expansion_slot_device::read(address_space &space, offs_t offset, UINT8 data, int sel)
UINT8 pet_expansion_slot_device::read(address_space &space, offs_t offset, UINT8 data, int &sel)
{
if (m_card != NULL)
{
@ -129,7 +129,7 @@ UINT8 pet_expansion_slot_device::read(address_space &space, offs_t offset, UINT8
// write - buffered data write
//-------------------------------------------------
void pet_expansion_slot_device::write(address_space &space, offs_t offset, UINT8 data, int sel)
void pet_expansion_slot_device::write(address_space &space, offs_t offset, UINT8 data, int &sel)
{
if (m_card != NULL)
{

View File

@ -63,8 +63,8 @@ public:
// computer interface
int norom_r(address_space &space, offs_t offset, int sel);
UINT8 read(address_space &space, offs_t offset, UINT8 data, int sel);
void write(address_space &space, offs_t offset, UINT8 data, int sel);
UINT8 read(address_space &space, offs_t offset, UINT8 data, int &sel);
void write(address_space &space, offs_t offset, UINT8 data, int &sel);
DECLARE_READ_LINE_MEMBER( diag_r );
DECLARE_WRITE_LINE_MEMBER( irq_w );
@ -75,6 +75,7 @@ public:
enum
{
SEL_NONE = -1,
SEL0 = 0,
SEL1,
SEL2,
@ -119,8 +120,8 @@ public:
protected:
// runtime
virtual int pet_norom_r(address_space &space, offs_t offset, int sel) { return 1; }
virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int sel) { return data; };
virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int sel) { };
virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel) { return data; };
virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel) { };
virtual int pet_diag_r() { return 1; }
virtual void pet_irq_w(int state) { }

View File

@ -250,7 +250,7 @@ int superpet_device::pet_norom_r(address_space &space, offs_t offset, int sel)
// pet_bd_r - buffered data read
//-------------------------------------------------
UINT8 superpet_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data, int sel)
UINT8 superpet_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel)
{
int norom = pet_norom_r(space, offset, sel);
@ -311,7 +311,7 @@ UINT8 superpet_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data,
// pet_bd_w - buffered data write
//-------------------------------------------------
void superpet_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, int sel)
void superpet_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel)
{
switch (sel)
{

View File

@ -52,8 +52,8 @@ protected:
// device_pet_expansion_card_interface overrides
virtual int pet_norom_r(address_space &space, offs_t offset, int sel);
virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int sel);
virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int sel);
virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel);
virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel);
virtual int pet_diag_r();
virtual void pet_irq_w(int state);