mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 11:51:49 +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 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)
|
||||
end
|
||||
end
|
||||
|
||||
for y = 360, h - 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)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,6 +9,7 @@ class VMLuaAdapter(val vm: VM) {
|
||||
|
||||
init {
|
||||
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