s11:fixed the worst of the flickering, and also the riverboat issue.

This commit is contained in:
Robbbert 2022-01-31 10:03:02 +11:00
parent c9538016f9
commit 5889120e02
5 changed files with 95 additions and 50 deletions

View File

@ -252,7 +252,14 @@ void s11_state::dig0_w(u8 data)
{
static const u8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447
m_strobe = data & 15;
m_diag = BIT(data, 4, 3);
u8 diag = BIT(data, 4, 3);
if (diag == get_diag())
{
set_lock1(0);
set_lock2(0);
}
else
set_diag(diag);
m_digits[60] = patterns[data>>4]; // diag digit
m_segment1 = 0;
m_segment2 = 0;
@ -260,8 +267,15 @@ void s11_state::dig0_w(u8 data)
void s11_state::dig1_w(u8 data)
{
m_segment2 |= data;
m_segment2 |= 0x20000;
u8 lock = get_lock2() + 1;
if (lock == 1)
{
u16 seg = get_segment2() & 0xff00;
seg |= data;
set_segment2(seg);
m_digits[get_strobe()+16] = bitswap<16>(seg, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
}
set_lock2(lock);
}
u8 s11_state::pia28_w7_r()
@ -279,19 +293,26 @@ u8 s11_state::pia28_w7_r()
void s11_state::pia2c_pa_w(u8 data)
{
m_segment1 |= (data<<8);
m_segment1 |= 0x10000;
if ((m_segment1 & 0x70000) == 0x30000)
if (get_lock1() == 1)
{
m_digits[m_strobe] = bitswap<16>(m_segment1, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
m_segment1 |= 0x40000;
u16 seg = get_segment1() & 0xff;
seg |= (data<<8);
m_digits[get_strobe()] = bitswap<16>(seg, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
set_segment1(seg);
}
}
void s11_state::pia2c_pb_w(u8 data)
{
m_segment1 |= data;
m_segment1 |= 0x20000;
u8 lock = get_lock1() + 1;
if (lock == 1)
{
u16 seg = get_segment1() & 0xff00;
seg |= data;
m_digits[get_strobe()] = bitswap<16>(seg, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
set_segment1(seg);
}
set_lock1(lock);
}
u8 s11_state::switch_r()
@ -313,12 +334,12 @@ void s11_state::switch_w(u8 data)
void s11_state::pia34_pa_w(u8 data)
{
m_segment2 |= (data<<8);
m_segment2 |= 0x10000;
if ((m_segment2 & 0x70000) == 0x30000)
if (get_lock2() == 1)
{
m_digits[m_strobe+16] = bitswap<16>(m_segment2, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
m_segment2 |= 0x40000;
u16 seg = get_segment2() & 0xff;
seg |= (data<<8);
m_digits[get_strobe()+16] = bitswap<16>(seg, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
set_segment2(seg);
}
}

View File

@ -135,7 +135,14 @@ INPUT_PORTS_END
void s11a_state::s11a_dig0_w(u8 data)
{
set_strobe(data & 15);
set_diag(BIT(data, 4, 3));
u8 diag = BIT(data, 4, 3);
if (diag == get_diag())
{
set_lock1(0);
set_lock2(0);
}
else
set_diag(diag);
m_digits[60] = 0; // +5VDC (always on)
m_digits[61] = BIT(data, 4); // connected to PA4
m_digits[62] = 0; // Blanking (pretty much always on)

View File

@ -174,54 +174,66 @@ void s11b_state::machine_reset()
void s11b_state::s11b_dig1_w(u8 data)
{
u32 seg = get_segment2();
seg |= data;
seg |= 0x20000;
set_segment2(seg);
u8 lock = get_lock2() + 1;
if (lock == 1)
{
u16 seg;
if (m_is7seg34)
{
seg = data | (m_invert ? 0x7700 : 0);
if (BIT(seg, 6))
seg |= 0x800; // fix g seg
if (BIT(seg, 7))
seg |= 0x8000; // fix comma
}
else
{
seg = get_segment2() & 0xff00;
seg |= data;
set_segment2(seg);
}
u16 segd = m_invert ? ~seg : seg;
m_digits[get_strobe()+16] = bitswap<16>(segd, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
}
set_lock2(lock);
}
void s11b_state::s11b_pia2c_pa_w(u8 data)
{
u32 seg = get_segment1();
seg |= (data<<8);
seg |= 0x10000;
if((seg & 0x70000) == 0x30000)
if (get_lock1() == 1)
{
u16 segd = (m_invert) ? ~seg : seg;
u16 seg = get_segment1() & 0xff;
seg |= (data<<8);
u16 segd = m_invert ? ~seg : seg;
m_digits[get_strobe()] = bitswap<16>(segd, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
seg |= 0x40000;
set_segment1(seg);
}
set_segment1(seg);
}
void s11b_state::s11b_pia2c_pb_w(u8 data)
{
u32 seg = get_segment1();
seg |= data;
seg |= 0x20000;
set_segment1(seg);
u8 lock = get_lock1() + 1;
if (lock == 1)
{
u16 seg = get_segment1() & 0xff00;
seg |= data;
u16 segd = m_invert ? ~seg : seg;
m_digits[get_strobe()] = bitswap<16>(segd, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
set_segment1(seg);
}
set_lock1(lock);
}
void s11b_state::s11b_pia34_pa_w(u8 data)
{
u32 seg = get_segment2();
seg |= (data<<8);
seg |= 0x10000;
if((seg & 0x70000) == 0x30000)
if ((get_lock2() == 1) && (!m_is7seg34))
{
u16 segd = (m_invert) ? ~seg : seg;
if (m_is7seg34)
{
segd &= 0xff; // discard diagonal segs
if (BIT(segd, 6))
segd |= 0x800; // fix g seg
if (BIT(segd, 7))
segd |= 0x8000; // fix comma
}
u16 seg = get_segment2() & 0xff;
seg |= (data<<8);
u16 segd = m_invert ? ~seg : seg;
m_digits[get_strobe()+16] = bitswap<16>(segd, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0);
seg |= 0x40000;
set_segment2(seg);
}
set_segment2(seg);
}
void s11b_state::init_s11bnn()

View File

@ -31,8 +31,7 @@ Status:
ToDo:
- Riverboat Gambler: first 4 digits of Player 4 don't work. (see code around BBB8)
- Some digits flicker
- Slight flicker
- Star Trax: there's no documentation. Need manual, schematics, etc

View File

@ -162,6 +162,12 @@ protected:
emu_timer* m_irq_timer;
bool m_timer_irq_active = false;
bool m_pia_irq_active = false;
u8 m_lock1 = 0U;
u8 m_lock2 = 0U;
void set_lock1(u8 x) { m_lock1 = x; }
u8 get_lock1() { return m_lock1; }
void set_lock2(u8 x) { m_lock2 = x; }
u8 get_lock2() { return m_lock2; }
private:
void dig0_w(u8 data);
@ -205,15 +211,15 @@ public:
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
bool m_invert = false; // later System 11B games start expecting inverted data to the display LED segments.
void set_invert(bool i) { m_invert = i; }
bool m_is7seg34 = false; // some games use 7-segment displays for players 3 and 4
void set_7seg(bool i) { m_is7seg34 = i; }
void s11b_dig1_w(u8 data);
void s11b_pia2c_pa_w(u8 data);
void s11b_pia2c_pb_w(u8 data);
void s11b_pia34_pa_w(u8 data);
bool m_is7seg34 = false; // some games use 7-segment displays for players 3 and 4
bool m_invert = false; // later System 11B games start expecting inverted data to the display LED segments.
};