From 7c36495c57a6d65dc3a6513dbab42a54fa72f8b8 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Thu, 20 Apr 2023 23:10:58 +0900 Subject: [PATCH] fix: vmemu not reading bios due to changes for BASIC not being ported --- .gitignore | 1 + buildapp/instructions.md | 4 ++++ tsvm_core/src/net/torvald/tsvm/VMSetupBroker.kt | 2 +- tsvm_executable/src/net/torvald/tsvm/VMEmuExecutable.kt | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fd6610f..2065fce 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,4 @@ tsvmman.pdf assets/disk0/home/basic/* assets/disk0/movtestimg/*.jpg assets/disk0/*.mov +assets/diskMediabin/* diff --git a/buildapp/instructions.md b/buildapp/instructions.md index f13a095..44a6843 100644 --- a/buildapp/instructions.md +++ b/buildapp/instructions.md @@ -56,6 +56,10 @@ Terrarum.*.app Hide the `.jar` within the subdirectory; users will think this file is the main executable and will try to execute it using whatever JVM they may (or may not) have. +#### Some Notes + +- Windows EXE creation is not there yet. Maybe use one of [these?](https://sourceforge.net/projects/batch-compiler/) + ### Notes to Terrarum Programmers By self-containing everything in one file, it is not possible to modify the base game easily. Modloading scheme must be extended to load from mutable directory such as `%APPDATA%/Terrarum/mods`. diff --git a/tsvm_core/src/net/torvald/tsvm/VMSetupBroker.kt b/tsvm_core/src/net/torvald/tsvm/VMSetupBroker.kt index 7c53ffb..2b361e5 100644 --- a/tsvm_core/src/net/torvald/tsvm/VMSetupBroker.kt +++ b/tsvm_core/src/net/torvald/tsvm/VMSetupBroker.kt @@ -45,7 +45,7 @@ object VMSetupBroker { vmRunners[vm.id] = VMRunnerFactory(vm.assetsDir, vm, "js") coroutineJobs[vm.id] = GlobalScope.launch { try { - vmRunners[vm.id]?.executeCommand(vm.roms[0]!!.readAll()) + vmRunners[vm.id]?.executeCommand(vm.roms[0].readAll()) } catch (e: Throwable) { whatToDoOnVmException(e) diff --git a/tsvm_executable/src/net/torvald/tsvm/VMEmuExecutable.kt b/tsvm_executable/src/net/torvald/tsvm/VMEmuExecutable.kt index 3ebb52a..fbbcd9a 100644 --- a/tsvm_executable/src/net/torvald/tsvm/VMEmuExecutable.kt +++ b/tsvm_executable/src/net/torvald/tsvm/VMEmuExecutable.kt @@ -17,6 +17,7 @@ import net.torvald.terrarum.utils.JsonFetcher import net.torvald.tsvm.VMEmuExecutableWrapper.Companion.FONT import net.torvald.tsvm.VMEmuExecutableWrapper.Companion.SQTEX import net.torvald.tsvm.peripheral.* +import java.io.File import kotlin.system.exitProcess class VMEmuExecutableWrapper(val windowWidth: Int, val windowHeight: Int, var panelsX: Int, var panelsY: Int, val diskPathRoot: String) : ApplicationAdapter() { @@ -580,7 +581,7 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX: val assetsDir = json.getString("assetsdir") val ramsize = json.getLong("ramsize") val cardslots = json.getInt("cardslots") - val roms = json.get("roms").iterator().map { VMProgramRom(it.asString()) }.toTypedArray() + val roms = json.get("roms").iterator().map { VMProgramRom(File(it.asString())) }.toTypedArray() val vm = VM(assetsDir, ramsize, TheRealWorld(), roms, cardslots, watchdogs)