Previous 199869 Revisions Next

r18941 Tuesday 13th November, 2012 at 10:39:11 UTC by Robbbert
lupin3a : added music [Robbbert]
[src/mame/audio]8080bw.c
[src/mame/drivers]8080bw.c
[src/mame/includes]8080bw.h

trunk/src/mame/drivers/8080bw.c
r18940r18941
12691269/*                                                                                         */
12701270/* Taito "Lupin III"                                                                       */
12711271/*                                                                                         */
1272/*  The rom at 5000 is optional. It contains code for colour ram, and the tune that plays  */
1273/*  in the "wife vs man" scene. If you remove this rom, bits 0 and 1 of port 0 must        */
1274/*  be set High. The colour will then be determined by the 2 proms instead. Bit 6          */
1272/*  The rom at 5000 is optional. It contains code for colour ram, and all tunes except     */
1273/*  when the moneybag has been stolen. If you remove this rom, bits 0 and 1 of port 0      */
1274/*  must be set High. The colour will then be determined by the 2 proms instead. Bit 6     */
12751275/*  of port 5 will select which prom to use.                                               */
12761276/*                                                                                         */
12771277/*  Differences between the 2 sets:                                                        */
r18940r18941
12831283/*******************************************************************************************/
12841284
12851285static ADDRESS_MAP_START( lupin3_io_map, AS_IO, 8, _8080bw_state )
1286   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
1286   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(lupin3_00_w)
12871287   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
12881288   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
12891289   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(lupin3_sh_port_1_w)
r18940r18941
13651365   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_indianbt)
13661366
13671367   /* sound hardware */
1368   MCFG_FRAGMENT_ADD(invaders_samples_audio)
1368   MCFG_SPEAKER_STANDARD_MONO("mono")
1369
1370   MCFG_SOUND_ADD("snsnd", SN76477, 0)
1371   MCFG_SOUND_CONFIG(lupin3_sn76477_interface)
1372   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
1373
1374   MCFG_SAMPLES_ADD("samples", lupin3_samples_interface)
1375   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1376
1377   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
1378   MCFG_SOUND_CONFIG_DISCRETE(indianbt)
1379   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
13691380MACHINE_CONFIG_END
13701381
13711382static MACHINE_CONFIG_DERIVED_CLASS( lupin3a, mw8080bw_root, _8080bw_state )
r18940r18941
13841395   MCFG_SCREEN_UPDATE_DRIVER(_8080bw_state, screen_update_lupin3)
13851396
13861397   /* sound hardware */
1387   MCFG_FRAGMENT_ADD(invaders_samples_audio)
1398   MCFG_SPEAKER_STANDARD_MONO("mono")
1399
1400   MCFG_SOUND_ADD("snsnd", SN76477, 0)
1401   MCFG_SOUND_CONFIG(lupin3_sn76477_interface)
1402   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
1403
1404   MCFG_SAMPLES_ADD("samples", lupin3_samples_interface)
1405   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1406
1407   MCFG_SOUND_ADD("discrete", DISCRETE, 0)
1408   MCFG_SOUND_CONFIG_DISCRETE(indianbt)
1409   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
13881410MACHINE_CONFIG_END
13891411
13901412
trunk/src/mame/audio/8080bw.c
r18940r18941
10261026/* Correct samples not available         */
10271027/*****************************************/
10281028
1029const sn76477_interface lupin3_sn76477_interface =
1030{
1031   0,         /*  4 noise_res (N/C)        */
1032   0,         /*  5 filter_res (N/C)       */
1033   0,         /*  6 filter_cap (N/C)       */
1034   0,         /*  7 decay_res (N/C)        */
1035   0,         /*  8 attack_decay_cap (N/C) */
1036   RES_K(100), /* 10 attack_res             */
1037   RES_K(56),   /* 11 amplitude_res          */
1038   RES_K(10),   /* 12 feedback_res           */
1039   0,         /* 16 vco_voltage (N/C)      */
1040   CAP_U(0.1),   /* 17 vco_cap                */
1041   RES_K(8.2),   /* 18 vco_res                */
1042   5.0,      /* 19 pitch_voltage          */
1043   RES_K(120),   /* 20 slf_res                */
1044   CAP_U(1.0),   /* 21 slf_cap                */
1045   0,         /* 23 oneshot_cap (N/C)      */
1046   0,         /* 24 oneshot_res (N/C)      */
1047   1,         /* 22 vco                    */
1048   0,         /* 26 mixer A                */
1049   0,         /* 25 mixer B                */
1050   0,         /* 27 mixer C                */
1051   1,         /* 1  envelope 1             */
1052   0,         /* 28 envelope 2             */
1053   1         /* 9  enable (variable)      */
1054};
1055
1056static const char *const lupin3_sample_names[] =
1057{
1058   "*lupin3",
1059   "cap",      /* go to jail */
1060   "bark",      /* dog barking */
1061   "walk1",      /* walk, get money */
1062   "walk2",      /* walk, get money */
1063   "warp",      /* translocate, deposit money */
1064   "extend",      /* bonus man */
1065   "kick",      /* lands on top of building, wife kicks man */
1066   0
1067};
1068
1069
1070const samples_interface lupin3_samples_interface =
1071{
1072   4,   /* 4 channels */
1073   lupin3_sample_names
1074};
1075
1076WRITE8_MEMBER( _8080bw_state::lupin3_00_w )
1077{
1078   discrete_sound_w(m_discrete, space, INDIANBT_MUSIC_DATA, data);
1079}
1080
10291081WRITE8_MEMBER(_8080bw_state::lupin3_sh_port_1_w)
10301082{
10311083   UINT8 rising_bits = data & ~m_port_1_last_extra;
1084   static UINT8 lupin3_step = 2;
10321085
1033   if (rising_bits & 0x01) m_samples->start(0, 6);      /* Walking, get money */
1086   if (rising_bits & 0x01)
1087   {
1088      m_samples->start(0, lupin3_step);         /* Walking, steal money */
1089      lupin3_step ^= 1;
1090   }
10341091
10351092   sn76477_enable_w(m_sn, data & 0x02 ? 0:1);         /* Helicopter */
10361093
1037   if (rising_bits & 0x04) m_samples->start(0, 7);      /* Translocate */
1038   if (rising_bits & 0x08) m_samples->start(0, 1);      /* Jail */
1039   if (rising_bits & 0x10) m_samples->start(3, 8);      /* Bonus Man */
1094   if (rising_bits & 0x04) m_samples->start(1, 4);      /* Translocate */
1095   if (rising_bits & 0x08) m_samples->start(0, 0);      /* Jail */
1096   if (rising_bits & 0x10) m_samples->start(2, 5);      /* Bonus Man */
10401097
1098   //machine().sound().system_enable(data & 0x20);
1099
1100   //coin_lockout_global_w(machine(), data & 0x80);
1101
10411102   m_port_1_last_extra = data;
10421103}
10431104
r18940r18941
10451106{
10461107   UINT8 rising_bits = data & ~m_port_2_last_extra;
10471108
1048   if (rising_bits & 0x01) m_samples->start(0, 3);      /* Lands on top of building, wife kicks man */
1049   if (rising_bits & 0x02) m_samples->start(1, 2);      /* deposit money, start intermission, end game */
1050   if (rising_bits & 0x04) m_samples->start(2, 5);      /* deposit money, start intermission, Slides down rope */
1051   if (rising_bits & 0x08) m_samples->start(3, 0);      /* start intermission, end game */
1052   //if (rising_bits & 0x10) m_samples->start(3, 9);        /* Dog barking */
1109   if (rising_bits & 0x01) m_samples->start(0, 6);      /* Lands on top of building, wife kicks man */
1110   //if (rising_bits & 0x02) m_samples->start(3, 7);      /* deposit money, start intermission, end game */
1111   //if (rising_bits & 0x04) m_samples->start(4, 7);      /* deposit money, start intermission, Slides down rope */
1112   //if (rising_bits & 0x08) m_samples->start(5, 7);      /* start intermission, end game */
1113   if (rising_bits & 0x10) m_samples->start(3, 1);        /* Dog barking */
10531114
10541115   m_color_map = data & 0x40;
10551116
trunk/src/mame/includes/8080bw.h
r18940r18941
6666   DECLARE_WRITE8_MEMBER(rollingc_sh_port_w);
6767   DECLARE_WRITE8_MEMBER(invrvnge_sh_port_1_w);
6868   DECLARE_WRITE8_MEMBER(invrvnge_sh_port_2_w);
69   DECLARE_WRITE8_MEMBER(lupin3_00_w);
6970   DECLARE_WRITE8_MEMBER(lupin3_sh_port_1_w);
7071   DECLARE_WRITE8_MEMBER(lupin3_sh_port_2_w);
7172   DECLARE_WRITE8_MEMBER(schasercv_sh_port_1_w);
r18940r18941
120121
121122/*----------- defined in audio/8080bw.c -----------*/
122123extern const samples_interface lrescue_samples_interface;
124extern const samples_interface lupin3_samples_interface;
123125
124126DISCRETE_SOUND_EXTERN( ballbomb );
125127DISCRETE_SOUND_EXTERN( indianbt );
126128DISCRETE_SOUND_EXTERN( polaris );
127129
130extern const sn76477_interface lupin3_sn76477_interface;
128131extern const sn76477_interface schaser_sn76477_interface;
129132DISCRETE_SOUND_EXTERN( schaser );
130133

Previous 199869 Revisions Next


© 1997-2024 The MAME Team