mirror of
https://github.com/holub/mame
synced 2025-06-22 20:38:50 +03:00
m14.cpp: cleanups (nw)
This commit is contained in:
parent
589198d87e
commit
7cd2929525
@ -7,19 +7,18 @@ M14 Hardware (c) 1979 Irem
|
|||||||
driver by Angelo Salese
|
driver by Angelo Salese
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
- Sound (very likely to be discrete);
|
- Actual discrete sound emulation;
|
||||||
- Colors might be not 100% accurate (needs screenshots from the real thing);
|
- Colors might be not 100% accurate (needs screenshots from the real thing);
|
||||||
- What are the high 4 bits in the colorram for? They are used on the mahjong tiles only,
|
- What are the high 4 bits in the colorram for? They are used on the mahjong tiles only,
|
||||||
left-over or something more important?
|
left-over or something more important?
|
||||||
- I'm not sure about the hopper hook-up, it could also be that the player should press
|
- I/Os are grossly mapped;
|
||||||
start + button 1 + ron buttons (= 0x43) instead of being "automatic";
|
|
||||||
- Inputs are grossly mapped;
|
|
||||||
- ball and paddle drawing are a guesswork;
|
- ball and paddle drawing are a guesswork;
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- Unlike most Arcade games, if you call a ron but you don't have a legit hand you'll automatically
|
- Unlike most Arcade games, if you call a ron but you don't have a legit hand you'll automatically
|
||||||
lose the match. This is commonly named chombo in rii'chi mahjong rules;
|
lose the match. This is commonly named chombo in rii'chi mahjong rules;
|
||||||
|
- After getting a completed hand, press start 1 + ron + discard at the same time to go back
|
||||||
|
into attract mode (!);
|
||||||
|
|
||||||
==============================================================================================
|
==============================================================================================
|
||||||
x (Mystery Rom)
|
x (Mystery Rom)
|
||||||
@ -82,8 +81,7 @@ public:
|
|||||||
DECLARE_WRITE8_MEMBER(m14_vram_w);
|
DECLARE_WRITE8_MEMBER(m14_vram_w);
|
||||||
DECLARE_WRITE8_MEMBER(m14_cram_w);
|
DECLARE_WRITE8_MEMBER(m14_cram_w);
|
||||||
DECLARE_READ8_MEMBER(m14_rng_r);
|
DECLARE_READ8_MEMBER(m14_rng_r);
|
||||||
DECLARE_READ8_MEMBER(input_buttons_r);
|
DECLARE_WRITE8_MEMBER(output_w);
|
||||||
DECLARE_WRITE8_MEMBER(hopper_w);
|
|
||||||
DECLARE_WRITE8_MEMBER(ball_x_w);
|
DECLARE_WRITE8_MEMBER(ball_x_w);
|
||||||
DECLARE_WRITE8_MEMBER(ball_y_w);
|
DECLARE_WRITE8_MEMBER(ball_y_w);
|
||||||
DECLARE_WRITE8_MEMBER(paddle_x_w);
|
DECLARE_WRITE8_MEMBER(paddle_x_w);
|
||||||
@ -106,7 +104,7 @@ private:
|
|||||||
tilemap_t *m_m14_tilemap;
|
tilemap_t *m_m14_tilemap;
|
||||||
|
|
||||||
/* input-related */
|
/* input-related */
|
||||||
uint8_t m_hop_mux;
|
//uint8_t m_hop_mux;
|
||||||
uint8_t m_ballx,m_bally;
|
uint8_t m_ballx,m_bally;
|
||||||
uint8_t m_paddlex;
|
uint8_t m_paddlex;
|
||||||
};
|
};
|
||||||
@ -225,24 +223,12 @@ READ8_MEMBER(m14_state::m14_rng_r)
|
|||||||
return (m_screen->frame_number() & 0x7f) | (ioport("IN1")->read() & 0x80);
|
return (m_screen->frame_number() & 0x7f) | (ioport("IN1")->read() & 0x80);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Here routes the hopper & the inputs */
|
WRITE8_MEMBER(m14_state::output_w)
|
||||||
READ8_MEMBER(m14_state::input_buttons_r)
|
|
||||||
{
|
{
|
||||||
if (m_hop_mux)
|
/* ---- x--- active after calling a winning hand */
|
||||||
{
|
/* ---- --x- lamp? */
|
||||||
m_hop_mux = 0;
|
|
||||||
return 0; //0x43 status bits
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return ioport("IN0")->read();
|
|
||||||
}
|
|
||||||
|
|
||||||
WRITE8_MEMBER(m14_state::hopper_w)
|
|
||||||
{
|
|
||||||
/* ---- x--- coin out */
|
|
||||||
/* ---- --x- hopper/input mux? */
|
|
||||||
/* ---- ---x flip screen */
|
/* ---- ---x flip screen */
|
||||||
m_hop_mux = data & 2;
|
//m_hop_mux = data & 2;
|
||||||
flip_screen_set(data & 1);
|
flip_screen_set(data & 1);
|
||||||
//popmessage("%02x",data);
|
//popmessage("%02x",data);
|
||||||
}
|
}
|
||||||
@ -321,9 +307,9 @@ ADDRESS_MAP_END
|
|||||||
static ADDRESS_MAP_START( m14_io_map, AS_IO, 8, m14_state )
|
static ADDRESS_MAP_START( m14_io_map, AS_IO, 8, m14_state )
|
||||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||||
AM_RANGE(0xf8, 0xf8) AM_READ_PORT("AN_PADDLE") AM_WRITE(ball_x_w)
|
AM_RANGE(0xf8, 0xf8) AM_READ_PORT("AN_PADDLE") AM_WRITE(ball_x_w)
|
||||||
AM_RANGE(0xf9, 0xf9) AM_READ(input_buttons_r) AM_WRITE(ball_y_w)
|
AM_RANGE(0xf9, 0xf9) AM_READ_PORT("IN0") AM_WRITE(ball_y_w)
|
||||||
AM_RANGE(0xfa, 0xfa) AM_READ(m14_rng_r) AM_WRITE(paddle_x_w)
|
AM_RANGE(0xfa, 0xfa) AM_READ(m14_rng_r) AM_WRITE(paddle_x_w)
|
||||||
AM_RANGE(0xfb, 0xfb) AM_READ_PORT("DSW") AM_WRITE(hopper_w)
|
AM_RANGE(0xfb, 0xfb) AM_READ_PORT("DSW") AM_WRITE(output_w)
|
||||||
AM_RANGE(0xfc, 0xfc) AM_WRITE(sound_w)
|
AM_RANGE(0xfc, 0xfc) AM_WRITE(sound_w)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
@ -349,7 +335,7 @@ INPUT_CHANGED_MEMBER(m14_state::right_coin_inserted)
|
|||||||
|
|
||||||
static INPUT_PORTS_START( m14 )
|
static INPUT_PORTS_START( m14 )
|
||||||
PORT_START("AN_PADDLE")
|
PORT_START("AN_PADDLE")
|
||||||
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_MINMAX(0,0xff) PORT_SENSITIVITY(5) PORT_KEYDELTA(1) PORT_CENTERDELTA(0) PORT_REVERSE
|
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_MINMAX(0,0xff) PORT_SENSITIVITY(10) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE
|
||||||
|
|
||||||
PORT_START("IN0")
|
PORT_START("IN0")
|
||||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Fire / Discard")
|
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Fire / Discard")
|
||||||
@ -363,9 +349,7 @@ static INPUT_PORTS_START( m14 )
|
|||||||
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
|
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
|
||||||
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x20, 0x20, "Freeze" )
|
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||||
PORT_DIPSETTING( 0x20, DEF_STR( No ) )
|
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
|
|
||||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
|
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
|
||||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
|
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
|
||||||
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
|
||||||
@ -428,7 +412,7 @@ INTERRUPT_GEN_MEMBER(m14_state::m14_irq)
|
|||||||
|
|
||||||
void m14_state::machine_start()
|
void m14_state::machine_start()
|
||||||
{
|
{
|
||||||
save_item(NAME(m_hop_mux));
|
//save_item(NAME(m_hop_mux));
|
||||||
save_item(NAME(m_ballx));
|
save_item(NAME(m_ballx));
|
||||||
save_item(NAME(m_bally));
|
save_item(NAME(m_bally));
|
||||||
save_item(NAME(m_paddlex));
|
save_item(NAME(m_paddlex));
|
||||||
@ -436,7 +420,7 @@ void m14_state::machine_start()
|
|||||||
|
|
||||||
void m14_state::machine_reset()
|
void m14_state::machine_reset()
|
||||||
{
|
{
|
||||||
m_hop_mux = 0;
|
//m_hop_mux = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user