Ejemplo n.º 1
0
 public static void LoadFlatROM(string file, Z80MemoryManager48KFlat mem)
 {
     var rom = new byte[0x3FFF];
     rom = File.ReadAllBytes(file);
     for (int i = 0; i < 0x4000; i++)
         mem.mem[i] = rom[i];
 }
Ejemplo n.º 2
0
        public static void LoadFlatROM(string file, Z80MemoryManager48KFlat mem)
        {
            var rom = new byte[0x3FFF];

            rom = File.ReadAllBytes(file);
            for (int i = 0; i < 0x4000; i++)
            {
                mem.mem[i] = rom[i];
            }
        }
Ejemplo n.º 3
0
        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;
                }
            }
        }
Ejemplo n.º 4
0
 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;
         }
     }
 }