graphics: preventing cursorxy(32,80) from scrolling the screen

This commit is contained in:
minjaesong
2021-01-29 13:43:45 +09:00
parent 91fdc7ec99
commit c73a725466
7 changed files with 132 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ public class AppLoader {
//VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{BasicBios.INSTANCE, BasicRom.INSTANCE});
//VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{OEMBios.INSTANCE, BasicRom.INSTANCE});
VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{GenericBios.INSTANCE});
VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{QuickBios.INSTANCE});
//VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{TBASRelBios.INSTANCE});
new LwjglApplication(new VMGUI(vm, appConfig), appConfig);
}

View File

@@ -123,7 +123,7 @@ open class GraphicsAdapter(val vm: VM, val config: AdapterConfig, val sgr: Super
var newx = x
var newy = y
if (newx >= TEXT_COLS) {
if (newx > TEXT_COLS) {
newx = 0
newy += 1
}

View File

@@ -39,7 +39,7 @@ class TTY(val vm: VM) : GlassTty(TEXT_ROWS, TEXT_COLS), PeriBase {
var newx = x
var newy = y
if (newx >= TEXT_COLS) {
if (newx > TEXT_COLS) {
newx = 0
newy += 1
}

View File

@@ -30,6 +30,25 @@ object GenericBios : VMProgramRom {
override fun get(addr: Int): Byte = contents[addr]
}
object QuickBios : VMProgramRom {
private val contents: ByteArray
init {
val bytes = File("./assets/bios/quick.js").readBytes()
contents = bytes.sliceArray(0 until minOf(65536, bytes.size))
}
override fun readAll(): String {
// check if bios is compressed in gzip
return if (contents.startsWith(GZIP_HEADER))
CompressorDelegate.decomp(contents).toString(VM.CHARSET)
else
contents.toString(VM.CHARSET)
}
override fun get(addr: Int): Byte = contents[addr]
}
object BasicBios : VMProgramRom {
private val contents: ByteArray