Ejemplo n.º 1
0
        public override void BeforePatch()
        {
            var LP22 = PrefabBuilder.Custom(() => CPUFP.createCube(2, 2))
                       .WithInput(CPUFP.getPegPos(2, 2, "L", 0.5f, 0f), CPUFP.getPegQuat("L"), "Reset Processer / Update Code")
                       .WithInput(CPUFP.getPegPos(2, 2, "L", -0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code Location")
                       .WithInput(CPUFP.getPegPos(2, 2, "R", 0.5f, 0f), CPUFP.getPegQuat("R"), "Clock")
                       .WithInput(CPUFP.getPegPos(2, 2, "B", -0.5f, 0f), CPUFP.getPegQuat("B"), "Input 0")
                       .WithInput(CPUFP.getPegPos(2, 2, "B", 0.5f, 0f), CPUFP.getPegQuat("B"), "Input 1")
                       .WithOutput(CPUFP.getPegPos(2, 2, "F", 0.5f, 0f), CPUFP.getPegQuat("F"), "Output 0")
                       .WithOutput(CPUFP.getPegPos(2, 2, "F", -0.5f, 0f), CPUFP.getPegQuat("F"), "Output 1");

            ComponentRegistry.CreateNew <Processer>("LogiProcessers22", "Processer 2 Bit IO", LP22);

            var LP44 = PrefabBuilder.Custom(() => CPUFP.createCube(4, 4))
                       .WithInput(CPUFP.getPegPos(4, 4, "L", 0.5f, 0f), CPUFP.getPegQuat("L"), "Reset Processer / Update Code")
                       .WithInput(CPUFP.getPegPos(4, 4, "L", -0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code Location")
                       .WithInput(CPUFP.getPegPos(4, 4, "R", 1.5f, 0f), CPUFP.getPegQuat("R"), "Clock")
                       .WithInput(CPUFP.getPegPos(4, 4, "B", -1.5f, 0f), CPUFP.getPegQuat("B"), "Input 0")
                       .WithInput(CPUFP.getPegPos(4, 4, "B", -0.5f, 0f), CPUFP.getPegQuat("B"), "Input 1")
                       .WithInput(CPUFP.getPegPos(4, 4, "B", 0.5f, 0f), CPUFP.getPegQuat("B"), "Input 2")
                       .WithInput(CPUFP.getPegPos(4, 4, "B", 1.5f, 0f), CPUFP.getPegQuat("B"), "Input 3")
                       .WithOutput(CPUFP.getPegPos(4, 4, "F", 1.5f, 0f), CPUFP.getPegQuat("F"), "Output 0")
                       .WithOutput(CPUFP.getPegPos(4, 4, "F", 0.5f, 0f), CPUFP.getPegQuat("F"), "Output 1")
                       .WithOutput(CPUFP.getPegPos(4, 4, "F", -0.5f, 0f), CPUFP.getPegQuat("F"), "Output 2")
                       .WithOutput(CPUFP.getPegPos(4, 4, "F", -1.5f, 0f), CPUFP.getPegQuat("F"), "Output 3");

            ComponentRegistry.CreateNew <Processer>("LogiProcessers44", "Processer 4 Bit IO", LP44);

            var LP88 = PrefabBuilder.Custom(() => CPUFP.createCube(8, 8))
                       .WithInput(CPUFP.getPegPos(8, 8, "L", 0.5f, 0f), CPUFP.getPegQuat("L"), "Reset Processer / Update Code")
                       .WithInput(CPUFP.getPegPos(8, 8, "L", -0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code Loc")
                       .WithInput(CPUFP.getPegPos(8, 8, "R", 3.5f, 0f), CPUFP.getPegQuat("R"), "Clock")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", -3.5f, 0f), CPUFP.getPegQuat("B"), "Input 0")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", -2.5f, 0f), CPUFP.getPegQuat("B"), "Input 1")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", -1.5f, 0f), CPUFP.getPegQuat("B"), "Input 2")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", -0.5f, 0f), CPUFP.getPegQuat("B"), "Input 3")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", 0.5f, 0f), CPUFP.getPegQuat("B"), "Input 4")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", 1.5f, 0f), CPUFP.getPegQuat("B"), "Input 5")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", 2.5f, 0f), CPUFP.getPegQuat("B"), "Input 6")
                       .WithInput(CPUFP.getPegPos(8, 8, "B", 3.5f, 0f), CPUFP.getPegQuat("B"), "Input 7")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", 3.5f, 0f), CPUFP.getPegQuat("F"), "Output 0")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", 2.5f, 0f), CPUFP.getPegQuat("F"), "Output 1")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", 1.5f, 0f), CPUFP.getPegQuat("F"), "Output 2")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", 0.5f, 0f), CPUFP.getPegQuat("F"), "Output 3")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", -0.5f, 0f), CPUFP.getPegQuat("F"), "Output 4")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", -1.5f, 0f), CPUFP.getPegQuat("F"), "Output 5")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", -2.5f, 0f), CPUFP.getPegQuat("F"), "Output 6")
                       .WithOutput(CPUFP.getPegPos(8, 8, "F", -3.5f, 0f), CPUFP.getPegQuat("F"), "Output 7");

            ComponentRegistry.CreateNew <Processer>("LogiProcessers88", "Processer 8 Bit IO", LP88);

            var LP1616 = PrefabBuilder.Custom(() => CPUFP.createCube(8, 17))
                         .WithInput(CPUFP.getPegPos(8, 17, "L", 0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code / Reset Processer")
                         .WithInput(CPUFP.getPegPos(8, 17, "L", -0.5f, 0f), CPUFP.getPegQuat("L"), "Update Code Loc")
                         .WithInput(CPUFP.getPegPos(8, 17, "R", 3.5f, 0f), CPUFP.getPegQuat("R"), "Clock")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 1f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 0")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 2f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 1")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 3f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 2")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 4f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 3")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 5f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 4")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 6f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 5")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 7f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 6")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", 8f, 0f), CPUFP.getPegQuat("B"), "Port 0 Input 7")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -8f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 0")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -7f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 1")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -6f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 2")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -5f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 3")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -4f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 4")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -3f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 5")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -2f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 6")
                         .WithInput(CPUFP.getPegPos(8, 17, "B", -1f, 0f), CPUFP.getPegQuat("B"), "Port 1 Input 7")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -1f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 0")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -2f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 1")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -3f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 2")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -4f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 3")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -5f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 4")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -6f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 5")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -7f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 6")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", -8f, 0f), CPUFP.getPegQuat("F"), "Port 0 Output 7")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 8f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 0")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 7f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 1")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 6f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 2")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 5f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 3")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 4f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 4")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 3f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 5")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 2f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 6")
                         .WithOutput(CPUFP.getPegPos(8, 17, "F", 1f, 0f), CPUFP.getPegQuat("F"), "Port 1 Output 7");

            ComponentRegistry.CreateNew <Processer>("LogiProcessers1616", "Processer 2 Port IO", LP1616);

            Shell.RegisterCommand <setCodeLoc>();
        }
Ejemplo n.º 2
0
        public override void BeforePatch()
        {
            var ROM8x4 = PrefabBuilder.Custom(() => CPUFP.createCube(4, 8))
                         .WithInput(CPUFP.getPegPos(4, 8, "L", .5f, 0), CPUFP.getPegQuat("L"), "Flash ROM")
                         .WithInput(CPUFP.getPegPos(4, 8, "L", -.5f, 0), CPUFP.getPegQuat("L"), "Change Flash Location")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "A0")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -.5f, 0), CPUFP.getPegQuat("B"), "A1")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", .5f, 0), CPUFP.getPegQuat("B"), "A2")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "A3")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "D0")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "D1")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "D2")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", .5f, 0), CPUFP.getPegQuat("F"), "D3")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -.5f, 0), CPUFP.getPegQuat("F"), "D4")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "D5")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "D6")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "D7");

            ComponentRegistry.CreateNew <ROM>("ROM8x4", "16 Byte ROM", ROM8x4);

            var ROM8x8 = PrefabBuilder.Custom(() => CPUFP.createCube(4, 8))
                         .WithInput(CPUFP.getPegPos(4, 8, "L", .5f, 0), CPUFP.getPegQuat("L"), "Flash ROM")
                         .WithInput(CPUFP.getPegPos(4, 8, "L", -.5f, 0), CPUFP.getPegQuat("L"), "Change Flash Location")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -3.5f, 0), CPUFP.getPegQuat("B"), "A0")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -2.5f, 0), CPUFP.getPegQuat("B"), "A1")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "A2")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -.5f, 0), CPUFP.getPegQuat("B"), "A3")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", .5f, 0), CPUFP.getPegQuat("B"), "A4")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "A5")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", 2.5f, 0), CPUFP.getPegQuat("B"), "A6")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", 3.5f, 0), CPUFP.getPegQuat("B"), "A7")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "D0")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "D1")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "D2")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", .5f, 0), CPUFP.getPegQuat("F"), "D3")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -.5f, 0), CPUFP.getPegQuat("F"), "D4")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "D5")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "D6")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "D7");

            ComponentRegistry.CreateNew <ROM>("ROM8x8", "256 Byte ROM", ROM8x8);

            var ROM8x12 = PrefabBuilder.Custom(() => CPUFP.createCube(4, 12))
                          .WithInput(CPUFP.getPegPos(4, 12, "L", .5f, 0), CPUFP.getPegQuat("L"), "Flash ROM")
                          .WithInput(CPUFP.getPegPos(4, 12, "L", -.5f, 0), CPUFP.getPegQuat("L"), "Change Flash Location")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", -5.5f, 0), CPUFP.getPegQuat("B"), "A0")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", -4.5f, 0), CPUFP.getPegQuat("B"), "A1")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", -3.5f, 0), CPUFP.getPegQuat("B"), "A2")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", -2.5f, 0), CPUFP.getPegQuat("B"), "A3")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "A4")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", -.5f, 0), CPUFP.getPegQuat("B"), "A5")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", .5f, 0), CPUFP.getPegQuat("B"), "A6")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "A7")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", 2.5f, 0), CPUFP.getPegQuat("B"), "A8")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", 3.5f, 0), CPUFP.getPegQuat("B"), "A9")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", 4.5f, 0), CPUFP.getPegQuat("B"), "A10")
                          .WithInput(CPUFP.getPegPos(4, 12, "B", 5.5f, 0), CPUFP.getPegQuat("B"), "A11")
                          .WithOutput(CPUFP.getPegPos(4, 12, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "D0")
                          .WithOutput(CPUFP.getPegPos(4, 12, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "D1")
                          .WithOutput(CPUFP.getPegPos(4, 12, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "D2")
                          .WithOutput(CPUFP.getPegPos(4, 12, "F", .5f, 0), CPUFP.getPegQuat("F"), "D3")
                          .WithOutput(CPUFP.getPegPos(4, 12, "F", -.5f, 0), CPUFP.getPegQuat("F"), "D4")
                          .WithOutput(CPUFP.getPegPos(4, 12, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "D5")
                          .WithOutput(CPUFP.getPegPos(4, 12, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "D6")
                          .WithOutput(CPUFP.getPegPos(4, 12, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "D7");

            ComponentRegistry.CreateNew <ROM>("ROM8x12", "4096 Byte ROM", ROM8x12);

            var ROM8x16 = PrefabBuilder.Custom(() => CPUFP.createCube(4, 16))
                          .WithInput(CPUFP.getPegPos(4, 16, "L", .5f, 0), CPUFP.getPegQuat("L"), "Flash ROM")
                          .WithInput(CPUFP.getPegPos(4, 16, "L", -.5f, 0), CPUFP.getPegQuat("L"), "Change Flash Location")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", -7.5f, 0), CPUFP.getPegQuat("B"), "A0")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", -6.5f, 0), CPUFP.getPegQuat("B"), "A1")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", -5.5f, 0), CPUFP.getPegQuat("B"), "A2")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", -4.5f, 0), CPUFP.getPegQuat("B"), "A3")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", -3.5f, 0), CPUFP.getPegQuat("B"), "A4")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", -2.5f, 0), CPUFP.getPegQuat("B"), "A5")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "A6")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", -.5f, 0), CPUFP.getPegQuat("B"), "A7")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", .5f, 0), CPUFP.getPegQuat("B"), "A8")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "A9")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", 2.5f, 0), CPUFP.getPegQuat("B"), "A10")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", 3.5f, 0), CPUFP.getPegQuat("B"), "A11")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", 4.5f, 0), CPUFP.getPegQuat("B"), "A12")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", 5.5f, 0), CPUFP.getPegQuat("B"), "A13")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", 6.5f, 0), CPUFP.getPegQuat("B"), "A14")
                          .WithInput(CPUFP.getPegPos(4, 16, "B", 7.5f, 0), CPUFP.getPegQuat("B"), "A15")
                          .WithOutput(CPUFP.getPegPos(4, 16, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "D0")
                          .WithOutput(CPUFP.getPegPos(4, 16, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "D1")
                          .WithOutput(CPUFP.getPegPos(4, 16, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "D2")
                          .WithOutput(CPUFP.getPegPos(4, 16, "F", .5f, 0), CPUFP.getPegQuat("F"), "D3")
                          .WithOutput(CPUFP.getPegPos(4, 16, "F", -.5f, 0), CPUFP.getPegQuat("F"), "D4")
                          .WithOutput(CPUFP.getPegPos(4, 16, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "D5")
                          .WithOutput(CPUFP.getPegPos(4, 16, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "D6")
                          .WithOutput(CPUFP.getPegPos(4, 16, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "D7");

            ComponentRegistry.CreateNew <ROM>("ROM8x16", "65536 Byte ROM", ROM8x16);


            var Register8 = PrefabBuilder.Custom(() => CPUFP.createCube(2, 8))
                            .WithInput(CPUFP.getPegPos(2, 8, "L", -.5f, 0), CPUFP.getPegQuat("L"), "Enable")
                            .WithInput(CPUFP.getPegPos(2, 8, "L", .5f, 0), CPUFP.getPegQuat("L"), "OE")
                            .WithInput(CPUFP.getPegPos(2, 8, "B", -3.5f, 0), CPUFP.getPegQuat("B"), "I0")
                            .WithInput(CPUFP.getPegPos(2, 8, "B", -2.5f, 0), CPUFP.getPegQuat("B"), "I1")
                            .WithInput(CPUFP.getPegPos(2, 8, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "I2")
                            .WithInput(CPUFP.getPegPos(2, 8, "B", -.5f, 0), CPUFP.getPegQuat("B"), "I3")
                            .WithInput(CPUFP.getPegPos(2, 8, "B", .5f, 0), CPUFP.getPegQuat("B"), "I4")
                            .WithInput(CPUFP.getPegPos(2, 8, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "I5")
                            .WithInput(CPUFP.getPegPos(2, 8, "B", 2.5f, 0), CPUFP.getPegQuat("B"), "I6")
                            .WithInput(CPUFP.getPegPos(2, 8, "B", 3.5f, 0), CPUFP.getPegQuat("B"), "I7")
                            .WithOutput(CPUFP.getPegPos(2, 8, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "O0")
                            .WithOutput(CPUFP.getPegPos(2, 8, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "O1")
                            .WithOutput(CPUFP.getPegPos(2, 8, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "O2")
                            .WithOutput(CPUFP.getPegPos(2, 8, "F", .5f, 0), CPUFP.getPegQuat("F"), "O3")
                            .WithOutput(CPUFP.getPegPos(2, 8, "F", -.5f, 0), CPUFP.getPegQuat("F"), "O4")
                            .WithOutput(CPUFP.getPegPos(2, 8, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "O5")
                            .WithOutput(CPUFP.getPegPos(2, 8, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "O6")
                            .WithOutput(CPUFP.getPegPos(2, 8, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "O7");

            ComponentRegistry.CreateNew <Register>("Register8", "8 Bit Register", Register8);

            var ProgRegister8 = PrefabBuilder.Custom(() => CPUFP.createCube(3, 8))
                                .WithInput(CPUFP.getPegPos(3, 8, "L", 0f, 0), CPUFP.getPegQuat("L"), "Enable")
                                .WithInput(CPUFP.getPegPos(3, 8, "L", 1f, 0), CPUFP.getPegQuat("L"), "OE")
                                .WithInput(CPUFP.getPegPos(3, 8, "R", 0f, 0), CPUFP.getPegQuat("R"), "Jump")
                                .WithInput(CPUFP.getPegPos(3, 8, "R", 1f, 0), CPUFP.getPegQuat("R"), "Carry In")
                                .WithInput(CPUFP.getPegPos(3, 8, "B", -3.5f, 0), CPUFP.getPegQuat("B"), "I0")
                                .WithInput(CPUFP.getPegPos(3, 8, "B", -2.5f, 0), CPUFP.getPegQuat("B"), "I1")
                                .WithInput(CPUFP.getPegPos(3, 8, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "I2")
                                .WithInput(CPUFP.getPegPos(3, 8, "B", -.5f, 0), CPUFP.getPegQuat("B"), "I3")
                                .WithInput(CPUFP.getPegPos(3, 8, "B", .5f, 0), CPUFP.getPegQuat("B"), "I4")
                                .WithInput(CPUFP.getPegPos(3, 8, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "I5")
                                .WithInput(CPUFP.getPegPos(3, 8, "B", 2.5f, 0), CPUFP.getPegQuat("B"), "I6")
                                .WithInput(CPUFP.getPegPos(3, 8, "B", 3.5f, 0), CPUFP.getPegQuat("B"), "I7")
                                .WithOutput(CPUFP.getPegPos(3, 8, "L", -1f, 0), CPUFP.getPegQuat("L"), "Carry Out")
                                .WithOutput(CPUFP.getPegPos(3, 8, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "O0")
                                .WithOutput(CPUFP.getPegPos(3, 8, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "O1")
                                .WithOutput(CPUFP.getPegPos(3, 8, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "O2")
                                .WithOutput(CPUFP.getPegPos(3, 8, "F", .5f, 0), CPUFP.getPegQuat("F"), "O3")
                                .WithOutput(CPUFP.getPegPos(3, 8, "F", -.5f, 0), CPUFP.getPegQuat("F"), "O4")
                                .WithOutput(CPUFP.getPegPos(3, 8, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "O5")
                                .WithOutput(CPUFP.getPegPos(3, 8, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "O6")
                                .WithOutput(CPUFP.getPegPos(3, 8, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "O7");

            ComponentRegistry.CreateNew <ProgramRegister>("ProgRegister8", "8 Bit Program Counter", ProgRegister8);

            var RAM8x4 = PrefabBuilder.Custom(() => CPUFP.createCube(4, 8))
                         .WithInput(CPUFP.getPegPos(4, 8, "L", 1.5f, 0), CPUFP.getPegQuat("L"), "Write Enable")
                         .WithInput(CPUFP.getPegPos(4, 8, "L", .5f, 0), CPUFP.getPegQuat("L"), "Flash RAM")
                         .WithInput(CPUFP.getPegPos(4, 8, "L", -.5f, 0), CPUFP.getPegQuat("L"), "Save RAM")
                         .WithInput(CPUFP.getPegPos(4, 8, "L", -1.5f, 0), CPUFP.getPegQuat("L"), "Change Flash Location")
                         .WithInput(CPUFP.getPegPos(4, 8, "R", -1.5f, 0), CPUFP.getPegQuat("R"), "A0")
                         .WithInput(CPUFP.getPegPos(4, 8, "R", -.5f, 0), CPUFP.getPegQuat("R"), "A1")
                         .WithInput(CPUFP.getPegPos(4, 8, "R", .5f, 0), CPUFP.getPegQuat("R"), "A2")
                         .WithInput(CPUFP.getPegPos(4, 8, "R", 1.5f, 0), CPUFP.getPegQuat("R"), "A3")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -3.5f, 0), CPUFP.getPegQuat("B"), "DIn0")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -2.5f, 0), CPUFP.getPegQuat("B"), "DIn1")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "DIn2")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", -.5f, 0), CPUFP.getPegQuat("B"), "DIn3")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", .5f, 0), CPUFP.getPegQuat("B"), "DIn4")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "DIn5")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", 2.5f, 0), CPUFP.getPegQuat("B"), "DIn6")
                         .WithInput(CPUFP.getPegPos(4, 8, "B", 3.5f, 0), CPUFP.getPegQuat("B"), "DIn7")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "DOut0")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "DOut1")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "DOut2")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", .5f, 0), CPUFP.getPegQuat("F"), "DOut3")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -.5f, 0), CPUFP.getPegQuat("F"), "DOut4")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "DOut5")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "DOut6")
                         .WithOutput(CPUFP.getPegPos(4, 8, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "DOut7");

            ComponentRegistry.CreateNew <RAM>("RAM8x4", "16 Byte RAM", RAM8x4);

            var RAM8x8 = PrefabBuilder.Custom(() => CPUFP.createCube(8, 8))
                         .WithInput(CPUFP.getPegPos(8, 8, "L", 1.5f, 0), CPUFP.getPegQuat("L"), "Write Enable")
                         .WithInput(CPUFP.getPegPos(8, 8, "L", .5f, 0), CPUFP.getPegQuat("L"), "Flash RAM")
                         .WithInput(CPUFP.getPegPos(8, 8, "L", -.5f, 0), CPUFP.getPegQuat("L"), "Save RAM")
                         .WithInput(CPUFP.getPegPos(8, 8, "L", -1.5f, 0), CPUFP.getPegQuat("L"), "Change Flash Location")
                         .WithInput(CPUFP.getPegPos(8, 8, "R", -3.5f, 0), CPUFP.getPegQuat("R"), "A0")
                         .WithInput(CPUFP.getPegPos(8, 8, "R", -2.5f, 0), CPUFP.getPegQuat("R"), "A1")
                         .WithInput(CPUFP.getPegPos(8, 8, "R", -1.5f, 0), CPUFP.getPegQuat("R"), "A2")
                         .WithInput(CPUFP.getPegPos(8, 8, "R", -.5f, 0), CPUFP.getPegQuat("R"), "A3")
                         .WithInput(CPUFP.getPegPos(8, 8, "R", .5f, 0), CPUFP.getPegQuat("R"), "A4")
                         .WithInput(CPUFP.getPegPos(8, 8, "R", 1.5f, 0), CPUFP.getPegQuat("R"), "A5")
                         .WithInput(CPUFP.getPegPos(8, 8, "R", 2.5f, 0), CPUFP.getPegQuat("R"), "A6")
                         .WithInput(CPUFP.getPegPos(8, 8, "R", 3.5f, 0), CPUFP.getPegQuat("R"), "A7")
                         .WithInput(CPUFP.getPegPos(8, 8, "B", -3.5f, 0), CPUFP.getPegQuat("B"), "DIn0")
                         .WithInput(CPUFP.getPegPos(8, 8, "B", -2.5f, 0), CPUFP.getPegQuat("B"), "DIn1")
                         .WithInput(CPUFP.getPegPos(8, 8, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "DIn2")
                         .WithInput(CPUFP.getPegPos(8, 8, "B", -.5f, 0), CPUFP.getPegQuat("B"), "DIn3")
                         .WithInput(CPUFP.getPegPos(8, 8, "B", .5f, 0), CPUFP.getPegQuat("B"), "DIn4")
                         .WithInput(CPUFP.getPegPos(8, 8, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "DIn5")
                         .WithInput(CPUFP.getPegPos(8, 8, "B", 2.5f, 0), CPUFP.getPegQuat("B"), "DIn6")
                         .WithInput(CPUFP.getPegPos(8, 8, "B", 3.5f, 0), CPUFP.getPegQuat("B"), "DIn7")
                         .WithOutput(CPUFP.getPegPos(8, 8, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "DOut0")
                         .WithOutput(CPUFP.getPegPos(8, 8, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "DOut1")
                         .WithOutput(CPUFP.getPegPos(8, 8, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "DOut2")
                         .WithOutput(CPUFP.getPegPos(8, 8, "F", .5f, 0), CPUFP.getPegQuat("F"), "DOut3")
                         .WithOutput(CPUFP.getPegPos(8, 8, "F", -.5f, 0), CPUFP.getPegQuat("F"), "DOut4")
                         .WithOutput(CPUFP.getPegPos(8, 8, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "DOut5")
                         .WithOutput(CPUFP.getPegPos(8, 8, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "DOut6")
                         .WithOutput(CPUFP.getPegPos(8, 8, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "DOut7");

            ComponentRegistry.CreateNew <RAM>("RAM8x8", "256 Byte RAM", RAM8x8);

            var RAM8x12 = PrefabBuilder.Custom(() => CPUFP.createCube(12, 8))
                          .WithInput(CPUFP.getPegPos(12, 8, "L", 1.5f, 0), CPUFP.getPegQuat("L"), "Write Enable")
                          .WithInput(CPUFP.getPegPos(12, 8, "L", .5f, 0), CPUFP.getPegQuat("L"), "Flash RAM")
                          .WithInput(CPUFP.getPegPos(12, 8, "L", -.5f, 0), CPUFP.getPegQuat("L"), "Save RAM")
                          .WithInput(CPUFP.getPegPos(12, 8, "L", -1.5f, 0), CPUFP.getPegQuat("L"), "Change Flash Location")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", -5.5f, 0), CPUFP.getPegQuat("R"), "A0")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", -4.5f, 0), CPUFP.getPegQuat("R"), "A1")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", -3.5f, 0), CPUFP.getPegQuat("R"), "A2")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", -2.5f, 0), CPUFP.getPegQuat("R"), "A3")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", -1.5f, 0), CPUFP.getPegQuat("R"), "A4")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", -.5f, 0), CPUFP.getPegQuat("R"), "A5")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", .5f, 0), CPUFP.getPegQuat("R"), "A6")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", 1.5f, 0), CPUFP.getPegQuat("R"), "A7")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", 2.5f, 0), CPUFP.getPegQuat("R"), "A8")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", 3.5f, 0), CPUFP.getPegQuat("R"), "A9")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", 4.5f, 0), CPUFP.getPegQuat("R"), "A10")
                          .WithInput(CPUFP.getPegPos(12, 8, "R", 5.5f, 0), CPUFP.getPegQuat("R"), "A11")
                          .WithInput(CPUFP.getPegPos(12, 8, "B", -3.5f, 0), CPUFP.getPegQuat("B"), "DIn0")
                          .WithInput(CPUFP.getPegPos(12, 8, "B", -2.5f, 0), CPUFP.getPegQuat("B"), "DIn1")
                          .WithInput(CPUFP.getPegPos(12, 8, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "DIn2")
                          .WithInput(CPUFP.getPegPos(12, 8, "B", -.5f, 0), CPUFP.getPegQuat("B"), "DIn3")
                          .WithInput(CPUFP.getPegPos(12, 8, "B", .5f, 0), CPUFP.getPegQuat("B"), "DIn4")
                          .WithInput(CPUFP.getPegPos(12, 8, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "DIn5")
                          .WithInput(CPUFP.getPegPos(12, 8, "B", 2.5f, 0), CPUFP.getPegQuat("B"), "DIn6")
                          .WithInput(CPUFP.getPegPos(12, 8, "B", 3.5f, 0), CPUFP.getPegQuat("B"), "DIn7")
                          .WithOutput(CPUFP.getPegPos(12, 8, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "DOut0")
                          .WithOutput(CPUFP.getPegPos(12, 8, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "DOut1")
                          .WithOutput(CPUFP.getPegPos(12, 8, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "DOut2")
                          .WithOutput(CPUFP.getPegPos(12, 8, "F", .5f, 0), CPUFP.getPegQuat("F"), "DOut3")
                          .WithOutput(CPUFP.getPegPos(12, 8, "F", -.5f, 0), CPUFP.getPegQuat("F"), "DOut4")
                          .WithOutput(CPUFP.getPegPos(12, 8, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "DOut5")
                          .WithOutput(CPUFP.getPegPos(12, 8, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "DOut6")
                          .WithOutput(CPUFP.getPegPos(12, 8, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "DOut7");

            ComponentRegistry.CreateNew <RAM>("RAM8x12", "4096 Byte RAM", RAM8x12);

            var RAM8x16 = PrefabBuilder.Custom(() => CPUFP.createCube(16, 8))
                          .WithInput(CPUFP.getPegPos(16, 8, "L", 1.5f, 0), CPUFP.getPegQuat("L"), "Write Enable")
                          .WithInput(CPUFP.getPegPos(16, 8, "L", .5f, 0), CPUFP.getPegQuat("L"), "Flash RAM")
                          .WithInput(CPUFP.getPegPos(16, 8, "L", -.5f, 0), CPUFP.getPegQuat("L"), "Save RAM")
                          .WithInput(CPUFP.getPegPos(16, 8, "L", -1.5f, 0), CPUFP.getPegQuat("L"), "Change Flash Location")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", -7.5f, 0), CPUFP.getPegQuat("R"), "A0")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", -6.5f, 0), CPUFP.getPegQuat("R"), "A1")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", -5.5f, 0), CPUFP.getPegQuat("R"), "A2")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", -4.5f, 0), CPUFP.getPegQuat("R"), "A3")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", -3.5f, 0), CPUFP.getPegQuat("R"), "A4")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", -2.5f, 0), CPUFP.getPegQuat("R"), "A5")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", -1.5f, 0), CPUFP.getPegQuat("R"), "A6")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", -.5f, 0), CPUFP.getPegQuat("R"), "A7")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", .5f, 0), CPUFP.getPegQuat("R"), "A8")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", 1.5f, 0), CPUFP.getPegQuat("R"), "A9")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", 2.5f, 0), CPUFP.getPegQuat("R"), "A10")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", 3.5f, 0), CPUFP.getPegQuat("R"), "A11")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", 4.5f, 0), CPUFP.getPegQuat("R"), "A12")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", 5.5f, 0), CPUFP.getPegQuat("R"), "A13")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", 6.5f, 0), CPUFP.getPegQuat("R"), "A14")
                          .WithInput(CPUFP.getPegPos(16, 8, "R", 7.5f, 0), CPUFP.getPegQuat("R"), "A15")
                          .WithInput(CPUFP.getPegPos(16, 8, "B", -3.5f, 0), CPUFP.getPegQuat("B"), "DIn0")
                          .WithInput(CPUFP.getPegPos(16, 8, "B", -2.5f, 0), CPUFP.getPegQuat("B"), "DIn1")
                          .WithInput(CPUFP.getPegPos(16, 8, "B", -1.5f, 0), CPUFP.getPegQuat("B"), "DIn2")
                          .WithInput(CPUFP.getPegPos(16, 8, "B", -.5f, 0), CPUFP.getPegQuat("B"), "DIn3")
                          .WithInput(CPUFP.getPegPos(16, 8, "B", .5f, 0), CPUFP.getPegQuat("B"), "DIn4")
                          .WithInput(CPUFP.getPegPos(16, 8, "B", 1.5f, 0), CPUFP.getPegQuat("B"), "DIn5")
                          .WithInput(CPUFP.getPegPos(16, 8, "B", 2.5f, 0), CPUFP.getPegQuat("B"), "DIn6")
                          .WithInput(CPUFP.getPegPos(16, 8, "B", 3.5f, 0), CPUFP.getPegQuat("B"), "DIn7")
                          .WithOutput(CPUFP.getPegPos(16, 8, "F", 3.5f, 0), CPUFP.getPegQuat("F"), "DOut0")
                          .WithOutput(CPUFP.getPegPos(16, 8, "F", 2.5f, 0), CPUFP.getPegQuat("F"), "DOut1")
                          .WithOutput(CPUFP.getPegPos(16, 8, "F", 1.5f, 0), CPUFP.getPegQuat("F"), "DOut2")
                          .WithOutput(CPUFP.getPegPos(16, 8, "F", .5f, 0), CPUFP.getPegQuat("F"), "DOut3")
                          .WithOutput(CPUFP.getPegPos(16, 8, "F", -.5f, 0), CPUFP.getPegQuat("F"), "DOut4")
                          .WithOutput(CPUFP.getPegPos(16, 8, "F", -1.5f, 0), CPUFP.getPegQuat("F"), "DOut5")
                          .WithOutput(CPUFP.getPegPos(16, 8, "F", -2.5f, 0), CPUFP.getPegQuat("F"), "DOut6")
                          .WithOutput(CPUFP.getPegPos(16, 8, "F", -3.5f, 0), CPUFP.getPegQuat("F"), "DOut7");

            ComponentRegistry.CreateNew <RAM>("RAM8x16", "65536 Byte RAM", RAM8x16);

            Shell.RegisterCommand <setRomLoc>();
        }
Ejemplo n.º 3
0
        public override void BeforePatch()
        {
            var XORRight = PrefabBuilder.Custom(() => CPUFP.createCube(1, 2, hexToColor("#1D2f8E")))
                           .WithInput(CPUFP.getPegPos(1, 2, "B", 0.5f, 0), CPUFP.getPegQuat("B"), "A")
                           .WithInput(CPUFP.getPegPos(1, 2, "B", -0.5f, 0), CPUFP.getPegQuat("B"), "B")
                           .WithOutput(CPUFP.getPegPos(1, 2, "F", 0.5f, 0), CPUFP.getPegQuat("F"), "A XOR B");

            ComponentRegistry.CreateNew <XOR>("LWXORRight", "XOR Gate (Right blot)", XORRight);

            var XORLeft = PrefabBuilder.Custom(() => CPUFP.createCube(1, 2, hexToColor("#1D2f8E")))
                          .WithInput(CPUFP.getPegPos(1, 2, "B", 0.5f, 0), CPUFP.getPegQuat("B"), "A")
                          .WithInput(CPUFP.getPegPos(1, 2, "B", -0.5f, 0), CPUFP.getPegQuat("B"), "B")
                          .WithOutput(CPUFP.getPegPos(1, 2, "F", -0.5f, 0), CPUFP.getPegQuat("F"), "A XOR B");

            ComponentRegistry.CreateNew <XOR>("LWXORLeft", "XOR Gate (Left blot)", XORLeft);

            var DLatch = PrefabBuilder.Custom(() => CPUFP.createCube(2, 1, hexToColor("#349F16")))
                         .WithInput(CPUFP.getPegPos(2, 1, "B"), CPUFP.getPegQuat("B"), "Input")
                         .WithInput(CPUFP.getPegPos(2, 1, "T", 0f, -0.5f), CPUFP.getPegQuat("T"), "Enable")
                         .WithOutput(CPUFP.getPegPos(2, 1, "T", 0f, 0.5f), CPUFP.getPegQuat("T"), "Output");

            ComponentRegistry.CreateNew <DLatch>("LWDLatch", "D Latch", DLatch);

            var Oracle = PrefabBuilder.Custom(() => CPUFP.createCube(1, 2, 1, hexToColor("#F365AB")))
                         .WithInput(CPUFP.getPegPos(1, 2, 1, "B", 0, -.5f), CPUFP.getPegQuat("B"), "Input")
                         .WithOutput(CPUFP.getPegPos(1, 2, 1, "F", 0, .5f), CPUFP.getPegQuat("F"), "Output");

            ComponentRegistry.CreateNew <Oracle>("LWOracle", "Oracle", Oracle);

            var And2 = PrefabBuilder.Custom(() => CPUFP.createCube(1, 1, hexToColor("#6D1916")))
                       .WithInput(CPUFP.getPegPos(1, 1, "B", .25f, 0), CPUFP.getPegQuat("B"), "A")
                       .WithInput(CPUFP.getPegPos(1, 1, "B", -.25f, 0), CPUFP.getPegQuat("B"), "B")
                       .WithOutput(CPUFP.getPegPos(1, 1, "F"), CPUFP.getPegQuat("F"), "A & B");

            ComponentRegistry.CreateNew <AND2>("LWAND", "AND Gate", And2);

            var And3 = PrefabBuilder.Custom(() => CPUFP.createCube(1, 1.5f, hexToColor("#6D1916")))
                       .WithInput(CPUFP.getPegPos(1, 1.5f, "B", .5f, 0), CPUFP.getPegQuat("B"), "A")
                       .WithInput(CPUFP.getPegPos(1, 1.5f, "B", 0f, 0), CPUFP.getPegQuat("B"), "B")
                       .WithInput(CPUFP.getPegPos(1, 1.5f, "B", -.5f, 0), CPUFP.getPegQuat("B"), "C")
                       .WithOutput(CPUFP.getPegPos(1, 1.5f, "F"), CPUFP.getPegQuat("F"), "A & B & C");

            ComponentRegistry.CreateNew <AND3>("LWAND3", "Three-way AND Gate", And3);

            var And4 = PrefabBuilder.Custom(() => CPUFP.createCube(1, 2, hexToColor("#6D1916")))
                       .WithInput(CPUFP.getPegPos(1, 2, "B", .75f, 0), CPUFP.getPegQuat("B"), "A")
                       .WithInput(CPUFP.getPegPos(1, 2, "B", .25f, 0), CPUFP.getPegQuat("B"), "B")
                       .WithInput(CPUFP.getPegPos(1, 2, "B", -.25f, 0), CPUFP.getPegQuat("B"), "C")
                       .WithInput(CPUFP.getPegPos(1, 2, "B", -.75f, 0), CPUFP.getPegQuat("B"), "D")
                       .WithOutput(CPUFP.getPegPos(1, 2, "F"), CPUFP.getPegQuat("F"), "A & B & C & D");

            ComponentRegistry.CreateNew <AND4>("LWAND4", "Four-way AND Gate", And4);

            var ShortDelayer = PrefabBuilder.Custom(() => CPUFP.createCube(0.75f, 1))
                               .WithInput(CPUFP.getPegPos(0.75f, 1, "BT", 0, 0.35f), CPUFP.getPegQuat("BT"), "Input")
                               .WithOutput(CPUFP.getPegPos(0.75f, 1, "FT", 0, 0.35f), CPUFP.getPegQuat("FT"), "Output");

            ComponentRegistry.CreateNew <SDelay>("LWDelayShort", "Short Delayer", ShortDelayer);

            var Relay = PrefabBuilder.Custom(() => CPUFP.createCube(2, 1, hexToColor("#7E133B")))
                        .WithInput(CPUFP.getPegPos(2, 1, "B"), CPUFP.getPegQuat("B"), "Input")
                        .WithInput(CPUFP.getPegPos(2, 1, "F"), CPUFP.getPegQuat("F"), "Input2")
                        .WithInput(CPUFP.getPegPos(2, 1, "T"), CPUFP.getPegQuat("T"), "Enable");

            ComponentRegistry.CreateNew <Relay>("LWRelay", "Relay", Relay);
        }
Ejemplo n.º 4
0
        public override void BeforePatch()
        {
            var Test = PrefabBuilder.Custom(() => CPUFP.createCube(1, 1))
                       .WithInput(new Vector3(0, 0.15f, 0.15f), Quaternion.Euler(90, 0, 0));

            ComponentRegistry.CreateNew <Empty>("Custom Builder Test", "Test", Test);
            var Test2 = PrefabBuilder.Custom(() => CPUFP.createCube(1, 1))
                        .WithInput(CPUFP.getPegPos(1, 1, "F"), CPUFP.getPegQuat(1, 1, "F"), "Front")
                        .WithInput(CPUFP.getPegPos(1, 1, "B"), CPUFP.getPegQuat(1, 1, "B"), "Back")
                        .WithInput(CPUFP.getPegPos(1, 1, "L"), CPUFP.getPegQuat(1, 1, "L"), "Left")
                        .WithInput(CPUFP.getPegPos(1, 1, "R"), CPUFP.getPegQuat(1, 1, "R"), "Right")
                        .WithInput(CPUFP.getPegPos(1, 1, "T"), CPUFP.getPegQuat(1, 1, "T"), "Top");

            ComponentRegistry.CreateNew <Empty>("Custom Builder Test2", "Test2", Test2);
            var SizeX  = 2;
            var SizeY  = 2;
            var Test22 = PrefabBuilder.Custom(() => CPUFP.createCube(2, 2))
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "F"), CPUFP.getPegQuat(SizeX, SizeY, "F"), "Front")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "B"), CPUFP.getPegQuat(SizeX, SizeY, "B"), "Back")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "L"), CPUFP.getPegQuat(SizeX, SizeY, "L"), "Left")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "R"), CPUFP.getPegQuat(SizeX, SizeY, "R"), "Right")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "T"), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top");

            ComponentRegistry.CreateNew <Empty>("Custom Builder Test2x2", "Test2x2", Test22);

            SizeX = 3;
            SizeY = 3;
            var Test33 = PrefabBuilder.Custom(() => CPUFP.createCube(3, 3))
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "F"), CPUFP.getPegQuat(SizeX, SizeY, "F"), "Front")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "B"), CPUFP.getPegQuat(SizeX, SizeY, "B"), "Back")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "L"), CPUFP.getPegQuat(SizeX, SizeY, "L"), "Left")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "R"), CPUFP.getPegQuat(SizeX, SizeY, "R"), "Right")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "T"), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top");

            ComponentRegistry.CreateNew <Empty>("Custom Builder Test3x3", "Test3x3", Test33);

            SizeX = 2;
            SizeY = 3;
            var Test23 = PrefabBuilder.Custom(() => CPUFP.createCube(2, 3))
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "F"), CPUFP.getPegQuat(SizeX, SizeY, "F"), "Front")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "B"), CPUFP.getPegQuat(SizeX, SizeY, "B"), "Back")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "L"), CPUFP.getPegQuat(SizeX, SizeY, "L"), "Left")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "R"), CPUFP.getPegQuat(SizeX, SizeY, "R"), "Right")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "T"), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top");

            ComponentRegistry.CreateNew <Empty>("Custom Builder Test2x3", "Test2x3", Test23);
            SizeX = 3;
            SizeY = 2;
            var Test32 = PrefabBuilder.Custom(() => CPUFP.createCube(3, 2))
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "F"), CPUFP.getPegQuat(SizeX, SizeY, "F"), "Front")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "B"), CPUFP.getPegQuat(SizeX, SizeY, "B"), "Back")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "L"), CPUFP.getPegQuat(SizeX, SizeY, "L"), "Left")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "R"), CPUFP.getPegQuat(SizeX, SizeY, "R"), "Right")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "T"), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top");

            ComponentRegistry.CreateNew <Empty>("Custom Builder Test3x2", "Test3x2", Test32);

            SizeX = 3;
            SizeY = 3;
            var TestO = PrefabBuilder.Custom(() => CPUFP.createCube(3, 3))
                        .WithOutput(CPUFP.getPegPos(SizeX, SizeY, "F"), CPUFP.getPegQuat(SizeX, SizeY, "F"), "Front")
                        .WithOutput(CPUFP.getPegPos(SizeX, SizeY, "B"), CPUFP.getPegQuat(SizeX, SizeY, "B"), "Back")
                        .WithOutput(CPUFP.getPegPos(SizeX, SizeY, "L"), CPUFP.getPegQuat(SizeX, SizeY, "L"), "Left")
                        .WithOutput(CPUFP.getPegPos(SizeX, SizeY, "R"), CPUFP.getPegQuat(SizeX, SizeY, "R"), "Right")
                        .WithOutput(CPUFP.getPegPos(SizeX, SizeY, "T"), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top");

            ComponentRegistry.CreateNew <Empty>("Custom Builder TestO", "Test With Outputs", TestO);

            SizeX = 3;
            SizeY = 3;
            var Test3D = PrefabBuilder.Custom(() => CPUFP.createCube(3, 3, 3))
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "F"), CPUFP.getPegQuat(SizeX, SizeY, 3, "F"), "Front")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "B"), CPUFP.getPegQuat(SizeX, SizeY, 3, "B"), "Back")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "L"), CPUFP.getPegQuat(SizeX, SizeY, 3, "L"), "Left")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "R"), CPUFP.getPegQuat(SizeX, SizeY, 3, "R"), "Right")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "T"), CPUFP.getPegQuat(SizeX, SizeY, 3, "T"), "Top");

            ComponentRegistry.CreateNew <Empty>("Custom Builder Test3D", "Vertial Test 3 High", Test3D);

            SizeX = 3;
            SizeY = 2;
            var Test332 = PrefabBuilder.Custom(() => CPUFP.createCube(3, 2, 3))
                          .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "F"), CPUFP.getPegQuat(SizeX, SizeY, 3, "F"), "Front")
                          .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "B"), CPUFP.getPegQuat(SizeX, SizeY, 3, "B"), "Back")
                          .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "L"), CPUFP.getPegQuat(SizeX, SizeY, 3, "L"), "Left")
                          .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "R"), CPUFP.getPegQuat(SizeX, SizeY, 3, "R"), "Right")
                          .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "T"), CPUFP.getPegQuat(SizeX, SizeY, 3, "T"), "Top");

            ComponentRegistry.CreateNew <Empty>("Custom Builder Test3D x 2", "Vertial Test 2 High", Test332);

            SizeX = 3;
            SizeY = 3;
            var Testos = PrefabBuilder.Custom(() => CPUFP.createCube(3, 3))
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "F"), CPUFP.getPegQuat(SizeX, SizeY, "F"), "Front")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "F", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, "F"), "Front Left Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "F", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, "F"), "Front Right Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "B"), CPUFP.getPegQuat(SizeX, SizeY, "B"), "Back")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "B", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, "B"), "Back Left Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "B", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, "B"), "Back Right Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "L"), CPUFP.getPegQuat(SizeX, SizeY, "L"), "Left")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "L", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, "L"), "Left Left Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "L", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, "L"), "Left Right Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "R"), CPUFP.getPegQuat(SizeX, SizeY, "R"), "Right")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "R", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, "R"), "Right Left Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "R", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, "R"), "Right Right Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "T"), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "T", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top Left Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "T", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top Right Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "T", 0, 1), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top Front Side")
                         .WithInput(CPUFP.getPegPos(SizeX, SizeY, "T", 0, -1), CPUFP.getPegQuat(SizeX, SizeY, "T"), "Top Back Side");

            ComponentRegistry.CreateNew <Empty>("Custom Builder TestOS", "Offset Test", Testos);

            SizeX = 3;
            SizeY = 3;
            var Testos3D = PrefabBuilder.Custom(() => CPUFP.createCube(3, 3, 3))
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "F"), CPUFP.getPegQuat(SizeX, SizeY, 3, "F"), "Front")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "F", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "F"), "Front Left Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "F", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "F"), "Front Right Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "F", 0, 1), CPUFP.getPegQuat(SizeX, SizeY, 3, "F"), "Front Top Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "F", 0, -1), CPUFP.getPegQuat(SizeX, SizeY, 3, "F"), "Front Bottom Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "B"), CPUFP.getPegQuat(SizeX, SizeY, 3, "B"), "Back")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "B", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "B"), "Back Left Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "B", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "B"), "Back Right Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "B", 0, 1), CPUFP.getPegQuat(SizeX, SizeY, 3, "B"), "Back Top Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "B", 0, -1), CPUFP.getPegQuat(SizeX, SizeY, 3, "B"), "Back Bottom Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "L"), CPUFP.getPegQuat(SizeX, SizeY, 3, "L"), "Left")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "L", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "L"), "Left Left Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "L", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "L"), "Left Right Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "L", 0, 1), CPUFP.getPegQuat(SizeX, SizeY, 3, "L"), "Left Top Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "L", 0, -1), CPUFP.getPegQuat(SizeX, SizeY, 3, "L"), "Left Bottom Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "R"), CPUFP.getPegQuat(SizeX, SizeY, 3, "R"), "Right")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "R", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "R"), "Right Left Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "R", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "R"), "Right Right Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "R", 0, 1), CPUFP.getPegQuat(SizeX, SizeY, 3, "R"), "Right Top Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "R", 0, -1), CPUFP.getPegQuat(SizeX, SizeY, 3, "R"), "Rigt Bottom Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "T"), CPUFP.getPegQuat(SizeX, SizeY, 3, "T"), "Top")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "T", 1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "T"), "Top Left Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "T", -1, 0), CPUFP.getPegQuat(SizeX, SizeY, 3, "T"), "Top Right Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "T", 0, 1), CPUFP.getPegQuat(SizeX, SizeY, 3, "T"), "Top Front Side")
                           .WithInput(CPUFP.getPegPos(SizeX, SizeY, 3, "T", 0, -1), CPUFP.getPegQuat(SizeX, SizeY, 3, "T"), "Top Back Side");

            ComponentRegistry.CreateNew <Empty>("Custom Builder TestOS3D", " Vertical Offset Test", Testos3D);
        }