Ejemplo n.º 1
0
        public PSXOptions(Octoshock.Settings settings, OctoshockDll.eVidStandard vidStandard, Size currentVideoSize)
        {
            InitializeComponent();
            _settings = settings;
            _previewVideoStandard = vidStandard;
            _previewVideoSize = currentVideoSize;

            if (_previewVideoStandard == OctoshockDll.eVidStandard.NTSC)
                lblNTSC.Font = new System.Drawing.Font(lblNTSC.Font, FontStyle.Bold);
            else lblPAL.Font = new System.Drawing.Font(lblPAL.Font, FontStyle.Bold);

            lblPixelPro_text = lblPixelPro.Text;
            lblMednafen_text = lblMednafen.Text;
            lblTweakedMednafen_text = lblTweakedMednafen.Text;

            rbPixelPro.Checked = _settings.ResolutionMode == Octoshock.eResolutionMode.PixelPro;
            rbDebugMode.Checked = _settings.ResolutionMode == Octoshock.eResolutionMode.Debug;
            rbMednafenMode.Checked = _settings.ResolutionMode == Octoshock.eResolutionMode.Mednafen;
            rbTweakedMednafenMode.Checked = _settings.ResolutionMode == Octoshock.eResolutionMode.TweakedMednafen;
            checkClipHorizontal.Checked = _settings.ClipHorizontalOverscan;

            NTSC_FirstLineNumeric.Value = _settings.ScanlineStart_NTSC;
            NTSC_LastLineNumeric.Value = _settings.ScanlineEnd_NTSC;
            PAL_FirstLineNumeric.Value = _settings.ScanlineStart_PAL;
            PAL_LastLineNumeric.Value = _settings.ScanlineEnd_PAL;
        }
Ejemplo n.º 2
0
		public PSXOptions(Octoshock.Settings settings, OctoshockDll.eVidStandard vidStandard, Size currentVideoSize)
		{
			InitializeComponent();
			_settings = settings;
			_previewVideoStandard = vidStandard;
			_previewVideoSize = currentVideoSize;

			if (_previewVideoStandard == OctoshockDll.eVidStandard.NTSC)
				lblNTSC.Font = new System.Drawing.Font(lblNTSC.Font, FontStyle.Bold);
			else lblPAL.Font = new System.Drawing.Font(lblPAL.Font, FontStyle.Bold);

			lblPixelPro_text = lblPixelPro.Text;
			lblMednafen_text = lblMednafen.Text;
			lblTweakedMednafen_text = lblTweakedMednafen.Text;

			rbPixelPro.Checked = _settings.ResolutionMode == Octoshock.eResolutionMode.PixelPro;
			rbDebugMode.Checked = _settings.ResolutionMode == Octoshock.eResolutionMode.Debug;
			rbMednafenMode.Checked = _settings.ResolutionMode == Octoshock.eResolutionMode.Mednafen;
			rbTweakedMednafenMode.Checked = _settings.ResolutionMode == Octoshock.eResolutionMode.TweakedMednafen;
			rbClipNone.Checked = _settings.HorizontalClipping == Octoshock.eHorizontalClipping.None;
			rbClipBasic.Checked = _settings.HorizontalClipping == Octoshock.eHorizontalClipping.Basic;
			rbClipToFramebuffer.Checked = _settings.HorizontalClipping == Octoshock.eHorizontalClipping.Framebuffer;

			rbWeave.Checked = _settings.DeinterlaceMode == Octoshock.eDeinterlaceMode.Weave;
			rbBob.Checked = _settings.DeinterlaceMode == Octoshock.eDeinterlaceMode.Bob;
			rbBobOffset.Checked = _settings.DeinterlaceMode == Octoshock.eDeinterlaceMode.BobOffset;

			NTSC_FirstLineNumeric.Value = _settings.ScanlineStart_NTSC;
			NTSC_LastLineNumeric.Value = _settings.ScanlineEnd_NTSC;
			PAL_FirstLineNumeric.Value = _settings.ScanlineStart_PAL;
			PAL_LastLineNumeric.Value = _settings.ScanlineEnd_PAL;
		}
        private unsafe void SetMemoryDomains()
        {
            var mmd = new List <MemoryDomain>();

            OctoshockDll.shock_GetMemData(psx, out var ptr, out var size, OctoshockDll.eMemType.MainRAM);
            mmd.Add(new MemoryDomainIntPtr("MainRAM", MemoryDomain.Endian.Little, ptr, size, true, 4));

            OctoshockDll.shock_GetMemData(psx, out ptr, out size, OctoshockDll.eMemType.GPURAM);
            mmd.Add(new MemoryDomainIntPtr("GPURAM", MemoryDomain.Endian.Little, ptr, size, true, 4));

            OctoshockDll.shock_GetMemData(psx, out ptr, out size, OctoshockDll.eMemType.SPURAM);
            mmd.Add(new MemoryDomainIntPtr("SPURAM", MemoryDomain.Endian.Little, ptr, size, true, 4));

            OctoshockDll.shock_GetMemData(psx, out ptr, out size, OctoshockDll.eMemType.BiosROM);
            mmd.Add(new MemoryDomainIntPtr("BiosROM", MemoryDomain.Endian.Little, ptr, size, true, 4));

            OctoshockDll.shock_GetMemData(psx, out ptr, out size, OctoshockDll.eMemType.PIOMem);
            mmd.Add(new MemoryDomainIntPtr("PIOMem", MemoryDomain.Endian.Little, ptr, size, true, 4));

            OctoshockDll.shock_GetMemData(psx, out ptr, out size, OctoshockDll.eMemType.DCache);
            mmd.Add(new MemoryDomainIntPtr("DCache", MemoryDomain.Endian.Little, ptr, size, true, 4));

            mmd.Add(new MemoryDomainDelegate("System Bus", 0x1_0000_0000, MemoryDomain.Endian.Little,
                                             (a) => { byte v; OctoshockDll.shock_PeekMemory(psx, (uint)a, out v); return(v); },
                                             (a, v) => { OctoshockDll.shock_PokeMemory(psx, (uint)a, v); },
                                             4));

            MemoryDomains = new MemoryDomainList(mmd);
            (ServiceProvider as BasicServiceProvider).Register <IMemoryDomains>(MemoryDomains);
        }
 private void RefreshMemCallbacks()
 {
     OctoshockDll.eShockMemCb mask = OctoshockDll.eShockMemCb.None;
     if (MemoryCallbacks.HasReads)
     {
         mask |= OctoshockDll.eShockMemCb.Read;
     }
     if (MemoryCallbacks.HasWrites)
     {
         mask |= OctoshockDll.eShockMemCb.Write;
     }
     if (MemoryCallbacks.HasExecutes)
     {
         mask |= OctoshockDll.eShockMemCb.Execute;
     }
     OctoshockDll.shock_SetMemCb(psx, mem_cb, mask);
 }
Ejemplo n.º 5
0
        // TODO: don't cast to int, and are any of these not 32 bit?
        public IDictionary <string, RegisterValue> GetCpuFlagsAndRegisters()
        {
            Dictionary <string, RegisterValue> ret = new Dictionary <string, RegisterValue>();
            var regs = new OctoshockDll.ShockRegisters_CPU();

            OctoshockDll.shock_GetRegisters_CPU(psx, ref regs);

            //ret[ "r1"] = (int)regs.GPR[ 1]; ret[ "r2"] = (int)regs.GPR[ 2]; ret[ "r3"] = (int)regs.GPR[ 3];
            //ret[ "r4"] = (int)regs.GPR[ 4]; ret[ "r5"] = (int)regs.GPR[ 5]; ret[ "r6"] = (int)regs.GPR[ 6]; ret[ "r7"] = (int)regs.GPR[ 7];
            //ret[ "r8"] = (int)regs.GPR[ 8]; ret[ "r9"] = (int)regs.GPR[ 9]; ret["r10"] = (int)regs.GPR[10]; ret["r11"] = (int)regs.GPR[11];
            //ret["r12"] = (int)regs.GPR[12]; ret["r13"] = (int)regs.GPR[13]; ret["r14"] = (int)regs.GPR[14]; ret["r15"] = (int)regs.GPR[15];
            //ret["r16"] = (int)regs.GPR[16]; ret["r17"] = (int)regs.GPR[17]; ret["r18"] = (int)regs.GPR[18]; ret["r19"] = (int)regs.GPR[19];
            //ret["r20"] = (int)regs.GPR[20]; ret["r21"] = (int)regs.GPR[21]; ret["r22"] = (int)regs.GPR[22]; ret["r23"] = (int)regs.GPR[23];
            //ret["r24"] = (int)regs.GPR[24]; ret["r25"] = (int)regs.GPR[25]; ret["r26"] = (int)regs.GPR[26]; ret["r27"] = (int)regs.GPR[27];
            //ret["r28"] = (int)regs.GPR[28]; ret["r29"] = (int)regs.GPR[29]; ret["r30"] = (int)regs.GPR[30]; ret["r31"] = (int)regs.GPR[31];

            ret["at"] = (int)regs.GPR[1];
            ret["v0"] = (int)regs.GPR[2]; ret["v1"] = (int)regs.GPR[3];
            ret["a0"] = (int)regs.GPR[4]; ret["a1"] = (int)regs.GPR[5]; ret["a2"] = (int)regs.GPR[6]; ret["a3"] = (int)regs.GPR[7];
            ret["t0"] = (int)regs.GPR[8]; ret["t1"] = (int)regs.GPR[9]; ret["t2"] = (int)regs.GPR[10]; ret["t3"] = (int)regs.GPR[11];
            ret["t4"] = (int)regs.GPR[12]; ret["t5"] = (int)regs.GPR[13]; ret["t6"] = (int)regs.GPR[14]; ret["t7"] = (int)regs.GPR[15];
            ret["s0"] = (int)regs.GPR[16]; ret["s1"] = (int)regs.GPR[17]; ret["s2"] = (int)regs.GPR[18]; ret["s3"] = (int)regs.GPR[19];
            ret["s4"] = (int)regs.GPR[20]; ret["s5"] = (int)regs.GPR[21]; ret["s6"] = (int)regs.GPR[22]; ret["s7"] = (int)regs.GPR[23];
            ret["t8"] = (int)regs.GPR[24]; ret["t9"] = (int)regs.GPR[25];
            ret["k0"] = (int)regs.GPR[26]; ret["k1"] = (int)regs.GPR[27];
            ret["gp"] = (int)regs.GPR[28];
            ret["sp"] = (int)regs.GPR[29];
            ret["fp"] = (int)regs.GPR[30];
            ret["ra"] = (int)regs.GPR[31];

            ret["pc"]    = (int)regs.PC;
            ret["lo"]    = (int)regs.LO;
            ret["hi"]    = (int)regs.HI;
            ret["sr"]    = (int)regs.SR;
            ret["cause"] = (int)regs.CAUSE;
            ret["epc"]   = (int)regs.EPC;

            return(ret);
        }
Ejemplo n.º 6
0
        public void SetCpuRegister(string register, int value)
        {
            int index = CpuRegisterIndices[register];

            OctoshockDll.shock_SetRegister_CPU(psx, index, (uint)value);
        }