From d524da3530aaf7035f376fa1faaa36934e715559 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 7 Mar 2021 22:19:40 +1000 Subject: [PATCH] s/null/nil/ in all included Lua scripts --- Assets/Lua/MovieClock.lua | 2 +- Assets/Lua/NES/PunchOutStats.lua | 10 ++-- Assets/Lua/NES/RBIBaseball.lua | 48 +++++++++---------- Assets/Lua/UnitTests/Joypad_Set.lua | 12 ++--- .../Joypad_WithControllerNumbers.lua | 12 ++--- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Assets/Lua/MovieClock.lua b/Assets/Lua/MovieClock.lua index 5586708075..d1054381ca 100644 --- a/Assets/Lua/MovieClock.lua +++ b/Assets/Lua/MovieClock.lua @@ -23,7 +23,7 @@ while true do if (hours > 0) then time = "0" .. hours .. ":" .. time; end - gui.text(0, 0, time, null, 1); + gui.text(0, 0, time, nil, 1); end emu.frameadvance(); end \ No newline at end of file diff --git a/Assets/Lua/NES/PunchOutStats.lua b/Assets/Lua/NES/PunchOutStats.lua index 18bb82fe46..992c0741de 100644 --- a/Assets/Lua/NES/PunchOutStats.lua +++ b/Assets/Lua/NES/PunchOutStats.lua @@ -61,10 +61,10 @@ end while true do --***************************************************************************** EnemyHP = mainmemory.read_u8(EHP) - gui.text(0,0,"Opponent: " .. EnemyHP, null, null, "topright") + gui.text(0,0,"Opponent: " .. EnemyHP, nil, nil, "topright") MacHP = mainmemory.read_u8(MHP) - gui.text(0,12,"Mac: " .. MacHP, null, null, "topright") + gui.text(0,12,"Mac: " .. MacHP, nil, nil, "topright") if IsOppDown() then OppWillGet = mainmemory.read_u8(OppWillGetUpWith) @@ -72,8 +72,8 @@ while true do if OppGetUpCount == -153 then OppGetUpCount = "never!" end - gui.text(0, 12, "Next health: " .. OppWillGet, null, null, "bottomright") - gui.text(OppGetUpX, OppGetUpY, "Will get up on: " .. OppGetUpCount, null, null, "bottomright") + gui.text(0, 12, "Next health: " .. OppWillGet, nil, nil, "bottomright") + gui.text(OppGetUpX, OppGetUpY, "Will get up on: " .. OppGetUpCount, nil, nil, "bottomright") end if OppIsHit() then @@ -83,7 +83,7 @@ while true do end if OppHitTimer > 0 then - gui.text(0, 0, "Damage: " .. OppHitToDisplay, null, null, "bottomright") + gui.text(0, 0, "Damage: " .. OppHitToDisplay, nil, nil, "bottomright") end diff --git a/Assets/Lua/NES/RBIBaseball.lua b/Assets/Lua/NES/RBIBaseball.lua index 51697ed650..3682a7ffa6 100644 --- a/Assets/Lua/NES/RBIBaseball.lua +++ b/Assets/Lua/NES/RBIBaseball.lua @@ -177,49 +177,49 @@ pitchtype = mainmemory.read_u8(pitchtypeAddr); --What the pitcher will pitch if (pitchtype == 0) then - gui.text(0,0,"Sinker!!", null, null, "bottomright"); + gui.text(0,0,"Sinker!!", nil, nil, "bottomright"); end if (pitchtype == 2) then - gui.text(0,0, "Fast Ball", null, null, "bottomright") + gui.text(0,0, "Fast Ball", nil, nil, "bottomright") end if (pitchtype == 1) then - gui.text(0,0,"Regular Pitch", null, null, "bottomright") + gui.text(0,0,"Regular Pitch", nil, nil, "bottomright") end --Top of Inning if (inningtb == 0) then - gui.text(0,0, "Health " .. mainmemory.read_u8(0x061D), null, null, "topright") - gui.text(0,12,"Drop " .. mainmemory.read_u8(0x0617) % 16, null, null, "topright") - gui.text(0,24,"CurveL " .. mainmemory.read_u8(0x061C) / 16, null, null, "topright") - gui.text(0,36,"CurveR " .. mainmemory.read_u8(0x061C) % 16, null, null, "topright") - gui.text(0,48,"Fast SP " .. mainmemory.read_u8(0x061B), null, null, "topright") - gui.text(0,60,"Reg SP " .. mainmemory.read_u8(0x061A), null, null, "topright") - gui.text(0,72,"Sink SP " .. mainmemory.read_u8(0x0619), null, null, "topright") + gui.text(0,0, "Health " .. mainmemory.read_u8(0x061D), nil, nil, "topright") + gui.text(0,12,"Drop " .. mainmemory.read_u8(0x0617) % 16, nil, nil, "topright") + gui.text(0,24,"CurveL " .. mainmemory.read_u8(0x061C) / 16, nil, nil, "topright") + gui.text(0,36,"CurveR " .. mainmemory.read_u8(0x061C) % 16, nil, nil, "topright") + gui.text(0,48,"Fast SP " .. mainmemory.read_u8(0x061B), nil, nil, "topright") + gui.text(0,60,"Reg SP " .. mainmemory.read_u8(0x061A), nil, nil, "topright") + gui.text(0,72,"Sink SP " .. mainmemory.read_u8(0x0619), nil, nil, "topright") P1currPower = mainmemory.read_u8(P1currHitterPowerAddr) + (mainmemory.read_u8(P1currHitterPowerAddr+1) * 256); - gui.text(0,108, "Power: " .. P1currPower, null, null, "topright"); + gui.text(0,108, "Power: " .. P1currPower, nil, nil, "topright"); P1currSpeed = mainmemory.read_u8(P1currSpeedAddr); - gui.text(0,120, "Speed: " .. P1currSpeed, null, null, "topright"); + gui.text(0,120, "Speed: " .. P1currSpeed, nil, nil, "topright"); P1currCt = mainmemory.read_u8(P1currContactAddr); - gui.text(0,132, "Contact: " .. P1currCt, null, null, "topright"); + gui.text(0,132, "Contact: " .. P1currCt, nil, nil, "topright"); end --Bottom of Inning if (inningtb == 0x10) then - gui.text(0,0,"Health " .. mainmemory.read_u8(0x060D), null, null, "topright") - gui.text(0,12,"Drop " .. mainmemory.read_u8(0x0607) % 16, null, null, "topright") - gui.text(0,24,"CurveL " .. mainmemory.read_u8(0x060C) / 16, null, null, "topright") - gui.text(0,36,"CurveR " .. mainmemory.read_u8(0x060C) % 16, null, null, "topright") - gui.text(0,48,"Fast SP " .. mainmemory.read_u8(0x060B), null, null, "topright") - gui.text(0,60,"Reg SP " .. mainmemory.read_u8(0x060A), null, null, "topright") - gui.text(0,72,"Sink SP " .. mainmemory.read_u8(0x0609), null, null, "topright") + gui.text(0,0,"Health " .. mainmemory.read_u8(0x060D), nil, nil, "topright") + gui.text(0,12,"Drop " .. mainmemory.read_u8(0x0607) % 16, nil, nil, "topright") + gui.text(0,24,"CurveL " .. mainmemory.read_u8(0x060C) / 16, nil, nil, "topright") + gui.text(0,36,"CurveR " .. mainmemory.read_u8(0x060C) % 16, nil, nil, "topright") + gui.text(0,48,"Fast SP " .. mainmemory.read_u8(0x060B), nil, nil, "topright") + gui.text(0,60,"Reg SP " .. mainmemory.read_u8(0x060A), nil, nil, "topright") + gui.text(0,72,"Sink SP " .. mainmemory.read_u8(0x0609), nil, nil, "topright") P2currPower = mainmemory.read_u8(P2currHitterPowerAddr) + (mainmemory.read_u8(P2currHitterPowerAddr+1) * 256); - gui.text(0,108, "Power: " .. P2currPower, null, null, "topright"); + gui.text(0,108, "Power: " .. P2currPower, nil, nil, "topright"); P2currSpeed = mainmemory.read_u8(P2currSpeedAddr); - gui.text(0,120, "Speed: " .. P2currSpeed, null, null, "topright"); + gui.text(0,120, "Speed: " .. P2currSpeed, nil, nil, "topright"); P2currCt = mainmemory.read_u8(P2currContactAddr); - gui.text(0,132, "Contact: " .. P2currCt, null, null, "topright"); + gui.text(0,132, "Contact: " .. P2currCt, nil, nil, "topright"); end end @@ -228,7 +228,7 @@ end if (PitchingScreen == 0x0036) then p1Outs = mainmemory.read_u8(p1OutsAddr); -gui.text(0,0, "Outs " .. p1Outs, null, null, "topright"); +gui.text(0,0, "Outs " .. p1Outs, nil, nil, "topright"); end ------------------------------------------------------- diff --git a/Assets/Lua/UnitTests/Joypad_Set.lua b/Assets/Lua/UnitTests/Joypad_Set.lua index fc6e969ce3..70c1638cf1 100644 --- a/Assets/Lua/UnitTests/Joypad_Set.lua +++ b/Assets/Lua/UnitTests/Joypad_Set.lua @@ -13,7 +13,7 @@ buttons = { }; buttons["Up"] = false; buttons["Down"] = true; buttons["Left"] = "invert"; -buttons["Right"] = null; +buttons["Right"] = nil; joypad.set(buttons, 1); pushThings = true; @@ -24,17 +24,17 @@ while true do buttons["A"] = false; buttons["B"] = true; buttons["Select"] = "invert"; - buttons["Start"] = null; + buttons["Start"] = nil; joypad.set(buttons, 1); end if (emu.framecount() == 600) then pushThings = false; turnoff = { }; - turnoff["A"] = null; - turnoff["B"] = null; - turnoff["Select"] = null; - turnoff["Start"] = null; + turnoff["A"] = nil; + turnoff["B"] = nil; + turnoff["Select"] = nil; + turnoff["Start"] = nil; joypad.set(turnoff, 1); console.writeline("cleared") diff --git a/Assets/Lua/UnitTests/Joypad_WithControllerNumbers.lua b/Assets/Lua/UnitTests/Joypad_WithControllerNumbers.lua index 0f36217b87..eac15be1c1 100644 --- a/Assets/Lua/UnitTests/Joypad_WithControllerNumbers.lua +++ b/Assets/Lua/UnitTests/Joypad_WithControllerNumbers.lua @@ -13,7 +13,7 @@ buttons = { }; buttons["Up"] = false; buttons["Down"] = true; buttons["Left"] = "invert"; -buttons["Right"] = null; +buttons["Right"] = nil; joypad.set(buttons, 1); pushThings = true; @@ -24,17 +24,17 @@ while true do buttons["A"] = false; buttons["B"] = true; buttons["Select"] = "invert"; - buttons["Start"] = null; + buttons["Start"] = nil; joypad.set(buttons, 1); end if (emu.framecount() == 600) then pushThings = false; turnoff = { }; - turnoff["A"] = null; - turnoff["B"] = null; - turnoff["Select"] = null; - turnoff["Start"] = null; + turnoff["A"] = nil; + turnoff["B"] = nil; + turnoff["Select"] = nil; + turnoff["Start"] = nil; joypad.set(turnoff, 1); console.writeline("cleared")