整理模拟器核心

This commit is contained in:
sin365 2024-08-28 13:01:43 +08:00
parent 8bd8c27772
commit 5310a9923a
194 changed files with 761 additions and 745 deletions

View File

@ -24,7 +24,7 @@ namespace MAME.Core.AxiBitmap
sdColor = 0; sdColor = 0;
r = _r; r = _r;
g = _g; g = _g;
b = _b; b = _b;
a = byte.MaxValue; a = byte.MaxValue;
} }
public AxiColor(byte _r, byte _g, byte _b, byte _a) public AxiColor(byte _r, byte _g, byte _b, byte _a)

View File

@ -1,7 +1,7 @@
using MAME.Core.run_interface; using MAME.Core;
using System; using System;
namespace mame namespace MAME.Core
{ {
public static class EmuLogger public static class EmuLogger
{ {

38
MAME.Core/MAMEEmu.cs Normal file
View File

@ -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<string, RomInfo> 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();
}
}
}

View File

@ -1,12 +1,11 @@
using mame; using MAME.Core;
using MAME.Core.run_interface;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Xml.Linq; using System.Xml.Linq;
namespace MAME.Core.Motion namespace MAME.Core
{ {
public class MameMainMotion public class MameMainMotion
{ {
@ -71,7 +70,7 @@ namespace MAME.Core.Motion
return RomInfo.dictName2Rom; 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; //_width = Video.fullwidth;
//_height = Video.fullheight; //_height = Video.fullheight;
@ -110,7 +109,7 @@ namespace MAME.Core.Motion
return; return;
} }
mame.Timer.lt = new List<mame.Timer.emu_timer>(); EmuTimer.lt = new List<EmuTimer.emu_timer>();
sSelect = RomInfo.Rom.Name; sSelect = RomInfo.Rom.Name;
Machine.mainMotion = this; Machine.mainMotion = this;
Machine.rom = RomInfo.Rom; Machine.rom = RomInfo.Rom;
@ -230,8 +229,8 @@ namespace MAME.Core.Motion
M68000Motion.iStatus = 0; M68000Motion.iStatus = 0;
M68000Motion.iValue = 0; M68000Motion.iValue = 0;
Mame.exit_pending = false; Mame.exit_pending = false;
MameMainMotion.mainThread = new Thread(Mame.mame_execute); mainThread = new Thread(Mame.mame_execute);
MameMainMotion.mainThread.Start(); mainThread.Start();
} }
public void StopGame() public void StopGame()

View File

@ -1,10 +1,9 @@
using cpu.m68000; using cpu.m68000;
using cpu.nec; using cpu.nec;
using mame;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace MAME.Core.Motion namespace MAME.Core
{ {
public partial class CheatMotion public partial class CheatMotion
{ {

View File

@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace MAME.Core.Motion namespace MAME.Core
{ {
public partial class CpsMotion public partial class CpsMotion
{ {

View File

@ -1,4 +1,4 @@
namespace MAME.Core.Motion namespace MAME.Core
{ {
public class Konami68000Motion public class Konami68000Motion
{ {

View File

@ -2,7 +2,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace MAME.Core.Motion namespace MAME.Core
{ {
public class M68000Motion public class M68000Motion
{ {

View File

@ -1,8 +1,7 @@
using cpu.m6809; using cpu.m6809;
using mame;
using System.Collections.Generic; using System.Collections.Generic;
namespace MAME.Core.Motion namespace MAME.Core
{ {
public partial class M6809Motion public partial class M6809Motion

View File

@ -1,9 +1,6 @@
using mame; using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
namespace MAME.Core.Motion namespace MAME.Core
{ {
public partial class NeogeoMotion public partial class NeogeoMotion
{ {

View File

@ -1,7 +1,7 @@
using cpu.z80; using cpu.z80;
using System.Collections.Generic; using System.Collections.Generic;
namespace MAME.Core.Motion namespace MAME.Core
{ {
public enum CPUState public enum CPUState
{ {

View File

@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<History>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||;</History> <History>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||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
using System; using System;
using System.IO; using System.IO;
//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) 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) private void m6502_set_irq_line(int irqline, LineState state)
{ {

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
namespace cpu.m6502 namespace cpu.m6502
{ {

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
using System; using System;
using System.IO; using System.IO;
@ -26,7 +26,7 @@ namespace cpu.m6800
public byte trcsr, rmcr, rdr, tdr, rsr, tsr; public byte trcsr, rmcr, rdr, tdr, rsr, tsr;
public int rxbits, txbits, trcsr_read, tx; public int rxbits, txbits, trcsr_read, tx;
public M6800_TX_STATE txstate; 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; 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; protected byte M6800_WAI = 8, M6800_SLP = 0x10;
private const byte M6800_IRQ_LINE = 0, M6800_TIN_LINE = 1; private const byte M6800_IRQ_LINE = 0, M6800_TIN_LINE = 1;
@ -246,8 +246,8 @@ namespace cpu.m6800
cycles = cycles_63701; cycles = cycles_63701;
clock = 1536000; clock = 1536000;
irq_callback = null; irq_callback = null;
m6800_rx_timer = Timer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false); m6800_rx_timer = EmuTimer.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_tx_timer = EmuTimer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
} }
public override void Reset() public override void Reset()
{ {
@ -844,8 +844,8 @@ namespace cpu.m6800
ram_ctrl |= 0x40; ram_ctrl |= 0x40;
trcsr = M6800_TRCSR_TDRE; trcsr = M6800_TRCSR_TDRE;
rmcr = 0; rmcr = 0;
Timer.timer_enable(m6800_rx_timer, false); EmuTimer.timer_enable(m6800_rx_timer, false);
Timer.timer_enable(m6800_tx_timer, false); EmuTimer.timer_enable(m6800_tx_timer, false);
txstate = M6800_TX_STATE.INIT; txstate = M6800_TX_STATE.INIT;
txbits = rxbits = 0; txbits = rxbits = 0;
trcsr_read = 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) 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) public override int ExecuteCycles(int cycles)
{ {
@ -1167,16 +1167,16 @@ namespace cpu.m6800
{ {
case 0: case 0:
case 3: // not implemented case 3: // not implemented
Timer.timer_enable(m6800_rx_timer, false); EmuTimer.timer_enable(m6800_rx_timer, false);
Timer.timer_enable(m6800_tx_timer, false); EmuTimer.timer_enable(m6800_tx_timer, false);
break; break;
case 1: case 1:
case 2: case 2:
{ {
int divisor = M6800_RMCR_SS[rmcr & M6800_RMCR_SS_MASK]; 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)))); EmuTimer.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_tx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor))));
} }
break; break;
} }
@ -1345,8 +1345,8 @@ namespace cpu.m6800
}; };
clock = 1000000; clock = 1000000;
irq_callback = Cpuint.cpu_3_irq_callback; irq_callback = Cpuint.cpu_3_irq_callback;
m6800_rx_timer = Timer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false); m6800_rx_timer = EmuTimer.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_tx_timer = EmuTimer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
} }
public override int ExecuteCycles(int cycles) public override int ExecuteCycles(int cycles)
{ {

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
namespace cpu.m6800 namespace cpu.m6800
{ {

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
using System; using System;
using System.Globalization; using System.Globalization;
using System.IO; 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) 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() public void Pulse_Reset()
{ {

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
using System; using System;
using System.IO; 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) 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) public override int ExecuteCycles(int cycles)
{ {

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
namespace cpu.m6805 namespace cpu.m6805
{ {

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
using System; using System;
using System.IO; 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) 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) public override int ExecuteCycles(int cycles)
{ {

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
namespace cpu.m6809 namespace cpu.m6809
{ {

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
using System; using System;
using System.IO; using System.IO;
@ -61,7 +61,7 @@ namespace cpu.nec
{ {
if (line >= 0 && line < 35) 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]++; int event_index = Cpuint.input_event_index[cpunum, line]++;
if (event_index >= 35) if (event_index >= 35)
{ {
@ -74,7 +74,7 @@ namespace cpu.nec
//Cpuint.input_event_queue[cpunum][line][event_index] = input_event; //Cpuint.input_event_queue[cpunum][line][event_index] = input_event;
//if (event_index == 0) //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");
} }
} }
} }

View File

@ -1,4 +1,4 @@
using mame; using MAME.Core;
using System; using System;
using System.Globalization; using System.Globalization;
using System.IO; 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) public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
{ {
Atime time1; Atime time1;
time1 = Timer.get_current_time(); time1 = EmuTimer.get_current_time();
bool b1 = false; bool b1 = false;
foreach (irq irq1 in Cpuint.lirq) foreach (irq irq1 in Cpuint.lirq)
{ {
@ -109,7 +109,7 @@ namespace cpu.z80
} }
else 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");
} }
} }

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public struct Atime public struct Atime
{ {

View File

@ -5,11 +5,10 @@ using cpu.m6805;
using cpu.m6809; using cpu.m6809;
using cpu.nec; using cpu.nec;
using cpu.z80; using cpu.z80;
using MAME.Core.Motion;
using System; using System;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public class cpuexec_data public class cpuexec_data
{ {
@ -26,7 +25,7 @@ namespace mame
public int cycles_running; public int cycles_running;
public int cycles_stolen; public int cycles_stolen;
public int icount; public int icount;
public Timer.emu_timer partial_frame_timer; public EmuTimer.emu_timer partial_frame_timer;
public Atime partial_frame_period; public Atime partial_frame_period;
public virtual ulong TotalExecutedCycles { get; set; } public virtual ulong TotalExecutedCycles { get; set; }
public virtual int PendingCycles { 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 bool b11 = true, b12 = true, b13 = true, b14 = true;
public static int iloops, activecpu, icpu, ncpu, iloops2; public static int iloops, activecpu, icpu, ncpu, iloops2;
public static cpuexec_data[] cpu; 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 static Atime timedint_period, timeslice_period;
public delegate void vblank_delegate(); public delegate void vblank_delegate();
public static vblank_delegate vblank_interrupt; public static vblank_delegate vblank_interrupt;
public static Action vblank_interrupt2; public static Action vblank_interrupt2;
public static Timer.emu_timer interleave_boost_timer; public static EmuTimer.emu_timer interleave_boost_timer;
public static Timer.emu_timer interleave_boost_timer_end; public static EmuTimer.emu_timer interleave_boost_timer_end;
public static Timer.emu_timer timeslice_timer; public static EmuTimer.emu_timer timeslice_timer;
public static Atime perfect_interleave; public static Atime perfect_interleave;
public static int vblank_interrupts_per_frame; public static int vblank_interrupts_per_frame;
public static void cpuexec_init() public static void cpuexec_init()
@ -2295,7 +2294,7 @@ namespace mame
Generic.irq_1_0_line_hold(); Generic.irq_1_0_line_hold();
if (iloops2 > 1) 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) public static byte null_callback1(int address)
@ -2321,12 +2320,12 @@ namespace mame
case "CPS-1(QSound)": case "CPS-1(QSound)":
case "CPS2": case "CPS2":
timedint_period = new Atime(0, (long)(1e18 / 250)); 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); timedint_timer = EmuTimer.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); EmuTimer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period);
break; break;
case "Neo Geo": case "Neo Geo":
interleave_boost_timer = Timer.timer_alloc_common(null_callback, "boost_callback", false); interleave_boost_timer = EmuTimer.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_end = EmuTimer.timer_alloc_common(end_interleave_boost, "end_interleave_boost", false);
break; break;
case "CPS1": case "CPS1":
case "Namco System 1": case "Namco System 1":
@ -2372,8 +2371,8 @@ namespace mame
case "bublcave11": case "bublcave11":
case "bublcave10": case "bublcave10":
timeslice_period = new Atime(0, Video.screenstate.frame_period / 100); timeslice_period = new Atime(0, Video.screenstate.frame_period / 100);
timeslice_timer = Timer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); timeslice_timer = EmuTimer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false);
Timer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period);
break; break;
case "opwolf": case "opwolf":
case "opwolfa": case "opwolfa":
@ -2382,15 +2381,15 @@ namespace mame
case "opwolfb": case "opwolfb":
case "opwolfp": case "opwolfp":
timeslice_period = new Atime(0, Video.screenstate.frame_period / 10); timeslice_period = new Atime(0, Video.screenstate.frame_period / 10);
timeslice_timer = Timer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); timeslice_timer = EmuTimer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false);
Timer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period);
break; break;
} }
break; break;
case "Taito B": case "Taito B":
timeslice_period = new Atime(0, Video.screenstate.frame_period / 10); timeslice_period = new Atime(0, Video.screenstate.frame_period / 10);
timeslice_timer = Timer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); timeslice_timer = EmuTimer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false);
Timer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period);
break; break;
case "Capcom": case "Capcom":
switch (Machine.sName) switch (Machine.sName)
@ -2415,8 +2414,8 @@ namespace mame
case "sfan": case "sfan":
case "sfp": case "sfp":
timedint_period = new Atime(0, (long)(1e18 / 8000)); 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); timedint_timer = EmuTimer.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); EmuTimer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period);
break; break;
} }
break; break;
@ -2424,8 +2423,8 @@ namespace mame
} }
public static void cpuexec_timeslice() public static void cpuexec_timeslice()
{ {
Atime target = Timer.lt[0].expire; Atime target = EmuTimer.lt[0].expire;
Atime tbase = Timer.global_basetime; Atime tbase = EmuTimer.global_basetime;
int ran; int ran;
Atime at; Atime at;
int i, j; int i, j;
@ -2471,8 +2470,8 @@ namespace mame
cpu[icpu].suspend = cpu[icpu].nextsuspend; cpu[icpu].suspend = cpu[icpu].nextsuspend;
cpu[icpu].eatcycles = cpu[icpu].nexteatcycles; cpu[icpu].eatcycles = cpu[icpu].nexteatcycles;
} }
Timer.timer_set_global_time(target); EmuTimer.timer_set_global_time(target);
if (Timer.global_basetime.attoseconds == 0 && Machine.mainMotion.cheatmotion.lockState == CheatMotion.LockState.LOCK_SECOND) if (EmuTimer.global_basetime.attoseconds == 0 && Machine.mainMotion.cheatmotion.lockState == CheatMotion.LockState.LOCK_SECOND)
{ {
Machine.mainMotion.cheatmotion.ApplyCheat(); Machine.mainMotion.cheatmotion.ApplyCheat();
} }
@ -2481,9 +2480,9 @@ namespace mame
{ {
if (Attotime.attotime_compare(timeslice_time, perfect_interleave) < 0) if (Attotime.attotime_compare(timeslice_time, perfect_interleave) < 0)
timeslice_time = perfect_interleave; timeslice_time = perfect_interleave;
Timer.timer_adjust_periodic(interleave_boost_timer, timeslice_time, timeslice_time); EmuTimer.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) if (!EmuTimer.timer_enabled(interleave_boost_timer_end) || Attotime.attotime_compare(EmuTimer.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_end, boost_duration, Attotime.ATTOTIME_NEVER);
} }
public static void activecpu_abort_timeslice(int cpunum) public static void activecpu_abort_timeslice(int cpunum)
{ {
@ -2564,7 +2563,7 @@ namespace mame
case "CPS2": case "CPS2":
iloops = 0; iloops = 0;
CPS.cps2_interrupt(); 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; break;
case "Data East": case "Data East":
Generic.nmi_line_pulse0(); Generic.nmi_line_pulse0();
@ -2573,7 +2572,7 @@ namespace mame
iloops = 0; iloops = 0;
vblank_interrupt(); vblank_interrupt();
Tehkan.pbaction_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; break;
case "Neo Geo": case "Neo Geo":
break; break;
@ -2581,8 +2580,8 @@ namespace mame
iloops = 0; iloops = 0;
iloops2 = 0; iloops2 = 0;
Generic.irq_1_0_line_hold(); 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); EmuTimer.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[1].partial_frame_timer, Cpuexec.cpu[1].partial_frame_period, Attotime.ATTOTIME_NEVER);
break; break;
case "Namco System 1": case "Namco System 1":
for (int cpunum = 0; cpunum < ncpu; cpunum++) for (int cpunum = 0; cpunum < ncpu; cpunum++)
@ -2606,7 +2605,7 @@ namespace mame
case "drgnwrldv40k": case "drgnwrldv40k":
iloops = 0; iloops = 0;
IGS011.lhb2_interrupt(); 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; break;
case "lhb": case "lhb":
case "lhbv33c": case "lhbv33c":
@ -2614,7 +2613,7 @@ namespace mame
case "ryukobou": case "ryukobou":
iloops = 0; iloops = 0;
IGS011.lhb_interrupt(); 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;
} }
break; break;
@ -2624,7 +2623,7 @@ namespace mame
case "M72": case "M72":
iloops = 0; iloops = 0;
vblank_interrupt(); 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; break;
case "M92": case "M92":
break; break;
@ -2677,7 +2676,7 @@ namespace mame
} }
iloops = 0; iloops = 0;
vblank_interrupt(); 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; break;
case "opwolf": case "opwolf":
case "opwolfa": case "opwolfa":
@ -2714,7 +2713,7 @@ namespace mame
case "cuebrick": case "cuebrick":
iloops = 0; iloops = 0;
vblank_interrupt(); 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; break;
default: default:
vblank_interrupt(); vblank_interrupt();
@ -2741,7 +2740,7 @@ namespace mame
} }
iloops = 0; iloops = 0;
vblank_interrupt(); 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; break;
case "sf": case "sf":
case "sfua": case "sfua":
@ -2772,7 +2771,7 @@ namespace mame
vblank_interrupt(); vblank_interrupt();
if (iloops > 1) 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; break;
case "Tehkan": case "Tehkan":
@ -2784,7 +2783,7 @@ namespace mame
Tehkan.pbaction_interrupt(); Tehkan.pbaction_interrupt();
if (iloops > 1) 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; break;
case "SunA8": case "SunA8":
@ -2796,7 +2795,7 @@ namespace mame
SunA8.hardhea2_interrupt(); SunA8.hardhea2_interrupt();
if (iloops > 1) 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; break;
case "M72": case "M72":
@ -2808,7 +2807,7 @@ namespace mame
vblank_interrupt(); vblank_interrupt();
if (iloops > 1) 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; break;
case "Taito": case "Taito":
@ -2823,7 +2822,7 @@ namespace mame
vblank_interrupt(); vblank_interrupt();
if (iloops > 1) 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; break;
} }
@ -2850,7 +2849,7 @@ namespace mame
vblank_interrupt(); vblank_interrupt();
if (iloops > 1) 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; break;
} }
@ -2863,7 +2862,7 @@ namespace mame
} }
public static void end_interleave_boost() 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() public static void compute_perfect_interleave()
{ {

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace mame namespace MAME.Core
{ {
[StructLayout(LayoutKind.Explicit)] [StructLayout(LayoutKind.Explicit)]
[Serializable()] [Serializable()]
@ -134,7 +134,7 @@ namespace mame
public static void cpunum_set_input_line(int cpunum, int line, LineState state) public static void cpunum_set_input_line(int cpunum, int line, LineState state)
{ {
int vector = (line >= 0 && line < 35) ? interrupt_vector[cpunum, line] : 0xff; 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); 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) 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) if (line >= 0 && line < 35)
{ {
lirq.Add(new irq(cpunum, line, state, vector, Timer.get_current_time())); lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time()));
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 static void cpunum_empty_event_queue() public static void cpunum_empty_event_queue()
@ -162,7 +162,7 @@ namespace mame
} }
foreach (irq irq1 in lirq) 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_state[irq1.cpunum, irq1.line] = (byte)irq1.state;
input_line_vector[irq1.cpunum, irq1.line] = irq1.vector; input_line_vector[irq1.cpunum, irq1.line] = irq1.vector;

View File

@ -1,7 +1,4 @@
 namespace MAME.Core
using Color = MAME.Core.AxiBitmap.AxiColor;
namespace mame
{ {
public class Crosshair public class Crosshair
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Drawgfx public partial class Drawgfx
{ {

View File

@ -1,6 +1,6 @@
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
/*public enum eeprom_command /*public enum eeprom_command
{ {

View File

@ -3,9 +3,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public class Timer public class EmuTimer
{ {
public static List<emu_timer> lt; public static List<emu_timer> lt;
private static List<emu_timer2> lt2; private static List<emu_timer2> lt2;

View File

@ -1,9 +1,8 @@
using MAME.Core.AxiBitmap; using MAME.Core.AxiBitmap;
using System; using System;
using static MAME.Core.AxiBitmap.AxiBitmapEx;
using Color = MAME.Core.AxiBitmap.AxiColor; using Color = MAME.Core.AxiBitmap.AxiColor;
namespace mame namespace MAME.Core
{ {
partial class Video partial class Video
{ {

View File

@ -1,7 +1,7 @@
using cpu.m68000; using cpu.m68000;
using System; using System;
namespace mame namespace MAME.Core
{ {
public class Generic public class Generic
{ {
@ -157,7 +157,7 @@ namespace mame
if (enabled == 0) if (enabled == 0)
{ {
objcpunum = cpunum; 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) public static void interrupt_enable_w(byte data)

View File

@ -1,6 +1,6 @@
using MAME.Core.run_interface; using MAME.Core;
namespace mame namespace MAME.Core
{ {
public class analog_field_state public class analog_field_state
{ {
@ -564,7 +564,7 @@ namespace mame
value = analog.accum; value = analog.accum;
if (analog.interpolate && portdata.last_delta_nsec != 0) 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)); value = (int)(analog.previous + ((long)(analog.accum - analog.previous) * nsec_since_last / portdata.last_delta_nsec));
} }
result = (uint)apply_analog_settings(value, analog); result = (uint)apply_analog_settings(value, analog);
@ -600,7 +600,7 @@ namespace mame
} }
private static void frame_update() 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_delta_nsec = Attotime.attotime_to_attoseconds(Attotime.attotime_sub(curtime, portdata.last_frame_time)) / Attotime.ATTOSECONDS_PER_NANOSECOND;
portdata.last_frame_time = curtime; portdata.last_frame_time = curtime;
if (Mame.playState != Mame.PlayState.PLAY_REPLAYRUNNING) if (Mame.playState != Mame.PlayState.PLAY_REPLAYRUNNING)

View File

@ -1,7 +1,7 @@
using MAME.Core.run_interface; using MAME.Core;
using System.Collections.Generic; using System.Collections.Generic;
namespace mame namespace MAME.Core
{ {
public partial class Inptport public partial class Inptport
{ {

View File

@ -1,6 +1,6 @@
using MAME.Core.run_interface; using MAME.Core;
namespace mame namespace MAME.Core
{ {
public class Keyboard public class Keyboard
{ {
@ -22,7 +22,7 @@ namespace mame
mKeyboard = ikb; mKeyboard = ikb;
} }
public static bool IsPressed(MotionKey key) public static bool IsPressed(MotionKey key)
{ {
return m_KeyStates[(int)key].IsPressed; return m_KeyStates[(int)key].IsPressed;
} }
@ -62,7 +62,7 @@ namespace mame
m_KeyStates[i].IsTriggered = false; m_KeyStates[i].IsTriggered = false;
} }
} }
} }
} }
} }

View File

@ -1,8 +1,7 @@
using MAME.Core.Motion; using System.Collections.Generic;
using System.Collections.Generic;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public class Machine public class Machine
{ {

View File

@ -1,8 +1,7 @@
using MAME.Core.Motion; using MAME.Core;
using MAME.Core.run_interface;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public class Mame public class Mame
{ {
@ -22,7 +21,7 @@ namespace mame
public static PlayState playState; public static PlayState playState;
public static bool is_foreground; public static bool is_foreground;
public static bool paused, exit_pending; 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 BinaryReader brRecord = null;
public static BinaryWriter bwRecord = null; public static BinaryWriter bwRecord = null;
public static bool bPP = true; public static bool bPP = true;
@ -88,7 +87,7 @@ namespace mame
public static void mame_schedule_soft_reset() 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); mame_pause(false);
if (Cpuexec.activecpu >= 0) if (Cpuexec.activecpu >= 0)
{ {
@ -136,8 +135,8 @@ namespace mame
Inptport.input_init(); Inptport.input_init();
Palette.palette_init(); Palette.palette_init();
Generic.generic_machine_init(); Generic.generic_machine_init();
Timer.timer_init(); EmuTimer.timer_init();
soft_reset_timer = Timer.timer_alloc_common(soft_reset, "soft_reset", false); soft_reset_timer = EmuTimer.timer_alloc_common(soft_reset, "soft_reset", false);
Window.osd_init(); Window.osd_init();
Inptport.input_port_init(); Inptport.input_port_init();
Cpuexec.cpuexec_init(); Cpuexec.cpuexec_init();
@ -174,7 +173,7 @@ namespace mame
Watchdog.watchdog_internal_reset(); Watchdog.watchdog_internal_reset();
Sound.sound_reset(); Sound.sound_reset();
playState = PlayState.PLAY_RUNNING; 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() private static void handle_save()
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public class Memory public class Memory
{ {

View File

@ -1,7 +1,6 @@
using MAME.Core.Motion; using MAME.Core;
using MAME.Core.run_interface;
namespace mame namespace MAME.Core
{ {
/// <summary> /// <summary>
/// 原依赖Form的内容 /// 原依赖Form的内容

View File

@ -1,7 +1,6 @@
using MAME.Core.Motion; using MAME.Core;
using MAME.Core.run_interface;
namespace mame namespace MAME.Core
{ {
public class Mouse public class Mouse
{ {

View File

@ -1,7 +1,7 @@
using MAME.Core.AxiBitmap; using MAME.Core.AxiBitmap;
using Color = MAME.Core.AxiBitmap.AxiColor; using Color = MAME.Core.AxiBitmap.AxiColor;
namespace mame namespace MAME.Core
{ {
public class Palette public class Palette
{ {

View File

@ -1,6 +1,6 @@
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public class Pd4900a public class Pd4900a
{ {

View File

@ -1,11 +1,11 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace mame namespace MAME.Core
{ {
public class RomInfo public class RomInfo
{ {
public static List<RomInfo> romList; public static List<RomInfo> romList;
public static Dictionary<string,RomInfo> dictName2Rom; public static Dictionary<string, RomInfo> dictName2Rom;
public static RomInfo Rom; public static RomInfo Rom;
public string Name, Board; public string Name, Board;
public string Parent; public string Parent;

View File

@ -1,6 +1,6 @@
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public class State public class State
{ {

View File

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace mame namespace MAME.Core
{ {
enum trans_t enum trans_t
{ {

View File

@ -1,10 +1,9 @@
using MAME.Core.Motion; using MAME.Core;
using MAME.Core.run_interface;
using System; using System;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace mame namespace MAME.Core
{ {
public struct screen_state public struct screen_state
{ {
@ -28,8 +27,8 @@ namespace mame
public static screen_state screenstate; public static screen_state screenstate;
public static int video_attributes; public static int video_attributes;
private static int PAUSED_REFRESH_RATE = 30, VIDEO_UPDATE_AFTER_VBLANK = 4; 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 EmuTimer.emu_timer vblank_begin_timer, vblank_end_timer;
public static Timer.emu_timer scanline0_timer, scanline_timer; public static EmuTimer.emu_timer scanline0_timer, scanline_timer;
private static Atime throttle_emutime, throttle_realtime, speed_last_emutime, overall_emutime; private static Atime throttle_emutime, throttle_realtime, speed_last_emutime, overall_emutime;
private static long throttle_last_ticks; private static long throttle_last_ticks;
private static long average_oversleep; 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); vblank_begin_timer = EmuTimer.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); EmuTimer.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); scanline0_timer = EmuTimer.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); EmuTimer.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_end_timer = EmuTimer.timer_alloc_common(vblank_end_callback, "vblank_end_callback", false);
switch (Machine.sBoard) switch (Machine.sBoard)
{ {
case "CPS-1": case "CPS-1":
@ -667,19 +666,19 @@ namespace mame
break; break;
case "CPS2": case "CPS2":
Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 262); 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; break;
case "Tehkan": case "Tehkan":
Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 2); 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; break;
case "Neo Geo": case "Neo Geo":
break; break;
case "SunA8": case "SunA8":
Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 0x100); 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_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; break;
case "IGS011": case "IGS011":
switch (Machine.sName) switch (Machine.sName)
@ -694,27 +693,27 @@ namespace mame
case "drgnwrldv40k": case "drgnwrldv40k":
case "lhb2": case "lhb2":
Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 5); 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; break;
case "lhb": case "lhb":
case "lhbv33c": case "lhbv33c":
case "dbc": case "dbc":
case "ryukobou": case "ryukobou":
Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 4); 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;
} }
break; break;
case "M72": case "M72":
Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 128); 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; break;
case "Taito": case "Taito":
switch (Machine.sName) switch (Machine.sName)
{ {
case "bub68705": case "bub68705":
Cpuexec.cpu[3].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 2); 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;
} }
break; break;
@ -723,7 +722,7 @@ namespace mame
{ {
case "cuebrick": case "cuebrick":
Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 10); 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;
} }
break; break;
@ -742,7 +741,7 @@ namespace mame
case "makaimurg": case "makaimurg":
case "diamond": case "diamond":
Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 4); 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;
} }
break; break;
@ -792,7 +791,7 @@ namespace mame
} }
public static int video_screen_get_vpos() 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; int vpos;
delta += screenstate.pixeltime / 2; delta += screenstate.pixeltime / 2;
vpos = (int)(delta / screenstate.scantime); vpos = (int)(delta / screenstate.scantime);
@ -800,11 +799,11 @@ namespace mame
} }
public static bool video_screen_get_vblank() 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) 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; long targetdelta;
vpos += screenstate.height - (screenstate.visarea.max_y + 1); vpos += screenstate.height - (screenstate.visarea.max_y + 1);
vpos %= screenstate.height; vpos %= screenstate.height;
@ -822,7 +821,7 @@ namespace mame
public static Atime video_screen_get_time_until_vblank_end() public static Atime video_screen_get_time_until_vblank_end()
{ {
Atime ret; Atime ret;
Atime current_time = Timer.get_current_time(); Atime current_time = EmuTimer.get_current_time();
if (video_screen_get_vblank()) if (video_screen_get_vblank())
{ {
ret = Attotime.attotime_sub(screenstate.vblank_end_time, current_time); ret = Attotime.attotime_sub(screenstate.vblank_end_time, current_time);
@ -843,21 +842,21 @@ namespace mame
} }
public static void vblank_begin_callback() 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); screenstate.vblank_end_time = Attotime.attotime_add_attoseconds(screenstate.vblank_start_time, screenstate.vblank_period);
Cpuexec.on_vblank(); Cpuexec.on_vblank();
if ((video_attributes & VIDEO_UPDATE_AFTER_VBLANK) == 0) if ((video_attributes & VIDEO_UPDATE_AFTER_VBLANK) == 0)
{ {
video_frame_update(); 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) if (screenstate.vblank_period == 0)
{ {
vblank_end_callback(); vblank_end_callback();
} }
else 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() public static void vblank_end_callback()
@ -871,7 +870,7 @@ namespace mame
public static void scanline0_callback() public static void scanline0_callback()
{ {
screenstate.last_partial_scan = 0; 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() public static void scanline_update_callback()
{ {
@ -883,11 +882,11 @@ namespace mame
scanline = screenstate.visarea.min_y; scanline = screenstate.visarea.min_y;
} }
scanline_param = scanline; 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() public static void video_frame_update()
{ {
Atime current_time = Timer.global_basetime; Atime current_time = EmuTimer.global_basetime;
if (!Mame.paused) if (!Mame.paused)
{ {
finish_screen_updates(); finish_screen_updates();

View File

@ -1,13 +1,13 @@
namespace mame namespace MAME.Core
{ {
public class Watchdog public class Watchdog
{ {
public static bool watchdog_enabled; 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 Atime watchdog_time;
public static void watchdog_init() 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) switch (Machine.sBoard)
{ {
case "CPS-1": case "CPS-1":
@ -45,15 +45,15 @@
{ {
if (!watchdog_enabled) 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) 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 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);
} }
} }
} }

View File

@ -1,6 +1,4 @@
using MAME.Core.Motion; namespace MAME.Core
namespace mame
{ {
public class Window public class Window
{ {

View File

@ -1,7 +1,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.Threading; using System.Threading;
namespace mame namespace MAME.Core
{ {
public class Wintime public class Wintime
{ {

View File

@ -1,6 +1,6 @@
using cpu.m68000; using cpu.m68000;
namespace mame namespace MAME.Core
{ {
public partial class Capcom public partial class Capcom
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Drawgfx public partial class Drawgfx
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Capcom public partial class Capcom
{ {

View File

@ -1,6 +1,6 @@
using MAME.Core.run_interface; using MAME.Core;
namespace mame namespace MAME.Core
{ {
public partial class Capcom public partial class Capcom
{ {

View File

@ -1,6 +1,6 @@
using cpu.z80; using cpu.z80;
namespace mame namespace MAME.Core
{ {
public partial class Capcom public partial class Capcom
{ {

View File

@ -3,7 +3,7 @@ using cpu.m6809;
using cpu.z80; using cpu.z80;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public partial class Capcom public partial class Capcom
{ {
@ -30,12 +30,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
AY8910.AA8910[0].SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer);
AY8910.AA8910[1].SaveStateBinary(writer); AY8910.AA8910[1].SaveStateBinary(writer);
YM2203.FF2203[0].SaveStateBinary(writer); YM2203.FF2203[0].SaveStateBinary(writer);
@ -76,12 +76,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
AY8910.AA8910[0].LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader);
AY8910.AA8910[1].LoadStateBinary(reader); AY8910.AA8910[1].LoadStateBinary(reader);
YM2203.FF2203[0].LoadStateBinary(reader); YM2203.FF2203[0].LoadStateBinary(reader);
@ -130,12 +130,12 @@ namespace mame
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Z80A.zz1[1].SaveStateBinary(writer); Z80A.zz1[1].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
MSM5205.mm1[0].SaveStateBinary(writer); MSM5205.mm1[0].SaveStateBinary(writer);
MSM5205.mm1[1].SaveStateBinary(writer); MSM5205.mm1[1].SaveStateBinary(writer);
@ -179,12 +179,12 @@ namespace mame
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Z80A.zz1[1].LoadStateBinary(reader); Z80A.zz1[1].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
MSM5205.mm1[0].LoadStateBinary(reader); MSM5205.mm1[0].LoadStateBinary(reader);
MSM5205.mm1[1].LoadStateBinary(reader); MSM5205.mm1[1].LoadStateBinary(reader);

View File

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace mame namespace MAME.Core
{ {
public partial class Capcom public partial class Capcom
{ {

View File

@ -1,6 +1,6 @@
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class Capcom public partial class Capcom
{ {

View File

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace mame namespace MAME.Core
{ {
public partial class CPS public partial class CPS
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Drawgfx public partial class Drawgfx
{ {

View File

@ -1,6 +1,6 @@
using MAME.Core.run_interface; using MAME.Core;
namespace mame namespace MAME.Core
{ {
public partial class CPS public partial class CPS
{ {
@ -1468,7 +1468,7 @@ namespace mame
} }
Inptport.bReplayRead = false; 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; short0 = short0_old;
short1 = short1_old; short1 = short1_old;

View File

@ -1,6 +1,6 @@
using cpu.z80; using cpu.z80;
namespace mame namespace MAME.Core
{ {
public partial class CPS public partial class CPS
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class CPS public partial class CPS
{ {

View File

@ -2,7 +2,7 @@
using cpu.z80; using cpu.z80;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public partial class CPS public partial class CPS
{ {
@ -31,8 +31,8 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
writer.Write(Video.screenstate.frame_number); writer.Write(Video.screenstate.frame_number);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
for (i = 0; i < 2; i++) 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.seconds);
writer.Write(Cpuexec.cpu[i].localtime.attoseconds); writer.Write(Cpuexec.cpu[i].localtime.attoseconds);
} }
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
OKI6295.SaveStateBinary(writer); OKI6295.SaveStateBinary(writer);
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
@ -101,8 +101,8 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
writer.Write(Video.screenstate.frame_number); writer.Write(Video.screenstate.frame_number);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
for (i = 0; i < 2; i++) 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.seconds);
writer.Write(Cpuexec.cpu[i].localtime.attoseconds); writer.Write(Cpuexec.cpu[i].localtime.attoseconds);
} }
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
writer.Write(qsound_sharedram1); writer.Write(qsound_sharedram1);
writer.Write(qsound_sharedram2); writer.Write(qsound_sharedram2);
QSound.SaveStateBinary(writer); QSound.SaveStateBinary(writer);
@ -164,8 +164,8 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
writer.Write(Video.screenstate.frame_number); writer.Write(Video.screenstate.frame_number);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
for (i = 0; i < 2; i++) 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.seconds);
writer.Write(Cpuexec.cpu[i].localtime.attoseconds); writer.Write(Cpuexec.cpu[i].localtime.attoseconds);
} }
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
writer.Write(qsound_sharedram1); writer.Write(qsound_sharedram1);
writer.Write(qsound_sharedram2); writer.Write(qsound_sharedram2);
QSound.SaveStateBinary(writer); QSound.SaveStateBinary(writer);
@ -212,8 +212,8 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.screenstate.frame_number = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64();
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
@ -225,7 +225,7 @@ namespace mame
Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32();
Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
} }
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
OKI6295.LoadStateBinary(reader); OKI6295.LoadStateBinary(reader);
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
@ -282,8 +282,8 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.screenstate.frame_number = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64();
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
@ -295,7 +295,7 @@ namespace mame
Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32();
Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
} }
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
qsound_sharedram1 = reader.ReadBytes(0x1000); qsound_sharedram1 = reader.ReadBytes(0x1000);
qsound_sharedram2 = reader.ReadBytes(0x1000); qsound_sharedram2 = reader.ReadBytes(0x1000);
QSound.LoadStateBinary(reader); QSound.LoadStateBinary(reader);
@ -345,8 +345,8 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.screenstate.frame_number = reader.ReadInt64(); Video.screenstate.frame_number = reader.ReadInt64();
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
@ -358,7 +358,7 @@ namespace mame
Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32(); Cpuexec.cpu[i].localtime.seconds = reader.ReadInt32();
Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64(); Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
} }
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
qsound_sharedram1 = reader.ReadBytes(0x1000); qsound_sharedram1 = reader.ReadBytes(0x1000);
qsound_sharedram2 = reader.ReadBytes(0x1000); qsound_sharedram2 = reader.ReadBytes(0x1000);
QSound.LoadStateBinary(reader); QSound.LoadStateBinary(reader);

View File

@ -1,6 +1,6 @@
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class CPS public partial class CPS
{ {

View File

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace mame namespace MAME.Core
{ {
public partial class CPS public partial class CPS
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Drawgfx public partial class Drawgfx
{ {

View File

@ -1,7 +1,7 @@
using MAME.Core.run_interface; using MAME.Core;
using System.Collections.Generic; using System.Collections.Generic;
namespace mame namespace MAME.Core
{ {
public partial class Dataeast public partial class Dataeast
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Dataeast public partial class Dataeast
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Dataeast public partial class Dataeast
{ {

View File

@ -1,7 +1,7 @@
using cpu.m6502; using cpu.m6502;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public partial class Dataeast public partial class Dataeast
{ {
@ -25,12 +25,12 @@ namespace mame
M6502.mm1[0].SaveStateBinary(writer); M6502.mm1[0].SaveStateBinary(writer);
M6502.mm1[1].SaveStateBinary(writer); M6502.mm1[1].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
AY8910.AA8910[0].SaveStateBinary(writer); AY8910.AA8910[0].SaveStateBinary(writer);
YM2203.FF2203[0].SaveStateBinary(writer); YM2203.FF2203[0].SaveStateBinary(writer);
YM3812.SaveStateBinary(writer); YM3812.SaveStateBinary(writer);
@ -68,12 +68,12 @@ namespace mame
M6502.mm1[0].LoadStateBinary(reader); M6502.mm1[0].LoadStateBinary(reader);
M6502.mm1[1].LoadStateBinary(reader); M6502.mm1[1].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
AY8910.AA8910[0].LoadStateBinary(reader); AY8910.AA8910[0].LoadStateBinary(reader);
YM2203.FF2203[0].LoadStateBinary(reader); YM2203.FF2203[0].LoadStateBinary(reader);
YM3812.LoadStateBinary(reader); YM3812.LoadStateBinary(reader);

View File

@ -1,6 +1,6 @@
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class Dataeast public partial class Dataeast
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Dataeast public partial class Dataeast
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class IGS011 public partial class IGS011
{ {

View File

@ -1,6 +1,6 @@
using MAME.Core.run_interface; using MAME.Core;
namespace mame namespace MAME.Core
{ {
public partial class IGS011 public partial class IGS011
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class IGS011 public partial class IGS011
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class IGS011 public partial class IGS011
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class IGS011 public partial class IGS011
{ {

View File

@ -1,7 +1,7 @@
using cpu.m68000; using cpu.m68000;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public partial class IGS011 public partial class IGS011
{ {
@ -59,12 +59,12 @@ namespace mame
writer.Write(blitter.flags); writer.Write(blitter.flags);
MC68000.m1.SaveStateBinary(writer); MC68000.m1.SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
OKI6295.SaveStateBinary(writer); OKI6295.SaveStateBinary(writer);
YM3812.SaveStateBinary(writer); YM3812.SaveStateBinary(writer);
writer.Write(Sound.okistream.output_sampindex); writer.Write(Sound.okistream.output_sampindex);
@ -128,12 +128,12 @@ namespace mame
blitter.flags = reader.ReadUInt16(); blitter.flags = reader.ReadUInt16();
MC68000.m1.LoadStateBinary(reader); MC68000.m1.LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
OKI6295.LoadStateBinary(reader); OKI6295.LoadStateBinary(reader);
YM3812.LoadStateBinary(reader); YM3812.LoadStateBinary(reader);
Sound.okistream.output_sampindex = reader.ReadInt32(); Sound.okistream.output_sampindex = reader.ReadInt32();

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class IGS011 public partial class IGS011
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Konami68000 public partial class Konami68000
{ {

View File

@ -1,6 +1,6 @@
using MAME.Core.run_interface; using MAME.Core;
namespace mame namespace MAME.Core
{ {
public partial class Konami68000 public partial class Konami68000
{ {

View File

@ -1,7 +1,7 @@
using cpu.m68000; using cpu.m68000;
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class Konami68000 public partial class Konami68000
{ {
@ -603,8 +603,8 @@ namespace mame
public static void sound_arm_nmi_w() public static void sound_arm_nmi_w()
{ {
Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.CLEAR_LINE); 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); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(nmi_callback, "nmi_callback", true);
Timer.timer_adjust_periodic(timer, new Atime(0, (long)50e12), Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)50e12), Attotime.ATTOTIME_NEVER);
} }
public static ushort punkshot_kludge_r() public static ushort punkshot_kludge_r()
{ {

View File

@ -1,6 +1,6 @@
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public partial class Konami68000 public partial class Konami68000
{ {

View File

@ -1,6 +1,6 @@
using cpu.z80; using cpu.z80;
namespace mame namespace MAME.Core
{ {
public partial class Konami68000 public partial class Konami68000
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Konami68000 public partial class Konami68000
{ {

View File

@ -2,7 +2,7 @@
using cpu.z80; using cpu.z80;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public partial class Konami68000 public partial class Konami68000
{ {
@ -50,12 +50,12 @@ namespace mame
MC68000.m1.SaveStateBinary(writer); MC68000.m1.SaveStateBinary(writer);
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
writer.Write(Sound.ym2151stream.output_sampindex); writer.Write(Sound.ym2151stream.output_sampindex);
writer.Write(Sound.ym2151stream.output_base_sampindex); writer.Write(Sound.ym2151stream.output_base_sampindex);
@ -106,12 +106,12 @@ namespace mame
MC68000.m1.LoadStateBinary(reader); MC68000.m1.LoadStateBinary(reader);
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
Sound.ym2151stream.output_sampindex = reader.ReadInt32(); Sound.ym2151stream.output_sampindex = reader.ReadInt32();
Sound.ym2151stream.output_base_sampindex = reader.ReadInt32(); Sound.ym2151stream.output_base_sampindex = reader.ReadInt32();
@ -157,12 +157,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
K007232.SaveStateBinary(writer); K007232.SaveStateBinary(writer);
for (i = 0; i < 1; i++) for (i = 0; i < 1; i++)
@ -219,12 +219,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
K007232.LoadStateBinary(reader); K007232.LoadStateBinary(reader);
for (i = 0; i < 1; i++) for (i = 0; i < 1; i++)
@ -285,12 +285,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
K007232.SaveStateBinary(writer); K007232.SaveStateBinary(writer);
Upd7759.SaveStateBinary(writer); Upd7759.SaveStateBinary(writer);
@ -357,12 +357,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
K007232.LoadStateBinary(reader); K007232.LoadStateBinary(reader);
Upd7759.LoadStateBinary(reader); Upd7759.LoadStateBinary(reader);
@ -424,12 +424,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
K053260.SaveStateBinary(writer); K053260.SaveStateBinary(writer);
writer.Write(Sound.ym2151stream.output_sampindex); writer.Write(Sound.ym2151stream.output_sampindex);
@ -477,12 +477,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
K053260.LoadStateBinary(reader); K053260.LoadStateBinary(reader);
Sound.ym2151stream.output_sampindex = reader.ReadInt32(); Sound.ym2151stream.output_sampindex = reader.ReadInt32();
@ -530,12 +530,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
K053260.SaveStateBinary(writer); K053260.SaveStateBinary(writer);
writer.Write(Sound.ym2151stream.output_sampindex); writer.Write(Sound.ym2151stream.output_sampindex);
@ -583,12 +583,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
K053260.LoadStateBinary(reader); K053260.LoadStateBinary(reader);
Sound.ym2151stream.output_sampindex = reader.ReadInt32(); Sound.ym2151stream.output_sampindex = reader.ReadInt32();
@ -634,12 +634,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
K053260.SaveStateBinary(writer); K053260.SaveStateBinary(writer);
writer.Write(Sound.ym2151stream.output_sampindex); writer.Write(Sound.ym2151stream.output_sampindex);
@ -686,12 +686,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
K053260.LoadStateBinary(reader); K053260.LoadStateBinary(reader);
Sound.ym2151stream.output_sampindex = reader.ReadInt32(); Sound.ym2151stream.output_sampindex = reader.ReadInt32();
@ -741,12 +741,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
K053260.SaveStateBinary(writer); K053260.SaveStateBinary(writer);
writer.Write(Sound.k053260stream.output_sampindex); writer.Write(Sound.k053260stream.output_sampindex);
writer.Write(Sound.k053260stream.output_base_sampindex); writer.Write(Sound.k053260stream.output_base_sampindex);
@ -792,12 +792,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
K053260.LoadStateBinary(reader); K053260.LoadStateBinary(reader);
Sound.k053260stream.output_sampindex = reader.ReadInt32(); Sound.k053260stream.output_sampindex = reader.ReadInt32();
Sound.k053260stream.output_base_sampindex = reader.ReadInt32(); Sound.k053260stream.output_base_sampindex = reader.ReadInt32();
@ -844,12 +844,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
K053260.SaveStateBinary(writer); K053260.SaveStateBinary(writer);
writer.Write(Sound.ym2151stream.output_sampindex); writer.Write(Sound.ym2151stream.output_sampindex);
@ -900,12 +900,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
K053260.LoadStateBinary(reader); K053260.LoadStateBinary(reader);
Sound.ym2151stream.output_sampindex = reader.ReadInt32(); Sound.ym2151stream.output_sampindex = reader.ReadInt32();
@ -952,12 +952,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
K053260.SaveStateBinary(writer); K053260.SaveStateBinary(writer);
writer.Write(Sound.ym2151stream.output_sampindex); writer.Write(Sound.ym2151stream.output_sampindex);
@ -1004,12 +1004,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
K053260.LoadStateBinary(reader); K053260.LoadStateBinary(reader);
Sound.ym2151stream.output_sampindex = reader.ReadInt32(); Sound.ym2151stream.output_sampindex = reader.ReadInt32();
@ -1056,12 +1056,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x800); writer.Write(Memory.audioram, 0, 0x800);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
K053260.SaveStateBinary(writer); K053260.SaveStateBinary(writer);
writer.Write(Sound.ym2151stream.output_sampindex); writer.Write(Sound.ym2151stream.output_sampindex);
@ -1108,12 +1108,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x800); Memory.audioram = reader.ReadBytes(0x800);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
K053260.LoadStateBinary(reader); K053260.LoadStateBinary(reader);
Sound.ym2151stream.output_sampindex = reader.ReadInt32(); Sound.ym2151stream.output_sampindex = reader.ReadInt32();
@ -1161,12 +1161,12 @@ namespace mame
writer.Write(Memory.audioram, 0, 0x2000); writer.Write(Memory.audioram, 0, 0x2000);
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
K054539.SaveStateBinary(writer); K054539.SaveStateBinary(writer);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
@ -1219,12 +1219,12 @@ namespace mame
Memory.audioram = reader.ReadBytes(0x2000); Memory.audioram = reader.ReadBytes(0x2000);
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
K054539.LoadStateBinary(reader); K054539.LoadStateBinary(reader);
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {

View File

@ -1,6 +1,6 @@
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class Konami68000 public partial class Konami68000
{ {

View File

@ -1,6 +1,6 @@
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class Konami68000 public partial class Konami68000
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class M72 public partial class M72
{ {
@ -44,17 +44,17 @@
{ {
if (irq != 0) 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; setvector_param = 1;
Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true);
Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER);
} }
else else
{ {
Cpuint.lvec.Add(new vec(2, Timer.get_current_time())); Cpuint.lvec.Add(new vec(2, EmuTimer.get_current_time()));
setvector_param = 2; setvector_param = 2;
Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true);
Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER);
} }
} }
public static void m72_sound_command_w(int offset, ushort data) public static void m72_sound_command_w(int offset, ushort data)
@ -62,26 +62,26 @@
//if (ACCESSING_BITS_0_7) //if (ACCESSING_BITS_0_7)
{ {
Sound.soundlatch_w(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; setvector_param = 3;
Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true);
Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER);
} }
} }
public static void m72_sound_command_byte_w(int offset, byte data) public static void m72_sound_command_byte_w(int offset, byte data)
{ {
Sound.soundlatch_w(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; setvector_param = 3;
Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true);
Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER);
} }
public static void m72_sound_irq_ack_w(int offset, byte data) 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; setvector_param = 4;
Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true);
Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER);
} }
public static void m72_set_sample_start(int start) public static void m72_set_sample_start(int start)
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Drawgfx public partial class Drawgfx
{ {

View File

@ -1,6 +1,6 @@
using MAME.Core.run_interface; using MAME.Core;
namespace mame namespace MAME.Core
{ {
public partial class M72 public partial class M72
{ {

View File

@ -1,11 +1,11 @@
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class M72 public partial class M72
{ {
public static byte[] protection_ram; 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 byte m72_irq_base;
public static int m72_scanline_param; public static int m72_scanline_param;
@ -44,7 +44,7 @@ namespace mame
Generic.paletteram16_2 = new ushort[0x600]; Generic.paletteram16_2 = new ushort[0x600];
Generic.spriteram16 = new ushort[0x200]; Generic.spriteram16 = new ushort[0x200];
Machine.bRom = true; Machine.bRom = true;
Timer.setvector = setvector_callback; EmuTimer.setvector = setvector_callback;
protection_ram = new byte[0x1000]; protection_ram = new byte[0x1000];
Memory.mainrom = Machine.GetRom("maincpu.rom"); Memory.mainrom = Machine.GetRom("maincpu.rom");
Memory.audiorom = Machine.GetRom("soundcpu.rom"); Memory.audiorom = Machine.GetRom("soundcpu.rom");
@ -154,19 +154,19 @@ namespace mame
} }
public static void machine_start_m72() 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() public static void machine_reset_m72()
{ {
m72_irq_base = 0x20; m72_irq_base = 0x20;
machine_reset_m72_sound(); 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() public static void machine_reset_kengo()
{ {
m72_irq_base = 0x18; m72_irq_base = 0x18;
machine_reset_m72_sound(); 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() public static void m72_scanline_interrupt()
{ {
@ -186,7 +186,7 @@ namespace mame
scanline = 0; scanline = 0;
} }
m72_scanline_param = scanline; 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);
} }
} }
} }

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class M72 public partial class M72
{ {

View File

@ -1,6 +1,6 @@
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class M72 public partial class M72
{ {

View File

@ -2,7 +2,7 @@
using cpu.z80; using cpu.z80;
using System.IO; using System.IO;
namespace mame namespace MAME.Core
{ {
public partial class M72 public partial class M72
{ {
@ -51,12 +51,12 @@ namespace mame
Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[0].SaveStateBinary(writer);
Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary(writer);
Cpuint.SaveStateBinary_v(writer); Cpuint.SaveStateBinary_v(writer);
writer.Write(Timer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.seconds);
writer.Write(Timer.global_basetime.attoseconds); writer.Write(EmuTimer.global_basetime.attoseconds);
Video.SaveStateBinary(writer); Video.SaveStateBinary(writer);
writer.Write(Sound.last_update_second); writer.Write(Sound.last_update_second);
Cpuexec.SaveStateBinary(writer); Cpuexec.SaveStateBinary(writer);
Timer.SaveStateBinary(writer); EmuTimer.SaveStateBinary(writer);
YM2151.SaveStateBinary(writer); YM2151.SaveStateBinary(writer);
DAC.SaveStateBinary(writer); DAC.SaveStateBinary(writer);
writer.Write(Sound.latched_value[0]); writer.Write(Sound.latched_value[0]);
@ -112,12 +112,12 @@ namespace mame
Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[0].LoadStateBinary(reader);
Cpuint.LoadStateBinary(reader); Cpuint.LoadStateBinary(reader);
Cpuint.LoadStateBinary_v(reader); Cpuint.LoadStateBinary_v(reader);
Timer.global_basetime.seconds = reader.ReadInt32(); EmuTimer.global_basetime.seconds = reader.ReadInt32();
Timer.global_basetime.attoseconds = reader.ReadInt64(); EmuTimer.global_basetime.attoseconds = reader.ReadInt64();
Video.LoadStateBinary(reader); Video.LoadStateBinary(reader);
Sound.last_update_second = reader.ReadInt32(); Sound.last_update_second = reader.ReadInt32();
Cpuexec.LoadStateBinary(reader); Cpuexec.LoadStateBinary(reader);
Timer.LoadStateBinary(reader); EmuTimer.LoadStateBinary(reader);
YM2151.LoadStateBinary(reader); YM2151.LoadStateBinary(reader);
DAC.LoadStateBinary(reader); DAC.LoadStateBinary(reader);
Sound.latched_value[0] = reader.ReadUInt16(); Sound.latched_value[0] = reader.ReadUInt16();

View File

@ -1,6 +1,6 @@
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class M72 public partial class M72
{ {

View File

@ -1,6 +1,6 @@
using System; using System;
namespace mame namespace MAME.Core
{ {
public partial class M72 public partial class M72
{ {

View File

@ -1,4 +1,4 @@
namespace mame namespace MAME.Core
{ {
public partial class Drawgfx public partial class Drawgfx
{ {

View File

@ -1,6 +1,6 @@
using MAME.Core.run_interface; using MAME.Core;
namespace mame namespace MAME.Core
{ {
public partial class M92 public partial class M92
{ {

View File

@ -1,14 +1,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace mame namespace MAME.Core
{ {
public partial class M92 public partial class M92
{ {
public static byte irqvector; public static byte irqvector;
public static ushort sound_status; public static ushort sound_status;
public static int bankaddress; 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 byte m92_irq_vectorbase;
public static int m92_raster_irq_position; public static int m92_raster_irq_position;
public static int m92_scanline_param; public static int m92_scanline_param;
@ -218,7 +218,7 @@ namespace mame
int i1, i2, n1, n2; int i1, i2, n1, n2;
byte[] bb1; byte[] bb1;
Machine.bRom = true; Machine.bRom = true;
Timer.setvector = setvector_callback; EmuTimer.setvector = setvector_callback;
pf_master_control = new ushort[4]; pf_master_control = new ushort[4];
M92.pf_layer = new M92.pf_layer_info[3]; M92.pf_layer = new M92.pf_layer_info[3];
for (i1 = 0; i1 < 3; i1++) for (i1 = 0; i1 < 3; i1++)
@ -301,12 +301,12 @@ namespace mame
{ {
setvector_param = 0; setvector_param = 0;
setvector_callback(); 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() public static void machine_reset_m92()
{ {
m92_scanline_param = 0; 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() public static void m92_scanline_interrupt()
{ {
@ -326,7 +326,7 @@ namespace mame
scanline = 0; scanline = 0;
} }
m92_scanline_param = scanline; 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) public static byte m92_eeprom_r(int offset)
{ {
@ -361,11 +361,11 @@ namespace mame
List<vec> lsvec = new List<vec>(); List<vec> lsvec = new List<vec>();
foreach (vec v1 in Cpuint.lvec) 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); 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; setvector_param = v1.vector;
lsvec.Add(v1); lsvec.Add(v1);
@ -413,10 +413,10 @@ namespace mame
} }
public static void m92_soundlatch_w(ushort data) 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; setvector_param = 3;
Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true);
Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER);
Sound.soundlatch_w((ushort)(data & 0xff)); Sound.soundlatch_w((ushort)(data & 0xff));
} }
public static ushort m92_sound_status_r() public static ushort m92_sound_status_r()
@ -429,10 +429,10 @@ namespace mame
} }
public static void m92_sound_irq_ack_w() 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; setvector_param = 4;
Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true);
Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER);
} }
public static void m92_sound_status_w(ushort data) public static void m92_sound_status_w(ushort data)
{ {
@ -443,17 +443,17 @@ namespace mame
{ {
if (state != 0) 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; setvector_param = 1;
Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true);
Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER);
} }
else else
{ {
Cpuint.lvec.Add(new vec(2, Timer.get_current_time())); Cpuint.lvec.Add(new vec(2, EmuTimer.get_current_time()));
setvector_param = 2; setvector_param = 2;
Timer.emu_timer timer = Timer.timer_alloc_common(setvector_callback, "setvector_callback", true); EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true);
Timer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER);
} }
} }
public static void m92_sprite_interrupt() public static void m92_sprite_interrupt()

Some files were not shown because too many files have changed in this diff Show More