ivanforum ivanforum
Forum for Iter Vehemens ad Necem
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   fchat fChat   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling for big endian systems

 
Post new topic   Reply to topic    ivanforum Forum Index -> Programming
View previous topic :: View next topic  
Author Message
Capehill
giant mushroom


Joined: 08 Dec 2005
Posts: 5

PostPosted: Thu Dec 08, 2005 1:21 pm    Post subject: Compiling for big endian systems Reply with quote

I have compiled IVAN for AmigaOS 4 (PowerPC) some days ago. Sadly, I kept crashing when entering from town (or dungeon) back to the world map. Also save games didn't work.

I couldn't find any endian problems from felib/include/save.h which was the most logical suspect. After some debugging I edited main/include/proto.h a bit:

template <class type> inline inputfile& operator>>(inputfile& SaveFile, type*& Class)
{
ushort Type = 0; // used to be int
SaveFile >> (ushort&)Type;

Now the game doesn't crash anymore when moving back to the world map. However, save games don't yet work but at least the crash log is always identical now:

Symbol info:
Instruction pointer 0x7135DF6C belongs to module "ivan" (PowerPC)
Symbol: _ZNK4item9GetVolumeEv + 0x14 in section 1 offset 0x0005DF4C

Stack trace:
_ZNK4item9GetVolumeEv()+0x14 (section 1 @ 0x5df4c)
_ZN5stack4LoadER9inputfile()+0xF0 (section 1 @ 0x2d425c)
_ZN9character4LoadER9inputfile()+0x50 (section 1 @ 0x1eaa4)
_ZN8humanoid4LoadER9inputfile()+0x2C (section 1 @ 0xafc98)
_ZN10playerkind4LoadER9inputfile()+0x28 (section 1 @ 0xc7b5c)
_ZNK18characterprototype12SpawnAndLoadER9inputfile()+0x5C (section 1 @ 0x2e150)
_ZrsI9characterER9inputfileS2_RPT_()+0x88 (section 1 @ 0xcd18)
_ZN6square4LoadER9inputfile()+0x4C (section 1 @ 0xaf98)
_ZN7wsquare4LoadER9inputfile()+0x38 (section 1 @ 0x2effb8)
_ZN8worldmap4LoadER9inputfile()+0x480 (section 1 @ 0x2ebbec)
_ZrsR9inputfileRP8worldmap()+0x184 (section 1 @ 0x2ef388)
_ZN4game12LoadWorldMapERK8festring()+0x1E8 (section 1 @ 0x138f44)
_ZN4game4LoadERK8festring()+0x93C (section 1 @ 0x136b98)
_ZN4game4InitERK8festring()+0x2E8 (section 1 @ 0x133b00)


I will be investigating this when I have more time. If Mac users have problems with the game, try changing int to ushort as pasted above.

Comments?
Back to top
View user's profile Send private message
Capehill
giant mushroom


Joined: 08 Dec 2005
Posts: 5

PostPosted: Thu Dec 08, 2005 2:28 pm    Post subject: Reply with quote

Ok, found similar code in main/source/stack.cpp:

void stack::Load(inputfile& SaveFile)
{
ushort SavedItems = 0; // was int!
SaveFile >> (ushort&)SavedItems;

Now also a saved game loaded (which was nice).
Back to top
View user's profile Send private message
Capehill
giant mushroom


Joined: 08 Dec 2005
Posts: 5

PostPosted: Thu Dec 08, 2005 3:51 pm    Post subject: Reply with quote

There is also a potential problem in main/source/script.cpp:

void materialscript::Load(inputfile& SaveFile)
{
script::Load(SaveFile);
Config = 0;
SaveFile >> (ushort&)Config;
}

I haven't see this cause problems yet but maybe value should be read into a temporary ushort variable first. Config is "int" in materialscript class.
Back to top
View user's profile Send private message
lenox
zombie


Joined: 03 Jun 2005
Posts: 67
Location: suffering in a cave

PostPosted: Wed Jan 11, 2006 4:31 pm    Post subject: Reply with quote

Thanks for the info....I will give these a try on the mac build.

One question: are you using the source code from CVS? Because in that version, the devs have made some changes to the code based upon some of my mac compatibility notes.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Capehill
giant mushroom


Joined: 08 Dec 2005
Posts: 5

PostPosted: Thu Jan 12, 2006 8:02 pm    Post subject: Reply with quote

@lenox:

I used the old source, I have been too lazy&busy to check the CVS ;)

I would like to know if you get the game working on Mac too...
Back to top
View user's profile Send private message
lenox
zombie


Joined: 03 Jun 2005
Posts: 67
Location: suffering in a cave

PostPosted: Mon Jan 16, 2006 7:47 pm    Post subject: Reply with quote

As it stands I have been able to get IVAN to compile (on mac), but it will eventually crash once in the dungeon for a length of time.

Not sure how much support we'd get from the devs at the moment unfortunately, however they have been helpful in the past when the game was still being worked on.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    ivanforum Forum Index -> Programming All times are GMT


Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group