forked from sin365/AxibugEmuOnline
Compare commits
5 Commits
0a6a2c1e72
...
5fdb799d3c
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fdb799d3c | |||
| f044fb6b97 | |||
| 1675628a3e | |||
| c7c46aee15 | |||
| 8a48e32e66 |
@ -97,7 +97,8 @@ namespace MAME.Core
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EmuTimer.lt = new List<EmuTimer.emu_timer>();
|
//EmuTimer.lt = new List<EmuTimer.emu_timer>();
|
||||||
|
EmuTimer.instancingTimerList();
|
||||||
sSelect = RomInfo.Rom.Name;
|
sSelect = RomInfo.Rom.Name;
|
||||||
Machine.mainMotion = this;
|
Machine.mainMotion = this;
|
||||||
Machine.rom = RomInfo.Rom;
|
Machine.rom = RomInfo.Rom;
|
||||||
|
|||||||
@ -27,6 +27,11 @@ namespace MAME.Core
|
|||||||
public Atime expire;
|
public Atime expire;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
public static void instancingTimerList()
|
||||||
|
{
|
||||||
|
lt = new List<emu_timer>();
|
||||||
|
}
|
||||||
|
|
||||||
public class emu_timer
|
public class emu_timer
|
||||||
{
|
{
|
||||||
public TIME_ACT action;
|
public TIME_ACT action;
|
||||||
@ -502,7 +507,8 @@ namespace MAME.Core
|
|||||||
which.period = period;
|
which.period = period;
|
||||||
timer_list_remove(which);
|
timer_list_remove(which);
|
||||||
timer_list_insert(which);
|
timer_list_insert(which);
|
||||||
if (lt.IndexOf(which) == 0)
|
//if (lt.IndexOf(which) == 0)
|
||||||
|
if (lt[0] == which)
|
||||||
{
|
{
|
||||||
if (Cpuexec.activecpu >= 0 && Cpuexec.activecpu < Cpuexec.ncpu)
|
if (Cpuexec.activecpu >= 0 && Cpuexec.activecpu < Cpuexec.ncpu)
|
||||||
{
|
{
|
||||||
@ -731,75 +737,76 @@ namespace MAME.Core
|
|||||||
lt = new List<emu_timer>();
|
lt = new List<emu_timer>();
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
lt.Add(new emu_timer());
|
emu_timer etimer = new emu_timer();
|
||||||
|
lt.Add(etimer);
|
||||||
i1 = reader.ReadInt32();
|
i1 = reader.ReadInt32();
|
||||||
lt[i].action = getactionbyindex(i1);
|
etimer.action = getactionbyindex(i1);
|
||||||
//lt[i].func = getfuncbyindex(i1);
|
//etimer.func = getfuncbyindex(i1);
|
||||||
lt[i].enabled = reader.ReadBoolean();
|
etimer.enabled = reader.ReadBoolean();
|
||||||
lt[i].temporary = reader.ReadBoolean();
|
etimer.temporary = reader.ReadBoolean();
|
||||||
lt[i].period.seconds = reader.ReadInt32();
|
etimer.period.seconds = reader.ReadInt32();
|
||||||
lt[i].period.attoseconds = reader.ReadInt64();
|
etimer.period.attoseconds = reader.ReadInt64();
|
||||||
lt[i].start.seconds = reader.ReadInt32();
|
etimer.start.seconds = reader.ReadInt32();
|
||||||
lt[i].start.attoseconds = reader.ReadInt64();
|
etimer.start.attoseconds = reader.ReadInt64();
|
||||||
lt[i].expire.seconds = reader.ReadInt32();
|
etimer.expire.seconds = reader.ReadInt32();
|
||||||
lt[i].expire.attoseconds = reader.ReadInt64();
|
etimer.expire.attoseconds = reader.ReadInt64();
|
||||||
//if (lt[i].func == "vblank_begin_callback")
|
//if (etimer.func == "vblank_begin_callback")
|
||||||
if (lt[i].action == TIME_ACT.Video_vblank_begin_callback)
|
if (etimer.action == TIME_ACT.Video_vblank_begin_callback)
|
||||||
{
|
{
|
||||||
Video.vblank_begin_timer = lt[i];
|
Video.vblank_begin_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Video.vblank_begin_timer);
|
lt.Add(Video.vblank_begin_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Video_vblank_end_callback)
|
else if (etimer.action == TIME_ACT.Video_vblank_end_callback)
|
||||||
{
|
{
|
||||||
Video.vblank_end_timer = lt[i];
|
Video.vblank_end_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Video.vblank_end_timer);
|
lt.Add(Video.vblank_end_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Mame_soft_reset)
|
else if (etimer.action == TIME_ACT.Mame_soft_reset)
|
||||||
{
|
{
|
||||||
Mame.soft_reset_timer = lt[i];
|
Mame.soft_reset_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Mame.soft_reset_timer);
|
lt.Add(Mame.soft_reset_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Watchdog_watchdog_callback)
|
else if (etimer.action == TIME_ACT.Watchdog_watchdog_callback)
|
||||||
{
|
{
|
||||||
Watchdog.watchdog_timer = lt[i];
|
Watchdog.watchdog_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Watchdog.watchdog_timer);
|
lt.Add(Watchdog.watchdog_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Generic_irq_1_0_line_hold)
|
else if (etimer.action == TIME_ACT.Generic_irq_1_0_line_hold)
|
||||||
{
|
{
|
||||||
Cpuexec.timedint_timer = lt[i];
|
Cpuexec.timedint_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Cpuexec.timedint_timer);
|
lt.Add(Cpuexec.timedint_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM2151_timer_callback_a)
|
else if (etimer.action == TIME_ACT.YM2151_timer_callback_a)
|
||||||
{
|
{
|
||||||
YM2151.PSG.timer_A = lt[i];
|
YM2151.PSG.timer_A = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM2151.PSG.timer_A);
|
lt.Add(YM2151.PSG.timer_A);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM2151_timer_callback_b)
|
else if (etimer.action == TIME_ACT.YM2151_timer_callback_b)
|
||||||
{
|
{
|
||||||
YM2151.PSG.timer_B = lt[i];
|
YM2151.PSG.timer_B = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM2151.PSG.timer_B);
|
lt.Add(YM2151.PSG.timer_B);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Cpuexec_trigger_partial_frame_interrupt)
|
else if (etimer.action == TIME_ACT.Cpuexec_trigger_partial_frame_interrupt)
|
||||||
{
|
{
|
||||||
switch (Machine.sBoard)
|
switch (Machine.sBoard)
|
||||||
{
|
{
|
||||||
case "CPS2":
|
case "CPS2":
|
||||||
case "IGS011":
|
case "IGS011":
|
||||||
case "Konami68000":
|
case "Konami68000":
|
||||||
Cpuexec.cpu[0].partial_frame_timer = lt[i];
|
Cpuexec.cpu[0].partial_frame_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Cpuexec.cpu[0].partial_frame_timer);
|
lt.Add(Cpuexec.cpu[0].partial_frame_timer);
|
||||||
break;
|
break;
|
||||||
case "M72":
|
case "M72":
|
||||||
Cpuexec.cpu[1].partial_frame_timer = lt[i];
|
Cpuexec.cpu[1].partial_frame_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Cpuexec.cpu[1].partial_frame_timer);
|
lt.Add(Cpuexec.cpu[1].partial_frame_timer);
|
||||||
break;
|
break;
|
||||||
case "Capcom":
|
case "Capcom":
|
||||||
@ -816,186 +823,186 @@ namespace MAME.Core
|
|||||||
case "makaimurc":
|
case "makaimurc":
|
||||||
case "makaimurg":
|
case "makaimurg":
|
||||||
case "diamond":
|
case "diamond":
|
||||||
Cpuexec.cpu[1].partial_frame_timer = lt[i];
|
Cpuexec.cpu[1].partial_frame_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Cpuexec.cpu[1].partial_frame_timer);
|
lt.Add(Cpuexec.cpu[1].partial_frame_timer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Cpuexec_null_callback)
|
else if (etimer.action == TIME_ACT.Cpuexec_null_callback)
|
||||||
{
|
{
|
||||||
Cpuexec.interleave_boost_timer = lt[i];
|
Cpuexec.interleave_boost_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Cpuexec.interleave_boost_timer);
|
lt.Add(Cpuexec.interleave_boost_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Cpuexec_end_interleave_boost)
|
else if (etimer.action == TIME_ACT.Cpuexec_end_interleave_boost)
|
||||||
{
|
{
|
||||||
Cpuexec.interleave_boost_timer_end = lt[i];
|
Cpuexec.interleave_boost_timer_end = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Cpuexec.interleave_boost_timer_end);
|
lt.Add(Cpuexec.interleave_boost_timer_end);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Video_scanline0_callback)
|
else if (etimer.action == TIME_ACT.Video_scanline0_callback)
|
||||||
{
|
{
|
||||||
Video.scanline0_timer = lt[i];
|
Video.scanline0_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Video.scanline0_timer);
|
lt.Add(Video.scanline0_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Neogeo_display_position_interrupt_callback)
|
else if (etimer.action == TIME_ACT.Neogeo_display_position_interrupt_callback)
|
||||||
{
|
{
|
||||||
Neogeo.display_position_interrupt_timer = lt[i];
|
Neogeo.display_position_interrupt_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Neogeo.display_position_interrupt_timer);
|
lt.Add(Neogeo.display_position_interrupt_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Neogeo_display_position_vblank_callback)
|
else if (etimer.action == TIME_ACT.Neogeo_display_position_vblank_callback)
|
||||||
{
|
{
|
||||||
Neogeo.display_position_vblank_timer = lt[i];
|
Neogeo.display_position_vblank_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Neogeo.display_position_vblank_timer);
|
lt.Add(Neogeo.display_position_vblank_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Neogeo_vblank_interrupt_callback)
|
else if (etimer.action == TIME_ACT.Neogeo_vblank_interrupt_callback)
|
||||||
{
|
{
|
||||||
Neogeo.vblank_interrupt_timer = lt[i];
|
Neogeo.vblank_interrupt_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Neogeo.vblank_interrupt_timer);
|
lt.Add(Neogeo.vblank_interrupt_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Neogeo_auto_animation_timer_callback)
|
else if (etimer.action == TIME_ACT.Neogeo_auto_animation_timer_callback)
|
||||||
{
|
{
|
||||||
Neogeo.auto_animation_timer = lt[i];
|
Neogeo.auto_animation_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Neogeo.auto_animation_timer);
|
lt.Add(Neogeo.auto_animation_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Neogeo_sprite_line_timer_callback)
|
else if (etimer.action == TIME_ACT.Neogeo_sprite_line_timer_callback)
|
||||||
{
|
{
|
||||||
Neogeo.sprite_line_timer = lt[i];
|
Neogeo.sprite_line_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Neogeo.sprite_line_timer);
|
lt.Add(Neogeo.sprite_line_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM2610_F2610_timer_callback_0)
|
else if (etimer.action == TIME_ACT.YM2610_F2610_timer_callback_0)
|
||||||
{
|
{
|
||||||
YM2610.timer[0] = lt[i];
|
YM2610.timer[0] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM2610.timer[0]);
|
lt.Add(YM2610.timer[0]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM2610_F2610_timer_callback_1)
|
else if (etimer.action == TIME_ACT.YM2610_F2610_timer_callback_1)
|
||||||
{
|
{
|
||||||
YM2610.timer[1] = lt[i];
|
YM2610.timer[1] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM2610.timer[1]);
|
lt.Add(YM2610.timer[1]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.M6800_action_rx)
|
else if (etimer.action == TIME_ACT.M6800_action_rx)
|
||||||
{
|
{
|
||||||
M6800.m1.m6800_rx_timer = lt[i];
|
M6800.m1.m6800_rx_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(M6800.m1.m6800_rx_timer);
|
lt.Add(M6800.m1.m6800_rx_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.M6800_action_tx)
|
else if (etimer.action == TIME_ACT.M6800_action_tx)
|
||||||
{
|
{
|
||||||
M6800.m1.m6800_tx_timer = lt[i];
|
M6800.m1.m6800_tx_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(M6800.m1.m6800_tx_timer);
|
lt.Add(M6800.m1.m6800_tx_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3812_0)
|
else if (etimer.action == TIME_ACT.YM3812_timer_callback_3812_0)
|
||||||
{
|
{
|
||||||
YM3812.timer[0] = lt[i];
|
YM3812.timer[0] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM3812.timer[0]);
|
lt.Add(YM3812.timer[0]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3812_1)
|
else if (etimer.action == TIME_ACT.YM3812_timer_callback_3812_1)
|
||||||
{
|
{
|
||||||
YM3812.timer[1] = lt[i];
|
YM3812.timer[1] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM3812.timer[1]);
|
lt.Add(YM3812.timer[1]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.ICS2115_timer_cb_0)
|
else if (etimer.action == TIME_ACT.ICS2115_timer_cb_0)
|
||||||
{
|
{
|
||||||
ICS2115.timer[0].timer = lt[i];
|
ICS2115.timer[0].timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(ICS2115.timer[0].timer);
|
lt.Add(ICS2115.timer[0].timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.ICS2115_timer_cb_1)
|
else if (etimer.action == TIME_ACT.ICS2115_timer_cb_1)
|
||||||
{
|
{
|
||||||
ICS2115.timer[1].timer = lt[i];
|
ICS2115.timer[1].timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(ICS2115.timer[1].timer);
|
lt.Add(ICS2115.timer[1].timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.M72_m72_scanline_interrupt)
|
else if (etimer.action == TIME_ACT.M72_m72_scanline_interrupt)
|
||||||
{
|
{
|
||||||
M72.scanline_timer = lt[i];
|
M72.scanline_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(M72.scanline_timer);
|
lt.Add(M72.scanline_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.M92_m92_scanline_interrupt)
|
else if (etimer.action == TIME_ACT.M92_m92_scanline_interrupt)
|
||||||
{
|
{
|
||||||
M92.scanline_timer = lt[i];
|
M92.scanline_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(M92.scanline_timer);
|
lt.Add(M92.scanline_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Cpuexec_cpu_timeslicecallback)
|
else if (etimer.action == TIME_ACT.Cpuexec_cpu_timeslicecallback)
|
||||||
{
|
{
|
||||||
Cpuexec.timeslice_timer = lt[i];
|
Cpuexec.timeslice_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Cpuexec.timeslice_timer);
|
lt.Add(Cpuexec.timeslice_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Upd7759_upd7759_slave_update)
|
else if (etimer.action == TIME_ACT.Upd7759_upd7759_slave_update)
|
||||||
{
|
{
|
||||||
Upd7759.chip.timer = lt[i];
|
Upd7759.chip.timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Upd7759.chip.timer);
|
lt.Add(Upd7759.chip.timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.Generic_irq_2_0_line_hold)
|
else if (etimer.action == TIME_ACT.Generic_irq_2_0_line_hold)
|
||||||
{
|
{
|
||||||
Cpuexec.timedint_timer = lt[i];
|
Cpuexec.timedint_timer = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(Cpuexec.timedint_timer);
|
lt.Add(Cpuexec.timedint_timer);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.MSM5205_MSM5205_vclk_callback0)
|
else if (etimer.action == TIME_ACT.MSM5205_MSM5205_vclk_callback0)
|
||||||
{
|
{
|
||||||
MSM5205.timer[0] = lt[i];
|
MSM5205.timer[0] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(MSM5205.timer[0]);
|
lt.Add(MSM5205.timer[0]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.MSM5205_MSM5205_vclk_callback1)
|
else if (etimer.action == TIME_ACT.MSM5205_MSM5205_vclk_callback1)
|
||||||
{
|
{
|
||||||
MSM5205.timer[1] = lt[i];
|
MSM5205.timer[1] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(MSM5205.timer[1]);
|
lt.Add(MSM5205.timer[1]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_0_0)
|
else if (etimer.action == TIME_ACT.YM2203_timer_callback_2203_0_0)
|
||||||
{
|
{
|
||||||
YM2203.FF2203[0].timer[0] = lt[i];
|
YM2203.FF2203[0].timer[0] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM2203.FF2203[0].timer[0]);
|
lt.Add(YM2203.FF2203[0].timer[0]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_0_1)
|
else if (etimer.action == TIME_ACT.YM2203_timer_callback_2203_0_1)
|
||||||
{
|
{
|
||||||
YM2203.FF2203[0].timer[1] = lt[i];
|
YM2203.FF2203[0].timer[1] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM2203.FF2203[0].timer[1]);
|
lt.Add(YM2203.FF2203[0].timer[1]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_1_0)
|
else if (etimer.action == TIME_ACT.YM2203_timer_callback_2203_1_0)
|
||||||
{
|
{
|
||||||
YM2203.FF2203[1].timer[0] = lt[i];
|
YM2203.FF2203[1].timer[0] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM2203.FF2203[1].timer[0]);
|
lt.Add(YM2203.FF2203[1].timer[0]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM2203_timer_callback_2203_1_1)
|
else if (etimer.action == TIME_ACT.YM2203_timer_callback_2203_1_1)
|
||||||
{
|
{
|
||||||
YM2203.FF2203[1].timer[1] = lt[i];
|
YM2203.FF2203[1].timer[1] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM2203.FF2203[1].timer[1]);
|
lt.Add(YM2203.FF2203[1].timer[1]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3526_0)
|
else if (etimer.action == TIME_ACT.YM3812_timer_callback_3526_0)
|
||||||
{
|
{
|
||||||
YM3812.timer[0] = lt[i];
|
YM3812.timer[0] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM3812.timer[0]);
|
lt.Add(YM3812.timer[0]);
|
||||||
}
|
}
|
||||||
else if (lt[i].action == TIME_ACT.YM3812_timer_callback_3526_1)
|
else if (etimer.action == TIME_ACT.YM3812_timer_callback_3526_1)
|
||||||
{
|
{
|
||||||
YM3812.timer[1] = lt[i];
|
YM3812.timer[1] = etimer;
|
||||||
lt.Remove(lt[i]);
|
lt.Remove(etimer);
|
||||||
lt.Add(YM3812.timer[1]);
|
lt.Add(YM3812.timer[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -629,7 +629,7 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Content: {fileID: 8865437771338118001}
|
m_Content: {fileID: 8865437771338118001}
|
||||||
m_Horizontal: 0
|
m_Horizontal: 0
|
||||||
m_Vertical: 1
|
m_Vertical: 0
|
||||||
m_MovementType: 0
|
m_MovementType: 0
|
||||||
m_Elasticity: 0.1
|
m_Elasticity: 0.1
|
||||||
m_Inertia: 1
|
m_Inertia: 1
|
||||||
|
|||||||
@ -33,6 +33,14 @@ namespace AxiInputSP.UGUI
|
|||||||
return m_state == AxiButtonState.KeyDown;
|
return m_state == AxiButtonState.KeyDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重设键值(如按钮重新隐藏之后)
|
||||||
|
/// </summary>
|
||||||
|
public void ResetKeyState()
|
||||||
|
{
|
||||||
|
m_state = AxiButtonState.None;
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnPointerDown(PointerEventData eventData)
|
public override void OnPointerDown(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
base.OnPointerDown(eventData);
|
base.OnPointerDown(eventData);
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using AxibugEmuOnline.Client;
|
||||||
|
using AxibugEmuOnline.Client.ClientCore;
|
||||||
|
using AxibugEmuOnline.Client.Event;
|
||||||
|
using AxibugProtobuf;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace AxiInputSP.UGUI
|
namespace AxiInputSP.UGUI
|
||||||
@ -16,6 +21,16 @@ namespace AxiInputSP.UGUI
|
|||||||
HashSet<AxiInputUGuiBtnType> m_pressBtns = new HashSet<AxiInputUGuiBtnType>();
|
HashSet<AxiInputUGuiBtnType> m_pressBtns = new HashSet<AxiInputUGuiBtnType>();
|
||||||
Vector2 m_joyStickRaw;
|
Vector2 m_joyStickRaw;
|
||||||
|
|
||||||
|
public Transform tfXMB;
|
||||||
|
public Transform tfNES;
|
||||||
|
public Transform tfGLOBAL;
|
||||||
|
public Transform tfMAME;
|
||||||
|
public Transform tfMAME_NEOGEO;
|
||||||
|
public Transform tfGAMEBOYCOLOR;
|
||||||
|
public Transform tfMASTERSYSTEM;
|
||||||
|
List<Transform> mPlatfromList = new List<Transform>();
|
||||||
|
|
||||||
|
|
||||||
public bool GetKey(AxiInputUGuiBtnType btnType)
|
public bool GetKey(AxiInputUGuiBtnType btnType)
|
||||||
{
|
{
|
||||||
return m_pressBtns.Contains(btnType);
|
return m_pressBtns.Contains(btnType);
|
||||||
@ -44,19 +59,97 @@ namespace AxiInputSP.UGUI
|
|||||||
{
|
{
|
||||||
m_buttons = GetComponentsInChildren<AxiIptButton>(true);
|
m_buttons = GetComponentsInChildren<AxiIptButton>(true);
|
||||||
m_joystick = GetComponentInChildren<FloatingJoystick>(true);
|
m_joystick = GetComponentInChildren<FloatingJoystick>(true);
|
||||||
|
|
||||||
|
mPlatfromList.Add(tfXMB);
|
||||||
|
mPlatfromList.Add(tfNES);
|
||||||
|
mPlatfromList.Add(tfGLOBAL);
|
||||||
|
mPlatfromList.Add(tfMAME);
|
||||||
|
mPlatfromList.Add(tfMAME_NEOGEO);
|
||||||
|
mPlatfromList.Add(tfGAMEBOYCOLOR);
|
||||||
|
mPlatfromList.Add(tfMASTERSYSTEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
m_joyStickRaw = Vector2.zero;
|
m_joyStickRaw = Vector2.zero;
|
||||||
m_pressBtns.Clear();
|
m_pressBtns.Clear();
|
||||||
|
|
||||||
OnGamepadActive?.Invoke(this);
|
OnGamepadActive?.Invoke(this);
|
||||||
|
ChangePlatfrom();
|
||||||
|
Eventer.Instance.RegisterEvent(EEvent.OnScreenGamepadPlatformTypeChanged, OnRomPlatformTypeChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void OnDisable()
|
private void OnDisable()
|
||||||
{
|
{
|
||||||
OnGamepadDisactive?.Invoke(this);
|
OnGamepadDisactive?.Invoke(this);
|
||||||
|
Eventer.Instance.UnregisterEvent(EEvent.OnScreenGamepadPlatformTypeChanged, OnRomPlatformTypeChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnRomPlatformTypeChanged()
|
||||||
|
{
|
||||||
|
App.log.Debug(">>OnRomPlatformTypeChanged");
|
||||||
|
ChangePlatfrom();
|
||||||
|
}
|
||||||
|
|
||||||
|
RomPlatformType? _last_platformType = RomPlatformType.Invalid;
|
||||||
|
void ChangePlatfrom()
|
||||||
|
{
|
||||||
|
RomPlatformType? platformType;
|
||||||
|
//XMB
|
||||||
|
if (App.emu.Core == null || CommandDispatcher.Instance.Mode == CommandListener.ScheduleType.Normal)
|
||||||
|
platformType = null;
|
||||||
|
else
|
||||||
|
platformType = App.emu.Core.Platform;
|
||||||
|
|
||||||
|
if (_last_platformType == platformType)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_last_platformType = platformType;
|
||||||
|
|
||||||
|
//先全部关闭
|
||||||
|
foreach (var trans in mPlatfromList)
|
||||||
|
trans.gameObject.SetActive(false);
|
||||||
|
|
||||||
|
//切换时,重置所有键值,避免如按钮隐藏时候 OnPointerUp 未触发等问题
|
||||||
|
foreach (var btn in m_buttons)
|
||||||
|
btn.ResetKeyState();
|
||||||
|
|
||||||
|
//开启指定平台
|
||||||
|
GetPlatfromPanel(platformType).gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Transform GetPlatfromPanel(RomPlatformType? platformType)
|
||||||
|
{
|
||||||
|
if (!platformType.HasValue)
|
||||||
|
return tfXMB;
|
||||||
|
|
||||||
|
switch (platformType)
|
||||||
|
{
|
||||||
|
case RomPlatformType.Nes:
|
||||||
|
return tfNES;
|
||||||
|
case RomPlatformType.Neogeo:
|
||||||
|
return tfMAME_NEOGEO;
|
||||||
|
case RomPlatformType.Igs:
|
||||||
|
case RomPlatformType.Cps1:
|
||||||
|
case RomPlatformType.Cps2:
|
||||||
|
return tfMAME;
|
||||||
|
case RomPlatformType.MasterSystem:
|
||||||
|
return tfMASTERSYSTEM;
|
||||||
|
case RomPlatformType.GameBoy:
|
||||||
|
case RomPlatformType.GameBoyColor:
|
||||||
|
return tfGAMEBOYCOLOR;
|
||||||
|
case RomPlatformType.GameGear:
|
||||||
|
case RomPlatformType.ColecoVision:
|
||||||
|
case RomPlatformType.Sc3000:
|
||||||
|
case RomPlatformType.Sg1000:
|
||||||
|
case RomPlatformType.ArcadeOld:
|
||||||
|
case RomPlatformType.WonderSwan:
|
||||||
|
case RomPlatformType.WonderSwanColor:
|
||||||
|
case RomPlatformType.Invalid:
|
||||||
|
case RomPlatformType.All:
|
||||||
|
default:
|
||||||
|
return tfGLOBAL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,5 +96,10 @@
|
|||||||
/// 核心开始游戏
|
/// 核心开始游戏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
OnEmuBeginGame,
|
OnEmuBeginGame,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 平台切换
|
||||||
|
/// </summary>
|
||||||
|
OnScreenGamepadPlatformTypeChanged
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,6 +131,7 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
LaunchUI.Instance.ShowMainMenu();
|
LaunchUI.Instance.ShowMainMenu();
|
||||||
m_controllerSetuper = null;
|
m_controllerSetuper = null;
|
||||||
Eventer.Instance.UnregisterEvent(EEvent.OnRoomSlotDataChanged, OnSlotDataChanged);
|
Eventer.Instance.UnregisterEvent(EEvent.OnRoomSlotDataChanged, OnSlotDataChanged);
|
||||||
|
Eventer.Instance.PostEvent(EEvent.OnScreenGamepadPlatformTypeChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetGame()
|
public void ResetGame()
|
||||||
|
|||||||
@ -229,11 +229,11 @@ namespace AxibugEmuOnline.Client
|
|||||||
}
|
}
|
||||||
App.FileDownloader.BeginDownload(webData.url, (bytes) =>
|
App.FileDownloader.BeginDownload(webData.url, (bytes) =>
|
||||||
{
|
{
|
||||||
HandleRomFilePostProcess(bytes);
|
HandleRomFilePostProcess(bytes, webData.romName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleRomFilePostProcess(byte[] bytes)
|
private void HandleRomFilePostProcess(byte[] bytes, string romName)
|
||||||
{
|
{
|
||||||
if (bytes == null) return;
|
if (bytes == null) return;
|
||||||
|
|
||||||
@ -285,6 +285,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
AxiIO.File.WriteAllBytes(LocalFilePath, bytes);
|
AxiIO.File.WriteAllBytes(LocalFilePath, bytes);
|
||||||
}
|
}
|
||||||
|
OverlayManager.PopTip($"下载完毕:[{romName}]");
|
||||||
Eventer.Instance.PostEvent(EEvent.OnRomFileDownloaded, ID);
|
Eventer.Instance.PostEvent(EEvent.OnRomFileDownloaded, ID);
|
||||||
OnDownloadOver?.Invoke(this);
|
OnDownloadOver?.Invoke(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using AxibugEmuOnline.Client.Event;
|
||||||
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace AxibugEmuOnline.Client
|
namespace AxibugEmuOnline.Client
|
||||||
@ -76,6 +77,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
if (m_waitMapperSetting != null)
|
if (m_waitMapperSetting != null)
|
||||||
{
|
{
|
||||||
m_listener.Schedule = m_waitMapperSetting.Value;
|
m_listener.Schedule = m_waitMapperSetting.Value;
|
||||||
|
Eventer.Instance.PostEvent(EEvent.OnScreenGamepadPlatformTypeChanged);
|
||||||
m_waitMapperSetting = null;
|
m_waitMapperSetting = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using AxibugEmuOnline.Client.ClientCore;
|
using AxibugEmuOnline.Client.ClientCore;
|
||||||
|
using AxibugEmuOnline.Client.Event;
|
||||||
using AxibugEmuOnline.Client.UI;
|
using AxibugEmuOnline.Client.UI;
|
||||||
using Coffee.UIExtensions;
|
using Coffee.UIExtensions;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
@ -50,7 +51,9 @@ namespace AxibugEmuOnline.Client
|
|||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (CommandDispatcher.Instance.Mode == CommandListener.ScheduleType.Gaming && App.emu.Core == null)
|
if (CommandDispatcher.Instance.Mode == CommandListener.ScheduleType.Gaming && App.emu.Core == null)
|
||||||
|
{
|
||||||
CommandDispatcher.Instance.Mode = CommandListener.ScheduleType.Normal;
|
CommandDispatcher.Instance.Mode = CommandListener.ScheduleType.Normal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HideMainMenu()
|
public void HideMainMenu()
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using AxibugEmuOnline.Client.ClientCore;
|
using AxibugEmuOnline.Client.ClientCore;
|
||||||
|
using AxibugEmuOnline.Client.Event;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using DG.Tweening.Core;
|
using DG.Tweening.Core;
|
||||||
using DG.Tweening.Plugins.Options;
|
using DG.Tweening.Plugins.Options;
|
||||||
|
|||||||
@ -17,7 +17,6 @@ namespace AxibugEmuOnline.Client
|
|||||||
m_itemTemplate.gameObject.SetActiveEx(false);
|
m_itemTemplate.gameObject.SetActiveEx(false);
|
||||||
m_runtimeItems.Add(m_itemTemplate);
|
m_runtimeItems.Add(m_itemTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Pop(string msg)
|
public void Pop(string msg)
|
||||||
{
|
{
|
||||||
PopTipsItem item = GetPopItem();
|
PopTipsItem item = GetPopItem();
|
||||||
|
|||||||
10
TODOLIST.md
10
TODOLIST.md
@ -6,7 +6,7 @@
|
|||||||
#### Alpha初版 TODOLIST
|
#### Alpha初版 TODOLIST
|
||||||
|
|
||||||
- [x] C-网络断开连接,重连等网络事件,回到主线程处理
|
- [x] C-网络断开连接,重连等网络事件,回到主线程处理
|
||||||
- [ ] C-Input个别核心问题
|
- [x] C-Input个别核心问题
|
||||||
- [ ] C-存档:个别时候没请求
|
- [ ] C-存档:个别时候没请求
|
||||||
- [ ] C-存档:统一管理同步列表,重新联网登录后,或断网状态下退出模拟器重进登录后自动上报
|
- [ ] C-存档:统一管理同步列表,重新联网登录后,或断网状态下退出模拟器重进登录后自动上报
|
||||||
- [ ] C-用户:昵称修改
|
- [ ] C-用户:昵称修改
|
||||||
@ -14,9 +14,9 @@
|
|||||||
- [ ] C-用户:用户绑定后,自动重新登录流程
|
- [ ] C-用户:用户绑定后,自动重新登录流程
|
||||||
- [ ] C-联机:房间内手柄按键可视化
|
- [ ] C-联机:房间内手柄按键可视化
|
||||||
- [ ] C/S-联机:有时第出现 二个玩家进房间时导致断线重连直接出现在3号位置
|
- [ ] C/S-联机:有时第出现 二个玩家进房间时导致断线重连直接出现在3号位置
|
||||||
- [ ] C-联机:CPS1等街机核心同步快照时,其他人黑屏,可能时快照问题
|
- [x] C-联机:CPS1等街机核心同步快照时,其他人黑屏,可能时快照问题
|
||||||
- [ ] C-SWITCH:InputSystem可用性验证
|
- [x] C-SWITCH:InputSystem可用性验证
|
||||||
- [ ] C-SWITCH:验证AxiNS文件读写封装可用性
|
- [x] C-SWITCH:验证AxiNS文件读写封装可用性
|
||||||
- [ ] C-PSVita:最新版仓库降低,解决和验证兼容性问题
|
- [ ] C-PSVita:最新版仓库降低,解决和验证兼容性问题
|
||||||
- [ ] S-用户:昵称修改
|
- [ ] S-用户:昵称修改
|
||||||
- [x] S-存档:服务器存储问题
|
- [x] S-存档:服务器存储问题
|
||||||
@ -24,4 +24,4 @@
|
|||||||
- [ ] S-用户:二维码下行
|
- [ ] S-用户:二维码下行
|
||||||
- [ ] S-用户:用户注册,游客账户数据转正
|
- [ ] S-用户:用户注册,游客账户数据转正
|
||||||
- [ ] S-用户:用户绑定,用户迁移
|
- [ ] S-用户:用户绑定,用户迁移
|
||||||
- [ ] S-用户:用户变化后,通知客户端重新登录
|
- [ ] S-用户:用户变化后,通知客户端重新登录
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user