saitek_osa: preliminary hook up PW pin

This commit is contained in:
hap 2021-05-25 16:45:22 +02:00
parent 6d499cc007
commit 39d304961c
5 changed files with 22 additions and 4 deletions

View File

@ -116,6 +116,16 @@ void saitekosa_expansion_device::ack_w(int state)
m_ack = state;
}
void saitekosa_expansion_device::pw_w(int state)
{
state = (state) ? 1 : 0;
if (m_module)
m_module->pw_w(state);
m_pw = state;
}
u32 saitekosa_expansion_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
return (m_module) ? m_module->screen_update(screen, bitmap, cliprect) : UPDATE_HAS_NOT_CHANGED;

View File

@ -68,12 +68,14 @@ public:
u8 data_state() { return m_data; }
int nmi_state() { return m_nmi; }
int ack_state() { return m_ack; }
int pw_state() { return m_pw; }
// called from host
u8 data_r();
void data_w(u8 data);
void nmi_w(int state);
void ack_w(int state);
void pw_w(int state);
protected:
// device-level overrides
@ -90,6 +92,7 @@ private:
u8 m_data = 0;
int m_nmi = 0;
int m_ack = 0;
int m_pw = 0;
device_saitekosa_expansion_interface *m_module;
};
@ -106,6 +109,7 @@ public:
virtual void data_w(u8 data) { }
virtual void nmi_w(int state) { }
virtual void ack_w(int state) { }
virtual void pw_w(int state) { }
virtual u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return UPDATE_HAS_NOT_CHANGED; }

View File

@ -339,7 +339,7 @@ u32 saitekosa_analyst_device::screen_update(screen_device &screen, bitmap_rgb32
const u8 *src = render + 16 * ((i & 7) + BIT(i, 3) * 40);
for (int y = 0; y < 8; y++)
for (int x = 0; x < 5; x++)
bitmap.pix(y + 4, i * 6 + x + 2) = BIT(src[y], 4 - x) ? 0x282828 : 0xe8e8e8;
bitmap.pix(y + 4, i * 6 + x + 2) = (BIT(src[y], 4 - x) && m_expansion->pw_state()) ? 0x282828 : 0xe8e8e8;
}
return 0;

View File

@ -43,9 +43,9 @@ Expansion modules released:
TODO:
- OSA module comms is not completely understood
- OSA PC link (probably uses MCU serial interface)
- add power-off
- OSA PC link, uses MCU serial interface
- add nvram (MCU port $14?)
- add power-off, not useful with missing nvram support
******************************************************************************/
@ -225,7 +225,8 @@ void leo_state::p5_w(u8 data)
m_led_data[0] = (m_led_data[0] & 3) | (~data >> 4 & 0xc);
update_display();
// d0: power-off
// d0: power-off on falling edge
m_expansion->pw_w(data & 1);
}
u8 leo_state::p6_r()

View File

@ -245,6 +245,9 @@ void ren_state::p5_w(u8 data)
// d5: expansion ACK-P
m_expansion->ack_w(BIT(data, 5));
// d0: power-off on falling edge
m_expansion->pw_w(data & 1);
// other: ?
}