diff --git a/output/luaScripts/emugator/emugators_demo.lua b/output/luaScripts/emugator/emugators_demo.lua index d699e9c3..888438e9 100644 --- a/output/luaScripts/emugator/emugators_demo.lua +++ b/output/luaScripts/emugator/emugators_demo.lua @@ -2,6 +2,8 @@ local cart = {x1=50, y1=50, x2=100, y2=100} local console = {x1=150, y1=50, x2=200, y2=100} local unloadButton = {x1 = 220, y1 = 220, x2 = 250, y2 = 230} + local ejectInsertButton = {x1 = 5, y1 = 220, x2 = 64, y2 = 230} + local switchButton = {x1 = 180, y1 = 220, x2 = 210, y2 = 230} local isDrag = false --local gd = require("gd") @@ -37,13 +39,23 @@ while(true) do gui.rect(unloadButton.x1, unloadButton.y1, unloadButton.x2, unloadButton.y2, "blue", "white") gui.text(unloadButton.x1+2, unloadButton.y1+2, "Unload") + gui.rect(switchButton.x1, switchButton.y1, switchButton.x2, switchButton.y2, "blue", "white") + gui.text(switchButton.x1+2, switchButton.y1+2, "Switch") + + gui.rect(ejectInsertButton.x1, ejectInsertButton.y1, ejectInsertButton.x2, ejectInsertButton.y2, "blue", "white") + gui.text(ejectInsertButton.x1+2, ejectInsertButton.y1+2, "Eject/Insert") + if ((inpt.xmouse > unloadButton.x1) and (inpt.xmouse < unloadButton.x2) and (inpt.ymouse > unloadButton.y1) and (inpt.ymouse < unloadButton.y2) and inpt.leftclick) then emu.closeRom() emugator.yieldwithflag() + elseif ((inpt.xmouse > switchButton.x1) and (inpt.xmouse < switchButton.x2) and (inpt.ymouse > switchButton.y1) and (inpt.ymouse < switchButton.y2) and inpt.leftclick) then + emu.switchDisk() + emu.frameadvance() + elseif ((inpt.xmouse > ejectInsertButton.x1) and (inpt.xmouse < ejectInsertButton.x2) and (inpt.ymouse > ejectInsertButton.y1) and (inpt.ymouse < ejectInsertButton.y2) and inpt.leftclick) then + emu.insertOrEjectDisk() + emu.frameadvance() else emu.frameadvance() end end - - --emu.frameadvance() end \ No newline at end of file