Previous 199869 Revisions Next

r18696 Wednesday 24th October, 2012 at 23:28:23 UTC by hap
added service button
[src/mame/drivers]namcos23.c

trunk/src/mame/drivers/namcos23.c
r18695r18696
14521452   DECLARE_WRITE8_MEMBER(s23_iob_mcu_w);
14531453   DECLARE_READ8_MEMBER(s23_iob_p4_r);
14541454   DECLARE_WRITE8_MEMBER(s23_iob_p4_w);
1455   DECLARE_READ8_MEMBER(s23_iob_p6_r);
1456   DECLARE_WRITE8_MEMBER(s23_iob_p6_w);
14551457   DECLARE_READ8_MEMBER(s23_gun_r);
14561458   DECLARE_READ8_MEMBER(iob_r);
14571459   DECLARE_DRIVER_INIT(ss23);
r18695r18696
18321834   if (c361.scanline != 0x1ff)
18331835   {
18341836      // need to do a partial update here, but doesn't work properly yet
1837      //machine().primary_screen->update_partial(machine().primary_screen->vpos());
18351838      update_main_interrupts(m_main_irqcause | MAIN_C361_IRQ);
18361839
18371840      // TC2 indicates it's probably one-shot since it resets it each VBL...
r18695r18696
28012804}
28022805
28032806static INPUT_PORTS_START( gorgon )
2804   PORT_START("H8PORT")
2805
28062807   // No idea if start is actually there, but we need buttons to pass error screens
28072808   PORT_START("P1")
28082809   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_START1 )
r18695r18696
28122813   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_START2 )
28132814   PORT_BIT( 0xffe, IP_ACTIVE_LOW, IPT_UNKNOWN )
28142815
2815   PORT_START("RRP0")
2816   PORT_START("IN0")
28162817   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1 )
28172818   PORT_BIT(0xef, IP_ACTIVE_LOW, IPT_UNKNOWN )
28182819
2819   PORT_START("RRP1")
2820   PORT_START("IN1")
28202821   PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
28212822
2822   PORT_START("RRP2")
2823   PORT_START("IN2")
28232824   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN1 )
28242825   PORT_BIT(0xf7, IP_ACTIVE_LOW, IPT_UNKNOWN )
28252826
2826   PORT_START("RRP3")
2827   PORT_START("IN3")
28272828   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
28282829   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
28292830   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
28302831   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
28312832   PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
28322833
2834   PORT_START("SERVICE")
2835   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
2836
28332837   PORT_START("DSW")
28342838   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
28352839   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
r18695r18696
28582862INPUT_PORTS_END
28592863
28602864static INPUT_PORTS_START( rapidrvrp )
2861   PORT_START("H8PORT")
2862
2863   // To get into test mode, enable both Service Mode dipswitches, and then tap [Dev A] + [Dev B]
2864   // (or hold [Dev B] and then tap [Dev A]). Some of the developer menus require you to
2865   // navigate with the Dev keys, but usually the User keys work fine too.
2865   // To fully use test mode, both Service Mode dipswitches need to be enabled.
2866   // Some of the developer menus require you to navigate with the Dev keys,
2867   // but usually the User keys work fine too.
28662868   PORT_START("P1")
28672869   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_UNKNOWN )
28682870   PORT_BIT( 0x002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // I/O Unknown Status
r18695r18696
28802882   PORT_START("P2")
28812883   PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNKNOWN )
28822884
2883   PORT_START("RRP0")
2885   PORT_START("IN0")
28842886   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE )
28852887   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_NAME("User Up")
28862888   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("User Down")
r18695r18696
28902892   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
28912893   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
28922894
2893   PORT_START("RRP1")
2895   PORT_START("IN1")
28942896   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
28952897
2896   PORT_START("RRP2")
2898   PORT_START("IN2")
28972899   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
28982900   PORT_BIT( 0xf7, IP_ACTIVE_LOW, IPT_UNKNOWN )
28992901
2900   PORT_START("RRP3")
2902   PORT_START("IN3")
29012903   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
29022904
2905   PORT_START("SERVICE")
2906   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
2907
29032908   PORT_START("DSW")
29042909   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:8")
29052910   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
r18695r18696
29282933INPUT_PORTS_END
29292934
29302935static INPUT_PORTS_START( s23 )
2931   PORT_START("H8PORT")
2932
29332936   // No idea if start is actually there, but we need buttons to pass error screens
29342937   // You can go to the pcb test mode by pressing start, and it doesn't crash anymore somehow
29352938   // Use start1 to select, start1+start2 to exit, up/down to navigate
r18695r18696
29432946   PORT_START("P2")
29442947   PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNKNOWN )   // 0x100 = freeze?
29452948
2946   PORT_START("TC2P0")
2949   PORT_START("IN0")
29472950   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
29482951   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
29492952   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )   // this is the "coin acceptor connected" signal
r18695r18696
29532956   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
29542957   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON3 )
29552958
2956   PORT_START("TC2P1")
2959   PORT_START("IN1")
29572960   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )   // gun trigger
29582961   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )   // foot pedal
29592962   PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
29602963
2964   PORT_START("IN2")
2965   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
2966
2967   PORT_START("IN3")
2968   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
2969
2970   PORT_START("SERVICE")
2971   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
2972
29612973   PORT_START("DSW")
29622974   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
29632975   PORT_DIPNAME( 0x02, 0x02, "Skip POST" )
r18695r18696
29933005INPUT_PORTS_END
29943006
29953007static INPUT_PORTS_START( ss23 )
2996   PORT_START("H8PORT")
2997
29983008   // No idea if start is actually there, but we need buttons to pass error screens
29993009   // You can go to the pcb test mode by pressing start, and it doesn't crash anymore somehow
30003010   // Use start1 to select, start1+start2 to exit, up/down to navigate
r18695r18696
30083018   PORT_START("P2")
30093019   PORT_BIT( 0xfff, IP_ACTIVE_LOW, IPT_UNKNOWN )
30103020
3011   PORT_START("TC2P0")
3021   PORT_START("IN0")
30123022   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
30133023   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
30143024   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )   // this is the "coin acceptor connected" signal
r18695r18696
30183028   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
30193029   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON3 )
30203030
3021   PORT_START("TC2P1")
3031   PORT_START("IN1")
30223032   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )   // gun trigger
30233033   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )   // foot pedal
30243034   PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
30253035
3036   PORT_START("IN2")
3037   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
3038
3039   PORT_START("IN3")
3040   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
3041
3042   PORT_START("SERVICE")
3043   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
3044
30263045   PORT_START("DSW")
30273046   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
30283047   PORT_DIPNAME( 0x02, 0x02, "Skip POST" )
r18695r18696
30523071READ8_MEMBER(namcos23_state::s23_mcu_p6_r)
30533072{
30543073   // bit 1 = JVS cable present sense (1 = I/O board plugged in)
3055      return (m_jvssense << 1) | 0xfd;
3074   return (m_jvssense << 1) | 0xfd;
30563075}
30573076
30583077WRITE8_MEMBER(namcos23_state::s23_mcu_p6_w)
30593078{
3060//  printf("%02x to port 6\n", data);
3079   //printf("%02x to port 6\n", data);
30613080}
30623081
30633082static ADDRESS_MAP_START( s23h8iomap, AS_IO, 8, namcos23_state )
30643083   AM_RANGE(H8_PORT_6, H8_PORT_6) AM_READWRITE(s23_mcu_p6_r, s23_mcu_p6_w )
3065   AM_RANGE(H8_PORT_7, H8_PORT_7) AM_READ_PORT( "H8PORT" )
30663084   AM_RANGE(H8_PORT_8, H8_PORT_8) AM_READ(s23_mcu_p8_r ) AM_WRITENOP
30673085   AM_RANGE(H8_PORT_9, H8_PORT_9) AM_NOP   // read on Gorgon, purpose unknown
30683086   AM_RANGE(H8_PORT_A, H8_PORT_A) AM_READWRITE(s23_mcu_pa_r, s23_mcu_pa_w )
r18695r18696
30783096// version without serial hookup to I/O board for games where the PIC isn't dumped
30793097static ADDRESS_MAP_START( s23h8noiobmap, AS_IO, 8, namcos23_state )
30803098   AM_RANGE(H8_PORT_6, H8_PORT_6) AM_READWRITE(s23_mcu_p6_r, s23_mcu_p6_w )
3081   AM_RANGE(H8_PORT_7, H8_PORT_7) AM_READ_PORT( "H8PORT" )
30823099   AM_RANGE(H8_PORT_8, H8_PORT_8) AM_READ(s23_mcu_p8_r ) AM_WRITENOP
30833100   AM_RANGE(H8_PORT_A, H8_PORT_A) AM_READWRITE(s23_mcu_pa_r, s23_mcu_pa_w )
30843101   AM_RANGE(H8_PORT_B, H8_PORT_B) AM_READWRITE(s23_mcu_portB_r, s23_mcu_portB_w )
r18695r18696
31263143   m_jvssense = (data & 0x04) ? 0 : 1;
31273144}
31283145
3146READ8_MEMBER(namcos23_state::s23_iob_p6_r)
3147{
3148   // d4 is service button
3149   UINT8 sb = ioport("SERVICE")->read() & 1;
3150   // other bits: unknown
3151
3152   return sb<<4;
3153}
3154
3155WRITE8_MEMBER(namcos23_state::s23_iob_p6_w)
3156{
3157   //printf("iob %02x to port 6\n", data);
3158}
3159
31293160READ8_MEMBER(namcos23_state::s23_gun_r)
31303161{
31313162   UINT16 xpos = ioport("LIGHTX")->read_safe(0) * 640 / 0xff + 0x80;
r18695r18696
31543185/* H8/3334 (Namco C78) I/O board MCU */
31553186static ADDRESS_MAP_START( s23iobrdmap, AS_PROGRAM, 8, namcos23_state )
31563187   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("iocpu", 0)
3157   AM_RANGE(0x6000, 0x6000) AM_READ_PORT("TC2P0")     // 0-1 = coin 0-3 = coin connect, 0-5 = test 0-6 = down select, 0-7 = up select, 0-8 = enter
3158   AM_RANGE(0x6001, 0x6001) AM_READ_PORT("TC2P1")     // 1-1 = gun trigger 1-2 = foot pedal
3159   AM_RANGE(0x6002, 0x6003) AM_READ(iob_r )
3188   AM_RANGE(0x6000, 0x6000) AM_READ_PORT("IN0")
3189   AM_RANGE(0x6001, 0x6001) AM_READ_PORT("IN1")
3190   AM_RANGE(0x6002, 0x6002) AM_READ_PORT("IN2")
3191   AM_RANGE(0x6003, 0x6003) AM_READ_PORT("IN3")
31603192   AM_RANGE(0x6004, 0x6005) AM_WRITENOP
31613193   AM_RANGE(0x6006, 0x6007) AM_NOP
31623194   AM_RANGE(0x7000, 0x700f) AM_READ(iob_r )
r18695r18696
31653197ADDRESS_MAP_END
31663198
31673199static ADDRESS_MAP_START( timecrs2iobrdmap, AS_PROGRAM, 8, namcos23_state )
3168   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("iocpu", 0)
3169   AM_RANGE(0x6000, 0x6000) AM_READ_PORT("TC2P0")
3170   AM_RANGE(0x6001, 0x6001) AM_READ_PORT("TC2P1")
3171   AM_RANGE(0x6002, 0x6005) AM_WRITENOP
3172   AM_RANGE(0x6006, 0x6007) AM_NOP
31733200   AM_RANGE(0x7000, 0x700f) AM_READ(s23_gun_r )
3174
3175   AM_RANGE(0xc000, 0xf7ff) AM_RAM
3201   AM_IMPORT_FROM( s23iobrdmap )
31763202ADDRESS_MAP_END
31773203
3178static ADDRESS_MAP_START( gorgoniobrdmap, AS_PROGRAM, 8, namcos23_state )
3179   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("iocpu", 0)
3180   AM_RANGE(0x6000, 0x6000) AM_READ_PORT("RRP0")     // 0-5 = start
3181   AM_RANGE(0x6001, 0x6001) AM_READ_PORT("RRP1")     //
3182   AM_RANGE(0x6002, 0x6002) AM_READ_PORT("RRP2")     // 0-4 = coin
3183   AM_RANGE(0x6003, 0x6003) AM_READ_PORT("RRP3")     // 1-1 = button?  1-4 = start?
3184   AM_RANGE(0x6004, 0x6005) AM_WRITENOP
3185   AM_RANGE(0x6006, 0x6007) AM_NOP
3186   AM_RANGE(0x7000, 0x700f) AM_READ(iob_r )
3187
3188   AM_RANGE(0xc000, 0xf7ff) AM_RAM
3189ADDRESS_MAP_END
3190
31913204/*
31923205    port 5 bit 2 = LED to indicate transmitting packet to main
31933206    port 4 bit 2 = SENSE line back to main (0 = asserted, 1 = dropped)
31943207*/
31953208static ADDRESS_MAP_START( s23iobrdiomap, AS_IO, 8, namcos23_state )
3196   AM_RANGE(H8_PORT_4, H8_PORT_4) AM_READWRITE(s23_iob_p4_r, s23_iob_p4_w )
3209   AM_RANGE(H8_PORT_4, H8_PORT_4) AM_READWRITE(s23_iob_p4_r, s23_iob_p4_w)
31973210   AM_RANGE(H8_PORT_5, H8_PORT_5) AM_NOP   // status LED in bit 2
3198   AM_RANGE(H8_PORT_6, H8_PORT_6) AM_NOP   // unknown
3211   AM_RANGE(H8_PORT_6, H8_PORT_6) AM_READWRITE(s23_iob_p6_r, s23_iob_p6_w)
31993212   AM_RANGE(H8_PORT_8, H8_PORT_8) AM_NOP   // unknown - used on ASCA-5 only
32003213   AM_RANGE(H8_PORT_9, H8_PORT_9) AM_NOP   // unknown - used on ASCA-5 only
3201   AM_RANGE(H8_SERIAL_0, H8_SERIAL_0) AM_READWRITE(s23_iob_mcu_r, s23_iob_mcu_w )
3202   AM_RANGE(H8_ADC_0_H, H8_ADC_3_L) AM_NOP
3214   AM_RANGE(H8_SERIAL_0, H8_SERIAL_0) AM_READWRITE(s23_iob_mcu_r, s23_iob_mcu_w)
3215   AM_RANGE(H8_ADC_0_H, H8_ADC_3_L) AM_NOP   // analog input
32033216ADDRESS_MAP_END
32043217
32053218DRIVER_INIT_MEMBER(namcos23_state,ss23)
r18695r18696
32163229
32173230   m_mi_rd = m_mi_wr = m_im_rd = m_im_wr = 0;
32183231   m_jvssense = 1;
3219   m_main_irqcause = ~0;
3232   m_main_irqcause = 0;
32203233   m_ctl_vbl_active = false;
32213234   m_s23_lastpB = 0x50;
32223235   m_s23_setstate = 0;
r18695r18696
32973310   MCFG_CPU_VBLANK_INT_DRIVER("screen", namcos23_state,  irq1_line_pulse)
32983311
32993312   MCFG_CPU_ADD("iocpu", H83334, S23_H8CLOCK )
3300   MCFG_CPU_PROGRAM_MAP( gorgoniobrdmap )
3313   MCFG_CPU_PROGRAM_MAP( s23iobrdmap )
33013314   MCFG_CPU_IO_MAP( s23iobrdiomap )
33023315
33033316   MCFG_QUANTUM_TIME(attotime::from_hz(60000))

Previous 199869 Revisions Next


© 1997-2024 The MAME Team