From 41262f90bca32361d79f0d464aba951b8cd18664 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 17 Oct 2014 07:56:41 +0000 Subject: [PATCH] From Fabio (nw) -hector: creates a machine fragment for the sound components which are shared among hector and interact to avoid duplicate code -specialist : makes static the specimx palette because it is not used outside video/specimx,c -pce: fixed MT5734 by adding support for 192k images --- src/emu/bus/pce/pce_slot.c | 15 ++++ src/mess/drivers/hec2hrp.c | 132 ++---------------------------------- src/mess/drivers/interact.c | 49 ++----------- src/mess/includes/hec2hrp.h | 2 + src/mess/includes/special.h | 5 -- src/mess/machine/hec2hrp.c | 32 +++++++++ src/mess/video/special.c | 2 +- 7 files changed, 60 insertions(+), 177 deletions(-) diff --git a/src/emu/bus/pce/pce_slot.c b/src/emu/bus/pce/pce_slot.c index 767cfa991c7..45eded53d3e 100644 --- a/src/emu/bus/pce/pce_slot.c +++ b/src/emu/bus/pce/pce_slot.c @@ -4,6 +4,9 @@ PC-Engine / Turbografx-16 cart emulation (through slot devices) + TODO: + - reimplement cart mirroring in a better way + ***********************************************************************************************************/ @@ -85,6 +88,18 @@ void device_pce_cart_interface::rom_map_setup(UINT32 size) rom_bank_map[6] = 2; rom_bank_map[7] = 2; } + else if (size == 0x30000) + { + // 192K images (some demos) + rom_bank_map[0] = 0; + rom_bank_map[1] = 1; + rom_bank_map[2] = 2; + rom_bank_map[3] = 2; + rom_bank_map[4] = 0; + rom_bank_map[5] = 1; + rom_bank_map[6] = 2; + rom_bank_map[7] = 2; + } else { int i; diff --git a/src/mess/drivers/hec2hrp.c b/src/mess/drivers/hec2hrp.c index 974d7cf9f96..1646d6196f5 100644 --- a/src/mess/drivers/hec2hrp.c +++ b/src/mess/drivers/hec2hrp.c @@ -379,12 +379,6 @@ MACHINE_RESET_MEMBER(hec2hrp_state,hec2mdhrx) hector_reset(1, 0); } -/* Discrete Sound */ -static DISCRETE_SOUND_START( hec2hrp ) - DISCRETE_INPUT_LOGIC(NODE_01) - DISCRETE_OUTPUT(NODE_01, 5000) -DISCRETE_SOUND_END - /***********************************************************/ /********* mini disque interface ***************************/ /***********************************************************/ @@ -419,26 +413,7 @@ static MACHINE_CONFIG_START( hec2hr, hec2hrp_state ) MCFG_PALETTE_ADD("palette", 16) MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25) - - MCFG_SOUND_ADD("sn76477", SN76477, 0) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) - - MCFG_SOUND_ADD("discrete", DISCRETE, 0) /* Son 1bit*/ - MCFG_DISCRETE_INTF( hec2hrp ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_FRAGMENT_ADD(hector_audio) /* Gestion cassette*/ MCFG_CASSETTE_ADD( "cassette" ) @@ -473,26 +448,7 @@ static MACHINE_CONFIG_START( hec2hrp, hec2hrp_state ) MCFG_PALETTE_ADD("palette", 16) MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25)// Sound level for cassette, as it is in mono => output channel=0 - - MCFG_SOUND_ADD("sn76477", SN76477, 0) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) - - MCFG_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit - MCFG_DISCRETE_INTF(hec2hrp) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_FRAGMENT_ADD(hector_audio) /* Gestion cassette*/ MCFG_CASSETTE_ADD( "cassette" ) @@ -541,26 +497,7 @@ static MACHINE_CONFIG_START( hec2mx40, hec2hrp_state ) MCFG_PALETTE_ADD("palette", 16) MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25)// Sound level for cassette, as it is in mono => output channel=0 - - MCFG_SOUND_ADD("sn76477", SN76477, 0) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) - - MCFG_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit - MCFG_DISCRETE_INTF( hec2hrp ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_FRAGMENT_ADD(hector_audio) /* Gestion cassette*/ MCFG_CASSETTE_ADD( "cassette" ) @@ -604,26 +541,7 @@ static MACHINE_CONFIG_START( hec2hrx, hec2hrp_state ) MCFG_PALETTE_ADD("palette", 16) MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25)// Sound level for cassette, as it is in mono => output channel=0 - - MCFG_SOUND_ADD("sn76477", SN76477, 0) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) - - MCFG_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit - MCFG_DISCRETE_INTF( hec2hrp ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_FRAGMENT_ADD(hector_audio) // Gestion cassette MCFG_CASSETTE_ADD( "cassette" ) @@ -665,26 +583,7 @@ static MACHINE_CONFIG_START( hec2mdhrx, hec2hrp_state ) MCFG_PALETTE_ADD("palette", 16) MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25)// Sound level for cassette, as it is in mono => output channel=0 - - MCFG_SOUND_ADD("sn76477", SN76477, 0) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) - - MCFG_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit - MCFG_DISCRETE_INTF( hec2hrp ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_FRAGMENT_ADD(hector_audio) // Gestion cassette MCFG_CASSETTE_ADD( "cassette" ) @@ -729,26 +628,7 @@ static MACHINE_CONFIG_START( hec2mx80, hec2hrp_state ) MCFG_PALETTE_ADD("palette", 16) MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25)// Sound level for cassette, as it is in mono => output channel=0 - - MCFG_SOUND_ADD("sn76477", SN76477, 0) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) - - MCFG_SOUND_ADD("discrete", DISCRETE, 0) // Son 1bit - MCFG_DISCRETE_INTF( hec2hrp ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + MCFG_FRAGMENT_ADD(hector_audio) /* Gestion cassette*/ MCFG_CASSETTE_ADD( "cassette" ) diff --git a/src/mess/drivers/interact.c b/src/mess/drivers/interact.c index 87bb66e37ec..ce2c9e918da 100644 --- a/src/mess/drivers/interact.c +++ b/src/mess/drivers/interact.c @@ -97,11 +97,6 @@ static ADDRESS_MAP_START(interact_mem, AS_PROGRAM, 8, interact_state ) ADDRESS_MAP_END -/* Discrete Sound */ -static DISCRETE_SOUND_START( hec2hrp ) - DISCRETE_INPUT_LOGIC(NODE_01) - DISCRETE_OUTPUT(NODE_01, 5000) -DISCRETE_SOUND_END MACHINE_RESET_MEMBER(interact_state,interact) { @@ -143,28 +138,10 @@ static MACHINE_CONFIG_START( interact, interact_state ) MCFG_PALETTE_ADD("palette", 16) /* 8 colours, but only 4 at a time*/ MCFG_VIDEO_START_OVERRIDE(interact_state,hec2hrp) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25) /* Sound level for cassette, as it is in mono => output channel=0*/ - MCFG_SOUND_ADD("sn76477", SN76477, 0) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) + MCFG_FRAGMENT_ADD(hector_audio) - MCFG_SOUND_ADD("discrete", DISCRETE, 0) /* Son 1bit*/ - MCFG_DISCRETE_INTF( hec2hrp ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - - MCFG_CASSETTE_ADD( "cassette" ) + MCFG_CASSETTE_ADD("cassette") MCFG_CASSETTE_FORMATS(hector_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER) MCFG_CASSETTE_INTERFACE("interact_cass") @@ -198,28 +175,10 @@ static MACHINE_CONFIG_START( hector1, interact_state ) MCFG_PALETTE_ADD("palette", 16) /* 8 colours, but only 4 at a time*/ MCFG_VIDEO_START_OVERRIDE(interact_state,hec2hrp) - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") - MCFG_SOUND_ROUTE(0, "mono", 0.25)/* Sound level for cassette, as it is in mono => output channel=0*/ - MCFG_SOUND_ADD("sn76477", SN76477, 0) - MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter - MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res - MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res - MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res - MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res - MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res - MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage - MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res - MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) + MCFG_FRAGMENT_ADD(hector_audio) - MCFG_SOUND_ADD("discrete", DISCRETE, 0) /* Son 1bit*/ - MCFG_DISCRETE_INTF( hec2hrp ) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - - MCFG_CASSETTE_ADD( "cassette" ) + MCFG_CASSETTE_ADD("cassette") MCFG_CASSETTE_FORMATS(hector_cassette_formats) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER) MCFG_CASSETTE_INTERFACE("interact_cass") diff --git a/src/mess/includes/hec2hrp.h b/src/mess/includes/hec2hrp.h index 46221efa6f1..60b2ba218c9 100644 --- a/src/mess/includes/hec2hrp.h +++ b/src/mess/includes/hec2hrp.h @@ -187,3 +187,5 @@ public: }; extern const floppy_interface minidisc_floppy_interface; + +MACHINE_CONFIG_EXTERN( hector_audio ); diff --git a/src/mess/includes/special.h b/src/mess/includes/special.h index 9b7dc4ac8b8..990662b8891 100644 --- a/src/mess/includes/special.h +++ b/src/mess/includes/special.h @@ -148,9 +148,4 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); }; -/*----------- defined in video/special.c -----------*/ - -extern const rgb_t specimx_palette[16]; - - #endif /* SPECIAL_H_ */ diff --git a/src/mess/machine/hec2hrp.c b/src/mess/machine/hec2hrp.c index 842745d7fbe..1677ab0aed1 100644 --- a/src/mess/machine/hec2hrp.c +++ b/src/mess/machine/hec2hrp.c @@ -847,3 +847,35 @@ void hec2hrp_state::hector_init() /* Sound sn76477*/ Init_Value_SN76477_Hector(); /*init R/C value*/ } + + +/* sound hardware */ + +static DISCRETE_SOUND_START( hec2hrp ) + DISCRETE_INPUT_LOGIC(NODE_01) + DISCRETE_OUTPUT(NODE_01, 5000) +DISCRETE_SOUND_END + +MACHINE_CONFIG_FRAGMENT( hector_audio ) + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") + MCFG_SOUND_ROUTE(0, "mono", 0.25) /* Sound level for cassette, as it is in mono => output channel=0*/ + + MCFG_SOUND_ADD("sn76477", SN76477, 0) + MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(330), CAP_P(390)) // noise + filter + MCFG_SN76477_DECAY_RES(RES_K(680)) // decay_res + MCFG_SN76477_ATTACK_PARAMS(CAP_U(47), RES_K(180)) // attack_decay_cap + attack_res + MCFG_SN76477_AMP_RES(RES_K(33)) // amplitude_res + MCFG_SN76477_FEEDBACK_RES(RES_K(100)) // feedback_res + MCFG_SN76477_VCO_PARAMS(2, CAP_N(47), RES_K(1000)) // VCO volt + cap + res + MCFG_SN76477_PITCH_VOLTAGE(2) // pitch_voltage + MCFG_SN76477_SLF_PARAMS(CAP_U(0.1), RES_K(180)) // slf caps + res + MCFG_SN76477_ONESHOT_PARAMS(CAP_U(1.00001), RES_K(10000)) // oneshot caps + res + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.1) + + MCFG_SOUND_ADD("discrete", DISCRETE, 0) /* Son 1bit*/ + MCFG_DISCRETE_INTF(hec2hrp) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + +MACHINE_CONFIG_END + diff --git a/src/mess/video/special.c b/src/mess/video/special.c index 80004c4111a..76958b719ea 100644 --- a/src/mess/video/special.c +++ b/src/mess/video/special.c @@ -54,7 +54,7 @@ UINT32 special_state::screen_update_specialp(screen_device &screen, bitmap_ind16 } -const rgb_t specimx_palette[16] = { +static const rgb_t specimx_palette[16] = { rgb_t(0x00, 0x00, 0x00), // 0 rgb_t(0x00, 0x00, 0xaa), // 1 rgb_t(0x00, 0xaa, 0x00), // 2