Skip to content

Commit

Permalink
Debugger: Lua - Fixed reverse mode script behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
SourMesen committed May 29, 2023
1 parent 8948221 commit 7a4e86b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions UI/Debugger/Utilities/LuaScripts/ReverseMode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ function Main()
input = emu.getInput(0)
input.left, input.right = input.right, input.left
emu.setInput(input, 0)
local size = emu.getScreenSize()
bufferI = emu.getScreenBuffer()
for y = 0, 239 do
local offset = y*256;
for x = 0, 255 do
bufferO[offset + x] = bufferI[offset + 255 - x]
for y = 0, size.height do
local offset = y*size.width;
for x = 1, size.width do
bufferO[offset + x] = bufferI[offset + size.width - x + 1]
end
end
emu.setScreenBuffer(bufferO)
Expand Down

0 comments on commit 7a4e86b

Please sign in to comment.