Opened 12 years ago

Closed 11 years ago

Last modified 8 months ago

#3455 closed defect (fixed)

WINCE: Save games have incorrect time & date

Reported by: spookypeanut Owned by: SF/knakos
Priority: blocker Component: Port: WinCE
Keywords: Cc:
Game:

Description

When saving and reloading games, the saved date and time are very wrong. For example, the saved game attached below (written with svn) from COMI claims it was written in the year 3888. Which it wasn't.
This doesn't only happen in COMI: I've also noticed it in MI2 (tho i haven't tested that with svn, and usually with MI2 it claims they were written in 1900). If needed, I can test other games (if I have them).

Ticket imported from: #1834822. Ticket imported from: bugs/3455.

Attachments (1)

comi.s04 (66.8 KB) - added by spookypeanut 12 years ago.
save game with date way in the future

Download all attachments as: .zip

Change History (12)

Changed 12 years ago by spookypeanut

Attachment: comi.s04 added

save game with date way in the future

comment:1 Changed 12 years ago by SF/knakos

Owner: set to SF/knakos

comment:2 Changed 12 years ago by SF/knakos

"claims it was written in the year 3888. Which it wasn't."

Now how can you be sure it wasn't? :-P

Well, I'll take a look at it. :-)

comment:3 Changed 12 years ago by sev-

Component: --Unset--
Priority: normalblocker

comment:4 Changed 12 years ago by sev-

Raising priority. This is a release-critical bug.

comment:5 Changed 12 years ago by fingolfin

Could it be that the localtime / time implementations in missing.cpp are flawed?

I really think missing.cpp should be cleared up. I recommend removing everything in it, then only re-adding what is actually needed. And then fixing those (e.g. strichr there is very bad, slow and can cause stack overwrites; so is strrchr, and I already talked about bsearch and strpbrk in another bug report...)

comment:6 Changed 12 years ago by SF/knakos

Yes, that's my guess too.

About missing.cpp: It is a graveyard of semi-dead and certainly inefficient/kludged code, which is still used actively. This has evolved from all the different compilers we have used. Not much of it can go away (we still need to include some functions to help compiling on microsoft tools, so that non-ARM cpu builds can potentially be done, such as this http://forums.scummvm.org/viewtopic.php?t=4459 ). I will put some effort to optimize and clear away that mess, sure.

comment:7 Changed 12 years ago by fingolfin

The bug is clearly in time(), which should do this, but doesn't:

"The time() function returns the value of time in seconds since 0 hours, 0
minutes, 0 seconds, January 1, 1970, Coordinated Universal Time, without
including leap seconds. "

However, in the "newer" SCUMM saveformat (header version 2, see engines/scumm/saveload.cpp), this shouldn't really matter, as long as "time+localtime" together return the correct results...

comment:8 Changed 12 years ago by fingolfin

See also patch #1859448, which adds OSystem::getTimeAndDate. Knakos, that might be interesting to you in this context.

comment:9 Changed 11 years ago by SF/knakos

Resolution: fixed
Status: newclosed

comment:10 Changed 11 years ago by SF/knakos

fixed in commits 30083, 30084 via the new gettimeanddate method.

comment:11 Changed 8 months ago by digitall

Component: --Unset--Port: WinCE
Note: See TracTickets for help on using tickets.