Debugger: Clean up Lua examples (#627)
- Remove extraneous semi-colons - Remove spaces after opening paren on functions - Remove trailing spaces on lines - Add newlines as last byte of file where applicable
This commit is contained in:
parent
04a41a1dd7
commit
a891307efc
10 changed files with 80 additions and 80 deletions
|
@ -123,5 +123,5 @@ header = {0x52,0x49,0x46,0x46,0x00,0x00,0x00,0x00,
|
|||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x01,0x00,0x08,0x00,0x64,0x61,0x74,0x61,
|
||||
0x00,0x00,0x00,0x00}
|
||||
emu.addEventCallback(Main, emu.eventType.endFrame);
|
||||
emu.addEventCallback(Main, emu.eventType.endFrame)
|
||||
emu.displayMessage("Script", "DMC Capture")
|
||||
|
|
|
@ -26,5 +26,5 @@ end
|
|||
|
||||
|
||||
hold = false
|
||||
emu.addEventCallback(Main, emu.eventType.endFrame);
|
||||
emu.addEventCallback(Main, emu.eventType.endFrame)
|
||||
emu.displayMessage("Script", "Draw Mode")
|
||||
|
|
|
@ -43,7 +43,7 @@ function printInfo()
|
|||
end
|
||||
|
||||
--Register some code (printInfo function) that will be run at the end of each frame
|
||||
emu.addEventCallback(printInfo, emu.eventType.endFrame);
|
||||
emu.addEventCallback(printInfo, emu.eventType.endFrame)
|
||||
|
||||
--Display a startup message
|
||||
emu.displayMessage("Script", "Example Lua script loaded.")
|
|
@ -38,5 +38,5 @@ color = 0xC0FF0000
|
|||
hold = false
|
||||
mode = 0
|
||||
size = 8
|
||||
emu.addEventCallback(Main, emu.eventType.endFrame);
|
||||
emu.addEventCallback(Main, emu.eventType.endFrame)
|
||||
emu.displayMessage("Script", "Grid")
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
-- Draws a red line over each scanline that CPU writes to $2005 occurred
|
||||
-----------------------
|
||||
|
||||
PPUSCROLL = 0x2005;
|
||||
colorCode = 0x4000FF00;
|
||||
PPUSCROLL = 0x2005
|
||||
colorCode = 0x4000FF00
|
||||
|
||||
function onScroll(address, value)
|
||||
local state = emu.getState();
|
||||
emu.log("Scrolling change. Scanline: "..state.ppu.scanline.." Value:"..value);
|
||||
local color = colorCode + state.ppu.scanline;
|
||||
local state = emu.getState()
|
||||
emu.log("Scrolling change. Scanline: "..state.ppu.scanline.." Value:"..value)
|
||||
local color = colorCode + state.ppu.scanline
|
||||
emu.drawLine(0, state.ppu.scanline, 256, state.ppu.scanline, color, 1)
|
||||
end;
|
||||
end
|
||||
|
||||
emu.addMemoryCallback(onScroll, emu.memCallbackType.cpuWrite, PPUSCROLL);
|
||||
emu.addMemoryCallback(onScroll, emu.memCallbackType.cpuWrite, PPUSCROLL)
|
||||
emu.displayMessage("Script", "Log Parallax")
|
|
@ -104,8 +104,8 @@ function checkKeys()
|
|||
end
|
||||
end
|
||||
|
||||
emu.addEventCallback(endFrame, emu.eventType.endFrame);
|
||||
emu.addEventCallback(checkKeys, emu.eventType.inputPolled);
|
||||
emu.addEventCallback(endFrame, emu.eventType.endFrame)
|
||||
emu.addEventCallback(checkKeys, emu.eventType.inputPolled)
|
||||
|
||||
local infoStr = "Press keys from 0 to 4 to change shaders"
|
||||
emu.displayMessage("Info", infoStr)
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
-----------------------
|
||||
|
||||
function drawSafeArea()
|
||||
local red = 0x40FF0000;
|
||||
local gray = 0x60505050;
|
||||
local red = 0x40FF0000
|
||||
local gray = 0x60505050
|
||||
|
||||
emu.drawRectangle(0, 0, 256, 8, red, true)
|
||||
emu.drawRectangle(0, 232, 256, 8, red, true)
|
||||
|
@ -26,4 +26,4 @@ function drawSafeArea()
|
|||
emu.drawRectangle(16, 216, 224, 16, gray, true)
|
||||
end
|
||||
|
||||
emu.addEventCallback(drawSafeArea, emu.eventType.endFrame);
|
||||
emu.addEventCallback(drawSafeArea, emu.eventType.endFrame)
|
||||
|
|
Loading…
Add table
Reference in a new issue