various drivers: another batch of output().set_value() removals

This commit is contained in:
Ivan Vangelista 2023-08-24 22:17:35 +02:00
parent 014cc81ea6
commit 1e095c9627
18 changed files with 238 additions and 93 deletions

View File

@ -68,6 +68,16 @@ public:
, m_switches(*this, "SW%u", 0U)
, m_steer(*this, "STEER")
, m_digits(*this, "digit%u", 0U)
, m_offroad_right_lamp(*this, "Offroad Right %u Lamp", 1U)
, m_offroad_left_lamp(*this, "Offroad Left %u Lamp", 1U)
, m_damage_lamp(*this, "Damage Lamp")
, m_stop_lamp(*this, "Stop Lamp")
, m_gun_active_right_lamp(*this, "Gun Active Right Lamp")
, m_gun_active_left_lamp(*this, "Gun Active Left Lamp")
, m_vest_hit_lamp(*this, "Vest Hit %u Lamp", 1U)
, m_flash_red_lamp(*this, "Flash Red Lamp")
, m_flash_blue_lamp(*this, "Flash Blue Lamp")
, m_bullet_lamp(*this, "Bullet Lamp %u", 1U)
, m_irq(0)
{ }
@ -94,6 +104,16 @@ private:
required_ioport_array<3> m_switches;
optional_ioport m_steer;
output_finder<16> m_digits;
output_finder<4> m_offroad_right_lamp;
output_finder<4> m_offroad_left_lamp;
output_finder<> m_damage_lamp;
output_finder<> m_stop_lamp;
output_finder<> m_gun_active_right_lamp;
output_finder<> m_gun_active_left_lamp;
output_finder<3> m_vest_hit_lamp;
output_finder<> m_flash_red_lamp;
output_finder<> m_flash_blue_lamp;
output_finder<6> m_bullet_lamp;
// screen updates
[[maybe_unused]] uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -654,23 +674,19 @@ void cops_state::io1_w(offs_t offset, uint8_t data)
m_lcd_data_h = data;
break;
case 0x04: /* WOP4 */
output().set_value("Offroad Right 4 Lamp", data & 0x80);
output().set_value("Offroad Right 3 Lamp", data & 0x40);
output().set_value("Offroad Right 2 Lamp", data & 0x20);
output().set_value("Offroad Right 1 Lamp", data & 0x10);
output().set_value("Offroad Left 4 Lamp", data & 0x08);
output().set_value("Offroad Left 3 Lamp", data & 0x04);
output().set_value("Offroad Left 2 Lamp", data & 0x02);
output().set_value("Offroad Left 1 Lamp", data & 0x01);
for (int i = 3; i >= 0; i--)
m_offroad_right_lamp[i] = BIT(data, i + 4);
for (int i = 3; i >= 0; i--)
m_offroad_left_lamp[i] = BIT(data, i);
break;
case 0x05: /* WOP5 */
output().set_value("Damage Lamp", data & 0x80);
output().set_value("Stop Lamp", data & 0x40);
output().set_value("Gun Active Right Lamp", data & 0x20);
output().set_value("Vest Hit 2 Lamp", data & 0x10);
output().set_value("Vest Hit 3 Lamp", data & 0x04);
output().set_value("Gun Active Left Lamp", data & 0x02);
output().set_value("Vest Hit 1 Lamp", data & 0x01);
m_damage_lamp = BIT(data, 7);
m_stop_lamp = BIT(data, 6);
m_gun_active_right_lamp = BIT(data, 5);
m_vest_hit_lamp[1] = BIT(data, 4);
m_vest_hit_lamp[2] = BIT(data, 2);
m_gun_active_left_lamp = BIT(data, 1);
m_vest_hit_lamp[0] = BIT(data, 0);
break;
case 0x06: /* WOP6 */
logerror("WOP6: data = %02x\n", data);
@ -704,17 +720,13 @@ void cops_state::io2_w(offs_t offset, uint8_t data)
switch( offset & 0x0f )
{
case 0x02:
output().set_value("Flash Red Lamp", data & 0x01);
output().set_value("Flash Blue Lamp", data & 0x80);
m_flash_red_lamp = BIT(data, 0);
m_flash_blue_lamp = BIT(data, 7);
if ( data & ~0x91 ) logerror("Unknown io2_w, offset = %02x, data = %02x\n", offset, data);
break;
case 0x04:
output().set_value("Bullet Lamp 6", data & 0x20);
output().set_value("Bullet Lamp 5", data & 0x10);
output().set_value("Bullet Lamp 4", data & 0x08);
output().set_value("Bullet Lamp 3", data & 0x04);
output().set_value("Bullet Lamp 2", data & 0x02);
output().set_value("Bullet Lamp 1", data & 0x01);
for (int i = 5; i >= 0; i--)
m_bullet_lamp[i] = BIT(data, i);
if ( data & ~0x3f ) logerror("Unknown io2_w, offset = %02x, data = %02x\n", offset, data);
break;
default:
@ -878,6 +890,16 @@ INPUT_PORTS_END
void cops_state::machine_start()
{
m_digits.resolve();
m_offroad_right_lamp.resolve();
m_offroad_left_lamp.resolve();
m_damage_lamp.resolve();
m_stop_lamp.resolve();
m_gun_active_right_lamp.resolve();
m_gun_active_left_lamp.resolve();
m_vest_hit_lamp.resolve();
m_flash_red_lamp.resolve();
m_flash_blue_lamp.resolve();
m_bullet_lamp.resolve();
m_ld_timer = timer_alloc(FUNC(cops_state::ld_timer_callback), this);

View File

@ -390,7 +390,7 @@ void mpu4_state::update_meters()
break;
case FLUTTERBOX: //The backbox fan assembly fits in a reel unit sized box, wired to the remote meter pin, so we can handle it here
output().set_value("flutterbox", data & 0x80);
m_flutterbox = BIT(data, 7);
data &= ~0x80; //Strip flutterbox data from meter drives
break;
}
@ -1880,6 +1880,7 @@ void mpu4_state::mpu4_config_common()
m_mpu4leds.resolve();
m_digits.resolve();
m_triacs.resolve();
m_flutterbox.resolve();
m_ic24_timer = timer_alloc(FUNC(mpu4_state::update_ic24), this);

View File

@ -158,6 +158,7 @@ public:
, m_mpu4leds(*this, "mpu4led%u", 0U)
, m_digits(*this, "digit%u", 0U)
, m_triacs(*this, "triac%u", 0U)
, m_flutterbox(*this, "flutterbox")
{ }
@ -459,6 +460,8 @@ protected:
output_finder<8> m_triacs;
output_finder<> m_flutterbox;
uint8_t m_mmtr_data = 0;
uint8_t m_ay8913_address = 0;
uint8_t m_signal_50hz = 0;

View File

@ -188,6 +188,7 @@ public:
driver_device(mconfig, type, tag),
m_dsw(*this, "DSW"),
m_in0(*this, "IN0"),
m_led(*this, "led%u", 0U),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
@ -217,6 +218,7 @@ protected:
required_ioport m_dsw;
required_ioport m_in0;
output_finder<2> m_led;
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
@ -472,8 +474,8 @@ void exidy_state::mtrap_ocl_w(uint8_t data) // Mouse Trap (possibly others) set
{
*m_sprite_enable = data;
output().set_value("led0", !BIT(data, 2));
output().set_value("led1", !BIT(data, 4));
m_led[0] = !BIT(data, 2);
m_led[1] = !BIT(data, 4);
}
@ -1457,6 +1459,8 @@ uint32_t exidy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
void exidy_state::machine_start()
{
m_led.resolve();
for (int i = 0; i < 128; i++)
m_collision_timer[i] = timer_alloc(FUNC(exidy_state::latch_collision), this);
}

View File

@ -102,6 +102,12 @@ public:
, m_turntable(*this, "TT%u", 1U)
, m_sndram(*this, "sndram")
, m_leds(*this, "led%u", 0U)
, m_right_red_hlt(*this, "right-red-hlt")
, m_left_red_hlt(*this, "left-red-hlt")
, m_right_blue_hlt(*this, "right-blue-hlt")
, m_left_blue_hlt(*this, "left-blue-hlt")
, m_right_ssr(*this, "right-ssr")
, m_left_ssr(*this, "left-ssr")
{
}
@ -168,6 +174,12 @@ private:
optional_ioport_array<2> m_turntable;
required_shared_ptr<uint8_t> m_sndram;
output_finder<3> m_leds;
output_finder<> m_right_red_hlt;
output_finder<> m_left_red_hlt;
output_finder<> m_right_blue_hlt;
output_finder<> m_left_blue_hlt;
output_finder<> m_right_ssr;
output_finder<> m_left_ssr;
int m_sndram_bank = 0;
int m_turntable_select = 0;
@ -559,10 +571,10 @@ void djmain_state::light_ctrl_1_w(offs_t offset, uint32_t data, uint32_t mem_mas
{
if (ACCESSING_BITS_16_31)
{
output().set_value("right-red-hlt", !(data & 0x08000000)); // Right red HIGHLIGHT
output().set_value("left-red-hlt", !(data & 0x04000000)); // Left red HIGHLIGHT
output().set_value("left-blue-hlt", !(data & 0x02000000)); // Left blue HIGHLIGHT
output().set_value("right-blue-hlt", !(data & 0x00200000)); // Right blue HIGHLIGHT
m_right_red_hlt = !BIT(data, 27); // Right red HIGHLIGHT
m_left_red_hlt = !BIT(data, 26); // Left red HIGHLIGHT
m_left_blue_hlt = !BIT(data, 25); // Left blue HIGHLIGHT
m_right_blue_hlt = !BIT(data, 21); // Right blue HIGHLIGHT
}
}
@ -570,8 +582,8 @@ void djmain_state::light_ctrl_2_w(offs_t offset, uint32_t data, uint32_t mem_mas
{
if (ACCESSING_BITS_16_31)
{
output().set_value("left-ssr", !!(data & 0x08000000)); // SSR
output().set_value("right-ssr", !!(data & 0x08000000)); // SSR
m_left_ssr = !!BIT(data, 27); // SSR
m_right_ssr = !!BIT(data, 27); // SSR
m_leds[0] = BIT(data, 16); // 1P START
m_leds[1] = BIT(data, 17); // 2P START
m_leds[2] = BIT(data, 18); // EFFECT
@ -1623,6 +1635,12 @@ void djmain_state::machine_start()
hdd->set_user_password(m_ata_user_password);
m_leds.resolve();
m_right_red_hlt.resolve();
m_left_red_hlt.resolve();
m_right_blue_hlt.resolve();
m_left_blue_hlt.resolve();
m_right_ssr.resolve();
m_left_ssr.resolve();
save_item(NAME(m_sndram_bank));
save_item(NAME(m_pending_vb_int));

View File

@ -296,11 +296,18 @@ public:
m_ata(*this, "ata"),
m_dpram(*this, "dpram"),
m_waveram(*this, "rfsnd"),
m_in(*this, "IN%u", 0U),
m_led_displays(*this, "led%u", 0U),
m_spotlights(*this, "spotlight%u", 0U),
m_main_leds(*this, "main_led%u", 0U),
m_key_leds(*this, "key%u-%u", 1U, 1U),
m_spu_leds(*this, "spu_led%u", 0U),
m_player_lamps(*this, "%up", 1U),
m_vefx_lamp(*this, "vefx"),
m_effect_lamp(*this, "effect"),
m_credit_lamp(*this, "credit"),
m_neon_lamp(*this, "neonlamp"),
m_unknown_outputs(*this, "unknown%u", 1U),
m_spu_ata_dma(0),
m_spu_ata_dmarq(0),
m_wave_bank(0)
@ -346,11 +353,19 @@ private:
required_device<cy7c131_device> m_dpram;
required_shared_ptr<uint16_t> m_waveram;
required_ioport_array<6> m_in;
output_finder<9> m_led_displays;
output_finder<8> m_spotlights;
output_finder<9> m_main_leds;
output_finder<2, 7> m_key_leds;
output_finder<8> m_spu_leds;
output_finder<2> m_player_lamps;
output_finder<> m_vefx_lamp;
output_finder<> m_effect_lamp;
output_finder<> m_credit_lamp;
output_finder<> m_neon_lamp;
output_finder<4> m_unknown_outputs;
uint16_t m_spu_ctrl = 0; // SPU board control register
uint32_t m_spu_ata_dma = 0;
@ -545,6 +560,12 @@ void twinkle_state::machine_start()
m_main_leds.resolve();
m_key_leds.resolve();
m_spu_leds.resolve();
m_player_lamps.resolve();
m_vefx_lamp.resolve();
m_effect_lamp.resolve();
m_credit_lamp.resolve();
m_neon_lamp.resolve();
m_unknown_outputs.resolve();
save_item(NAME(m_spu_ctrl));
save_item(NAME(m_spu_ata_dma));
@ -591,11 +612,11 @@ void twinkle_state::twinkle_io_w(offs_t offset, uint8_t data)
break;
case 0x37:
output().set_value("1p", (~data >> 0) & 1);
output().set_value("2p", (~data >> 1) & 1);
output().set_value("vefx", (~data >> 2) & 1);
output().set_value("effect", (~data >> 3) & 1);
output().set_value("credit", (~data >> 4) & 1);
m_player_lamps[0] = BIT(~data, 0);
m_player_lamps[1] = BIT(~data, 1);
m_vefx_lamp = BIT(~data, 2);
m_effect_lamp = BIT(~data, 3);
m_credit_lamp = BIT(~data, 4);
if ((data & 0xe0) != 0xe0)
{
@ -627,9 +648,9 @@ void twinkle_state::twinkle_io_w(offs_t offset, uint8_t data)
break;
case 0x8f:
output().set_value( "neonlamp", ( ~data >> 0 ) & 1 );
output().set_value( "unknown1", ( ~data >> 1 ) & 1 );
output().set_value( "unknown2", ( ~data >> 2 ) & 1 );
m_neon_lamp = BIT(~data, 0);
m_unknown_outputs[0] = BIT(~data, 1);
m_unknown_outputs[1] = BIT(~data, 2);
if( ( data & 0xf8 ) != 0xf8 )
{
@ -660,27 +681,27 @@ uint8_t twinkle_state::twinkle_io_r(offs_t offset)
switch( m_io_offset )
{
case 0x07:
data = ioport( "IN0" )->read();
data = m_in[0]->read();
break;
case 0x0f:
data = ioport( "IN1" )->read();
data = m_in[1]->read();
break;
case 0x17:
data = ioport( "IN2" )->read();
data = m_in[2]->read();
break;
case 0x1f:
data = ioport( "IN3" )->read();
data = m_in[3]->read();
break;
case 0x27:
data = ioport( "IN4" )->read();
data = m_in[4]->read();
break;
case 0x2f:
data = ioport( "IN5" )->read();
data = m_in[5]->read();
break;
default:
@ -840,8 +861,8 @@ void twinkle_state::key_led_w(uint16_t data)
m_key_leds[1][4] = BIT(data, 11);
m_key_leds[1][5] = BIT(data, 12);
m_key_leds[1][6] = BIT(data, 13);
output().set_value("unknown3", (data >> 14) & 1);
output().set_value("unknown4", (data >> 15) & 1);
m_unknown_outputs[2] = BIT(data, 14);
m_unknown_outputs[3] = BIT(data, 15);
}
void twinkle_state::serial_w(uint16_t data)

View File

@ -206,7 +206,10 @@ public:
m_maincpu(*this, "maincpu"),
m_banks(*this, "bank%u", 0U),
m_region_maincpu(*this, "maincpu"),
m_region_extra(*this, "extra")
m_region_extra(*this, "extra"),
m_p1_disc_lamp(*this, "P1 DISC %u LAMP", 1U),
m_p1_play_lamp(*this, "P1 PLAY LAMP"),
m_p1_cancel_lamp(*this, "P1 CANCEL LAMP")
{ }
void init_megat3te();
@ -232,6 +235,9 @@ private:
required_memory_region m_region_maincpu;
optional_memory_region m_region_extra;
std::unique_ptr<uint8_t[]> m_ram;
output_finder<5> m_p1_disc_lamp;
output_finder<> m_p1_play_lamp;
output_finder<> m_p1_cancel_lamp;
int m_vint;
int m_interrupt_vdp0_state;
@ -875,13 +881,10 @@ uint8_t meritm_state::_8255_port_c_r()
void meritm_state::crt250_port_b_w(uint8_t data)
{
//popmessage("Lamps: %d %d %d %d %d %d %d", BIT(data,0), BIT(data,1), BIT(data,2), BIT(data,3), BIT(data,4), BIT(data,5), BIT(data,6) );
output().set_value("P1 DISC 1 LAMP", !BIT(data,0));
output().set_value("P1 DISC 2 LAMP", !BIT(data,1));
output().set_value("P1 DISC 3 LAMP", !BIT(data,2));
output().set_value("P1 DISC 4 LAMP", !BIT(data,3));
output().set_value("P1 DISC 5 LAMP", !BIT(data,4));
output().set_value("P1 PLAY LAMP", !BIT(data,5));
output().set_value("P1 CANCEL LAMP", !BIT(data,6));
for (int i = 0; i < 5; i++)
m_p1_disc_lamp[i] = !BIT(data, i);
m_p1_play_lamp = !BIT(data, 5);
m_p1_cancel_lamp = !BIT(data, 6);
}
/*************************************
@ -1042,6 +1045,9 @@ MACHINE_START_MEMBER(meritm_state, common)
void meritm_state::machine_start()
{
m_p1_disc_lamp.resolve();
m_p1_play_lamp.resolve();
m_p1_cancel_lamp.resolve();
m_banks[0]->configure_entries(0, 8, m_region_maincpu->base(), 0x10000);
m_bank = 0xff;
crt250_switch_banks();

View File

@ -583,7 +583,7 @@ void mcr_state::dotron_op4_w(uint8_t data)
*/
/* bit 7 = FL1 (J1-3) on flasher control board */
/* bit 6 = FL0 (J1-4) on flasher control board */
output().set_value("backlight", (data >> 6) & 1);
m_backlight = BIT(data, 6);
/*
Lamp Sequencer:

View File

@ -49,7 +49,8 @@ public:
m_squawk_n_talk(*this, "snt"),
m_samples(*this, "samples"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette")
m_palette(*this, "palette"),
m_backlight(*this, "backlight")
{ }
void mcr_control_port_w(uint8_t data);
@ -140,6 +141,7 @@ protected:
required_device<palette_device> m_palette;
private:
output_finder<> m_backlight;
uint32_t m_mcr_cpu_board = 0;
uint32_t m_mcr_sprite_board = 0;

View File

@ -79,6 +79,8 @@ const z80_daisy_config mcr_ipu_daisy_chain[] =
void mcr_state::machine_start()
{
m_backlight.resolve();
save_item(NAME(m_mcr_cocktail_flip));
}

View File

@ -57,6 +57,7 @@ void midvunit_state::machine_start()
save_item(NAME(m_comm_data));
m_optional_drivers.resolve();
m_wheel_motor.resolve();
}
@ -433,7 +434,7 @@ void midvunit_state::midvunit_wheel_board_w(uint32_t data)
logerror("Wheel board (ATODRDZ) = %02X\n", arg);
break;
case 4: // WHLCTLZ
output().set_value("wheel", arg);
m_wheel_motor = arg;
//logerror("Wheel board (U4 74HC574; Motor) = %02X\n", arg);
break;
case 5: // DRVCTLZ

View File

@ -75,6 +75,7 @@ public:
m_dcs(*this, "dcs"),
m_generic_paletteram_32(*this, "paletteram"),
m_optional_drivers(*this, "lamp%u", 0U),
m_wheel_motor(*this, "wheel"),
m_in1(*this, "IN1"),
m_dsw(*this, "DSW"),
m_motion(*this, "MOTION") { }
@ -191,6 +192,7 @@ private:
required_device<dcs_audio_device> m_dcs;
required_shared_ptr<uint32_t> m_generic_paletteram_32;
output_finder<8> m_optional_drivers;
output_finder<> m_wheel_motor;
optional_ioport m_in1;
optional_ioport m_dsw;
optional_ioport m_motion;

View File

@ -40,6 +40,14 @@ public:
, m_gfx_rom(*this, "gfx_rom", 0x800000, ENDIANNESS_BIG)
, m_mainram(*this, "mainram")
, m_ports(*this, { { "IN0", "IN1", "IN2", "DSW", "UNK0", "UNK1" } })
, m_left_flash(*this, "Left_Flash_%u", 1U)
, m_right_flash(*this, "Right_Flash_%u", 1U)
, m_left_gun_recoil(*this, "Left_Gun_Recoil")
, m_right_gun_recoil(*this, "Right_Gun_Recoil")
, m_left_gun_green_led(*this, "Left_Gun_Green_Led")
, m_left_gun_red_led(*this, "Left_Gun_Red_Led")
, m_right_gun_green_led(*this, "Right_Gun_Green_Led")
, m_right_gun_red_led(*this, "Right_Gun_Red_Led")
{
}
@ -74,6 +82,9 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(narc_talkback_data_r);
int adpcm_irq_state_r();
protected:
virtual void machine_start() override;
private:
/* protection data types */
struct protection_data
@ -109,6 +120,14 @@ private:
memory_share_creator<uint8_t> m_gfx_rom;
required_shared_ptr<uint16_t> m_mainram;
optional_ioport_array<6> m_ports;
output_finder<4> m_left_flash;
output_finder<4> m_right_flash;
output_finder<> m_left_gun_recoil;
output_finder<> m_right_gun_recoil;
output_finder<> m_left_gun_green_led;
output_finder<> m_left_gun_red_led;
output_finder<> m_right_gun_green_led;
output_finder<> m_right_gun_red_led;
std::unique_ptr<uint16_t[]> m_cmos_ram;
std::unique_ptr<uint8_t[]> m_hidden_ram;

View File

@ -21,6 +21,17 @@
#define SOUND_YAWDIM2 6
void midyunit_state::machine_start()
{
m_left_flash.resolve();
m_right_flash.resolve();
m_left_gun_recoil.resolve();
m_right_gun_recoil.resolve();
m_left_gun_green_led.resolve();
m_left_gun_red_led.resolve();
m_right_gun_green_led.resolve();
m_right_gun_red_led.resolve();
}
/*************************************
*
@ -139,25 +150,21 @@ void midyunit_state::term2_sound_w(offs_t offset, uint16_t data)
/* Flash Lamp Output Data */
if ( ((data & 0x800) != 0x800) && ((data & 0x400) == 0x400 ) )
{
output().set_value("Left_Flash_1", data & 0x1);
output().set_value("Left_Flash_2", (data & 0x2) >> 1);
output().set_value("Left_Flash_3", (data & 0x4) >> 2);
output().set_value("Left_Flash_4", (data & 0x8) >> 3);
output().set_value("Right_Flash_1", (data & 0x10) >> 4);
output().set_value("Right_Flash_2", (data & 0x20) >> 5);
output().set_value("Right_Flash_3", (data & 0x40) >> 6);
output().set_value("Right_Flash_4", (data & 0x80) >> 7);
for (int i = 0; i < 4; i++)
m_left_flash[i] = BIT(data, i);
for (int i = 0; i < 4; i++)
m_right_flash[i] = BIT(data, i + 4);
}
/* Gun Output Data */
if ( ((data & 0x800) == 0x800) && ((data & 0x400) != 0x400 ) )
{
output().set_value("Left_Gun_Recoil", data & 0x1);
output().set_value("Right_Gun_Recoil", (data & 0x2) >> 1);
output().set_value("Left_Gun_Green_Led", (~data & 0x20) >> 5);
output().set_value("Left_Gun_Red_Led", (~data & 0x10) >> 4);
output().set_value("Right_Gun_Green_Led", (~data & 0x80) >> 7);
output().set_value("Right_Gun_Red_Led", (~data & 0x40) >> 6);
m_left_gun_recoil = BIT(data, 0);
m_right_gun_recoil = BIT(data, 1);
m_left_gun_green_led = BIT(~data, 5);
m_left_gun_red_led = BIT(~data, 4);
m_right_gun_green_led = BIT(~data, 7);
m_right_gun_red_led = BIT(~data, 6);
}
if (offset == 0)

View File

@ -290,6 +290,7 @@ public:
m_io_system(*this, "SYSTEM"),
m_io_dips(*this, "DIPS"),
m_wheel_driver(*this, "wheel"),
m_wheel_motor(*this, "wheel_motor"),
m_lamps(*this, "lamp%u", 0U),
m_leds(*this, "led%u", 0U)
{
@ -357,7 +358,8 @@ private:
optional_ioport m_io_gearshift;
optional_ioport m_io_system;
optional_ioport m_io_dips;
output_finder<1> m_wheel_driver;
output_finder<> m_wheel_driver;
output_finder<> m_wheel_motor;
output_finder<16> m_lamps;
output_finder<24> m_leds;
@ -484,6 +486,7 @@ void seattle_state::machine_start()
save_item(NAME(m_wheel_calibrated));
m_wheel_driver.resolve();
m_wheel_motor.resolve();
m_lamps.resolve();
m_leds.resolve();
@ -752,7 +755,7 @@ void seattle_state::wheel_board_w(offs_t offset, uint32_t data)
}
else
{
m_wheel_driver[0] = arg; // target wheel angle. signed byte.
m_wheel_driver = arg; // target wheel angle. signed byte.
m_wheel_force = int8_t(arg);
}
}
@ -987,7 +990,7 @@ void seattle_state::output_w(uint32_t data)
break;
case 0x04:
output().set_value("wheel", arg); // wheel motor delta. signed byte.
m_wheel_motor = arg; // wheel motor delta. signed byte.
m_wheel_force = int8_t(~arg);
//logerror("wheel_board_w: data = %08x op: %02x arg: %02x\n", data, op, arg);
break;

View File

@ -1138,6 +1138,8 @@ public:
, m_mainbank(*this, "mainbank")
, m_lightgun_io(*this, {"LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y"})
, m_service_io(*this, "SERVICE")
, m_start_lamp(*this, "P%u_Start_lamp", 1U)
, m_gun_recoil(*this, "Player%u_Gun_Recoil", 1U)
{
}
@ -1151,6 +1153,7 @@ public:
void init_alt_bank1();
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
void jvsmap(address_map &map);
@ -1192,6 +1195,9 @@ private:
optional_ioport_array<4> m_lightgun_io;
optional_ioport m_service_io;
output_finder<2> m_start_lamp;
output_finder<2> m_gun_recoil;
uint16_t m_n_bankoffset;
uint32_t m_n_dmaoffset;
uint32_t m_n_tektagdmaoffset;
@ -1445,13 +1451,13 @@ void namcos12_state::system11gun_w(offs_t offset, uint16_t data, uint16_t mem_ma
/* blowback 1 */
/* blowback 2 */
/* Note: output label has been changed for the Engrish Impaired ;-) */
output().set_value("Player1_Gun_Recoil", (~data & 0x02)>>1);
output().set_value("Player2_Gun_Recoil", (~data & 0x01));
m_gun_recoil[0] = BIT(~data, 1);
m_gun_recoil[1] = BIT(~data, 0);
/* start 1 */
output().set_value("P2_Start_lamp", (~data & 0x08)>>3);
m_start_lamp[0] = BIT(~data, 3);
/* start 2 */
output().set_value("P2_Start_lamp", (~data & 0x04)>>2);
m_start_lamp[1] = BIT(~data, 2);
verboselog(1, "system11gun_w: outputs (%08x %08x)\n", data, mem_mask );
break;
@ -1585,6 +1591,12 @@ uint16_t namcos12_state::tektagt_protection_3_r()
return 0;
}
void namcos12_state::machine_start()
{
m_start_lamp.resolve();
m_gun_recoil.resolve();
}
void namcos12_state::machine_reset()
{
bankoffset_w(0,0,0xffff);

View File

@ -417,20 +417,20 @@ void segaorun_state::bankmotor_control_w(uint8_t data)
if (data < 8)
{
// left
output().set_value("Bank_Motor_Direction", 1);
output().set_value("Bank_Motor_Speed", 8 - data);
m_bank_motor_direction = 1;
m_bank_motor_speed = 8 - data;
}
else if (data == 8)
{
// no movement
output().set_value("Bank_Motor_Direction", 0);
output().set_value("Bank_Motor_Speed", 0);
m_bank_motor_direction = 0;
m_bank_motor_speed = 0;
}
else
{
// right
output().set_value("Bank_Motor_Direction", 2);
output().set_value("Bank_Motor_Speed", data - 8);
m_bank_motor_direction = 2;
m_bank_motor_speed = data - 8;
}
}
@ -530,6 +530,15 @@ void segaorun_state::nop_w(address_space &space, offs_t offset, uint16_t data, u
// DRIVER OVERRIDES
//**************************************************************************
void segaorun_state::machine_start()
{
m_bank_motor_direction.resolve();
m_bank_motor_speed.resolve();
m_vibration_motor.resolve();
m_start_lamp.resolve();
m_brake_lamp.resolve();
}
//-------------------------------------------------
// machine_reset - reset the state of the machine
//-------------------------------------------------
@ -686,9 +695,9 @@ void segaorun_state::outrun_custom_io_w(offs_t offset, uint16_t data, uint16_t m
// D1: Brake lamp
// other bits: ?
machine().sound().system_mute(!BIT(data, 7));
output().set_value("Vibration_motor", BIT(data, 5));
output().set_value("Start_lamp", BIT(data, 2));
output().set_value("Brake_lamp", BIT(data, 1));
m_vibration_motor = BIT(data, 5);
m_start_lamp = BIT(data, 2);
m_brake_lamp = BIT(data, 1);
}
return;
@ -761,10 +770,10 @@ void segaorun_state::shangon_custom_io_w(offs_t offset, uint16_t data, uint16_t
// D3: Vibration motor
// D2: Start lamp
// other bits: ?
m_adc_select = data >> 6 & 3;
m_segaic16vid->set_display_enable(data >> 5 & 1);
output().set_value("Vibration_motor", data >> 3 & 1);
output().set_value("Start_lamp", data >> 2 & 1);
m_adc_select = BIT(data, 7, 6);
m_segaic16vid->set_display_enable(BIT(data, 5));
m_vibration_motor = BIT(data, 3);
m_start_lamp = BIT(data, 2);
}
return;

View File

@ -43,6 +43,11 @@ public:
m_bankmotor_timer(*this, "bankmotor"),
m_digital_ports(*this, { { "SERVICE", "UNKNOWN", "COINAGE", "DSW" } }),
m_adc_ports(*this, "ADC.%u", 0),
m_bank_motor_direction(*this, "Bank_Motor_Direction"),
m_bank_motor_speed(*this, "Bank_Motor_Speed"),
m_vibration_motor(*this, "Vibration_motor"),
m_start_lamp(*this, "Start_lamp"),
m_brake_lamp(*this, "Brake_lamp"),
m_workram(*this, "workram"),
m_custom_io_r(*this),
m_custom_io_w(*this),
@ -110,6 +115,7 @@ protected:
void sub_map(address_map &map);
// device overrides
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
@ -146,6 +152,13 @@ protected:
required_ioport_array<4> m_digital_ports;
optional_ioport_array<8> m_adc_ports;
// outputs
output_finder<> m_bank_motor_direction;
output_finder<> m_bank_motor_speed;
output_finder<> m_vibration_motor;
output_finder<> m_start_lamp;
output_finder<> m_brake_lamp;
// memory
required_shared_ptr<uint16_t> m_workram;