Skip to content

Commit

Permalink
Small update to comment language
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamachara authored Oct 7, 2021
1 parent dc524d7 commit 2f3bf52
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
23 changes: 19 additions & 4 deletions ShadowrunMouse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,32 @@ It is suggested you set movement (Input->Input Configuration) to WASD.
I set start to E and Select to left CTRL.
Shadowrun has a large following in Germany and it was brought to my attention that the German version of the rom was incompatible with the original script. This will now work on either the US or German version with the alternate memory locations set below.
]]


-- US Rom --

mouseOn = 0x0001F5
mouseX = 0x0001F1
mouseY = 0x0001F3

-- DE Rom --

--mouseOn = 0x0001D9
--mouseX = 0x0001D5
--mouseY = 0x0001D7

function ShadowrunMouse()
inp = input.get()

if(memory.readbyte(0x0001F5) == 255) then
--keep in range and adjust for offset
if(memory.readbyte(mouseOn) == 255) then
--keep in range and adjust for offset. (This version of LUA does not feature clamp)
x = math.max(3,math.min(inp.xmouse - 5,255))
y = math.max(3,math.min(inp.ymouse - 4,223))
memory.writebyte(0x0001F1,x)
memory.writebyte(0x0001F3,y)
memory.writebyte(mouseX,x)
memory.writebyte(mouseY,y)
end

if(inp.leftclick) then joypad.set(1, {B=true}) --Select
Expand Down
2 changes: 1 addition & 1 deletion ShadowrunMouseGerman.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function ShadowrunMouse()
inp = input.get()

if(memory.readbyte(mouseOn) == 255) then
--keep in range and adjust for offset
--keep in range and adjust for offset. (This version of LUA does not feature clamp)
x = math.max(3,math.min(inp.xmouse - 5,255))
y = math.max(3,math.min(inp.ymouse - 4,223))
memory.writebyte(mouseX,x)
Expand Down

0 comments on commit 2f3bf52

Please sign in to comment.