(nw) output finder for 24cdjuke,30test,allied,cvicny,datum,k1003,prodigy

This commit is contained in:
Robbbert 2018-04-03 17:26:27 +10:00
parent c80846895b
commit 109691ca5c
7 changed files with 83 additions and 50 deletions

View File

@ -61,13 +61,14 @@ class midcoin24cdjuke_state : public driver_device
{ {
public: public:
midcoin24cdjuke_state(const machine_config &mconfig, device_type type, const char *tag) midcoin24cdjuke_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : driver_device(mconfig, type, tag)
m_maincpu(*this, "maincpu"), , m_maincpu(*this, "maincpu")
m_io_row0(*this, "ROW0"), , m_io_row0(*this, "ROW0")
m_io_row1(*this, "ROW1"), , m_io_row1(*this, "ROW1")
m_io_row2(*this, "ROW2"), , m_io_row2(*this, "ROW2")
m_io_row3(*this, "ROW3"), , m_io_row3(*this, "ROW3")
m_charset(*this, "charset") , m_charset(*this, "charset")
, m_digits(*this, "digit%u", 0U)
{ } { }
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
@ -76,6 +77,7 @@ public:
required_ioport m_io_row2; required_ioport m_io_row2;
required_ioport m_io_row3; required_ioport m_io_row3;
required_region_ptr<uint16_t> m_charset; required_region_ptr<uint16_t> m_charset;
output_finder<16> m_digits;
virtual void machine_start() override; virtual void machine_start() override;
virtual void machine_reset() override; virtual void machine_reset() override;
@ -121,7 +123,7 @@ WRITE8_MEMBER(midcoin24cdjuke_state::digit_w)
char_data = bitswap<16>(char_data, 13,11,9,15,14,10,12,8,7,6,5,4,3,2,1,0); char_data = bitswap<16>(char_data, 13,11,9,15,14,10,12,8,7,6,5,4,3,2,1,0);
output().set_digit_value(offset, char_data ^ 0xffff); m_digits[offset] = char_data ^ 0xffff;
} }
@ -271,6 +273,7 @@ INPUT_PORTS_END
void midcoin24cdjuke_state::machine_start() void midcoin24cdjuke_state::machine_start()
{ {
m_digits.resolve();
} }
void midcoin24cdjuke_state::machine_reset() void midcoin24cdjuke_state::machine_reset()

View File

@ -56,9 +56,11 @@ class namco_30test_state : public driver_device
{ {
public: public:
namco_30test_state(const machine_config &mconfig, device_type type, const char *tag) namco_30test_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : driver_device(mconfig, type, tag)
m_maincpu(*this, "maincpu"), , m_maincpu(*this, "maincpu")
m_oki(*this, "oki") { } , m_oki(*this, "oki")
, m_digits(*this, "digit%u", 0U)
{ }
uint8_t m_mux_data; uint8_t m_mux_data;
uint8_t m_oki_bank; uint8_t m_oki_bank;
@ -77,6 +79,7 @@ public:
void _30test(machine_config &config); void _30test(machine_config &config);
void namco_30test_io(address_map &map); void namco_30test_io(address_map &map);
void namco_30test_map(address_map &map); void namco_30test_map(address_map &map);
output_finder<72> m_digits;
}; };
@ -85,14 +88,17 @@ static const uint8_t led_map[16] =
WRITE8_MEMBER(namco_30test_state::namco_30test_led_w) WRITE8_MEMBER(namco_30test_state::namco_30test_led_w)
{ {
output().set_digit_value(0 + offset * 2, led_map[(data & 0xf0) >> 4]); m_digits[offset * 2] = led_map[data >> 4];
output().set_digit_value(1 + offset * 2, led_map[(data & 0x0f) >> 0]); m_digits[1 + offset * 2] = led_map[data & 0x0f];
} }
WRITE8_MEMBER(namco_30test_state::namco_30test_led_rank_w) WRITE8_MEMBER(namco_30test_state::namco_30test_led_rank_w)
{ {
output().set_digit_value(64 + offset * 2, led_map[(data & 0xf0) >> 4]); if (offset < 4)
output().set_digit_value(65 + offset * 2, led_map[(data & 0x0f) >> 0]); {
m_digits[64 + offset * 2] = led_map[data >> 4];
m_digits[65 + offset * 2] = led_map[data & 0x0f];
}
} }
WRITE8_MEMBER(namco_30test_state::namco_30test_lamps_w) WRITE8_MEMBER(namco_30test_state::namco_30test_lamps_w)
@ -233,6 +239,7 @@ INPUT_PORTS_END
void namco_30test_state::machine_start() void namco_30test_state::machine_start()
{ {
m_digits.resolve();
save_item(NAME(m_mux_data)); save_item(NAME(m_mux_data));
save_item(NAME(m_oki_bank)); save_item(NAME(m_oki_bank));
} }

View File

@ -27,6 +27,7 @@
For some reason the 'rol $46' instruction outputs the original data For some reason the 'rol $46' instruction outputs the original data
followed by the new result, so I've had to employ a horrible hack. followed by the new result, so I've had to employ a horrible hack.
Hold down X while inserting a coin.
At the start of each ball, the display will be flashing. You need to At the start of each ball, the display will be flashing. You need to
hit Z, and then you can get a score. When the ball indicator goes out, hit Z, and then you can get a score. When the ball indicator goes out,
your game is over. your game is over.
@ -63,6 +64,7 @@ public:
, m_ic6(*this, "ic6") , m_ic6(*this, "ic6")
, m_ic7(*this, "ic7") , m_ic7(*this, "ic7")
, m_ic8(*this, "ic8") , m_ic8(*this, "ic8")
, m_digits(*this, "digit%u", 0U)
{ } { }
DECLARE_WRITE8_MEMBER(ic1_b_w); DECLARE_WRITE8_MEMBER(ic1_b_w);
@ -99,6 +101,7 @@ private:
uint8_t m_ic6b4; uint8_t m_ic6b4;
uint8_t m_ic6b7; uint8_t m_ic6b7;
virtual void machine_reset() override; virtual void machine_reset() override;
virtual void machine_start() override { m_digits.resolve(); }
required_device<m6504_device> m_maincpu; required_device<m6504_device> m_maincpu;
required_device<pia6821_device> m_ic1; required_device<pia6821_device> m_ic1;
required_device<pia6821_device> m_ic2; required_device<pia6821_device> m_ic2;
@ -107,6 +110,7 @@ private:
required_device<mos6530_device> m_ic6; required_device<mos6530_device> m_ic6;
required_device<pia6821_device> m_ic7; required_device<pia6821_device> m_ic7;
required_device<pia6821_device> m_ic8; required_device<pia6821_device> m_ic8;
output_finder<42> m_digits;
}; };
@ -413,34 +417,34 @@ WRITE8_MEMBER( allied_state::ic4_b_w )
{ {
if (!BIT(data, i+4)) if (!BIT(data, i+4))
{ {
output().set_digit_value(i*10, patterns[0]); m_digits[i*10] = patterns[0];
segment = (m_player_score[i] >> 0) & 15; segment = (m_player_score[i] >> 0) & 15;
output().set_digit_value(i*10+1, patterns[segment]); m_digits[i*10+1] = patterns[segment];
segment = (m_player_score[i] >> 4) & 15; segment = (m_player_score[i] >> 4) & 15;
output().set_digit_value(i*10+2, patterns[segment]); m_digits[i*10+2] = patterns[segment];
segment = (m_player_score[i] >> 8) & 15; segment = (m_player_score[i] >> 8) & 15;
output().set_digit_value(i*10+3, patterns[segment]); m_digits[i*10+3] = patterns[segment];
segment = (m_player_score[i] >> 12) & 15; segment = (m_player_score[i] >> 12) & 15;
output().set_digit_value(i*10+4, patterns[segment]); m_digits[i*10+4] = patterns[segment];
segment = (m_player_score[i] >> 16) & 15; segment = (m_player_score[i] >> 16) & 15;
output().set_digit_value(i*10+5, patterns[segment]); m_digits[i*10+5] = patterns[segment];
} }
else else
{ {
output().set_digit_value(i*10, 0); m_digits[i*10] = 0;
output().set_digit_value(i*10+1, 0); m_digits[i*10+1] = 0;
output().set_digit_value(i*10+2, 0); m_digits[i*10+2] = 0;
output().set_digit_value(i*10+3, 0); m_digits[i*10+3] = 0;
output().set_digit_value(i*10+4, 0); m_digits[i*10+4] = 0;
output().set_digit_value(i*10+5, 0); m_digits[i*10+5] = 0;
} }
} }
// doesn't seem to be a strobe for the credits display // doesn't seem to be a strobe for the credits display
segment = (m_player_score[4] >> 0) & 15; segment = (m_player_score[4] >> 0) & 15;
output().set_digit_value(40, patterns[segment]); m_digits[40] = patterns[segment];
segment = (m_player_score[4] >> 4) & 15; segment = (m_player_score[4] >> 4) & 15;
output().set_digit_value(41, patterns[segment]); m_digits[41] = patterns[segment];
// PB0-3 - player 1-4 LED - to do // PB0-3 - player 1-4 LED - to do
} }

View File

@ -40,25 +40,29 @@ class cvicny_state : public driver_device
{ {
public: public:
cvicny_state(const machine_config &mconfig, device_type type, const char *tag) cvicny_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : driver_device(mconfig, type, tag)
m_maincpu(*this, "maincpu"), , m_digit_last(0)
m_digit_last(0) , m_maincpu(*this, "maincpu")
{ } , m_digits(*this, "digit%u", 0U)
{ }
required_device<cpu_device> m_maincpu; void cvicny(machine_config &config);
void cvicny_mem(address_map &map);
DECLARE_READ8_MEMBER(key_r); DECLARE_READ8_MEMBER(key_r);
DECLARE_WRITE8_MEMBER(digit_w); DECLARE_WRITE8_MEMBER(digit_w);
DECLARE_WRITE8_MEMBER(segment_w ); DECLARE_WRITE8_MEMBER(segment_w );
private:
uint8_t m_digit; uint8_t m_digit;
uint8_t m_digit_last; uint8_t m_digit_last;
void cvicny(machine_config &config); virtual void machine_start() override { m_digits.resolve(); }
void cvicny_mem(address_map &map); required_device<cpu_device> m_maincpu;
output_finder<8> m_digits;
}; };
WRITE8_MEMBER( cvicny_state::segment_w ) // output segments on the selected digit WRITE8_MEMBER( cvicny_state::segment_w ) // output segments on the selected digit
{ {
if (m_digit != m_digit_last) if (m_digit != m_digit_last)
output().set_digit_value(m_digit, data); m_digits[m_digit] = data;
m_digit_last = m_digit; m_digit_last = m_digit;
} }

View File

@ -63,6 +63,7 @@ public:
, m_pia1(*this, "pia1") , m_pia1(*this, "pia1")
, m_keyboard(*this, "X%u", 0) , m_keyboard(*this, "X%u", 0)
, m_maincpu(*this, "maincpu") , m_maincpu(*this, "maincpu")
, m_digits(*this, "digit%u", 0U)
{ } { }
DECLARE_READ8_MEMBER(pa_r); DECLARE_READ8_MEMBER(pa_r);
@ -75,9 +76,11 @@ public:
private: private:
uint8_t m_keydata; uint8_t m_keydata;
virtual void machine_reset() override; virtual void machine_reset() override;
virtual void machine_start() override { m_digits.resolve(); }
required_device<pia6821_device> m_pia1; required_device<pia6821_device> m_pia1;
required_ioport_array<4> m_keyboard; required_ioport_array<4> m_keyboard;
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
output_finder<16> m_digits;
}; };
@ -164,7 +167,7 @@ WRITE8_MEMBER( datum_state::pa_w )
data ^= 0xff; data ^= 0xff;
if (m_keydata > 3) if (m_keydata > 3)
{ {
output().set_digit_value(m_keydata, bitswap<8>(data & 0x7f, 7, 0, 5, 6, 4, 2, 1, 3)); m_digits[m_keydata] = bitswap<8>(data & 0x7f, 7, 0, 5, 6, 4, 2, 1, 3);
m_keydata = 0; m_keydata = 0;
} }

View File

@ -51,7 +51,9 @@ class k1003_state : public driver_device
public: public:
k1003_state(const machine_config &mconfig, device_type type, const char *tag) k1003_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) : driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu") { } , m_maincpu(*this, "maincpu")
, m_digits(*this, "digit%u", 0U)
{ }
DECLARE_READ8_MEMBER(port2_r); DECLARE_READ8_MEMBER(port2_r);
DECLARE_READ8_MEMBER(key_r); DECLARE_READ8_MEMBER(key_r);
@ -67,7 +69,9 @@ private:
uint8_t m_disp_2; uint8_t m_disp_2;
uint8_t bit_to_dec(uint8_t val); uint8_t bit_to_dec(uint8_t val);
virtual void machine_reset() override; virtual void machine_reset() override;
virtual void machine_start() override { m_digits.resolve(); }
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
output_finder<16> m_digits;
}; };
@ -117,8 +121,8 @@ uint8_t k1003_state::bit_to_dec(uint8_t val)
WRITE8_MEMBER( k1003_state::disp_w ) WRITE8_MEMBER( k1003_state::disp_w )
{ {
output().set_digit_value(bit_to_dec(data)*2, m_disp_1); m_digits[bit_to_dec(data)*2] = m_disp_1;
output().set_digit_value(bit_to_dec(data)*2+1, m_disp_2); m_digits[bit_to_dec(data)*2+1] = m_disp_2;
} }
void k1003_state::k1003_io(address_map &map) void k1003_state::k1003_io(address_map &map)

View File

@ -137,6 +137,7 @@ public:
, m_cb2(*this, "bcd:cb2") , m_cb2(*this, "bcd:cb2")
, m_digit(0.0) , m_digit(0.0)
, m_io_line(*this, "LINE%u", 0) , m_io_line(*this, "LINE%u", 0)
, m_digits(*this, "digit%u", 0U)
#if HTTPUI #if HTTPUI
, m_connection(NULL) , m_connection(NULL)
, m_web_line0(0) , m_web_line0(0)
@ -180,6 +181,7 @@ private:
virtual void device_start() override; virtual void device_start() override;
required_ioport_array<5> m_io_line; required_ioport_array<5> m_io_line;
output_finder<4> m_digits;
uint16_t m_line[5]; uint16_t m_line[5];
#if HTTPUI #if HTTPUI
@ -212,6 +214,7 @@ NETDEV_LOGIC_CALLBACK_MEMBER(prodigy_state::bcd_bit7_cb) { if (data != 0) m_digi
void prodigy_state::device_start() void prodigy_state::device_start()
{ {
m_digits.resolve();
memset(m_line, 0, sizeof(m_line)); memset(m_line, 0, sizeof(m_line));
#if HTTPUI #if HTTPUI
m_server = machine().manager().http(); m_server = machine().manager().http();
@ -554,22 +557,27 @@ void prodigy_state::update_bcd()
LOGBCD(" - segments: %02x -> ", m_digit); LOGBCD(" - segments: %02x -> ", m_digit);
m_segments = m_digit; m_segments = m_digit;
LOGBCD("%02x\n", m_segments); LOGBCD("%02x\n", m_segments);
if (m_digit_cache[digit_nbr] != m_segments)
if (digit_nbr < 4)
{ {
output().set_digit_value( digit_nbr, m_segments); if (m_digit_cache[digit_nbr] != m_segments)
m_digit_cache[digit_nbr] = m_segments; {
m_digits[digit_nbr] = m_segments;
m_digit_cache[digit_nbr] = m_segments;
#if HTTPUI #if HTTPUI
update_web_bcd(digit_nbr, m_segments); update_web_bcd(digit_nbr, m_segments);
#endif #endif
}
} }
} }
} }
ADDRESS_MAP_START(prodigy_state::maincpu_map) void prodigy_state::maincpu_map(address_map &map)
AM_RANGE(0x0000, 0x07ff) AM_RAM {
AM_RANGE(0x2000, 0x200f) AM_DEVREADWRITE("via", via6522_device, read, write) map(0x0000, 0x07ff).ram();
AM_RANGE(0x6000, 0x7fff) AM_ROM AM_REGION("roms", 0x0000) AM_MIRROR(0x8000) map(0x2000, 0x200f).rw("via", FUNC(via6522_device::read),FUNC(via6522_device::write));
ADDRESS_MAP_END map(0x6000, 0x7fff).rom().region("roms", 0).mirror(0x8000);
}
/* /*
* The keypad was modelled after the physical appearance but altered after finding out how it was working so * The keypad was modelled after the physical appearance but altered after finding out how it was working so