예제 #1
0
        static RolandScript ParseScript(RolandTestConfig config, RolandExportConfig exportConfig)
        {
            var rootDocument = XDocument.Parse(File.ReadAllText(config.ScriptFile), LoadOptions.SetLineInfo);
            var rootNode     = rootDocument.Element("script");

            var root = new RolandScript(rootNode);

            root.Config = exportConfig;
            root.Parse();

            return(root);
        }
        public virtual void DumpToPatchFile(RolandMemory memory, MemoryStream ms, RolandExportConfig exportConfig)
        {
            foreach (var subStruct in Structs)
            {
                subStruct.DumpToPatchFile(memory, ms, exportConfig);
            }

            foreach (var value in Values)
            {
                value.DumpToPatchFile(memory, ms, exportConfig);
            }
        }
예제 #3
0
        private void InitializeInternal()
        {
            ExportConfig =
                JsonConvert.DeserializeObject <RolandExportConfig>(Encoding.UTF8.GetString(GetExportConfig()));

            ExportConfig.Suffix = GetSuffixData();

            PresetFiles.Clear();
            foreach (var patchFile in Directory.EnumerateFiles(
                         GetPresetFolder(), "*.bin",
                         SearchOption.AllDirectories))
            {
                PresetFiles.Add(patchFile);
            }
        }
예제 #4
0
        public override void DumpToPatchFile(RolandMemory memory, MemoryStream ms, RolandExportConfig exportConfig)
        {
            /*if (!exportConfig.ExportZeroForInt1X7 && Type == "int1x7" && memVal == 0)
             * {
             *
             *  return;
             * }*/


            if (!exportConfig.ShouldExport(ValuePath))
            {
                return;
            }

            var rvs    = ToRolandValueStruct();
            var result = rvs.ConvertMemoryValue(memory);

            if (result.address != null && result.data != null)
            {
                ms.Write(result.address, 0, 4);
                ms.Write(result.data, 0, 4);
            }
        }