04-09-2005, 12:25 AM
greets,
tried to do a simple little prog, fb goes crazy and outputs this
D:\projects\pointinpoly>fbc -r pipcoll.bas
pipcoll.asm: Assembler messages:
pipcoll.asm:56: Error: suffix or operands invalid for `mov'
pipcoll.asm:69: Error: suffix or operands invalid for `mov'
seems like reg allocation is farked up cause the thing tries mov eax, st(0). i used the 0.13 cvs version so i guess this has already been fixed right?
EDIT: just tried it with official 0.12 beta same result. problem is in matrixIdentity.
here's the source
have fun
tried to do a simple little prog, fb goes crazy and outputs this
D:\projects\pointinpoly>fbc -r pipcoll.bas
pipcoll.asm: Assembler messages:
pipcoll.asm:56: Error: suffix or operands invalid for `mov'
pipcoll.asm:69: Error: suffix or operands invalid for `mov'
seems like reg allocation is farked up cause the thing tries mov eax, st(0). i used the 0.13 cvs version so i guess this has already been fixed right?
EDIT: just tried it with official 0.12 beta same result. problem is in matrixIdentity.
here's the source
Code:
option explicit
type Vertex2D
x as single
y as single
end type
type Matrix
m( 0 to 2, 0 to 2 ) as single
end type
sub matrixIdentity ( mat as Matrix )
dim row as integer
dim col as integer
for row = 0 to 2
for col = 0 to 2
if( row = col ) then
mat.m( row, col ) = 1.0
else
mat.m( row, col ) = 0.0
end if
next col
next row
end sub
sub matrixTranslation ( mat as Matrix, x as single, y as single )
matrixIdentity ( mat )
mat.m( 0, 2 ) = x
mat.m( 1, 2 ) = y
end sub
sub matrixMultiVert2d ( mat as Matrix, vec as Vertex2D, outvec as Vertex2D )
outvec.x = vec.x * mat.m( 0, 0 ) + vec.y * mat.m( 0, 1 ) + mat.m( 0, 2 )
outvec.y = vec.x * mat.m( 1, 0 ) + vec.y * mat.m( 1, 1 ) + mat.m( 1, 2 )
end sub
screen 13
dim mat as Matrix
dim vec as Vertex2D
dim outvec as Vertex2D
matrixTranslation ( mat, 160, 100 )
vec.x = 0: vec.y = 0
matrixMultiVert2d( mat, vec, outvec )
pset( outvec.x, outvec.y ) , 4
have fun