diff --git a/BizHawk.Emulation.Cores/CPUs/LR35902/Interrupts.cs b/BizHawk.Emulation.Cores/CPUs/LR35902/Interrupts.cs index 51c926aec8..6ee944e95d 100644 --- a/BizHawk.Emulation.Cores/CPUs/LR35902/Interrupts.cs +++ b/BizHawk.Emulation.Cores/CPUs/LR35902/Interrupts.cs @@ -4,23 +4,6 @@ namespace BizHawk.Emulation.Common.Components.LR35902 { public partial class LR35902 { - private bool nonMaskableInterrupt; - public bool NonMaskableInterrupt - { - get { return nonMaskableInterrupt; } - set { if (value && !nonMaskableInterrupt) NonMaskableInterruptPending = true; nonMaskableInterrupt = value; } - } - - private bool nonMaskableInterruptPending; - public bool NonMaskableInterruptPending { get { return nonMaskableInterruptPending; } set { nonMaskableInterruptPending = value; } } - - private int interruptMode; - public int InterruptMode - { - get { return interruptMode; } - set { if (value < 0 || value > 2) throw new ArgumentOutOfRangeException(); interruptMode = value; } - } - private void INTERRUPT_() { cur_instr = new ushort[] @@ -92,9 +75,6 @@ namespace BizHawk.Emulation.Common.Components.LR35902 skip_once = false; Halt_bug_2 = false; Halt_bug_3 = false; - NonMaskableInterrupt = false; - NonMaskableInterruptPending = false; - InterruptMode = 1; } } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs b/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs index 8decc26e76..2df6418354 100644 --- a/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs +++ b/BizHawk.Emulation.Cores/CPUs/LR35902/LR35902.cs @@ -564,9 +564,6 @@ namespace BizHawk.Emulation.Common.Components.LR35902 ser.BeginSection("LR35902"); ser.Sync("Regs", ref Regs, false); ser.Sync("IRQ", ref interrupts_enabled); - ser.Sync("NMI", ref nonMaskableInterrupt); - ser.Sync("NMIPending", ref nonMaskableInterruptPending); - ser.Sync("IM", ref interruptMode); ser.Sync("I_use", ref I_use); ser.Sync("skip_once", ref skip_once); ser.Sync("Halt_bug_2", ref Halt_bug_2); @@ -579,8 +576,8 @@ namespace BizHawk.Emulation.Common.Components.LR35902 ser.Sync("stop_check", ref stop_check); ser.Sync("is_GBC", ref is_GBC); - ser.Sync("instruction_pointer", ref instr_pntr); - ser.Sync("current instruction", ref cur_instr, false); + ser.Sync("instr_pntr", ref instr_pntr); + ser.Sync("cur_instr", ref cur_instr, false); ser.Sync("CB Preifx", ref CB_prefix); ser.Sync("Stopped", ref stopped); ser.Sync("opcode", ref opcode); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs index b404cf0df3..c272d52839 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs @@ -107,7 +107,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk public byte AUD_CTRL_vol_L; public byte AUD_CTRL_vol_R; - public int sequencer_len, sequencer_vol, sequencer_swp, sequencer_tick; + public int sequencer_len, sequencer_vol, sequencer_swp; public bool timer_bit_old; public byte sample; @@ -729,14 +729,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // frame sequencer ticks at a rate of 512 hz (or every time a 13 bit counter rolls over) // the sequencer is actually the timer DIV register // so if it's constantly written to, these values won't update - //sequencer_tick++; - - //if (sequencer_tick == 8192) bool check = Core.double_speed ? Core.timer.divider_reg.Bit(13) : Core.timer.divider_reg.Bit(12); if (check && !timer_bit_old) { - //sequencer_tick = 0; - sequencer_vol++; sequencer_vol &= 0x7; sequencer_len++; sequencer_len &= 0x7; sequencer_swp++; sequencer_swp &= 0x7; @@ -941,7 +936,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk sequencer_len = 0; sequencer_swp = 0; sequencer_vol = 0; - sequencer_tick = 0; sample = 0; @@ -1033,7 +1027,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ser.Sync("sequencer_len", ref sequencer_len); ser.Sync("sequencer_vol", ref sequencer_vol); ser.Sync("sequencer_swp", ref sequencer_swp); - ser.Sync("sequencer_tick", ref sequencer_tick); ser.Sync("timer_bit_old", ref timer_bit_old); ser.Sync("master_audio_clock", ref master_audio_clock); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs index c7c5068f87..14570a59f2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IEmulator.cs @@ -63,8 +63,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk if (_scanlineCallback != null) { - GetGPU(); - _scanlineCallback(ppu.LCDC); + if (_scanlineCallbackLine == -1) + { + GetGPU(); + _scanlineCallback(ppu.LCDC); + } } if (_islag) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs index 9268eaee52..c7f2f425f3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.IStatable.cs @@ -72,11 +72,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk ser.Sync("REG_FFFF", ref REG_FFFF); ser.Sync("REG_FF0F", ref REG_FF0F); - ser.Sync("enable_VBL", ref enable_VBL); - ser.Sync("enable_LCDC", ref enable_PRS); - ser.Sync("enable_TIMO", ref enable_TIMO); - ser.Sync("enable_SER", ref enable_SER); - ser.Sync("enable_STAT", ref enable_STAT); // memory domains ser.Sync("RAM", ref RAM, false); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs index 3a0e26ba7c..ed6d09a237 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBHawk.cs @@ -28,12 +28,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk public byte REG_FFFF; // The unused bits in this register (interrupt flags) are always set public byte REG_FF0F = 0xE0; - public bool enable_VBL; - public bool enable_STAT; - public bool enable_TIMO; - public bool enable_SER; - public bool enable_PRS; - // memory domains public byte[] RAM = new byte[0x8000]; // only 0x2000 available to GB diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/HW_Registers.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/HW_Registers.cs index b4bdde86d6..a3ef71cad3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/HW_Registers.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/HW_Registers.cs @@ -373,11 +373,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk // interrupt control register case 0xFFFF: REG_FFFF = value; - enable_VBL = REG_FFFF.Bit(0); - enable_STAT = REG_FFFF.Bit(1); - enable_TIMO = REG_FFFF.Bit(2); - enable_SER = REG_FFFF.Bit(3); - enable_PRS = REG_FFFF.Bit(4); // check if enabling any of the bits triggered an IRQ for (int i = 0; i < 5; i++)