From b7e3b1d683f4846ffd7775d25a4746aea405f245 Mon Sep 17 00:00:00 2001 From: LekKit <50500857+LekKit@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:30:41 +0200 Subject: [PATCH] scev: Fix librvvm API usage --- src/main/java/lekkit/scev/gui/MachineGui.java | 2 +- src/main/java/lekkit/scev/inventory/InventoryLaptop.java | 2 +- src/main/java/lekkit/scev/server/MachineManager.java | 4 ++-- src/main/java/lekkit/scev/server/MachineState.java | 4 ++-- .../java/lekkit/scev/tileentity/TileEntityComputerCase.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/lekkit/scev/gui/MachineGui.java b/src/main/java/lekkit/scev/gui/MachineGui.java index 4ad94d1..7e79292 100644 --- a/src/main/java/lekkit/scev/gui/MachineGui.java +++ b/src/main/java/lekkit/scev/gui/MachineGui.java @@ -31,7 +31,7 @@ public void drawScreen(int mouse_x, int mouse_y, float par3) { if (texID == 0) { RVVMNative.loadLib("/usr/lib/librvvm.so"); - machine = new RVVMMachine(256, 1, true); + machine = new RVVMMachine(256, 1, "rv64"); new PLIC(machine); new PCIBus(machine); new I2CBus(machine); diff --git a/src/main/java/lekkit/scev/inventory/InventoryLaptop.java b/src/main/java/lekkit/scev/inventory/InventoryLaptop.java index e3b0ca6..206e2cf 100644 --- a/src/main/java/lekkit/scev/inventory/InventoryLaptop.java +++ b/src/main/java/lekkit/scev/inventory/InventoryLaptop.java @@ -60,7 +60,7 @@ protected MachineState buildMachine(UUID uuid) { return null; } - MachineState state = MachineManager.createMachineState(uuid, mem_mb, 1, true); + MachineState state = MachineManager.createMachineState(uuid, mem_mb, 1, "rv64"); if (state == null) { return null; } diff --git a/src/main/java/lekkit/scev/server/MachineManager.java b/src/main/java/lekkit/scev/server/MachineManager.java index aeb190f..4bb708d 100644 --- a/src/main/java/lekkit/scev/server/MachineManager.java +++ b/src/main/java/lekkit/scev/server/MachineManager.java @@ -6,7 +6,7 @@ public class MachineManager { private static HashMap machines = new HashMap(); - public synchronized static MachineState createMachineState(UUID machineUUID, long mem_mb, int smp, boolean rv64) { + public synchronized static MachineState createMachineState(UUID machineUUID, long mem_mb, int smp, String isa) { MachineState state = getMachineState(machineUUID); if (state != null) { System.out.println("Machine already exists!"); @@ -14,7 +14,7 @@ public synchronized static MachineState createMachineState(UUID machineUUID, lon } state = new MachineState(machineUUID); - if (state.create(mem_mb, smp, rv64)) { + if (state.create(mem_mb, smp, isa)) { machines.put(machineUUID, state); return state; diff --git a/src/main/java/lekkit/scev/server/MachineState.java b/src/main/java/lekkit/scev/server/MachineState.java index ea3dad7..aae4d18 100644 --- a/src/main/java/lekkit/scev/server/MachineState.java +++ b/src/main/java/lekkit/scev/server/MachineState.java @@ -27,10 +27,10 @@ public MachineState(UUID machineUUID) { uuid = machineUUID; } - public boolean create(long mem_mb, int smp, boolean rv64) { + public boolean create(long mem_mb, int smp, String isa) { RVVMNative.loadLib("/usr/lib/librvvm.so"); - machine = new RVVMMachine(mem_mb, smp, rv64); + machine = new RVVMMachine(mem_mb, smp, isa); if (machine.isValid()) { machine.setOption(RVVMMachine.RVVM_OPT_HW_IMITATE, 1); diff --git a/src/main/java/lekkit/scev/tileentity/TileEntityComputerCase.java b/src/main/java/lekkit/scev/tileentity/TileEntityComputerCase.java index 9b38a78..4067f6e 100644 --- a/src/main/java/lekkit/scev/tileentity/TileEntityComputerCase.java +++ b/src/main/java/lekkit/scev/tileentity/TileEntityComputerCase.java @@ -55,7 +55,7 @@ protected MachineState buildMachine(UUID uuid) { return null; } - MachineState state = MachineManager.createMachineState(uuid, mem_mb, 1, true); + MachineState state = MachineManager.createMachineState(uuid, mem_mb, 1, "rv64"); if (state == null) { return null; }