示例#1
0
文件: MOS6581.cs 项目: rosc77/vita64
        SIDRenderer the_renderer; // Reference to current renderer

        #endregion Fields

        #region Constructors

        public MOS6581(C64 c64)
        {
            the_c64 = c64;
            the_renderer = null;
            for (int i = 0; i < regs.Length; i++)
                regs[i] = 0;

            // Open the renderer
            open_close_renderer(SIDType.SIDTYPE_NONE, GlobalPrefs.ThePrefs.SIDType);
        }
示例#2
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();
        }
示例#3
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;
                }
            }
        }
示例#4
0
        MOS6526_2 _TheCIA2; // Pointer to C64 CIA 2

        #endregion Fields

        #region Constructors

        public MOS6502_1541(C64 c64, Job1541 job, C64Display disp, Drive1541Ram Ram, Drive1541Rom Rom)
        {
            the_c64 = c64;
            the_job = job;
            the_display = disp;
            ram = Ram;
            rom = Rom;

            a = x = y = 0;
            sp = 0xff;
            n_flag = z_flag = 0;
            v_flag = d_flag = c_flag = false;
            i_flag = true;

            via1_t1c = via1_t1l = via1_t2c = via1_t2l = 0;
            via1_sr = 0;
            via2_t1c = via2_t1l = via2_t2c = via2_t2l = 0;
            via2_sr = 0;

            first_irq_cycle = 0;
            Idle = false;
        }
示例#5
0
文件: MOS6510.cs 项目: rosc77/vita64
        public MOS6510(C64 c64, SystemRam ram, BasicRom basicRom, KernalRom kernelRom, CharacterRom charRom, ColorRam colorRam)
        {
            TheC64 = c64;
            _ram = ram;
            _basicRom = basicRom;
            _kernalRom = kernelRom;
            _characterRom = charRom;
            _colorRam = colorRam;

            a = x = y = 0;
            sp = 0xff;

            n_flag = z_flag = 0;
            v_flag = c_flag = d_flag = b_flag = i_flag = false;

            dfff_byte = 0x55;
            BALow = false;
            first_irq_cycle = first_nmi_cycle = 0;
            #if DEBUG_INSTRUCTIONS
            debugLogger = new DebugLog(this, false);
            #endif
        }
示例#6
0
文件: MOS6569.cs 项目: rosc77/vita64
        public MOS6569(C64 c64, C64Display disp, MOS6510 CPU, SystemRam ram, CharacterRom characterRom, ColorRam colorRam)
        {
            _c64 = c64;
            _display = disp;
            _cpu = CPU;
            _ram = ram;
            _characterRom = characterRom;
            _colorRam = colorRam;

            int i;

            matrix_base = 0;
            char_base = 0;
            bitmap_base = 0;

            // Allocate GC Handles, to pin buffers
               // AllocateHandles();

            // Get bitmap info
            //unsafe
            //{
            //    chunky_ptr = chunky_line_start = _display.BitmapBase;
            //}

            _chunkyLineStartIndex = 0;
            _chunkyIndex = 0;

            xmod = disp.BitmapXMod;

            // Initialize VIC registers
            mx8 = 0;
            ctrl1 = ctrl2 = 0;
            lpx = lpy = 0;
            me = mxe = mye = mdp = mmc = 0;
            vbase = irq_flag = irq_mask = 0;
            clx_spr = clx_bgr = 0;
            cia_vabase = 0;
            ec = b0c = b1c = b2c = b3c = mm0 = mm1 = 0;

            // already 0 for .NET
            //for (i = 0; i < 8; i++) mx[i] = my[i] = sc[i] = 0;

            // Initialize other variables
            raster_y = unchecked((UInt32)(TOTAL_RASTERS - 1));
            rc = 7;
            irq_raster = vc = vc_base = x_scroll = y_scroll = 0;
            dy_start = ROW24_YSTART;
            dy_stop = ROW24_YSTOP;
            ml_index = 0;

            cycle = 1;
            display_idx = 0;
            display_state = false;
            border_on = ud_border_on = vblanking = false;
            lp_triggered = draw_this_line = false;

            spr_dma_on = spr_disp_on = 0;
            for (i = 0; i < 8; i++)
            {
                mc[i] = 63;
                spr_ptr[i] = 0;
            }

            frame_skipped = false;
            skip_counter = 1;

            // Preset colors
            disp.InitColors(colors);

            // default to black
            ec_color = b0c_color = b1c_color = b2c_color = b3c_color = mm0_color = mm1_color = colors[0];
            for (i = 0; i < spr_color.Length; i++) spr_color[i] = colors[0];
        }