Vectrex: add pcm sample playback

This commit is contained in:
alyosha-tas 2019-07-03 20:49:27 -04:00
parent 38772dcd89
commit 95db4f2159
2 changed files with 8 additions and 3 deletions

View File

@ -18,6 +18,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
private short current_sample, old_sample;
// not actually part of the AY chip, the Vectrex schematics show a line directly feeding audio from multiplexer output
public short pcm_sample;
public byte[] Register = new byte[16];
public byte port_sel;
@ -76,6 +79,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
ser.Sync(nameof(old_sample), ref old_sample);
ser.Sync(nameof(master_audio_clock), ref master_audio_clock);
ser.Sync(nameof(pcm_sample), ref pcm_sample);
sync_psg_state();
ser.EndSection();
@ -300,7 +305,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
v += (short)(sound_out_C ? VolumeTable[env_E] : 0);
}
current_sample = (short)v;
current_sample = (short)(v + pcm_sample);
if (current_sample != old_sample)
{

View File

@ -181,7 +181,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
{
if (sel0)
{
if (sel1) {/* sound line? */ }
if (sel1) {/* sound samples direct to output */ audio.pcm_sample = (short)(portA_ret << 6); }
else { ppu.vec_scale = portA_ret; if (portA_ret != 0) { Console.WriteLine("scale: " + portA_ret); } }
}
else
@ -220,7 +220,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
{
if (sel0)
{
if (sel1) {/* sound line? */ }
if (sel1) {/* sound samples direct to output */ audio.pcm_sample = (short)(portA_ret << 6); }
else { ppu.vec_scale = portA_ret; if (portA_ret != 0) { Console.WriteLine("scale: " + portA_ret); } }
}
else