mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-08-21 23:26:38 -07:00
BizHawkClient: Fix compatibility for Lua 5.5+ (#6200)
This commit is contained in:
+5
-5
@@ -5,11 +5,7 @@ local base64 = {}
|
||||
|
||||
local extract = _G.bit32 and _G.bit32.extract -- Lua 5.2/Lua 5.3 in compatibility mode
|
||||
if not extract then
|
||||
if _G._VERSION == "Lua 5.4" then
|
||||
extract = load[[return function( v, from, width )
|
||||
return ( v >> from ) & ((1 << width) - 1)
|
||||
end]]()
|
||||
elseif _G.bit then -- LuaJIT
|
||||
if _G.bit then -- LuaJIT
|
||||
local shl, shr, band = _G.bit.lshift, _G.bit.rshift, _G.bit.band
|
||||
extract = function( v, from, width )
|
||||
return band( shr( v, from ), shl( 1, width ) - 1 )
|
||||
@@ -27,6 +23,10 @@ if not extract then
|
||||
end
|
||||
return w
|
||||
end
|
||||
else -- Lua 5.3+
|
||||
extract = load[[return function( v, from, width )
|
||||
return ( v >> from ) & ((1 << width) - 1)
|
||||
end]]()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -633,8 +633,8 @@ end)
|
||||
if bizhawk_major < 2 or (bizhawk_major == 2 and bizhawk_minor < 7) then
|
||||
print("Must use BizHawk 2.7.0 or newer")
|
||||
else
|
||||
if bizhawk_major > 2 or (bizhawk_major == 2 and bizhawk_minor > 10) then
|
||||
print("Warning: This version of BizHawk is newer than this script. If it doesn't work, consider downgrading to 2.10.")
|
||||
if bizhawk_major > 2 or (bizhawk_major == 2 and bizhawk_minor > 11) then
|
||||
print("Warning: This version of BizHawk is newer than this script. If it doesn't work, consider downgrading to 2.11.")
|
||||
end
|
||||
|
||||
if emu.getsystemid() == "NULL" then
|
||||
|
||||
Reference in New Issue
Block a user