コード例 #1
0
        public static string GetRegisters(M6502 cpu)
        {
            var dSB = new StringBuilder();

            dSB.Append($"PC:{cpu.PC:x4} A:{cpu.A:x2} X:{cpu.X:x2} Y:{cpu.Y:x2} S:{cpu.S:x2} P:");

            const string flags = "nv0bdizcNV1BDIZC";

            for (var i = 0; i < 8; i++)
            {
                dSB.Append(((cpu.P & (1 << (7 - i))) == 0) ? flags[i] : flags[i + 8]);
            }
            return(dSB.ToString());
        }
コード例 #2
0
        public static string GetRegisters(M6502 cpu)
        {
            var dSB = new StringBuilder();

            dSB.Append(String.Format(
                           "PC:{0:x4} A:{1:x2} X:{2:x2} Y:{3:x2} S:{4:x2} P:",
                           cpu.PC, cpu.A, cpu.X, cpu.Y, cpu.S));

            const string flags = "nv0bdizcNV1BDIZC";

            for (var i = 0; i < 8; i++)
            {
                dSB.Append(((cpu.P & (1 << (7 - i))) == 0) ? flags[i] : flags[i + 8]);
            }
            return(dSB.ToString());
        }
コード例 #3
0
        public Machine7800(Cart cart, Bios7800 bios, HSC7800 hsc, ILogger logger, int scanlines, int startl, int fHZ, int sRate, ReadOnlyMemory <uint> p)
            : base(logger, scanlines, startl, fHZ, sRate, p, 320)
        {
            Mem = new AddressSpace(this, 16, 6);  // 7800: 16bit, 64byte pages

            CPU = new M6502(this, 4);

            Maria = new Maria(this, scanlines);
            Mem.Map(0x0000, 0x0040, Maria);
            Mem.Map(0x0100, 0x0040, Maria);
            Mem.Map(0x0200, 0x0040, Maria);
            Mem.Map(0x0300, 0x0040, Maria);

            PIA = new PIA(this);
            Mem.Map(0x0280, 0x0080, PIA);
            Mem.Map(0x0480, 0x0080, PIA);
            Mem.Map(0x0580, 0x0080, PIA);

            RAM1 = new RAM6116();
            RAM2 = new RAM6116();
            Mem.Map(0x1800, 0x0800, RAM1);
            Mem.Map(0x2000, 0x0800, RAM2);

            Mem.Map(0x0040, 0x00c0, RAM2); // page 0 shadow
            Mem.Map(0x0140, 0x00c0, RAM2); // page 1 shadow
            Mem.Map(0x2800, 0x0800, RAM2); // shadow1
            Mem.Map(0x3000, 0x0800, RAM2); // shadow2
            Mem.Map(0x3800, 0x0800, RAM2); // shadow3

            BIOS = bios;
            HSC  = hsc;

            if (HSC != HSC7800.Default)
            {
                Mem.Map(0x1000, 0x800, HSC.SRAM);
                Mem.Map(0x3000, 0x1000, HSC);
                Logger.WriteLine("7800 Highscore Cartridge Installed");
            }

            Cart = cart;
            Mem.Map(0x4000, 0xc000, Cart);
        }
コード例 #4
0
        public Machine2600(Cart cart, ILogger logger, int slines, int startl, int fHZ, int sRate, ReadOnlyMemory <uint> p)
            : base(logger, slines, startl, fHZ, sRate, p, 160)
        {
            Mem = new AddressSpace(this, 13, 6);  // 2600: 13bit, 64byte pages

            CPU = new M6502(this, 1);

            TIA = new TIA(this);
            for (ushort i = 0; i < 0x1000; i += 0x100)
            {
                Mem.Map(i, 0x0080, TIA);
            }

            PIA = new PIA(this);
            for (ushort i = 0x0080; i < 0x1000; i += 0x100)
            {
                Mem.Map(i, 0x0080, PIA);
            }

            Cart = cart;
            Mem.Map(0x1000, 0x1000, Cart);
        }
コード例 #5
0
 public M6502 ReadM6502(MachineBase m, int runClocksMultiple)
 {
     var cpu = new M6502(this, m, runClocksMultiple);
     return cpu;
 }
コード例 #6
0
        public M6502 ReadM6502(MachineBase m, int runClocksMultiple)
        {
            var cpu = new M6502(this, m, runClocksMultiple);

            return(cpu);
        }
コード例 #7
0
 public void Write(M6502 cpu)
 {
     cpu.GetObjectData(this);
 }
コード例 #8
0
ファイル: M6502DASM.cs プロジェクト: CadeLaRen/BizHawk
        public static string GetRegisters(M6502 cpu)
        {
            var dSB = new StringBuilder();
            dSB.Append(String.Format(
                "PC:{0:x4} A:{1:x2} X:{2:x2} Y:{3:x2} S:{4:x2} P:",
                cpu.PC, cpu.A, cpu.X, cpu.Y, cpu.S));

            const string flags = "nv0bdizcNV1BDIZC";

            for (var i = 0; i < 8; i++)
            {
                dSB.Append(((cpu.P & (1 << (7 - i))) == 0) ? flags[i] : flags[i + 8]);
            }
            return dSB.ToString();
        }
コード例 #9
0
 public void Write(M6502 cpu)
 {
     cpu.GetObjectData(this);
 }