The Cathedral of Attnam

Iter Vehemens ad Necem (IVAN)
Login
Username
Password


 Valid CSS  Valid HTML 4.01 Strict

64 bit ivan

The Cathedral of Attnam  >  Programming
Print

View profile
Send message
Find posts Find topics
 
Sep 1, 2008 at 1:05 pm #1  !
nukes
hedgehog


Joined: Mar 25, 2008
Posts: 9
64 bit ivan
So I spent a few hours the other day getting IVAN running on my 64 bit Gentoo system. There was a lot of odd stuff with the reference counting, then a weird problem with the fonts. All seems to work now.
I've tested it on a 32 bit freebsd 7 system too, which seems to work, so hope I've not broken too much. Let me know. Most of the changes are in FeLib, so the likes of LIVAN should be able to take from that.

As always, disable optimisation or it'll die. Also chances are saves aren't compatible with the 32 bit version (but then they might be, not tried, just a hunch).

at some point I'll get round to comparing all the produced asm with the optimised stuff and see where it's going wrong, but with the amount of pointer tricks it's unlikely that the optimiser will be able to do a decent job anyway.

So anyway, here goes:
 
 
View profile
Send message
Find posts Find topics
 
Sep 2, 2008 at 1:05 pm #2  !
nukes
hedgehog


Joined: Mar 25, 2008
Posts: 9
can't remember if I posted this before or after a certain change. In short I screwed up somewhere, probably forgetting to make install between builds. Anyway, in FeLib/Source/bitmap.cpp:

Code


void cachedfont::PrintCharacter(cblitdata B) const
{
if(B.Dest.X < 0 || B.Dest.Y < 0 || B.Dest.X + 10 >= B.Bitmap->Size.X || B.Dest.Y + 9 >= B.Bitmap->Size.Y)
{
NormalMaskedBlit(B);
return;
}

packcol16** SrcLine = &Image[B.Src.Y];
packcol16** EndLine = SrcLine + 9;
packcol16** SrcMaskLine = &MaskMap[B.Src.Y];
packcol16** DestLine = &B.Bitmap->Image[B.Dest.Y];

for(; SrcLine != EndLine; ++SrcLine, ++SrcMaskLine, ++DestLine)
{
culong* FontPtr = reinterpret_cast<culong*>(*SrcLine + B.Src.X);
culong* EndPtr = FontPtr + (20/sizeof(ulong));
culong* MaskPtr = reinterpret_cast<culong*>(*SrcMaskLine + B.Src.X);
ulong* DestPtr = reinterpret_cast<ulong*>(*DestLine + B.Dest.X);

for(; FontPtr != EndPtr; ++DestPtr, ++MaskPtr, ++FontPtr)
*DestPtr = *DestPtr & *MaskPtr | *FontPtr;
}
}



At some point I tried changing it back to 32 bit values and it didn't go too well... I'm aware that 20/8 doesn't go, but it seems to work... can't tell the difference in looks anyway.
 
 
 Print


The Cathedral of Attnam  >  Programming  >  64 bit ivan

Jump to