Exemplo n.º 1
0
        public C1541()
        {
            PLA = new FloppyPLA();
            CPU = new CPU_6510("C1541", PLA);

            Reset();
        }
Exemplo n.º 2
0
        public C64()
        {
            MPU  = new PLA(this);
            CPU  = new CPU_6510("C64", MPU);
            SID  = new SID_OpenAL();
            IEC  = new IECBus();
            VIC  = new VIC_II(this);
            CIA  = new CIA(Keyboard);
            CIA2 = new CIA2();

            //Joystick1 = new NoJoystick();
            //Joystick1 = new JoystickKeypad(Keys.W, Keys.S, Keys.A, Keys.D, Keys.LControlKey);
            Joystick2 = new JoystickKeypad(Keys.NumPad8, Keys.NumPad5, Keys.NumPad4, Keys.NumPad6, Keys.ControlKey);
            // Joystick2 = new JoystickKeypad(Keys.Up, Keys.Down, Keys.Left, Keys.Right, Keys.ControlKey);

            CIA.SetJoystick(1, Joystick1);
            CIA.SetJoystick(2, Joystick2);

            Datasette = new DatasetteTAP();
            Floppy    = new C1541();

            // Form f = Floppy.GetControlForm();
            // f.Show();

            Reset();
        }
Exemplo n.º 3
0
 public void OnAfter_RTS(CPU_6510 _cpu, DecodedInstruction _instr)
 {
     //  RTS
     if (JSR_Depth > 0)
     {
         CallStack.Pop();
         JSR_Depth--;
     }
 }
Exemplo n.º 4
0
        public void OnNextOpcode(CPU_6510 _cpu, DecodedInstruction _instr)
        {
            ushort adr = _instr.PC;

            lastTraceIndex++;
            if (lastTraceIndex >= 64)
            {
                lastTraceIndex = 0;
            }

            Trace[lastTraceIndex] = _instr;

            ushort a0 = adr;

            if (adr == 0xBE1D)
            {
            }

            // TraceOPCodes = false;
            if (IsBreakpoint(adr))
            {
                //TraceOPCodes = true;
            }
            // TraceOPCodes = false;

            // AddBreakpoint(0xB91D);

            if (false)
            {
                string func = "";
                if (KernalFunctions.TryGetValue(adr, out func))
                {
                    Console.Out.WriteLine("${0,4:X4}: {1}", adr, func);
                }
            }

            if (TraceOPCodes)
            {
                string func = "";
                if (KernalFunctions.TryGetValue(adr, out func))
                {
                    Console.Out.WriteLine("${0,4:X4}: {1}", adr, func);
                }

                Console.Out.WriteLine(_instr.ToString());
            }
        }
Exemplo n.º 5
0
        public ZeroPage(CPU_6510 _cpu)
        {
            for (int i = 0; i < 512; i++)
            {
                Data[i] = _cpu.PeekMemory(i);
            }

            FAC1_E    = Data[0x61];
            FAC1_M[0] = Data[0x62];
            FAC1_M[1] = Data[0x63];
            FAC1_M[2] = Data[0x64];
            FAC1_M[3] = Data[0x65];
            FAC1_Sign = Data[0x66];

            for (int i = 0; i < 16; i++)
            {
                String_0x100[i] = _cpu.PeekMemory(0x100 + i);
            }
        }
Exemplo n.º 6
0
        public void OnAfter_JSR(CPU_6510 _cpu, DecodedInstruction _instr, int _newPC)
        {
            JSR_Depth++;

            //  JSR
            CallstackDetail det = new CallstackDetail();

            det.Adress   = _instr.adr16;
            det.CPUState = _cpu.GetState();

            string func;

            if (KernalFunctions.TryGetValue(det.Adress, out func))
            {
            }

            if (TraceJSRs)
            {
                Console.Out.WriteLine(det.ToString());
            }

            //TraceOPCodes = false;
            CallStack.Push(det);
        }