diff --git a/MAME.Core/AxiBitmap/AxiBitmap.cs b/MAME.Core/AxiBitmap/AxiBitmap.cs index 6f31f3e..0fc3815 100644 --- a/MAME.Core/AxiBitmap/AxiBitmap.cs +++ b/MAME.Core/AxiBitmap/AxiBitmap.cs @@ -24,7 +24,7 @@ namespace MAME.Core.AxiBitmap sdColor = 0; r = _r; g = _g; - b = _b; + b = _b; a = byte.MaxValue; } public AxiColor(byte _r, byte _g, byte _b, byte _a) diff --git a/MAME.Core/Log/EmuLogger.cs b/MAME.Core/Log/EmuLogger.cs index cd6b43a..28acc3a 100644 --- a/MAME.Core/Log/EmuLogger.cs +++ b/MAME.Core/Log/EmuLogger.cs @@ -1,7 +1,7 @@ -using MAME.Core.run_interface; +using MAME.Core; using System; -namespace mame +namespace MAME.Core { public static class EmuLogger { diff --git a/MAME.Core/MAMEEmu.cs b/MAME.Core/MAMEEmu.cs new file mode 100644 index 0000000..c7139cf --- /dev/null +++ b/MAME.Core/MAMEEmu.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace MAME.Core +{ + public class MAMEEmu : IDisposable + { + MameMainMotion mameMainMotion; + public MAMEEmu() + { + mameMainMotion = new MameMainMotion(); + } + + public bool bRom => mameMainMotion.bRom; + + public void Init( + string RomDir, + ILog ilog, + IResources iRes, + IVideoPlayer ivp, + ISoundPlayer isp, + IKeyboard ikb, + IMouse imou + ) => mameMainMotion.Init(RomDir, ilog, iRes, ivp, isp, ikb, imou); + public Dictionary GetGameList() => mameMainMotion.GetGameList(); + public void LoadRom(string Name) => mameMainMotion.LoadRom(Name); + public void GetGameScreenSize(out int _width, out int _height, out IntPtr _framePtr) => mameMainMotion.GetGameScreenSize(out _width, out _height, out _framePtr); + public void StartGame() => mameMainMotion.StartGame(); + public void StopGame() => mameMainMotion.StopGame(); + + public void Dispose() + { + mameMainMotion.StopGame(); + mameMainMotion = null; + GC.Collect(); + } + } +} diff --git a/MAME.Core/Motion/MameMainMotion.cs b/MAME.Core/Motion/MameMainMotion.cs index 8492271..6d180ae 100644 --- a/MAME.Core/Motion/MameMainMotion.cs +++ b/MAME.Core/Motion/MameMainMotion.cs @@ -1,12 +1,11 @@ -using mame; -using MAME.Core.run_interface; +using MAME.Core; using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Xml.Linq; -namespace MAME.Core.Motion +namespace MAME.Core { public class MameMainMotion { @@ -71,7 +70,7 @@ namespace MAME.Core.Motion return RomInfo.dictName2Rom; } - public void GetGameScreenSize(out int _width, out int _height,out IntPtr _framePtr) + public void GetGameScreenSize(out int _width, out int _height, out IntPtr _framePtr) { //_width = Video.fullwidth; //_height = Video.fullheight; @@ -110,7 +109,7 @@ namespace MAME.Core.Motion return; } - mame.Timer.lt = new List(); + EmuTimer.lt = new List(); sSelect = RomInfo.Rom.Name; Machine.mainMotion = this; Machine.rom = RomInfo.Rom; @@ -230,8 +229,8 @@ namespace MAME.Core.Motion M68000Motion.iStatus = 0; M68000Motion.iValue = 0; Mame.exit_pending = false; - MameMainMotion.mainThread = new Thread(Mame.mame_execute); - MameMainMotion.mainThread.Start(); + mainThread = new Thread(Mame.mame_execute); + mainThread.Start(); } public void StopGame() diff --git a/MAME.Core/Motion/cheatMotion.cs b/MAME.Core/Motion/cheatMotion.cs index 9d50d51..0f0922b 100644 --- a/MAME.Core/Motion/cheatMotion.cs +++ b/MAME.Core/Motion/cheatMotion.cs @@ -1,10 +1,9 @@ using cpu.m68000; using cpu.nec; -using mame; using System; using System.Collections.Generic; -namespace MAME.Core.Motion +namespace MAME.Core { public partial class CheatMotion { diff --git a/MAME.Core/Motion/cpsMotion.cs b/MAME.Core/Motion/cpsMotion.cs index 1883383..e208d61 100644 --- a/MAME.Core/Motion/cpsMotion.cs +++ b/MAME.Core/Motion/cpsMotion.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace MAME.Core.Motion +namespace MAME.Core { public partial class CpsMotion { diff --git a/MAME.Core/Motion/konami68000Motion.cs b/MAME.Core/Motion/konami68000Motion.cs index babd94d..0fbbbff 100644 --- a/MAME.Core/Motion/konami68000Motion.cs +++ b/MAME.Core/Motion/konami68000Motion.cs @@ -1,4 +1,4 @@ -namespace MAME.Core.Motion +namespace MAME.Core { public class Konami68000Motion { diff --git a/MAME.Core/Motion/m68000Motion.cs b/MAME.Core/Motion/m68000Motion.cs index 7f6056d..42d3f78 100644 --- a/MAME.Core/Motion/m68000Motion.cs +++ b/MAME.Core/Motion/m68000Motion.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; -namespace MAME.Core.Motion +namespace MAME.Core { public class M68000Motion { diff --git a/MAME.Core/Motion/m6809Motion.cs b/MAME.Core/Motion/m6809Motion.cs index cef6beb..15de2ce 100644 --- a/MAME.Core/Motion/m6809Motion.cs +++ b/MAME.Core/Motion/m6809Motion.cs @@ -1,8 +1,7 @@ using cpu.m6809; -using mame; using System.Collections.Generic; -namespace MAME.Core.Motion +namespace MAME.Core { public partial class M6809Motion diff --git a/MAME.Core/Motion/neogeoMotion.cs b/MAME.Core/Motion/neogeoMotion.cs index 299c015..a9e2941 100644 --- a/MAME.Core/Motion/neogeoMotion.cs +++ b/MAME.Core/Motion/neogeoMotion.cs @@ -1,9 +1,6 @@ -using mame; -using System; -using System.Collections.Generic; -using System.IO; +using System.Collections.Generic; -namespace MAME.Core.Motion +namespace MAME.Core { public partial class NeogeoMotion { diff --git a/MAME.Core/Motion/z80Motion.cs b/MAME.Core/Motion/z80Motion.cs index d97c39f..4feb92c 100644 --- a/MAME.Core/Motion/z80Motion.cs +++ b/MAME.Core/Motion/z80Motion.cs @@ -1,7 +1,7 @@ using cpu.z80; using System.Collections.Generic; -namespace MAME.Core.Motion +namespace MAME.Core { public enum CPUState { diff --git a/MAME.Core/Properties/PublishProfiles/FolderProfile.pubxml.user b/MAME.Core/Properties/PublishProfiles/FolderProfile.pubxml.user index 937d72e..521b6aa 100644 --- a/MAME.Core/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/MAME.Core/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - True|2024-08-07T10:02:59.4096796Z||;False|2024-08-07T18:02:44.0239078+08:00||;True|2024-07-31T17:00:23.0585720+08:00||;True|2024-07-31T17:00:19.8123170+08:00||;True|2024-07-30T20:51:40.9773933+08:00||;True|2024-07-30T17:04:12.3440051+08:00||;True|2024-07-30T17:01:28.0849009+08:00||;True|2024-07-30T10:36:57.5301145+08:00||; + True|2024-08-28T04:54:14.9742502Z||;True|2024-08-28T12:09:37.5280942+08:00||;True|2024-08-28T12:07:03.6717540+08:00||;True|2024-08-07T18:02:59.4096796+08:00||;False|2024-08-07T18:02:44.0239078+08:00||;True|2024-07-31T17:00:23.0585720+08:00||;True|2024-07-31T17:00:19.8123170+08:00||;True|2024-07-30T20:51:40.9773933+08:00||;True|2024-07-30T17:04:12.3440051+08:00||;True|2024-07-30T17:01:28.0849009+08:00||;True|2024-07-30T10:36:57.5301145+08:00||; \ No newline at end of file diff --git a/MAME.Core/cpu/m6502/M6502.cs b/MAME.Core/cpu/m6502/M6502.cs index f591157..f801844 100644 --- a/MAME.Core/cpu/m6502/M6502.cs +++ b/MAME.Core/cpu/m6502/M6502.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; using System; using System.IO; //using System.IO; @@ -191,7 +191,7 @@ namespace cpu.m6502 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); } private void m6502_set_irq_line(int irqline, LineState state) { diff --git a/MAME.Core/cpu/m6502/Ops02.cs b/MAME.Core/cpu/m6502/Ops02.cs index d0ec0d7..83b5020 100644 --- a/MAME.Core/cpu/m6502/Ops02.cs +++ b/MAME.Core/cpu/m6502/Ops02.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; namespace cpu.m6502 { diff --git a/MAME.Core/cpu/m6800/M6800.cs b/MAME.Core/cpu/m6800/M6800.cs index dfb455f..be6a9d9 100644 --- a/MAME.Core/cpu/m6800/M6800.cs +++ b/MAME.Core/cpu/m6800/M6800.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; using System; using System.IO; @@ -26,7 +26,7 @@ namespace cpu.m6800 public byte trcsr, rmcr, rdr, tdr, rsr, tsr; public int rxbits, txbits, trcsr_read, tx; public M6800_TX_STATE txstate; - public Timer.emu_timer m6800_rx_timer, m6800_tx_timer; + public EmuTimer.emu_timer m6800_rx_timer, m6800_tx_timer; private byte TCSR_OLVL = 0x01, TCSR_IEDG = 0x02, TCSR_ETOI = 0x04, TCSR_EOCI = 0x08, TCSR_EICI = 0x10, TCSR_TOF = 0x20, TCSR_OCF = 0x40, TCSR_ICF = 0x80; protected byte M6800_WAI = 8, M6800_SLP = 0x10; private const byte M6800_IRQ_LINE = 0, M6800_TIN_LINE = 1; @@ -246,8 +246,8 @@ namespace cpu.m6800 cycles = cycles_63701; clock = 1536000; irq_callback = null; - m6800_rx_timer = Timer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false); - m6800_tx_timer = Timer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false); + m6800_rx_timer = EmuTimer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false); + m6800_tx_timer = EmuTimer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false); } public override void Reset() { @@ -844,8 +844,8 @@ namespace cpu.m6800 ram_ctrl |= 0x40; trcsr = M6800_TRCSR_TDRE; rmcr = 0; - Timer.timer_enable(m6800_rx_timer, false); - Timer.timer_enable(m6800_tx_timer, false); + EmuTimer.timer_enable(m6800_rx_timer, false); + EmuTimer.timer_enable(m6800_tx_timer, false); txstate = M6800_TX_STATE.INIT; txbits = rxbits = 0; trcsr_read = 0; @@ -905,7 +905,7 @@ namespace cpu.m6800 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); } public override int ExecuteCycles(int cycles) { @@ -1167,16 +1167,16 @@ namespace cpu.m6800 { case 0: case 3: // not implemented - Timer.timer_enable(m6800_rx_timer, false); - Timer.timer_enable(m6800_tx_timer, false); + EmuTimer.timer_enable(m6800_rx_timer, false); + EmuTimer.timer_enable(m6800_tx_timer, false); break; case 1: case 2: { int divisor = M6800_RMCR_SS[rmcr & M6800_RMCR_SS_MASK]; - Timer.timer_adjust_periodic(m6800_rx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor)))); - Timer.timer_adjust_periodic(m6800_tx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor)))); + EmuTimer.timer_adjust_periodic(m6800_rx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor)))); + EmuTimer.timer_adjust_periodic(m6800_tx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor)))); } break; } @@ -1345,8 +1345,8 @@ namespace cpu.m6800 }; clock = 1000000; irq_callback = Cpuint.cpu_3_irq_callback; - m6800_rx_timer = Timer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false); - m6800_tx_timer = Timer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false); + m6800_rx_timer = EmuTimer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false); + m6800_tx_timer = EmuTimer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false); } public override int ExecuteCycles(int cycles) { diff --git a/MAME.Core/cpu/m6800/M6800op.cs b/MAME.Core/cpu/m6800/M6800op.cs index 29b26fd..f53a0c5 100644 --- a/MAME.Core/cpu/m6800/M6800op.cs +++ b/MAME.Core/cpu/m6800/M6800op.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; namespace cpu.m6800 { diff --git a/MAME.Core/cpu/m68000/MC68000.cs b/MAME.Core/cpu/m68000/MC68000.cs index 599ae79..9d4336e 100644 --- a/MAME.Core/cpu/m68000/MC68000.cs +++ b/MAME.Core/cpu/m68000/MC68000.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; using System; using System.Globalization; using System.IO; @@ -192,7 +192,7 @@ namespace cpu.m68000 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); } public void Pulse_Reset() { diff --git a/MAME.Core/cpu/m6805/M6805.cs b/MAME.Core/cpu/m6805/M6805.cs index 1f0f997..71f9604 100644 --- a/MAME.Core/cpu/m6805/M6805.cs +++ b/MAME.Core/cpu/m6805/M6805.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; using System; using System.IO; @@ -540,7 +540,7 @@ namespace cpu.m6805 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); } public override int ExecuteCycles(int cycles) { diff --git a/MAME.Core/cpu/m6805/M6805op.cs b/MAME.Core/cpu/m6805/M6805op.cs index 3342818..f22af0d 100644 --- a/MAME.Core/cpu/m6805/M6805op.cs +++ b/MAME.Core/cpu/m6805/M6805op.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; namespace cpu.m6805 { diff --git a/MAME.Core/cpu/m6809/M6809.cs b/MAME.Core/cpu/m6809/M6809.cs index 2db435f..add419e 100644 --- a/MAME.Core/cpu/m6809/M6809.cs +++ b/MAME.Core/cpu/m6809/M6809.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; using System; using System.IO; @@ -555,7 +555,7 @@ namespace cpu.m6809 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); } public override int ExecuteCycles(int cycles) { diff --git a/MAME.Core/cpu/m6809/M6809op.cs b/MAME.Core/cpu/m6809/M6809op.cs index e1010db..614303a 100644 --- a/MAME.Core/cpu/m6809/M6809op.cs +++ b/MAME.Core/cpu/m6809/M6809op.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; namespace cpu.m6809 { diff --git a/MAME.Core/cpu/nec/Nec.cs b/MAME.Core/cpu/nec/Nec.cs index 7b3934b..4d58115 100644 --- a/MAME.Core/cpu/nec/Nec.cs +++ b/MAME.Core/cpu/nec/Nec.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; using System; using System.IO; @@ -61,7 +61,7 @@ namespace cpu.nec { if (line >= 0 && line < 35) { - Cpuint.lirq.Add(new irq(cpunum, line, state, vector, Timer.get_current_time())); + Cpuint.lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time())); int event_index = Cpuint.input_event_index[cpunum, line]++; if (event_index >= 35) { @@ -74,7 +74,7 @@ namespace cpu.nec //Cpuint.input_event_queue[cpunum][line][event_index] = input_event; //if (event_index == 0) { - Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); } } } diff --git a/MAME.Core/cpu/z80/Z80A.cs b/MAME.Core/cpu/z80/Z80A.cs index f903aae..4ae86ec 100644 --- a/MAME.Core/cpu/z80/Z80A.cs +++ b/MAME.Core/cpu/z80/Z80A.cs @@ -1,4 +1,4 @@ -using mame; +using MAME.Core; using System; using System.Globalization; using System.IO; @@ -86,7 +86,7 @@ namespace cpu.z80 public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { Atime time1; - time1 = Timer.get_current_time(); + time1 = EmuTimer.get_current_time(); bool b1 = false; foreach (irq irq1 in Cpuint.lirq) { @@ -109,7 +109,7 @@ namespace cpu.z80 } else { - Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); } } diff --git a/MAME.Core/emu/Attotime.cs b/MAME.Core/emu/Attotime.cs index b74af92..d699458 100644 --- a/MAME.Core/emu/Attotime.cs +++ b/MAME.Core/emu/Attotime.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public struct Atime { diff --git a/MAME.Core/emu/Cpuexec.cs b/MAME.Core/emu/Cpuexec.cs index be68a26..cc49d53 100644 --- a/MAME.Core/emu/Cpuexec.cs +++ b/MAME.Core/emu/Cpuexec.cs @@ -5,11 +5,10 @@ using cpu.m6805; using cpu.m6809; using cpu.nec; using cpu.z80; -using MAME.Core.Motion; using System; using System.IO; -namespace mame +namespace MAME.Core { public class cpuexec_data { @@ -26,7 +25,7 @@ namespace mame public int cycles_running; public int cycles_stolen; public int icount; - public Timer.emu_timer partial_frame_timer; + public EmuTimer.emu_timer partial_frame_timer; public Atime partial_frame_period; public virtual ulong TotalExecutedCycles { get; set; } public virtual int PendingCycles { get; set; } @@ -43,14 +42,14 @@ namespace mame public static bool b11 = true, b12 = true, b13 = true, b14 = true; public static int iloops, activecpu, icpu, ncpu, iloops2; public static cpuexec_data[] cpu; - public static Timer.emu_timer timedint_timer; + public static EmuTimer.emu_timer timedint_timer; public static Atime timedint_period, timeslice_period; public delegate void vblank_delegate(); public static vblank_delegate vblank_interrupt; public static Action vblank_interrupt2; - public static Timer.emu_timer interleave_boost_timer; - public static Timer.emu_timer interleave_boost_timer_end; - public static Timer.emu_timer timeslice_timer; + public static EmuTimer.emu_timer interleave_boost_timer; + public static EmuTimer.emu_timer interleave_boost_timer_end; + public static EmuTimer.emu_timer timeslice_timer; public static Atime perfect_interleave; public static int vblank_interrupts_per_frame; public static void cpuexec_init() @@ -2295,7 +2294,7 @@ namespace mame Generic.irq_1_0_line_hold(); if (iloops2 > 1) { - Timer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); } } public static byte null_callback1(int address) @@ -2321,12 +2320,12 @@ namespace mame case "CPS-1(QSound)": case "CPS2": timedint_period = new Atime(0, (long)(1e18 / 250)); - timedint_timer = Timer.timer_alloc_common(Generic.irq_1_0_line_hold, "irq_1_0_line_hold", false); - Timer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period); + timedint_timer = EmuTimer.timer_alloc_common(Generic.irq_1_0_line_hold, "irq_1_0_line_hold", false); + EmuTimer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period); break; case "Neo Geo": - interleave_boost_timer = Timer.timer_alloc_common(null_callback, "boost_callback", false); - interleave_boost_timer_end = Timer.timer_alloc_common(end_interleave_boost, "end_interleave_boost", false); + interleave_boost_timer = EmuTimer.timer_alloc_common(null_callback, "boost_callback", false); + interleave_boost_timer_end = EmuTimer.timer_alloc_common(end_interleave_boost, "end_interleave_boost", false); break; case "CPS1": case "Namco System 1": @@ -2372,8 +2371,8 @@ namespace mame case "bublcave11": case "bublcave10": timeslice_period = new Atime(0, Video.screenstate.frame_period / 100); - timeslice_timer = Timer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); - Timer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); + timeslice_timer = EmuTimer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); + EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); break; case "opwolf": case "opwolfa": @@ -2382,15 +2381,15 @@ namespace mame case "opwolfb": case "opwolfp": timeslice_period = new Atime(0, Video.screenstate.frame_period / 10); - timeslice_timer = Timer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); - Timer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); + timeslice_timer = EmuTimer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); + EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); break; } break; case "Taito B": timeslice_period = new Atime(0, Video.screenstate.frame_period / 10); - timeslice_timer = Timer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); - Timer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); + timeslice_timer = EmuTimer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); + EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); break; case "Capcom": switch (Machine.sName) @@ -2415,8 +2414,8 @@ namespace mame case "sfan": case "sfp": timedint_period = new Atime(0, (long)(1e18 / 8000)); - timedint_timer = Timer.timer_alloc_common(Generic.irq_2_0_line_hold, "irq_2_0_line_hold", false); - Timer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period); + timedint_timer = EmuTimer.timer_alloc_common(Generic.irq_2_0_line_hold, "irq_2_0_line_hold", false); + EmuTimer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period); break; } break; @@ -2424,8 +2423,8 @@ namespace mame } public static void cpuexec_timeslice() { - Atime target = Timer.lt[0].expire; - Atime tbase = Timer.global_basetime; + Atime target = EmuTimer.lt[0].expire; + Atime tbase = EmuTimer.global_basetime; int ran; Atime at; int i, j; @@ -2471,8 +2470,8 @@ namespace mame cpu[icpu].suspend = cpu[icpu].nextsuspend; cpu[icpu].eatcycles = cpu[icpu].nexteatcycles; } - Timer.timer_set_global_time(target); - if (Timer.global_basetime.attoseconds == 0 && Machine.mainMotion.cheatmotion.lockState == CheatMotion.LockState.LOCK_SECOND) + EmuTimer.timer_set_global_time(target); + if (EmuTimer.global_basetime.attoseconds == 0 && Machine.mainMotion.cheatmotion.lockState == CheatMotion.LockState.LOCK_SECOND) { Machine.mainMotion.cheatmotion.ApplyCheat(); } @@ -2481,9 +2480,9 @@ namespace mame { if (Attotime.attotime_compare(timeslice_time, perfect_interleave) < 0) timeslice_time = perfect_interleave; - Timer.timer_adjust_periodic(interleave_boost_timer, timeslice_time, timeslice_time); - if (!Timer.timer_enabled(interleave_boost_timer_end) || Attotime.attotime_compare(Timer.timer_timeleft(interleave_boost_timer_end), boost_duration) < 0) - Timer.timer_adjust_periodic(interleave_boost_timer_end, boost_duration, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(interleave_boost_timer, timeslice_time, timeslice_time); + if (!EmuTimer.timer_enabled(interleave_boost_timer_end) || Attotime.attotime_compare(EmuTimer.timer_timeleft(interleave_boost_timer_end), boost_duration) < 0) + EmuTimer.timer_adjust_periodic(interleave_boost_timer_end, boost_duration, Attotime.ATTOTIME_NEVER); } public static void activecpu_abort_timeslice(int cpunum) { @@ -2564,7 +2563,7 @@ namespace mame case "CPS2": iloops = 0; CPS.cps2_interrupt(); - Timer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); break; case "Data East": Generic.nmi_line_pulse0(); @@ -2573,7 +2572,7 @@ namespace mame iloops = 0; vblank_interrupt(); Tehkan.pbaction_interrupt(); - Timer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); break; case "Neo Geo": break; @@ -2581,8 +2580,8 @@ namespace mame iloops = 0; iloops2 = 0; Generic.irq_1_0_line_hold(); - Timer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); - Timer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); break; case "Namco System 1": for (int cpunum = 0; cpunum < ncpu; cpunum++) @@ -2606,7 +2605,7 @@ namespace mame case "drgnwrldv40k": iloops = 0; IGS011.lhb2_interrupt(); - Timer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); break; case "lhb": case "lhbv33c": @@ -2614,7 +2613,7 @@ namespace mame case "ryukobou": iloops = 0; IGS011.lhb_interrupt(); - Timer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); break; } break; @@ -2624,7 +2623,7 @@ namespace mame case "M72": iloops = 0; vblank_interrupt(); - Timer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); break; case "M92": break; @@ -2677,7 +2676,7 @@ namespace mame } iloops = 0; vblank_interrupt(); - Timer.timer_adjust_periodic(Cpuexec.cpu[3].partial_frame_timer, Cpuexec.cpu[3].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[3].partial_frame_timer, Cpuexec.cpu[3].partial_frame_period, Attotime.ATTOTIME_NEVER); break; case "opwolf": case "opwolfa": @@ -2714,7 +2713,7 @@ namespace mame case "cuebrick": iloops = 0; vblank_interrupt(); - Timer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); break; default: vblank_interrupt(); @@ -2741,7 +2740,7 @@ namespace mame } iloops = 0; vblank_interrupt(); - Timer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); break; case "sf": case "sfua": @@ -2772,7 +2771,7 @@ namespace mame vblank_interrupt(); if (iloops > 1) { - Timer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); } break; case "Tehkan": @@ -2784,7 +2783,7 @@ namespace mame Tehkan.pbaction_interrupt(); if (iloops > 1) { - Timer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); } break; case "SunA8": @@ -2796,7 +2795,7 @@ namespace mame SunA8.hardhea2_interrupt(); if (iloops > 1) { - Timer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[0].partial_frame_timer, Cpuexec.cpu[0].partial_frame_period, Attotime.ATTOTIME_NEVER); } break; case "M72": @@ -2808,7 +2807,7 @@ namespace mame vblank_interrupt(); if (iloops > 1) { - Timer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); } break; case "Taito": @@ -2823,7 +2822,7 @@ namespace mame vblank_interrupt(); if (iloops > 1) { - Timer.timer_adjust_periodic(Cpuexec.cpu[3].partial_frame_timer, Cpuexec.cpu[3].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[3].partial_frame_timer, Cpuexec.cpu[3].partial_frame_period, Attotime.ATTOTIME_NEVER); } break; } @@ -2850,7 +2849,7 @@ namespace mame vblank_interrupt(); if (iloops > 1) { - Timer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(Cpuexec.cpu[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER); } break; } @@ -2863,7 +2862,7 @@ namespace mame } public static void end_interleave_boost() { - Timer.timer_adjust_periodic(interleave_boost_timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(interleave_boost_timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); } public static void compute_perfect_interleave() { diff --git a/MAME.Core/emu/Cpuint.cs b/MAME.Core/emu/Cpuint.cs index de9d903..8878c73 100644 --- a/MAME.Core/emu/Cpuint.cs +++ b/MAME.Core/emu/Cpuint.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; -namespace mame +namespace MAME.Core { [StructLayout(LayoutKind.Explicit)] [Serializable()] @@ -134,7 +134,7 @@ namespace mame public static void cpunum_set_input_line(int cpunum, int line, LineState state) { int vector = (line >= 0 && line < 35) ? interrupt_vector[cpunum, line] : 0xff; - lirq.Add(new irq(cpunum, line, state, vector, Timer.get_current_time())); + lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time())); Cpuexec.cpu[cpunum].cpunum_set_input_line_and_vector(cpunum, line, state, vector); } public static void cpunum_set_input_line_vector(int cpunum, int line, int vector) @@ -149,8 +149,8 @@ namespace mame { if (line >= 0 && line < 35) { - lirq.Add(new irq(cpunum, line, state, vector, Timer.get_current_time())); - Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time())); + EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); } } public static void cpunum_empty_event_queue() @@ -162,7 +162,7 @@ namespace mame } foreach (irq irq1 in lirq) { - if (Attotime.attotime_compare(irq1.time, Timer.global_basetime) <= 0) + if (Attotime.attotime_compare(irq1.time, EmuTimer.global_basetime) <= 0) { input_line_state[irq1.cpunum, irq1.line] = (byte)irq1.state; input_line_vector[irq1.cpunum, irq1.line] = irq1.vector; diff --git a/MAME.Core/emu/Crosshair.cs b/MAME.Core/emu/Crosshair.cs index 8887564..9871280 100644 --- a/MAME.Core/emu/Crosshair.cs +++ b/MAME.Core/emu/Crosshair.cs @@ -1,7 +1,4 @@ - -using Color = MAME.Core.AxiBitmap.AxiColor; - -namespace mame +namespace MAME.Core { public class Crosshair { diff --git a/MAME.Core/emu/Drawgfx.cs b/MAME.Core/emu/Drawgfx.cs index bd9af78..0307951 100644 --- a/MAME.Core/emu/Drawgfx.cs +++ b/MAME.Core/emu/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/emu/Eeprom.cs b/MAME.Core/emu/Eeprom.cs index ec77b52..79ba32e 100644 --- a/MAME.Core/emu/Eeprom.cs +++ b/MAME.Core/emu/Eeprom.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { /*public enum eeprom_command { diff --git a/MAME.Core/emu/Timer.cs b/MAME.Core/emu/EmuTimer.cs similarity index 99% rename from MAME.Core/emu/Timer.cs rename to MAME.Core/emu/EmuTimer.cs index 654fb26..2fc4189 100644 --- a/MAME.Core/emu/Timer.cs +++ b/MAME.Core/emu/EmuTimer.cs @@ -3,9 +3,9 @@ using System; using System.Collections.Generic; using System.IO; -namespace mame +namespace MAME.Core { - public class Timer + public class EmuTimer { public static List lt; private static List lt2; diff --git a/MAME.Core/emu/Gdi.cs b/MAME.Core/emu/Gdi.cs index 0cd2a03..6f97cc4 100644 --- a/MAME.Core/emu/Gdi.cs +++ b/MAME.Core/emu/Gdi.cs @@ -1,9 +1,8 @@ using MAME.Core.AxiBitmap; using System; -using static MAME.Core.AxiBitmap.AxiBitmapEx; using Color = MAME.Core.AxiBitmap.AxiColor; -namespace mame +namespace MAME.Core { partial class Video { diff --git a/MAME.Core/emu/Generic.cs b/MAME.Core/emu/Generic.cs index 41878c7..d92bfe4 100644 --- a/MAME.Core/emu/Generic.cs +++ b/MAME.Core/emu/Generic.cs @@ -1,7 +1,7 @@ using cpu.m68000; using System; -namespace mame +namespace MAME.Core { public class Generic { @@ -157,7 +157,7 @@ namespace mame if (enabled == 0) { objcpunum = cpunum; - Timer.timer_set_internal(clear_all_lines, "clear_all_lines"); + EmuTimer.timer_set_internal(clear_all_lines, "clear_all_lines"); } } public static void interrupt_enable_w(byte data) diff --git a/MAME.Core/emu/Inptport.cs b/MAME.Core/emu/Inptport.cs index 6bf8063..72091fd 100644 --- a/MAME.Core/emu/Inptport.cs +++ b/MAME.Core/emu/Inptport.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public class analog_field_state { @@ -564,7 +564,7 @@ namespace mame value = analog.accum; if (analog.interpolate && portdata.last_delta_nsec != 0) { - nsec_since_last = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(Timer.get_current_time(), portdata.last_frame_time)) / Attotime.ATTOSECONDS_PER_NANOSECOND; + nsec_since_last = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(EmuTimer.get_current_time(), portdata.last_frame_time)) / Attotime.ATTOSECONDS_PER_NANOSECOND; value = (int)(analog.previous + ((long)(analog.accum - analog.previous) * nsec_since_last / portdata.last_delta_nsec)); } result = (uint)apply_analog_settings(value, analog); @@ -600,7 +600,7 @@ namespace mame } private static void frame_update() { - Atime curtime = Timer.get_current_time(); + Atime curtime = EmuTimer.get_current_time(); portdata.last_delta_nsec = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(curtime, portdata.last_frame_time)) / Attotime.ATTOSECONDS_PER_NANOSECOND; portdata.last_frame_time = curtime; if (Mame.playState != Mame.PlayState.PLAY_REPLAYRUNNING) diff --git a/MAME.Core/emu/KeyStruct.cs b/MAME.Core/emu/KeyStruct.cs index cd37985..732fae4 100644 --- a/MAME.Core/emu/KeyStruct.cs +++ b/MAME.Core/emu/KeyStruct.cs @@ -1,7 +1,7 @@ -using MAME.Core.run_interface; +using MAME.Core; using System.Collections.Generic; -namespace mame +namespace MAME.Core { public partial class Inptport { diff --git a/MAME.Core/emu/Keyboard.cs b/MAME.Core/emu/Keyboard.cs index 05cdc50..4732629 100644 --- a/MAME.Core/emu/Keyboard.cs +++ b/MAME.Core/emu/Keyboard.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public class Keyboard { @@ -22,7 +22,7 @@ namespace mame mKeyboard = ikb; } - public static bool IsPressed(MotionKey key) + public static bool IsPressed(MotionKey key) { return m_KeyStates[(int)key].IsPressed; } @@ -62,7 +62,7 @@ namespace mame m_KeyStates[i].IsTriggered = false; } } - + } } } \ No newline at end of file diff --git a/MAME.Core/emu/Machine.cs b/MAME.Core/emu/Machine.cs index 7902978..bc2c1c9 100644 --- a/MAME.Core/emu/Machine.cs +++ b/MAME.Core/emu/Machine.cs @@ -1,8 +1,7 @@ -using MAME.Core.Motion; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; -namespace mame +namespace MAME.Core { public class Machine { diff --git a/MAME.Core/emu/Mame.cs b/MAME.Core/emu/Mame.cs index 65d8f07..147a578 100644 --- a/MAME.Core/emu/Mame.cs +++ b/MAME.Core/emu/Mame.cs @@ -1,8 +1,7 @@ -using MAME.Core.Motion; -using MAME.Core.run_interface; +using MAME.Core; using System.IO; -namespace mame +namespace MAME.Core { public class Mame { @@ -22,7 +21,7 @@ namespace mame public static PlayState playState; public static bool is_foreground; public static bool paused, exit_pending; - public static Timer.emu_timer soft_reset_timer; + public static EmuTimer.emu_timer soft_reset_timer; public static BinaryReader brRecord = null; public static BinaryWriter bwRecord = null; public static bool bPP = true; @@ -88,7 +87,7 @@ namespace mame public static void mame_schedule_soft_reset() { - Timer.timer_adjust_periodic(soft_reset_timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(soft_reset_timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); mame_pause(false); if (Cpuexec.activecpu >= 0) { @@ -136,8 +135,8 @@ namespace mame Inptport.input_init(); Palette.palette_init(); Generic.generic_machine_init(); - Timer.timer_init(); - soft_reset_timer = Timer.timer_alloc_common(soft_reset, "soft_reset", false); + EmuTimer.timer_init(); + soft_reset_timer = EmuTimer.timer_alloc_common(soft_reset, "soft_reset", false); Window.osd_init(); Inptport.input_port_init(); Cpuexec.cpuexec_init(); @@ -174,7 +173,7 @@ namespace mame Watchdog.watchdog_internal_reset(); Sound.sound_reset(); playState = PlayState.PLAY_RUNNING; - Timer.timer_set_global_time(Timer.get_current_time()); + EmuTimer.timer_set_global_time(EmuTimer.get_current_time()); } private static void handle_save() { diff --git a/MAME.Core/emu/Memory.cs b/MAME.Core/emu/Memory.cs index 5e49334..38daf39 100644 --- a/MAME.Core/emu/Memory.cs +++ b/MAME.Core/emu/Memory.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public class Memory { diff --git a/MAME.Core/emu/Motion.cs b/MAME.Core/emu/Motion.cs index 449e82a..1a32963 100644 --- a/MAME.Core/emu/Motion.cs +++ b/MAME.Core/emu/Motion.cs @@ -1,7 +1,6 @@ -using MAME.Core.Motion; -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { /// /// 原依赖Form的内容 diff --git a/MAME.Core/emu/Mouse.cs b/MAME.Core/emu/Mouse.cs index 93ac8f4..aeaade3 100644 --- a/MAME.Core/emu/Mouse.cs +++ b/MAME.Core/emu/Mouse.cs @@ -1,7 +1,6 @@ -using MAME.Core.Motion; -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public class Mouse { diff --git a/MAME.Core/emu/Palette.cs b/MAME.Core/emu/Palette.cs index 7173a1e..1058574 100644 --- a/MAME.Core/emu/Palette.cs +++ b/MAME.Core/emu/Palette.cs @@ -1,7 +1,7 @@ using MAME.Core.AxiBitmap; using Color = MAME.Core.AxiBitmap.AxiColor; -namespace mame +namespace MAME.Core { public class Palette { diff --git a/MAME.Core/emu/Pd4900a.cs b/MAME.Core/emu/Pd4900a.cs index e9051e2..5e6b23f 100644 --- a/MAME.Core/emu/Pd4900a.cs +++ b/MAME.Core/emu/Pd4900a.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class Pd4900a { diff --git a/MAME.Core/emu/RomInfo.cs b/MAME.Core/emu/RomInfo.cs index 9c8f350..43947a4 100644 --- a/MAME.Core/emu/RomInfo.cs +++ b/MAME.Core/emu/RomInfo.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; -namespace mame +namespace MAME.Core { public class RomInfo { public static List romList; - public static Dictionary dictName2Rom; + public static Dictionary dictName2Rom; public static RomInfo Rom; public string Name, Board; public string Parent; diff --git a/MAME.Core/emu/State.cs b/MAME.Core/emu/State.cs index 06222f2..2f9421f 100644 --- a/MAME.Core/emu/State.cs +++ b/MAME.Core/emu/State.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class State { diff --git a/MAME.Core/emu/Tilemap.cs b/MAME.Core/emu/Tilemap.cs index fc73794..0e4c8b1 100644 --- a/MAME.Core/emu/Tilemap.cs +++ b/MAME.Core/emu/Tilemap.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace mame +namespace MAME.Core { enum trans_t { diff --git a/MAME.Core/emu/Video.cs b/MAME.Core/emu/Video.cs index 85bc05f..83c89e5 100644 --- a/MAME.Core/emu/Video.cs +++ b/MAME.Core/emu/Video.cs @@ -1,10 +1,9 @@ -using MAME.Core.Motion; -using MAME.Core.run_interface; +using MAME.Core; using System; using System.IO; using System.Runtime.InteropServices; -namespace mame +namespace MAME.Core { public struct screen_state { @@ -28,8 +27,8 @@ namespace mame public static screen_state screenstate; public static int video_attributes; private static int PAUSED_REFRESH_RATE = 30, VIDEO_UPDATE_AFTER_VBLANK = 4; - public static Timer.emu_timer vblank_begin_timer, vblank_end_timer; - public static Timer.emu_timer scanline0_timer, scanline_timer; + public static EmuTimer.emu_timer vblank_begin_timer, vblank_end_timer; + public static EmuTimer.emu_timer scanline0_timer, scanline_timer; private static Atime throttle_emutime, throttle_realtime, speed_last_emutime, overall_emutime; private static long throttle_last_ticks; private static long average_oversleep; @@ -652,11 +651,11 @@ namespace mame - vblank_begin_timer = Timer.timer_alloc_common(vblank_begin_callback, "vblank_begin_callback", false); - Timer.timer_adjust_periodic(vblank_begin_timer, video_screen_get_time_until_vblank_start(), Attotime.ATTOTIME_NEVER); - scanline0_timer = Timer.timer_alloc_common(scanline0_callback, "scanline0_callback", false); - Timer.timer_adjust_periodic(scanline0_timer, video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); - vblank_end_timer = Timer.timer_alloc_common(vblank_end_callback, "vblank_end_callback", false); + vblank_begin_timer = EmuTimer.timer_alloc_common(vblank_begin_callback, "vblank_begin_callback", false); + EmuTimer.timer_adjust_periodic(vblank_begin_timer, video_screen_get_time_until_vblank_start(), Attotime.ATTOTIME_NEVER); + scanline0_timer = EmuTimer.timer_alloc_common(scanline0_callback, "scanline0_callback", false); + EmuTimer.timer_adjust_periodic(scanline0_timer, video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + vblank_end_timer = EmuTimer.timer_alloc_common(vblank_end_callback, "vblank_end_callback", false); switch (Machine.sBoard) { case "CPS-1": @@ -667,19 +666,19 @@ namespace mame break; case "CPS2": Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 262); - Cpuexec.cpu[0].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); break; case "Tehkan": Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 2); - Cpuexec.cpu[1].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); break; case "Neo Geo": break; case "SunA8": Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 0x100); - Cpuexec.cpu[0].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 4); - Cpuexec.cpu[1].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger2, "trigger2", false); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger2, "trigger2", false); break; case "IGS011": switch (Machine.sName) @@ -694,27 +693,27 @@ namespace mame case "drgnwrldv40k": case "lhb2": Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 5); - Cpuexec.cpu[0].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); break; case "lhb": case "lhbv33c": case "dbc": case "ryukobou": Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 4); - Cpuexec.cpu[0].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); break; } break; case "M72": Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 128); - Cpuexec.cpu[1].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); break; case "Taito": switch (Machine.sName) { case "bub68705": Cpuexec.cpu[3].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 2); - Cpuexec.cpu[3].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[3].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); break; } break; @@ -723,7 +722,7 @@ namespace mame { case "cuebrick": Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 10); - Cpuexec.cpu[0].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); break; } break; @@ -742,7 +741,7 @@ namespace mame case "makaimurg": case "diamond": Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 4); - Cpuexec.cpu[1].partial_frame_timer = Timer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); break; } break; @@ -792,7 +791,7 @@ namespace mame } public static int video_screen_get_vpos() { - long delta = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(Timer.get_current_time(), screenstate.vblank_start_time)); + long delta = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(EmuTimer.get_current_time(), screenstate.vblank_start_time)); int vpos; delta += screenstate.pixeltime / 2; vpos = (int)(delta / screenstate.scantime); @@ -800,11 +799,11 @@ namespace mame } public static bool video_screen_get_vblank() { - return (Attotime.attotime_compare(Timer.get_current_time(), screenstate.vblank_end_time) < 0); + return (Attotime.attotime_compare(EmuTimer.get_current_time(), screenstate.vblank_end_time) < 0); } public static Atime video_screen_get_time_until_pos(int vpos, int hpos) { - long curdelta = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(Timer.get_current_time(), screenstate.vblank_start_time)); + long curdelta = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(EmuTimer.get_current_time(), screenstate.vblank_start_time)); long targetdelta; vpos += screenstate.height - (screenstate.visarea.max_y + 1); vpos %= screenstate.height; @@ -822,7 +821,7 @@ namespace mame public static Atime video_screen_get_time_until_vblank_end() { Atime ret; - Atime current_time = Timer.get_current_time(); + Atime current_time = EmuTimer.get_current_time(); if (video_screen_get_vblank()) { ret = Attotime.attotime_sub(screenstate.vblank_end_time, current_time); @@ -843,21 +842,21 @@ namespace mame } public static void vblank_begin_callback() { - screenstate.vblank_start_time = Timer.global_basetime;// Timer.get_current_time(); + screenstate.vblank_start_time = EmuTimer.global_basetime;// Timer.get_current_time(); screenstate.vblank_end_time = Attotime.attotime_add_attoseconds(screenstate.vblank_start_time, screenstate.vblank_period); Cpuexec.on_vblank(); if ((video_attributes & VIDEO_UPDATE_AFTER_VBLANK) == 0) { video_frame_update(); } - Timer.timer_adjust_periodic(vblank_begin_timer, video_screen_get_time_until_vblank_start(), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(vblank_begin_timer, video_screen_get_time_until_vblank_start(), Attotime.ATTOTIME_NEVER); if (screenstate.vblank_period == 0) { vblank_end_callback(); } else { - Timer.timer_adjust_periodic(vblank_end_timer, video_screen_get_time_until_vblank_end(), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(vblank_end_timer, video_screen_get_time_until_vblank_end(), Attotime.ATTOTIME_NEVER); } } public static void vblank_end_callback() @@ -871,7 +870,7 @@ namespace mame public static void scanline0_callback() { screenstate.last_partial_scan = 0; - Timer.timer_adjust_periodic(scanline0_timer, video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(scanline0_timer, video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); } public static void scanline_update_callback() { @@ -883,11 +882,11 @@ namespace mame scanline = screenstate.visarea.min_y; } scanline_param = scanline; - Timer.timer_adjust_periodic(scanline_timer, video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(scanline_timer, video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); } public static void video_frame_update() { - Atime current_time = Timer.global_basetime; + Atime current_time = EmuTimer.global_basetime; if (!Mame.paused) { finish_screen_updates(); diff --git a/MAME.Core/emu/Watchdog.cs b/MAME.Core/emu/Watchdog.cs index 1663d3e..3c908c9 100644 --- a/MAME.Core/emu/Watchdog.cs +++ b/MAME.Core/emu/Watchdog.cs @@ -1,13 +1,13 @@ -namespace mame +namespace MAME.Core { public class Watchdog { public static bool watchdog_enabled; - public static Timer.emu_timer watchdog_timer; + public static EmuTimer.emu_timer watchdog_timer; public static Atime watchdog_time; public static void watchdog_init() { - watchdog_timer = Timer.timer_alloc_common(watchdog_callback, "watchdog_callback", false); + watchdog_timer = EmuTimer.timer_alloc_common(watchdog_callback, "watchdog_callback", false); switch (Machine.sBoard) { case "CPS-1": @@ -45,15 +45,15 @@ { if (!watchdog_enabled) { - Timer.timer_adjust_periodic(watchdog_timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(watchdog_timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); } else if (Attotime.attotime_compare(watchdog_time, Attotime.ATTOTIME_ZERO) != 0) { - Timer.timer_adjust_periodic(watchdog_timer, watchdog_time, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(watchdog_timer, watchdog_time, Attotime.ATTOTIME_NEVER); } else { - Timer.timer_adjust_periodic(watchdog_timer, new Atime(3, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(watchdog_timer, new Atime(3, 0), Attotime.ATTOTIME_NEVER); } } } diff --git a/MAME.Core/emu/Window.cs b/MAME.Core/emu/Window.cs index 6b9f652..9d02d57 100644 --- a/MAME.Core/emu/Window.cs +++ b/MAME.Core/emu/Window.cs @@ -1,6 +1,4 @@ -using MAME.Core.Motion; - -namespace mame +namespace MAME.Core { public class Window { diff --git a/MAME.Core/emu/Wintime.cs b/MAME.Core/emu/Wintime.cs index 3c56aad..c109aa4 100644 --- a/MAME.Core/emu/Wintime.cs +++ b/MAME.Core/emu/Wintime.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Threading; -namespace mame +namespace MAME.Core { public class Wintime { diff --git a/MAME.Core/mame/capcom/Capcom.cs b/MAME.Core/mame/capcom/Capcom.cs index a84a16a..1ba4059 100644 --- a/MAME.Core/mame/capcom/Capcom.cs +++ b/MAME.Core/mame/capcom/Capcom.cs @@ -1,6 +1,6 @@ using cpu.m68000; -namespace mame +namespace MAME.Core { public partial class Capcom { diff --git a/MAME.Core/mame/capcom/Drawgfx.cs b/MAME.Core/mame/capcom/Drawgfx.cs index 4f84627..f090f15 100644 --- a/MAME.Core/mame/capcom/Drawgfx.cs +++ b/MAME.Core/mame/capcom/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/capcom/Gng.cs b/MAME.Core/mame/capcom/Gng.cs index 3d3633c..b3889a2 100644 --- a/MAME.Core/mame/capcom/Gng.cs +++ b/MAME.Core/mame/capcom/Gng.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Capcom { diff --git a/MAME.Core/mame/capcom/Input.cs b/MAME.Core/mame/capcom/Input.cs index cea9068..1970abd 100644 --- a/MAME.Core/mame/capcom/Input.cs +++ b/MAME.Core/mame/capcom/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class Capcom { diff --git a/MAME.Core/mame/capcom/Memory.cs b/MAME.Core/mame/capcom/Memory.cs index f5e2782..91581c9 100644 --- a/MAME.Core/mame/capcom/Memory.cs +++ b/MAME.Core/mame/capcom/Memory.cs @@ -1,6 +1,6 @@ using cpu.z80; -namespace mame +namespace MAME.Core { public partial class Capcom { diff --git a/MAME.Core/mame/capcom/State.cs b/MAME.Core/mame/capcom/State.cs index 99d4115..d0af37c 100644 --- a/MAME.Core/mame/capcom/State.cs +++ b/MAME.Core/mame/capcom/State.cs @@ -3,7 +3,7 @@ using cpu.m6809; using cpu.z80; using System.IO; -namespace mame +namespace MAME.Core { public partial class Capcom { @@ -30,12 +30,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer); AY8910.AA8910[1].SaveStateBinary(writer); YM2203.FF2203[0].SaveStateBinary(writer); @@ -76,12 +76,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader); AY8910.AA8910[1].LoadStateBinary(reader); YM2203.FF2203[0].LoadStateBinary(reader); @@ -130,12 +130,12 @@ namespace mame Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[1].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); MSM5205.mm1[0].SaveStateBinary(writer); MSM5205.mm1[1].SaveStateBinary(writer); @@ -179,12 +179,12 @@ namespace mame Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[1].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); MSM5205.mm1[0].LoadStateBinary(reader); MSM5205.mm1[1].LoadStateBinary(reader); diff --git a/MAME.Core/mame/capcom/Tilemap.cs b/MAME.Core/mame/capcom/Tilemap.cs index b0bc7d6..6ec6620 100644 --- a/MAME.Core/mame/capcom/Tilemap.cs +++ b/MAME.Core/mame/capcom/Tilemap.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace mame +namespace MAME.Core { public partial class Capcom { diff --git a/MAME.Core/mame/capcom/Video.cs b/MAME.Core/mame/capcom/Video.cs index b00b025..ff7042f 100644 --- a/MAME.Core/mame/capcom/Video.cs +++ b/MAME.Core/mame/capcom/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Capcom { diff --git a/MAME.Core/mame/cps/CPS.cs b/MAME.Core/mame/cps/CPS.cs index b341368..dcfab11 100644 --- a/MAME.Core/mame/cps/CPS.cs +++ b/MAME.Core/mame/cps/CPS.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace mame +namespace MAME.Core { public partial class CPS { diff --git a/MAME.Core/mame/cps/Drawgfx.cs b/MAME.Core/mame/cps/Drawgfx.cs index 6fbc758..279d1a0 100644 --- a/MAME.Core/mame/cps/Drawgfx.cs +++ b/MAME.Core/mame/cps/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/cps/Input.cs b/MAME.Core/mame/cps/Input.cs index 79f0d6b..e36a466 100644 --- a/MAME.Core/mame/cps/Input.cs +++ b/MAME.Core/mame/cps/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class CPS { @@ -1468,7 +1468,7 @@ namespace mame } Inptport.bReplayRead = false; } - if (Attotime.attotime_compare(Timer.global_basetime, Timer.global_basetime_obj) == 0) + if (Attotime.attotime_compare(EmuTimer.global_basetime, EmuTimer.global_basetime_obj) == 0) { short0 = short0_old; short1 = short1_old; diff --git a/MAME.Core/mame/cps/Memory.cs b/MAME.Core/mame/cps/Memory.cs index 2dcbce5..dc93efb 100644 --- a/MAME.Core/mame/cps/Memory.cs +++ b/MAME.Core/mame/cps/Memory.cs @@ -1,6 +1,6 @@ using cpu.z80; -namespace mame +namespace MAME.Core { public partial class CPS { diff --git a/MAME.Core/mame/cps/Memory2.cs b/MAME.Core/mame/cps/Memory2.cs index 39d9eef..942a69d 100644 --- a/MAME.Core/mame/cps/Memory2.cs +++ b/MAME.Core/mame/cps/Memory2.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class CPS { diff --git a/MAME.Core/mame/cps/State.cs b/MAME.Core/mame/cps/State.cs index c09f9e2..5aedc36 100644 --- a/MAME.Core/mame/cps/State.cs +++ b/MAME.Core/mame/cps/State.cs @@ -2,7 +2,7 @@ using cpu.z80; using System.IO; -namespace mame +namespace MAME.Core { public partial class CPS { @@ -31,8 +31,8 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); writer.Write(Video.screenstate.frame_number); writer.Write(Sound.last_update_second); for (i = 0; i < 2; i++) @@ -44,7 +44,7 @@ namespace mame writer.Write(Cpuexec.cpu[i].localtime.seconds); writer.Write(Cpuexec.cpu[i].localtime.attoseconds); } - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); OKI6295.SaveStateBinary(writer); for (i = 0; i < 2; i++) @@ -101,8 +101,8 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); writer.Write(Video.screenstate.frame_number); writer.Write(Sound.last_update_second); for (i = 0; i < 2; i++) @@ -114,7 +114,7 @@ namespace mame writer.Write(Cpuexec.cpu[i].localtime.seconds); writer.Write(Cpuexec.cpu[i].localtime.attoseconds); } - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); writer.Write(qsound_sharedram1); writer.Write(qsound_sharedram2); QSound.SaveStateBinary(writer); @@ -164,8 +164,8 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); writer.Write(Video.screenstate.frame_number); writer.Write(Sound.last_update_second); for (i = 0; i < 2; i++) @@ -177,7 +177,7 @@ namespace mame writer.Write(Cpuexec.cpu[i].localtime.seconds); writer.Write(Cpuexec.cpu[i].localtime.attoseconds); } - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); writer.Write(qsound_sharedram1); writer.Write(qsound_sharedram2); QSound.SaveStateBinary(writer); @@ -212,8 +212,8 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64(); Sound.last_update_second = reader.ReadInt32(); for (i = 0; i < 2; i++) @@ -225,7 +225,7 @@ namespace mame Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); } - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); OKI6295.LoadStateBinary(reader); for (i = 0; i < 2; i++) @@ -282,8 +282,8 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64(); Sound.last_update_second = reader.ReadInt32(); for (i = 0; i < 2; i++) @@ -295,7 +295,7 @@ namespace mame Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); } - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); qsound_sharedram1 = reader.ReadBytes(0x1000); qsound_sharedram2 = reader.ReadBytes(0x1000); QSound.LoadStateBinary(reader); @@ -345,8 +345,8 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64(); Sound.last_update_second = reader.ReadInt32(); for (i = 0; i < 2; i++) @@ -358,7 +358,7 @@ namespace mame Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); } - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); qsound_sharedram1 = reader.ReadBytes(0x1000); qsound_sharedram2 = reader.ReadBytes(0x1000); QSound.LoadStateBinary(reader); diff --git a/MAME.Core/mame/cps/Tilemap.cs b/MAME.Core/mame/cps/Tilemap.cs index d539272..3996990 100644 --- a/MAME.Core/mame/cps/Tilemap.cs +++ b/MAME.Core/mame/cps/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class CPS { diff --git a/MAME.Core/mame/cps/Video.cs b/MAME.Core/mame/cps/Video.cs index 37223f8..c14f01e 100644 --- a/MAME.Core/mame/cps/Video.cs +++ b/MAME.Core/mame/cps/Video.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace mame +namespace MAME.Core { public partial class CPS { diff --git a/MAME.Core/mame/dataeast/Drawgfx.cs b/MAME.Core/mame/dataeast/Drawgfx.cs index b2dda01..843e6a9 100644 --- a/MAME.Core/mame/dataeast/Drawgfx.cs +++ b/MAME.Core/mame/dataeast/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/dataeast/Input.cs b/MAME.Core/mame/dataeast/Input.cs index 3847af1..6612783 100644 --- a/MAME.Core/mame/dataeast/Input.cs +++ b/MAME.Core/mame/dataeast/Input.cs @@ -1,7 +1,7 @@ -using MAME.Core.run_interface; +using MAME.Core; using System.Collections.Generic; -namespace mame +namespace MAME.Core { public partial class Dataeast { diff --git a/MAME.Core/mame/dataeast/Memory.cs b/MAME.Core/mame/dataeast/Memory.cs index a6f13c0..2f28b40 100644 --- a/MAME.Core/mame/dataeast/Memory.cs +++ b/MAME.Core/mame/dataeast/Memory.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Dataeast { diff --git a/MAME.Core/mame/dataeast/Pcktgal.cs b/MAME.Core/mame/dataeast/Pcktgal.cs index 55e527a..ca4f5f8 100644 --- a/MAME.Core/mame/dataeast/Pcktgal.cs +++ b/MAME.Core/mame/dataeast/Pcktgal.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Dataeast { diff --git a/MAME.Core/mame/dataeast/State.cs b/MAME.Core/mame/dataeast/State.cs index e9067e9..0ffad93 100644 --- a/MAME.Core/mame/dataeast/State.cs +++ b/MAME.Core/mame/dataeast/State.cs @@ -1,7 +1,7 @@ using cpu.m6502; using System.IO; -namespace mame +namespace MAME.Core { public partial class Dataeast { @@ -25,12 +25,12 @@ namespace mame M6502.mm1[0].SaveStateBinary(writer); M6502.mm1[1].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer); YM2203.FF2203[0].SaveStateBinary(writer); YM3812.SaveStateBinary(writer); @@ -68,12 +68,12 @@ namespace mame M6502.mm1[0].LoadStateBinary(reader); M6502.mm1[1].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader); YM2203.FF2203[0].LoadStateBinary(reader); YM3812.LoadStateBinary(reader); diff --git a/MAME.Core/mame/dataeast/Tilemap.cs b/MAME.Core/mame/dataeast/Tilemap.cs index 4ce5d6d..b38def3 100644 --- a/MAME.Core/mame/dataeast/Tilemap.cs +++ b/MAME.Core/mame/dataeast/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Dataeast { diff --git a/MAME.Core/mame/dataeast/Video.cs b/MAME.Core/mame/dataeast/Video.cs index b8d700e..fe98727 100644 --- a/MAME.Core/mame/dataeast/Video.cs +++ b/MAME.Core/mame/dataeast/Video.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Dataeast { diff --git a/MAME.Core/mame/igs011/IGS011.cs b/MAME.Core/mame/igs011/IGS011.cs index 0afd299..8fd1576 100644 --- a/MAME.Core/mame/igs011/IGS011.cs +++ b/MAME.Core/mame/igs011/IGS011.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class IGS011 { diff --git a/MAME.Core/mame/igs011/Input.cs b/MAME.Core/mame/igs011/Input.cs index 7d8c483..228ab14 100644 --- a/MAME.Core/mame/igs011/Input.cs +++ b/MAME.Core/mame/igs011/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class IGS011 { diff --git a/MAME.Core/mame/igs011/Machine.cs b/MAME.Core/mame/igs011/Machine.cs index 8df8abf..38fe7d2 100644 --- a/MAME.Core/mame/igs011/Machine.cs +++ b/MAME.Core/mame/igs011/Machine.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class IGS011 { diff --git a/MAME.Core/mame/igs011/Memory.cs b/MAME.Core/mame/igs011/Memory.cs index 3ee3e9e..9db2224 100644 --- a/MAME.Core/mame/igs011/Memory.cs +++ b/MAME.Core/mame/igs011/Memory.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class IGS011 { diff --git a/MAME.Core/mame/igs011/Memory2.cs b/MAME.Core/mame/igs011/Memory2.cs index 5a0887b..c25a1db 100644 --- a/MAME.Core/mame/igs011/Memory2.cs +++ b/MAME.Core/mame/igs011/Memory2.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class IGS011 { diff --git a/MAME.Core/mame/igs011/State.cs b/MAME.Core/mame/igs011/State.cs index cb59e7d..6343ac4 100644 --- a/MAME.Core/mame/igs011/State.cs +++ b/MAME.Core/mame/igs011/State.cs @@ -1,7 +1,7 @@ using cpu.m68000; using System.IO; -namespace mame +namespace MAME.Core { public partial class IGS011 { @@ -59,12 +59,12 @@ namespace mame writer.Write(blitter.flags); MC68000.m1.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); OKI6295.SaveStateBinary(writer); YM3812.SaveStateBinary(writer); writer.Write(Sound.okistream.output_sampindex); @@ -128,12 +128,12 @@ namespace mame blitter.flags = reader.ReadUInt16(); MC68000.m1.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); OKI6295.LoadStateBinary(reader); YM3812.LoadStateBinary(reader); Sound.okistream.output_sampindex = reader.ReadInt32(); diff --git a/MAME.Core/mame/igs011/Video.cs b/MAME.Core/mame/igs011/Video.cs index 236ad04..5582262 100644 --- a/MAME.Core/mame/igs011/Video.cs +++ b/MAME.Core/mame/igs011/Video.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class IGS011 { diff --git a/MAME.Core/mame/konami68000/Drawgfx.cs b/MAME.Core/mame/konami68000/Drawgfx.cs index e62c5ac..82bec1c 100644 --- a/MAME.Core/mame/konami68000/Drawgfx.cs +++ b/MAME.Core/mame/konami68000/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Konami68000 { diff --git a/MAME.Core/mame/konami68000/Input.cs b/MAME.Core/mame/konami68000/Input.cs index cc2a904..6cf32fa 100644 --- a/MAME.Core/mame/konami68000/Input.cs +++ b/MAME.Core/mame/konami68000/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class Konami68000 { diff --git a/MAME.Core/mame/konami68000/Konami68000.cs b/MAME.Core/mame/konami68000/Konami68000.cs index 789104f..19d0281 100644 --- a/MAME.Core/mame/konami68000/Konami68000.cs +++ b/MAME.Core/mame/konami68000/Konami68000.cs @@ -1,7 +1,7 @@ using cpu.m68000; using System; -namespace mame +namespace MAME.Core { public partial class Konami68000 { @@ -603,8 +603,8 @@ namespace mame public static void sound_arm_nmi_w() { Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.CLEAR_LINE); - Timer.emu_timer timer = Timer.timer_alloc_common(nmi_callback, "nmi_callback", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)50e12), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(nmi_callback, "nmi_callback", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)50e12), Attotime.ATTOTIME_NEVER); } public static ushort punkshot_kludge_r() { diff --git a/MAME.Core/mame/konami68000/Konamiic.cs b/MAME.Core/mame/konami68000/Konamiic.cs index 32d2941..9a27cde 100644 --- a/MAME.Core/mame/konami68000/Konamiic.cs +++ b/MAME.Core/mame/konami68000/Konamiic.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public partial class Konami68000 { diff --git a/MAME.Core/mame/konami68000/Memory.cs b/MAME.Core/mame/konami68000/Memory.cs index 40120cf..ad695a1 100644 --- a/MAME.Core/mame/konami68000/Memory.cs +++ b/MAME.Core/mame/konami68000/Memory.cs @@ -1,6 +1,6 @@ using cpu.z80; -namespace mame +namespace MAME.Core { public partial class Konami68000 { diff --git a/MAME.Core/mame/konami68000/Memory2.cs b/MAME.Core/mame/konami68000/Memory2.cs index e0a8037..0fdb3e1 100644 --- a/MAME.Core/mame/konami68000/Memory2.cs +++ b/MAME.Core/mame/konami68000/Memory2.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Konami68000 { diff --git a/MAME.Core/mame/konami68000/State.cs b/MAME.Core/mame/konami68000/State.cs index f37fd1a..37db83c 100644 --- a/MAME.Core/mame/konami68000/State.cs +++ b/MAME.Core/mame/konami68000/State.cs @@ -2,7 +2,7 @@ using cpu.z80; using System.IO; -namespace mame +namespace MAME.Core { public partial class Konami68000 { @@ -50,12 +50,12 @@ namespace mame MC68000.m1.SaveStateBinary(writer); writer.Write(Memory.audioram, 0, 0x800); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); writer.Write(Sound.ym2151stream.output_sampindex); writer.Write(Sound.ym2151stream.output_base_sampindex); @@ -106,12 +106,12 @@ namespace mame MC68000.m1.LoadStateBinary(reader); Memory.audioram = reader.ReadBytes(0x800); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); Sound.ym2151stream.output_sampindex = reader.ReadInt32(); Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); @@ -157,12 +157,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); K007232.SaveStateBinary(writer); for (i = 0; i < 1; i++) @@ -219,12 +219,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); K007232.LoadStateBinary(reader); for (i = 0; i < 1; i++) @@ -285,12 +285,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); K007232.SaveStateBinary(writer); Upd7759.SaveStateBinary(writer); @@ -357,12 +357,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); K007232.LoadStateBinary(reader); Upd7759.LoadStateBinary(reader); @@ -424,12 +424,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); K053260.SaveStateBinary(writer); writer.Write(Sound.ym2151stream.output_sampindex); @@ -477,12 +477,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); K053260.LoadStateBinary(reader); Sound.ym2151stream.output_sampindex = reader.ReadInt32(); @@ -530,12 +530,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); K053260.SaveStateBinary(writer); writer.Write(Sound.ym2151stream.output_sampindex); @@ -583,12 +583,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); K053260.LoadStateBinary(reader); Sound.ym2151stream.output_sampindex = reader.ReadInt32(); @@ -634,12 +634,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); K053260.SaveStateBinary(writer); writer.Write(Sound.ym2151stream.output_sampindex); @@ -686,12 +686,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); K053260.LoadStateBinary(reader); Sound.ym2151stream.output_sampindex = reader.ReadInt32(); @@ -741,12 +741,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); K053260.SaveStateBinary(writer); writer.Write(Sound.k053260stream.output_sampindex); writer.Write(Sound.k053260stream.output_base_sampindex); @@ -792,12 +792,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); K053260.LoadStateBinary(reader); Sound.k053260stream.output_sampindex = reader.ReadInt32(); Sound.k053260stream.output_base_sampindex = reader.ReadInt32(); @@ -844,12 +844,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); K053260.SaveStateBinary(writer); writer.Write(Sound.ym2151stream.output_sampindex); @@ -900,12 +900,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); K053260.LoadStateBinary(reader); Sound.ym2151stream.output_sampindex = reader.ReadInt32(); @@ -952,12 +952,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); K053260.SaveStateBinary(writer); writer.Write(Sound.ym2151stream.output_sampindex); @@ -1004,12 +1004,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); K053260.LoadStateBinary(reader); Sound.ym2151stream.output_sampindex = reader.ReadInt32(); @@ -1056,12 +1056,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); K053260.SaveStateBinary(writer); writer.Write(Sound.ym2151stream.output_sampindex); @@ -1108,12 +1108,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); K053260.LoadStateBinary(reader); Sound.ym2151stream.output_sampindex = reader.ReadInt32(); @@ -1161,12 +1161,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x2000); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); K054539.SaveStateBinary(writer); for (i = 0; i < 3; i++) { @@ -1219,12 +1219,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x2000); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); K054539.LoadStateBinary(reader); for (i = 0; i < 3; i++) { diff --git a/MAME.Core/mame/konami68000/Tilemap.cs b/MAME.Core/mame/konami68000/Tilemap.cs index dd9b45f..3ab49bb 100644 --- a/MAME.Core/mame/konami68000/Tilemap.cs +++ b/MAME.Core/mame/konami68000/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Konami68000 { diff --git a/MAME.Core/mame/konami68000/Video.cs b/MAME.Core/mame/konami68000/Video.cs index 9de79ee..8660257 100644 --- a/MAME.Core/mame/konami68000/Video.cs +++ b/MAME.Core/mame/konami68000/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Konami68000 { diff --git a/MAME.Core/mame/m72/Audio.cs b/MAME.Core/mame/m72/Audio.cs index 42d5e52..031804a 100644 --- a/MAME.Core/mame/m72/Audio.cs +++ b/MAME.Core/mame/m72/Audio.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class M72 { @@ -44,17 +44,17 @@ { if (irq != 0) { - Cpuint.lvec.Add(new vec(1, Timer.get_current_time())); + Cpuint.lvec.Add(new vec(1, EmuTimer.get_current_time())); setvector_param = 1; - Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } else { - Cpuint.lvec.Add(new vec(2, Timer.get_current_time())); + Cpuint.lvec.Add(new vec(2, EmuTimer.get_current_time())); setvector_param = 2; - Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } } public static void m72_sound_command_w(int offset, ushort data) @@ -62,26 +62,26 @@ //if (ACCESSING_BITS_0_7) { Sound.soundlatch_w(data); - Cpuint.lvec.Add(new vec(3, Timer.get_current_time())); + Cpuint.lvec.Add(new vec(3, EmuTimer.get_current_time())); setvector_param = 3; - Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } } public static void m72_sound_command_byte_w(int offset, byte data) { Sound.soundlatch_w(data); - Cpuint.lvec.Add(new vec(3, Timer.get_current_time())); + Cpuint.lvec.Add(new vec(3, EmuTimer.get_current_time())); setvector_param = 3; - Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } public static void m72_sound_irq_ack_w(int offset, byte data) { - Cpuint.lvec.Add(new vec(4, Timer.get_current_time())); + Cpuint.lvec.Add(new vec(4, EmuTimer.get_current_time())); setvector_param = 4; - Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } public static void m72_set_sample_start(int start) { diff --git a/MAME.Core/mame/m72/Drawgfx.cs b/MAME.Core/mame/m72/Drawgfx.cs index 7515f67..3d39b51 100644 --- a/MAME.Core/mame/m72/Drawgfx.cs +++ b/MAME.Core/mame/m72/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/m72/Input.cs b/MAME.Core/mame/m72/Input.cs index 3ff3584..5e814b6 100644 --- a/MAME.Core/mame/m72/Input.cs +++ b/MAME.Core/mame/m72/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class M72 { diff --git a/MAME.Core/mame/m72/M72.cs b/MAME.Core/mame/m72/M72.cs index d1d513b..bc83afe 100644 --- a/MAME.Core/mame/m72/M72.cs +++ b/MAME.Core/mame/m72/M72.cs @@ -1,11 +1,11 @@ using System; -namespace mame +namespace MAME.Core { public partial class M72 { public static byte[] protection_ram; - public static Timer.emu_timer scanline_timer; + public static EmuTimer.emu_timer scanline_timer; public static byte m72_irq_base; public static int m72_scanline_param; @@ -44,7 +44,7 @@ namespace mame Generic.paletteram16_2 = new ushort[0x600]; Generic.spriteram16 = new ushort[0x200]; Machine.bRom = true; - Timer.setvector = setvector_callback; + EmuTimer.setvector = setvector_callback; protection_ram = new byte[0x1000]; Memory.mainrom = Machine.GetRom("maincpu.rom"); Memory.audiorom = Machine.GetRom("soundcpu.rom"); @@ -154,19 +154,19 @@ namespace mame } public static void machine_start_m72() { - scanline_timer = Timer.timer_alloc_common(m72_scanline_interrupt, "m72_scanline_interrupt", false); + scanline_timer = EmuTimer.timer_alloc_common(m72_scanline_interrupt, "m72_scanline_interrupt", false); } public static void machine_reset_m72() { m72_irq_base = 0x20; machine_reset_m72_sound(); - Timer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); } public static void machine_reset_kengo() { m72_irq_base = 0x18; machine_reset_m72_sound(); - Timer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); } public static void m72_scanline_interrupt() { @@ -186,7 +186,7 @@ namespace mame scanline = 0; } m72_scanline_param = scanline; - Timer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); } } } diff --git a/MAME.Core/mame/m72/Memory.cs b/MAME.Core/mame/m72/Memory.cs index 884b816..76f558e 100644 --- a/MAME.Core/mame/m72/Memory.cs +++ b/MAME.Core/mame/m72/Memory.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class M72 { diff --git a/MAME.Core/mame/m72/Memory2.cs b/MAME.Core/mame/m72/Memory2.cs index 1f0c4a3..b6271b4 100644 --- a/MAME.Core/mame/m72/Memory2.cs +++ b/MAME.Core/mame/m72/Memory2.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class M72 { diff --git a/MAME.Core/mame/m72/State.cs b/MAME.Core/mame/m72/State.cs index 1e3ba17..901eed6 100644 --- a/MAME.Core/mame/m72/State.cs +++ b/MAME.Core/mame/m72/State.cs @@ -2,7 +2,7 @@ using cpu.z80; using System.IO; -namespace mame +namespace MAME.Core { public partial class M72 { @@ -51,12 +51,12 @@ namespace mame Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary_v(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); DAC.SaveStateBinary(writer); writer.Write(Sound.latched_value[0]); @@ -112,12 +112,12 @@ namespace mame Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary_v(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); DAC.LoadStateBinary(reader); Sound.latched_value[0] = reader.ReadUInt16(); diff --git a/MAME.Core/mame/m72/Tilemap.cs b/MAME.Core/mame/m72/Tilemap.cs index 778adbe..60dedae 100644 --- a/MAME.Core/mame/m72/Tilemap.cs +++ b/MAME.Core/mame/m72/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class M72 { diff --git a/MAME.Core/mame/m72/Video.cs b/MAME.Core/mame/m72/Video.cs index 2790434..0420dfd 100644 --- a/MAME.Core/mame/m72/Video.cs +++ b/MAME.Core/mame/m72/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class M72 { diff --git a/MAME.Core/mame/m92/Drawgfx.cs b/MAME.Core/mame/m92/Drawgfx.cs index 8a9e53a..f36ac48 100644 --- a/MAME.Core/mame/m92/Drawgfx.cs +++ b/MAME.Core/mame/m92/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/m92/Input.cs b/MAME.Core/mame/m92/Input.cs index d21e1dd..42ed061 100644 --- a/MAME.Core/mame/m92/Input.cs +++ b/MAME.Core/mame/m92/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class M92 { diff --git a/MAME.Core/mame/m92/M92.cs b/MAME.Core/mame/m92/M92.cs index e747fcf..dcf7dab 100644 --- a/MAME.Core/mame/m92/M92.cs +++ b/MAME.Core/mame/m92/M92.cs @@ -1,14 +1,14 @@ using System; using System.Collections.Generic; -namespace mame +namespace MAME.Core { public partial class M92 { public static byte irqvector; public static ushort sound_status; public static int bankaddress; - public static Timer.emu_timer scanline_timer; + public static EmuTimer.emu_timer scanline_timer; public static byte m92_irq_vectorbase; public static int m92_raster_irq_position; public static int m92_scanline_param; @@ -218,7 +218,7 @@ namespace mame int i1, i2, n1, n2; byte[] bb1; Machine.bRom = true; - Timer.setvector = setvector_callback; + EmuTimer.setvector = setvector_callback; pf_master_control = new ushort[4]; M92.pf_layer = new M92.pf_layer_info[3]; for (i1 = 0; i1 < 3; i1++) @@ -301,12 +301,12 @@ namespace mame { setvector_param = 0; setvector_callback(); - scanline_timer = Timer.timer_alloc_common(m92_scanline_interrupt, "m92_scanline_interrupt", false); + scanline_timer = EmuTimer.timer_alloc_common(m92_scanline_interrupt, "m92_scanline_interrupt", false); } public static void machine_reset_m92() { m92_scanline_param = 0; - Timer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); } public static void m92_scanline_interrupt() { @@ -326,7 +326,7 @@ namespace mame scanline = 0; } m92_scanline_param = scanline; - Timer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(scanline_timer, Video.video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); } public static byte m92_eeprom_r(int offset) { @@ -361,11 +361,11 @@ namespace mame List lsvec = new List(); foreach (vec v1 in Cpuint.lvec) { - if (Attotime.attotime_compare(v1.time, Timer.global_basetime) < 0) + if (Attotime.attotime_compare(v1.time, EmuTimer.global_basetime) < 0) { lsvec.Add(v1); } - else if (Attotime.attotime_compare(v1.time, Timer.global_basetime) == 0) + else if (Attotime.attotime_compare(v1.time, EmuTimer.global_basetime) == 0) { setvector_param = v1.vector; lsvec.Add(v1); @@ -413,10 +413,10 @@ namespace mame } public static void m92_soundlatch_w(ushort data) { - Cpuint.lvec.Add(new vec(3, Timer.get_current_time())); + Cpuint.lvec.Add(new vec(3, EmuTimer.get_current_time())); setvector_param = 3; - Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); Sound.soundlatch_w((ushort)(data & 0xff)); } public static ushort m92_sound_status_r() @@ -429,10 +429,10 @@ namespace mame } public static void m92_sound_irq_ack_w() { - Cpuint.lvec.Add(new vec(4, Timer.get_current_time())); + Cpuint.lvec.Add(new vec(4, EmuTimer.get_current_time())); setvector_param = 4; - Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } public static void m92_sound_status_w(ushort data) { @@ -443,17 +443,17 @@ namespace mame { if (state != 0) { - Cpuint.lvec.Add(new vec(1, Timer.get_current_time())); + Cpuint.lvec.Add(new vec(1, EmuTimer.get_current_time())); setvector_param = 1; - Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } else { - Cpuint.lvec.Add(new vec(2, Timer.get_current_time())); + Cpuint.lvec.Add(new vec(2, EmuTimer.get_current_time())); setvector_param = 2; - Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } } public static void m92_sprite_interrupt() diff --git a/MAME.Core/mame/m92/Memory.cs b/MAME.Core/mame/m92/Memory.cs index 48917b7..0087419 100644 --- a/MAME.Core/mame/m92/Memory.cs +++ b/MAME.Core/mame/m92/Memory.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class M92 { diff --git a/MAME.Core/mame/m92/Memory2.cs b/MAME.Core/mame/m92/Memory2.cs index 8cb3f17..98482c9 100644 --- a/MAME.Core/mame/m92/Memory2.cs +++ b/MAME.Core/mame/m92/Memory2.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class M92 { diff --git a/MAME.Core/mame/m92/State.cs b/MAME.Core/mame/m92/State.cs index 57cdaad..f145f4e 100644 --- a/MAME.Core/mame/m92/State.cs +++ b/MAME.Core/mame/m92/State.cs @@ -1,7 +1,7 @@ using cpu.nec; using System.IO; -namespace mame +namespace MAME.Core { public partial class M92 { @@ -65,12 +65,12 @@ namespace mame Nec.nn1[1].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary_v(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); Iremga20.SaveStateBinary(writer); writer.Write(Sound.latched_value[0]); @@ -142,12 +142,12 @@ namespace mame Nec.nn1[1].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary_v(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); Iremga20.LoadStateBinary(reader); Sound.latched_value[0] = reader.ReadUInt16(); diff --git a/MAME.Core/mame/m92/Tilemap.cs b/MAME.Core/mame/m92/Tilemap.cs index 924009c..c358e35 100644 --- a/MAME.Core/mame/m92/Tilemap.cs +++ b/MAME.Core/mame/m92/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class M92 { diff --git a/MAME.Core/mame/m92/Video.cs b/MAME.Core/mame/m92/Video.cs index de72b87..896c8b7 100644 --- a/MAME.Core/mame/m92/Video.cs +++ b/MAME.Core/mame/m92/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class M92 { @@ -45,8 +45,8 @@ namespace mame { Generic.buffer_spriteram16_w(); m92_sprite_buffer_busy = 0; - Timer.emu_timer timer = Timer.timer_alloc_common(spritebuffer_callback, "spritebuffer_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(spritebuffer_callback, "spritebuffer_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); } } public static void m92_spritecontrol_w2(int offset, byte data) @@ -67,8 +67,8 @@ namespace mame { Generic.buffer_spriteram16_w(); m92_sprite_buffer_busy = 0; - Timer.emu_timer timer = Timer.timer_alloc_common(spritebuffer_callback, "spritebuffer_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(spritebuffer_callback, "spritebuffer_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); } } public static void m92_spritecontrol_w(int offset, ushort data) @@ -89,8 +89,8 @@ namespace mame { Generic.buffer_spriteram16_w(); m92_sprite_buffer_busy = 0; - Timer.emu_timer timer = Timer.timer_alloc_common(spritebuffer_callback, "spritebuffer_callback", true); - Timer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(spritebuffer_callback, "spritebuffer_callback", true); + EmuTimer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); } } public static void m92_videocontrol_w(byte data) diff --git a/MAME.Core/mame/namcos1/Drawgfx.cs b/MAME.Core/mame/namcos1/Drawgfx.cs index 79f062d..3d42a68 100644 --- a/MAME.Core/mame/namcos1/Drawgfx.cs +++ b/MAME.Core/mame/namcos1/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/namcos1/Input.cs b/MAME.Core/mame/namcos1/Input.cs index b7ab2ba..29473ad 100644 --- a/MAME.Core/mame/namcos1/Input.cs +++ b/MAME.Core/mame/namcos1/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class Namcos1 { diff --git a/MAME.Core/mame/namcos1/Machine.cs b/MAME.Core/mame/namcos1/Machine.cs index 5d9c5ca..cbdaf4c 100644 --- a/MAME.Core/mame/namcos1/Machine.cs +++ b/MAME.Core/mame/namcos1/Machine.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Namcos1 { diff --git a/MAME.Core/mame/namcos1/Memory.cs b/MAME.Core/mame/namcos1/Memory.cs index 9f08539..98641a9 100644 --- a/MAME.Core/mame/namcos1/Memory.cs +++ b/MAME.Core/mame/namcos1/Memory.cs @@ -1,6 +1,6 @@ using cpu.m6800; -namespace mame +namespace MAME.Core { public partial class Namcos1 { diff --git a/MAME.Core/mame/namcos1/Memory2.cs b/MAME.Core/mame/namcos1/Memory2.cs index c790a07..4c85f15 100644 --- a/MAME.Core/mame/namcos1/Memory2.cs +++ b/MAME.Core/mame/namcos1/Memory2.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Namcos1 { diff --git a/MAME.Core/mame/namcos1/Namcos1.cs b/MAME.Core/mame/namcos1/Namcos1.cs index e4ef7a5..fdb9bca 100644 --- a/MAME.Core/mame/namcos1/Namcos1.cs +++ b/MAME.Core/mame/namcos1/Namcos1.cs @@ -1,7 +1,6 @@ -using MAME.Core.Motion; -using System; +using System; -namespace mame +namespace MAME.Core { public partial class Namcos1 { diff --git a/MAME.Core/mame/namcos1/State.cs b/MAME.Core/mame/namcos1/State.cs index 9cbd114..17b3092 100644 --- a/MAME.Core/mame/namcos1/State.cs +++ b/MAME.Core/mame/namcos1/State.cs @@ -2,7 +2,7 @@ using cpu.m6809; using System.IO; -namespace mame +namespace MAME.Core { public partial class Namcos1 { @@ -55,12 +55,12 @@ namespace mame } M6800.m1.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); Namco.SaveStateBinary(writer); DAC.SaveStateBinary(writer); @@ -122,12 +122,12 @@ namespace mame } M6800.m1.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); Namco.LoadStateBinary(reader); DAC.LoadStateBinary(reader); diff --git a/MAME.Core/mame/namcos1/Tilemap.cs b/MAME.Core/mame/namcos1/Tilemap.cs index e2d426c..20c5c18 100644 --- a/MAME.Core/mame/namcos1/Tilemap.cs +++ b/MAME.Core/mame/namcos1/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Namcos1 { diff --git a/MAME.Core/mame/namcos1/Video.cs b/MAME.Core/mame/namcos1/Video.cs index bfdd2d7..a3f4c90 100644 --- a/MAME.Core/mame/namcos1/Video.cs +++ b/MAME.Core/mame/namcos1/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Namcos1 { diff --git a/MAME.Core/mame/neogeo/Input.cs b/MAME.Core/mame/neogeo/Input.cs index 21c1b01..ada5a86 100644 --- a/MAME.Core/mame/neogeo/Input.cs +++ b/MAME.Core/mame/neogeo/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class Neogeo { diff --git a/MAME.Core/mame/neogeo/Memory.cs b/MAME.Core/mame/neogeo/Memory.cs index 49bf340..670821e 100644 --- a/MAME.Core/mame/neogeo/Memory.cs +++ b/MAME.Core/mame/neogeo/Memory.cs @@ -1,7 +1,6 @@ using cpu.m68000; -using MAME.Core.Motion; -namespace mame +namespace MAME.Core { public partial class Neogeo { diff --git a/MAME.Core/mame/neogeo/Neogeo.cs b/MAME.Core/mame/neogeo/Neogeo.cs index 80ca4ad..955725a 100644 --- a/MAME.Core/mame/neogeo/Neogeo.cs +++ b/MAME.Core/mame/neogeo/Neogeo.cs @@ -1,8 +1,7 @@ -using MAME.Core.Motion; -using System; +using System; using System.IO; -namespace mame +namespace MAME.Core { public partial class Neogeo { @@ -18,9 +17,9 @@ namespace mame private static int display_position_interrupt_pending; private static int irq3_pending; public static byte dsw; - public static Timer.emu_timer display_position_interrupt_timer; - public static Timer.emu_timer display_position_vblank_timer; - public static Timer.emu_timer vblank_interrupt_timer; + public static EmuTimer.emu_timer display_position_interrupt_timer; + public static EmuTimer.emu_timer display_position_vblank_timer; + public static EmuTimer.emu_timer vblank_interrupt_timer; private static byte controller_select; public static int main_cpu_bank_address; public static byte main_cpu_vector_table_source; @@ -117,7 +116,7 @@ namespace mame if ((display_counter + 1) != 0) { Atime period = Attotime.attotime_mul(new Atime(0, Attotime.ATTOSECONDS_PER_SECOND / 6000000), display_counter + 1); - Timer.timer_adjust_periodic(display_position_interrupt_timer, period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(display_position_interrupt_timer, period, Attotime.ATTOTIME_NEVER); } } private static void update_interrupts() @@ -170,14 +169,14 @@ namespace mame { adjust_display_position_interrupt_timer(); } - Timer.timer_adjust_periodic(display_position_vblank_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(display_position_vblank_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), Attotime.ATTOTIME_NEVER); } public static void vblank_interrupt_callback() { calendar_clock(); vblank_interrupt_pending = 1; update_interrupts(); - Timer.timer_adjust_periodic(vblank_interrupt_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(vblank_interrupt_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, 0), Attotime.ATTOTIME_NEVER); } public static void audio_cpu_irq(int assert) { @@ -326,9 +325,9 @@ namespace mame audio_cpu_banks[1] = 0x0e; audio_cpu_banks[2] = 0x06; audio_cpu_banks[3] = 0x02; - display_position_interrupt_timer = Timer.timer_alloc_common(display_position_interrupt_callback, "display_position_interrupt_callback", false); - display_position_vblank_timer = Timer.timer_alloc_common(display_position_vblank_callback, "display_position_vblank_callback", false); - vblank_interrupt_timer = Timer.timer_alloc_common(vblank_interrupt_callback, "vblank_interrupt_callback", false); + display_position_interrupt_timer = EmuTimer.timer_alloc_common(display_position_interrupt_callback, "display_position_interrupt_callback", false); + display_position_vblank_timer = EmuTimer.timer_alloc_common(display_position_vblank_callback, "display_position_vblank_callback", false); + vblank_interrupt_timer = EmuTimer.timer_alloc_common(vblank_interrupt_callback, "vblank_interrupt_callback", false); Pd4900a.pd4990a_init(); calendar_init(); irq3_pending = 1; @@ -358,8 +357,8 @@ namespace mame audio_cpu_nmi_enabled = false; audio_cpu_nmi_pending = false; audio_cpu_check_nmi(); - Timer.timer_adjust_periodic(vblank_interrupt_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, 0), Attotime.ATTOTIME_NEVER); - Timer.timer_adjust_periodic(display_position_vblank_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(vblank_interrupt_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(display_position_vblank_timer, Video.video_screen_get_time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), Attotime.ATTOTIME_NEVER); update_interrupts(); start_sprite_line_timer(); start_auto_animation_timer(); diff --git a/MAME.Core/mame/neogeo/Neoprot.cs b/MAME.Core/mame/neogeo/Neoprot.cs index 42261e0..4e7d03a 100644 --- a/MAME.Core/mame/neogeo/Neoprot.cs +++ b/MAME.Core/mame/neogeo/Neoprot.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Neogeo { diff --git a/MAME.Core/mame/neogeo/State.cs b/MAME.Core/mame/neogeo/State.cs index 3e65139..d110763 100644 --- a/MAME.Core/mame/neogeo/State.cs +++ b/MAME.Core/mame/neogeo/State.cs @@ -2,7 +2,7 @@ using cpu.z80; using System.IO; -namespace mame +namespace MAME.Core { public partial class Neogeo { @@ -51,14 +51,14 @@ namespace mame writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); writer.Write(Video.screenstate.vblank_start_time.seconds); writer.Write(Video.screenstate.vblank_start_time.attoseconds); writer.Write(Video.screenstate.frame_number); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer); YM2610.F2610.SaveStateBinary(writer); for (i = 0; i < 2; i++) @@ -122,14 +122,14 @@ namespace mame Memory.audioram = reader.ReadBytes(0x800); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64(); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader); YM2610.F2610.LoadStateBinary(reader); for (i = 0; i < 2; i++) diff --git a/MAME.Core/mame/neogeo/Video.cs b/MAME.Core/mame/neogeo/Video.cs index 7b8bdb8..c9a4c45 100644 --- a/MAME.Core/mame/neogeo/Video.cs +++ b/MAME.Core/mame/neogeo/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Neogeo { @@ -21,7 +21,7 @@ namespace mame public static byte auto_animation_disabled; public static int auto_animation_counter; private static int auto_animation_frame_counter; - public static Timer.emu_timer auto_animation_timer, sprite_line_timer; + public static EmuTimer.emu_timer auto_animation_timer, sprite_line_timer; private static double[] rgb_weights_normal; private static double[] rgb_weights_normal_bit15; private static double[] rgb_weights_dark; @@ -123,15 +123,15 @@ namespace mame { auto_animation_frame_counter = auto_animation_frame_counter - 1; } - Timer.timer_adjust_periodic(auto_animation_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(auto_animation_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); } private static void create_auto_animation_timer() { - auto_animation_timer = Timer.timer_alloc_common(auto_animation_timer_callback, "auto_animation_timer_callback", false); + auto_animation_timer = EmuTimer.timer_alloc_common(auto_animation_timer_callback, "auto_animation_timer_callback", false); } private static void start_auto_animation_timer() { - Timer.timer_adjust_periodic(auto_animation_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(auto_animation_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); } private static int rows_to_height(int rows) { @@ -359,16 +359,16 @@ namespace mame parse_sprites(scanline); scanline = (scanline + 1) % 264; neogeo_scanline_param = scanline; - Timer.timer_adjust_periodic(sprite_line_timer, Video.video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(sprite_line_timer, Video.video_screen_get_time_until_pos(scanline, 0), Attotime.ATTOTIME_NEVER); } private static void create_sprite_line_timer() { - sprite_line_timer = Timer.timer_alloc_common(sprite_line_timer_callback, "sprite_line_timer_callback", false); + sprite_line_timer = EmuTimer.timer_alloc_common(sprite_line_timer_callback, "sprite_line_timer_callback", false); } private static void start_sprite_line_timer() { neogeo_scanline_param = 0; - Timer.timer_adjust_periodic(sprite_line_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(sprite_line_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); } private static void draw_fixed_layer(int iBitmap, int scanline) { diff --git a/MAME.Core/mame/pgm/Input.cs b/MAME.Core/mame/pgm/Input.cs index 4104965..4406830 100644 --- a/MAME.Core/mame/pgm/Input.cs +++ b/MAME.Core/mame/pgm/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class PGM { diff --git a/MAME.Core/mame/pgm/Machine.cs b/MAME.Core/mame/pgm/Machine.cs index c9c34c9..96bbee1 100644 --- a/MAME.Core/mame/pgm/Machine.cs +++ b/MAME.Core/mame/pgm/Machine.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class PGM { diff --git a/MAME.Core/mame/pgm/Memory.cs b/MAME.Core/mame/pgm/Memory.cs index 9e82ba9..696c328 100644 --- a/MAME.Core/mame/pgm/Memory.cs +++ b/MAME.Core/mame/pgm/Memory.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class PGM { diff --git a/MAME.Core/mame/pgm/Memory2.cs b/MAME.Core/mame/pgm/Memory2.cs index 3236998..f47ef5d 100644 --- a/MAME.Core/mame/pgm/Memory2.cs +++ b/MAME.Core/mame/pgm/Memory2.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class PGM { diff --git a/MAME.Core/mame/pgm/PGM.cs b/MAME.Core/mame/pgm/PGM.cs index 15faea5..050ba0e 100644 --- a/MAME.Core/mame/pgm/PGM.cs +++ b/MAME.Core/mame/pgm/PGM.cs @@ -1,8 +1,7 @@ using cpu.m68000; -using MAME.Core.Motion; using System; -namespace mame +namespace MAME.Core { public partial class PGM { diff --git a/MAME.Core/mame/pgm/Pgmprot.cs b/MAME.Core/mame/pgm/Pgmprot.cs index 5745e06..6fed266 100644 --- a/MAME.Core/mame/pgm/Pgmprot.cs +++ b/MAME.Core/mame/pgm/Pgmprot.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class PGM { diff --git a/MAME.Core/mame/pgm/State.cs b/MAME.Core/mame/pgm/State.cs index 92ee2eb..6ef7da8 100644 --- a/MAME.Core/mame/pgm/State.cs +++ b/MAME.Core/mame/pgm/State.cs @@ -2,7 +2,7 @@ using cpu.z80; using System.IO; -namespace mame +namespace MAME.Core { public partial class PGM { @@ -38,12 +38,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x10000); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); ICS2115.SaveStateBinary(writer); for (i = 0; i < 3; i++) { @@ -90,12 +90,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x10000); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); ICS2115.LoadStateBinary(reader); for (i = 0; i < 3; i++) { diff --git a/MAME.Core/mame/pgm/Tilemap.cs b/MAME.Core/mame/pgm/Tilemap.cs index d20f69b..cbcb114 100644 --- a/MAME.Core/mame/pgm/Tilemap.cs +++ b/MAME.Core/mame/pgm/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class PGM { diff --git a/MAME.Core/mame/pgm/Video.cs b/MAME.Core/mame/pgm/Video.cs index bafdae8..7dc926e 100644 --- a/MAME.Core/mame/pgm/Video.cs +++ b/MAME.Core/mame/pgm/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class PGM { diff --git a/MAME.Core/mame/suna8/Drawgfx.cs b/MAME.Core/mame/suna8/Drawgfx.cs index 67d9441..2d85c70 100644 --- a/MAME.Core/mame/suna8/Drawgfx.cs +++ b/MAME.Core/mame/suna8/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/suna8/Input.cs b/MAME.Core/mame/suna8/Input.cs index d2aa3d8..d7b2c05 100644 --- a/MAME.Core/mame/suna8/Input.cs +++ b/MAME.Core/mame/suna8/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class SunA8 { diff --git a/MAME.Core/mame/suna8/Memory.cs b/MAME.Core/mame/suna8/Memory.cs index 18be1ad..9e8d013 100644 --- a/MAME.Core/mame/suna8/Memory.cs +++ b/MAME.Core/mame/suna8/Memory.cs @@ -1,6 +1,6 @@ using cpu.z80; -namespace mame +namespace MAME.Core { public partial class SunA8 { diff --git a/MAME.Core/mame/suna8/State.cs b/MAME.Core/mame/suna8/State.cs index 589b618..f5e3567 100644 --- a/MAME.Core/mame/suna8/State.cs +++ b/MAME.Core/mame/suna8/State.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public partial class SunA8 { diff --git a/MAME.Core/mame/suna8/SunA8.cs b/MAME.Core/mame/suna8/SunA8.cs index d6474d3..f266265 100644 --- a/MAME.Core/mame/suna8/SunA8.cs +++ b/MAME.Core/mame/suna8/SunA8.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class SunA8 { diff --git a/MAME.Core/mame/suna8/Video.cs b/MAME.Core/mame/suna8/Video.cs index 7aeb108..feb0150 100644 --- a/MAME.Core/mame/suna8/Video.cs +++ b/MAME.Core/mame/suna8/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class SunA8 { diff --git a/MAME.Core/mame/taito/Bublbobl.cs b/MAME.Core/mame/taito/Bublbobl.cs index 7ec1875..2b57124 100644 --- a/MAME.Core/mame/taito/Bublbobl.cs +++ b/MAME.Core/mame/taito/Bublbobl.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Taito { @@ -73,7 +73,7 @@ public static void bublbobl_sound_command_w(byte data) { Sound.soundlatch_w((ushort)data); - Timer.timer_set_internal(nmi_callback, "nmi_callback"); + EmuTimer.timer_set_internal(nmi_callback, "nmi_callback"); } public static void bublbobl_sh_nmi_disable_w() { diff --git a/MAME.Core/mame/taito/Drawgfx.cs b/MAME.Core/mame/taito/Drawgfx.cs index a6e74b6..61ca93d 100644 --- a/MAME.Core/mame/taito/Drawgfx.cs +++ b/MAME.Core/mame/taito/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/taito/Input.cs b/MAME.Core/mame/taito/Input.cs index e74ba43..a4e6cbf 100644 --- a/MAME.Core/mame/taito/Input.cs +++ b/MAME.Core/mame/taito/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class Taito { diff --git a/MAME.Core/mame/taito/Memory.cs b/MAME.Core/mame/taito/Memory.cs index 5a547b1..71077bb 100644 --- a/MAME.Core/mame/taito/Memory.cs +++ b/MAME.Core/mame/taito/Memory.cs @@ -1,6 +1,6 @@ using cpu.z80; -namespace mame +namespace MAME.Core { public partial class Taito { diff --git a/MAME.Core/mame/taito/Opwolf.cs b/MAME.Core/mame/taito/Opwolf.cs index ba95a48..7b334b9 100644 --- a/MAME.Core/mame/taito/Opwolf.cs +++ b/MAME.Core/mame/taito/Opwolf.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Taito { @@ -981,8 +981,8 @@ namespace mame if (cchip_ram[0x7a] == 0 && cchip_last_7a != 0 && current_cmd != 0xf5) { current_cmd = 0xf5; - Timer.emu_timer timer = Timer.timer_alloc_common(opwolf_timer_callback, "opwolf_timer_callback", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(80000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(opwolf_timer_callback, "opwolf_timer_callback", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(80000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); } cchip_last_7a = cchip_ram[0x7a]; if (cchip_ram[0x7f] == 0xa) @@ -1020,7 +1020,7 @@ namespace mame cchip_credits_for_coin[0] = 1; cchip_coins_for_credit[1] = 1; cchip_credits_for_coin[1] = 1; - Timer.timer_pulse_internal(new Atime(0, (long)(1e18 / 60)), cchip_timer, "cchip_timer"); + EmuTimer.timer_pulse_internal(new Atime(0, (long)(1e18 / 60)), cchip_timer, "cchip_timer"); } } } diff --git a/MAME.Core/mame/taito/State.cs b/MAME.Core/mame/taito/State.cs index 324b579..36d4dc6 100644 --- a/MAME.Core/mame/taito/State.cs +++ b/MAME.Core/mame/taito/State.cs @@ -4,7 +4,7 @@ using cpu.m6805; using cpu.z80; using System.IO; -namespace mame +namespace MAME.Core { public partial class Taito { @@ -32,14 +32,14 @@ namespace mame Z80A.zz1[i].SaveStateBinary(writer); } Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); writer.Write(Video.screenstate.vblank_start_time.seconds); writer.Write(Video.screenstate.vblank_start_time.attoseconds); writer.Write(Video.screenstate.frame_number); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer); YM2203.FF2203[0].SaveStateBinary(writer); for (i = 0; i < 2; i++) @@ -81,14 +81,14 @@ namespace mame Z80A.zz1[i].LoadStateBinary(reader); } Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64(); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader); YM2203.FF2203[0].LoadStateBinary(reader); for (i = 0; i < 2; i++) @@ -142,14 +142,14 @@ namespace mame } M6800.m1.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); writer.Write(Video.screenstate.vblank_start_time.seconds); writer.Write(Video.screenstate.vblank_start_time.attoseconds); writer.Write(Video.screenstate.frame_number); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer); YM2203.FF2203[0].SaveStateBinary(writer); YM3812.SaveStateBinary_YM3526(writer); @@ -206,14 +206,14 @@ namespace mame } M6800.m1.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64(); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader); YM2203.FF2203[0].LoadStateBinary(reader); YM3812.LoadStateBinary_YM3526(reader); @@ -260,14 +260,14 @@ namespace mame Z80A.zz1[i].SaveStateBinary(writer); } Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); writer.Write(Video.screenstate.vblank_start_time.seconds); writer.Write(Video.screenstate.vblank_start_time.attoseconds); writer.Write(Video.screenstate.frame_number); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer); YM2203.FF2203[0].SaveStateBinary(writer); YM3812.SaveStateBinary_YM3526(writer); @@ -313,14 +313,14 @@ namespace mame Z80A.zz1[i].LoadStateBinary(reader); } Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64(); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader); YM2203.FF2203[0].LoadStateBinary(reader); YM3812.LoadStateBinary_YM3526(reader); @@ -371,14 +371,14 @@ namespace mame } M6805.m1.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); writer.Write(Video.screenstate.vblank_start_time.seconds); writer.Write(Video.screenstate.vblank_start_time.attoseconds); writer.Write(Video.screenstate.frame_number); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer); YM2203.FF2203[0].SaveStateBinary(writer); YM3812.SaveStateBinary_YM3526(writer); @@ -429,14 +429,14 @@ namespace mame } M6805.m1.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.screenstate.vblank_start_time.seconds = reader.ReadInt32(); Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64(); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader); YM2203.FF2203[0].LoadStateBinary(reader); YM3812.LoadStateBinary_YM3526(reader); @@ -574,12 +574,12 @@ namespace mame Z80A.zz1[i].SaveStateBinary(writer); } Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); YM2151.SaveStateBinary(writer); MSM5205.mm1[0].SaveStateBinary(writer); MSM5205.mm1[1].SaveStateBinary(writer); @@ -711,12 +711,12 @@ namespace mame Z80A.zz1[i].LoadStateBinary(reader); } Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); YM2151.LoadStateBinary(reader); MSM5205.mm1[0].LoadStateBinary(reader); MSM5205.mm1[1].LoadStateBinary(reader); diff --git a/MAME.Core/mame/taito/Taito.cs b/MAME.Core/mame/taito/Taito.cs index 5ad1181..022c905 100644 --- a/MAME.Core/mame/taito/Taito.cs +++ b/MAME.Core/mame/taito/Taito.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Taito { diff --git a/MAME.Core/mame/taito/Taitoic.cs b/MAME.Core/mame/taito/Taitoic.cs index d110f6a..7936687 100644 --- a/MAME.Core/mame/taito/Taitoic.cs +++ b/MAME.Core/mame/taito/Taitoic.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Taito { diff --git a/MAME.Core/mame/taito/Tilemap.cs b/MAME.Core/mame/taito/Tilemap.cs index 19ddb56..cbe45f8 100644 --- a/MAME.Core/mame/taito/Tilemap.cs +++ b/MAME.Core/mame/taito/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Tmap { diff --git a/MAME.Core/mame/taito/Video.cs b/MAME.Core/mame/taito/Video.cs index 298d4ca..2c8b521 100644 --- a/MAME.Core/mame/taito/Video.cs +++ b/MAME.Core/mame/taito/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Taito { diff --git a/MAME.Core/mame/taitob/Drawgfx.cs b/MAME.Core/mame/taitob/Drawgfx.cs index 21bc81e..b97e57a 100644 --- a/MAME.Core/mame/taitob/Drawgfx.cs +++ b/MAME.Core/mame/taitob/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/taitob/Input.cs b/MAME.Core/mame/taitob/Input.cs index 54e6293..99ecba5 100644 --- a/MAME.Core/mame/taitob/Input.cs +++ b/MAME.Core/mame/taitob/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class Taitob { diff --git a/MAME.Core/mame/taitob/Mb87078.cs b/MAME.Core/mame/taitob/Mb87078.cs index bc66773..d051b01 100644 --- a/MAME.Core/mame/taitob/Mb87078.cs +++ b/MAME.Core/mame/taitob/Mb87078.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Taitob { diff --git a/MAME.Core/mame/taitob/Memory.cs b/MAME.Core/mame/taitob/Memory.cs index ed46d44..523ce2d 100644 --- a/MAME.Core/mame/taitob/Memory.cs +++ b/MAME.Core/mame/taitob/Memory.cs @@ -1,6 +1,6 @@ using cpu.z80; -namespace mame +namespace MAME.Core { public partial class Taitob { diff --git a/MAME.Core/mame/taitob/Memory2.cs b/MAME.Core/mame/taitob/Memory2.cs index 7f06614..1373c8c 100644 --- a/MAME.Core/mame/taitob/Memory2.cs +++ b/MAME.Core/mame/taitob/Memory2.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Taitob { diff --git a/MAME.Core/mame/taitob/State.cs b/MAME.Core/mame/taitob/State.cs index 001a349..16d9ccb 100644 --- a/MAME.Core/mame/taitob/State.cs +++ b/MAME.Core/mame/taitob/State.cs @@ -2,7 +2,7 @@ using cpu.z80; using System.IO; -namespace mame +namespace MAME.Core { public partial class Taitob { @@ -58,12 +58,12 @@ namespace mame writer.Write(Memory.audioram, 0, 0x2000); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer); YM2610.F2610.SaveStateBinary(writer); for (i = 0; i < 2; i++) @@ -147,12 +147,12 @@ namespace mame Memory.audioram = reader.ReadBytes(0x2000); Z80A.zz1[0].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader); YM2610.F2610.LoadStateBinary(reader); for (i = 0; i < 2; i++) diff --git a/MAME.Core/mame/taitob/Taitob.cs b/MAME.Core/mame/taitob/Taitob.cs index d6d8f13..b3b4a62 100644 --- a/MAME.Core/mame/taitob/Taitob.cs +++ b/MAME.Core/mame/taitob/Taitob.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Taitob { @@ -89,8 +89,8 @@ } public static void rastansaga2_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(rsaga2_interrupt2, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(rsaga2_interrupt2, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); } public static void crimec_interrupt3() @@ -99,8 +99,8 @@ } public static void crimec_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(crimec_interrupt3, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(crimec_interrupt3, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); } public static void hitice_interrupt6() @@ -109,8 +109,8 @@ } public static void hitice_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(hitice_interrupt6, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(hitice_interrupt6, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); } public static void rambo3_interrupt1() @@ -119,8 +119,8 @@ } public static void rambo3_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(rambo3_interrupt1, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(rambo3_interrupt1, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); } public static void pbobble_interrupt5() @@ -129,8 +129,8 @@ } public static void pbobble_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(pbobble_interrupt5, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(pbobble_interrupt5, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 3, LineState.HOLD_LINE); } public static void viofight_interrupt1() @@ -139,8 +139,8 @@ } public static void viofight_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(viofight_interrupt1, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(viofight_interrupt1, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); } public static void masterw_interrupt4() @@ -149,8 +149,8 @@ } public static void masterw_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(masterw_interrupt4, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(masterw_interrupt4, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); } public static void silentd_interrupt4() @@ -159,8 +159,8 @@ } public static void silentd_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(silentd_interrupt4, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(silentd_interrupt4, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); } public static void selfeena_interrupt4() @@ -169,8 +169,8 @@ } public static void selfeena_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(selfeena_interrupt4, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(selfeena_interrupt4, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); } public static void sbm_interrupt5() @@ -179,8 +179,8 @@ } public static void sbm_interrupt() { - Timer.emu_timer timer = Timer.timer_alloc_common(sbm_interrupt5, "vblank_interrupt2", true); - Timer.timer_adjust_periodic(timer, new Atime(0, (long)(10000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(sbm_interrupt5, "vblank_interrupt2", true); + EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(10000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); } public static void mb87078_gain_changed(int channel, int percent) diff --git a/MAME.Core/mame/taitob/Tilemap.cs b/MAME.Core/mame/taitob/Tilemap.cs index 9dde262..6ab8820 100644 --- a/MAME.Core/mame/taitob/Tilemap.cs +++ b/MAME.Core/mame/taitob/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Taitob { diff --git a/MAME.Core/mame/taitob/Video.cs b/MAME.Core/mame/taitob/Video.cs index 2bc80ee..7049932 100644 --- a/MAME.Core/mame/taitob/Video.cs +++ b/MAME.Core/mame/taitob/Video.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Taitob { diff --git a/MAME.Core/mame/tehkan/Drawgfx.cs b/MAME.Core/mame/tehkan/Drawgfx.cs index 140e4c0..ad3e677 100644 --- a/MAME.Core/mame/tehkan/Drawgfx.cs +++ b/MAME.Core/mame/tehkan/Drawgfx.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Drawgfx { diff --git a/MAME.Core/mame/tehkan/Input.cs b/MAME.Core/mame/tehkan/Input.cs index 61b2a13..e26d802 100644 --- a/MAME.Core/mame/tehkan/Input.cs +++ b/MAME.Core/mame/tehkan/Input.cs @@ -1,6 +1,6 @@ -using MAME.Core.run_interface; +using MAME.Core; -namespace mame +namespace MAME.Core { public partial class Tehkan { diff --git a/MAME.Core/mame/tehkan/Memory.cs b/MAME.Core/mame/tehkan/Memory.cs index 9f09a6d..e50f311 100644 --- a/MAME.Core/mame/tehkan/Memory.cs +++ b/MAME.Core/mame/tehkan/Memory.cs @@ -1,6 +1,6 @@ using cpu.z80; -namespace mame +namespace MAME.Core { public partial class Tehkan { diff --git a/MAME.Core/mame/tehkan/Pbaction.cs b/MAME.Core/mame/tehkan/Pbaction.cs index 825a061..8a086ff 100644 --- a/MAME.Core/mame/tehkan/Pbaction.cs +++ b/MAME.Core/mame/tehkan/Pbaction.cs @@ -1,6 +1,6 @@ using cpu.z80; -namespace mame +namespace MAME.Core { public partial class Tehkan { diff --git a/MAME.Core/mame/tehkan/State.cs b/MAME.Core/mame/tehkan/State.cs index 397aeaa..9cb86e8 100644 --- a/MAME.Core/mame/tehkan/State.cs +++ b/MAME.Core/mame/tehkan/State.cs @@ -1,7 +1,7 @@ using cpu.z80; using System.IO; -namespace mame +namespace MAME.Core { public partial class Tehkan { @@ -26,12 +26,12 @@ namespace mame Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[1].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); - writer.Write(Timer.global_basetime.seconds); - writer.Write(Timer.global_basetime.attoseconds); + writer.Write(EmuTimer.global_basetime.seconds); + writer.Write(EmuTimer.global_basetime.attoseconds); Video.SaveStateBinary(writer); writer.Write(Sound.last_update_second); Cpuexec.SaveStateBinary(writer); - Timer.SaveStateBinary(writer); + EmuTimer.SaveStateBinary(writer); for (i = 0; i < 3; i++) { AY8910.AA8910[i].SaveStateBinary(writer); @@ -67,12 +67,12 @@ namespace mame Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[1].LoadStateBinary(reader); Cpuint.LoadStateBinary(reader); - Timer.global_basetime.seconds = reader.ReadInt32(); - Timer.global_basetime.attoseconds = reader.ReadInt64(); + EmuTimer.global_basetime.seconds = reader.ReadInt32(); + EmuTimer.global_basetime.attoseconds = reader.ReadInt64(); Video.LoadStateBinary(reader); Sound.last_update_second = reader.ReadInt32(); Cpuexec.LoadStateBinary(reader); - Timer.LoadStateBinary(reader); + EmuTimer.LoadStateBinary(reader); for (i = 0; i < 3; i++) { AY8910.AA8910[i].LoadStateBinary(reader); diff --git a/MAME.Core/mame/tehkan/Tilemap.cs b/MAME.Core/mame/tehkan/Tilemap.cs index aa3263d..7308777 100644 --- a/MAME.Core/mame/tehkan/Tilemap.cs +++ b/MAME.Core/mame/tehkan/Tilemap.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public partial class Tehkan { diff --git a/MAME.Core/mame/tehkan/Video.cs b/MAME.Core/mame/tehkan/Video.cs index 9bb0ebf..e6eb191 100644 --- a/MAME.Core/mame/tehkan/Video.cs +++ b/MAME.Core/mame/tehkan/Video.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public partial class Tehkan { diff --git a/MAME.Core/run_interface/Corekey.cs b/MAME.Core/run_interface/Corekey.cs index 5c0630c..f33c987 100644 --- a/MAME.Core/run_interface/Corekey.cs +++ b/MAME.Core/run_interface/Corekey.cs @@ -1,4 +1,4 @@ -namespace MAME.Core.run_interface +namespace MAME.Core { public enum Corekey { diff --git a/MAME.Core/run_interface/IKeyboard.cs b/MAME.Core/run_interface/IKeyboard.cs index 21841c7..de5ac8f 100644 --- a/MAME.Core/run_interface/IKeyboard.cs +++ b/MAME.Core/run_interface/IKeyboard.cs @@ -1,4 +1,4 @@ -namespace MAME.Core.run_interface +namespace MAME.Core { public interface IKeyboard { diff --git a/MAME.Core/run_interface/ILog.cs b/MAME.Core/run_interface/ILog.cs index c1fc649..ca89b0a 100644 --- a/MAME.Core/run_interface/ILog.cs +++ b/MAME.Core/run_interface/ILog.cs @@ -1,4 +1,4 @@ -namespace MAME.Core.run_interface +namespace MAME.Core { public interface ILog { diff --git a/MAME.Core/run_interface/IMouse.cs b/MAME.Core/run_interface/IMouse.cs index 74a2ead..73f9a22 100644 --- a/MAME.Core/run_interface/IMouse.cs +++ b/MAME.Core/run_interface/IMouse.cs @@ -1,7 +1,7 @@ -namespace MAME.Core.run_interface +namespace MAME.Core { public interface IMouse { - void MouseXY(out int X, out int Y,out byte[] MouseButtons); + void MouseXY(out int X, out int Y, out byte[] MouseButtons); } } diff --git a/MAME.Core/run_interface/IResources.cs b/MAME.Core/run_interface/IResources.cs index 1d8a104..5f48e0d 100644 --- a/MAME.Core/run_interface/IResources.cs +++ b/MAME.Core/run_interface/IResources.cs @@ -1,8 +1,8 @@ -namespace MAME.Core.run_interface +namespace MAME.Core { public interface IResources { - byte[] mcu { get; } + byte[] mcu { get; } byte[] sfix { get; } byte[] _000_lo { get; } byte[] sm1 { get; } diff --git a/MAME.Core/run_interface/ISoundPlayer.cs b/MAME.Core/run_interface/ISoundPlayer.cs index 7814554..cc56bd0 100644 --- a/MAME.Core/run_interface/ISoundPlayer.cs +++ b/MAME.Core/run_interface/ISoundPlayer.cs @@ -1,4 +1,4 @@ -namespace MAME.Core.run_interface +namespace MAME.Core { public interface ISoundPlayer { diff --git a/MAME.Core/run_interface/IVideoPlayer.cs b/MAME.Core/run_interface/IVideoPlayer.cs index aadd4b0..eddc082 100644 --- a/MAME.Core/run_interface/IVideoPlayer.cs +++ b/MAME.Core/run_interface/IVideoPlayer.cs @@ -1,4 +1,4 @@ -namespace MAME.Core.run_interface +namespace MAME.Core { public interface IVideoPlayer { diff --git a/MAME.Core/run_interface/MotionKey.cs b/MAME.Core/run_interface/MotionKey.cs index 575afbe..7138755 100644 --- a/MAME.Core/run_interface/MotionKey.cs +++ b/MAME.Core/run_interface/MotionKey.cs @@ -1,4 +1,4 @@ -namespace MAME.Core.run_interface +namespace MAME.Core { public enum MotionKey : byte { diff --git a/MAME.Core/sound/AY8910.cs b/MAME.Core/sound/AY8910.cs index c9dd075..53466df 100644 --- a/MAME.Core/sound/AY8910.cs +++ b/MAME.Core/sound/AY8910.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class AY8910 { diff --git a/MAME.Core/sound/DAC.cs b/MAME.Core/sound/DAC.cs index d53d7d9..eeba0e1 100644 --- a/MAME.Core/sound/DAC.cs +++ b/MAME.Core/sound/DAC.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class DAC { diff --git a/MAME.Core/sound/FM.cs b/MAME.Core/sound/FM.cs index 336f15f..e9c81e9 100644 --- a/MAME.Core/sound/FM.cs +++ b/MAME.Core/sound/FM.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public class FM { @@ -146,7 +146,7 @@ namespace mame { if (Attotime.attotime_compare(ST.busy_expiry_time, Attotime.ATTOTIME_ZERO) != 0) { - if (Attotime.attotime_compare(ST.busy_expiry_time, Timer.get_current_time()) > 0) + if (Attotime.attotime_compare(ST.busy_expiry_time, EmuTimer.get_current_time()) > 0) { return (byte)(ST.status | 0x80); } @@ -157,7 +157,7 @@ namespace mame public void FM_BUSY_SET(int busyclock) { Atime expiry_period = Attotime.attotime_mul(Attotime.ATTOTIME_IN_HZ(ST.clock), (uint)(busyclock * ST.timer_prescaler)); - ST.busy_expiry_time = Attotime.attotime_add(Timer.get_current_time(), expiry_period); + ST.busy_expiry_time = Attotime.attotime_add(EmuTimer.get_current_time(), expiry_period); } private void FM_KEYON(int type, int c, int s) { diff --git a/MAME.Core/sound/FMOpl.cs b/MAME.Core/sound/FMOpl.cs index a173694..226c71f 100644 --- a/MAME.Core/sound/FMOpl.cs +++ b/MAME.Core/sound/FMOpl.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public class FMOpl { diff --git a/MAME.Core/sound/ICS2115.cs b/MAME.Core/sound/ICS2115.cs index 63eb11f..213e541 100644 --- a/MAME.Core/sound/ICS2115.cs +++ b/MAME.Core/sound/ICS2115.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class ICS2115 { @@ -16,7 +16,7 @@ namespace mame public struct timer_struct { public byte scale, preset; - public Timer.emu_timer timer; + public EmuTimer.emu_timer timer; public long period; } public static void ics2115_w(int offset, byte data) @@ -140,9 +140,9 @@ namespace mame { timer[i].period = period; if (period != 0) - Timer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_IN_NSEC(period), Attotime.ATTOTIME_IN_NSEC(period)); + EmuTimer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_IN_NSEC(period), Attotime.ATTOTIME_IN_NSEC(period)); else - Timer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); } } static void reg_write(byte data, bool msb) @@ -334,8 +334,8 @@ namespace mame int i; voice2 = new voice_struct[32]; timer = new timer_struct[2]; - timer[0].timer = Timer.timer_alloc_common(timer_cb_0, "timer_cb_0", false); - timer[1].timer = Timer.timer_alloc_common(timer_cb_1, "timer_cb_1", false); + timer[0].timer = EmuTimer.timer_alloc_common(timer_cb_0, "timer_cb_0", false); + timer[1].timer = EmuTimer.timer_alloc_common(timer_cb_1, "timer_cb_1", false); ulaw = new short[256]; for (i = 0; i < 256; i++) { @@ -410,7 +410,7 @@ namespace mame } for (i = 0; i < 2; i++) { - Timer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(timer[i].timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); timer[i].period = 0; } recalc_irq(); diff --git a/MAME.Core/sound/Iremga20.cs b/MAME.Core/sound/Iremga20.cs index 68f9980..e7ca585 100644 --- a/MAME.Core/sound/Iremga20.cs +++ b/MAME.Core/sound/Iremga20.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class Iremga20 { diff --git a/MAME.Core/sound/K007232.cs b/MAME.Core/sound/K007232.cs index 41a15e0..5c4611d 100644 --- a/MAME.Core/sound/K007232.cs +++ b/MAME.Core/sound/K007232.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class K007232 { diff --git a/MAME.Core/sound/K053260.cs b/MAME.Core/sound/K053260.cs index 3a649d3..4c5e182 100644 --- a/MAME.Core/sound/K053260.cs +++ b/MAME.Core/sound/K053260.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class K053260 { diff --git a/MAME.Core/sound/K054539.cs b/MAME.Core/sound/K054539.cs index ea2a2ce..1daa58d 100644 --- a/MAME.Core/sound/K054539.cs +++ b/MAME.Core/sound/K054539.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace mame +namespace MAME.Core { public class K054539 { @@ -371,7 +371,7 @@ namespace mame } if (irq != null) { - Timer.timer_pulse_internal(new Atime(0, (long)(1e18 / 480)), k054539_irq, "k054539_irq"); + EmuTimer.timer_pulse_internal(new Atime(0, (long)(1e18 / 480)), k054539_irq, "k054539_irq"); } } static void k054539_w(int chip, int offset, byte data) diff --git a/MAME.Core/sound/MSM5205.cs b/MAME.Core/sound/MSM5205.cs index 49c4d3a..71bba42 100644 --- a/MAME.Core/sound/MSM5205.cs +++ b/MAME.Core/sound/MSM5205.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace mame +namespace MAME.Core { public class MSM5205 { @@ -24,7 +24,7 @@ namespace mame public static int[] diff_lookup; public static int[] index_shift = new int[8] { -1, -1, -1, -1, 2, 4, 6, 8 }; public MSM5205Voice voice; - public static Timer.emu_timer[] timer = new Timer.emu_timer[2]; + public static EmuTimer.emu_timer[] timer = new EmuTimer.emu_timer[2]; public static MSM5205[] mm1 = new MSM5205[2]; public static void ComputeTables() { @@ -177,11 +177,11 @@ namespace mame mm1[sndindex].voice.stream = new sound_stream(clock, 0, 1, mm1[sndindex].MSM5205_update); if (sndindex == 0) { - timer[0] = Timer.timer_alloc_common(MSM5205_vclk_callback0, "msm5205_vclk_callback0", false); + timer[0] = EmuTimer.timer_alloc_common(MSM5205_vclk_callback0, "msm5205_vclk_callback0", false); } else if (sndindex == 1) { - timer[1] = Timer.timer_alloc_common(MSM5205_vclk_callback1, "msm5205_vclk_callback1", false); + timer[1] = EmuTimer.timer_alloc_common(MSM5205_vclk_callback1, "msm5205_vclk_callback1", false); } mm1[sndindex].msm5205_reset(); } @@ -241,11 +241,11 @@ namespace mame if (prescaler != 0) { Atime period = Attotime.attotime_mul(Attotime.ATTOTIME_IN_HZ(mm1[num].voice.clock), (uint)prescaler); - Timer.timer_adjust_periodic(timer[num], period, period); + EmuTimer.timer_adjust_periodic(timer[num], period, period); } else { - Timer.timer_adjust_periodic(timer[num], Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(timer[num], Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); } } if (mm1[num].voice.bitwidth != bitwidth) diff --git a/MAME.Core/sound/Namco.cs b/MAME.Core/sound/Namco.cs index 817020d..c21d729 100644 --- a/MAME.Core/sound/Namco.cs +++ b/MAME.Core/sound/Namco.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class Namco { diff --git a/MAME.Core/sound/OKI6295.cs b/MAME.Core/sound/OKI6295.cs index d6c4684..86667ff 100644 --- a/MAME.Core/sound/OKI6295.cs +++ b/MAME.Core/sound/OKI6295.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace mame +namespace MAME.Core { public class OKI6295 { diff --git a/MAME.Core/sound/QSound.cs b/MAME.Core/sound/QSound.cs index d1655c0..b12df15 100644 --- a/MAME.Core/sound/QSound.cs +++ b/MAME.Core/sound/QSound.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace mame +namespace MAME.Core { public struct QSOUND_CHANNEL { diff --git a/MAME.Core/sound/Sample.cs b/MAME.Core/sound/Sample.cs index edab527..deae5a8 100644 --- a/MAME.Core/sound/Sample.cs +++ b/MAME.Core/sound/Sample.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace mame +namespace MAME.Core { public class Sample { diff --git a/MAME.Core/sound/Sound.cs b/MAME.Core/sound/Sound.cs index 2d05cdf..68767dc 100644 --- a/MAME.Core/sound/Sound.cs +++ b/MAME.Core/sound/Sound.cs @@ -1,11 +1,11 @@ -using MAME.Core.run_interface; +using MAME.Core; using System; -namespace mame +namespace MAME.Core { public partial class Sound { - public static Timer.emu_timer sound_update_timer; + public static EmuTimer.emu_timer sound_update_timer; private static int[] leftmix, rightmix; private static byte[] finalmixb; private static int sound_muted; @@ -74,7 +74,7 @@ namespace mame latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateC; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM2151.ym2151_init(3579545); OKI6295.okim6295_start(); ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); @@ -84,7 +84,7 @@ namespace mame case "CPS-1(QSound)": case "CPS2": sound_update = sound_updateQ; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); QSound.qsound_start(); qsoundstream = new sound_stream(4000000 / 166, 0, 2, QSound.qsound_update); mixerstream = new sound_stream(48000, 2, 0, null); @@ -93,7 +93,7 @@ namespace mame latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateDataeast_pcktgal; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM2203.ym2203_start(0, 1500000); YM3812.ym3812_start(3000000); MSM5205.msm5205_start(0, 384000, Dataeast.pcktgal_adpcm_int, 5); @@ -104,7 +104,7 @@ namespace mame latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateTehkan_pbaction; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); AY8910.ay8910_interface generic_ay8910 = new AY8910.ay8910_interface(); generic_ay8910.flags = 1; generic_ay8910.res_load = new int[3] { 1000, 1000, 1000 }; @@ -121,7 +121,7 @@ namespace mame latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateN; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM2610.ym2610_start(8000000); ym2610stream = new sound_stream(111111, 0, 2, YM2610.F2610.ym2610_update_one); mixerstream = new sound_stream(48000, 3, 0, null); @@ -130,7 +130,7 @@ namespace mame latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateSunA8; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM3812.ym3812_start(4000000); AY8910.ay8910_interface starfigh_ay8910_interface = new AY8910.ay8910_interface(); starfigh_ay8910_interface.flags = 1; @@ -147,7 +147,7 @@ namespace mame break; case "Namco System 1": sound_update = sound_updateNa; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM2151.ym2151_init(3579580); Namco.namco_start(); DAC.dac_start(); @@ -168,7 +168,7 @@ namespace mame case "drgnwrldv11h": case "drgnwrldv40k": sound_update = sound_updateIGS011_drgnwrld; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); OKI6295.okim6295_start(); YM3812.ym3812_start(3579545); okistream = new sound_stream(1047600 / 132, 0, 1, OKI6295.okim6295_update); @@ -182,7 +182,7 @@ namespace mame case "xymg": case "wlcc": sound_update = sound_updateIGS011_lhb; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); OKI6295.okim6295_start(); okistream = new sound_stream(1047600 / 132, 0, 1, OKI6295.okim6295_update); mixerstream = new sound_stream(48000, 1, 0, null); @@ -190,7 +190,7 @@ namespace mame case "lhb2": case "nkishusp": sound_update = sound_updateIGS011_lhb2; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); OKI6295.okim6295_start(); YM2413.ym2413_start(3579545); okistream = new sound_stream(1047600 / 132, 0, 1, OKI6295.okim6295_update); @@ -200,7 +200,7 @@ namespace mame case "vbowl": case "vbowlj": sound_update = sound_updateIGS011_vbowl; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); ICS2115.ics2115_start(); ics2115stream = new sound_stream(33075, 0, 2, ICS2115.ics2115_update); mixerstream = new sound_stream(48000, 2, 0, null); @@ -211,7 +211,7 @@ namespace mame latched_value = new ushort[3]; utempdata = new ushort[3]; sound_update = sound_updatePGM; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); ICS2115.ics2115_start(); ics2115stream = new sound_stream(33075, 0, 2, ICS2115.ics2115_update); mixerstream = new sound_stream(48000, 2, 0, null); @@ -220,7 +220,7 @@ namespace mame latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateM72; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM2151.ym2151_init(3579545); DAC.dac_start(); ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); @@ -231,7 +231,7 @@ namespace mame latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateM92; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM2151.ym2151_init(3579545); Iremga20.iremga20_start(); ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); @@ -248,7 +248,7 @@ namespace mame latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateTaito_tokio; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM2203.ym2203_start(0, 3000000); mixerstream = new sound_stream(48000, 4, 0, null); break; @@ -273,7 +273,7 @@ namespace mame latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateTaito_bublbobl; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM2203.ym2203_start(0, 3000000); YM3812.ym3526_start(3000000); ym3526stream = new sound_stream(41666, 0, 1, FMOpl.ym3526_update_one); @@ -288,7 +288,7 @@ namespace mame latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateTaito_opwolf; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); YM2151.ym2151_init(4000000); ym2151stream = new sound_stream(62500, 0, 2, YM2151.ym2151_update_one); MSM5205.msm5205_start(0, 384000, Taito.opwolf_msm5205_vck, 5); @@ -315,7 +315,7 @@ namespace mame AY8910.AA8910[0].stream.gain = 0x100; ym2610stream.gain = 0x100; sound_update = sound_updateTaitoB; - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); mixerstream = new sound_stream(48000, 3, 0, null); break; case "Konami 68000": @@ -441,7 +441,7 @@ namespace mame mixerstream = new sound_stream(48000, 2, 0, null); break; } - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); break; case "Capcom": latched_value = new ushort[1]; @@ -480,10 +480,10 @@ namespace mame mixerstream = new sound_stream(48000, 4, 0, null); break; } - sound_update_timer = Timer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); break; } - Timer.timer_adjust_periodic(sound_update_timer, update_frequency, update_frequency); + EmuTimer.timer_adjust_periodic(sound_update_timer, update_frequency, update_frequency); } public static void sound_reset() { @@ -1702,22 +1702,22 @@ namespace mame public static void soundlatch_w(ushort data) { utempdata[0] = data; - Timer.timer_set_internal(latch_callback, "latch_callback"); + EmuTimer.timer_set_internal(latch_callback, "latch_callback"); } public static void soundlatch2_w(ushort data) { utempdata[1] = data; - Timer.timer_set_internal(latch_callback2, "latch_callback2"); + EmuTimer.timer_set_internal(latch_callback2, "latch_callback2"); } public static void soundlatch3_w(ushort data) { utempdata[2] = data; - Timer.timer_set_internal(latch_callback3, "latch_callback3"); + EmuTimer.timer_set_internal(latch_callback3, "latch_callback3"); } public static void soundlatch4_w(ushort data) { utempdata[3] = data; - Timer.timer_set_internal(latch_callback4, "latch_callback4"); + EmuTimer.timer_set_internal(latch_callback4, "latch_callback4"); } public static ushort soundlatch_r() { diff --git a/MAME.Core/sound/Streams.cs b/MAME.Core/sound/Streams.cs index a717274..42535fd 100644 --- a/MAME.Core/sound/Streams.cs +++ b/MAME.Core/sound/Streams.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public class sound_stream { @@ -39,7 +39,7 @@ namespace mame } public void stream_update() { - int update_sampindex = time_to_sampindex(Timer.get_current_time()); + int update_sampindex = time_to_sampindex(EmuTimer.get_current_time()); int offset, samples; samples = update_sampindex - output_sampindex; if (samples > 0) @@ -1017,7 +1017,7 @@ namespace mame } public static void streams_updateC() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1030,7 +1030,7 @@ namespace mame } private static void streams_updateQ() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1042,7 +1042,7 @@ namespace mame } private static void streams_updateDataeast_pcktgal() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1058,7 +1058,7 @@ namespace mame } private static void streams_updateTehkan() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1075,7 +1075,7 @@ namespace mame } private static void streams_updateN() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1089,7 +1089,7 @@ namespace mame } private static void streams_updateSunA8() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1104,7 +1104,7 @@ namespace mame } private static void streams_updateNa() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1118,7 +1118,7 @@ namespace mame } private static void streams_updateIGS011_drgnwrld() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1131,7 +1131,7 @@ namespace mame } private static void streams_updateIGS011_lhb() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1143,7 +1143,7 @@ namespace mame } private static void streams_updateIGS011_lhb2() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1156,7 +1156,7 @@ namespace mame } private static void streams_updateIGS011_vbowl() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1168,7 +1168,7 @@ namespace mame } private static void streams_updatePGM() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1180,7 +1180,7 @@ namespace mame } private static void streams_updateM72() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1193,7 +1193,7 @@ namespace mame } private static void streams_updateM92() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1206,7 +1206,7 @@ namespace mame } private static void streams_updateTaito_tokio() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1219,7 +1219,7 @@ namespace mame } private static void streams_updateTaito_bublbobl() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1234,7 +1234,7 @@ namespace mame } private static void streams_updateKonami68000_cuebrick() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1246,7 +1246,7 @@ namespace mame } private static void streams_updateKonami68000_mia() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1259,7 +1259,7 @@ namespace mame } private static void streams_updateKonami68000_tmnt() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1274,7 +1274,7 @@ namespace mame } private static void streams_updateKonami68000_glfgreat() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1286,7 +1286,7 @@ namespace mame } private static void streams_updateKonami68000_ssriders() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1299,7 +1299,7 @@ namespace mame } private static void streams_updateKonami68000_prmrsocr() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1311,7 +1311,7 @@ namespace mame } private static void streams_updateCapcom_gng() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { @@ -1328,7 +1328,7 @@ namespace mame } private static void streams_updateCapcom_sf() { - Atime curtime = Timer.global_basetime; + Atime curtime = EmuTimer.global_basetime; bool second_tick = false; if (curtime.seconds != last_update_second) { diff --git a/MAME.Core/sound/Taitosnd.cs b/MAME.Core/sound/Taitosnd.cs index 6cd2e69..75bf5fd 100644 --- a/MAME.Core/sound/Taitosnd.cs +++ b/MAME.Core/sound/Taitosnd.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class Taitosnd { diff --git a/MAME.Core/sound/Upd7759.cs b/MAME.Core/sound/Upd7759.cs index f4e2ee4..d12624e 100644 --- a/MAME.Core/sound/Upd7759.cs +++ b/MAME.Core/sound/Upd7759.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class Upd7759 { @@ -9,7 +9,7 @@ namespace mame public uint pos; public uint step; public Atime clock_period; - public Timer.emu_timer timer; + public EmuTimer.emu_timer timer; public byte fifo_in; public byte reset; @@ -265,7 +265,7 @@ namespace mame } if (chip.state != 0) { - Timer.timer_adjust_periodic(chip.timer, Attotime.attotime_mul(chip.clock_period, (uint)chip.clocks_left), Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(chip.timer, Attotime.attotime_mul(chip.clock_period, (uint)chip.clocks_left), Attotime.ATTOTIME_NEVER); } } public static void upd7759_reset() @@ -291,7 +291,7 @@ namespace mame chip.sample = 0; if (chip.timer != null) { - Timer.timer_adjust_periodic(chip.timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(chip.timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER); } } public static void upd7759_start(int clock) @@ -303,7 +303,7 @@ namespace mame chip.rombase = 0; if (updrom == null) { - chip.timer = Timer.timer_alloc_common(upd7759_slave_update, "upd7759_slave_update", false); + chip.timer = EmuTimer.timer_alloc_common(upd7759_slave_update, "upd7759_slave_update", false); } chip.reset = 1; chip.start = 1; @@ -329,7 +329,7 @@ namespace mame chip.state = 2; if (chip.timer != null) { - Timer.timer_adjust_periodic(chip.timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(chip.timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } } } diff --git a/MAME.Core/sound/WavWrite.cs b/MAME.Core/sound/WavWrite.cs index e7d66f0..92ae311 100644 --- a/MAME.Core/sound/WavWrite.cs +++ b/MAME.Core/sound/WavWrite.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class WavWrite { diff --git a/MAME.Core/sound/YM2151.cs b/MAME.Core/sound/YM2151.cs index 626838b..f5a49ba 100644 --- a/MAME.Core/sound/YM2151.cs +++ b/MAME.Core/sound/YM2151.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace mame +namespace MAME.Core { public class YM2151 { @@ -87,8 +87,8 @@ namespace mame public uint status; public byte[] connect; - public Timer.emu_timer timer_A; - public Timer.emu_timer timer_B; + public EmuTimer.emu_timer timer_A; + public EmuTimer.emu_timer timer_B; public Atime[] timer_A_time; public Atime[] timer_B_time; public int irqlinestate; @@ -450,12 +450,12 @@ namespace mame } public static void timer_callback_a() { - Timer.timer_adjust_periodic(PSG.timer_A, PSG.timer_A_time[PSG.timer_A_index], Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(PSG.timer_A, PSG.timer_A_time[PSG.timer_A_index], Attotime.ATTOTIME_NEVER); PSG.timer_A_index_old = PSG.timer_A_index; if ((PSG.irq_enable & 0x04) != 0) { PSG.status |= 1; - Timer.timer_set_internal(irqAon_callback, "irqAon_callback"); + EmuTimer.timer_set_internal(irqAon_callback, "irqAon_callback"); } if ((PSG.irq_enable & 0x80) != 0) { @@ -464,12 +464,12 @@ namespace mame } public static void timer_callback_b() { - Timer.timer_adjust_periodic(PSG.timer_B, PSG.timer_B_time[PSG.timer_B_index], Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(PSG.timer_B, PSG.timer_B_time[PSG.timer_B_index], Attotime.ATTOTIME_NEVER); PSG.timer_B_index_old = PSG.timer_B_index; if ((PSG.irq_enable & 0x08) != 0) { PSG.status |= 2; - Timer.timer_set_internal(irqBon_callback, "irqBon_callback"); + EmuTimer.timer_set_internal(irqBon_callback, "irqBon_callback"); } } private static void set_connect(int cha, int v) @@ -706,42 +706,42 @@ namespace mame if ((v & 0x10) != 0) /* reset timer A irq flag */ { PSG.status &= 0xfffffffe; - Timer.timer_set_internal(irqAoff_callback, "irqAoff_callback"); + EmuTimer.timer_set_internal(irqAoff_callback, "irqAoff_callback"); } if ((v & 0x20) != 0) /* reset timer B irq flag */ { PSG.status &= 0xfffffffd; - Timer.timer_set_internal(irqBoff_callback, "irqBoff_callback"); + EmuTimer.timer_set_internal(irqBoff_callback, "irqBoff_callback"); } if ((v & 0x02) != 0) { /* load and start timer B */ /* ASG 980324: added a real timer */ /* start timer _only_ if it wasn't already started (it will reload time value next round) */ - if (!Timer.timer_enable(PSG.timer_B, true)) + if (!EmuTimer.timer_enable(PSG.timer_B, true)) { - Timer.timer_adjust_periodic(PSG.timer_B, PSG.timer_B_time[PSG.timer_B_index], Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(PSG.timer_B, PSG.timer_B_time[PSG.timer_B_index], Attotime.ATTOTIME_NEVER); PSG.timer_B_index_old = PSG.timer_B_index; } } else { /* stop timer B */ /* ASG 980324: added a real timer */ - Timer.timer_enable(PSG.timer_B, false); + EmuTimer.timer_enable(PSG.timer_B, false); } if ((v & 0x01) != 0) { /* load and start timer A */ /* ASG 980324: added a real timer */ /* start timer _only_ if it wasn't already started (it will reload time value next round) */ - if (!Timer.timer_enable(PSG.timer_A, true)) + if (!EmuTimer.timer_enable(PSG.timer_A, true)) { - Timer.timer_adjust_periodic(PSG.timer_A, PSG.timer_A_time[PSG.timer_A_index], Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(PSG.timer_A, PSG.timer_A_time[PSG.timer_A_index], Attotime.ATTOTIME_NEVER); PSG.timer_A_index_old = PSG.timer_A_index; } } else { /* stop timer A */ /* ASG 980324: added a real timer */ - Timer.timer_enable(PSG.timer_A, false); + EmuTimer.timer_enable(PSG.timer_A, false); } break; case 0x18: /* LFO frequency */ @@ -934,8 +934,8 @@ namespace mame PSG.eg_timer_add = (uint)(0x10000 * (clock / 64.0) / PSG.sampfreq); PSG.eg_timer_overflow = 0x30000; /* this must be done _before_ a call to ym2151_reset_chip() */ - PSG.timer_A = Timer.timer_alloc_common(timer_callback_a, "timer_callback_a", false); - PSG.timer_B = Timer.timer_alloc_common(timer_callback_b, "timer_callback_b", false); + PSG.timer_A = EmuTimer.timer_alloc_common(timer_callback_a, "timer_callback_a", false); + PSG.timer_B = EmuTimer.timer_alloc_common(timer_callback_b, "timer_callback_b", false); ym2151_reset_chip(); switch (Machine.sBoard) { @@ -1013,8 +1013,8 @@ namespace mame PSG.test = 0; PSG.irq_enable = 0; /* ASG 980324 -- reset the timers before writing to the registers */ - Timer.timer_enable(PSG.timer_A, false); - Timer.timer_enable(PSG.timer_B, false); + EmuTimer.timer_enable(PSG.timer_A, false); + EmuTimer.timer_enable(PSG.timer_B, false); PSG.timer_A_index = 0; PSG.timer_B_index = 0; PSG.timer_A_index_old = 0; diff --git a/MAME.Core/sound/YM2203.cs b/MAME.Core/sound/YM2203.cs index 085fd6e..c222168 100644 --- a/MAME.Core/sound/YM2203.cs +++ b/MAME.Core/sound/YM2203.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class YM2203 { @@ -8,7 +8,7 @@ namespace mame public FM.FM_OPN OPN; public sound_stream stream; public static YM2203[] FF2203 = new YM2203[2]; - public Timer.emu_timer[] timer; + public EmuTimer.emu_timer[] timer; public static void timer_callback_2203_0_0() { FF2203[0].ym2203_timer_over(0); @@ -29,14 +29,14 @@ namespace mame { if (count == 0) { - Timer.timer_enable(timer[c], false); + EmuTimer.timer_enable(timer[c], false); } else { Atime period = Attotime.attotime_mul(new Atime(0, Attotime.ATTOSECONDS_PER_SECOND / clock), (uint)count); - if (!Timer.timer_enable(timer[c], true)) + if (!EmuTimer.timer_enable(timer[c], true)) { - Timer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); } } } @@ -140,16 +140,16 @@ namespace mame FMOpl.sin_tab = new uint[0x1000]; int rate = clock / 72; AY8910.ay8910_start_ym(14, sndindex, clock, generic_2203); - FF2203[sndindex].timer = new Timer.emu_timer[2]; + FF2203[sndindex].timer = new EmuTimer.emu_timer[2]; if (sndindex == 0) { - FF2203[sndindex].timer[0] = Timer.timer_alloc_common(timer_callback_2203_0_0, "timer_callback_2203_0_0", false); - FF2203[sndindex].timer[1] = Timer.timer_alloc_common(timer_callback_2203_0_1, "timer_callback_2203_0_1", false); + FF2203[sndindex].timer[0] = EmuTimer.timer_alloc_common(timer_callback_2203_0_0, "timer_callback_2203_0_0", false); + FF2203[sndindex].timer[1] = EmuTimer.timer_alloc_common(timer_callback_2203_0_1, "timer_callback_2203_0_1", false); } else if (sndindex == 1) { - FF2203[sndindex].timer[0] = Timer.timer_alloc_common(timer_callback_2203_1_0, "timer_callback_2203_1_0", false); - FF2203[sndindex].timer[1] = Timer.timer_alloc_common(timer_callback_2203_1_1, "timer_callback_2203_1_1", false); + FF2203[sndindex].timer[0] = EmuTimer.timer_alloc_common(timer_callback_2203_1_0, "timer_callback_2203_1_0", false); + FF2203[sndindex].timer[1] = EmuTimer.timer_alloc_common(timer_callback_2203_1_1, "timer_callback_2203_1_1", false); } FF2203[sndindex].stream = new sound_stream(rate, 0, 1, FF2203[sndindex].ym2203_update_one); ym2203_init(sndindex, clock, rate); diff --git a/MAME.Core/sound/YM2413.cs b/MAME.Core/sound/YM2413.cs index c0a68ab..1203b31 100644 --- a/MAME.Core/sound/YM2413.cs +++ b/MAME.Core/sound/YM2413.cs @@ -1,6 +1,6 @@ using System; -namespace mame +namespace MAME.Core { public class YM2413 { diff --git a/MAME.Core/sound/YM2610.cs b/MAME.Core/sound/YM2610.cs index 5328fd0..530f8cc 100644 --- a/MAME.Core/sound/YM2610.cs +++ b/MAME.Core/sound/YM2610.cs @@ -1,6 +1,6 @@ using System.IO; -namespace mame +namespace MAME.Core { public class YM2610 { @@ -14,7 +14,7 @@ namespace mame public byte[] adpcmreg; public byte adpcm_arrivedEndAddress; public static YM2610 F2610 = new YM2610(); - public static Timer.emu_timer[] timer; + public static EmuTimer.emu_timer[] timer; public void timer_callback_0() { F2610.ym2610_timer_over(0); @@ -27,14 +27,14 @@ namespace mame { if (count == 0) { - Timer.timer_enable(timer[c], false); + EmuTimer.timer_enable(timer[c], false); } else { Atime period = Attotime.attotime_mul(new Atime(0, Attotime.ATTOSECONDS_PER_SECOND / clock), (uint)count);//8000000 - if (!Timer.timer_enable(timer[c], true)) + if (!EmuTimer.timer_enable(timer[c], true)) { - Timer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); } } } @@ -99,9 +99,9 @@ namespace mame generic_ay8910.portBwrite = null; int rate = clock / 72; AY8910.ay8910_start_ym(17, 0, clock, generic_ay8910); - timer = new Timer.emu_timer[2]; - timer[0] = Timer.timer_alloc_common(F2610.timer_callback_0, "timer_callback_0", false); - timer[1] = Timer.timer_alloc_common(F2610.timer_callback_1, "timer_callback_1", false); + timer = new EmuTimer.emu_timer[2]; + timer[0] = EmuTimer.timer_alloc_common(F2610.timer_callback_0, "timer_callback_0", false); + timer[1] = EmuTimer.timer_alloc_common(F2610.timer_callback_1, "timer_callback_1", false); ym2610_init(clock, rate); } public static void ym2610_init(int clock, int rate) diff --git a/MAME.Core/sound/YM3812.cs b/MAME.Core/sound/YM3812.cs index b515498..dcab901 100644 --- a/MAME.Core/sound/YM3812.cs +++ b/MAME.Core/sound/YM3812.cs @@ -1,10 +1,10 @@ using System.IO; -namespace mame +namespace MAME.Core { public class YM3812 { - public static Timer.emu_timer[] timer; + public static EmuTimer.emu_timer[] timer; public delegate void ym3812_delegate(LineState linestate); public static ym3812_delegate ym3812handler; public static void IRQHandler_3812(int irq) @@ -26,11 +26,11 @@ namespace mame { if (Attotime.attotime_compare(period, Attotime.ATTOTIME_ZERO) == 0) { - Timer.timer_enable(timer[c], false); + EmuTimer.timer_enable(timer[c], false); } else { - Timer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); } } public static void _stream_update_3812(int interval) @@ -41,7 +41,7 @@ namespace mame { FMOpl.tl_tab = new int[0x1800]; FMOpl.sin_tab = new uint[0x1000]; - timer = new Timer.emu_timer[2]; + timer = new EmuTimer.emu_timer[2]; int rate = clock / 72; switch (Machine.sName) { @@ -74,8 +74,8 @@ namespace mame FMOpl.ym3812_set_timer_handler(TimerHandler_3812); FMOpl.ym3812_set_irq_handler(IRQHandler_3812); FMOpl.ym3812_set_update_handler(_stream_update_3812); - timer[0] = Timer.timer_alloc_common(timer_callback_3812_0, "timer_callback_3812_0", false); - timer[1] = Timer.timer_alloc_common(timer_callback_3812_1, "timer_callback_3812_1", false); + timer[0] = EmuTimer.timer_alloc_common(timer_callback_3812_0, "timer_callback_3812_0", false); + timer[1] = EmuTimer.timer_alloc_common(timer_callback_3812_1, "timer_callback_3812_1", false); } public static void ym3812_control_port_0_w(byte data) { @@ -214,11 +214,11 @@ namespace mame { if (Attotime.attotime_compare(period, Attotime.ATTOTIME_ZERO) == 0) { - Timer.timer_enable(timer[c], false); + EmuTimer.timer_enable(timer[c], false); } else { - Timer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); + EmuTimer.timer_adjust_periodic(timer[c], period, Attotime.ATTOTIME_NEVER); } } public static void _stream_update_3526(int interval) @@ -229,12 +229,12 @@ namespace mame { int rate = clock / 72; FMOpl.YM3526 = FMOpl.ym3526_init(0, clock, rate); - timer = new Timer.emu_timer[2]; + timer = new EmuTimer.emu_timer[2]; FMOpl.ym3526_set_timer_handler(TimerHandler_3526); FMOpl.ym3526_set_irq_handler(IRQHandler_3526); FMOpl.ym3526_set_update_handler(_stream_update_3526); - timer[0] = Timer.timer_alloc_common(timer_callback_3526_0, "timer_callback_3526_0", false); - timer[1] = Timer.timer_alloc_common(timer_callback_3526_1, "timer_callback_3526_1", false); + timer[0] = EmuTimer.timer_alloc_common(timer_callback_3526_0, "timer_callback_3526_0", false); + timer[1] = EmuTimer.timer_alloc_common(timer_callback_3526_1, "timer_callback_3526_1", false); } public static void ym3526_control_port_0_w(byte data) { diff --git a/MAME.Core/sound/YMDeltat.cs b/MAME.Core/sound/YMDeltat.cs index 74a463d..41ca872 100644 --- a/MAME.Core/sound/YMDeltat.cs +++ b/MAME.Core/sound/YMDeltat.cs @@ -1,4 +1,4 @@ -namespace mame +namespace MAME.Core { public class YMDeltat {