1#pragma name_counter 245
16extern "C" void *__vt__Q23std9exception[4] __attribute__((section(
".vtables"))) = {
18 (
void *) what__Q23std9exceptionCFv};
20extern "C" void *__vt__Q23std13bad_exception[4] __attribute__((section(
".vtables"))) = {
21 (
void *) &__RTTI__Q23std13bad_exception, 0, (
void *) __dt__Q23std13bad_exceptionFv,
22 (
void *) what__Q23std13bad_exceptionCFv};
23void (*thandler__3std)() __attribute__((section(
".data"))) __attribute__((aligned(8))) = dthandler__3stdFv;
24void (*uhandler__3std)() __attribute__((section(
".data"))) __attribute__((aligned(8))) = duhandler__3stdFv;
34 virtual const char *what()
const throw();
43 virtual const char *what()
const throw();
69 unsigned char *element;
80const char ExceptionWhat[] =
"exception";
91#pragma optimize_for_size off
96 unsigned char *element;
99 constructor(element, 1);
103#pragma alignlabel reset
104#pragma optimize_for_size reset
105#pragma exceptions reset
106#pragma schedule reset
116#pragma optimize_for_size off
122 if ((array = (
char *) allocation) != NULL) {
123 unsigned int *header = (
unsigned int *) array;
124 header[0] = element_size;
128 if (constructor != NULL) {
133 constructor(element, 1);
141#pragma alignlabel reset
142#pragma optimize_for_size reset
143#pragma exceptions reset
144#pragma schedule reset
155void __dl(
void *storage)
throw() {
159#pragma exceptions reset
160#pragma schedule reset
171extern "C" void *__dt__Q23std9exceptionFv(
void **self,
short flag)
throw() {
173 *self = __vt__Q23std9exception;
183#pragma exceptions reset
184#pragma schedule reset
194extern "C" const char *what__Q23std9exceptionCFv(
const void *exception) {
196 return ExceptionWhat;
199#pragma schedule reset
207#pragma optimization_level 4
208#pragma optimize_for_size off
213extern "C" char __throw_catch_compare(
const char *thrown_type,
const char *caught_type,
long *pointer_adjustment) {
217 *pointer_adjustment = 0;
219 if ((caught = caught_type) == NULL) {
224 thrown = thrown_type;
226 if (*caught ==
'P') {
229 if (*caught ==
'C') {
233 if (*caught ==
'V') {
237 if (*caught ==
'v') {
239 if (*thrown ==
'P' || *thrown ==
'*') {
244 caught = caught_type;
251 if (*thrown++ != *caught++) {
256 if (*thrown == *caught++) {
257 if (*thrown++ ==
'!') {
260 for (offset = 0; *thrown !=
'!';) {
261 offset = offset * 10 + *thrown++ -
'0';
264 *pointer_adjustment = offset;
268 while (*thrown++ !=
'!') {
271 while (*thrown++ !=
'!') {
278 caught = caught_type + 1;
285 while ((*thrown ==
'P' || *thrown ==
'R') && *thrown == *caught) {
289 if (*caught ==
'C') {
290 if (*thrown ==
'C') {
297 if (*thrown ==
'C') {
301 if (*caught ==
'V') {
302 if (*thrown ==
'V') {
309 if (*thrown ==
'V') {
314 for (; *thrown == *caught; thrown++, caught++) {
323#pragma schedule reset
324#pragma alignlabel reset
326#pragma optimize_for_size reset
327#pragma optimization_level reset
337extern "C" void unexpected__3stdFv() {
341#pragma schedule reset
351extern "C" void terminate__3stdFv() {
355#pragma schedule reset
365extern "C" void duhandler__3stdFv() {
369#pragma schedule reset
379extern "C" void dthandler__3stdFv() {
383#pragma schedule reset
394 record->
next = __global_destructor_chain;
397 __global_destructor_chain = record;
401#pragma schedule reset
410#pragma optimization_level 4
413extern "C" void __initialize_cpp_rts(
void *first,
void *last,
void *overlay_start,
void *overlay_end) {
414 void (**initializer)() = (
void (**)()) first;
416 if ((
void (**)()) first < (void (**)()) last) {
420 }
while (initializer < (
void (**)()) last);
425#pragma optimization_level reset
426#pragma schedule reset
436char *__DecodeUnsignedNumber(
char *encoded,
unsigned int *value) {
437 unsigned int first = (
unsigned char) encoded[0];
439 if ((first & 1) == 0) {
444 unsigned int second = (
unsigned char) encoded[1];
446 if ((first & 2) == 0) {
447 *value = ((first >> 2) << 8) | second;
451 unsigned int third = (
unsigned char) encoded[2];
453 if ((first & 4) == 0) {
454 *value = ((first >> 3) << 16) | (second << 8) | third;
458 *value = ((first >> 3) << 24) | (second << 16) | (third << 8) | (
unsigned char) encoded[3];
462#pragma schedule reset
472char *__DecodeSignedNumber(
char *encoded,
int *value) {
473 signed char first = encoded[0];
475 if ((first & 1) == 0) {
480 unsigned int second = (
unsigned char) encoded[1];
482 if ((first & 2) == 0) {
483 *value = ((first >> 2) << 8) | second;
487 unsigned int third = (
unsigned char) encoded[2];
489 if ((first & 4) == 0) {
490 *value = ((first >> 3) << 16) | (second << 8) | third;
494 *value = ((first >> 3) << 24) | (second << 16) | (third << 8) | (
unsigned char) encoded[3];
498#pragma schedule reset
514#pragma schedule reset
522 unsigned char *types = spec->
types;
524 for (
unsigned int i = 0; i < spec->
count; i++) {
525 if (__throw_catch_compare(type_info, (
const char *) (types[0] | (types[1] << 8) | (types[2] << 16) | (types[3] << 24)), &adjustment)) {
544extern "C" void __unexpected(
void *exception_record) {
545 char *encoded = (
char *) ((
MWCatchRecord *) exception_record)->stack_top;
548#pragma exception_magic
550 unexpected__3stdFv();
556 if (__find_exception_spec(((
MWCatchRecord *) &__exception_magic)->type_info, &spec)) {
560 if (__find_exception_spec(
"!std::bad_exception!!", &spec)) {
567#pragma schedule reset
571static const int __unexpected_generated = 0;
572#pragma exceptions reset
574const char BadExceptionTypeName[] =
"std::bad_exception";
575const char ExceptionTypeName[] =
"std::exception";
578 {&ExceptionTypeInfo, 0},
581const MWTypeInfo __RTTI__Q23std13bad_exception = {BadExceptionTypeName, &BadExceptionBaseClasses.base};
582const char BadExceptionWhat[] =
"bad_exception";
593extern "C" void *__dt__Q23std13bad_exceptionFv(
void **self,
short flag)
throw() {
595 *self = __vt__Q23std13bad_exception;
598 *self = __vt__Q23std9exception;
609#pragma exceptions reset
610#pragma schedule reset
620extern "C" const char *what__Q23std13bad_exceptionCFv(
const void *exception) {
622 return BadExceptionWhat;
625#pragma schedule reset
634void mwInit(
int argc,
const char **argv,
const char **envp) {
645extern "C" void mwOverlayInit(
void *overlay,
int size) {
646 char *image = (
char *) overlay;
654 memset(image, 0, bss_size);
667void MWNotifyOverlayLoaded(
void *address) {}
676extern "C" int mwBload(
char *path,
void *buffer) {
680 fd = sceOpen(path, 1);
683 size = sceLseek(fd, 0, 2);
688 size = sceRead(fd, buffer, size);
705extern "C" int mwLoadOverlay(
char *path,
void *address) {
708 size = mwBload(path, address);
711 MWNotifyOverlayLoaded(address);
712 mwOverlayInit(address, size);
719static float sin_table_num = 1024.0f;
720static float sin_table_unit_1 = 162.97466f;
721static float SinTable[1024];
723void VectorMax(
float *max,
float *a,
float *b) {
724 register float *out = max;
725 register float *p0 = a;
726 register float *p1 = b;
731 vmax vf18, vf15, vf16
736void VectorMax(
float *max,
float *a,
float *b,
float *c) {
737 register float *out = max;
738 register float *p0 = a;
739 register float *p1 = b;
740 register float *p2 = c;
746 vmax vf18, vf15, vf16
747 vmax vf19, vf18, vf17
752void VectorMax(
float *max,
float *a,
float *b,
float *c,
float *d) {
753 register float *out = max;
754 register float *p0 = a;
755 register float *p1 = b;
756 register float *p2 = c;
757 register float *p3 = d;
764 vmax vf20, vf15, vf16
765 vmax vf20, vf20, vf17
766 vmax vf20, vf20, vf18
771void VectorMin(
float *min,
float *a,
float *b) {
772 register float *out = min;
773 register float *p0 = a;
774 register float *p1 = b;
779 vmini vf18, vf15, vf16
784void VectorMin(
float *min,
float *a,
float *b,
float *c,
float *d) {
785 register float *out = min;
786 register float *p0 = a;
787 register float *p1 = b;
788 register float *p2 = c;
789 register float *p3 = d;
796 vmini vf20, vf15, vf16
797 vmini vf20, vf20, vf17
798 vmini vf20, vf20, vf18
803void VectorMaxMin(
float *max,
float *min,
float *a,
float *b) {
804 register float *out_max = max;
805 register float *out_min = min;
806 register float *p0 = a;
807 register float *p1 = b;
812 vmax vf18, vf15, vf16
813 vmini vf20, vf15, vf16
814 sqc2 vf18, 0(out_max)
815 sqc2 vf20, 0(out_min)
819void VectorMaxMin(
float *max,
float *min,
float *a,
float *b,
float *c) {
820 register float *out_max = max;
821 register float *out_min = min;
822 register float *p0 = a;
823 register float *p1 = b;
824 register float *p2 = c;
830 vmax vf18, vf15, vf16
831 vmini vf20, vf15, vf16
832 vmax vf19, vf18, vf17
833 vmini vf21, vf20, vf17
834 sqc2 vf19, 0(out_max)
835 sqc2 vf21, 0(out_min)
839void VectorMaxMin(
float *max,
float *min,
float *a,
float *b,
float *c,
float *d) {
840 register float *out_max = max;
841 register float *out_min = min;
842 register float *p0 = a;
843 register float *p1 = b;
844 register float *p2 = c;
845 register float *p3 = d;
852 vmax vf20, vf15, vf16
853 vmini vf21, vf15, vf16
854 vmax vf20, vf20, vf17
855 vmini vf21, vf21, vf17
856 vmax vf20, vf20, vf18
857 vmini vf21, vf21, vf18
858 sqc2 vf20, 0(out_max)
859 sqc2 vf21, 0(out_min)
863void PlaneNormal(
float *normal,
float *v0,
float *v1,
float *v2) {
864 register float *out = normal;
865 register float *p0 = v0;
866 register float *p1 = v1;
867 register float *p2 = v2;
873 vsub vf10, vf16, vf15
874 vsub vf11, vf17, vf15
875 vopmula ACC, vf10, vf11
876 vopmsub vf12, vf11, vf10
881float DistPlanePoint(
float *normal,
float *on_plane,
float *point) {
882 sceVu0FVECTOR offset;
884 sceVu0SubVector(offset, point, on_plane);
885 return sceVu0InnerProduct(normal, offset);
888float ReflectionPlane(
float *normal,
float *on_plane,
float *point,
float *reflection) {
892 distance = 2.0f * DistPlanePoint(normal, on_plane, point);
893 sceVu0ScaleVector(step, normal, -distance);
894 sceVu0SubVector(reflection, on_plane, point);
895 sceVu0SubVector(reflection, reflection, step);
899int IntersectionPoint_line_poly3(
float *from,
float *to,
float *v0,
float *v1,
float *v2,
float *normal,
float *hit) {
907 sceVu0SubVector(line, to, from);
908 sceVu0SubVector(e0, v0, from);
909 sceVu0SubVector(e1, v1, from);
910 sceVu0SubVector(e2, v2, from);
911 above = -sceVu0InnerProduct(normal, e0);
912 along = sceVu0InnerProduct(normal, line);
918 sceVu0ScaleVector(hit, line, -above / along);
919 sceVu0AddVector(hit, hit, from);
920 return Check_Point_Poly3_XYZ(hit, v0, v1, v2, normal);
923int Check_Point_Poly3_XYZ(
float *point,
float *v0,
float *v1,
float *v2,
float *normal) {
937 sceVu0SubVector(p0, point, v0);
938 sceVu0SubVector(p1, point, v1);
939 sceVu0SubVector(p2, point, v2);
940 sceVu0SubVector(e0, v1, v0);
941 sceVu0SubVector(e1, v2, v1);
942 sceVu0SubVector(e2, v0, v2);
943 sceVu0OuterProduct(c0, e0, p0);
944 sceVu0OuterProduct(c1, e1, p1);
945 sceVu0OuterProduct(c2, e2, p2);
946 d0 = sceVu0InnerProduct(c0, normal);
947 d1 = sceVu0InnerProduct(c1, normal);
948 d2 = sceVu0InnerProduct(c2, normal);
950 if (d0 >= 0.0f && d1 >= 0.0f && d2 >= 0.0f) {
954 if (d0 <= 0.0f && d1 <= 0.0f && d2 <= 0.0f) {
965float DistVector(
float *vector) {
966 register float *pointer = vector;
968 register float length = 0.0f;
972 vmul.xyz vf4, vf4, vf4
986float DistVector(
float *a,
float *b) {
987 register float *p0 = a;
988 register float *p1 = b;
990 register float length = 0.0f;
995 vsub.xyz vf4, vf3, vf2
996 vmul.xyz vf4, vf4, vf4
1000 vadd.x vf5, vf6, vf7
1010void MulMatrix(sceVu0FMATRIX product, sceVu0FMATRIX left_matrix, sceVu0FMATRIX right_matrix) {
1011 register float *out = (
float *) product;
1012 register float *left = (
float *) left_matrix;
1013 register float *right = (
float *) right_matrix;
1024 vmulax ACC, vf1, vf5
1025 vmadday ACC, vf2, vf5
1026 vmaddaz ACC, vf3, vf5
1027 vmaddw vf20, vf4, vf5
1028 vmulax ACC, vf1, vf6
1029 vmadday ACC, vf2, vf6
1030 vmaddaz ACC, vf3, vf6
1031 vmaddw vf21, vf4, vf6
1032 vmulax ACC, vf1, vf7
1033 vmadday ACC, vf2, vf7
1034 vmaddaz ACC, vf3, vf7
1035 vmaddw vf22, vf4, vf7
1036 vmulax ACC, vf1, vf8
1037 vmadday ACC, vf2, vf8
1038 vmaddaz ACC, vf3, vf8
1039 vmaddw vf23, vf4, vf8
1047void RotMatrixY(sceVu0FMATRIX matrix,
float angle_y) {
1048 register float *out = (
float *) matrix;
1049 float angle = angle_y;
1063 matrix[2][2] = Cosf(angle);
1064 matrix[0][0] = matrix[2][2];
1065 matrix[2][0] = Sinf(angle);
1066 matrix[0][2] = -matrix[2][0];
1069void LookAtMatrixZ(sceVu0FMATRIX matrix,
float *direction) {
1070 sceVu0FMATRIX pitch;
1078 sceVu0UnitMatrix(yaw);
1079 sceVu0CopyMatrix(pitch, yaw);
1080 sceVu0Normalize(unit, direction);
1081 sceVu0CopyVector(flat, unit);
1083 ground = DistVector(flat);
1088 if (ground == 0.0f) {
1092 cosine = unit[0] / ground;
1093 sine = unit[2] / ground;
1096 pitch[1][1] = ground;
1097 pitch[1][2] = -unit[1];
1098 pitch[2][1] = unit[1];
1099 pitch[2][2] = ground;
1101 yaw[0][2] = -cosine;
1104 MulMatrix(matrix, yaw, pitch);
1107void ApplyMatrixN(sceVu0FVECTOR *out, sceVu0FMATRIX matrix, sceVu0FVECTOR *in,
int count) {
1108 register float *dst = (
float *) out;
1109 register float *m = (
float *) matrix;
1110 register float *src = (
float *) in;
1111 register int remaining = count;
1115 addi remaining, remaining, -1
1127 vmulax ACC, vf10, vf16
1128 vmadday ACC, vf11, vf16
1129 vmaddaz ACC, vf12, vf16
1130 vmaddw vf17, vf13, vf16
1131 addi remaining, remaining, -1
1143void VectorInterpolate(
float *out,
float *from,
float *to,
float step,
int mode) {
1149 sceVu0SubVector(gap, to, from);
1153 for (i = 0; i < 3; i++) {
1166 if (magnitude < step) {
1168 }
else if (delta < 0.0f) {
1169 out[i] = from[i] - step;
1171 out[i] = from[i] + step;
1177 for (i = 0; i < 3; i++) {
1178 out[i] = from[i] + gap[i] / step;
1189float AngleInterpolate(
float from,
float to,
float step,
int mode) {
1220 if (delta >= 0.0f) {
1230 offset = delta / step;
1234 result = from + offset;
1237 result -= PI * 2.0f;
1240 if (result <= -PI) {
1241 result += PI * 2.0f;
1247int AngleCmp(
float a,
float b,
float tolerance) {
1252 if (delta == 0.0f) {
1264 if (delta > tolerance) {
1268 if (delta < -tolerance) {
1275float AngleLimit(
float angle) {
1279 if (angle < PI && angle > -PI) {
1283 turns = angle / (PI * 2.0f);
1286 whole = (int) turns;
1287 angle -= PI * 2.0f * (int) turns;
1301 return (
float) rand() / 2147483648.0f;
1305 return rnd() + rnd() + rnd() + rnd() + rnd() + rnd() + rnd() + rnd() + rnd() + rnd() + rnd() + rnd() - 6.0f;
1308void CreateSinTable() {
1311 sin_table_num = 1024.0f;
1312 sin_table_unit_1 = 162.97466f;
1314 for (i = 0; i < 1024; i++) {
1315 SinTable[i] = sinf(PI * (2.0f * (
float) i) / sin_table_num);
1319float Sinf(
float angle) {
1320 if (angle >= 0.0f) {
1321 return SinTable[(int) (angle * sin_table_unit_1) % 1024];
1324 return -SinTable[(int) (-angle * sin_table_unit_1) % 1024];
1327float Cosf(
float angle) {
1328 return Sinf(PI / 2.0f + angle);
unsigned int element_size
MWRuntimeObjectFunction destructor
void(* __static_init[])()
const unsigned char __RTTI__Q23std9exception[]
void(* __static_init_end[])()
void(* MWRuntimeObjectFunction)(void *object, int mode)
MWRuntimeObjectFunction destructor
unsigned int unused_unsigned
MWRuntimeObjectFunction destructor
MWGlobalDestructor * next