Author Topic: Can we hack lemmings for Genesis and Snes?  (Read 10575 times)

0 Members and 1 Guest are viewing this topic.

Offline crazygerry

  • Posts: 5
    • View Profile
Re: Can we hack lemmings for Genesis and Snes?
« Reply #15 on: August 07, 2018, 09:47:15 PM »
Hello again,

now I have a solution to play the Genesis version with a mouse.

1.    Save the following code as lemmmouse.lua

Code: [Select]
function LEMMINGSMouse()
inp = input.get()
pad = joypad.get(1)
offset = -7
--cursorx = memory.readbyte(0x00FFF46D)
--cursory = memory.readbyte(0x00FFF46F)

--gui.text(2, 60, cursorx)
if(inp.xmouse+offset >= 0 and inp.xmouse+offset <= 239) then
memory.writebyte(0x00FFF46D,inp.xmouse+offset)
elseif(inp.xmouse+offset < 0) then
memory.writebyte(0x00FFF46D,0)
elseif(inp.xmouse+offset > 239) then
memory.writebyte(0x00FFF46D,239)
end
--gui.text(2, 70, inp.xmouse+offset)


--gui.text(2, 100, cursory)
if(inp.ymouse+offset >= 0 and inp.ymouse+offset <= 191) then
memory.writebyte(0x00FFF46F,inp.ymouse+offset)
elseif(inp.ymouse+offset < 0) then
memory.writebyte(0x00FFF46F,0)
elseif(inp.ymouse+offset > 191) then
memory.writebyte(0x00FFF46F,191)
end
--gui.text(2, 110, inp.ymouse+offset)


if (inp.xmouse+offset > 238) then
        pad.right = true
joypad.set(1,pad)
end

if (inp.xmouse+offset < 1) then
        pad.left = true
joypad.set(1,pad)
end

if (inp.leftclick) then
pad.C = true
joypad.set(1,pad)
end

if (inp.B) then
pad.B = true
pad.left = true
joypad.set(1,pad)
end

if (inp.N) then
pad.B = true
pad.right = true
joypad.set(1,pad)
end

end
gui.register(LEMMINGSMouse)

2.   Use Gens with LUA support.
      hxxp...adelikat.tasvideos.org/emulatordownloads/gens/Gens11svn.zip

3.   Load Lemmings (Japan).zip (MD5 21ce8bb46d99446c3d5d79e845864135) - emuparadise

4.   Load my LUAscript and enjoy Lemmings with mouse :-)

The European Lemmings version that I tested worked too.

Have fun !