ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/30/12:58:46

To: djgpp AT delorie DOT com
Subject: Re: Page Faults
Message-ID: <19961201.003702.10791.1.aclemmer@juno.com>
References: <19961129 DOT 012507 DOT 8439 DOT 1 DOT aclemmer AT juno DOT com>
<329e2296 DOT 22687782 AT news DOT ox DOT ac DOT uk>
From: aclemmer AT juno DOT com (Aaron M Clemmer)
Date: Sat, 30 Nov 1996 12:39:19 EST

On Thu, 28 Nov 1996 23:46:11 GMT mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
writes:
>Other than that, I can't see any errors. Posting the typedef, struct
>and variable declarations would be helpful.
	I've been working on this, and the problem just seems to get
stranger and stranger... 

struct vector {
	fixed32 x;  // fixed32 is just a typedef for 'long'
	fixed32 y;
 	fixed32 z;
};

typedef fixed32 matrix[4][4];

void xform_vector(matrix m, vector svect, vector *result)
	// this multiplies matrix 'm' with vector 'svect', putting the
result in 'result'
{
//  I think I managed to isolate the problem, but this is really weird...
I have all the real // code commented out, and have just one of the below
lines uncommmented...
//	result->y = m[1][3];  // this will cause a page fault
//	result->x = m[1][3];  // but this won't
// It seems totally illogical that trying to access an element of the
matrix with one // // variable works, but with the other causes a page
fault.

/*
	result->x =  FixedMul(m[0][0], svect.x) +
				 FixedMul(m[0][1], svect.y) +
				 FixedMul(m[0][2], svect.z) +
			   m[0][3];

  result->y = FixedMul(m[1][0], svect.x) +
				 FixedMul(m[1][1], svect.y) +
				 FixedMul(m[1][2], svect.z) +
			   m[1][3];

  result->z =  FixedMul(m[2][0], svect.x) +
				 FixedMul(m[2][1], svect.y) +
				 FixedMul(m[2][2], svect.z) +
			   m[2][3];
*/
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019