fixed bad tab impl on terminal

This commit is contained in:
minjaesong
2021-05-05 00:37:36 +09:00
parent be7dd20f14
commit 1b98a19de7
3 changed files with 8 additions and 7 deletions

View File

@@ -23,24 +23,24 @@ public class AppLoader {
appConfig.resizable = false;
appConfig.title = appTitle;
appConfig.forceExit = true;
appConfig.width = 720;
appConfig.height = 480;
appConfig.width = 560;//720;
appConfig.height = 448;//480;
// val vm = VM(64.kB(), TheRealWorld(), arrayOf(GenericBios))
//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[]{TandemBios.INSTANCE, BasicRom.INSTANCE});
//VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{TandemBios.INSTANCE, BasicRom.INSTANCE});
// uncomment to target the TerranBASIC runner
//VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{TBASRelBios.INSTANCE});
VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{TBASRelBios.INSTANCE});
EmulInstance reference = new EmulInstance(appConfig, vm, "net.torvald.tsvm.peripheral.ReferenceGraphicsAdapter", "assets/disk0");
EmulInstance reference2 = new EmulInstance(appConfig, vm, "net.torvald.tsvm.peripheral.ReferenceLikeLCD", "assets/disk0");
EmulInstance term = new EmulInstance(appConfig, vm, "net.torvald.tsvm.peripheral.TexticsAdapter", "assets/disk0");
EmulInstance portable = new EmulInstance(appConfig, vm, "net.torvald.tsvm.peripheral.CharacterLCDdisplay", "assets/disk0");
new LwjglApplication(new VMGUI(portable), appConfig);
new LwjglApplication(new VMGUI(reference), appConfig);
}
public static ShaderProgram loadShaderFromFile(String vert, String frag) {

View File

@@ -107,7 +107,7 @@ class VMGUI(val loaderInfo: EmulInstance) : ApplicationAdapter() {
// update window title with contents of the 'built-in status display'
val msg = (1024L until 1048L).map { cp437toUni[vm.getIO().mmio_read(it)!!.toInt().and(255)] }.joinToString("").trim()
Gdx.graphics.setTitle("[$msg] $EMDASH F: ${Gdx.graphics.framesPerSecond}")
Gdx.graphics.setTitle("$msg $EMDASH F: ${Gdx.graphics.framesPerSecond}")
if (usememvwr) memvwr.update()

View File

@@ -56,6 +56,7 @@ open class GraphicsAdapter(val vm: VM, val config: AdapterConfig, val sgr: Super
protected val TTY_FORE_DEFAULT = config.ttyDefaultFore
protected val TTY_BACK_DEFAULT = config.ttyDefaultBack
protected val theme = config.theme
protected val TAB_SIZE = 8
internal val framebuffer = Pixmap(WIDTH, HEIGHT, Pixmap.Format.Alpha)
protected var rendertex = Texture(1, 1, Pixmap.Format.RGBA8888)
@@ -465,7 +466,7 @@ open class GraphicsAdapter(val vm: VM, val config: AdapterConfig, val sgr: Super
override fun insertTab() {
val (x, y) = getCursorPos()
setCursorPos((x / 8) + 8, y)
setCursorPos((x / TAB_SIZE + 1) * TAB_SIZE, y)
}
override fun crlf() {