trunk/src/mame/drivers/namcos22.c
| r18700 | r18701 | |
| 2434 | 2434 | |
| 2435 | 2435 | READ32_MEMBER(namcos22_state::namcos22_gun_r) |
| 2436 | 2436 | { |
| 2437 | | int xpos = ioport("LIGHTX")->read_safe(0) * 640 / 0xff; |
| 2438 | | int ypos = ioport("LIGHTY")->read_safe(0) * 240 / 0xff + 0x10; |
| 2437 | UINT16 xpos = ioport("LIGHTX")->read(); |
| 2438 | UINT16 ypos = ioport("LIGHTY")->read(); |
| 2439 | |
| 2439 | 2440 | switch( offset ) |
| 2440 | 2441 | { |
| 2441 | | case 0: /* 430000 */ |
| 2442 | | return xpos<<16; |
| 2442 | case 0: /* 430000 */ |
| 2443 | return xpos<<16; |
| 2443 | 2444 | |
| 2444 | | case 1: /* 430004 */ |
| 2445 | | case 2: /* 430008 */ |
| 2446 | | return ypos<<16; |
| 2445 | case 1: /* 430004 */ |
| 2446 | case 2: /* 430008 */ |
| 2447 | return ypos<<16; |
| 2447 | 2448 | |
| 2448 | | case 3: |
| 2449 | | default: |
| 2450 | | return 0; |
| 2449 | default: |
| 2450 | return 0; |
| 2451 | 2451 | } |
| 2452 | | } /* namcos22_gun_r */ |
| 2452 | } |
| 2453 | 2453 | |
| 2454 | 2454 | WRITE32_MEMBER(namcos22_state::namcos22_cpuleds_w) |
| 2455 | 2455 | { |
| r18700 | r18701 | |
| 2458 | 2458 | if (ACCESSING_BITS_0_15) data &= 0xff; |
| 2459 | 2459 | else data = (data>>16) & 0xff; |
| 2460 | 2460 | |
| 2461 | | output_set_lamp_value(0, data>>7 & 1); |
| 2462 | | output_set_lamp_value(1, data>>6 & 1); |
| 2463 | | output_set_lamp_value(2, data>>5 & 1); |
| 2464 | | output_set_lamp_value(3, data>>4 & 1); |
| 2465 | | output_set_lamp_value(4, data>>3 & 1); |
| 2466 | | output_set_lamp_value(5, data>>2 & 1); |
| 2467 | | output_set_lamp_value(6, data>>1 & 1); |
| 2468 | | output_set_lamp_value(7, data>>0 & 1); |
| 2461 | for (int i = 0; i < 8; i++) |
| 2462 | output_set_lamp_value(i, (~data<<i & 0x80) ? 0 : 1); |
| 2469 | 2463 | } |
| 2470 | 2464 | |
| 2471 | 2465 | READ32_MEMBER(namcos22_state::alpinesa_prot_r) |
| r18700 | r18701 | |
| 2477 | 2471 | { |
| 2478 | 2472 | switch( data ) |
| 2479 | 2473 | { |
| 2480 | | case 0: |
| 2481 | | m_mAlpineSurferProtData = 0; |
| 2482 | | break; |
| 2483 | | case 1: |
| 2484 | | m_mAlpineSurferProtData = 1; |
| 2485 | | break; |
| 2486 | | case 3: |
| 2487 | | m_mAlpineSurferProtData = 2; |
| 2488 | | break; |
| 2489 | | default: |
| 2490 | | break; |
| 2474 | case 0: |
| 2475 | m_mAlpineSurferProtData = 0; |
| 2476 | break; |
| 2477 | case 1: |
| 2478 | m_mAlpineSurferProtData = 1; |
| 2479 | break; |
| 2480 | case 3: |
| 2481 | m_mAlpineSurferProtData = 2; |
| 2482 | break; |
| 2483 | default: |
| 2484 | break; |
| 2491 | 2485 | } |
| 2492 | 2486 | } /* alpinesa_prot_w */ |
| 2493 | 2487 | |
| r18700 | r18701 | |
| 2517 | 2511 | AM_RANGE(0x400000, 0x40001f) AM_READWRITE(namcos22_keycus_r, namcos22_keycus_w) |
| 2518 | 2512 | AM_RANGE(0x410000, 0x413fff) AM_RAM /* C139 SCI buffer */ |
| 2519 | 2513 | AM_RANGE(0x420000, 0x42000f) AM_READ(namcos22_C139_SCI_r) AM_WRITEONLY /* C139 SCI registers */ |
| 2520 | | AM_RANGE(0x430000, 0x43000f) AM_READ(namcos22_gun_r) |
| 2521 | 2514 | AM_RANGE(0x430000, 0x430003) AM_WRITE(namcos22_cpuleds_w) |
| 2522 | 2515 | AM_RANGE(0x440000, 0x440003) AM_READ(namcos22_dipswitch_r) |
| 2523 | 2516 | AM_RANGE(0x450008, 0x45000b) AM_READWRITE(namcos22_portbit_r, namcos22_portbit_w) |
| r18700 | r18701 | |
| 2541 | 2534 | AM_RANGE(0xe00000, 0xe3ffff) AM_RAM /* workram */ |
| 2542 | 2535 | ADDRESS_MAP_END |
| 2543 | 2536 | |
| 2537 | static ADDRESS_MAP_START( timecris_am, AS_PROGRAM, 32, namcos22_state ) |
| 2538 | AM_RANGE(0x430000, 0x43000f) AM_READ(namcos22_gun_r) |
| 2539 | AM_IMPORT_FROM( namcos22s_am ) |
| 2540 | ADDRESS_MAP_END |
| 2541 | |
| 2544 | 2542 | READ16_MEMBER(namcos22_state::s22mcu_shared_r) |
| 2545 | 2543 | { |
| 2546 | 2544 | UINT16 *share16 = (UINT16 *)m_shareram.target(); |
| r18700 | r18701 | |
| 2981 | 2979 | MCFG_SOUND_ROUTE(3, "lspeaker", 1.00) |
| 2982 | 2980 | MACHINE_CONFIG_END |
| 2983 | 2981 | |
| 2982 | |
| 2983 | static MACHINE_CONFIG_DERIVED( timecris, namcos22s ) |
| 2984 | |
| 2985 | MCFG_CPU_MODIFY("maincpu") |
| 2986 | MCFG_CPU_PROGRAM_MAP(timecris_am) |
| 2987 | MACHINE_CONFIG_END |
| 2988 | |
| 2984 | 2989 | /*********************************************************************************/ |
| 2985 | 2990 | |
| 2986 | 2991 | /* Namco System 22 */ |
| r18700 | r18701 | |
| 4484 | 4489 | ROM_REGION( 0x1000000, "c352", 0 ) // Samples |
| 4485 | 4490 | ROM_LOAD( "ts1wavea.2l", 0x000000, 0x400000, CRC(d1123301) SHA1(4bf1fd746fef4e6befa63c61a761971d729e1573) ) |
| 4486 | 4491 | ROM_LOAD( "ts1waveb.1l", 0x800000, 0x200000, CRC(bf4d7272) SHA1(c7c7b3620e7b3176644b6784ee36e679c9e31cc1) ) |
| 4487 | | |
| 4488 | | ROM_REGION( 0x4000, "nvram", 0 ) // default eeprom |
| 4489 | | ROM_LOAD( "timecris_defaults.nv", 0x0000, 0x4000, CRC(02eeea95) SHA1(0c3c20c9dc7c1e1d5affb99e305e671b32f8e29b) ) |
| 4490 | 4492 | ROM_END |
| 4491 | 4493 | |
| 4492 | 4494 | ROM_START( timecrisa ) |
| r18700 | r18701 | |
| 4540 | 4542 | ROM_REGION( 0x1000000, "c352", 0 ) // Samples |
| 4541 | 4543 | ROM_LOAD( "ts1wavea.2l", 0x000000, 0x400000, CRC(d1123301) SHA1(4bf1fd746fef4e6befa63c61a761971d729e1573) ) |
| 4542 | 4544 | ROM_LOAD( "ts1waveb.1l", 0x800000, 0x200000, CRC(bf4d7272) SHA1(c7c7b3620e7b3176644b6784ee36e679c9e31cc1) ) |
| 4543 | | |
| 4544 | | ROM_REGION( 0x4000, "nvram", 0 ) // default eeprom |
| 4545 | | ROM_LOAD( "timecris_defaults.nv", 0x0000, 0x4000, CRC(02eeea95) SHA1(0c3c20c9dc7c1e1d5affb99e305e671b32f8e29b) ) |
| 4546 | 4545 | ROM_END |
| 4547 | 4546 | |
| 4548 | 4547 | ROM_START( tokyowar ) |
| r18700 | r18701 | |
| 5080 | 5079 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 5081 | 5080 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 5082 | 5081 | |
| 5083 | | PORT_START( "LIGHTX" ) |
| 5084 | | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(48) PORT_KEYDELTA(4) |
| 5085 | | PORT_START( "LIGHTY" ) |
| 5086 | | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(64) PORT_KEYDELTA(4) |
| 5082 | PORT_START( "LIGHTX" ) // tuned for CRT |
| 5083 | PORT_BIT( 0xfff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(68, 68+626) PORT_SENSITIVITY(48) PORT_KEYDELTA(10) |
| 5084 | PORT_START( "LIGHTY" ) // tuned for CRT - can't shoot below the statusbar? |
| 5085 | PORT_BIT( 0xfff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(43, 43+241) PORT_SENSITIVITY(64) PORT_KEYDELTA(4) |
| 5087 | 5086 | |
| 5088 | 5087 | PORT_START("MCUP5A") |
| 5089 | 5088 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r18700 | r18701 | |
| 5670 | 5669 | GAME( 1995, airco22b, 0, namcos22s, airco22, namcos22_state, airco22, ROT0, "Namco", "Air Combat 22 (Rev. ACS1 Ver.B, Japan)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) // boots but missing sprite clear DMA? |
| 5671 | 5670 | GAME( 1995, cybrcycc, 0, namcos22s, cybrcycc, namcos22_state, cybrcyc, ROT0, "Namco", "Cyber Cycles (Rev. CB2 Ver.C)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 95/04/04 |
| 5672 | 5671 | GAME( 1995, dirtdash, 0, namcos22s, dirtdash, namcos22_state, dirtdash, ROT0, "Namco", "Dirt Dash (Rev. DT2)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 95/12/20 20:01:56 |
| 5673 | | GAME( 1995, timecris, 0, namcos22s, timecris, namcos22_state, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.B)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 96/04/02 18:48:00 |
| 5674 | | GAME( 1995, timecrisa,timecris, namcos22s, timecris, namcos22_state, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.A)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 96/01/08 18:56:09 |
| 5672 | GAME( 1995, timecris, 0, timecris, timecris, namcos22_state, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.B)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 96/04/02 18:48:00 |
| 5673 | GAME( 1995, timecrisa,timecris, timecris, timecris, namcos22_state, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.A)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 96/01/08 18:56:09 |
| 5675 | 5674 | GAME( 1996, propcycl, 0, namcos22s, propcycl, namcos22_state, propcycl, ROT0, "Namco", "Prop Cycle (Rev. PR2 Ver.A)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS ) // 96/06/18 21:22:13 |
| 5676 | 5675 | GAME( 1996, alpinesa, 0, namcos22s, alpiner, namcos22_state, alpinesa, ROT0, "Namco", "Alpine Surfer (Rev. AF2 Ver.A)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) // 96/07/01 15:19:23. major gfx problems, slave dsp? |
| 5677 | 5676 | GAME( 1996, tokyowar, 0, namcos22s, tokyowar, namcos22_state, tokyowar, ROT0, "Namco", "Tokyo Wars (Rev. TW2 Ver.A)" , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) // 96/09/03 14:08:47. near-invincible tanks, maybe related to timecris helicopter bug? |
trunk/src/mame/drivers/namcos23.c
| r18700 | r18701 | |
| 1782 | 1782 | { |
| 1783 | 1783 | m_ctl_led = data & 0xff; |
| 1784 | 1784 | for (int i = 0; i < 8; i++) |
| 1785 | | output_set_lamp_value(i, m_ctl_led>>i & 1); |
| 1785 | output_set_lamp_value(i, (~data<<i & 0x80) ? 0 : 1); |
| 1786 | 1786 | } |
| 1787 | 1787 | break; |
| 1788 | 1788 | |
| r18700 | r18701 | |
| 2998 | 2998 | static INPUT_PORTS_START( timecrs2 ) |
| 2999 | 2999 | PORT_INCLUDE( s23 ) |
| 3000 | 3000 | |
| 3001 | | PORT_START("LIGHTX") |
| 3002 | | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(48) PORT_KEYDELTA(4) |
| 3003 | | PORT_START("LIGHTY") |
| 3004 | | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(64) PORT_KEYDELTA(4) |
| 3001 | PORT_START("LIGHTX") // tuned for CRT |
| 3002 | PORT_BIT( 0xfff, 91+733/2, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(91, 91+733) PORT_SENSITIVITY(48) PORT_KEYDELTA(12) |
| 3003 | PORT_START("LIGHTY") // tuned for CRT - can't shoot below the statusbar? |
| 3004 | PORT_BIT( 0xfff, 38+247/2, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(38, 38+247) PORT_SENSITIVITY(64) PORT_KEYDELTA(4) |
| 3005 | 3005 | INPUT_PORTS_END |
| 3006 | 3006 | |
| 3007 | 3007 | static INPUT_PORTS_START( ss23 ) |
| r18700 | r18701 | |
| 3146 | 3146 | READ8_MEMBER(namcos23_state::s23_iob_p6_r) |
| 3147 | 3147 | { |
| 3148 | 3148 | // d4 is service button |
| 3149 | | UINT8 sb = ioport("SERVICE")->read() & 1; |
| 3149 | UINT8 sb = (ioport("SERVICE")->read() & 1) << 4; |
| 3150 | 3150 | // other bits: unknown |
| 3151 | 3151 | |
| 3152 | | return sb<<4; |
| 3152 | return sb | 0; |
| 3153 | 3153 | } |
| 3154 | 3154 | |
| 3155 | 3155 | WRITE8_MEMBER(namcos23_state::s23_iob_p6_w) |
| r18700 | r18701 | |
| 3159 | 3159 | |
| 3160 | 3160 | READ8_MEMBER(namcos23_state::s23_gun_r) |
| 3161 | 3161 | { |
| 3162 | | UINT16 xpos = ioport("LIGHTX")->read_safe(0) * 640 / 0xff + 0x80; |
| 3163 | | UINT16 ypos = ioport("LIGHTY")->read_safe(0) * 240 / 0xff + 0x20; |
| 3162 | UINT16 xpos = ioport("LIGHTX")->read(); |
| 3163 | UINT16 ypos = ioport("LIGHTY")->read(); |
| 3164 | 3164 | |
| 3165 | | // note: will need angle adjustments for accurate aiming at screen sides |
| 3166 | 3165 | switch(offset) |
| 3167 | 3166 | { |
| 3168 | 3167 | case 0: return xpos&0xff; |