public static Project BuildSampleProject2()
        {
            var project2 = new Project
            {
                Data = SampleRomData.CreateSampleData().Data,
            };

            project2.CacheVerificationInfo();

            return(project2);
        }
Beispiel #2
0
 /// <summary>
 /// Generate a sample of assembly output with the given settings
 /// </summary>
 /// <param name="baseSettings">Existing settings to base this generation on</param>
 /// <returns>Output of assembly generation as text</returns>
 /// <remarks>
 /// This is handy for UI and other areas where you want to quickly demo what the effect
 /// will be of various setting changes. We'll use a built-in sample ROM as our data source.
 /// </remarks>
 public static LogCreatorOutput.OutputResult GetSampleAssemblyOutput(LogWriterSettings baseSettings)
 {
     var sampleRomData = SampleRomData.CreateSampleData();
     var lc            = new LogCreator
     {
         Settings = baseSettings with
         {
             Structure           = LogWriterSettings.FormatStructure.SingleFile,
             FileOrFolderOutPath = "",
             OutputToString      = true,
             RomSizeOverride     = sampleRomData.OriginalRomSizeBeforePadding,
         },
Beispiel #3
0
        public static void TestGetFlatByteNonPadded()
        {
            // Get a byte from the sample data that is a real (i.e. non-padded) byte

            var       sampleData  = SampleRomData.CreateSampleData();
            const int romOffset   = 0x0A;
            const int snesAddress = 0x808000 + romOffset;

            var flatByte = ByteGraphUtil.BuildFlatDataFrom(sampleData.Data.SnesAddressSpace, snesAddress);

            Assert.NotNull(flatByte);
            Assert.NotNull(flatByte.Byte);
            Assert.Equal(0xC2, flatByte.Byte.Value);
        }
Beispiel #4
0
        public static void TestGetFlatByteInRange()
        {
            // Get a byte from the sample data that is a padded (i.e. for sample ROMs we can create them with a different
            // size than their source data. in this one, we pad the ROM from a few hundred bytes and add zero'd bytes
            // until we reach 32k bytes). This test is mostly testing that we built the sample data correctly, in real
            // world scenarios, this would never fail because we're not doing padding.

            var       sampleData  = SampleRomData.CreateSampleData();
            const int romOffset   = 0xEB;
            const int snesAddress = 0x808000 + romOffset;

            Assert.True(romOffset >= sampleData.OriginalRomSizeBeforePadding);

            var flatByte = ByteGraphUtil.BuildFlatDataFrom(sampleData.Data.SnesAddressSpace, snesAddress);

            Assert.NotNull(flatByte);
            Assert.NotNull(flatByte.Byte);
            Assert.Equal(0x00, flatByte.Byte.Value);
        }