Hooked up Votrax properly to Gorf/WoW. Currently disabled by

default, but can be enabled by turning off USE_FAKE_VOTRAX in
astrocde.h.
This commit is contained in:
Aaron Giles 2012-03-01 08:36:39 +00:00
parent e2e32aac85
commit 0898291c85
4 changed files with 48 additions and 2 deletions

View File

@ -20,6 +20,7 @@ gorf_sh_ update- Null
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/samples.h"
#include "sound/votrax.h"
#include "includes/astrocde.h"
@ -111,11 +112,12 @@ const char *const gorf_sample_names[] =
READ8_HANDLER( gorf_speech_r )
{
UINT8 data = offset >> 8;
#if USE_FAKE_VOTRAX
astrocde_state *state = space->machine().driver_data<astrocde_state>();
samples_device *samples = space->machine().device<samples_device>("samples");
int Phoneme, Intonation;
int i = 0;
UINT8 data = offset >> 8;
offset &= 0xff;
state->m_totalword_ptr = state->m_totalword;
@ -169,6 +171,11 @@ READ8_HANDLER( gorf_speech_r )
return data;
}
}
#else
votrax_sc01_device *votrax = space->machine().device<votrax_sc01_device>("votrax");
votrax->inflection_w(*space, 0, data >> 6);
votrax->write(*space, 0, data);
#endif
/* Note : We should really also use volume in this as well as frequency */
return data; /* Return nicely */
@ -177,6 +184,11 @@ READ8_HANDLER( gorf_speech_r )
CUSTOM_INPUT( gorf_speech_status_r )
{
#if USE_FAKE_VOTRAX
samples_device *samples = field.machine().device<samples_device>("samples");
return !samples->playing(0);
#else
votrax_sc01_device *votrax = field.machine().device<votrax_sc01_device>("votrax");
return votrax->request();
#endif
}

View File

@ -21,6 +21,7 @@ wow_sh_ update- Null
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/samples.h"
#include "sound/votrax.h"
#include "includes/astrocde.h"
@ -102,11 +103,12 @@ const char *const wow_sample_names[] =
READ8_HANDLER( wow_speech_r )
{
UINT8 data = offset >> 8;
#if USE_FAKE_VOTRAX
astrocde_state *state = space->machine().driver_data<astrocde_state>();
samples_device *samples = space->machine().device<samples_device>("samples");
int Phoneme/*, Intonation*/;
int i = 0;
UINT8 data = offset >> 8;
offset &= 0xff;
state->m_totalword_ptr = state->m_totalword;
@ -163,6 +165,11 @@ READ8_HANDLER( wow_speech_r )
return data;
}
}
#else
votrax_sc01_device *votrax = space->machine().device<votrax_sc01_device>("votrax");
votrax->inflection_w(*space, 0, data >> 6);
votrax->write(*space, 0, data);
#endif
/* Note : We should really also use volume in this as well as frequency */
return data; /* Return nicely */
@ -171,6 +178,11 @@ READ8_HANDLER( wow_speech_r )
CUSTOM_INPUT( wow_speech_status_r )
{
#if USE_FAKE_VOTRAX
samples_device *samples = field.machine().device<samples_device>("samples");
return !samples->playing(0);
#else
votrax_sc01_device *votrax = field.machine().device<votrax_sc01_device>("votrax");
return votrax->request();
#endif
}

View File

@ -118,6 +118,7 @@
#include "machine/z80ctc.h"
#include "machine/nvram.h"
#include "sound/samples.h"
#include "sound/votrax.h"
#include "sound/astrocde.h"
#include "sound/ay8910.h"
@ -341,7 +342,11 @@ static READ8_HANDLER( gorf_io_1_r )
case 5: state->m_sparkle[3] = data; break;
case 6:
space->machine().device<astrocade_device>("astrocade1")->set_output_gain(0, data ? 0.0 : 1.0);
#if USE_FAKE_VOTRAX
space->machine().device<samples_device>("samples")->set_output_gain(0, data ? 1.0 : 0.0);
#else
space->machine().device<votrax_sc01_device>("votrax")->set_output_gain(0, data ? 1.0 : 0.0);
#endif
break;
case 7: mame_printf_debug("io_1:%d\n", data); break;
}
@ -1404,6 +1409,13 @@ static MACHINE_CONFIG_DERIVED( spacezap, astrocade_base )
MACHINE_CONFIG_END
#if !USE_FAKE_VOTRAX
static votrax_sc01_interface votrax_interface =
{
DEVCB_NULL
};
#endif
static MACHINE_CONFIG_DERIVED( wow, astrocade_base )
MCFG_FRAGMENT_ADD(astrocade_stereo_sound)
@ -1420,7 +1432,11 @@ static MACHINE_CONFIG_DERIVED( wow, astrocade_base )
/* sound hardware */
MCFG_SPEAKER_ADD("center", 0.0, 0.0, 1.0)
#if USE_FAKE_VOTRAX
MCFG_SAMPLES_ADD("samples", wow_samples_interface)
#else
MCFG_VOTRAX_SC01_ADD("votrax", 720000, votrax_interface)
#endif
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "center", 0.85)
MACHINE_CONFIG_END
@ -1446,7 +1462,11 @@ static MACHINE_CONFIG_DERIVED( gorf, astrocade_base )
MCFG_SOUND_ADD("astrocade2", ASTROCADE, ASTROCADE_CLOCK/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lower", 1.0)
#if USE_FAKE_VOTRAX
MCFG_SAMPLES_ADD("samples", gorf_samples_interface)
#else
MCFG_VOTRAX_SC01_ADD("votrax", 720000, votrax_interface)
#endif
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "upper", 0.85)
MACHINE_CONFIG_END

View File

@ -11,6 +11,8 @@
#define AC_STARS (0x04)
#define AC_MONITOR_BW (0x08)
#define USE_FAKE_VOTRAX (1)
class astrocde_state : public driver_device
{