[quake3] Just a q...

Laurent Desnogues laurent.desnogues at wanadoo.fr
Tue Dec 6 14:00:03 EST 2005


Well this is an alignment problem:  src is aligned
on a multiple of 4 and the lines there try to force
the compiler to use double that are 8 bytes long.

That code copies a square of 16x4 bytes of memory
from src to dst where each chunk of 16 bytes is on
a line whose width is spl bytes long.

What you could do is try with the following code:

static void move4_32( byte *src, byte *dst, int spl  )
{
	int *dsrc, *ddst;
	int dspl;

	dsrc = (int *)src;
	ddst = (int *)dst;
	dspl = spl>>2;

	ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
	ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
	dsrc += dspl; ddst += dspl;
	ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
	ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
	dsrc += dspl; ddst += dspl;
	ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
	ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
	dsrc += dspl; ddst += dspl;
	ddst[0] = dsrc[0]; ddst[1] = dsrc[1];
	ddst[2] = dsrc[2]; ddst[3] = dsrc[3];
}

Of course the above code assumes that src and dst
are 4 bytes aligned.

You may also experience similar problems with
move8_32...

Well as I already said I don't know the code and did
not even try to compile it :)


		Laurent


vincent at cojot.name wrote:
> 
> Hi everyone, Tim, Ryan and Ludwig,
> 
> I'm still trying to find why the debug client will run on Solaris and 
> not the release version.. The client dies early in cl_cin.c at line 377 
> after displaying the first frame of the intro cinematics (the brown 
> wall).. The code at line 377 looks a tad strange to me but I really 
> cannot see what could be wrong.... Any ideas?
> 
> Here's the backtrace I'm getting:
> 
> (gdb) bt
> #0  move4_32 (
>     src=0x214b0c 
> "\021\n\bÿ\024\f\nÿ\032\022\020ÿ\037\024\021ÿ%\032\027ÿ\037\024\021ÿ%\032\027ÿ\"\026\021ÿ&\032\025ÿ/!\032ÿ-\037\030ÿ-\035\026ÿ8(!ÿ/!\032ÿ-\037\030ÿ-\035\026ÿ8(!ÿ(\030\022ÿ)\031\023ÿI0%ÿE,!ÿ@,$ÿ9%\035ÿ6$\035ÿ4\"\033ÿI0%ÿE,!ÿA)\036ÿD,!ÿ5!\031ÿ5!\031ÿ-\037\030ÿ$\026\017ÿ(\030\022ÿ)\031\023ÿ=)!ÿ?+#ÿ1\037\030ÿ;)\"ÿ/!\032ÿ-\037\030ÿ\037\024\021ÿ\033\020\rÿ\024\f\nÿ\032\022\020ÿ\036\026\024ÿ\027\017\rÿ\024\r\vÿ\021\n\bÿ\024\f\nÿ"..., 
> 
>     dst=0x293b00 
> "\f\a\005ÿ\023\016\fÿ\037\024\021ÿ%\032\027ÿ\036\026\024ÿ\027\017\rÿ\024\f\nÿ\032\022\020ÿ\034\021\016ÿ 
> \025\022ÿ\"\026\021ÿ&\032\025ÿ-\037\030ÿ$\026\017ÿ\"\026\021ÿ&\032\025ÿ/!\032ÿ-\037\030ÿ6$\035ÿ4\"\033ÿ6$\035ÿ4\"\033ÿ8$\034ÿA-%ÿ@,$ÿ9%\035ÿI5-ÿ>*\"ÿ(\030\022ÿ)\031\023ÿ+\033\024ÿ0 
> \031ÿ(\030\022ÿ)\031\023ÿ\"\026\021ÿ&\032\025ÿ(\030\022ÿ)\031\023ÿ5!\031ÿ5!\031ÿ-\037\030ÿ$\026\017ÿ\037\024\021ÿ\033\020\rÿ\037\024\021ÿ%\032\027ÿ\036\026\024ÿ\027\017\rÿ\017\n\bÿ\f\a\005ÿ"..., 
> spl=2048) at ../client/cl_cin.c:377
> #1  0x000324e4 in blitVQQuad32fs (status=0x4420f0, data=0x411af2 
> "V\004\023p\230Á") at ../client/cl_cin.c:534
> #2  0x00036318 in RoQInterrupt () at ../client/cl_cin.c:1198
> #3  0x000372d0 in CIN_RunCinematic (handle=4595972) at 
> ../client/cl_cin.c:1450
> #4  0x00038210 in SCR_RunCinematic () at ../client/cl_cin.c:1706
> #5  0x000430bc in CL_Frame (msec=61) at ../client/cl_main.c:2064
> #6  0x0005ee9c in Com_Frame () at ../qcommon/common.c:2796
> #7  0x00127590 in main (argc=16, argv=0xffbff6bc) at 
> ../unix/unix_main.c:1414
> 
> 






More information about the quake3 mailing list