Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#4691 closed defect (fixed)

PSP: KYRA broken

Reported by: bluddy Owned by:
Priority: normal Component: Port: PSP
Version: Keywords:
Cc: Game:

Description

Since around the release of 1.0.0rc, Kyrandia has been broken in trunk when playing on PSP. I assume this is because of additions to support LOL, but I just want the maintainers to be aware of this. For example, Kyrandia 2 gets to the menu, but crashes upon starting a new game. Kyrandia 1 also cannot get in -game.

Ticket imported from: #2887707. Ticket imported from: bugs/4691.

Change History (15)

comment:1 by lordhoto, 15 years ago

Well Lands of Lore is not enabled by default in trunk, so unless you include it yourself I fail to see why there should be a connection. So far there had been no other reports about certain platforms failing to run KYRA. Maybe it is a PSP specific bug? (Maybe even in the PSP backend?). Or maybe it's just plain out of memory because you enable all engines in your build? (KYRA usually didn't use that much of memory though ;-).

Since it works fine on all systems I have access to, I'm afraid I can't do anything to fix it without at least any further information, which revision broke it actually or in which function it crashes.

Marking it as PSP specific problem till there's further information.

comment:2 by lordhoto, 15 years ago

Summary: KYRANDIA broken in trunkPSP: KYRA broken

comment:3 by bluddy, 15 years ago

I have to admit that it's strange that it works well on other platforms. It's also unfortunate that it doesn't crash upon startup but only after loading the main screen. It's most certainly not a memory problem... I'll have to dig through the patches to find which one caused it.

comment:4 by bluddy, 15 years ago

Hold on - would enabling LOL cause a problem with KYRA? Because I do enable it as well as most other things when building my trunk version.

comment:5 by lordhoto, 15 years ago

No, it shouldn't cause any problems (except increased memory use for the additional code).

comment:6 by bluddy, 15 years ago

OK now I remember why it's so hard to debug this game... I'm having issues with respect to kyra.dat when I try to go back to a previous revision.

comment:7 by lordhoto, 15 years ago

Well you have to copy over the ScummVM executable you build anyway. So it shouldn't be too hard to copy over a correct kyra.dat version from dists/engine-data too ;-).

comment:8 by bluddy, 15 years ago

Yeah... I guess the problem is with the shell setup used to debug the PSP. I really need it for error messages/not losing my sanity from having to constantly reset the PSP. It reads some stuff from the PC hard drive (like the ELF) but if I put the kyra.dat there it doesn't read it... maybe because of the way the file is read in Scummvm. I guess I'll have to copy it to the kyrandia folder on the PSP every time which is a pain.

comment:9 by lordhoto, 15 years ago

Actually ScummVM searches for kyra.dat in the following locations: the cwd ("."), extrapath (whatever you set your "extrapath" config variable to) and the game dir. So if you can set extrapath to that specific directory on your PC, it should work fine (I don't know whether this is possible though).

comment:10 by lordhoto, 15 years ago

Oh and just btw. you could change line 199 in engines/kyra/staticres.cpp from: if (version != RESFILE_VERSION) to if (version >= RESFILE_VERSION)

Usually that isn't safe, but since no Kyrandia entries in kyra.dat should have been touched really, it should work at least and would let you "bypass" the need to update kyra.dat constantly. Of course that change isn't safe for the public, since it is not safe to assume that all newer versions are still using the same format.

comment:11 by bluddy, 15 years ago

OK that last one should be VERY helpful since, just to illustrate how frustrating this search is, I try to find a subversion revision number that seems reasonable. Half of the time, I can't even link the code because that revision wasn't stable. Half of the remaining time, even taking the kyra.dat from /dists/engine_data/ won't work (and I'm really not sure why). It would also be helpful (in general) if there was one message for a missing kyra.dat and one for incorrect versions, maybe even displaying the versions.

comment:12 by lordhoto, 15 years ago

Broken linking? What's the cause of this? I just remember some revisions, which were broken, because of some WIP SCI changes, but just disabling all engines except kyra looks sensible anyway, if you can rule out memory issues, so there should be no problem.

Also I can't remember any version, where the kyra.dat from dists/engine-data isn't working with the code base. Any specific revisions where you noticed that?

About the error message: first of all the user has no way of telling, which kyra.dat version he has, thus a version string in the error message would be rather confusing to the user. Next the code searches through all kyra.dat files in the path and tries to pick a working one: So which "incorrect" versions should be displayed: all? just of the last one tried? just the newest one? Should the path(s) be included?

comment:13 by bluddy, 15 years ago

OK the bug was really in the PSP's plugin module code. Really, it's because gcc/ld does 2 really unexpected things that could almost be termed bugs:

1. It accesses the $gp addressable section with other relocations like LO and HI16 and with MIPS_32. 2. It bunches groups of LO and HI16 relocations in different sections e.g. HI16 for 0x000f1330 followed by a LO16 for the same address and then a LO16 for 0x08342210. This is not really supposed to happen as far as I can tell, but I put in a workaround.

Kyrandia was the only engine that picked up on these 2 issued because it's the only one that had arrays of 8 bytes that therefore went in the $gp addressable section. However, had we enlarged that section (using -Gnum) we would have had more of these issues in more games, so I'm glad Kyra caught them first.

Thanks for bearing with me.

comment:14 by bluddy, 15 years ago

Resolution: fixed
Status: newclosed

comment:15 by digitall, 6 years ago

Component: Port: PSP
Note: See TracTickets for help on using tickets.