I am coding using windows Lua Player. I want to display battery/memory information. The following works on my PSP but not on windows:
Code: Select all
screen:print (10,10,"battery: " .. System.powerGetBatteryLifePercent(),Color.new(255,255,255))
screen:print (10,30,"Free Mem: " .. System.getFreeMemory(),Color.new(255,255,255))
screen.flip()
screen.waitVblankStart()
pad = Controls.read()
while not pad:start() do
pad = Controls.read()
end
error: sysinfo.lua:4: attempt to call field `getFreeMemory' (a nil value)
So it looks like the getFreeMemory function is not support under windows. Fair enough I don't really need it supported under windows. That said I would like to be able to run this code under windows. Is it possible to tell what version/platform the lua player is so I could do something like
Code: Select all
if System.Platform() == "windows" then
FreeMem = 0
else
FreeMem = System.getFreeMemory()
end
screen:print (10,30,"Free Mem: " .. FreeMem ,Color.new(255,255,255))
Thanks,
JC