Mesen-X/GUI.NET/Dependencies/LuaScripts/NtscSafeArea.lua
Jeremy Chadwick a891307efc 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
2019-05-22 20:09:27 -04:00

29 lines
910 B
Lua

-----------------------
-- Name: NTSC Safe Area
-- Author: Sour
-----------------------
-- Displays an overlay based on tepples' "Safe Area on 5.37Mhz NTSC VDPs" diagram
-- Source: https://wiki.nesdev.com/w/index.php/File:Safe_areas.png
--
-- Red: "Danger Zone" (Top and bottom 8 pixels)
-- Most TVs hide all of this.
--
-- Gray: Outside the "Title Safe Area".
-- Some TVs may hide portions of this.
-- Text, etc. should not appear here.
-----------------------
function drawSafeArea()
local red = 0x40FF0000
local gray = 0x60505050
emu.drawRectangle(0, 0, 256, 8, red, true)
emu.drawRectangle(0, 232, 256, 8, red, true)
emu.drawRectangle(0, 8, 16, 224, gray, true)
emu.drawRectangle(240, 8, 16, 224, gray, true)
emu.drawRectangle(16, 8, 224, 16, gray, true)
emu.drawRectangle(16, 216, 224, 16, gray, true)
end
emu.addEventCallback(drawSafeArea, emu.eventType.endFrame)