示例#1
0
        public static void Inject(string sourcebase, string sourcerom, string destination,
                                  byte speed, byte players, byte soundVolume, byte romType,
                                  short widthTv = 1920, short widthDrc = 854, short heightTv = 1080, short heightDrc = 480)
        {
            RPXSNES rpx = new RPXSNES(sourcebase);

            rpx.Edit(sourcerom, destination, speed, players, soundVolume, romType, widthTv, widthDrc, heightTv, heightDrc);
        }
示例#2
0
        protected override void InjectRom()
        {
            byte speed   = (byte)(Speed == 50 ? 50 : 60);
            byte players = (byte)(Players == 4 ? 4 : Players == 3 ? 3 : 2);
            byte romType = 0;

            if (RomIsValid)
            {
                switch ((Rom as RomSNES).Mode)
                {
                case RomSNES.Subformat.LoROM:
                    romType = 20;
                    break;

                case RomSNES.Subformat.HiROM:
                    romType = 21;
                    break;

                default:
                    romType = 0;
                    break;
                }
            }
            short widthTv;
            short widthDrc;

            switch (AspectRatioValue)
            {
            case AspectRatio.H8V7:
                widthTv  = 2240;
                widthDrc = 996;
                break;

            case AspectRatio.H16V9:
                widthTv  = 1440;
                widthDrc = 640;
                break;

            default:
                widthTv  = 1920;
                widthDrc = 854;
                break;
            }

            if (!Directory.Exists(Environment.CurrentDirectory + "\\resources"))
            {
                Directory.CreateDirectory(Environment.CurrentDirectory + "\\resources");
            }

            DirectoryInfo code = new DirectoryInfo(BasePath + "\\code");

            FileInfo[] rpxFiles = code.GetFiles("*.rpx");
            RPXSNES.Inject(rpxFiles[0].FullName, RomPath, Environment.CurrentDirectory + "\\resources\\snes.rpx", speed, players, SoundVolume, romType, widthTv, widthDrc);

            File.Delete(rpxFiles[0].FullName);
            File.Move(Environment.CurrentDirectory + "\\resources\\snes.rpx", rpxFiles[0].FullName);
        }
示例#3
0
 public VCSNES GetBase(string path)
 {
     try
     {
         ValidateBase(path, false);
         RPXSNES vc = ValidateRPX(path);
         return(VCSNES.GetVC(vc.CRCsSum));
     }
     catch
     {
         return(null);
     }
 }