clustered tevd integration wip

This commit is contained in:
minjaesong
2023-06-15 18:55:38 +09:00
parent 17a9fa8ab7
commit 445c1a873f
3 changed files with 17 additions and 3 deletions

View File

@@ -79,8 +79,9 @@ let repaint = function() {
if (cy <= termH) {
if (cx >= 0 && cx < termW) {
con.move(cy, cx);
if (char != 10 && char != 13)
if (char != 10 && char != 13) {
con.addch(char);con.curs_right();
}
}
cx += 1;
}

View File

@@ -155,7 +155,7 @@ class TevdDiskDrive(private val vm: VM, private val driveNum: Int, theTevdPath:
file.pwrite(writeBuffer, 0, writeBuffer.size, filesize)
}
else if (writeMode)
file.writeBytes(writeBuffer)
file.overwrite(writeBuffer)
writeMode = false
appendMode = false
@@ -167,9 +167,10 @@ class TevdDiskDrive(private val vm: VM, private val driveNum: Int, theTevdPath:
val inputData = if (inputData.size != BLOCK_SIZE) ByteArray(BLOCK_SIZE) { if (it < inputData.size) inputData[it] else 0 }
else inputData
file.writeBytes(inputData)
DOM.writeBoot(inputData)
fileOpenMode = -1
fileOpen = false
}
else {
val inputString = inputData.trimNull().toString(VM.CHARSET)

View File

@@ -7,6 +7,7 @@ import net.torvald.reflection.forceInvoke
import net.torvald.terrarum.modulecomputers.virtualcomputer.tvd.DiskSkimmer.Companion.read
import net.torvald.terrarum.modulecomputers.virtualcomputer.tvd.archivers.ClusteredFormatDOM
import net.torvald.terrarum.modulecomputers.virtualcomputer.tvd.archivers.seekToCluster
import net.torvald.terrarum.modulecomputers.virtualcomputer.tvd.toHex
import net.torvald.terrarum.modulecomputers.virtualcomputer.tvd.toUint
import net.torvald.tsvm.VMEmuExecutableWrapper.Companion.FONT
import net.torvald.tsvm.peripheral.TevdDiskDrive
@@ -24,6 +25,15 @@ class TevdMenu(parent: VMEmuExecutable, x: Int, y: Int, w: Int, h: Int) : EmuMen
}
override fun hide() {
val dev = parent.currentlyPersistentVM?.vm?.getIO()?.blockTransferPorts?.getOrNull(cardIndex ?: -1)?.recipient
if (dev?.javaClass?.simpleName == "TevdDiskDrive") {
val dev = dev as TevdDiskDrive
val DOM = dev.extortField<ClusteredFormatDOM>("DOM")!!
DOM.forceInvoke<Unit>("bbbb", arrayOf("false"))
}
}
override fun update() {
@@ -57,6 +67,8 @@ class TevdMenu(parent: VMEmuExecutable, x: Int, y: Int, w: Int, h: Int) : EmuMen
val DOM = dev.extortField<ClusteredFormatDOM>("DOM")!!
val ARCHIVE = DOM.extortField<RandomAccessFile>("ARCHIVE")!!
DOM.forceInvoke<Unit>("bbbb", arrayOf("true"))
setupHook(dev, batch)
batch.inUse {