Opened 16 years ago

Closed 16 years ago

Last modified 5 years ago

#3455 closed defect (fixed)

WINCE: Save games have incorrect time & date

Reported by: spookypeanut Owned by: SF/knakos
Priority: blocker Component: Port: WinCE
Version: 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 16 years ago.
save game with date way in the future

Download all attachments as: .zip

Change History (12)

by spookypeanut, 16 years ago

Attachment: comi.s04 added

save game with date way in the future

comment:1 by SF/knakos, 16 years ago

Owner: set to SF/knakos

comment:2 by SF/knakos, 16 years ago

"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 by sev-, 16 years ago

Component: --Unset--
Priority: normalblocker

comment:4 by sev-, 16 years ago

Raising priority. This is a release-critical bug.

comment:5 by fingolfin, 16 years ago

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 by SF/knakos, 16 years ago

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 by fingolfin, 16 years ago

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 by fingolfin, 16 years ago

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

comment:9 by SF/knakos, 16 years ago

Resolution: fixed
Status: newclosed

comment:10 by SF/knakos, 16 years ago

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

comment:11 by digitall, 5 years ago

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