Previous 199869 Revisions Next

r36415 Saturday 14th March, 2015 at 06:57:07 UTC by Osso
jankenmn: enabled save state support (nw)
[src/mame/drivers]jankenmn.c

trunk/src/mame/drivers/jankenmn.c
r244926r244927
152152      : driver_device(mconfig, type, tag),
153153      m_maincpu(*this, "maincpu") { }
154154
155   DECLARE_CUSTOM_INPUT_MEMBER(jankenmn_hopper_status_r);
156   DECLARE_WRITE8_MEMBER(jankenmn_lamps1_w);
157   DECLARE_WRITE8_MEMBER(jankenmn_lamps2_w);
158   DECLARE_WRITE8_MEMBER(jankenmn_lamps3_w);
159155   required_device<cpu_device> m_maincpu;
156   
157   DECLARE_WRITE8_MEMBER(lamps1_w);
158   DECLARE_WRITE8_MEMBER(lamps2_w);
159   DECLARE_WRITE8_MEMBER(lamps3_w);
160   
161   DECLARE_CUSTOM_INPUT_MEMBER(hopper_status_r);
160162};
161163
162164
r244926r244927
167169static const UINT8 led_map[16] = // 7748 IC?
168170   { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 };
169171
170WRITE8_MEMBER(jankenmn_state::jankenmn_lamps1_w)
172WRITE8_MEMBER(jankenmn_state::lamps1_w)
171173{
172174   // hand state: d0: rock, d1: scissors, d2: paper
173175   output_set_lamp_value(8, (data & 7) != 0);
r244926r244927
183185   // d3: ? (only set if game is over)
184186}
185187
186WRITE8_MEMBER(jankenmn_state::jankenmn_lamps2_w)
188WRITE8_MEMBER(jankenmn_state::lamps2_w)
187189{
188190   // button LEDs: d1: paper, d2: scissors, d3: rock
189191   output_set_lamp_value(2, data >> 3 & 1);
r244926r244927
202204   output_set_digit_value(0, led_map[data & 1]);
203205}
204206
205WRITE8_MEMBER(jankenmn_state::jankenmn_lamps3_w)
207WRITE8_MEMBER(jankenmn_state::lamps3_w)
206208{
207209   // d1: blue rotating lamp on top of cab
208210   output_set_lamp_value(15, data >> 1 & 1);
r244926r244927
220222   // d0, d6, d7: N/C?
221223}
222224
223CUSTOM_INPUT_MEMBER(jankenmn_state::jankenmn_hopper_status_r)
225CUSTOM_INPUT_MEMBER(jankenmn_state::hopper_status_r)
224226{
225227   // temp workaround, needs hopper
226228   return machine().rand();
r244926r244927
257259   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Paa (Paper)")
258260   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
259261   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) // 100 yen coin
260   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jankenmn_state,jankenmn_hopper_status_r, NULL)
262   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jankenmn_state, hopper_status_r, NULL)
261263   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) // 10 yen coin
262264   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) // 10 yen coin
263265
r244926r244927
315317   /* (10-13) Mode 0 - Ports A & B set as input, high C & low C as output. */
316318   MCFG_I8255_IN_PORTA_CB(IOPORT("DSW"))
317319   MCFG_I8255_IN_PORTB_CB(IOPORT("IN0"))
318   MCFG_I8255_OUT_PORTC_CB(WRITE8(jankenmn_state, jankenmn_lamps3_w))
320   MCFG_I8255_OUT_PORTC_CB(WRITE8(jankenmn_state, lamps3_w))
319321
320322   MCFG_DEVICE_ADD("ppi8255_1", I8255, 0)
321323   /* (20-23) Mode 0 - Ports A, B, high C & low C set as output. */
322324   MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("dac", dac_device, write_unsigned8))
323   MCFG_I8255_OUT_PORTB_CB(WRITE8(jankenmn_state, jankenmn_lamps1_w))
324   MCFG_I8255_OUT_PORTC_CB(WRITE8(jankenmn_state, jankenmn_lamps2_w))
325   MCFG_I8255_OUT_PORTB_CB(WRITE8(jankenmn_state, lamps1_w))
326   MCFG_I8255_OUT_PORTC_CB(WRITE8(jankenmn_state, lamps2_w))
325327
326328   MCFG_DEVICE_ADD("ctc", Z80CTC, MASTER_CLOCK)
327329   MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
r244926r244927
359361*********************************************/
360362
361363/*     YEAR  NAME      PARENT  MACHINE   INPUT     INIT                 ROT    COMPANY    FULLNAME                   FLAGS...  LAYOUT */
362GAMEL( 1991, jankenmn, 0,      jankenmn, jankenmn, driver_device, 0,    ROT0, "Sunwise", "Janken Man Kattara Ageru", 0,        layout_jankenmn )
364GAMEL( 1991, jankenmn, 0,      jankenmn, jankenmn, driver_device, 0,    ROT0, "Sunwise", "Janken Man Kattara Ageru", GAME_SUPPORTS_SAVE,        layout_jankenmn )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team