I am new in psp programing, in inline assembly coding and I am new in this forum too :).
I am trying to code a simple little 3d engine. Now, I was coding a simple function to multiply two matrix, but i have some problems with inline assembly code.
This is my code:
Code: Select all
void multMatrix(float *matrix1, float *matrix2)
{
	__asm__ volatile(
		"lv.q c000,  0 + %0\n"
		"lv.q c010, 16 + %0\n"
		"lv.q c020, 32 + %0\n"
		"lv.q c030, 48 + %0\n"
		"lv.q c100,  0 + %1\n"
		"lv.q c110, 16 + %1\n"
		"lv.q c120, 32 + %1\n"
		"lv.q c130, 48 + %1\n"
		"vmmul.q m200, m000, m100\n"
		"sv.q c200,  0 + %1\n"
		"sv.q c210, 16 + %1\n"
		"sv.q c220, 32 + %1\n"
		"sv.q c230, 48 + %1\n"
		::"m" (matrix1[0]),
		  "m" (matrix2[0]));
}Maybe my problem is shift registers. I don´t know.
Can someone help me to fix this??
Edited:
I have discovered that always I use lv or sv to load and store data, I get a freeze psp. But when I use mtv/mfv it works.
Generally, somebody knows how to save/load a 4x4 matrix to/from vfpu using simple vfpu instructions (without GUM)??
Thanks