inseven / opolua

A compiled-OPL interpreter for iOS written in Lua
https://opolua.org
MIT License
12 stars 0 forks source link

Issue with the `NotFloat` function in `ops.lua` #262

Closed kapfab closed 6 months ago

kapfab commented 6 months ago

Given the weirdness of OPL logical operators with floats, I don’t think many programs actually make use of this opcode, but the function NotFloat in ops.lua should be:

function NotFloat(stack) -- 0x66
    stack:push(stack:pop() == 0)
end

instead of:

function NotFloat(stack) -- 0x66
    stack:push(stack:pop() ~= 0)
end
tomsci commented 6 months ago

Thanks for the report! Yep that seems backwards.