commit 89c4face0f0a6aaf827bfd147e71446b77c1fc57
parent af6d2674ebb15b2df9823c5b0206c6907253cf57
Author: evenfri <evenfri256@gmail.com>
Date: Sun, 16 Aug 2026 02:24:54 +0800
add executing, lamps, relayout
Diffstat:
8 files changed, 364 insertions(+), 130 deletions(-)
diff --git a/computer_interface.cs b/computer_interface.cs
@@ -1,42 +1,84 @@
using Godot;
using System;
+using static emulator;
public partial class computer_interface : Node {
[Export] public Button[] button_bits;
[Export] public Button[] button_memory_bits;
[Export] public Sprite2D[] lamp_current_instruction;
+[Export] public Sprite2D[] lamp_addr;
[Export] public Color lamp_on = Colors.Red;
[Export] public Color lamp_off = Colors.DarkGray;
+[Export] public Button button_execute;
[Export] public Button button_write_byte;
[Export] public Button button_jmp_memory;
[Export] public Button button_examine;
-emulator emu;
+IntPtr _emu;
ushort curr_addr;
byte curr_instr;
+bool worked = false;
public override void _Ready() {
- emu = new emulator();
+ _emu = emu_create();
+
+ button_execute.Pressed += execute;
button_write_byte.Pressed += write_byte;
button_jmp_memory.Pressed += jmp_memory;
button_examine.Pressed += examine;
+
+ for (int i = 0; i < 16; i++) {
+ button_memory_bits[i].Pressed += memory_pressed;
+ }
+
+ update_lamps();
+}
- update_lamps(curr_instr);
+public override void _Notification(int what) {
+ if (what == NotificationPredelete) {
+ emu_destroy(_emu);
+ }
}
public override void _Process(double delta) {
+ if (!worked) return;
+ int r = emu_step(_emu);
+ if (r > 0) {
+ worked = false;
+ }
+
+ GD.Print($"pc: {emu_get_pc(_emu)}");
+}
+
+void update_lamps() {
+ update_data_lamps(curr_instr);
+ update_addr_lamps(curr_addr);
+}
+
+void memory_pressed() {
+ byte b0 = assem_byte(button_memory_bits, 0);
+ byte b1 = assem_byte(button_memory_bits, 8);
+ curr_addr = (ushort)((b1 << 8) | b0);
+
+ update_lamps();
+}
+
+void execute() {
+ worked = true;
+
+ emu_set_pc(_emu, 0);
}
void write_byte() {
byte b = assem_byte(button_bits, 0);
curr_instr = b;
- emu.write_byte(b, curr_addr);
- update_lamps(b);
+ emu_mem_write(_emu, curr_addr, b);
curr_addr++;
+ update_lamps();
GD.Print($"write byte 0x{b:x2} by 0x{curr_addr:x4}");
}
@@ -52,19 +94,26 @@ void jmp_memory() {
}
void examine() {
- curr_instr = emu.read_byte(curr_addr);
- update_lamps(curr_instr);
+ curr_instr = emu_mem_read(_emu, curr_addr);
+ update_lamps();
GD.Print($"read byte 0x{curr_instr:x2} by 0x{curr_addr:x4}");
}
-void update_lamps(byte value) {
+void update_data_lamps(byte value) {
for (int i = 0; i < 8 && i < lamp_current_instruction.Length; i++) {
bool is_bit_set = (value & (1 << i)) != 0;
lamp_current_instruction[i].SelfModulate = is_bit_set ? lamp_on : lamp_off;
}
}
+void update_addr_lamps(ushort value) {
+ for (int i = 0; i < 16 && i < lamp_addr.Length; i++) {
+ bool is_bit_set = (value & (1 << i)) != 0;
+ lamp_addr[i].SelfModulate = is_bit_set ? lamp_on : lamp_off;
+ }
+}
+
byte assem_byte(Button[] buttons, int offset) {
byte r = 0;
for (int i = 0; i < 8; i++) {
diff --git a/emulator.cs b/emulator.cs
@@ -1,13 +1,29 @@
-public class emulator {
+using System.Runtime.InteropServices;
+using System;
-byte[] memory = new byte[65536];
+public static class emulator {
-public void write_byte(byte b, ushort addr) {
- memory[addr] = b;
-}
+const string lib_name = "emulator/emu.so";
-public byte read_byte(ushort addr) {
- return memory[addr];
-}
+[DllImport(lib_name, CallingConvention = CallingConvention.Cdecl)]
+public static extern IntPtr emu_create();
+
+[DllImport(lib_name, CallingConvention = CallingConvention.Cdecl)]
+public static extern void emu_destroy(IntPtr emu);
+
+[DllImport(lib_name, CallingConvention = CallingConvention.Cdecl)]
+public static extern int emu_get_pc(IntPtr emu);
+
+[DllImport(lib_name, CallingConvention = CallingConvention.Cdecl)]
+public static extern void emu_set_pc(IntPtr emu, int pc);
+
+[DllImport(lib_name, CallingConvention = CallingConvention.Cdecl)]
+public static extern int emu_step(IntPtr emu);
+
+[DllImport(lib_name, CallingConvention = CallingConvention.Cdecl)]
+public static extern void emu_mem_write(IntPtr emu, int addr, byte val);
+
+[DllImport(lib_name, CallingConvention = CallingConvention.Cdecl)]
+public static extern byte emu_mem_read(IntPtr emu, int addr);
}
\ No newline at end of file
diff --git a/emulator/build.sh b/emulator/build.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+gcc -shared -fPIC -o emu.so main.c
diff --git a/emulator/emu.h b/emulator/emu.h
@@ -0,0 +1,18 @@
+#ifndef emu_h
+#define emu_h
+
+#include <stdint.h>
+
+#define EXPORT
+
+typedef struct emulator emulator;
+
+EXPORT emulator* emu_create(void);
+EXPORT void emu_destroy(emulator *e);
+EXPORT int emu_step(emulator *e);
+EXPORT void emu_mem_write(emulator *e, uint16_t addr, unsigned char val);
+EXPORT unsigned char emu_mem_read(emulator *e, uint16_t addr);
+EXPORT int emu_get_pc(emulator *e);
+EXPORT void emu_set_pc(emulator *e, int pc);
+
+#endif /* emu_h */
+\ No newline at end of file
diff --git a/emulator/emu.so b/emulator/emu.so
Binary files differ.
diff --git a/emulator/main.c b/emulator/main.c
@@ -0,0 +1,46 @@
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include "emu.h"
+
+#define op_hlt 0x00
+
+struct emulator {
+ unsigned char memory[65536];
+ int pc;
+};
+
+emulator* emu_create(void) {
+ emulator* e = malloc(sizeof(emulator));
+ memset(e, 0, sizeof(emulator));
+ return e;
+}
+
+void emu_destroy(emulator *e) { free(e); }
+
+int emu_get_pc(emulator *e) {
+ return e->pc;
+}
+
+void emu_set_pc(emulator *e, int pc) {
+ e->pc = pc;
+}
+
+int emu_step(emulator *e) {
+ unsigned int instr = e->memory[e->pc];
+
+ if (instr == op_hlt) {
+ return 1;
+ }
+
+ e->pc++;
+ return 0;
+}
+
+void emu_mem_write(emulator *e, uint16_t addr, unsigned char val) {
+ e->memory[addr] = val;
+}
+
+unsigned char emu_mem_read(emulator *e, uint16_t addr) {
+ return e->memory[addr];
+}
+\ No newline at end of file
diff --git a/main.tscn b/main.tscn
@@ -9,265 +9,365 @@
[node name="cam" type="Camera2D" parent="." unique_id=1611617563]
zoom = Vector2(1.5, 1.5)
-[node name="computer" type="Sprite2D" parent="." unique_id=1267147980 node_paths=PackedStringArray("button_bits", "button_memory_bits", "lamp_current_instruction", "button_write_byte", "button_jmp_memory", "button_examine")]
-position = Vector2(-352, -128)
+[node name="computer" type="Sprite2D" parent="." unique_id=1267147980 node_paths=PackedStringArray("button_bits", "button_memory_bits", "lamp_current_instruction", "lamp_addr", "button_execute", "button_write_byte", "button_jmp_memory", "button_examine")]
+position = Vector2(-355, -141)
texture = ExtResource("1_ig7tw")
centered = false
script = ExtResource("2_0xm2m")
-button_bits = [NodePath("data/bit-0"), NodePath("data/bit-1"), NodePath("data/bit-2"), NodePath("data/bit-3"), NodePath("data/bit-4"), NodePath("data/bit-5"), NodePath("data/bit-6"), NodePath("data/bit-7")]
-button_memory_bits = [NodePath("memory/bit-0"), NodePath("memory/bit-1"), NodePath("memory/bit-2"), NodePath("memory/bit-3"), NodePath("memory/bit-4"), NodePath("memory/bit-5"), NodePath("memory/bit-6"), NodePath("memory/bit-7"), NodePath("memory/bit-8"), NodePath("memory/bit-9"), NodePath("memory/bit-10"), NodePath("memory/bit-11"), NodePath("memory/bit-12"), NodePath("memory/bit-13"), NodePath("memory/bit-14"), NodePath("memory/bit-15")]
-lamp_current_instruction = [NodePath("curr_data/lamp"), NodePath("curr_data/lamp2"), NodePath("curr_data/lamp3"), NodePath("curr_data/lamp4"), NodePath("curr_data/lamp5"), NodePath("curr_data/lamp6"), NodePath("curr_data/lamp7"), NodePath("curr_data/lamp8")]
-button_write_byte = NodePath("data/write")
-button_jmp_memory = NodePath("memory/jmp")
-button_examine = NodePath("curr_data/examine")
-
-[node name="data" type="Node2D" parent="computer" unique_id=969809626]
-position = Vector2(257, 212)
-
-[node name="bit-0" type="CheckButton" parent="computer/data" unique_id=928947275]
+button_bits = [NodePath("data/buttons/bit-0"), NodePath("data/buttons/bit-1"), NodePath("data/buttons/bit-2"), NodePath("data/buttons/bit-3"), NodePath("data/buttons/bit-4"), NodePath("data/buttons/bit-5"), NodePath("data/buttons/bit-6"), NodePath("data/buttons/bit-7")]
+button_memory_bits = [NodePath("addr/buttons/bit-0"), NodePath("addr/buttons/bit-1"), NodePath("addr/buttons/bit-2"), NodePath("addr/buttons/bit-3"), NodePath("addr/buttons/bit-4"), NodePath("addr/buttons/bit-5"), NodePath("addr/buttons/bit-6"), NodePath("addr/buttons/bit-7"), NodePath("addr/buttons/bit-8"), NodePath("addr/buttons/bit-9"), NodePath("addr/buttons/bit-10"), NodePath("addr/buttons/bit-11"), NodePath("addr/buttons/bit-12"), NodePath("addr/buttons/bit-13"), NodePath("addr/buttons/bit-14"), NodePath("addr/buttons/bit-15")]
+lamp_current_instruction = [NodePath("data/lamps/lamp"), NodePath("data/lamps/lamp2"), NodePath("data/lamps/lamp3"), NodePath("data/lamps/lamp4"), NodePath("data/lamps/lamp5"), NodePath("data/lamps/lamp6"), NodePath("data/lamps/lamp7"), NodePath("data/lamps/lamp8")]
+lamp_addr = [NodePath("addr/lamps/lamp"), NodePath("addr/lamps/lamp2"), NodePath("addr/lamps/lamp3"), NodePath("addr/lamps/lamp4"), NodePath("addr/lamps/lamp5"), NodePath("addr/lamps/lamp6"), NodePath("addr/lamps/lamp7"), NodePath("addr/lamps/lamp8"), NodePath("addr/lamps/lamp9"), NodePath("addr/lamps/lamp10"), NodePath("addr/lamps/lamp11"), NodePath("addr/lamps/lamp12"), NodePath("addr/lamps/lamp13"), NodePath("addr/lamps/lamp14"), NodePath("addr/lamps/lamp15"), NodePath("addr/lamps/lamp16")]
+button_execute = NodePath("execute")
+button_write_byte = NodePath("data/buttons/write")
+button_jmp_memory = NodePath("addr/buttons/jmp")
+button_examine = NodePath("data/lamps/examine")
+
+[node name="data" type="Node2D" parent="computer" unique_id=750574758]
+position = Vector2(352, 173)
+
+[node name="buttons" type="Node2D" parent="computer/data" unique_id=969809626]
+position = Vector2(-95, 39)
+
+[node name="bit-0" type="CheckButton" parent="computer/data/buttons" unique_id=928947275]
offset_right = 44.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-1" type="CheckButton" parent="computer/data" unique_id=1497880795]
+[node name="bit-1" type="CheckButton" parent="computer/data/buttons" unique_id=1497880795]
offset_left = 24.0
offset_right = 68.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-2" type="CheckButton" parent="computer/data" unique_id=1937568649]
+[node name="bit-2" type="CheckButton" parent="computer/data/buttons" unique_id=1937568649]
offset_left = 48.0
offset_right = 92.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-3" type="CheckButton" parent="computer/data" unique_id=789265495]
+[node name="bit-3" type="CheckButton" parent="computer/data/buttons" unique_id=789265495]
offset_left = 72.0
offset_right = 116.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-4" type="CheckButton" parent="computer/data" unique_id=833821743]
+[node name="bit-4" type="CheckButton" parent="computer/data/buttons" unique_id=833821743]
offset_left = 96.0
offset_right = 140.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-5" type="CheckButton" parent="computer/data" unique_id=1557534661]
+[node name="bit-5" type="CheckButton" parent="computer/data/buttons" unique_id=1557534661]
offset_left = 120.0
offset_right = 164.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-6" type="CheckButton" parent="computer/data" unique_id=1615780657]
+[node name="bit-6" type="CheckButton" parent="computer/data/buttons" unique_id=1615780657]
offset_left = 144.0
offset_right = 188.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-7" type="CheckButton" parent="computer/data" unique_id=787642520]
+[node name="bit-7" type="CheckButton" parent="computer/data/buttons" unique_id=787642520]
offset_left = 168.0
offset_right = 212.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="write" type="Button" parent="computer/data" unique_id=5392396]
+[node name="write" type="Button" parent="computer/data/buttons" unique_id=5392396]
offset_left = 192.0
-offset_top = -37.0
-offset_right = 222.0
-offset_bottom = -7.0
-
-[node name="text" type="Label" parent="computer/data" unique_id=917668259]
-offset_left = 223.0
-offset_top = -37.0
-offset_right = 263.0
-offset_bottom = -14.0
+offset_top = -42.0
+offset_right = 208.0
+offset_bottom = -26.0
+
+[node name="text" type="Label" parent="computer/data/buttons/write" unique_id=917668259]
+layout_mode = 0
+offset_left = 18.0
+offset_top = -6.0
+offset_right = 58.0
+offset_bottom = 17.0
text = "write"
-[node name="text2" type="Label" parent="computer/data" unique_id=1336008430]
-offset_left = -33.0
-offset_top = -37.0
-offset_right = 2.0
-offset_bottom = -14.0
+[node name="lamps" type="Node2D" parent="computer/data" unique_id=1993962898]
+position = Vector2(0, -22)
+
+[node name="lamp" type="Sprite2D" parent="computer/data/lamps" unique_id=691408274]
+position = Vector2(-84, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp2" type="Sprite2D" parent="computer/data/lamps" unique_id=1393453519]
+position = Vector2(-60, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp3" type="Sprite2D" parent="computer/data/lamps" unique_id=1888166272]
+position = Vector2(-36, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp4" type="Sprite2D" parent="computer/data/lamps" unique_id=1421031255]
+position = Vector2(-11, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp5" type="Sprite2D" parent="computer/data/lamps" unique_id=1492744603]
+position = Vector2(12, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp6" type="Sprite2D" parent="computer/data/lamps" unique_id=605179344]
+position = Vector2(37, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp7" type="Sprite2D" parent="computer/data/lamps" unique_id=1033917715]
+position = Vector2(61, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp8" type="Sprite2D" parent="computer/data/lamps" unique_id=2000831074]
+position = Vector2(85, 7)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="examine" type="Button" parent="computer/data/lamps" unique_id=1814681530]
+offset_left = 97.0
+offset_right = 113.0
+offset_bottom = 16.0
+
+[node name="text" type="Label" parent="computer/data/lamps/examine" unique_id=1029160794]
+layout_mode = 0
+offset_left = 18.0
+offset_top = -5.0
+offset_right = 85.0
+offset_bottom = 18.0
+text = "examine"
+
+[node name="text" type="Label" parent="computer/data" unique_id=1336008430]
+offset_left = -138.0
+offset_top = -13.0
+offset_right = -103.0
+offset_bottom = 10.0
text = "data"
-[node name="memory" type="Node2D" parent="computer" unique_id=733435300]
-position = Vector2(160, 175)
+[node name="addr" type="Node2D" parent="computer" unique_id=1662363803]
+position = Vector2(352, 104)
-[node name="bit-0" type="CheckButton" parent="computer/memory" unique_id=325488317]
+[node name="buttons" type="Node2D" parent="computer/addr" unique_id=733435300]
+position = Vector2(-189, 37)
+
+[node name="bit-0" type="CheckButton" parent="computer/addr/buttons" unique_id=325488317]
offset_right = 44.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-1" type="CheckButton" parent="computer/memory" unique_id=1336488479]
+[node name="bit-1" type="CheckButton" parent="computer/addr/buttons" unique_id=1336488479]
offset_left = 24.0
offset_right = 68.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-2" type="CheckButton" parent="computer/memory" unique_id=695745454]
+[node name="bit-2" type="CheckButton" parent="computer/addr/buttons" unique_id=695745454]
offset_left = 48.0
offset_right = 92.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-3" type="CheckButton" parent="computer/memory" unique_id=1690503583]
+[node name="bit-3" type="CheckButton" parent="computer/addr/buttons" unique_id=1690503583]
offset_left = 72.0
offset_right = 116.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-4" type="CheckButton" parent="computer/memory" unique_id=760018466]
+[node name="bit-4" type="CheckButton" parent="computer/addr/buttons" unique_id=760018466]
offset_left = 96.0
offset_right = 140.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-5" type="CheckButton" parent="computer/memory" unique_id=1404060575]
+[node name="bit-5" type="CheckButton" parent="computer/addr/buttons" unique_id=1404060575]
offset_left = 120.0
offset_right = 164.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-6" type="CheckButton" parent="computer/memory" unique_id=313744853]
+[node name="bit-6" type="CheckButton" parent="computer/addr/buttons" unique_id=313744853]
offset_left = 144.0
offset_right = 188.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-7" type="CheckButton" parent="computer/memory" unique_id=210349797]
+[node name="bit-7" type="CheckButton" parent="computer/addr/buttons" unique_id=210349797]
offset_left = 168.0
offset_right = 212.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-8" type="CheckButton" parent="computer/memory" unique_id=1283918352]
+[node name="bit-8" type="CheckButton" parent="computer/addr/buttons" unique_id=1283918352]
offset_left = 192.0
offset_right = 236.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-9" type="CheckButton" parent="computer/memory" unique_id=1421105136]
+[node name="bit-9" type="CheckButton" parent="computer/addr/buttons" unique_id=1421105136]
offset_left = 216.0
offset_right = 260.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-10" type="CheckButton" parent="computer/memory" unique_id=2076865949]
+[node name="bit-10" type="CheckButton" parent="computer/addr/buttons" unique_id=2076865949]
offset_left = 240.0
offset_right = 284.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-11" type="CheckButton" parent="computer/memory" unique_id=1943659506]
+[node name="bit-11" type="CheckButton" parent="computer/addr/buttons" unique_id=1943659506]
offset_left = 264.0
offset_right = 308.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-12" type="CheckButton" parent="computer/memory" unique_id=2099906965]
+[node name="bit-12" type="CheckButton" parent="computer/addr/buttons" unique_id=2099906965]
offset_left = 288.0
offset_right = 332.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-13" type="CheckButton" parent="computer/memory" unique_id=70508066]
+[node name="bit-13" type="CheckButton" parent="computer/addr/buttons" unique_id=70508066]
offset_left = 312.0
offset_right = 356.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-14" type="CheckButton" parent="computer/memory" unique_id=862879246]
+[node name="bit-14" type="CheckButton" parent="computer/addr/buttons" unique_id=862879246]
offset_left = 336.0
offset_right = 380.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="bit-15" type="CheckButton" parent="computer/memory" unique_id=2129421308]
+[node name="bit-15" type="CheckButton" parent="computer/addr/buttons" unique_id=2129421308]
offset_left = 360.0
offset_right = 404.0
offset_bottom = 24.0
rotation = 4.712389
-[node name="jmp" type="Button" parent="computer/memory" unique_id=137966172]
+[node name="jmp" type="Button" parent="computer/addr/buttons" unique_id=137966172]
offset_left = 384.0
-offset_top = -37.0
-offset_right = 414.0
-offset_bottom = -7.0
-
-[node name="text" type="Label" parent="computer/memory" unique_id=663994812]
-offset_left = 414.0
-offset_top = -37.0
-offset_right = 454.0
-offset_bottom = -14.0
+offset_top = 29.0
+offset_right = 400.0
+offset_bottom = 45.0
+
+[node name="text" type="Label" parent="computer/addr/buttons/jmp" unique_id=663994812]
+layout_mode = 0
+offset_left = 18.0
+offset_top = -6.0
+offset_right = 58.0
+offset_bottom = 17.0
text = "jump"
-[node name="text2" type="Label" parent="computer/memory" unique_id=783362460]
-offset_left = -58.0
-offset_top = -37.0
-offset_right = 3.0
-offset_bottom = -14.0
-text = "address"
+[node name="lamps" type="Node2D" parent="computer/addr" unique_id=1734725300]
+position = Vector2(-78, -22)
-[node name="curr_data" type="Node2D" parent="computer" unique_id=1993962898]
-position = Vector2(352, 71)
+[node name="lamp" type="Sprite2D" parent="computer/addr/lamps" unique_id=301037469]
+position = Vector2(-99, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
-[node name="lamp" type="Sprite2D" parent="computer/curr_data" unique_id=691408274]
-position = Vector2(-112, 6)
-scale = Vector2(0.5, 0.5)
+[node name="lamp2" type="Sprite2D" parent="computer/addr/lamps" unique_id=2063842413]
+position = Vector2(-75, 8)
+scale = Vector2(0.25, 0.25)
texture = ExtResource("3_h2yge")
-[node name="lamp2" type="Sprite2D" parent="computer/curr_data" unique_id=1393453519]
-position = Vector2(-80, 6)
-scale = Vector2(0.5, 0.5)
+[node name="lamp3" type="Sprite2D" parent="computer/addr/lamps" unique_id=1509287834]
+position = Vector2(-51, 8)
+scale = Vector2(0.25, 0.25)
texture = ExtResource("3_h2yge")
-[node name="lamp3" type="Sprite2D" parent="computer/curr_data" unique_id=1888166272]
-position = Vector2(-48, 6)
-scale = Vector2(0.5, 0.5)
+[node name="lamp4" type="Sprite2D" parent="computer/addr/lamps" unique_id=446232673]
+position = Vector2(-27, 8)
+scale = Vector2(0.25, 0.25)
texture = ExtResource("3_h2yge")
-[node name="lamp4" type="Sprite2D" parent="computer/curr_data" unique_id=1421031255]
-position = Vector2(-16, 6)
-scale = Vector2(0.5, 0.5)
+[node name="lamp5" type="Sprite2D" parent="computer/addr/lamps" unique_id=1761830216]
+position = Vector2(-3, 8)
+scale = Vector2(0.25, 0.25)
texture = ExtResource("3_h2yge")
-[node name="lamp5" type="Sprite2D" parent="computer/curr_data" unique_id=1492744603]
-position = Vector2(16, 6)
-scale = Vector2(0.5, 0.5)
+[node name="lamp6" type="Sprite2D" parent="computer/addr/lamps" unique_id=95336119]
+position = Vector2(21, 8)
+scale = Vector2(0.25, 0.25)
texture = ExtResource("3_h2yge")
-[node name="lamp6" type="Sprite2D" parent="computer/curr_data" unique_id=605179344]
-position = Vector2(48, 6)
-scale = Vector2(0.5, 0.5)
+[node name="lamp7" type="Sprite2D" parent="computer/addr/lamps" unique_id=1368353718]
+position = Vector2(45, 8)
+scale = Vector2(0.25, 0.25)
texture = ExtResource("3_h2yge")
-[node name="lamp7" type="Sprite2D" parent="computer/curr_data" unique_id=1033917715]
-position = Vector2(80, 6)
-scale = Vector2(0.5, 0.5)
+[node name="lamp8" type="Sprite2D" parent="computer/addr/lamps" unique_id=1370430321]
+position = Vector2(69, 8)
+scale = Vector2(0.25, 0.25)
texture = ExtResource("3_h2yge")
-[node name="lamp8" type="Sprite2D" parent="computer/curr_data" unique_id=2000831074]
-position = Vector2(112, 6)
-scale = Vector2(0.5, 0.5)
+[node name="lamp9" type="Sprite2D" parent="computer/addr/lamps" unique_id=1284145815]
+position = Vector2(93, 8)
+scale = Vector2(0.25, 0.25)
texture = ExtResource("3_h2yge")
-[node name="examine" type="Button" parent="computer/curr_data" unique_id=1814681530]
-offset_left = 128.0
-offset_top = -10.0
-offset_right = 160.0
-offset_bottom = 22.0
-
-[node name="text" type="Label" parent="computer/curr_data" unique_id=1029160794]
-offset_left = 160.0
-offset_top = -10.0
-offset_right = 227.0
-offset_bottom = 13.0
-text = "examine"
+[node name="lamp10" type="Sprite2D" parent="computer/addr/lamps" unique_id=1138734365]
+position = Vector2(117, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
-[node name="text2" type="Label" parent="computer/curr_data" unique_id=424486015]
-offset_left = -163.0
-offset_top = -10.0
-offset_right = -128.0
-offset_bottom = 13.0
-text = "data"
+[node name="lamp11" type="Sprite2D" parent="computer/addr/lamps" unique_id=140769146]
+position = Vector2(141, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp12" type="Sprite2D" parent="computer/addr/lamps" unique_id=1864714391]
+position = Vector2(165, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp13" type="Sprite2D" parent="computer/addr/lamps" unique_id=339122357]
+position = Vector2(189, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp14" type="Sprite2D" parent="computer/addr/lamps" unique_id=307082814]
+position = Vector2(213, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp15" type="Sprite2D" parent="computer/addr/lamps" unique_id=2009264748]
+position = Vector2(237, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="lamp16" type="Sprite2D" parent="computer/addr/lamps" unique_id=1911411271]
+position = Vector2(261, 8)
+scale = Vector2(0.25, 0.25)
+texture = ExtResource("3_h2yge")
+
+[node name="text" type="Label" parent="computer/addr" unique_id=783362460]
+offset_left = -247.0
+offset_top = -15.0
+offset_right = -186.0
+offset_bottom = 8.0
+text = "address"
+
+[node name="execute" type="Button" parent="computer" unique_id=499234741]
+offset_left = 547.0
+offset_top = 151.0
+offset_right = 563.0
+offset_bottom = 167.0
+
+[node name="text" type="Label" parent="computer/execute" unique_id=548414139]
+layout_mode = 0
+offset_left = 18.0
+offset_top = -5.0
+offset_right = 85.0
+offset_bottom = 18.0
+text = "execute"
diff --git a/project.godot b/project.godot
@@ -12,7 +12,7 @@ config_version=5
config/name="old-pc-simulator"
run/main_scene="uid://ct47fh1ow17f"
-config/features=PackedStringArray("4.7", "Forward Plus")
+config/features=PackedStringArray("4.7", "C#", "Forward Plus")
config/icon="res://icon.svg"
[display]