trunk/src/mame/drivers/cps1.c
| r19542 | r19543 | |
| 192 | 192 | For example, magic power will be increased at the end of level 1 but you won't notice |
| 193 | 193 | it before level 3, and sword power will be increased at the end of level 2 but you |
| 194 | 194 | won't notice it before level 4. |
| 195 | |
| 196 | 6) 'ganbare' |
| 195 | 197 | |
| 198 | - Using the payout setting dip switch results in some occasional hopper errors, if this |
| 199 | happens, then the clear ram dip switch needs to be used. This needs to be resolved. |
| 200 | |
| 196 | 201 | TO DO (2006.09.20) : |
| 197 | 202 | |
| 198 | 203 | - Check 'strider' and its clones and add debug features |
| r19542 | r19543 | |
| 239 | 244 | #include "sound/okim6295.h" |
| 240 | 245 | #include "sound/qsound.h" |
| 241 | 246 | #include "sound/msm5205.h" |
| 247 | #include "machine/timekpr.h" |
| 242 | 248 | |
| 243 | 249 | #include "includes/cps1.h" /* External CPS1 definitions */ |
| 244 | 250 | |
| r19542 | r19543 | |
| 333 | 339 | device.execute().set_input_line(2, HOLD_LINE); |
| 334 | 340 | } |
| 335 | 341 | |
| 342 | TIMER_CALLBACK_MEMBER(cps_state::ganbare_interrupt4) |
| 343 | { |
| 344 | /* not sure on the timing or source of this - the game needs it once per frame, */ |
| 345 | /* otherwise you get a "HARD ERROR" after boot */ |
| 346 | m_maincpu->set_input_line(4, HOLD_LINE); |
| 347 | } |
| 348 | |
| 349 | INTERRUPT_GEN_MEMBER(cps_state::ganbare_interrupt) |
| 350 | { |
| 351 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(150000 - 500), timer_expired_delegate(FUNC(cps_state::ganbare_interrupt4),this)); |
| 352 | device.execute().set_input_line(2, HOLD_LINE); |
| 353 | } |
| 354 | |
| 336 | 355 | /******************************************************************** |
| 337 | 356 | * |
| 338 | 357 | * Q Sound |
| r19542 | r19543 | |
| 2900 | 2919 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Coin 3 (P3 Button 3 in-game)") |
| 2901 | 2920 | INPUT_PORTS_END |
| 2902 | 2921 | |
| 2922 | static INPUT_PORTS_START( ganbare ) |
| 2923 | PORT_START("IN0") |
| 2924 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 2925 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) /* definitely read here in test mode, coin lock prevents it though */ |
| 2926 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 2927 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2928 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) |
| 2929 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) |
| 2930 | PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW ) |
| 2931 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2932 | |
| 2933 | PORT_START("IN1") |
| 2934 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 2935 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 2936 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2937 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2938 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 2939 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 2940 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2941 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2942 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2943 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2944 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2945 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2946 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2947 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2948 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2949 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 2903 | 2950 | |
| 2951 | PORT_START("DSWA") |
| 2952 | PORT_DIPNAME( 0x01, 0x01, "Medal Setup" ) PORT_DIPLOCATION("SW(A):1") |
| 2953 | PORT_DIPSETTING( 0x01, "1 Medal 1 Credit" ) |
| 2954 | PORT_DIPSETTING( 0x00, "Don't use" ) |
| 2955 | PORT_DIPNAME( 0x02, 0x02, "Coin Setup" ) PORT_DIPLOCATION("SW(A):2") |
| 2956 | PORT_DIPSETTING( 0x02, "100 Yen" ) |
| 2957 | PORT_DIPSETTING( 0x00, "10 Yen" ) |
| 2958 | PORT_DIPNAME( 0x1c, 0x1c, "Change Setup" ) PORT_DIPLOCATION("SW(A):3,4,5") |
| 2959 | PORT_DIPSETTING( 0x04, "12" ) |
| 2960 | PORT_DIPSETTING( 0x00, "11" ) |
| 2961 | PORT_DIPSETTING( 0x1c, "10" ) |
| 2962 | PORT_DIPSETTING( 0x18, "8" ) |
| 2963 | PORT_DIPSETTING( 0x14, "7" ) |
| 2964 | PORT_DIPSETTING( 0x10, "6" ) |
| 2965 | PORT_DIPSETTING( 0x0c, "5" ) |
| 2966 | PORT_DIPSETTING( 0x08, "No change" ) |
| 2967 | PORT_DIPNAME( 0x60, 0x60, "10 Yen Setup" ) PORT_DIPLOCATION("SW(A):6,7") |
| 2968 | PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) |
| 2969 | PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) |
| 2970 | PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) ) |
| 2971 | PORT_DIPSETTING( 0x00, "Don't use" ) |
| 2972 | PORT_DIPNAME( 0x80, 0x80, "Payout Setup" ) PORT_DIPLOCATION("SW(A):8") |
| 2973 | PORT_DIPSETTING( 0x80, "Credit Mode" ) |
| 2974 | PORT_DIPSETTING( 0x00, "Payout Mode" ) |
| 2975 | |
| 2976 | PORT_START("DSWB") |
| 2977 | PORT_DIPNAME( 0x07, 0x07, "Payout Rate Setup" ) PORT_DIPLOCATION("SW(B):1,2,3") |
| 2978 | PORT_DIPSETTING( 0x01, "90%" ) |
| 2979 | PORT_DIPSETTING( 0x00, "85%" ) |
| 2980 | PORT_DIPSETTING( 0x07, "80%" ) |
| 2981 | PORT_DIPSETTING( 0x06, "75%" ) |
| 2982 | PORT_DIPSETTING( 0x05, "70%" ) |
| 2983 | PORT_DIPSETTING( 0x04, "65%" ) |
| 2984 | PORT_DIPSETTING( 0x03, "60%" ) |
| 2985 | PORT_DIPSETTING( 0x02, "55%" ) |
| 2986 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW(B):4" ) |
| 2987 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW(B):5" ) |
| 2988 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW(B):6" ) |
| 2989 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW(B):7" ) |
| 2990 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW(B):8" ) |
| 2991 | |
| 2992 | PORT_START("DSWC") |
| 2993 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW(C):1,2") |
| 2994 | PORT_DIPSETTING( 0x03, DEF_STR( On ) ) |
| 2995 | PORT_DIPSETTING( 0x02, "Every second sound" ) |
| 2996 | PORT_DIPSETTING( 0x01, "Every third sound" ) |
| 2997 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2998 | PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW(C):3" ) |
| 2999 | PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW(C):4" ) |
| 3000 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW(C):5" ) |
| 3001 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW(C):6" ) |
| 3002 | PORT_DIPNAME( 0x40, 0x40, "Clear RAM" ) PORT_DIPLOCATION("SW(C):7") |
| 3003 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) |
| 3004 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 3005 | PORT_DIPNAME( 0x80, 0x80, "Tes Mode Display" ) PORT_DIPLOCATION("SW(C):8") |
| 3006 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 3007 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 3008 | INPUT_PORTS_END |
| 3009 | |
| 3010 | |
| 2904 | 3011 | static INPUT_PORTS_START( sfzch ) |
| 2905 | 3012 | PORT_START("IN0") /* IN0 */ |
| 2906 | 3013 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_PLAYER(1) |
| r19542 | r19543 | |
| 3135 | 3242 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 3136 | 3243 | MACHINE_CONFIG_END |
| 3137 | 3244 | |
| 3245 | static MACHINE_CONFIG_DERIVED( ganbare, cps1_10MHz ) |
| 3246 | |
| 3247 | /* basic machine hardware */ |
| 3248 | MCFG_CPU_MODIFY("maincpu") |
| 3249 | MCFG_CPU_VBLANK_INT_DRIVER("screen", cps_state, ganbare_interrupt) |
| 3250 | |
| 3251 | MCFG_M48T35_ADD("m48t35") |
| 3252 | MACHINE_CONFIG_END |
| 3253 | |
| 3138 | 3254 | /* bootlegs with PIC */ |
| 3139 | 3255 | |
| 3140 | 3256 | static MACHINE_CONFIG_START( cpspicb, cps_state ) |
| r19542 | r19543 | |
| 10723 | 10839 | ROM_LOAD( "c632.ic1", 0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) ) |
| 10724 | 10840 | ROM_END |
| 10725 | 10841 | |
| 10842 | /* B-Board 91634B-2 */ |
| 10843 | ROM_START( ganbare ) |
| 10844 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ |
| 10845 | ROM_LOAD16_WORD_SWAP( "mrnj_23d.8f", 0x00000, 0x80000, CRC(f929be72) SHA1(d175bdcace469277479ef85bf4e1b9d5a63cffde) ) |
| 10846 | |
| 10847 | ROM_REGION( 0x400000, "gfx", 0 ) |
| 10848 | ROMX_LOAD( "mrnj_01.3a", 0x000000, 0x80000, CRC(3f878020) SHA1(b18faa50d88c76d19db1af73cf4b3095e928f51f) , ROM_GROUPWORD | ROM_SKIP(6) ) // == kd-5m.4a |
| 10849 | ROMX_LOAD( "mrnj_02.4a", 0x000002, 0x80000, CRC(3e5624d8) SHA1(502e4897916af1c9e121b096de1369d06f1ffe87) , ROM_GROUPWORD | ROM_SKIP(6) ) // == kd-7m.6a |
| 10850 | ROMX_LOAD( "mrnj_03.5a", 0x000004, 0x80000, CRC(d1e61f96) SHA1(5f6dee8adbf83c697416e440fbdd3a84a6e698da) , ROM_GROUPWORD | ROM_SKIP(6) ) // == kd-1m.3a |
| 10851 | ROMX_LOAD( "mrnj_04.6a", 0x000006, 0x80000, CRC(d241971b) SHA1(b641740b40a043affbb79ea91ba12f821a259bad) , ROM_GROUPWORD | ROM_SKIP(6) ) // == kd-3m.5a |
| 10852 | ROMX_LOAD( "mrnj_05.7a", 0x200000, 0x80000, CRC(c0a14562) SHA1(2fb6cf98fed83ac92c33df9526102a101454e276) , ROM_GROUPWORD | ROM_SKIP(6) ) // == kd-6m.4c |
| 10853 | ROMX_LOAD( "mrnj_06.8a", 0x200002, 0x80000, CRC(e6a71dfc) SHA1(67178b020f87fb28ef35292d008ce9b80e02a2db) , ROM_GROUPWORD | ROM_SKIP(6) ) // == kd-8m.6c |
| 10854 | ROMX_LOAD( "mrnj_07.9a", 0x200004, 0x80000, CRC(99afb6c7) SHA1(5caead2b71cd54f6b53765f09829cc9e92e1e2d6) , ROM_GROUPWORD | ROM_SKIP(6) ) // == kd-2m.3c |
| 10855 | ROMX_LOAD( "mrnj_08.10a", 0x200006, 0x80000, CRC(52882c20) SHA1(5e3fca6da3470aeb78534f01e1575d8c0e067c0e) , ROM_GROUPWORD | ROM_SKIP(6) ) // == kd-4m.5c |
| 10856 | |
| 10857 | ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ |
| 10858 | ROM_LOAD( "mrnj_09.12c", 0x00000, 0x08000, CRC(62470d72) SHA1(1de357a20f794defb49ed01af5b95ad00e2aa1d9) ) // == kd_9.12a |
| 10859 | ROM_CONTINUE( 0x10000, 0x08000 ) |
| 10860 | |
| 10861 | ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ |
| 10862 | ROM_LOAD( "mrnj_18.11c", 0x00000, 0x20000, CRC(08e13940) SHA1(5c7dd7ff6a66f100b59cf9244e78f2c8702faca1) ) |
| 10863 | ROM_LOAD( "mrnj_19.12c", 0x20000, 0x20000, CRC(5fa59927) SHA1(f05246cf566c214b008a91816c71e7c03b7cc218) ) |
| 10864 | |
| 10865 | ROM_REGION( 0x8000, "timekeeper", 0) /* Timekeeper internal RAM was dumped (but game overwrites it - should I keep this here or remove it?) */ |
| 10866 | ROM_LOAD( "m48t35y.9n", 0x00000, 0x8000, CRC(96107b4a) SHA1(be9149736030e06c96083dcac73b5be3dbc318ac) ) |
| 10867 | |
| 10868 | ROM_REGION( 0x0200, "aboardplds", 0 ) |
| 10869 | ROM_LOAD( "buf1", 0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) ) |
| 10870 | ROM_LOAD( "ioa1", 0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) ) |
| 10871 | ROM_LOAD( "prg1", 0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) ) |
| 10872 | ROM_LOAD( "rom1", 0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) ) |
| 10873 | ROM_LOAD( "sou1", 0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) ) |
| 10874 | |
| 10875 | ROM_REGION( 0x0200, "bboardplds", 0 ) |
| 10876 | ROM_LOAD( "gbp.1a", 0x0000, 0x0117, NO_DUMP ) |
| 10877 | ROM_LOAD( "iob1.12e", 0x0000, 0x0117, NO_DUMP ) |
| 10878 | ROM_LOAD( "bprg1.11e", 0x0000, 0x0117, NO_DUMP ) |
| 10879 | ROM_END |
| 10880 | |
| 10726 | 10881 | /* Home 'CPS Changer' Unit - For MESS */ |
| 10727 | 10882 | |
| 10728 | 10883 | /* B-Board 91635B-2 */ |
| r19542 | r19543 | |
| 11030 | 11185 | DRIVER_INIT_CALL(pang3b); |
| 11031 | 11186 | } |
| 11032 | 11187 | |
| 11188 | READ16_MEMBER(cps_state::ganbare_ram_r) |
| 11189 | { |
| 11190 | device_t *device = machine().device("m48t35"); |
| 11191 | UINT16 result = 0xffff; |
| 11192 | |
| 11193 | if ((mem_mask & 0x00ff) != 0) |
| 11194 | result = (result & ~0x00ff) | timekeeper_r(device, space, offset); |
| 11195 | if ((mem_mask & 0xff00) != 0) |
| 11196 | result = (result & ~0xff00) | (m_ganbare_shared_ram[offset] << 8); |
| 11197 | |
| 11198 | return result; |
| 11199 | } |
| 11200 | |
| 11201 | WRITE16_MEMBER(cps_state::ganbare_ram_w) |
| 11202 | { |
| 11203 | device_t *device = machine().device("m48t35"); |
| 11204 | |
| 11205 | if ((mem_mask & 0x00ff) != 0) |
| 11206 | timekeeper_w(device, space, offset, data & 0xff); |
| 11207 | if ((mem_mask & 0xff00) != 0) |
| 11208 | m_ganbare_shared_ram[offset] = data >> 8; |
| 11209 | } |
| 11210 | |
| 11211 | DRIVER_INIT_MEMBER(cps_state, ganbare) |
| 11212 | { |
| 11213 | DRIVER_INIT_CALL(cps1); |
| 11214 | |
| 11215 | /* ram is shared between the CPS work ram and the timekeeper ram */ |
| 11216 | m_ganbare_shared_ram = auto_alloc_array(machine(), UINT16, 0x10000 / 2); |
| 11217 | save_pointer(NAME(m_ganbare_shared_ram), 0x10000 / 2); |
| 11218 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xff0000, 0xffffff, read16_delegate(FUNC(cps_state::ganbare_ram_r),this), write16_delegate(FUNC(cps_state::ganbare_ram_w),this)); |
| 11219 | } |
| 11220 | |
| 11033 | 11221 | DRIVER_INIT_MEMBER(cps_state,dinohunt) |
| 11034 | 11222 | { |
| 11035 | 11223 | // is this shared with the new sound hw? |
| r19542 | r19543 | |
| 11201 | 11389 | GAME( 1995, megaman, 0, cps1_12MHz, megaman, cps_state, cps1, ROT0, "Capcom", "Mega Man: The Power Battle (CPS1, USA 951006)", GAME_SUPPORTS_SAVE ) |
| 11202 | 11390 | GAME( 1995, megamana, megaman, cps1_12MHz, megaman, cps_state, cps1, ROT0, "Capcom", "Mega Man: The Power Battle (CPS1, Asia 951006)", GAME_SUPPORTS_SAVE ) |
| 11203 | 11391 | GAME( 1995, rockmanj, megaman, cps1_12MHz, rockmanj, cps_state, cps1, ROT0, "Capcom", "Rockman: The Power Battle (CPS1, Japan 950922)", GAME_SUPPORTS_SAVE ) |
| 11392 | GAME( 2000, ganbare, 0, ganbare, ganbare, cps_state, ganbare, ROT0, "Capcom", "Ganbare Marin-kun (Marine 2K0411 JPN)", GAME_SUPPORTS_SAVE ) |
| 11204 | 11393 | |
| 11205 | 11394 | /* Games released on CPS-1 hardware by Mitchell */ |
| 11206 | 11395 | |