mirror of
https://github.com/holub/mame
synced 2025-04-28 19:14:55 +03:00
(nw) output finder for speedbal,chesstrv,fireball
This commit is contained in:
parent
fe7fa9c237
commit
3a7e5ed9f8
@ -20,10 +20,10 @@ class chesstrv_state : public driver_device
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
chesstrv_state(const machine_config &mconfig, device_type type, const char *tag)
|
chesstrv_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)
|
||||||
virtual void machine_start() override;
|
{ }
|
||||||
|
|
||||||
DECLARE_READ8_MEMBER( ram_addr_r );
|
DECLARE_READ8_MEMBER( ram_addr_r );
|
||||||
DECLARE_WRITE8_MEMBER( ram_addr_w );
|
DECLARE_WRITE8_MEMBER( ram_addr_w );
|
||||||
@ -34,17 +34,20 @@ public:
|
|||||||
DECLARE_READ8_MEMBER( keypad_r );
|
DECLARE_READ8_MEMBER( keypad_r );
|
||||||
DECLARE_WRITE8_MEMBER( diplomat_display_w );
|
DECLARE_WRITE8_MEMBER( diplomat_display_w );
|
||||||
DECLARE_READ8_MEMBER( diplomat_keypad_r );
|
DECLARE_READ8_MEMBER( diplomat_keypad_r );
|
||||||
|
|
||||||
uint8_t m_ram_addr;
|
|
||||||
uint8_t *m_ram;
|
|
||||||
uint8_t m_matrix;
|
|
||||||
//TIMER_DEVICE_CALLBACK_MEMBER(borisdpl_timer_interrupt);
|
//TIMER_DEVICE_CALLBACK_MEMBER(borisdpl_timer_interrupt);
|
||||||
required_device<cpu_device> m_maincpu;
|
|
||||||
void chesstrv(machine_config &config);
|
void chesstrv(machine_config &config);
|
||||||
void borisdpl(machine_config &config);
|
void borisdpl(machine_config &config);
|
||||||
void borisdpl_io(address_map &map);
|
void borisdpl_io(address_map &map);
|
||||||
void chesstrv_io(address_map &map);
|
void chesstrv_io(address_map &map);
|
||||||
void chesstrv_mem(address_map &map);
|
void chesstrv_mem(address_map &map);
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint8_t m_ram_addr;
|
||||||
|
uint8_t *m_ram;
|
||||||
|
uint8_t m_matrix;
|
||||||
|
virtual void machine_start() override;
|
||||||
|
required_device<cpu_device> m_maincpu;
|
||||||
|
output_finder<8> m_digits;
|
||||||
};
|
};
|
||||||
|
|
||||||
WRITE8_MEMBER( chesstrv_state::ram_addr_w )
|
WRITE8_MEMBER( chesstrv_state::ram_addr_w )
|
||||||
@ -72,13 +75,13 @@ WRITE8_MEMBER( chesstrv_state::display_w )
|
|||||||
uint8_t seg_data = bitswap<8>(data,0,1,2,3,4,5,6,7);
|
uint8_t seg_data = bitswap<8>(data,0,1,2,3,4,5,6,7);
|
||||||
|
|
||||||
if(!(m_matrix & 0x01))
|
if(!(m_matrix & 0x01))
|
||||||
output().set_digit_value( 3, seg_data );
|
m_digits[ 3 ] = seg_data;
|
||||||
if(!(m_matrix & 0x02))
|
if(!(m_matrix & 0x02))
|
||||||
output().set_digit_value( 2, seg_data );
|
m_digits[ 2 ] = seg_data;
|
||||||
if(!(m_matrix & 0x04))
|
if(!(m_matrix & 0x04))
|
||||||
output().set_digit_value( 1, seg_data );
|
m_digits[ 1 ] = seg_data;
|
||||||
if(!(m_matrix & 0x08))
|
if(!(m_matrix & 0x08))
|
||||||
output().set_digit_value( 0, seg_data );
|
m_digits[ 0 ] = seg_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER( chesstrv_state::matrix_w )
|
WRITE8_MEMBER( chesstrv_state::matrix_w )
|
||||||
@ -104,7 +107,7 @@ READ8_MEMBER( chesstrv_state::keypad_r )
|
|||||||
|
|
||||||
WRITE8_MEMBER( chesstrv_state::diplomat_display_w )
|
WRITE8_MEMBER( chesstrv_state::diplomat_display_w )
|
||||||
{
|
{
|
||||||
output().set_digit_value( m_matrix & 7, data ^ 0xff );
|
m_digits[m_matrix & 7] = data ^ 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
READ8_MEMBER( chesstrv_state::diplomat_keypad_r )
|
READ8_MEMBER( chesstrv_state::diplomat_keypad_r )
|
||||||
@ -216,6 +219,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(chesstrv_state::borisdpl_timer_interrupt)
|
|||||||
|
|
||||||
void chesstrv_state::machine_start()
|
void chesstrv_state::machine_start()
|
||||||
{
|
{
|
||||||
|
m_digits.resolve();
|
||||||
m_ram = memregion("ram")->base();
|
m_ram = memregion("ram")->base();
|
||||||
|
|
||||||
save_item(NAME(m_ram_addr));
|
save_item(NAME(m_ram_addr));
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// copyright-holders:ANY
|
// copyright-holders:ANY
|
||||||
/***********************************************************************************
|
/***********************************************************************************
|
||||||
|
|
||||||
fireball.c
|
fireball.cpp
|
||||||
|
|
||||||
Mechanical game where you have a gun shooting rubber balls.
|
Mechanical game where you have a gun shooting rubber balls.
|
||||||
|
|
||||||
@ -48,20 +48,13 @@ class fireball_state : public driver_device
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
fireball_state(const machine_config &mconfig, device_type type, const char *tag)
|
fireball_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_ay(*this, "aysnd"),
|
, m_ay(*this, "aysnd")
|
||||||
m_eeprom(*this, "eeprom")
|
, m_eeprom(*this, "eeprom")
|
||||||
|
, m_digits(*this, "digit%u", 0U)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
uint8_t m_p1_data;
|
|
||||||
uint8_t m_p3_data;
|
|
||||||
uint8_t int_timing;
|
|
||||||
uint8_t int_data;
|
|
||||||
uint8_t ay_data;
|
|
||||||
uint8_t to_ay_data;
|
|
||||||
uint8_t m_display_data;
|
|
||||||
|
|
||||||
DECLARE_WRITE8_MEMBER(io_00_w);
|
DECLARE_WRITE8_MEMBER(io_00_w);
|
||||||
DECLARE_READ8_MEMBER(io_00_r);
|
DECLARE_READ8_MEMBER(io_00_r);
|
||||||
DECLARE_WRITE8_MEMBER(io_02_w);
|
DECLARE_WRITE8_MEMBER(io_02_w);
|
||||||
@ -79,17 +72,21 @@ public:
|
|||||||
void fireball(machine_config &config);
|
void fireball(machine_config &config);
|
||||||
void fireball_io_map(address_map &map);
|
void fireball_io_map(address_map &map);
|
||||||
void fireball_map(address_map &map);
|
void fireball_map(address_map &map);
|
||||||
protected:
|
|
||||||
|
|
||||||
// devices
|
private:
|
||||||
|
uint8_t m_p1_data;
|
||||||
|
uint8_t m_p3_data;
|
||||||
|
uint8_t int_timing;
|
||||||
|
uint8_t int_data;
|
||||||
|
uint8_t ay_data;
|
||||||
|
uint8_t to_ay_data;
|
||||||
|
uint8_t m_display_data;
|
||||||
|
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;
|
||||||
required_device<ay8912_device> m_ay;
|
required_device<ay8912_device> m_ay;
|
||||||
required_device<eeprom_serial_x24c44_device> m_eeprom;
|
required_device<eeprom_serial_x24c44_device> m_eeprom;
|
||||||
|
output_finder<8> m_digits;
|
||||||
// driver_device overrides
|
|
||||||
virtual void machine_reset() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
@ -116,13 +113,13 @@ WRITE8_MEMBER(fireball_state::io_00_w)
|
|||||||
|
|
||||||
switch (data&0x0f)
|
switch (data&0x0f)
|
||||||
{
|
{
|
||||||
case 1: output().set_digit_value(2, m_display_data);
|
case 1: m_digits[2] = m_display_data;
|
||||||
break;
|
break;
|
||||||
case 2: output().set_digit_value(1, m_display_data);
|
case 2: m_digits[1] = m_display_data;
|
||||||
break;
|
break;
|
||||||
case 4: output().set_digit_value(4, m_display_data);
|
case 4: m_digits[4] = m_display_data;
|
||||||
break;
|
break;
|
||||||
case 8: output().set_digit_value(3, m_display_data);
|
case 8: m_digits[3] = m_display_data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +198,7 @@ WRITE8_MEMBER(fireball_state::io_06_w)
|
|||||||
if (LOG_DISPLAY2)
|
if (LOG_DISPLAY2)
|
||||||
logerror("On board display write %02X\n",uint8_t(~(data&0xff)));
|
logerror("On board display write %02X\n",uint8_t(~(data&0xff)));
|
||||||
|
|
||||||
output().set_digit_value(7, uint8_t(~(data&0xff)));
|
m_digits[7] = uint8_t(~(data&0xff));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -448,8 +445,8 @@ INPUT_PORTS_END
|
|||||||
void fireball_state::machine_reset()
|
void fireball_state::machine_reset()
|
||||||
{
|
{
|
||||||
int_timing=1;
|
int_timing=1;
|
||||||
output().set_digit_value(5, 0x3f);
|
m_digits[5] = 0x3f;
|
||||||
output().set_digit_value(6, 0x3f);
|
m_digits[6] = 0x3f;
|
||||||
|
|
||||||
output().set_value("Hopper1", 0);
|
output().set_value("Hopper1", 0);
|
||||||
output().set_value("Hopper2", 0);
|
output().set_value("Hopper2", 0);
|
||||||
|
@ -42,6 +42,7 @@ Interrupt frequency on audio CPU is not a periodical signal, but there are a lot
|
|||||||
|
|
||||||
void speedbal_state::machine_start()
|
void speedbal_state::machine_start()
|
||||||
{
|
{
|
||||||
|
m_digits.resolve();
|
||||||
save_item(NAME(m_leds_start));
|
save_item(NAME(m_leds_start));
|
||||||
save_item(NAME(m_leds_shiftreg));
|
save_item(NAME(m_leds_shiftreg));
|
||||||
}
|
}
|
||||||
@ -101,9 +102,9 @@ WRITE8_MEMBER(speedbal_state::leds_output_block)
|
|||||||
// The shift register is 28 bits, led block number is in the upper bits
|
// The shift register is 28 bits, led block number is in the upper bits
|
||||||
// and the other 3 bytes in it go to each 7seg led of the current block.
|
// and the other 3 bytes in it go to each 7seg led of the current block.
|
||||||
int block = m_leds_shiftreg >> 24 & 7;
|
int block = m_leds_shiftreg >> 24 & 7;
|
||||||
output().set_digit_value(10 * block + 0, ~m_leds_shiftreg >> 0 & 0xff);
|
m_digits[10 * block] = ~m_leds_shiftreg & 0xff;
|
||||||
output().set_digit_value(10 * block + 1, ~m_leds_shiftreg >> 8 & 0xff);
|
m_digits[10 * block + 1] = ~m_leds_shiftreg >> 8 & 0xff;
|
||||||
output().set_digit_value(10 * block + 2, ~m_leds_shiftreg >> 16 & 0xff);
|
m_digits[10 * block + 2] = ~m_leds_shiftreg >> 16 & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER(speedbal_state::leds_start_block)
|
WRITE8_MEMBER(speedbal_state::leds_start_block)
|
||||||
|
@ -4,13 +4,14 @@ class speedbal_state : public driver_device
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
speedbal_state(const machine_config &mconfig, device_type type, const char *tag)
|
speedbal_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_gfxdecode(*this, "gfxdecode"),
|
, m_gfxdecode(*this, "gfxdecode")
|
||||||
m_palette(*this, "palette"),
|
, m_palette(*this, "palette")
|
||||||
m_spriteram(*this, "spriteram"),
|
, m_spriteram(*this, "spriteram")
|
||||||
m_background_videoram(*this, "bg_videoram"),
|
, m_background_videoram(*this, "bg_videoram")
|
||||||
m_foreground_videoram(*this, "fg_videoram")
|
, m_foreground_videoram(*this, "fg_videoram")
|
||||||
|
, m_digits(*this, "digit%u", 0U)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
@ -20,6 +21,7 @@ public:
|
|||||||
required_shared_ptr<uint8_t> m_spriteram;
|
required_shared_ptr<uint8_t> m_spriteram;
|
||||||
required_shared_ptr<uint8_t> m_background_videoram;
|
required_shared_ptr<uint8_t> m_background_videoram;
|
||||||
required_shared_ptr<uint8_t> m_foreground_videoram;
|
required_shared_ptr<uint8_t> m_foreground_videoram;
|
||||||
|
output_finder<73> m_digits;
|
||||||
|
|
||||||
bool m_leds_start;
|
bool m_leds_start;
|
||||||
uint32_t m_leds_shiftreg;
|
uint32_t m_leds_shiftreg;
|
||||||
|
Loading…
Reference in New Issue
Block a user