mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 06:54:04 +09:00
internalising more global functions
This commit is contained in:
@@ -67,8 +67,8 @@ class VMGUI(val loaderInfo: EmulInstance, val viewportWidth: Int, val viewportHe
|
|||||||
private fun init() {
|
private fun init() {
|
||||||
if (loaderInfo.display != null) {
|
if (loaderInfo.display != null) {
|
||||||
val loadedClass = Class.forName(loaderInfo.display)
|
val loadedClass = Class.forName(loaderInfo.display)
|
||||||
val loadedClassConstructor = loadedClass.getConstructor(vm::class.java)
|
val loadedClassConstructor = loadedClass.getConstructor(String::class.java, vm::class.java)
|
||||||
val loadedClassInstance = loadedClassConstructor.newInstance(vm)
|
val loadedClassInstance = loadedClassConstructor.newInstance("./assets", vm)
|
||||||
gpu = (loadedClassInstance as GraphicsAdapter)
|
gpu = (loadedClassInstance as GraphicsAdapter)
|
||||||
|
|
||||||
vm.getIO().blockTransferPorts[0].attachDevice(TestDiskDrive(vm, 0, File(loaderInfo.diskPath)))
|
vm.getIO().blockTransferPorts[0].attachDevice(TestDiskDrive(vm, 0, File(loaderInfo.diskPath)))
|
||||||
|
|||||||
@@ -212,4 +212,4 @@ class PeripheralEntry2(
|
|||||||
vararg val args: Any
|
vararg val args: Any
|
||||||
)
|
)
|
||||||
|
|
||||||
fun Int.kB() = this * 1024L
|
internal fun Int.kB() = this * 1024L
|
||||||
|
|||||||
@@ -1748,17 +1748,17 @@ void main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
infix fun Int.fmod(other: Int): Int {
|
internal infix fun Int.fmod(other: Int): Int {
|
||||||
return Math.floorMod(this, other)
|
return Math.floorMod(this, other)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun FrameBuffer.inUse(action: () -> Unit) {
|
internal fun FrameBuffer.inUse(action: () -> Unit) {
|
||||||
this.begin()
|
this.begin()
|
||||||
action()
|
action()
|
||||||
this.end()
|
this.end()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun SpriteBatch.inUse(action: () -> Unit) {
|
internal fun SpriteBatch.inUse(action: () -> Unit) {
|
||||||
this.begin()
|
this.begin()
|
||||||
action()
|
action()
|
||||||
this.end()
|
this.end()
|
||||||
|
|||||||
Reference in New Issue
Block a user