public static void MainRun(Form f) { var model = new Z80Model(f, size); if (size == 48) { memory = (Z80MemoryManager48KFlat)model.MemoryManager; } else { memory128 = (Z80MemoryManager128K)model.MemoryManager; } if (size == 48) { LoadFlatROM(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"d:\ZXS48.ROM"), memory); } else { LoadPagedROM(@"e:\Data\2007-04-23\zzzz\vbspec-src\ZX128_0.ROM", memory128, 8); LoadPagedROM(@"e:\Data\2007-04-23\zzzz\vbspec-src\ZX128_1.ROM", memory128, 9); } video = (VideoRenderer)model.VideoRenderer; z80 = new Z80(model); ResetMachine(); go = true; while (go) { z80.Execute(); t--; ti--; if (t == 0) { video.Draw(); Application.DoEvents(); t = 70000; } if (ti == 0) { z80.Interrupt(); System.Threading.Thread.Sleep(20); Application.DoEvents(); ti = 5000; } } }
public static void MainRun(Form f) { var model = new Z80Model(f, size); if (size == 48) memory = (Z80MemoryManager48KFlat)model.MemoryManager; else memory128 = (Z80MemoryManager128K)model.MemoryManager; if (size == 48) LoadFlatROM(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"d:\ZXS48.ROM"), memory); else { LoadPagedROM(@"e:\Data\2007-04-23\zzzz\vbspec-src\ZX128_0.ROM", memory128, 8); LoadPagedROM(@"e:\Data\2007-04-23\zzzz\vbspec-src\ZX128_1.ROM", memory128, 9); } video = (VideoRenderer)model.VideoRenderer; z80 = new Z80(model); ResetMachine(); go = true; while (go) { z80.Execute(); t--; ti--; if (t == 0) { video.Draw(); Application.DoEvents(); t = 70000; } if (ti == 0) { z80.Interrupt(); System.Threading.Thread.Sleep(20); Application.DoEvents(); ti = 5000; } } }