Esempio n. 1
0
        public EmulatorApplication(EmulatorIOAdapter ioAdapter)
        {
            c64 = new C64(ioAdapter);

            _videoInfo = new VideoInfo();

            C64Display display = c64.Display;
            _videoInfo.width = display.getWidth();
            _videoInfo.height = display.getHeight();
            _videoInfo.bitsPerPixel = display.getBitsPerPixel();
            _videoInfo.size = _videoInfo.width * _videoInfo.height * _videoInfo.bitsPerPixel / 8;
            _videoInfo.palette = display.getPalette();
        }
Esempio n. 2
0
        //public MediaStreamSource Video
        //{
        //    get { return _video; }
        //    set { _video = value; }
        //}


        public C64Display(C64 c64, EmulatorIOAdapter ioAdapter)
        {
            _TheC64 = c64;

            this.ioAdapter = ioAdapter;

            //CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);

            //_ui.ScreenImage.Source = _image;

            _indexLines = new byte[16][];

            for (int i = 0; i < 16; i++)
            {
                _indexLines[i] = new byte[DISPLAY_X];
                for (int p = 0; p < DISPLAY_X; p++)
                {
                    _indexLines[i][p] = (byte) i;
                }
            }
        }
Esempio n. 3
0
File: C64.cs Progetto: rosc77/vita64
        public C64(EmulatorIOAdapter ioAdapter)
        {
            int i, j;

            emulationSpeed = 0.0f;

            // The thread is not yet running
            thread_running = false;
            quit_thyself = false;
            have_a_break = false;

            // Open display
            TheDisplay = new C64Display(this, ioAdapter);

            // Allocate RAM/ROM memory
            //RAM = new byte[0x10000];

            _ram = new SystemRam();
            _colorRam = new ColorRam();

            _basicRom = new BasicRom();
            _kernalRom = new KernalRom();
            _characterRom = new CharacterRom();

            //Basic = new byte[0x2000];
            //Kernal = new byte[0x2000];
            //Char = new byte[0x1000];
            //Color = new byte[0x0400];

            _ram1541 = new Drive1541Ram();
            _rom1541 = new Drive1541Rom();

            //RAM1541 = new byte[0x0800];
            //ROM1541 = new byte[0x4000];

            // Create the chips
            TheCPU = new MOS6510(this, RAM, Basic, Kernal, Char, Color);

            TheJob1541 = new Job1541(_ram1541);
            TheCPU1541 = new MOS6502_1541(this, TheJob1541, TheDisplay, _ram1541, _rom1541);

            TheVIC = TheCPU.TheVIC = new MOS6569(this, TheDisplay, TheCPU, RAM, Char, Color);
            TheSID = TheCPU.TheSID = new MOS6581(this);
            TheCIA1 = TheCPU.TheCIA1 = new MOS6526_1(TheCPU, TheVIC);
            TheCIA2 = TheCPU.TheCIA2 = TheCPU1541.TheCIA2 = new MOS6526_2(TheCPU, TheVIC, TheCPU1541);
            TheIEC = TheCPU.TheIEC = new IEC(TheDisplay);
            TheREU = TheCPU.TheREU = new REU(TheCPU);

            _ram.InitializeWithPowerUpPattern();
            _colorRam.InitializeWithRandomValues();

            TheDisplay.Initialize();

            #if false
            //unsafe
            //{
            //    fixed (byte* pRAM = RAM, pColor = Color)
            //    {
            //        byte* p = pRAM;
            //        // Initialize RAM with powerup pattern
            //        for (i = 0; i < 512; i++)
            //        {
            //            for (j = 0; j < 64; j++)
            //                *p++ = 0;
            //            for (j = 0; j < 64; j++)
            //                *p++ = 0xff;
            //        }

            //        Random rand = new Random();
            //        p = pColor;
            //        // Initialize color RAM with random values
            //        for (i = 0; i < 1024; i++)
            //            *p++ = (byte)(rand.Next() & 0x0f);
            //    }
            //}
            #endif

            // Open joystick drivers if required
            open_close_joysticks(false, false, GlobalPrefs.ThePrefs.Joystick1On, GlobalPrefs.ThePrefs.Joystick2On);
            joykey = 0xff;

            CycleCounter = 0;

            // No need to check for state change.
            state_change = false;

            // TODO
            frameTimer.Reset();
            frameTimer.Start();
        }