 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
katsumoto
Joined: 27 Jul 2006 Posts: 5
|
Posted: Sun Aug 06, 2006 11:48 am Post subject: VFPU 4x4 matrix inverse |
|
|
Hello,
| Code: |
GLfloat out[16], in[16]
asm volatile (
"ulv.q c400, 0 + %1\n"
"ulv.q c410, 16 + %1\n"
"ulv.q c420, 32 + %1\n"
"ulv.q c600, 48 + %1\n"
"vzero.t c430\n"
"vtfm3.t c610, m400, c600\n"
"vneg.t c600, c610\n"
"usv.q r400, 0 + %0\n"
"usv.q r401, 16 + %0\n"
"usv.q r402, 32 + %0\n"
"usv.q c600, 48 + %0\n"
: "=m" (*out) : "m" (*in)); |
someone can fix my code? |
|
| Back to top |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Mon Aug 07, 2006 3:50 pm Post subject: |
|
|
This function that I wrote for pspgum works just fine: | Code: | void gumFastInverse(ScePspFMatrix4* m, const ScePspFMatrix4* a)
{
pspvfpu_use_matrices(gum_vfpucontext, 0, VMAT0 | VMAT1 | VMAT2);
__asm__ volatile (
"ulv.q C200, 0 + %1\n"
"ulv.q C210, 16 + %1\n"
"ulv.q C220, 32 + %1\n"
"ulv.q C230, 48 + %1\n"
"vmidt.q M000\n"
"vmmov.t M000, E200\n"
"vneg.t C100, C230\n"
"vtfm3.t C030, M200, C100\n"
"usv.q C000, 0 + %0\n"
"usv.q C010, 16 + %0\n"
"usv.q C020, 32 + %0\n"
"usv.q C030, 48 + %0\n"
: "=m"(*m) : "m"(*a) : "memory" );
} |
_________________ GE Dominator |
|
| Back to top |
|
 |
|
|
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, 2005 phpBB Group
|