nes apu: add PAL numbers for NoiseUnit

This commit is contained in:
goyuken 2012-12-03 19:55:14 +00:00
parent e513eb7cf7
commit 9b40792553
1 changed files with 15 additions and 4 deletions

View File

@ -38,6 +38,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
{
this.nes = nes;
dmc = new DMCUnit(this, pal);
noise = new NoiseUnit(pal);
if (old != null)
{
EnableSquare1 = old.EnableSquare1;
@ -62,10 +63,13 @@ namespace BizHawk.Emulation.Consoles.Nintendo
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
};
static int[] NOISE_TABLE =
static int[] NOISE_TABLE_NTSC =
{
4, 8, 16, 32, 64, 96, 128, 160, 202, 254, 380, 508, 762, 1016, 2034, 4068 //NTSC
//4, 7, 14, 30, 60, 88, 118, 148, 188, 236, 354, 472, 708, 944, 1890, 3778 //PAL
4, 8, 16, 32, 64, 96, 128, 160, 202, 254, 380, 508, 762, 1016, 2034, 4068
};
static int[] NOISE_TABLE_PAL =
{
4, 7, 14, 30, 60, 88, 118, 148, 188, 236, 354, 472, 708, 944, 1890, 3778
};
@ -286,6 +290,13 @@ namespace BizHawk.Emulation.Consoles.Nintendo
int env_output, env_start_flag, env_divider, env_counter;
bool noise_bit = true;
int[] NOISE_TABLE;
public NoiseUnit(bool pal)
{
NOISE_TABLE = pal ? NOISE_TABLE_PAL : NOISE_TABLE_NTSC;
}
public void SyncState(Serializer ser)
{
ser.Sync("env_cnt_value", ref env_cnt_value);
@ -766,7 +777,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
PulseUnit[] pulse = { new PulseUnit(0), new PulseUnit(1) };
TriangleUnit triangle = new TriangleUnit();
NoiseUnit noise = new NoiseUnit();
NoiseUnit noise; //= new NoiseUnit();
DMCUnit dmc;
bool irq_pending;