mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 23:04:04 +09:00
global int-casting function
This commit is contained in:
@@ -98,14 +98,14 @@ class VMGUI(val appConfig: LwjglApplicationConfiguration) : ApplicationAdapter()
|
|||||||
|
|
||||||
for y = 0, 359 do
|
for y = 0, 359 do
|
||||||
for x = 0, w - 1 do
|
for x = 0, w - 1 do
|
||||||
palnum = 20 * math.floor(y / 30) + math.floor(x / 28)
|
palnum = 20 * int(y / 30) + int(x / 28)
|
||||||
vm.poke(-(y * w + x + 1) - hwoff, palnum)
|
vm.poke(-(y * w + x + 1) - hwoff, palnum)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for y = 360, h - 1 do
|
for y = 360, h - 1 do
|
||||||
for x = 0, w - 1 do
|
for x = 0, w - 1 do
|
||||||
palnum = 240 + (x / 35)
|
palnum = 240 + int(x / 35)
|
||||||
vm.poke(-(y * w + x + 1) - hwoff, palnum)
|
vm.poke(-(y * w + x + 1) - hwoff, palnum)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class VMLuaAdapter(val vm: VM) {
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
lua.load(Firmware(vm))
|
lua.load(Firmware(vm))
|
||||||
|
lua.load("_G.int = function(n) if n > 0 then return math.floor(n) else return math.ceil(n) end end").call()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user