diff --git a/.idea/artifacts/TSVM_Executable.xml b/.idea/artifacts/TSVM_Executable.xml index 056ff55..69863db 100644 --- a/.idea/artifacts/TSVM_Executable.xml +++ b/.idea/artifacts/TSVM_Executable.xml @@ -11,16 +11,13 @@ - - - @@ -28,7 +25,6 @@ - @@ -40,6 +36,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/com_badlogicgames_gdx_gdx_1_10_0.xml b/.idea/libraries/com_badlogicgames_gdx_gdx_1_10_0.xml new file mode 100644 index 0000000..7a8c660 --- /dev/null +++ b/.idea/libraries/com_badlogicgames_gdx_gdx_1_10_0.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/com_badlogicgames_gdx_gdx_backend_lwjgl3_1_10_0.xml b/.idea/libraries/com_badlogicgames_gdx_gdx_backend_lwjgl3_1_10_0.xml new file mode 100644 index 0000000..520d879 --- /dev/null +++ b/.idea/libraries/com_badlogicgames_gdx_gdx_backend_lwjgl3_1_10_0.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/com_badlogicgames_gdx_gdx_platform_1_10_0.xml b/.idea/libraries/com_badlogicgames_gdx_gdx_platform_1_10_0.xml new file mode 100644 index 0000000..db39a67 --- /dev/null +++ b/.idea/libraries/com_badlogicgames_gdx_gdx_platform_1_10_0.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 9c0199b..e0844bc 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/lib/gdx-1.10.0-javadoc.jar b/lib/gdx-1.10.0-javadoc.jar new file mode 100644 index 0000000..e371794 Binary files /dev/null and b/lib/gdx-1.10.0-javadoc.jar differ diff --git a/lib/gdx-1.10.0-sources.jar b/lib/gdx-1.10.0-sources.jar new file mode 100644 index 0000000..90f2677 Binary files /dev/null and b/lib/gdx-1.10.0-sources.jar differ diff --git a/lib/gdx-1.10.0.jar b/lib/gdx-1.10.0.jar new file mode 100644 index 0000000..d40d517 Binary files /dev/null and b/lib/gdx-1.10.0.jar differ diff --git a/lib/gdx-backend-lwjgl-natives.jar b/lib/gdx-backend-lwjgl-natives.jar deleted file mode 100644 index bd9b36e..0000000 Binary files a/lib/gdx-backend-lwjgl-natives.jar and /dev/null differ diff --git a/lib/gdx-backend-lwjgl.jar b/lib/gdx-backend-lwjgl.jar deleted file mode 100644 index a783cfa..0000000 Binary files a/lib/gdx-backend-lwjgl.jar and /dev/null differ diff --git a/lib/gdx-backend-lwjgl3-1.10.0-javadoc.jar b/lib/gdx-backend-lwjgl3-1.10.0-javadoc.jar new file mode 100644 index 0000000..488eed8 Binary files /dev/null and b/lib/gdx-backend-lwjgl3-1.10.0-javadoc.jar differ diff --git a/lib/gdx-backend-lwjgl3-1.10.0-sources.jar b/lib/gdx-backend-lwjgl3-1.10.0-sources.jar new file mode 100644 index 0000000..412affa Binary files /dev/null and b/lib/gdx-backend-lwjgl3-1.10.0-sources.jar differ diff --git a/lib/gdx-backend-lwjgl3-1.10.0.jar b/lib/gdx-backend-lwjgl3-1.10.0.jar new file mode 100644 index 0000000..69bd2d7 Binary files /dev/null and b/lib/gdx-backend-lwjgl3-1.10.0.jar differ diff --git a/lib/gdx-natives.jar b/lib/gdx-natives.jar deleted file mode 100644 index 1bec32c..0000000 Binary files a/lib/gdx-natives.jar and /dev/null differ diff --git a/lib/gdx-platform-1.10.0-natives-desktop.jar b/lib/gdx-platform-1.10.0-natives-desktop.jar new file mode 100644 index 0000000..d5d8a90 Binary files /dev/null and b/lib/gdx-platform-1.10.0-natives-desktop.jar differ diff --git a/lib/gdx-platform-1.10.0.jar b/lib/gdx-platform-1.10.0.jar new file mode 100644 index 0000000..761e6ac Binary files /dev/null and b/lib/gdx-platform-1.10.0.jar differ diff --git a/lib/gdx.jar b/lib/gdx.jar deleted file mode 100644 index d90e4ba..0000000 Binary files a/lib/gdx.jar and /dev/null differ diff --git a/lib/jlayer-1.0.1-gdx-javadoc.jar b/lib/jlayer-1.0.1-gdx-javadoc.jar new file mode 100755 index 0000000..732cb69 Binary files /dev/null and b/lib/jlayer-1.0.1-gdx-javadoc.jar differ diff --git a/lib/jlayer-1.0.1-gdx-sources.jar b/lib/jlayer-1.0.1-gdx-sources.jar new file mode 100755 index 0000000..036f83a Binary files /dev/null and b/lib/jlayer-1.0.1-gdx-sources.jar differ diff --git a/lib/jlayer-1.0.1-gdx.jar b/lib/jlayer-1.0.1-gdx.jar new file mode 100755 index 0000000..9cd804b Binary files /dev/null and b/lib/jlayer-1.0.1-gdx.jar differ diff --git a/lib/jorbis-0.0.17-javadoc.jar b/lib/jorbis-0.0.17-javadoc.jar new file mode 100755 index 0000000..2ad2520 Binary files /dev/null and b/lib/jorbis-0.0.17-javadoc.jar differ diff --git a/lib/jorbis-0.0.17-sources.jar b/lib/jorbis-0.0.17-sources.jar new file mode 100755 index 0000000..5fc64e2 Binary files /dev/null and b/lib/jorbis-0.0.17-sources.jar differ diff --git a/lib/jorbis-0.0.17.jar b/lib/jorbis-0.0.17.jar new file mode 100755 index 0000000..e58a6aa Binary files /dev/null and b/lib/jorbis-0.0.17.jar differ diff --git a/lib/lwjgl-3.2.3-javadoc.jar b/lib/lwjgl-3.2.3-javadoc.jar new file mode 100644 index 0000000..6751cba Binary files /dev/null and b/lib/lwjgl-3.2.3-javadoc.jar differ diff --git a/lib/lwjgl-3.2.3-natives-linux-arm32.jar b/lib/lwjgl-3.2.3-natives-linux-arm32.jar new file mode 100644 index 0000000..25a176a Binary files /dev/null and b/lib/lwjgl-3.2.3-natives-linux-arm32.jar differ diff --git a/lib/lwjgl-3.2.3-natives-linux-arm64.jar b/lib/lwjgl-3.2.3-natives-linux-arm64.jar new file mode 100644 index 0000000..c32df86 Binary files /dev/null and b/lib/lwjgl-3.2.3-natives-linux-arm64.jar differ diff --git a/lib/lwjgl-3.2.3-natives-linux.jar b/lib/lwjgl-3.2.3-natives-linux.jar new file mode 100644 index 0000000..f6509cf Binary files /dev/null and b/lib/lwjgl-3.2.3-natives-linux.jar differ diff --git a/lib/lwjgl-3.2.3-natives-macos.jar b/lib/lwjgl-3.2.3-natives-macos.jar new file mode 100644 index 0000000..a7f9872 Binary files /dev/null and b/lib/lwjgl-3.2.3-natives-macos.jar differ diff --git a/lib/lwjgl-3.2.3-natives-windows-x86.jar b/lib/lwjgl-3.2.3-natives-windows-x86.jar new file mode 100644 index 0000000..82fbbd0 Binary files /dev/null and b/lib/lwjgl-3.2.3-natives-windows-x86.jar differ diff --git a/lib/lwjgl-3.2.3-natives-windows.jar b/lib/lwjgl-3.2.3-natives-windows.jar new file mode 100644 index 0000000..78a7620 Binary files /dev/null and b/lib/lwjgl-3.2.3-natives-windows.jar differ diff --git a/lib/lwjgl-3.2.3-sources.jar b/lib/lwjgl-3.2.3-sources.jar new file mode 100644 index 0000000..1360c50 Binary files /dev/null and b/lib/lwjgl-3.2.3-sources.jar differ diff --git a/lib/lwjgl-3.2.3.jar b/lib/lwjgl-3.2.3.jar new file mode 100644 index 0000000..e2f71fb Binary files /dev/null and b/lib/lwjgl-3.2.3.jar differ diff --git a/lib/lwjgl-glfw-3.2.3-javadoc.jar b/lib/lwjgl-glfw-3.2.3-javadoc.jar new file mode 100644 index 0000000..5e328ce Binary files /dev/null and b/lib/lwjgl-glfw-3.2.3-javadoc.jar differ diff --git a/lib/lwjgl-glfw-3.2.3-natives-linux-arm32.jar b/lib/lwjgl-glfw-3.2.3-natives-linux-arm32.jar new file mode 100644 index 0000000..54441cd Binary files /dev/null and b/lib/lwjgl-glfw-3.2.3-natives-linux-arm32.jar differ diff --git a/lib/lwjgl-glfw-3.2.3-natives-linux-arm64.jar b/lib/lwjgl-glfw-3.2.3-natives-linux-arm64.jar new file mode 100644 index 0000000..9f5bbf3 Binary files /dev/null and b/lib/lwjgl-glfw-3.2.3-natives-linux-arm64.jar differ diff --git a/lib/lwjgl-glfw-3.2.3-natives-linux.jar b/lib/lwjgl-glfw-3.2.3-natives-linux.jar new file mode 100644 index 0000000..2f48c49 Binary files /dev/null and b/lib/lwjgl-glfw-3.2.3-natives-linux.jar differ diff --git a/lib/lwjgl-glfw-3.2.3-natives-macos.jar b/lib/lwjgl-glfw-3.2.3-natives-macos.jar new file mode 100644 index 0000000..148ea41 Binary files /dev/null and b/lib/lwjgl-glfw-3.2.3-natives-macos.jar differ diff --git a/lib/lwjgl-glfw-3.2.3-natives-windows-x86.jar b/lib/lwjgl-glfw-3.2.3-natives-windows-x86.jar new file mode 100644 index 0000000..0b61721 Binary files /dev/null and b/lib/lwjgl-glfw-3.2.3-natives-windows-x86.jar differ diff --git a/lib/lwjgl-glfw-3.2.3-natives-windows.jar b/lib/lwjgl-glfw-3.2.3-natives-windows.jar new file mode 100644 index 0000000..ba29a14 Binary files /dev/null and b/lib/lwjgl-glfw-3.2.3-natives-windows.jar differ diff --git a/lib/lwjgl-glfw-3.2.3-sources.jar b/lib/lwjgl-glfw-3.2.3-sources.jar new file mode 100644 index 0000000..3f11673 Binary files /dev/null and b/lib/lwjgl-glfw-3.2.3-sources.jar differ diff --git a/lib/lwjgl-glfw-3.2.3.jar b/lib/lwjgl-glfw-3.2.3.jar new file mode 100644 index 0000000..5408c4d Binary files /dev/null and b/lib/lwjgl-glfw-3.2.3.jar differ diff --git a/lib/lwjgl-jemalloc-3.2.3-javadoc.jar b/lib/lwjgl-jemalloc-3.2.3-javadoc.jar new file mode 100644 index 0000000..adb48bc Binary files /dev/null and b/lib/lwjgl-jemalloc-3.2.3-javadoc.jar differ diff --git a/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm32.jar b/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm32.jar new file mode 100644 index 0000000..c95a251 Binary files /dev/null and b/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm32.jar differ diff --git a/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm64.jar b/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm64.jar new file mode 100644 index 0000000..dbc1143 Binary files /dev/null and b/lib/lwjgl-jemalloc-3.2.3-natives-linux-arm64.jar differ diff --git a/lib/lwjgl-jemalloc-3.2.3-natives-linux.jar b/lib/lwjgl-jemalloc-3.2.3-natives-linux.jar new file mode 100644 index 0000000..396941d Binary files /dev/null and b/lib/lwjgl-jemalloc-3.2.3-natives-linux.jar differ diff --git a/lib/lwjgl-jemalloc-3.2.3-natives-macos.jar b/lib/lwjgl-jemalloc-3.2.3-natives-macos.jar new file mode 100644 index 0000000..ad4ede7 Binary files /dev/null and b/lib/lwjgl-jemalloc-3.2.3-natives-macos.jar differ diff --git a/lib/lwjgl-jemalloc-3.2.3-natives-windows-x86.jar b/lib/lwjgl-jemalloc-3.2.3-natives-windows-x86.jar new file mode 100644 index 0000000..2fd051c Binary files /dev/null and b/lib/lwjgl-jemalloc-3.2.3-natives-windows-x86.jar differ diff --git a/lib/lwjgl-jemalloc-3.2.3-natives-windows.jar b/lib/lwjgl-jemalloc-3.2.3-natives-windows.jar new file mode 100644 index 0000000..a652648 Binary files /dev/null and b/lib/lwjgl-jemalloc-3.2.3-natives-windows.jar differ diff --git a/lib/lwjgl-jemalloc-3.2.3-sources.jar b/lib/lwjgl-jemalloc-3.2.3-sources.jar new file mode 100644 index 0000000..fa70568 Binary files /dev/null and b/lib/lwjgl-jemalloc-3.2.3-sources.jar differ diff --git a/lib/lwjgl-jemalloc-3.2.3.jar b/lib/lwjgl-jemalloc-3.2.3.jar new file mode 100644 index 0000000..07029fc Binary files /dev/null and b/lib/lwjgl-jemalloc-3.2.3.jar differ diff --git a/lib/lwjgl-openal-3.2.3-javadoc.jar b/lib/lwjgl-openal-3.2.3-javadoc.jar new file mode 100644 index 0000000..7152d15 Binary files /dev/null and b/lib/lwjgl-openal-3.2.3-javadoc.jar differ diff --git a/lib/lwjgl-openal-3.2.3-natives-linux-arm32.jar b/lib/lwjgl-openal-3.2.3-natives-linux-arm32.jar new file mode 100644 index 0000000..fce5eb9 Binary files /dev/null and b/lib/lwjgl-openal-3.2.3-natives-linux-arm32.jar differ diff --git a/lib/lwjgl-openal-3.2.3-natives-linux-arm64.jar b/lib/lwjgl-openal-3.2.3-natives-linux-arm64.jar new file mode 100644 index 0000000..65ebedb Binary files /dev/null and b/lib/lwjgl-openal-3.2.3-natives-linux-arm64.jar differ diff --git a/lib/lwjgl-openal-3.2.3-natives-linux.jar b/lib/lwjgl-openal-3.2.3-natives-linux.jar new file mode 100644 index 0000000..383bf3f Binary files /dev/null and b/lib/lwjgl-openal-3.2.3-natives-linux.jar differ diff --git a/lib/lwjgl-openal-3.2.3-natives-macos.jar b/lib/lwjgl-openal-3.2.3-natives-macos.jar new file mode 100644 index 0000000..f690b92 Binary files /dev/null and b/lib/lwjgl-openal-3.2.3-natives-macos.jar differ diff --git a/lib/lwjgl-openal-3.2.3-natives-windows-x86.jar b/lib/lwjgl-openal-3.2.3-natives-windows-x86.jar new file mode 100644 index 0000000..34633e6 Binary files /dev/null and b/lib/lwjgl-openal-3.2.3-natives-windows-x86.jar differ diff --git a/lib/lwjgl-openal-3.2.3-natives-windows.jar b/lib/lwjgl-openal-3.2.3-natives-windows.jar new file mode 100644 index 0000000..56adadf Binary files /dev/null and b/lib/lwjgl-openal-3.2.3-natives-windows.jar differ diff --git a/lib/lwjgl-openal-3.2.3-sources.jar b/lib/lwjgl-openal-3.2.3-sources.jar new file mode 100644 index 0000000..6ca1e29 Binary files /dev/null and b/lib/lwjgl-openal-3.2.3-sources.jar differ diff --git a/lib/lwjgl-openal-3.2.3.jar b/lib/lwjgl-openal-3.2.3.jar new file mode 100644 index 0000000..8f5f39d Binary files /dev/null and b/lib/lwjgl-openal-3.2.3.jar differ diff --git a/lib/lwjgl-opengl-3.2.3-javadoc.jar b/lib/lwjgl-opengl-3.2.3-javadoc.jar new file mode 100644 index 0000000..5e5ba83 Binary files /dev/null and b/lib/lwjgl-opengl-3.2.3-javadoc.jar differ diff --git a/lib/lwjgl-opengl-3.2.3-natives-linux-arm32.jar b/lib/lwjgl-opengl-3.2.3-natives-linux-arm32.jar new file mode 100644 index 0000000..cebb767 Binary files /dev/null and b/lib/lwjgl-opengl-3.2.3-natives-linux-arm32.jar differ diff --git a/lib/lwjgl-opengl-3.2.3-natives-linux-arm64.jar b/lib/lwjgl-opengl-3.2.3-natives-linux-arm64.jar new file mode 100644 index 0000000..6aa0769 Binary files /dev/null and b/lib/lwjgl-opengl-3.2.3-natives-linux-arm64.jar differ diff --git a/lib/lwjgl-opengl-3.2.3-natives-linux.jar b/lib/lwjgl-opengl-3.2.3-natives-linux.jar new file mode 100644 index 0000000..bbe4538 Binary files /dev/null and b/lib/lwjgl-opengl-3.2.3-natives-linux.jar differ diff --git a/lib/lwjgl-opengl-3.2.3-natives-macos.jar b/lib/lwjgl-opengl-3.2.3-natives-macos.jar new file mode 100644 index 0000000..084072e Binary files /dev/null and b/lib/lwjgl-opengl-3.2.3-natives-macos.jar differ diff --git a/lib/lwjgl-opengl-3.2.3-natives-windows-x86.jar b/lib/lwjgl-opengl-3.2.3-natives-windows-x86.jar new file mode 100644 index 0000000..c7da8fe Binary files /dev/null and b/lib/lwjgl-opengl-3.2.3-natives-windows-x86.jar differ diff --git a/lib/lwjgl-opengl-3.2.3-natives-windows.jar b/lib/lwjgl-opengl-3.2.3-natives-windows.jar new file mode 100644 index 0000000..977cfcb Binary files /dev/null and b/lib/lwjgl-opengl-3.2.3-natives-windows.jar differ diff --git a/lib/lwjgl-opengl-3.2.3-sources.jar b/lib/lwjgl-opengl-3.2.3-sources.jar new file mode 100644 index 0000000..17ff783 Binary files /dev/null and b/lib/lwjgl-opengl-3.2.3-sources.jar differ diff --git a/lib/lwjgl-opengl-3.2.3.jar b/lib/lwjgl-opengl-3.2.3.jar new file mode 100644 index 0000000..b7dcfa3 Binary files /dev/null and b/lib/lwjgl-opengl-3.2.3.jar differ diff --git a/src/net/torvald/tsvm/AppLoader.java b/src/net/torvald/tsvm/AppLoader.java index a10918f..0371f17 100644 --- a/src/net/torvald/tsvm/AppLoader.java +++ b/src/net/torvald/tsvm/AppLoader.java @@ -1,8 +1,8 @@ package net.torvald.tsvm; import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.backends.lwjgl.LwjglApplication; -import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import net.torvald.tsvm.peripheral.*; @@ -10,21 +10,22 @@ import net.torvald.tsvm.peripheral.*; public class AppLoader { public static String appTitle = "Totally Simple Virtual Machine"; - public static LwjglApplicationConfiguration appConfig; + public static Lwjgl3ApplicationConfiguration appConfig; + + public static int WIDTH = 810;//720; + public static int HEIGHT = 360;//480; public static void main(String[] args) { ShaderProgram.pedantic = false; - appConfig = new LwjglApplicationConfiguration(); - appConfig.foregroundFPS = 60; - appConfig.backgroundFPS = 60; - appConfig.vSyncEnabled = false; - appConfig.useGL30 = false; - appConfig.resizable = false; - appConfig.title = appTitle; - appConfig.forceExit = true; - appConfig.width = 810;//720; - appConfig.height = 360;//480; + appConfig = new Lwjgl3ApplicationConfiguration(); + appConfig.setIdleFPS(60); + appConfig.setForegroundFPS(60); + appConfig.useVsync(false); + appConfig.setResizable(false); + appConfig.setTitle(appTitle); + + appConfig.setWindowedMode(WIDTH, HEIGHT); //VM vm = new VM(64 << 10, new TheRealWorld(), new VMProgramRom[]{BasicBios.INSTANCE, BasicRom.INSTANCE}); @@ -35,14 +36,14 @@ public class AppLoader { // uncomment to target the TerranBASIC runner //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.Term", "assets/disk0"); - EmulInstance portable = new EmulInstance(appConfig, vm, "net.torvald.tsvm.peripheral.CharacterLCDdisplay", "assets/disk0"); + EmulInstance reference = new EmulInstance(vm, "net.torvald.tsvm.peripheral.ReferenceGraphicsAdapter", "assets/disk0"); + EmulInstance reference2 = new EmulInstance(vm, "net.torvald.tsvm.peripheral.ReferenceLikeLCD", "assets/disk0"); + EmulInstance term = new EmulInstance(vm, "net.torvald.tsvm.peripheral.Term", "assets/disk0"); + EmulInstance portable = new EmulInstance(vm, "net.torvald.tsvm.peripheral.CharacterLCDdisplay", "assets/disk0"); - EmulInstance wp = new EmulInstance(appConfig, vm, "net.torvald.tsvm.peripheral.WpTerm", "assets/wpdisk"); + EmulInstance wp = new EmulInstance(vm, "net.torvald.tsvm.peripheral.WpTerm", "assets/wpdisk"); - new LwjglApplication(new VMGUI(wp), appConfig); + new Lwjgl3Application(new VMGUI(wp), appConfig); } public static ShaderProgram loadShaderFromFile(String vert, String frag) { diff --git a/src/net/torvald/tsvm/GraphicsJSR223Delegate.kt b/src/net/torvald/tsvm/GraphicsJSR223Delegate.kt index 8b66ca8..0345c80 100644 --- a/src/net/torvald/tsvm/GraphicsJSR223Delegate.kt +++ b/src/net/torvald/tsvm/GraphicsJSR223Delegate.kt @@ -2,7 +2,6 @@ package net.torvald.tsvm import net.torvald.UnsafeHelper import net.torvald.tsvm.peripheral.GraphicsAdapter -import sun.nio.ch.DirectBuffer class GraphicsJSR223Delegate(val vm: VM) { @@ -27,13 +26,13 @@ class GraphicsJSR223Delegate(val vm: VM) { } } - fun loadBulk(fromAddr: Int, toAddr: Int, length: Int) { + /*fun loadBulk(fromAddr: Int, toAddr: Int, length: Int) { getFirstGPU()?._loadbulk(fromAddr, toAddr, length) } fun storeBulk(fromAddr: Int, toAddr: Int, length: Int) { getFirstGPU()?._storebulk(fromAddr, toAddr, length) - } + }*/ fun plotPixel(x: Int, y: Int, color: Int) { getFirstGPU()?.let { @@ -90,7 +89,7 @@ class GraphicsJSR223Delegate(val vm: VM) { } } - private fun GraphicsAdapter._loadbulk(fromAddr: Int, toAddr: Int, length: Int) { + /*private fun GraphicsAdapter._loadbulk(fromAddr: Int, toAddr: Int, length: Int) { UnsafeHelper.memcpy( vm.usermem.ptr + fromAddr, (this.framebuffer.pixels as DirectBuffer).address() + toAddr, @@ -104,7 +103,7 @@ class GraphicsJSR223Delegate(val vm: VM) { vm.usermem.ptr + toAddr, length.toLong() ) - } + }*/ private fun GraphicsAdapter._loadSprite(spriteNum: Int, ptr: Int) { UnsafeHelper.memcpy( diff --git a/src/net/torvald/tsvm/VMGUI.kt b/src/net/torvald/tsvm/VMGUI.kt index 16c71dc..19212f9 100644 --- a/src/net/torvald/tsvm/VMGUI.kt +++ b/src/net/torvald/tsvm/VMGUI.kt @@ -2,7 +2,6 @@ package net.torvald.tsvm import com.badlogic.gdx.ApplicationAdapter import com.badlogic.gdx.Gdx -import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration import com.badlogic.gdx.graphics.* import com.badlogic.gdx.graphics.g2d.SpriteBatch import kotlinx.coroutines.* @@ -14,7 +13,6 @@ fun ByteArray.startsWith(other: ByteArray) = this.sliceArray(other.indices).cont data class EmulInstance( - val appConfig: LwjglApplicationConfiguration, val vm: VM, val display: String, val diskPath: String = "assets/disk0" @@ -22,7 +20,6 @@ data class EmulInstance( class VMGUI(val loaderInfo: EmulInstance) : ApplicationAdapter() { - val appConfig = loaderInfo.appConfig val vm = loaderInfo.vm lateinit var batch: SpriteBatch @@ -45,10 +42,10 @@ class VMGUI(val loaderInfo: EmulInstance) : ApplicationAdapter() { VertexAttribute.ColorUnpacked(), VertexAttribute.TexCoords(0) ) - updateFullscreenQuad(appConfig.width, appConfig.height) + updateFullscreenQuad(AppLoader.WIDTH, AppLoader.HEIGHT) batch = SpriteBatch() - camera = OrthographicCamera(appConfig.width.toFloat(), appConfig.height.toFloat()) + camera = OrthographicCamera(AppLoader.WIDTH.toFloat(), AppLoader.HEIGHT.toFloat()) camera.setToOrtho(false) camera.update() batch.projectionMatrix = camera.combined @@ -144,7 +141,7 @@ class VMGUI(val loaderInfo: EmulInstance) : ApplicationAdapter() { } private fun setCameraPosition(newX: Float, newY: Float) { - camera.position.set((-newX + appConfig.width / 2), (-newY + appConfig.height / 2), 0f) // deliberate integer division + camera.position.set((-newX + AppLoader.WIDTH / 2), (-newY + AppLoader.HEIGHT / 2), 0f) // deliberate integer division camera.update() batch.setProjectionMatrix(camera.combined) } diff --git a/src/net/torvald/tsvm/peripheral/IOSpace.kt b/src/net/torvald/tsvm/peripheral/IOSpace.kt index 7c9d8cb..6b4ed4d 100644 --- a/src/net/torvald/tsvm/peripheral/IOSpace.kt +++ b/src/net/torvald/tsvm/peripheral/IOSpace.kt @@ -287,7 +287,7 @@ class IOSpace(val vm: VM) : PeriBase, InputProcessor { } } - override fun scrolled(p0: Int): Boolean { + override fun scrolled(p0: Float, p1: Float): Boolean { return false } diff --git a/src/net/torvald/tsvm/vdc/V2kRunTest.kt b/src/net/torvald/tsvm/vdc/V2kRunTest.kt index 80b6222..3e9e39f 100644 --- a/src/net/torvald/tsvm/vdc/V2kRunTest.kt +++ b/src/net/torvald/tsvm/vdc/V2kRunTest.kt @@ -2,8 +2,8 @@ package net.torvald.tsvm.vdc import com.badlogic.gdx.ApplicationAdapter import com.badlogic.gdx.Gdx -import com.badlogic.gdx.backends.lwjgl.LwjglApplication -import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration import com.badlogic.gdx.graphics.OrthographicCamera import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.glutils.ShaderProgram @@ -13,7 +13,7 @@ import kotlinx.coroutines.launch import net.torvald.tsvm.* import net.torvald.tsvm.peripheral.GraphicsAdapter -class V2kRunTest(val appConfig: LwjglApplicationConfiguration) : ApplicationAdapter() { +class V2kRunTest : ApplicationAdapter() { val vm = VM(64.kB(), TheRealWorld(), arrayOf()) lateinit var gpu: GraphicsAdapter @@ -40,11 +40,11 @@ class V2kRunTest(val appConfig: LwjglApplicationConfiguration) : ApplicationAdap ) batch = SpriteBatch() - camera = OrthographicCamera(appConfig.width.toFloat(), appConfig.height.toFloat()) + camera = OrthographicCamera(AppLoader.WIDTH.toFloat(), AppLoader.WIDTH.toFloat()) camera.setToOrtho(false) camera.update() batch.projectionMatrix = camera.combined - Gdx.gl20.glViewport(0, 0, appConfig.width, appConfig.height) + Gdx.gl20.glViewport(0, 0, AppLoader.WIDTH, AppLoader.HEIGHT) vm.getPrintStream = { gpu.getPrintStream() } vm.getErrorStream = { gpu.getErrorStream() } @@ -103,15 +103,13 @@ class V2kRunTest(val appConfig: LwjglApplicationConfiguration) : ApplicationAdap fun main() { ShaderProgram.pedantic = false - val appConfig = LwjglApplicationConfiguration() - appConfig.foregroundFPS = 60 - appConfig.backgroundFPS = 60 - appConfig.vSyncEnabled = false - appConfig.useGL30 = true - appConfig.resizable = false - appConfig.title = "Videotron2K Test" - appConfig.forceExit = true - appConfig.width = 560 - appConfig.height = 448 - LwjglApplication(V2kRunTest(appConfig), appConfig) + + val appConfig = Lwjgl3ApplicationConfiguration() + appConfig.setIdleFPS(60) + appConfig.setForegroundFPS(60) + appConfig.useVsync(false) + appConfig.setResizable(false) + appConfig.setTitle("Videotron2K Test") + appConfig.setWindowedMode(560, 448) + Lwjgl3Application(V2kRunTest(), appConfig) } \ No newline at end of file diff --git a/tsvm.iml b/tsvm.iml index 4e22ae7..b892b76 100644 --- a/tsvm.iml +++ b/tsvm.iml @@ -11,5 +11,8 @@ + + + \ No newline at end of file