Exemple #1
0
        protected override IEnumerable <RtlInstructionCluster> GetRtlStream(MemoryArea mem, IStorageBinder binder, IRewriterHost host)
        {
            var addr = Address.Ptr16(0x801);

            arch = new C64Basic(sc, lines);
            return(arch.CreateRewriter(
                       arch.CreateImageReader(mem, addr),
                       arch.CreateProcessorState(),
                       binder,
                       host));
        }
 public void Setup()
 {
     lines    = new SortedList <ushort, C64BasicInstruction>();
     arch     = new C64Basic(lines);
     arch6502 = new Mos6502ProcessorArchitecture("m6502");
     m        = new BasicProcessor(lines);
     host     = new Mock <RewriterTestBase.RewriterHost>(arch)
     {
         CallBase = true
     };
     host.Setup(h => h.GetArchitecture("m6502"))
     .Returns(arch6502);
 }
Exemple #3
0
 public void Setup()
 {
     lines    = new SortedList <ushort, C64BasicInstruction>();
     arch     = new C64Basic(lines);
     arch6502 = new Mos6502ProcessorArchitecture("m6502");
     m        = new BasicProcessor(lines);
     host     = new Mock <RewriterTestBase.RewriterHost>(arch)
     {
         CallBase = true
     };
     host.Setup(h => h.GetArchitecture("m6502"))
     .Returns(arch6502);
     base.Given_MemoryArea(new MemoryArea(Address.Ptr16(0x10), new byte[10]));
 }
Exemple #4
0
 public void Setup()
 {
     lines    = new SortedList <ushort, C64BasicInstruction>();
     sc       = CreateServiceContainer();
     arch     = new C64Basic(sc, "c64", new Dictionary <string, object>());
     arch6502 = new Mos6502Architecture(sc, "m6502", new Dictionary <string, object>());
     m        = new BasicProcessor(lines);
     host     = new Mock <RewriterHost>(arch)
     {
         CallBase = true
     };
     host.Setup(h => h.GetArchitecture("m6502"))
     .Returns(arch6502);
     base.Given_MemoryArea(new ByteMemoryArea(Address.Ptr16(0x800), new byte[10]));
 }
Exemple #5
0
 /// <summary>
 /// Load a Basic PRG.
 /// </summary>
 /// <param name="imageBytes"></param>
 /// <returns></returns>
 private Program LoadPrg(byte[] imageBytes)
 {
     var stm = new MemoryStream();
     ushort preferredAddress = LoadedImage.ReadLeUInt16(imageBytes, 0);
     ushort alignedAddress = (ushort) (preferredAddress & ~0xF);
     int pad = preferredAddress - alignedAddress;
     while (pad-- > 0)
         stm.WriteByte(0);
     stm.Write(imageBytes, 2, imageBytes.Length - 2);
     var loadedBytes = stm.ToArray();
     var image = new LoadedImage(
         Address.Ptr16(alignedAddress),
         loadedBytes);
     var rdr = new C64BasicReader(image, 0x0801);
     var prog = rdr.ToSortedList(line => (ushort)line.Address.ToLinear(), line => line);
     var arch = new C64Basic(prog);
     image = new LoadedImage(
         Address.Ptr16(prog.Keys[0]),
         new byte[0xFFFF]);
     var program = new Program(
         image,
         image.CreateImageMap(),
         arch,
         new C64Platform(Services, null));
     program.EntryPoints.Add(new EntryPoint(image.BaseAddress, arch.CreateProcessorState()));
     return program;
 }
Exemple #6
0
 public void Setup()
 {
     lines = new SortedList <ushort, C64BasicInstruction>();
     arch  = new C64Basic(lines);
     m     = new BasicProcessor(lines);
 }
 public void Setup()
 {
     lines = new SortedList<ushort, C64BasicInstruction>();
     arch = new C64Basic(lines);
     m = new BasicProcessor(lines);
 }