|
@@ -93,48 +93,6 @@ function prt(txt,x,y,clr,shd)
|
|
|
if shd==1 then print(txt,x-1,y+1,0,1,1,1) end
|
|
|
end
|
|
|
|
|
|
-local days = {
|
|
|
- { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335},
|
|
|
- { 366, 397, 425, 456, 486, 517, 547, 578, 609, 639, 670, 700},
|
|
|
- { 731, 762, 790, 821, 851, 882, 912, 943, 974,1004,1035,1065},
|
|
|
- {1096,1127,1155,1186,1216,1247,1277,1308,1339,1369,1400,1430},
|
|
|
-}
|
|
|
-function tstampToDateTime(epoch)
|
|
|
- epoch = tonumber(epoch)
|
|
|
- local date_time = {}
|
|
|
- date_time.second = epoch % 60; epoch = math.floor(epoch / 60)
|
|
|
- date_time.minute = epoch % 60; epoch = math.floor(epoch / 60)
|
|
|
- date_time.hour = epoch % 24; epoch = math.floor(epoch / 24)
|
|
|
-
|
|
|
- local years = epoch//(365*4+1)*4
|
|
|
- epoch = epoch % (365*4+1)
|
|
|
- dbg(epoch)
|
|
|
- local year
|
|
|
- for y = 4,1,-1 do
|
|
|
- if epoch >= days[y][1] then
|
|
|
- year = y
|
|
|
- goto yearContinue
|
|
|
- end
|
|
|
- end
|
|
|
- ::yearContinue::
|
|
|
-
|
|
|
- local month
|
|
|
- for m = 12, 1, -1 do
|
|
|
- if epoch >= days[year][m] then
|
|
|
- month = m
|
|
|
- goto monthContinue
|
|
|
- end
|
|
|
- end
|
|
|
- ::monthContinue::
|
|
|
-
|
|
|
- date_time.year = years + year + 1970 - 1
|
|
|
- date_time.month = month
|
|
|
- date_time.day = epoch - days[year][month] + 1
|
|
|
- trace(date_time.year)
|
|
|
-
|
|
|
- return string.format("%04d-%02d-%02d %02d:%02d:%02d", date_time.year, date_time.month, date_time.day, date_time.hour, date_time.minute, date_time.second)
|
|
|
-end
|
|
|
-
|
|
|
|
|
|
function remapPico(tile,x,y)
|
|
|
local outTile=tile
|
|
@@ -236,8 +194,6 @@ function updateMainGameIntro()
|
|
|
local mx,my=mouse()
|
|
|
doRainOverlay(my/136)
|
|
|
|
|
|
- prt(tstampToDateTime(tstamp()),20,30,7)
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
@@ -963,22 +919,22 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|