Can we hack lemmings for Genesis and Snes?

Started by GigaLem, May 29, 2015, 10:24:43 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

crazygerry

Hello again,

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

1.    Save the following code as lemmmouse.lua

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 !