diff --git a/MAME.Unity/Assets/Plugins/UMAME/cpu/m6502/M6502.cs b/MAME.Unity/Assets/Plugins/UMAME/cpu/m6502/M6502.cs index f801844..f18802b 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/cpu/m6502/M6502.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/cpu/m6502/M6502.cs @@ -191,7 +191,7 @@ namespace cpu.m6502 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); } private void m6502_set_irq_line(int irqline, LineState state) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/cpu/m6800/M6800.cs b/MAME.Unity/Assets/Plugins/UMAME/cpu/m6800/M6800.cs index be6a9d9..ed7c5c6 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/cpu/m6800/M6800.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/cpu/m6800/M6800.cs @@ -246,8 +246,8 @@ namespace cpu.m6800 cycles = cycles_63701; clock = 1536000; irq_callback = null; - 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); + m6800_rx_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M6800_action_rx, false); + m6800_tx_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M6800_action_tx, false); } public override void Reset() { @@ -905,7 +905,7 @@ namespace cpu.m6800 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); } public override int ExecuteCycles(int cycles) { @@ -1345,8 +1345,8 @@ namespace cpu.m6800 }; clock = 1000000; irq_callback = Cpuint.cpu_3_irq_callback; - 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); + m6800_rx_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M6800_action_rx, false); + m6800_tx_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M6800_action_tx, false); } public override int ExecuteCycles(int cycles) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/cpu/m68000/MC68000.cs b/MAME.Unity/Assets/Plugins/UMAME/cpu/m68000/MC68000.cs index 72efe19..111cf3e 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/cpu/m68000/MC68000.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/cpu/m68000/MC68000.cs @@ -192,7 +192,7 @@ namespace cpu.m68000 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); } public void Pulse_Reset() { diff --git a/MAME.Unity/Assets/Plugins/UMAME/cpu/m6805/M6805.cs b/MAME.Unity/Assets/Plugins/UMAME/cpu/m6805/M6805.cs index 71f9604..b2d8309 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/cpu/m6805/M6805.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/cpu/m6805/M6805.cs @@ -540,7 +540,7 @@ namespace cpu.m6805 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); } public override int ExecuteCycles(int cycles) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/cpu/m6809/M6809.cs b/MAME.Unity/Assets/Plugins/UMAME/cpu/m6809/M6809.cs index 55833b2..62995c1 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/cpu/m6809/M6809.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/cpu/m6809/M6809.cs @@ -555,7 +555,7 @@ namespace cpu.m6809 } public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector) { - EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); } public override int ExecuteCycles(int cycles) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/cpu/nec/Nec.cs b/MAME.Unity/Assets/Plugins/UMAME/cpu/nec/Nec.cs index 4d58115..3609c9b 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/cpu/nec/Nec.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/cpu/nec/Nec.cs @@ -74,7 +74,7 @@ namespace cpu.nec //Cpuint.input_event_queue[cpunum][line][event_index] = input_event; //if (event_index == 0) { - EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); } } } diff --git a/MAME.Unity/Assets/Plugins/UMAME/cpu/z80/Z80A.cs b/MAME.Unity/Assets/Plugins/UMAME/cpu/z80/Z80A.cs index 6e10366..0d3a972 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/cpu/z80/Z80A.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/cpu/z80/Z80A.cs @@ -109,7 +109,7 @@ namespace cpu.z80 } else { - EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); } } diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Cpuexec.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Cpuexec.cs index 6395ee2..1aa8e72 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Cpuexec.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Cpuexec.cs @@ -2320,12 +2320,12 @@ namespace MAME.Core case "CPS-1(QSound)": case "CPS2": timedint_period = new Atime(0, (long)(1e18 / 250)); - timedint_timer = EmuTimer.timer_alloc_common(Generic.irq_1_0_line_hold, "irq_1_0_line_hold", false); + timedint_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Generic_irq_1_0_line_hold, false); EmuTimer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period); break; case "Neo Geo": - 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); + interleave_boost_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_null_callback, false); + interleave_boost_timer_end = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_end_interleave_boost, false); break; case "CPS1": case "Namco System 1": @@ -2371,7 +2371,7 @@ namespace MAME.Core case "bublcave11": case "bublcave10": timeslice_period = new Atime(0, Video.screenstate.frame_period / 100); - timeslice_timer = EmuTimer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); + timeslice_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_cpu_timeslicecallback, false); EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); break; case "opwolf": @@ -2381,14 +2381,14 @@ namespace MAME.Core case "opwolfb": case "opwolfp": timeslice_period = new Atime(0, Video.screenstate.frame_period / 10); - timeslice_timer = EmuTimer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); + timeslice_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_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 = EmuTimer.timer_alloc_common(cpu_timeslicecallback, "cpu_timeslicecallback", false); + timeslice_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_cpu_timeslicecallback, false); EmuTimer.timer_adjust_periodic(timeslice_timer, timeslice_period, timeslice_period); break; case "Capcom": @@ -2414,7 +2414,7 @@ namespace MAME.Core case "sfan": case "sfp": timedint_period = new Atime(0, (long)(1e18 / 8000)); - timedint_timer = EmuTimer.timer_alloc_common(Generic.irq_2_0_line_hold, "irq_2_0_line_hold", false); + timedint_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Generic_irq_2_0_line_hold, false); EmuTimer.timer_adjust_periodic(timedint_timer, timedint_period, timedint_period); break; } diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Cpuint.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Cpuint.cs index 8878c73..6ff6a25 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Cpuint.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Cpuint.cs @@ -150,7 +150,7 @@ namespace MAME.Core if (line >= 0 && line < 35) { 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"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Cpuint_cpunum_empty_event_queue); } } public static void cpunum_empty_event_queue() diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/EmuTimer.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/EmuTimer.cs index 5cfd531..5fe2437 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/EmuTimer.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/EmuTimer.cs @@ -18,8 +18,8 @@ namespace MAME.Core public static Action setvector; public class emu_timer { - public Action action; - public string func; + public TIME_ACT action; + //public string func; public bool enabled; public bool temporary; public Atime period; @@ -33,18 +33,19 @@ namespace MAME.Core public class emu_timer2 { public int index; - public Action action; + public TIME_ACT action; public string func; - public emu_timer2(int i1, Action ac1, string func1) + public emu_timer2(int i1, TIME_ACT ac1) { index = i1; action = ac1; - func = func1; + //func = func1; } } - public static Action getactionbyindex(int index) + //public static Action getactionbyindex(int index) + public static TIME_ACT getactionbyindex(int index) { - Action action = null; + TIME_ACT action = TIME_ACT.NoneAct; foreach (emu_timer2 timer in lt2) { if (timer.index == index) @@ -52,28 +53,59 @@ namespace MAME.Core action = timer.action; if (index == 4) { - action = Sound.sound_update; + action = TIME_ACT.Sound_sound_update; } else if (index == 32) { - action = M6800.action_rx; + action = TIME_ACT.M6800_action_rx; } else if (index == 33) { - action = M6800.action_tx; + action = TIME_ACT.M6800_action_tx; } else if (index == 39) { - action = setvector; + action = TIME_ACT.setvector; } else if (index == 42) { - action = Cpuexec.vblank_interrupt2; + action = TIME_ACT.Cpuexec_vblank_interrupt2; } } } return action; } + //{ + // Action action = null; + // foreach (emu_timer2 timer in lt2) + // { + // if (timer.index == index) + // { + // action = timer.action; + // if (index == 4) + // { + // action = Sound.sound_update; + // } + // else if (index == 32) + // { + // action = M6800.action_rx; + // } + // else if (index == 33) + // { + // action = M6800.action_tx; + // } + // else if (index == 39) + // { + // action = setvector; + // } + // else if (index == 42) + // { + // action = Cpuexec.vblank_interrupt2; + // } + // } + // } + // return action; + //} public static string getfuncbyindex(int index) { string func = ""; @@ -87,12 +119,25 @@ namespace MAME.Core } return func; } - public static int getindexbyfunc(string func) + //public static int getindexbyfunc(string func) + //{ + // int index = 0; + // foreach (emu_timer2 timer in lt2) + // { + // if (timer.func == func) + // { + // index = timer.index; + // break; + // } + // } + // return index; + //} + public static int getindexbyaction(TIME_ACT act) { int index = 0; foreach (emu_timer2 timer in lt2) { - if (timer.func == func) + if (timer.action == act) { index = timer.index; break; @@ -100,65 +145,280 @@ namespace MAME.Core } return index; } + //public static void timer_init() + //{ + // global_basetime = Attotime.ATTOTIME_ZERO; + // lt = new List(); + // lt2 = new List(); + // lt2.Add(new emu_timer2(1, Video.vblank_begin_callback, "vblank_begin_callback")); + // lt2.Add(new emu_timer2(2, Mame.soft_reset, "soft_reset")); + // lt2.Add(new emu_timer2(3, Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue")); + // lt2.Add(new emu_timer2(4, Sound.sound_update, "sound_update")); + // lt2.Add(new emu_timer2(5, Watchdog.watchdog_callback, "watchdog_callback")); + // lt2.Add(new emu_timer2(6, Generic.irq_1_0_line_hold, "irq_1_0_line_hold")); + // lt2.Add(new emu_timer2(7, Video.vblank_end_callback, "vblank_end_callback")); + + // lt2.Add(new emu_timer2(10, YM2151.irqAon_callback, "irqAon_callback")); + // lt2.Add(new emu_timer2(11, YM2151.irqBon_callback, "irqBon_callback")); + // lt2.Add(new emu_timer2(12, YM2151.irqAoff_callback, "irqAoff_callback")); + // lt2.Add(new emu_timer2(13, YM2151.irqBoff_callback, "irqBoff_callback")); + // lt2.Add(new emu_timer2(14, YM2151.timer_callback_a, "timer_callback_a")); + // lt2.Add(new emu_timer2(15, YM2151.timer_callback_b, "timer_callback_b")); + // lt2.Add(new emu_timer2(16, Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt")); + // lt2.Add(new emu_timer2(17, Cpuexec.null_callback, "boost_callback")); + // lt2.Add(new emu_timer2(18, Cpuexec.end_interleave_boost, "end_interleave_boost")); + // lt2.Add(new emu_timer2(19, Video.scanline0_callback, "scanline0_callback")); + // lt2.Add(new emu_timer2(20, Sound.latch_callback, "latch_callback")); + // lt2.Add(new emu_timer2(21, Sound.latch_callback2, "latch_callback2")); + // lt2.Add(new emu_timer2(22, Sound.latch_callback3, "latch_callback3")); + // lt2.Add(new emu_timer2(23, Sound.latch_callback4, "latch_callback4")); + // lt2.Add(new emu_timer2(24, Neogeo.display_position_interrupt_callback, "display_position_interrupt_callback")); + // lt2.Add(new emu_timer2(25, Neogeo.display_position_vblank_callback, "display_position_vblank_callback")); + // lt2.Add(new emu_timer2(26, Neogeo.vblank_interrupt_callback, "vblank_interrupt_callback")); + // lt2.Add(new emu_timer2(27, Neogeo.auto_animation_timer_callback, "auto_animation_timer_callback")); + // lt2.Add(new emu_timer2(29, YM2610.F2610.timer_callback_0, "timer_callback_0")); + // lt2.Add(new emu_timer2(30, YM2610.F2610.timer_callback_1, "timer_callback_1")); + // lt2.Add(new emu_timer2(31, Neogeo.sprite_line_timer_callback, "sprite_line_timer_callback")); + // lt2.Add(new emu_timer2(32, M6800.action_rx, "m6800_rx_tick")); + // lt2.Add(new emu_timer2(33, M6800.action_tx, "m6800_tx_tick")); + // lt2.Add(new emu_timer2(34, YM3812.timer_callback_3812_0, "timer_callback_3812_0")); + // lt2.Add(new emu_timer2(35, YM3812.timer_callback_3812_1, "timer_callback_3812_1")); + // lt2.Add(new emu_timer2(36, ICS2115.timer_cb_0, "timer_cb_0")); + // lt2.Add(new emu_timer2(37, ICS2115.timer_cb_1, "timer_cb_1")); + // lt2.Add(new emu_timer2(38, M72.m72_scanline_interrupt, "m72_scanline_interrupt")); + // lt2.Add(new emu_timer2(39, setvector, "setvector_callback")); + // lt2.Add(new emu_timer2(40, M92.m92_scanline_interrupt, "m92_scanline_interrupt")); + // lt2.Add(new emu_timer2(41, Cpuexec.cpu_timeslicecallback, "cpu_timeslicecallback")); + // lt2.Add(new emu_timer2(42, Cpuexec.vblank_interrupt2, "vblank_interrupt2")); + // lt2.Add(new emu_timer2(43, Konami68000.nmi_callback, "nmi_callback")); + // lt2.Add(new emu_timer2(44, Upd7759.upd7759_slave_update, "upd7759_slave_update")); + // lt2.Add(new emu_timer2(45, Generic.irq_2_0_line_hold, "irq_2_0_line_hold")); + // lt2.Add(new emu_timer2(46, MSM5205.MSM5205_vclk_callback0, "msm5205_vclk_callback0")); + // lt2.Add(new emu_timer2(47, MSM5205.MSM5205_vclk_callback1, "msm5205_vclk_callback1")); + // lt2.Add(new emu_timer2(48, YM2203.timer_callback_2203_0_0, "timer_callback_2203_0_0")); + // lt2.Add(new emu_timer2(49, YM2203.timer_callback_2203_0_1, "timer_callback_2203_0_1")); + // lt2.Add(new emu_timer2(50, YM2203.timer_callback_2203_1_0, "timer_callback_2203_1_0")); + // lt2.Add(new emu_timer2(51, YM2203.timer_callback_2203_1_1, "timer_callback_2203_1_1")); + // lt2.Add(new emu_timer2(52, YM3812.timer_callback_3526_0, "timer_callback_3526_0")); + // lt2.Add(new emu_timer2(53, YM3812.timer_callback_3526_1, "timer_callback_3526_1")); + // lt2.Add(new emu_timer2(54, K054539.k054539_irq, "k054539_irq")); + // lt2.Add(new emu_timer2(55, Taito.cchip_timer, "cchip_timer")); + //} public static void timer_init() { global_basetime = Attotime.ATTOTIME_ZERO; lt = new List(); lt2 = new List(); - lt2.Add(new emu_timer2(1, Video.vblank_begin_callback, "vblank_begin_callback")); - lt2.Add(new emu_timer2(2, Mame.soft_reset, "soft_reset")); - lt2.Add(new emu_timer2(3, Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue")); - lt2.Add(new emu_timer2(4, Sound.sound_update, "sound_update")); - lt2.Add(new emu_timer2(5, Watchdog.watchdog_callback, "watchdog_callback")); - lt2.Add(new emu_timer2(6, Generic.irq_1_0_line_hold, "irq_1_0_line_hold")); - lt2.Add(new emu_timer2(7, Video.vblank_end_callback, "vblank_end_callback")); - - lt2.Add(new emu_timer2(10, YM2151.irqAon_callback, "irqAon_callback")); - lt2.Add(new emu_timer2(11, YM2151.irqBon_callback, "irqBon_callback")); - lt2.Add(new emu_timer2(12, YM2151.irqAoff_callback, "irqAoff_callback")); - lt2.Add(new emu_timer2(13, YM2151.irqBoff_callback, "irqBoff_callback")); - lt2.Add(new emu_timer2(14, YM2151.timer_callback_a, "timer_callback_a")); - lt2.Add(new emu_timer2(15, YM2151.timer_callback_b, "timer_callback_b")); - lt2.Add(new emu_timer2(16, Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt")); - lt2.Add(new emu_timer2(17, Cpuexec.null_callback, "boost_callback")); - lt2.Add(new emu_timer2(18, Cpuexec.end_interleave_boost, "end_interleave_boost")); - lt2.Add(new emu_timer2(19, Video.scanline0_callback, "scanline0_callback")); - lt2.Add(new emu_timer2(20, Sound.latch_callback, "latch_callback")); - lt2.Add(new emu_timer2(21, Sound.latch_callback2, "latch_callback2")); - lt2.Add(new emu_timer2(22, Sound.latch_callback3, "latch_callback3")); - lt2.Add(new emu_timer2(23, Sound.latch_callback4, "latch_callback4")); - lt2.Add(new emu_timer2(24, Neogeo.display_position_interrupt_callback, "display_position_interrupt_callback")); - lt2.Add(new emu_timer2(25, Neogeo.display_position_vblank_callback, "display_position_vblank_callback")); - lt2.Add(new emu_timer2(26, Neogeo.vblank_interrupt_callback, "vblank_interrupt_callback")); - lt2.Add(new emu_timer2(27, Neogeo.auto_animation_timer_callback, "auto_animation_timer_callback")); - lt2.Add(new emu_timer2(29, YM2610.F2610.timer_callback_0, "timer_callback_0")); - lt2.Add(new emu_timer2(30, YM2610.F2610.timer_callback_1, "timer_callback_1")); - lt2.Add(new emu_timer2(31, Neogeo.sprite_line_timer_callback, "sprite_line_timer_callback")); - lt2.Add(new emu_timer2(32, M6800.action_rx, "m6800_rx_tick")); - lt2.Add(new emu_timer2(33, M6800.action_tx, "m6800_tx_tick")); - lt2.Add(new emu_timer2(34, YM3812.timer_callback_3812_0, "timer_callback_3812_0")); - lt2.Add(new emu_timer2(35, YM3812.timer_callback_3812_1, "timer_callback_3812_1")); - lt2.Add(new emu_timer2(36, ICS2115.timer_cb_0, "timer_cb_0")); - lt2.Add(new emu_timer2(37, ICS2115.timer_cb_1, "timer_cb_1")); - lt2.Add(new emu_timer2(38, M72.m72_scanline_interrupt, "m72_scanline_interrupt")); - lt2.Add(new emu_timer2(39, setvector, "setvector_callback")); - lt2.Add(new emu_timer2(40, M92.m92_scanline_interrupt, "m92_scanline_interrupt")); - lt2.Add(new emu_timer2(41, Cpuexec.cpu_timeslicecallback, "cpu_timeslicecallback")); - lt2.Add(new emu_timer2(42, Cpuexec.vblank_interrupt2, "vblank_interrupt2")); - lt2.Add(new emu_timer2(43, Konami68000.nmi_callback, "nmi_callback")); - lt2.Add(new emu_timer2(44, Upd7759.upd7759_slave_update, "upd7759_slave_update")); - lt2.Add(new emu_timer2(45, Generic.irq_2_0_line_hold, "irq_2_0_line_hold")); - lt2.Add(new emu_timer2(46, MSM5205.MSM5205_vclk_callback0, "msm5205_vclk_callback0")); - lt2.Add(new emu_timer2(47, MSM5205.MSM5205_vclk_callback1, "msm5205_vclk_callback1")); - lt2.Add(new emu_timer2(48, YM2203.timer_callback_2203_0_0, "timer_callback_2203_0_0")); - lt2.Add(new emu_timer2(49, YM2203.timer_callback_2203_0_1, "timer_callback_2203_0_1")); - lt2.Add(new emu_timer2(50, YM2203.timer_callback_2203_1_0, "timer_callback_2203_1_0")); - lt2.Add(new emu_timer2(51, YM2203.timer_callback_2203_1_1, "timer_callback_2203_1_1")); - lt2.Add(new emu_timer2(52, YM3812.timer_callback_3526_0, "timer_callback_3526_0")); - lt2.Add(new emu_timer2(53, YM3812.timer_callback_3526_1, "timer_callback_3526_1")); - lt2.Add(new emu_timer2(54, K054539.k054539_irq, "k054539_irq")); - lt2.Add(new emu_timer2(55, Taito.cchip_timer, "cchip_timer")); + lt2.Add(new emu_timer2(1, TIME_ACT.Video_vblank_begin_callback)); + lt2.Add(new emu_timer2(2, TIME_ACT.Mame_soft_reset)); + lt2.Add(new emu_timer2(3, TIME_ACT.Cpuint_cpunum_empty_event_queue)); + lt2.Add(new emu_timer2(4, TIME_ACT.Sound_sound_update)); + lt2.Add(new emu_timer2(5, TIME_ACT.Watchdog_watchdog_callback)); + lt2.Add(new emu_timer2(6, TIME_ACT.Generic_irq_1_0_line_hold)); + lt2.Add(new emu_timer2(7, TIME_ACT.Video_vblank_end_callback)); + lt2.Add(new emu_timer2(10, TIME_ACT.YM2151_irqAon_callback)); + lt2.Add(new emu_timer2(11, TIME_ACT.YM2151_irqBon_callback)); + lt2.Add(new emu_timer2(12, TIME_ACT.YM2151_irqAoff_callback)); + lt2.Add(new emu_timer2(13, TIME_ACT.YM2151_irqBoff_callback)); + lt2.Add(new emu_timer2(14, TIME_ACT.YM2151_timer_callback_a)); + lt2.Add(new emu_timer2(15, TIME_ACT.YM2151_timer_callback_b)); + lt2.Add(new emu_timer2(16, TIME_ACT.Cpuexec_trigger_partial_frame_interrupt)); + lt2.Add(new emu_timer2(17, TIME_ACT.Cpuexec_null_callback)); + lt2.Add(new emu_timer2(18, TIME_ACT.Cpuexec_end_interleave_boost)); + lt2.Add(new emu_timer2(19, TIME_ACT.Video_scanline0_callback)); + lt2.Add(new emu_timer2(20, TIME_ACT.Sound_latch_callback)); + lt2.Add(new emu_timer2(21, TIME_ACT.Sound_latch_callback2)); + lt2.Add(new emu_timer2(22, TIME_ACT.Sound_latch_callback3)); + lt2.Add(new emu_timer2(23, TIME_ACT.Sound_latch_callback4)); + lt2.Add(new emu_timer2(24, TIME_ACT.Neogeo_display_position_interrupt_callback)); + lt2.Add(new emu_timer2(25, TIME_ACT.Neogeo_display_position_vblank_callback)); + lt2.Add(new emu_timer2(26, TIME_ACT.Neogeo_vblank_interrupt_callback)); + lt2.Add(new emu_timer2(27, TIME_ACT.Neogeo_auto_animation_timer_callback)); + lt2.Add(new emu_timer2(29, TIME_ACT.YM2610_F2610_timer_callback_0)); + lt2.Add(new emu_timer2(30, TIME_ACT.YM2610_F2610_timer_callback_1)); + lt2.Add(new emu_timer2(31, TIME_ACT.Neogeo_sprite_line_timer_callback)); + lt2.Add(new emu_timer2(32, TIME_ACT.M6800_action_rx)); + lt2.Add(new emu_timer2(33, TIME_ACT.M6800_action_tx)); + lt2.Add(new emu_timer2(34, TIME_ACT.YM3812_timer_callback_3812_0)); + lt2.Add(new emu_timer2(35, TIME_ACT.YM3812_timer_callback_3812_1)); + lt2.Add(new emu_timer2(36, TIME_ACT.ICS2115_timer_cb_0)); + lt2.Add(new emu_timer2(37, TIME_ACT.ICS2115_timer_cb_1)); + lt2.Add(new emu_timer2(38, TIME_ACT.M72_m72_scanline_interrupt)); + lt2.Add(new emu_timer2(39, TIME_ACT.setvector)); + lt2.Add(new emu_timer2(40, TIME_ACT.M92_m92_scanline_interrupt)); + lt2.Add(new emu_timer2(41, TIME_ACT.Cpuexec_cpu_timeslicecallback)); + lt2.Add(new emu_timer2(42, TIME_ACT.Cpuexec_vblank_interrupt2)); + lt2.Add(new emu_timer2(43, TIME_ACT.Konami68000_nmi_callback)); + lt2.Add(new emu_timer2(44, TIME_ACT.Upd7759_upd7759_slave_update)); + lt2.Add(new emu_timer2(45, TIME_ACT.Generic_irq_2_0_line_hold)); + lt2.Add(new emu_timer2(46, TIME_ACT.MSM5205_MSM5205_vclk_callback0)); + lt2.Add(new emu_timer2(47, TIME_ACT.MSM5205_MSM5205_vclk_callback1)); + lt2.Add(new emu_timer2(48, TIME_ACT.YM2203_timer_callback_2203_0_0)); + lt2.Add(new emu_timer2(49, TIME_ACT.YM2203_timer_callback_2203_0_1)); + lt2.Add(new emu_timer2(50, TIME_ACT.YM2203_timer_callback_2203_1_0)); + lt2.Add(new emu_timer2(51, TIME_ACT.YM2203_timer_callback_2203_1_1)); + lt2.Add(new emu_timer2(52, TIME_ACT.YM3812_timer_callback_3526_0)); + lt2.Add(new emu_timer2(53, TIME_ACT.YM3812_timer_callback_3526_1)); + lt2.Add(new emu_timer2(54, TIME_ACT.K054539_k054539_irq)); + lt2.Add(new emu_timer2(55, TIME_ACT.Taito_cchip_timer)); } + + + #region 更换调度 + + public enum TIME_ACT : byte + { + NoneAct = 0, + Video_vblank_begin_callback, + Mame_soft_reset, + Cpuint_cpunum_empty_event_queue, + Sound_sound_update, + Watchdog_watchdog_callback, + Generic_irq_1_0_line_hold, + Video_vblank_end_callback, + YM2151_irqAon_callback, + YM2151_irqBon_callback, + YM2151_irqAoff_callback, + YM2151_irqBoff_callback, + YM2151_timer_callback_a, + YM2151_timer_callback_b, + Cpuexec_trigger_partial_frame_interrupt, + Cpuexec_null_callback, + Cpuexec_end_interleave_boost, + Video_scanline0_callback, + Sound_latch_callback, + Sound_latch_callback2, + Sound_latch_callback3, + Sound_latch_callback4, + Neogeo_display_position_interrupt_callback, + Neogeo_display_position_vblank_callback, + Neogeo_vblank_interrupt_callback, + Neogeo_auto_animation_timer_callback, + YM2610_F2610_timer_callback_0, + YM2610_F2610_timer_callback_1, + Neogeo_sprite_line_timer_callback, + M6800_action_rx, + M6800_action_tx, + YM3812_timer_callback_3812_0, + YM3812_timer_callback_3812_1, + ICS2115_timer_cb_0, + ICS2115_timer_cb_1, + M72_m72_scanline_interrupt, + setvector, + M92_m92_scanline_interrupt, + Cpuexec_cpu_timeslicecallback, + Cpuexec_vblank_interrupt2, + Konami68000_nmi_callback, + Upd7759_upd7759_slave_update, + Generic_irq_2_0_line_hold, + MSM5205_MSM5205_vclk_callback0, + MSM5205_MSM5205_vclk_callback1, + YM2203_timer_callback_2203_0_0, + YM2203_timer_callback_2203_0_1, + YM2203_timer_callback_2203_1_0, + YM2203_timer_callback_2203_1_1, + YM3812_timer_callback_3526_0, + YM3812_timer_callback_3526_1, + K054539_k054539_irq, + Taito_cchip_timer, + + + + Cpuexec_trigger2, + Taitob_rsaga2_interrupt2, + Taitob_crimec_interrupt3, + Taitob_hitice_interrupt6, + Taitob_rambo3_interrupt1, + Taitob_pbobble_interrupt5, + Taitob_viofight_interrupt1, + Taitob_masterw_interrupt4, + Taitob_silentd_interrupt4, + Taitob_selfeena_interrupt4, + Taitob_sbm_interrupt5, + Generic_clear_all_lines, + M92_spritebuffer_callback, + Taito_opwolf_timer_callback, + Taito_nmi_callback, + } + + public static void DoAct(TIME_ACT act) + { + switch (act) + { + case TIME_ACT.Video_vblank_begin_callback: Video.vblank_begin_callback(); break; + case TIME_ACT.Mame_soft_reset: Mame.soft_reset(); break; + case TIME_ACT.Cpuint_cpunum_empty_event_queue: Cpuint.cpunum_empty_event_queue(); break; + case TIME_ACT.Sound_sound_update: Sound.sound_update(); break; + case TIME_ACT.Watchdog_watchdog_callback: Watchdog.watchdog_callback(); break; + case TIME_ACT.Generic_irq_1_0_line_hold: Generic.irq_1_0_line_hold(); break; + case TIME_ACT.Video_vblank_end_callback: Video.vblank_end_callback(); break; + case TIME_ACT.YM2151_irqAon_callback: YM2151.irqAon_callback(); break; + case TIME_ACT.YM2151_irqBon_callback: YM2151.irqBon_callback(); break; + case TIME_ACT.YM2151_irqAoff_callback: YM2151.irqAoff_callback(); break; + case TIME_ACT.YM2151_irqBoff_callback: YM2151.irqBoff_callback(); break; + case TIME_ACT.YM2151_timer_callback_a: YM2151.timer_callback_a(); break; + case TIME_ACT.YM2151_timer_callback_b: YM2151.timer_callback_b(); break; + case TIME_ACT.Cpuexec_trigger_partial_frame_interrupt: Cpuexec.trigger_partial_frame_interrupt(); break; + case TIME_ACT.Cpuexec_null_callback: Cpuexec.null_callback(); break; + case TIME_ACT.Cpuexec_end_interleave_boost: Cpuexec.end_interleave_boost(); break; + case TIME_ACT.Video_scanline0_callback: Video.scanline0_callback(); break; + case TIME_ACT.Sound_latch_callback: Sound.latch_callback(); break; + case TIME_ACT.Sound_latch_callback2: Sound.latch_callback2(); break; + case TIME_ACT.Sound_latch_callback3: Sound.latch_callback3(); break; + case TIME_ACT.Sound_latch_callback4: Sound.latch_callback4(); break; + case TIME_ACT.Neogeo_display_position_interrupt_callback: Neogeo.display_position_interrupt_callback(); break; + case TIME_ACT.Neogeo_display_position_vblank_callback: Neogeo.display_position_vblank_callback(); break; + case TIME_ACT.Neogeo_vblank_interrupt_callback: Neogeo.vblank_interrupt_callback(); break; + case TIME_ACT.Neogeo_auto_animation_timer_callback: Neogeo.auto_animation_timer_callback(); break; + case TIME_ACT.YM2610_F2610_timer_callback_0: YM2610.F2610.timer_callback_0(); break; + case TIME_ACT.YM2610_F2610_timer_callback_1: YM2610.F2610.timer_callback_1(); break; + case TIME_ACT.Neogeo_sprite_line_timer_callback: Neogeo.sprite_line_timer_callback(); break; + case TIME_ACT.M6800_action_rx: M6800.action_rx(); break; + case TIME_ACT.M6800_action_tx: M6800.action_tx(); break; + case TIME_ACT.YM3812_timer_callback_3812_0: YM3812.timer_callback_3812_0(); break; + case TIME_ACT.YM3812_timer_callback_3812_1: YM3812.timer_callback_3812_1(); break; + case TIME_ACT.ICS2115_timer_cb_0: ICS2115.timer_cb_0(); break; + case TIME_ACT.ICS2115_timer_cb_1: ICS2115.timer_cb_1(); break; + case TIME_ACT.M72_m72_scanline_interrupt: M72.m72_scanline_interrupt(); break; + case TIME_ACT.setvector: setvector(); break; + case TIME_ACT.M92_m92_scanline_interrupt: M92.m92_scanline_interrupt(); break; + case TIME_ACT.Cpuexec_cpu_timeslicecallback: Cpuexec.cpu_timeslicecallback(); break; + case TIME_ACT.Cpuexec_vblank_interrupt2: Cpuexec.vblank_interrupt2(); break; + case TIME_ACT.Konami68000_nmi_callback: Konami68000.nmi_callback(); break; + case TIME_ACT.Upd7759_upd7759_slave_update: Upd7759.upd7759_slave_update(); break; + case TIME_ACT.Generic_irq_2_0_line_hold: Generic.irq_2_0_line_hold(); break; + case TIME_ACT.MSM5205_MSM5205_vclk_callback0: MSM5205.MSM5205_vclk_callback0(); break; + case TIME_ACT.MSM5205_MSM5205_vclk_callback1: MSM5205.MSM5205_vclk_callback1(); break; + case TIME_ACT.YM2203_timer_callback_2203_0_0: YM2203.timer_callback_2203_0_0(); break; + case TIME_ACT.YM2203_timer_callback_2203_0_1: YM2203.timer_callback_2203_0_1(); break; + case TIME_ACT.YM2203_timer_callback_2203_1_0: YM2203.timer_callback_2203_1_0(); break; + case TIME_ACT.YM2203_timer_callback_2203_1_1: YM2203.timer_callback_2203_1_1(); break; + case TIME_ACT.YM3812_timer_callback_3526_0: YM3812.timer_callback_3526_0(); break; + case TIME_ACT.YM3812_timer_callback_3526_1: YM3812.timer_callback_3526_1(); break; + case TIME_ACT.K054539_k054539_irq: K054539.k054539_irq(); break; + case TIME_ACT.Taito_cchip_timer: Taito.cchip_timer(); break; + + case TIME_ACT.Cpuexec_trigger2: Cpuexec.trigger2(); break; + + + case TIME_ACT.Taitob_rsaga2_interrupt2: Taitob.rsaga2_interrupt2(); break; + case TIME_ACT.Taitob_crimec_interrupt3: Taitob.crimec_interrupt3(); break; + case TIME_ACT.Taitob_hitice_interrupt6: Taitob.hitice_interrupt6(); break; + case TIME_ACT.Taitob_rambo3_interrupt1: Taitob.rambo3_interrupt1(); break; + case TIME_ACT.Taitob_pbobble_interrupt5: Taitob.pbobble_interrupt5(); break; + case TIME_ACT.Taitob_viofight_interrupt1: Taitob.viofight_interrupt1(); break; + case TIME_ACT.Taitob_masterw_interrupt4: Taitob.masterw_interrupt4(); break; + case TIME_ACT.Taitob_silentd_interrupt4: Taitob.silentd_interrupt4(); break; + case TIME_ACT.Taitob_selfeena_interrupt4: Taitob.selfeena_interrupt4(); break; + case TIME_ACT.Taitob_sbm_interrupt5: Taitob.sbm_interrupt5(); break; + + case TIME_ACT.Generic_clear_all_lines: Generic.clear_all_lines(); break; + case TIME_ACT.M92_spritebuffer_callback: M92.spritebuffer_callback(); break;//!! + case TIME_ACT.Taito_opwolf_timer_callback: Taito.opwolf_timer_callback(); break; + case TIME_ACT.Taito_nmi_callback: Taito.nmi_callback(); break; + } + } + #endregion public static Atime get_current_time() { if (callback_timer != null) @@ -204,25 +464,25 @@ namespace MAME.Core } } } - public static void timer_pulse_internal(Atime period, Action action, string func) + public static void timer_pulse_internal(Atime period, TIME_ACT action) { - emu_timer timer = timer_alloc_common(action, func, false); + emu_timer timer = timer_alloc_common(action, false); timer_adjust_periodic(timer, period, period); } - public static void timer_set_internal(Action action, string func) + public static void timer_set_internal(TIME_ACT action) { - emu_timer timer = timer_alloc_common(action, func, true); + emu_timer timer = timer_alloc_common(action, true); timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } public static void timer_list_insert(emu_timer timer1) { int i; int i1 = -1; - if (timer1.func == "cpunum_empty_event_queue" || timer1.func == "setvector_callback") + if (timer1.action == TIME_ACT.Cpuint_cpunum_empty_event_queue || timer1.action == TIME_ACT.setvector) { foreach (emu_timer et in lt) { - if (et.func == timer1.func && Attotime.attotime_compare(et.expire, global_basetime) <= 0) + if (et.action == timer1.action && Attotime.attotime_compare(et.expire, global_basetime) <= 0) { i1 = lt.IndexOf(et); break; @@ -244,22 +504,22 @@ namespace MAME.Core } public static void timer_list_remove(emu_timer timer1) { - if (timer1.func == "cpunum_empty_event_queue" || timer1.func == "setvector_callback") + if (timer1.action == TIME_ACT.Cpuint_cpunum_empty_event_queue || timer1.action == TIME_ACT.setvector) { List lt1 = new List(); foreach (emu_timer et in lt) { - if (et.func == timer1.func && Attotime.attotime_compare(et.expire, timer1.expire) == 0) + if (et.action == timer1.action && Attotime.attotime_compare(et.expire, timer1.expire) == 0) { lt1.Add(et); //lt.Remove(et); //break; } - else if (et.func == timer1.func && Attotime.attotime_compare(et.expire, timer1.expire) < 0) + else if (et.action == timer1.action && Attotime.attotime_compare(et.expire, timer1.expire) < 0) { int i1 = 1; } - else if (et.func == timer1.func && Attotime.attotime_compare(et.expire, timer1.expire) > 0) + else if (et.action == timer1.action && Attotime.attotime_compare(et.expire, timer1.expire) > 0) { int i1 = 1; } @@ -273,7 +533,7 @@ namespace MAME.Core { foreach (emu_timer et in lt) { - if (et.func == timer1.func) + if (et.action == timer1.action) { lt.Remove(et); break; @@ -331,9 +591,10 @@ namespace MAME.Core callback_timer = timer; callback_timer_expire_time = timer.expire; //if (was_enabled && (timer.action != null && timer.action != Cpuexec.null_callback)) - if (was_enabled && (timer.action != null && timer.func != "boost_callback")) + if (was_enabled && (timer.action != TIME_ACT.NoneAct && timer.action != TIME_ACT.Cpuexec_null_callback)) { - timer.action(); + //timer.action(); + DoAct(timer.action); } callback_timer = null; if (callback_timer_modified == false) @@ -352,7 +613,7 @@ namespace MAME.Core } } } - public static emu_timer timer_alloc_common(Action action, string func, bool temp) + public static emu_timer timer_alloc_common(TIME_ACT action, bool temp) { Atime time = get_current_time(); emu_timer timer = new emu_timer(); @@ -360,7 +621,7 @@ namespace MAME.Core timer.enabled = false; timer.temporary = temp; timer.period = Attotime.ATTOTIME_ZERO; - timer.func = func; + //timer.func = func; timer.start = time; timer.expire = Attotime.ATTOTIME_NEVER; timer_list_insert(timer); @@ -390,7 +651,7 @@ namespace MAME.Core writer.Write(n); for (i = 0; i < n; i++) { - i1 = getindexbyfunc(lt[i].func); + i1 = getindexbyaction(lt[i].action); writer.Write(i1); writer.Write(lt[i].enabled); writer.Write(lt[i].temporary); @@ -424,7 +685,7 @@ namespace MAME.Core lt.Add(new emu_timer()); i1 = reader.ReadInt32(); lt[i].action = getactionbyindex(i1); - lt[i].func = getfuncbyindex(i1); + //lt[i].func = getfuncbyindex(i1); lt[i].enabled = reader.ReadBoolean(); lt[i].temporary = reader.ReadBoolean(); lt[i].period.seconds = reader.ReadInt32(); @@ -433,49 +694,50 @@ namespace MAME.Core lt[i].start.attoseconds = reader.ReadInt64(); lt[i].expire.seconds = reader.ReadInt32(); lt[i].expire.attoseconds = reader.ReadInt64(); - if (lt[i].func == "vblank_begin_callback") + //if (lt[i].func == "vblank_begin_callback") + if (lt[i].action == TIME_ACT.Video_vblank_begin_callback) { Video.vblank_begin_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Video.vblank_begin_timer); } - else if (lt[i].func == "vblank_end_callback") + else if (lt[i].action == TIME_ACT.Video_vblank_end_callback) { Video.vblank_end_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Video.vblank_end_timer); } - else if (lt[i].func == "soft_reset") + else if (lt[i].action == TIME_ACT.Mame_soft_reset) { Mame.soft_reset_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Mame.soft_reset_timer); } - else if (lt[i].func == "watchdog_callback") + else if (lt[i].action == TIME_ACT.Watchdog_watchdog_callback) { Watchdog.watchdog_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Watchdog.watchdog_timer); } - else if (lt[i].func == "irq_1_0_line_hold") + else if (lt[i].action == TIME_ACT.Generic_irq_1_0_line_hold) { Cpuexec.timedint_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Cpuexec.timedint_timer); } - else if (lt[i].func == "timer_callback_a") + else if (lt[i].action == TIME_ACT.YM2151_timer_callback_a) { YM2151.PSG.timer_A = lt[i]; lt.Remove(lt[i]); lt.Add(YM2151.PSG.timer_A); } - else if (lt[i].func == "timer_callback_b") + else if (lt[i].action == TIME_ACT.YM2151_timer_callback_b) { YM2151.PSG.timer_B = lt[i]; lt.Remove(lt[i]); lt.Add(YM2151.PSG.timer_B); } - else if (lt[i].func == "trigger_partial_frame_interrupt") + else if (lt[i].action == TIME_ACT.Cpuexec_trigger_partial_frame_interrupt) { switch (Machine.sBoard) { @@ -513,175 +775,175 @@ namespace MAME.Core break; } } - else if (lt[i].func == "boost_callback") + else if (lt[i].action == TIME_ACT.Cpuexec_null_callback) { Cpuexec.interleave_boost_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Cpuexec.interleave_boost_timer); } - else if (lt[i].func == "end_interleave_boost") + else if (lt[i].action == TIME_ACT.Cpuexec_end_interleave_boost) { Cpuexec.interleave_boost_timer_end = lt[i]; lt.Remove(lt[i]); lt.Add(Cpuexec.interleave_boost_timer_end); } - else if (lt[i].func == "scanline0_callback") + else if (lt[i].action == TIME_ACT.Video_scanline0_callback) { Video.scanline0_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Video.scanline0_timer); } - else if (lt[i].func == "display_position_interrupt_callback") + else if (lt[i].action == TIME_ACT.Neogeo_display_position_interrupt_callback) { Neogeo.display_position_interrupt_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Neogeo.display_position_interrupt_timer); } - else if (lt[i].func == "display_position_vblank_callback") + else if (lt[i].action == TIME_ACT.Neogeo_display_position_vblank_callback) { Neogeo.display_position_vblank_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Neogeo.display_position_vblank_timer); } - else if (lt[i].func == "vblank_interrupt_callback") + else if (lt[i].action == TIME_ACT.Neogeo_vblank_interrupt_callback) { Neogeo.vblank_interrupt_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Neogeo.vblank_interrupt_timer); } - else if (lt[i].func == "auto_animation_timer_callback") + else if (lt[i].action == TIME_ACT.Neogeo_auto_animation_timer_callback) { Neogeo.auto_animation_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Neogeo.auto_animation_timer); } - else if (lt[i].func == "sprite_line_timer_callback") + else if (lt[i].action == TIME_ACT.Neogeo_sprite_line_timer_callback) { Neogeo.sprite_line_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Neogeo.sprite_line_timer); } - else if (lt[i].func == "timer_callback_0") + else if (lt[i].action == TIME_ACT.YM2610_F2610_timer_callback_0) { YM2610.timer[0] = lt[i]; lt.Remove(lt[i]); lt.Add(YM2610.timer[0]); } - else if (lt[i].func == "timer_callback_1") + else if (lt[i].action == TIME_ACT.YM2610_F2610_timer_callback_1) { YM2610.timer[1] = lt[i]; lt.Remove(lt[i]); lt.Add(YM2610.timer[1]); } - else if (lt[i].func == "m6800_rx_tick") + else if (lt[i].action == TIME_ACT.M6800_action_rx) { M6800.m1.m6800_rx_timer = lt[i]; lt.Remove(lt[i]); lt.Add(M6800.m1.m6800_rx_timer); } - else if (lt[i].func == "m6800_tx_tick") + else if (lt[i].action == TIME_ACT.M6800_action_tx) { M6800.m1.m6800_tx_timer = lt[i]; lt.Remove(lt[i]); lt.Add(M6800.m1.m6800_tx_timer); } - else if (lt[i].func == "timer_callback_3812_0") + else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3812_0) { YM3812.timer[0] = lt[i]; lt.Remove(lt[i]); lt.Add(YM3812.timer[0]); } - else if (lt[i].func == "timer_callback_3812_1") + else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3812_1) { YM3812.timer[1] = lt[i]; lt.Remove(lt[i]); lt.Add(YM3812.timer[1]); } - else if (lt[i].func == "timer_cb_0") + else if (lt[i].action == TIME_ACT.ICS2115_timer_cb_0) { ICS2115.timer[0].timer = lt[i]; lt.Remove(lt[i]); lt.Add(ICS2115.timer[0].timer); } - else if (lt[i].func == "timer_cb_1") + else if (lt[i].action == TIME_ACT.ICS2115_timer_cb_1) { ICS2115.timer[1].timer = lt[i]; lt.Remove(lt[i]); lt.Add(ICS2115.timer[1].timer); } - else if (lt[i].func == "m72_scanline_interrupt") + else if (lt[i].action == TIME_ACT.M72_m72_scanline_interrupt) { M72.scanline_timer = lt[i]; lt.Remove(lt[i]); lt.Add(M72.scanline_timer); } - else if (lt[i].func == "m92_scanline_interrupt") + else if (lt[i].action == TIME_ACT.M92_m92_scanline_interrupt) { M92.scanline_timer = lt[i]; lt.Remove(lt[i]); lt.Add(M92.scanline_timer); } - else if (lt[i].func == "cpu_timeslicecallback") + else if (lt[i].action == TIME_ACT.Cpuexec_cpu_timeslicecallback) { Cpuexec.timeslice_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Cpuexec.timeslice_timer); } - else if (lt[i].func == "upd7759_slave_update") + else if (lt[i].action == TIME_ACT.Upd7759_upd7759_slave_update) { Upd7759.chip.timer = lt[i]; lt.Remove(lt[i]); lt.Add(Upd7759.chip.timer); } - else if (lt[i].func == "irq_2_0_line_hold") + else if (lt[i].action == TIME_ACT.Generic_irq_2_0_line_hold) { Cpuexec.timedint_timer = lt[i]; lt.Remove(lt[i]); lt.Add(Cpuexec.timedint_timer); } - else if (lt[i].func == "msm5205_vclk_callback0") + else if (lt[i].action == TIME_ACT.MSM5205_MSM5205_vclk_callback0) { MSM5205.timer[0] = lt[i]; lt.Remove(lt[i]); lt.Add(MSM5205.timer[0]); } - else if (lt[i].func == "msm5205_vclk_callback1") + else if (lt[i].action == TIME_ACT.MSM5205_MSM5205_vclk_callback1) { MSM5205.timer[1] = lt[i]; lt.Remove(lt[i]); lt.Add(MSM5205.timer[1]); } - else if (lt[i].func == "timer_callback_2203_0_0") + else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_0_0) { YM2203.FF2203[0].timer[0] = lt[i]; lt.Remove(lt[i]); lt.Add(YM2203.FF2203[0].timer[0]); } - else if (lt[i].func == "timer_callback_2203_0_1") + else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_0_1) { YM2203.FF2203[0].timer[1] = lt[i]; lt.Remove(lt[i]); lt.Add(YM2203.FF2203[0].timer[1]); } - else if (lt[i].func == "timer_callback_2203_1_0") + else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_1_0) { YM2203.FF2203[1].timer[0] = lt[i]; lt.Remove(lt[i]); lt.Add(YM2203.FF2203[1].timer[0]); } - else if (lt[i].func == "timer_callback_2203_1_1") + else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_1_1) { YM2203.FF2203[1].timer[1] = lt[i]; lt.Remove(lt[i]); lt.Add(YM2203.FF2203[1].timer[1]); } - else if (lt[i].func == "timer_callback_3526_0") + else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3526_0) { YM3812.timer[0] = lt[i]; lt.Remove(lt[i]); lt.Add(YM3812.timer[0]); } - else if (lt[i].func == "timer_callback_3526_1") + else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3526_1) { YM3812.timer[1] = lt[i]; lt.Remove(lt[i]); diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Generic.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Generic.cs index d92bfe4..6b735ac 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Generic.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Generic.cs @@ -157,7 +157,7 @@ namespace MAME.Core if (enabled == 0) { objcpunum = cpunum; - EmuTimer.timer_set_internal(clear_all_lines, "clear_all_lines"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Generic_clear_all_lines); } } public static void interrupt_enable_w(byte data) diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Mame.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Mame.cs index 4f562ca..c2b27d4 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Mame.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Mame.cs @@ -170,7 +170,7 @@ namespace MAME.Core Palette.palette_init(); Generic.generic_machine_init(); EmuTimer.timer_init(); - soft_reset_timer = EmuTimer.timer_alloc_common(soft_reset, "soft_reset", false); + soft_reset_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Mame_soft_reset, false); Window.osd_init(); Inptport.input_port_init(); Cpuexec.cpuexec_init(); diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Video.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Video.cs index 657d9b0..a1c73e2 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Video.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Video.cs @@ -72,7 +72,7 @@ namespace MAME.Core #region 抽象出去 - static Action Act_SubmitVideo; + static Action Act_SubmitVideo; public static void BindFunc(IVideoPlayer Ivp) { @@ -651,11 +651,11 @@ namespace MAME.Core - vblank_begin_timer = EmuTimer.timer_alloc_common(vblank_begin_callback, "vblank_begin_callback", false); + vblank_begin_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Video_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); + scanline0_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Video_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); + vblank_end_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Video_vblank_end_callback, false); switch (Machine.sBoard) { case "CPS-1": @@ -666,19 +666,19 @@ namespace MAME.Core break; case "CPS2": Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 262); - Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_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 = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_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 = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_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 = EmuTimer.timer_alloc_common(Cpuexec.trigger2, "trigger2", false); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger2, false); break; case "IGS011": switch (Machine.sName) @@ -693,27 +693,27 @@ namespace MAME.Core case "drgnwrldv40k": case "lhb2": Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 5); - Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_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 = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_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 = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_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 = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[3].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); break; } break; @@ -722,7 +722,7 @@ namespace MAME.Core { case "cuebrick": Cpuexec.cpu[0].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 10); - Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[0].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); break; } break; @@ -741,7 +741,7 @@ namespace MAME.Core case "makaimurg": case "diamond": Cpuexec.cpu[1].partial_frame_period = Attotime.attotime_div(Video.frame_update_time, 4); - Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(Cpuexec.trigger_partial_frame_interrupt, "trigger_partial_frame_interrupt", false); + Cpuexec.cpu[1].partial_frame_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Cpuexec_trigger_partial_frame_interrupt, false); break; } break; diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Watchdog.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Watchdog.cs index 3c908c9..1b49f61 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Watchdog.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Watchdog.cs @@ -7,7 +7,7 @@ public static Atime watchdog_time; public static void watchdog_init() { - watchdog_timer = EmuTimer.timer_alloc_common(watchdog_callback, "watchdog_callback", false); + watchdog_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Watchdog_watchdog_callback, false); switch (Machine.sBoard) { case "CPS-1": diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs index 19d0281..2d09396 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs @@ -603,7 +603,7 @@ namespace MAME.Core public static void sound_arm_nmi_w() { Cpuint.cpunum_set_input_line(1, (int)LineState.INPUT_LINE_NMI, LineState.CLEAR_LINE); - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(nmi_callback, "nmi_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common( EmuTimer.TIME_ACT.Konami68000_nmi_callback, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)50e12), Attotime.ATTOTIME_NEVER); } public static ushort punkshot_kludge_r() diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Audio.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Audio.cs index 031804a..9d5e31e 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Audio.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Audio.cs @@ -46,14 +46,14 @@ { Cpuint.lvec.Add(new vec(1, EmuTimer.get_current_time())); setvector_param = 1; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } else { Cpuint.lvec.Add(new vec(2, EmuTimer.get_current_time())); setvector_param = 2; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } } @@ -64,7 +64,7 @@ Sound.soundlatch_w(data); Cpuint.lvec.Add(new vec(3, EmuTimer.get_current_time())); setvector_param = 3; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } } @@ -73,14 +73,14 @@ Sound.soundlatch_w(data); Cpuint.lvec.Add(new vec(3, EmuTimer.get_current_time())); setvector_param = 3; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, 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, EmuTimer.get_current_time())); setvector_param = 4; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } public static void m72_set_sample_start(int start) diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs index bc83afe..1382d22 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs @@ -154,7 +154,7 @@ namespace MAME.Core } public static void machine_start_m72() { - scanline_timer = EmuTimer.timer_alloc_common(m72_scanline_interrupt, "m72_scanline_interrupt", false); + scanline_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M72_m72_scanline_interrupt, false); } public static void machine_reset_m72() { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/M92.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/M92.cs index dcf7dab..c9e929e 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/M92.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/M92.cs @@ -301,7 +301,7 @@ namespace MAME.Core { setvector_param = 0; setvector_callback(); - scanline_timer = EmuTimer.timer_alloc_common(m92_scanline_interrupt, "m92_scanline_interrupt", false); + scanline_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M92_m92_scanline_interrupt, false); } public static void machine_reset_m92() { @@ -415,7 +415,7 @@ namespace MAME.Core { Cpuint.lvec.Add(new vec(3, EmuTimer.get_current_time())); setvector_param = 3; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); Sound.soundlatch_w((ushort)(data & 0xff)); } @@ -431,7 +431,7 @@ namespace MAME.Core { Cpuint.lvec.Add(new vec(4, EmuTimer.get_current_time())); setvector_param = 4; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } public static void m92_sound_status_w(ushort data) @@ -445,14 +445,14 @@ namespace MAME.Core { Cpuint.lvec.Add(new vec(1, EmuTimer.get_current_time())); setvector_param = 1; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } else { Cpuint.lvec.Add(new vec(2, EmuTimer.get_current_time())); setvector_param = 2; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(setvector_callback, "setvector_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.setvector, true); EmuTimer.timer_adjust_periodic(timer, Attotime.ATTOTIME_ZERO, Attotime.ATTOTIME_NEVER); } } diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Video.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Video.cs index 896c8b7..e696156 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Video.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Video.cs @@ -45,7 +45,7 @@ namespace MAME.Core { Generic.buffer_spriteram16_w(); m92_sprite_buffer_busy = 0; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(spritebuffer_callback, "spritebuffer_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M92_spritebuffer_callback, true); EmuTimer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); } } @@ -67,7 +67,7 @@ namespace MAME.Core { Generic.buffer_spriteram16_w(); m92_sprite_buffer_busy = 0; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(spritebuffer_callback, "spritebuffer_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M92_spritebuffer_callback, true); EmuTimer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); } } @@ -89,7 +89,7 @@ namespace MAME.Core { Generic.buffer_spriteram16_w(); m92_sprite_buffer_busy = 0; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(spritebuffer_callback, "spritebuffer_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.M92_spritebuffer_callback, true); EmuTimer.timer_adjust_periodic(timer, Attotime.attotime_mul(new Atime(0, (long)(1e18 / 26666000)), 0x400), Attotime.ATTOTIME_NEVER); } } diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neogeo.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neogeo.cs index 955725a..0e99890 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neogeo.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neogeo.cs @@ -325,9 +325,9 @@ namespace MAME.Core audio_cpu_banks[1] = 0x0e; audio_cpu_banks[2] = 0x06; audio_cpu_banks[3] = 0x02; - display_position_interrupt_timer = EmuTimer.timer_alloc_common(display_position_interrupt_callback, "display_position_interrupt_callback", false); - display_position_vblank_timer = EmuTimer.timer_alloc_common(display_position_vblank_callback, "display_position_vblank_callback", false); - vblank_interrupt_timer = EmuTimer.timer_alloc_common(vblank_interrupt_callback, "vblank_interrupt_callback", false); + display_position_interrupt_timer = EmuTimer.timer_alloc_common( EmuTimer.TIME_ACT.Neogeo_display_position_interrupt_callback, false); + display_position_vblank_timer = EmuTimer.timer_alloc_common( EmuTimer.TIME_ACT.Neogeo_display_position_vblank_callback, false); + vblank_interrupt_timer = EmuTimer.timer_alloc_common( EmuTimer.TIME_ACT.Neogeo_vblank_interrupt_callback, false); Pd4900a.pd4990a_init(); calendar_init(); irq3_pending = 1; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Video.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Video.cs index ddd4815..45d98c0 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Video.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Video.cs @@ -127,7 +127,7 @@ namespace MAME.Core } private static void create_auto_animation_timer() { - auto_animation_timer = EmuTimer.timer_alloc_common(auto_animation_timer_callback, "auto_animation_timer_callback", false); + auto_animation_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Neogeo_auto_animation_timer_callback, false); } private static void start_auto_animation_timer() { @@ -363,7 +363,7 @@ namespace MAME.Core } private static void create_sprite_line_timer() { - sprite_line_timer = EmuTimer.timer_alloc_common(sprite_line_timer_callback, "sprite_line_timer_callback", false); + sprite_line_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Neogeo_sprite_line_timer_callback, false); } private static void start_sprite_line_timer() { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Bublbobl.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Bublbobl.cs index 2b57124..480e491 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Bublbobl.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Bublbobl.cs @@ -73,7 +73,7 @@ public static void bublbobl_sound_command_w(byte data) { Sound.soundlatch_w((ushort)data); - EmuTimer.timer_set_internal(nmi_callback, "nmi_callback"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Taito_nmi_callback); } public static void bublbobl_sh_nmi_disable_w() { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Opwolf.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Opwolf.cs index 7b334b9..9d7ac45 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Opwolf.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Opwolf.cs @@ -981,7 +981,7 @@ namespace MAME.Core if (cchip_ram[0x7a] == 0 && cchip_last_7a != 0 && current_cmd != 0xf5) { current_cmd = 0xf5; - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(opwolf_timer_callback, "opwolf_timer_callback", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Taito_opwolf_timer_callback, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(80000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); } cchip_last_7a = cchip_ram[0x7a]; @@ -1020,7 +1020,7 @@ namespace MAME.Core cchip_credits_for_coin[0] = 1; cchip_coins_for_credit[1] = 1; cchip_credits_for_coin[1] = 1; - EmuTimer.timer_pulse_internal(new Atime(0, (long)(1e18 / 60)), cchip_timer, "cchip_timer"); + EmuTimer.timer_pulse_internal(new Atime(0, (long)(1e18 / 60)), EmuTimer.TIME_ACT.Taito_cchip_timer); } } } diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Taitob.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Taitob.cs index b3b4a62..228eac9 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Taitob.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Taitob.cs @@ -1,4 +1,6 @@ -namespace MAME.Core +using static MAME.Core.EmuTimer; + +namespace MAME.Core { public partial class Taitob { @@ -89,7 +91,7 @@ } public static void rastansaga2_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(rsaga2_interrupt2, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_rsaga2_interrupt2, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); } @@ -99,7 +101,7 @@ } public static void crimec_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(crimec_interrupt3, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_crimec_interrupt3, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); } @@ -109,7 +111,7 @@ } public static void hitice_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(hitice_interrupt6, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_hitice_interrupt6, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); } @@ -119,7 +121,7 @@ } public static void rambo3_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(rambo3_interrupt1, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_rambo3_interrupt1, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); } @@ -129,7 +131,7 @@ } public static void pbobble_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(pbobble_interrupt5, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_pbobble_interrupt5, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 3, LineState.HOLD_LINE); } @@ -139,7 +141,7 @@ } public static void viofight_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(viofight_interrupt1, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_viofight_interrupt1, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); } @@ -149,7 +151,7 @@ } public static void masterw_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(masterw_interrupt4, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_masterw_interrupt4, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 5, LineState.HOLD_LINE); } @@ -159,7 +161,7 @@ } public static void silentd_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(silentd_interrupt4, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_silentd_interrupt4, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); } @@ -169,7 +171,7 @@ } public static void selfeena_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(selfeena_interrupt4, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_selfeena_interrupt4, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(5000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 6, LineState.HOLD_LINE); } @@ -179,7 +181,7 @@ } public static void sbm_interrupt() { - EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(sbm_interrupt5, "vblank_interrupt2", true); + EmuTimer.emu_timer timer = EmuTimer.timer_alloc_common(TIME_ACT.Taitob_sbm_interrupt5, true); EmuTimer.timer_adjust_periodic(timer, new Atime(0, (long)(10000 * Cpuexec.cpu[0].attoseconds_per_cycle)), Attotime.ATTOTIME_NEVER); Cpuint.cpunum_set_input_line(0, 4, LineState.HOLD_LINE); } diff --git a/MAME.Unity/Assets/Plugins/UMAME/sound/ICS2115.cs b/MAME.Unity/Assets/Plugins/UMAME/sound/ICS2115.cs index 213e541..353a93b 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/sound/ICS2115.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/sound/ICS2115.cs @@ -334,8 +334,8 @@ namespace MAME.Core int i; voice2 = new voice_struct[32]; timer = new timer_struct[2]; - timer[0].timer = EmuTimer.timer_alloc_common(timer_cb_0, "timer_cb_0", false); - timer[1].timer = EmuTimer.timer_alloc_common(timer_cb_1, "timer_cb_1", false); + timer[0].timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.ICS2115_timer_cb_0, false); + timer[1].timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.ICS2115_timer_cb_1, false); ulaw = new short[256]; for (i = 0; i < 256; i++) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/sound/K054539.cs b/MAME.Unity/Assets/Plugins/UMAME/sound/K054539.cs index 1daa58d..e536ce0 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/sound/K054539.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/sound/K054539.cs @@ -371,7 +371,7 @@ namespace MAME.Core } if (irq != null) { - EmuTimer.timer_pulse_internal(new Atime(0, (long)(1e18 / 480)), k054539_irq, "k054539_irq"); + EmuTimer.timer_pulse_internal(new Atime(0, (long)(1e18 / 480)), EmuTimer.TIME_ACT.K054539_k054539_irq); } } static void k054539_w(int chip, int offset, byte data) diff --git a/MAME.Unity/Assets/Plugins/UMAME/sound/MSM5205.cs b/MAME.Unity/Assets/Plugins/UMAME/sound/MSM5205.cs index 71bba42..c4de52a 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/sound/MSM5205.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/sound/MSM5205.cs @@ -177,11 +177,11 @@ namespace MAME.Core mm1[sndindex].voice.stream = new sound_stream(clock, 0, 1, mm1[sndindex].MSM5205_update); if (sndindex == 0) { - timer[0] = EmuTimer.timer_alloc_common(MSM5205_vclk_callback0, "msm5205_vclk_callback0", false); + timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.MSM5205_MSM5205_vclk_callback0, false); } else if (sndindex == 1) { - timer[1] = EmuTimer.timer_alloc_common(MSM5205_vclk_callback1, "msm5205_vclk_callback1", false); + timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.MSM5205_MSM5205_vclk_callback1, false); } mm1[sndindex].msm5205_reset(); } diff --git a/MAME.Unity/Assets/Plugins/UMAME/sound/Sound.cs b/MAME.Unity/Assets/Plugins/UMAME/sound/Sound.cs index 68767dc..f468309 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/sound/Sound.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/sound/Sound.cs @@ -74,7 +74,7 @@ namespace MAME.Core latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateC; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM2151.ym2151_init(3579545); OKI6295.okim6295_start(); ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); @@ -84,7 +84,7 @@ namespace MAME.Core case "CPS-1(QSound)": case "CPS2": sound_update = sound_updateQ; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); QSound.qsound_start(); qsoundstream = new sound_stream(4000000 / 166, 0, 2, QSound.qsound_update); mixerstream = new sound_stream(48000, 2, 0, null); @@ -93,7 +93,7 @@ namespace MAME.Core latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateDataeast_pcktgal; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM2203.ym2203_start(0, 1500000); YM3812.ym3812_start(3000000); MSM5205.msm5205_start(0, 384000, Dataeast.pcktgal_adpcm_int, 5); @@ -104,7 +104,7 @@ namespace MAME.Core latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateTehkan_pbaction; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); AY8910.ay8910_interface generic_ay8910 = new AY8910.ay8910_interface(); generic_ay8910.flags = 1; generic_ay8910.res_load = new int[3] { 1000, 1000, 1000 }; @@ -121,7 +121,7 @@ namespace MAME.Core latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateN; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM2610.ym2610_start(8000000); ym2610stream = new sound_stream(111111, 0, 2, YM2610.F2610.ym2610_update_one); mixerstream = new sound_stream(48000, 3, 0, null); @@ -130,7 +130,7 @@ namespace MAME.Core latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateSunA8; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM3812.ym3812_start(4000000); AY8910.ay8910_interface starfigh_ay8910_interface = new AY8910.ay8910_interface(); starfigh_ay8910_interface.flags = 1; @@ -147,7 +147,7 @@ namespace MAME.Core break; case "Namco System 1": sound_update = sound_updateNa; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM2151.ym2151_init(3579580); Namco.namco_start(); DAC.dac_start(); @@ -168,7 +168,7 @@ namespace MAME.Core case "drgnwrldv11h": case "drgnwrldv40k": sound_update = sound_updateIGS011_drgnwrld; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); OKI6295.okim6295_start(); YM3812.ym3812_start(3579545); okistream = new sound_stream(1047600 / 132, 0, 1, OKI6295.okim6295_update); @@ -182,7 +182,7 @@ namespace MAME.Core case "xymg": case "wlcc": sound_update = sound_updateIGS011_lhb; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); OKI6295.okim6295_start(); okistream = new sound_stream(1047600 / 132, 0, 1, OKI6295.okim6295_update); mixerstream = new sound_stream(48000, 1, 0, null); @@ -190,7 +190,7 @@ namespace MAME.Core case "lhb2": case "nkishusp": sound_update = sound_updateIGS011_lhb2; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); OKI6295.okim6295_start(); YM2413.ym2413_start(3579545); okistream = new sound_stream(1047600 / 132, 0, 1, OKI6295.okim6295_update); @@ -200,7 +200,7 @@ namespace MAME.Core case "vbowl": case "vbowlj": sound_update = sound_updateIGS011_vbowl; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); ICS2115.ics2115_start(); ics2115stream = new sound_stream(33075, 0, 2, ICS2115.ics2115_update); mixerstream = new sound_stream(48000, 2, 0, null); @@ -211,7 +211,7 @@ namespace MAME.Core latched_value = new ushort[3]; utempdata = new ushort[3]; sound_update = sound_updatePGM; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); ICS2115.ics2115_start(); ics2115stream = new sound_stream(33075, 0, 2, ICS2115.ics2115_update); mixerstream = new sound_stream(48000, 2, 0, null); @@ -220,7 +220,7 @@ namespace MAME.Core latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateM72; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM2151.ym2151_init(3579545); DAC.dac_start(); ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); @@ -231,7 +231,7 @@ namespace MAME.Core latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateM92; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM2151.ym2151_init(3579545); Iremga20.iremga20_start(); ym2151stream = new sound_stream(55930, 0, 2, YM2151.ym2151_update_one); @@ -248,7 +248,7 @@ namespace MAME.Core latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateTaito_tokio; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM2203.ym2203_start(0, 3000000); mixerstream = new sound_stream(48000, 4, 0, null); break; @@ -273,7 +273,7 @@ namespace MAME.Core latched_value = new ushort[2]; utempdata = new ushort[2]; sound_update = sound_updateTaito_bublbobl; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM2203.ym2203_start(0, 3000000); YM3812.ym3526_start(3000000); ym3526stream = new sound_stream(41666, 0, 1, FMOpl.ym3526_update_one); @@ -288,7 +288,7 @@ namespace MAME.Core latched_value = new ushort[1]; utempdata = new ushort[1]; sound_update = sound_updateTaito_opwolf; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); YM2151.ym2151_init(4000000); ym2151stream = new sound_stream(62500, 0, 2, YM2151.ym2151_update_one); MSM5205.msm5205_start(0, 384000, Taito.opwolf_msm5205_vck, 5); @@ -315,7 +315,7 @@ namespace MAME.Core AY8910.AA8910[0].stream.gain = 0x100; ym2610stream.gain = 0x100; sound_update = sound_updateTaitoB; - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); mixerstream = new sound_stream(48000, 3, 0, null); break; case "Konami 68000": @@ -441,7 +441,7 @@ namespace MAME.Core mixerstream = new sound_stream(48000, 2, 0, null); break; } - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); break; case "Capcom": latched_value = new ushort[1]; @@ -480,7 +480,7 @@ namespace MAME.Core mixerstream = new sound_stream(48000, 4, 0, null); break; } - sound_update_timer = EmuTimer.timer_alloc_common(sound_update, "sound_update", false); + sound_update_timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Sound_sound_update, false); break; } EmuTimer.timer_adjust_periodic(sound_update_timer, update_frequency, update_frequency); @@ -1702,22 +1702,22 @@ namespace MAME.Core public static void soundlatch_w(ushort data) { utempdata[0] = data; - EmuTimer.timer_set_internal(latch_callback, "latch_callback"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Sound_latch_callback); } public static void soundlatch2_w(ushort data) { utempdata[1] = data; - EmuTimer.timer_set_internal(latch_callback2, "latch_callback2"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Sound_latch_callback2); } public static void soundlatch3_w(ushort data) { utempdata[2] = data; - EmuTimer.timer_set_internal(latch_callback3, "latch_callback3"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Sound_latch_callback3); } public static void soundlatch4_w(ushort data) { utempdata[3] = data; - EmuTimer.timer_set_internal(latch_callback4, "latch_callback4"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.Sound_latch_callback4); } public static ushort soundlatch_r() { diff --git a/MAME.Unity/Assets/Plugins/UMAME/sound/Upd7759.cs b/MAME.Unity/Assets/Plugins/UMAME/sound/Upd7759.cs index d12624e..9c58b0e 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/sound/Upd7759.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/sound/Upd7759.cs @@ -303,7 +303,7 @@ namespace MAME.Core chip.rombase = 0; if (updrom == null) { - chip.timer = EmuTimer.timer_alloc_common(upd7759_slave_update, "upd7759_slave_update", false); + chip.timer = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.Upd7759_upd7759_slave_update, false); } chip.reset = 1; chip.start = 1; diff --git a/MAME.Unity/Assets/Plugins/UMAME/sound/YM2151.cs b/MAME.Unity/Assets/Plugins/UMAME/sound/YM2151.cs index f5a49ba..e43c318 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/sound/YM2151.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/sound/YM2151.cs @@ -455,7 +455,7 @@ namespace MAME.Core if ((PSG.irq_enable & 0x04) != 0) { PSG.status |= 1; - EmuTimer.timer_set_internal(irqAon_callback, "irqAon_callback"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.YM2151_irqAon_callback); } if ((PSG.irq_enable & 0x80) != 0) { @@ -469,7 +469,7 @@ namespace MAME.Core if ((PSG.irq_enable & 0x08) != 0) { PSG.status |= 2; - EmuTimer.timer_set_internal(irqBon_callback, "irqBon_callback"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.YM2151_irqBon_callback); } } private static void set_connect(int cha, int v) @@ -706,12 +706,12 @@ namespace MAME.Core if ((v & 0x10) != 0) /* reset timer A irq flag */ { PSG.status &= 0xfffffffe; - EmuTimer.timer_set_internal(irqAoff_callback, "irqAoff_callback"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.YM2151_irqAoff_callback); } if ((v & 0x20) != 0) /* reset timer B irq flag */ { PSG.status &= 0xfffffffd; - EmuTimer.timer_set_internal(irqBoff_callback, "irqBoff_callback"); + EmuTimer.timer_set_internal(EmuTimer.TIME_ACT.YM2151_irqBoff_callback); } if ((v & 0x02) != 0) { /* load and start timer B */ @@ -934,8 +934,8 @@ namespace MAME.Core PSG.eg_timer_add = (uint)(0x10000 * (clock / 64.0) / PSG.sampfreq); PSG.eg_timer_overflow = 0x30000; /* this must be done _before_ a call to ym2151_reset_chip() */ - PSG.timer_A = EmuTimer.timer_alloc_common(timer_callback_a, "timer_callback_a", false); - PSG.timer_B = EmuTimer.timer_alloc_common(timer_callback_b, "timer_callback_b", false); + PSG.timer_A = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2151_timer_callback_a, false); + PSG.timer_B = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2151_timer_callback_b, false); ym2151_reset_chip(); switch (Machine.sBoard) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/sound/YM2203.cs b/MAME.Unity/Assets/Plugins/UMAME/sound/YM2203.cs index c222168..288c587 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/sound/YM2203.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/sound/YM2203.cs @@ -143,13 +143,13 @@ namespace MAME.Core FF2203[sndindex].timer = new EmuTimer.emu_timer[2]; if (sndindex == 0) { - FF2203[sndindex].timer[0] = EmuTimer.timer_alloc_common(timer_callback_2203_0_0, "timer_callback_2203_0_0", false); - FF2203[sndindex].timer[1] = EmuTimer.timer_alloc_common(timer_callback_2203_0_1, "timer_callback_2203_0_1", false); + FF2203[sndindex].timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2203_timer_callback_2203_0_0, false); + FF2203[sndindex].timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2203_timer_callback_2203_0_1, false); } else if (sndindex == 1) { - FF2203[sndindex].timer[0] = EmuTimer.timer_alloc_common(timer_callback_2203_1_0, "timer_callback_2203_1_0", false); - FF2203[sndindex].timer[1] = EmuTimer.timer_alloc_common(timer_callback_2203_1_1, "timer_callback_2203_1_1", false); + FF2203[sndindex].timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2203_timer_callback_2203_1_0, false); + FF2203[sndindex].timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2203_timer_callback_2203_1_1, false); } FF2203[sndindex].stream = new sound_stream(rate, 0, 1, FF2203[sndindex].ym2203_update_one); ym2203_init(sndindex, clock, rate); diff --git a/MAME.Unity/Assets/Plugins/UMAME/sound/YM2610.cs b/MAME.Unity/Assets/Plugins/UMAME/sound/YM2610.cs index 530f8cc..a9d5f11 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/sound/YM2610.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/sound/YM2610.cs @@ -100,8 +100,8 @@ namespace MAME.Core int rate = clock / 72; AY8910.ay8910_start_ym(17, 0, clock, generic_ay8910); timer = new EmuTimer.emu_timer[2]; - timer[0] = EmuTimer.timer_alloc_common(F2610.timer_callback_0, "timer_callback_0", false); - timer[1] = EmuTimer.timer_alloc_common(F2610.timer_callback_1, "timer_callback_1", false); + timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2610_F2610_timer_callback_0, false); + timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM2610_F2610_timer_callback_1, false); ym2610_init(clock, rate); } public static void ym2610_init(int clock, int rate) diff --git a/MAME.Unity/Assets/Plugins/UMAME/sound/YM3812.cs b/MAME.Unity/Assets/Plugins/UMAME/sound/YM3812.cs index dcab901..8611b4d 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/sound/YM3812.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/sound/YM3812.cs @@ -74,8 +74,8 @@ namespace MAME.Core FMOpl.ym3812_set_timer_handler(TimerHandler_3812); FMOpl.ym3812_set_irq_handler(IRQHandler_3812); FMOpl.ym3812_set_update_handler(_stream_update_3812); - timer[0] = EmuTimer.timer_alloc_common(timer_callback_3812_0, "timer_callback_3812_0", false); - timer[1] = EmuTimer.timer_alloc_common(timer_callback_3812_1, "timer_callback_3812_1", false); + timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM3812_timer_callback_3812_0, false); + timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM3812_timer_callback_3812_1, false); } public static void ym3812_control_port_0_w(byte data) { @@ -233,8 +233,8 @@ namespace MAME.Core FMOpl.ym3526_set_timer_handler(TimerHandler_3526); FMOpl.ym3526_set_irq_handler(IRQHandler_3526); FMOpl.ym3526_set_update_handler(_stream_update_3526); - timer[0] = EmuTimer.timer_alloc_common(timer_callback_3526_0, "timer_callback_3526_0", false); - timer[1] = EmuTimer.timer_alloc_common(timer_callback_3526_1, "timer_callback_3526_1", false); + timer[0] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM3812_timer_callback_3526_0, false); + timer[1] = EmuTimer.timer_alloc_common(EmuTimer.TIME_ACT.YM3812_timer_callback_3526_1, false); } public static void ym3526_control_port_0_w(byte data) {