整理模拟器核心

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
using mame;
using MAME.Core;
using System;
using System.IO;
//using System.IO;
@ -191,7 +191,7 @@ namespace cpu.m6502
}
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
{
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
}
private void m6502_set_irq_line(int irqline, LineState state)
{

View File

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

View File

@ -1,4 +1,4 @@
using mame;
using MAME.Core;
using System;
using System.IO;
@ -26,7 +26,7 @@ namespace cpu.m6800
public byte trcsr, rmcr, rdr, tdr, rsr, tsr;
public int rxbits, txbits, trcsr_read, tx;
public M6800_TX_STATE txstate;
public Timer.emu_timer m6800_rx_timer, m6800_tx_timer;
public EmuTimer.emu_timer m6800_rx_timer, m6800_tx_timer;
private byte TCSR_OLVL = 0x01, TCSR_IEDG = 0x02, TCSR_ETOI = 0x04, TCSR_EOCI = 0x08, TCSR_EICI = 0x10, TCSR_TOF = 0x20, TCSR_OCF = 0x40, TCSR_ICF = 0x80;
protected byte M6800_WAI = 8, M6800_SLP = 0x10;
private const byte M6800_IRQ_LINE = 0, M6800_TIN_LINE = 1;
@ -246,8 +246,8 @@ namespace cpu.m6800
cycles = cycles_63701;
clock = 1536000;
irq_callback = null;
m6800_rx_timer = Timer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false);
m6800_tx_timer = Timer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
m6800_rx_timer = EmuTimer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false);
m6800_tx_timer = EmuTimer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
}
public override void Reset()
{
@ -844,8 +844,8 @@ namespace cpu.m6800
ram_ctrl |= 0x40;
trcsr = M6800_TRCSR_TDRE;
rmcr = 0;
Timer.timer_enable(m6800_rx_timer, false);
Timer.timer_enable(m6800_tx_timer, false);
EmuTimer.timer_enable(m6800_rx_timer, false);
EmuTimer.timer_enable(m6800_tx_timer, false);
txstate = M6800_TX_STATE.INIT;
txbits = rxbits = 0;
trcsr_read = 0;
@ -905,7 +905,7 @@ namespace cpu.m6800
}
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
{
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
}
public override int ExecuteCycles(int cycles)
{
@ -1167,16 +1167,16 @@ namespace cpu.m6800
{
case 0:
case 3: // not implemented
Timer.timer_enable(m6800_rx_timer, false);
Timer.timer_enable(m6800_tx_timer, false);
EmuTimer.timer_enable(m6800_rx_timer, false);
EmuTimer.timer_enable(m6800_tx_timer, false);
break;
case 1:
case 2:
{
int divisor = M6800_RMCR_SS[rmcr & M6800_RMCR_SS_MASK];
Timer.timer_adjust_periodic(m6800_rx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor))));
Timer.timer_adjust_periodic(m6800_tx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor))));
EmuTimer.timer_adjust_periodic(m6800_rx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor))));
EmuTimer.timer_adjust_periodic(m6800_tx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor))));
}
break;
}
@ -1345,8 +1345,8 @@ namespace cpu.m6800
};
clock = 1000000;
irq_callback = Cpuint.cpu_3_irq_callback;
m6800_rx_timer = Timer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false);
m6800_tx_timer = Timer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
m6800_rx_timer = EmuTimer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false);
m6800_tx_timer = EmuTimer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
}
public override int ExecuteCycles(int cycles)
{

View File

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

View File

@ -1,4 +1,4 @@
using mame;
using MAME.Core;
using System;
using System.Globalization;
using System.IO;
@ -192,7 +192,7 @@ namespace cpu.m68000
}
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
{
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
}
public void Pulse_Reset()
{

View File

@ -1,4 +1,4 @@
using mame;
using MAME.Core;
using System;
using System.IO;
@ -540,7 +540,7 @@ namespace cpu.m6805
}
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
{
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
}
public override int ExecuteCycles(int cycles)
{

View File

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

View File

@ -1,4 +1,4 @@
using mame;
using MAME.Core;
using System;
using System.IO;
@ -555,7 +555,7 @@ namespace cpu.m6809
}
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
{
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
}
public override int ExecuteCycles(int cycles)
{

View File

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

View File

@ -1,4 +1,4 @@
using mame;
using MAME.Core;
using System;
using System.IO;
@ -61,7 +61,7 @@ namespace cpu.nec
{
if (line >= 0 && line < 35)
{
Cpuint.lirq.Add(new irq(cpunum, line, state, vector, Timer.get_current_time()));
Cpuint.lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time()));
int event_index = Cpuint.input_event_index[cpunum, line]++;
if (event_index >= 35)
{
@ -74,7 +74,7 @@ namespace cpu.nec
//Cpuint.input_event_queue[cpunum][line][event_index] = input_event;
//if (event_index == 0)
{
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
}
}
}

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
namespace mame
namespace MAME.Core
{
[StructLayout(LayoutKind.Explicit)]
[Serializable()]
@ -134,7 +134,7 @@ namespace mame
public static void cpunum_set_input_line(int cpunum, int line, LineState state)
{
int vector = (line >= 0 && line < 35) ? interrupt_vector[cpunum, line] : 0xff;
lirq.Add(new irq(cpunum, line, state, vector, Timer.get_current_time()));
lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time()));
Cpuexec.cpu[cpunum].cpunum_set_input_line_and_vector(cpunum, line, state, vector);
}
public static void cpunum_set_input_line_vector(int cpunum, int line, int vector)
@ -149,8 +149,8 @@ namespace mame
{
if (line >= 0 && line < 35)
{
lirq.Add(new irq(cpunum, line, state, vector, Timer.get_current_time()));
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time()));
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
}
}
public static void cpunum_empty_event_queue()
@ -162,7 +162,7 @@ namespace mame
}
foreach (irq irq1 in lirq)
{
if (Attotime.attotime_compare(irq1.time, Timer.global_basetime) <= 0)
if (Attotime.attotime_compare(irq1.time, EmuTimer.global_basetime) <= 0)
{
input_line_state[irq1.cpunum, irq1.line] = (byte)irq1.state;
input_line_vector[irq1.cpunum, irq1.line] = irq1.vector;

View File

@ -1,7 +1,4 @@

using Color = MAME.Core.AxiBitmap.AxiColor;
namespace mame
namespace MAME.Core
{
public class Crosshair
{

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
using cpu.m68000;
using System;
namespace mame
namespace MAME.Core
{
public class Generic
{
@ -157,7 +157,7 @@ namespace mame
if (enabled == 0)
{
objcpunum = cpunum;
Timer.timer_set_internal(clear_all_lines, "clear_all_lines");
EmuTimer.timer_set_internal(clear_all_lines, "clear_all_lines");
}
}
public static void interrupt_enable_w(byte data)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace mame
namespace MAME.Core
{
public class RomInfo
{

View File

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

View File

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

View File

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

View File

@ -1,13 +1,13 @@
namespace mame
namespace MAME.Core
{
public class Watchdog
{
public static bool watchdog_enabled;
public static Timer.emu_timer watchdog_timer;
public static EmuTimer.emu_timer watchdog_timer;
public static Atime watchdog_time;
public static void watchdog_init()
{
watchdog_timer = Timer.timer_alloc_common(watchdog_callback, "watchdog_callback", false);
watchdog_timer = EmuTimer.timer_alloc_common(watchdog_callback, "watchdog_callback", false);
switch (Machine.sBoard)
{
case "CPS-1":
@ -45,15 +45,15 @@
{
if (!watchdog_enabled)
{
Timer.timer_adjust_periodic(watchdog_timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER);
EmuTimer.timer_adjust_periodic(watchdog_timer, Attotime.ATTOTIME_NEVER, Attotime.ATTOTIME_NEVER);
}
else if (Attotime.attotime_compare(watchdog_time, Attotime.ATTOTIME_ZERO) != 0)
{
Timer.timer_adjust_periodic(watchdog_timer, watchdog_time, Attotime.ATTOTIME_NEVER);
EmuTimer.timer_adjust_periodic(watchdog_timer, watchdog_time, Attotime.ATTOTIME_NEVER);
}
else
{
Timer.timer_adjust_periodic(watchdog_timer, new Atime(3, 0), Attotime.ATTOTIME_NEVER);
EmuTimer.timer_adjust_periodic(watchdog_timer, new Atime(3, 0), Attotime.ATTOTIME_NEVER);
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
namespace mame
namespace MAME.Core
{
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
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
namespace mame
namespace MAME.Core
{
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
{
@ -1468,7 +1468,7 @@ namespace mame
}
Inptport.bReplayRead = false;
}
if (Attotime.attotime_compare(Timer.global_basetime, Timer.global_basetime_obj) == 0)
if (Attotime.attotime_compare(EmuTimer.global_basetime, EmuTimer.global_basetime_obj) == 0)
{
short0 = short0_old;
short1 = short1_old;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
namespace mame
namespace MAME.Core
{
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
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
namespace mame
namespace MAME.Core
{
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
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
namespace mame
namespace MAME.Core
{
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
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
namespace mame
namespace MAME.Core
{
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
{

View File

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

View File

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

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