Skip to content

Commit

Permalink
undrfire: remove fake dipswitch
Browse files Browse the repository at this point in the history
  • Loading branch information
happppp committed Jan 8, 2025
1 parent 77bee91 commit 50046f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 30 deletions.
16 changes: 6 additions & 10 deletions src/mame/konami/xexex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ class xexex_state : public driver_device

void xexex(machine_config &config);

protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
virtual void device_post_load() override { parse_control2(); }

private:
/* memory pointers */
required_shared_ptr<uint16_t> m_workram;
Expand Down Expand Up @@ -242,13 +248,9 @@ class xexex_state : public driver_device
void sound_irq_w(uint16_t data);
void sound_bankswitch_w(uint8_t data);

virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
uint32_t screen_update_xexex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(dmaend_callback);
TIMER_DEVICE_CALLBACK_MEMBER(xexex_interrupt);
void xexex_postload();
void xexex_objdma(int limiter);
void parse_control2();
K056832_CB_MEMBER(tile_callback);
Expand Down Expand Up @@ -650,11 +652,6 @@ INPUT_PORTS_END



void xexex_state::xexex_postload()
{
parse_control2();
}

void xexex_state::machine_start()
{
m_z80bank->configure_entries(0, 8, memregion("audiocpu")->base(), 0x4000);
Expand All @@ -669,7 +666,6 @@ void xexex_state::machine_start()
save_item(NAME(m_frame));

save_item(NAME(m_cur_control2));
machine().save().register_postload(save_prepost_delegate(FUNC(xexex_state::xexex_postload), this));

m_dmadelay_timer = timer_alloc(FUNC(xexex_state::dmaend_callback), this);
}
Expand Down
13 changes: 3 additions & 10 deletions src/mame/taito/undrfire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ void undrfire_state::shared_ram_w(offs_t offset, u16 data, u16 mem_mask)

u32 undrfire_state::undrfire_lightgun_r(offs_t offset)
{
int x,y;

switch (offset)
{
/* NB we are raising the raw inputs by an arbitrary amount,
Expand All @@ -256,8 +254,8 @@ u32 undrfire_state::undrfire_lightgun_r(offs_t offset)
case 0x00: /* P1 */
case 0x01: /* P2 */
{
x = m_in_gunx[offset & 1]->read() << 6;
y = m_in_guny[offset & 1]->read() << 6;
int x = m_in_gunx[offset & 1]->read() << 6;
int y = m_in_guny[offset & 1]->read() << 6;

return ((x << 24) &0xff000000) | ((x << 8) &0xff0000)
| ((y << 8) &0xff00) | ((y >> 8) &0xff) ;
Expand Down Expand Up @@ -421,7 +419,6 @@ static INPUT_PORTS_START( undrfire )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )

/* Gun inputs (real range is 0-0xffff: we use standard 0-255 and shift later) */

PORT_START("GUNX1")
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, -1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_REVERSE PORT_PLAYER(1)

Expand All @@ -433,11 +430,6 @@ static INPUT_PORTS_START( undrfire )

PORT_START("GUNY2")
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(25) PORT_PLAYER(2)

PORT_START("FAKE")
PORT_DIPNAME( 0x01, 0x00, "Show gun target" ) PORT_CODE(KEYCODE_F1) PORT_TOGGLE
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x01, DEF_STR( Yes ) )
INPUT_PORTS_END


Expand Down Expand Up @@ -507,6 +499,7 @@ static GFXDECODE_START( gfx_undrfire )
GFXDECODE_ENTRY( "sprites", 0x0, tile16x16_layout, 0, 512 )
GFXDECODE_END


/***********************************************************
MACHINE DRIVERS
***********************************************************/
Expand Down
2 changes: 0 additions & 2 deletions src/mame/taito/undrfire.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class undrfire_state : public driver_device
m_spritemaphi(*this, "spritemaphi"),
m_in_gunx(*this, "GUNX%u", 1U),
m_in_guny(*this, "GUNY%u", 1U),
m_io_fake(*this, "FAKE"),
m_lamp_start(*this, "P%u_lamp_start", 1U),
m_gun_recoil(*this, "P%u_gun_recoil", 1U),
m_lamp(*this, "Lamp_%u", 1U),
Expand Down Expand Up @@ -80,7 +79,6 @@ class undrfire_state : public driver_device

optional_ioport_array<2> m_in_gunx;
optional_ioport_array<2> m_in_guny;
optional_ioport m_io_fake;
output_finder<2> m_lamp_start;
output_finder<2> m_gun_recoil;
output_finder<6> m_lamp;
Expand Down
8 changes: 0 additions & 8 deletions src/mame/taito/undrfire_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,6 @@ u32 undrfire_state::screen_update_undrfire(screen_device &screen, bitmap_ind16 &

m_tc0480scp->tilemap_draw(screen, bitmap, cliprect, layer[4], 0, 0); /* TC0480SCP text layer */

/* See if we should draw artificial gun targets */
/* (not yet implemented...) */

if (m_io_fake->read() & 0x1) /* Fake DSW */
{
popmessage("Gunsights on");
}

/* Enable this to see rotation (?) control words */
#if 0
{
Expand Down

0 comments on commit 50046f5

Please sign in to comment.