Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --"readtime.lua"
- --For use in MM (U) on BizHawk 1.9.1
- --Text placement assumes 640x480 resolution
- --
- --Addresses:
- --0x1EF67C is Game Time
- function display(hr,mn)
- am = "pm"
- if hr > 12 then
- hr = hr-12
- elseif hr ~= 12 then
- if hr == 0 then
- hr = 12
- end
- am = "am"
- end
- if mn > 9 then
- gui.text(290,450,hr..":"..mn..am)
- else
- gui.text(290,450,hr..":0"..mn..am)
- end
- end
- while true do
- frame = memory.read_u16_be(0x1EF67C)
- hour = math.floor(3*frame/8192)
- remain = 3*frame/8192 - hour
- minute = math.floor(3*math.floor(remain*100)/5)
- display(hour,minute)
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement