mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
clustered tevd integration wip
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user