Restore Goddard leveling and Scooter positional pitch processing
This commit is contained in:
1 parent
74be19eb15
commit
fccc0b9d1b
24 files changed
+967
-8
No files matched your search
@@ -0,0 +1,38 @@
|
||||
/* Copied4096E0/472480, source Goddard axis factors, synthetic enabled/dirty actor.
|
||||
No original game entrypoint, AI target selection, body or rendering. */
|
||||
#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};
|
||||
for(uint32_t at=start;at+4<=end;at++){
|
||||
uint32_t v;memcpy(&v,AT(at),4);
|
||||
for(unsigned i=0;i<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 targetYaw,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(0x278)=targetYaw;
|
||||
OF(0x810)=.3f;OF(0x814)=3.2f;OF(0x818)=.3f;
|
||||
for(int i=0;i<ticks;i++)((void(TC*)(void*,float))AT(0x4096e0))(object,dt);
|
||||
printf("LEVEL %s in=%.9g,%.9g,%.9g,%.9g,%.9g,%d,%d,%d out=%.9g,%.9g,%.9g\n",name,x,y,z,targetYaw,dt,ticks,enabled,dirty,OF(0x224),OF(0x228),OF(0x22c));
|
||||
}
|
||||
int main(void){
|
||||
map_source();fix(0x4096e0,0x40988d);fix(0x472480,0x472570);
|
||||
const unsigned char ready[]={0xb0,1,0xc3};memcpy(AT(0x475ca0),ready,3);
|
||||
table[0x334/4]=(uintptr_t)AT(0x472480);
|
||||
run("tilted",20,90,30,90,.1f,1,1,1);
|
||||
run("opposite",340,90,330,90,.1f,1,1,1);
|
||||
run("seam",350,359,350,1,.1f,1,1,1);
|
||||
run("negative",-20,-10,-30,20,.1f,1,1,1);
|
||||
run("equal180",180,180,180,0,.1f,1,1,1);
|
||||
run("over180",181,181,181,0,.1f,1,1,1);
|
||||
run("tick",20,90,30,90,1.f/60,1,1,1);
|
||||
run("five_seconds",20,90,30,90,1.f/60,300,1,1);
|
||||
run("upright",0,90,0,90,.1f,1,1,1);
|
||||
run("disabled",20,90,30,90,.1f,1,0,1);
|
||||
run("clean",20,90,30,90,.1f,1,1,0);
|
||||
puts("GODDARD_LEVELING_COMPLETE");return 0;
|
||||
}
|
||||
Reference in new issue
Block a user