Skip to content

Commit 0396abe

Browse files
committed
thayers: led display DA3 is not connected (fixes possible crash)
1 parent e00e8b3 commit 0396abe

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

src/mame/misc/thayers.cpp

+6-25
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@ class thayers_state : public driver_device
119119
void laserdisc_data_w(u8 data);
120120
void laserdisc_control_w(u8 data);
121121

122-
void den1_w(u8 data);
123-
void den2_w(u8 data);
124-
125-
static constexpr u8 LED_MAP[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x00 };
122+
void den_w(offs_t offset, u8 data);
126123
};
127124

128125
void thayers_state::machine_start()
@@ -496,23 +493,7 @@ void thayers_state::laserdisc_control_w(u8 data)
496493
}
497494
}
498495

499-
void thayers_state::den1_w(u8 data)
500-
{
501-
// bit description
502-
//
503-
// 0 DD0
504-
// 1 DD1
505-
// 2 DD2
506-
// 3 DD3
507-
// 4 DA0
508-
// 5 DA1
509-
// 6 DA2
510-
// 7 DA3
511-
512-
m_digits[data >> 4] = LED_MAP[data & 0x0f];
513-
}
514-
515-
void thayers_state::den2_w(u8 data)
496+
void thayers_state::den_w(offs_t offset, u8 data)
516497
{
517498
// bit description
518499
//
@@ -523,9 +504,10 @@ void thayers_state::den2_w(u8 data)
523504
// 4 DA0
524505
// 5 DA1
525506
// 6 DA2
526-
// 7 DA3
507+
// 7 N/C
527508

528-
m_digits[8 + (data >> 4)] = LED_MAP[data & 0x0f];
509+
static constexpr u8 LED_MAP[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x00 };
510+
m_digits[(offset * 8) | (data >> 4 & 7)] = LED_MAP[data & 0x0f];
529511
}
530512

531513

@@ -551,8 +533,7 @@ void thayers_state::thayers_io_map(address_map &map)
551533
map(0xf3, 0xf3).w(FUNC(thayers_state::periodic_int_ack_w));
552534
map(0xf4, 0xf4).w(FUNC(thayers_state::laserdisc_data_w));
553535
map(0xf5, 0xf5).w(FUNC(thayers_state::laserdisc_control_w));
554-
map(0xf6, 0xf6).w(FUNC(thayers_state::den1_w));
555-
map(0xf7, 0xf7).w(FUNC(thayers_state::den2_w));
536+
map(0xf6, 0xf7).w(FUNC(thayers_state::den_w));
556537
}
557538

558539

0 commit comments

Comments
 (0)