Match Jimmy controller arithmetic and facing to original probes
This commit is contained in:
1 parent
42ea2b8cd5
commit
0e2f426d42
60 files changed
+6027
-48
No files matched your search
@@ -0,0 +1,41 @@
|
||||
/* Copied43A420/458F90/472480 facing, synthetic enabled/dirty actor.
|
||||
No original game entrypoint, body, AI targets or renderer. */
|
||||
#define main unused_grappler_main
|
||||
#include "grappler_scalar_probe.c"
|
||||
#undef main
|
||||
static uintptr_t table[0x340/4];
|
||||
#define OF(o) (*(float*)(object+(o)))
|
||||
static void fix(uint32_t start,uint32_t end){
|
||||
const uint32_t targets[]={0x48d914,0x48e5b0,0x48e5c0,0x48e5c4,0x4afcf0,0x4afd38};
|
||||
for(uint32_t at=start;at+4<=end;at++){
|
||||
uint32_t v;memcpy(&v,AT(at),4);
|
||||
for(unsigned i=0;i<sizeof(targets)/4;i++)if(v==targets[i]){v=(uintptr_t)AT(v);memcpy(AT(at),&v,4);at+=3;break;}
|
||||
}
|
||||
}
|
||||
static void run(const char*name,float x,float y,float z,float tx,float ty,float tz,float dt,int ticks,int enabled,int dirty){
|
||||
memset(object,0,sizeof(object));*(void**)object=table;object[5]=enabled;object[10]=dirty;
|
||||
OF(0x224)=x;OF(0x228)=y;OF(0x22c)=z;OF(0x274)=tx;OF(0x278)=ty;OF(0x27c)=tz;
|
||||
for(int i=0;i<ticks;i++)((void(TC*)(void*,float))AT(0x43a420))(object,dt);
|
||||
printf("ORIENT %s in=%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%d,%d,%d out=%.9g,%.9g,%.9g,%u\n",name,x,y,z,tx,ty,tz,dt,ticks,enabled,dirty,OF(0x224),OF(0x228),OF(0x22c),object[10]);
|
||||
}
|
||||
int main(void){
|
||||
map_source();fix(0x43a420,0x43a5cf);fix(0x472480,0x472570);
|
||||
const unsigned char ready[]={0xb0,1,0xc3};memcpy(AT(0x475ca0),ready,3);table[0x334/4]=(uintptr_t)AT(0x458f90);
|
||||
run("ordinary",10,20,30,0,30,0,.1f,1,1,1);
|
||||
run("level",338,90,338,0,90,0,1.f/60,1,1,1);
|
||||
run("seam",359,359,359,1,1,1,.1f,1,1,1);
|
||||
run("opposite_seam",1,1,1,359,359,359,.1f,1,1,1);
|
||||
run("negative",-20,-10,-30,0,20,0,.1f,1,1,1);
|
||||
run("equal180",180,180,180,0,0,0,.1f,1,1,1);
|
||||
run("positive180",0,0,0,180,180,180,.1f,1,1,1);
|
||||
run("over180",181,181,181,0,0,0,.1f,1,1,1);
|
||||
run("canonical360",360,360,360,0,0,0,.1f,1,1,1);
|
||||
run("fractional",.001f,359.999f,.001f,359.999f,.001f,359.999f,.37f,1,1,1);
|
||||
run("tiny",.01f,.01f,.01f,0,0,0,1.f/60,1,1,1);
|
||||
run("settle",338,359,338,0,1,0,1.f/60,120,1,1);
|
||||
run("upright",0,90,0,0,90,0,.1f,1,1,1);
|
||||
run("disabled",20,90,30,0,0,0,.1f,1,0,1);
|
||||
run("clean",20,90,30,0,0,0,.1f,1,1,0);
|
||||
run("zero_dt",20,90,30,0,0,0,0,1,1,1);
|
||||
puts("JIMMY_ORIENTATION_COMPLETE");return 0;
|
||||
}
|
||||
Reference in new issue
Block a user