65 lines
4.0 KiB
C
65 lines
4.0 KiB
C
/* Copied ordinary ground keyboard suffix and actual Jimmy facing/Euler leaves.
|
|
Synthetic supported actor, no full scheduler/body/AI/camera/render execution.
|
|
This probes retention; it does not establish absence of another scene writer. */
|
|
#define main unused_grappler_main
|
|
#include "grappler_scalar_probe.c"
|
|
#undef main
|
|
typedef struct { float x,y,z,w; } Vec4;
|
|
static uintptr_t game_table[0x440/4],outer_table[0x180/4];
|
|
#define VEC(o) (*(Vec4*)(object+0xc0+(o)))
|
|
#define OF(o) (*(float*)(object+(o)))
|
|
static void TC animate(void*self,void*name){(void)self;(void)name;}
|
|
static void fix(uint32_t start,uint32_t end){
|
|
const uint32_t targets[]={/* RELOCATIONS */};
|
|
for(uint32_t a=start;a+4<=end;a++){
|
|
uint32_t v;memcpy(&v,AT(a),4);
|
|
for(unsigned i=0;i<sizeof(targets)/4;i++)if(v==targets[i]){v=(uintptr_t)AT(v);memcpy(AT(a),&v,4);a+=3;break;}
|
|
}
|
|
}
|
|
static void*input_entry(void){
|
|
unsigned char*c=VirtualAlloc(NULL,256,MEM_COMMIT|MEM_RESERVE,PAGE_EXECUTE_READWRITE),*p=c;require(c!=NULL,"wrapper");
|
|
emit_byte(&p,0x53);emit_byte(&p,0x55);emit_byte(&p,0x56);emit_byte(&p,0x57);
|
|
emit_byte(&p,0x81);emit_byte(&p,0xec);word(&p,0x90);
|
|
emit_byte(&p,0xbd);word(&p,(uintptr_t)object);
|
|
emit_byte(&p,0x31);emit_byte(&p,0xff);
|
|
emit_byte(&p,0xba);word(&p,1);emit_byte(&p,0x31);emit_byte(&p,0xf6);
|
|
emit_byte(&p,0xbb);word(&p,(uintptr_t)(object+0x9bc));
|
|
const int slots[]={0x14,0x18,0x1c};
|
|
for(int i=0;i<3;i++){emit_byte(&p,0xc7);emit_byte(&p,0x44);emit_byte(&p,0x24);emit_byte(&p,slots[i]);word(&p,0);}
|
|
jump(p,AT(0x43915d));p+=5;unsigned char*end=p;
|
|
emit_byte(&p,0x81);emit_byte(&p,0xc4);word(&p,0x90);emit_byte(&p,0x5f);emit_byte(&p,0x5e);emit_byte(&p,0x5d);emit_byte(&p,0x5b);emit_byte(&p,0xc3);
|
|
jump(AT(0x4395cf),end);return c;
|
|
}
|
|
static void vec(Vec4 v){printf("[%.9g,%.9g,%.9g,%.9g]",v.x,v.y,v.z,v.w);}
|
|
static void snapshot(void){
|
|
printf("{\"current\":");vec(VEC(0x224));printf(",\"target\":");vec(VEC(0x274));printf(",\"dirty\":%u}",object[0xca]);
|
|
}
|
|
static void one(const char*name,void(*input)(void),Vec4 current,Vec4 target,int up,int left,int dirty){
|
|
memset(object,0,sizeof(object));*(void**)object=outer_table;*(void**)(object+0xc0)=game_table;
|
|
memset(AT(0x509830),0,0x1d0);*(short*)AT(0x4f0588)=-1;*(void**)AT(0x5099e4)=object+0xc0;
|
|
OF(0x6bc)=30;OF(0x6c0)=35;OF(0x6c4)=600;object[0xc5]=1;object[0xca]=dirty;
|
|
VEC(0x224)=current;VEC(0x274)=target;*AT(0x50985e)=up;*AT(0x50985d)=left;
|
|
printf("LANDING {\"name\":\"%s\",\"up\":%d,\"left\":%d,\"before\":",name,up,left);snapshot();
|
|
input();printf(",\"after_input\":");snapshot();
|
|
if(!up&&!left)require(!memcmp(&target,&VEC(0x274),sizeof(Vec4)),"neutral preserves all destination components");
|
|
else require(VEC(0x274).x==0&&VEC(0x274).z==0&&object[0xca]==1,"active steering publishes upright dirty target");
|
|
((void(TC*)(void*,float))AT(0x43a420))(object+0xc0,1.f/60);
|
|
printf(",\"after_facing\":");snapshot();
|
|
for(int i=1;i<300;i++){input();((void(TC*)(void*,float))AT(0x43a420))(object+0xc0,1.f/60);}
|
|
printf(",\"after_300\":");snapshot();puts("}");
|
|
}
|
|
int main(void){
|
|
setbuf(stdout,NULL);map_source();fix(0x43915d,0x4395cf);fix(0x43a420,0x43a5cd);fix(0x472480,0x472570);
|
|
const unsigned char ready[]={0xb0,1,0xc3};memcpy(AT(0x475ca0),ready,3);
|
|
game_table[0x328/4]=(uintptr_t)AT(0x4723f0);game_table[0x36c/4]=(uintptr_t)AT(0x472660);game_table[0x334/4]=(uintptr_t)AT(0x458f90);
|
|
outer_table[0x150/4]=(uintptr_t)animate;void(*input)(void)=input_entry();
|
|
one("neutral_last_air_roll",input,(Vec4){1,155,355,1},(Vec4){0,155,-5,7},0,0,1);
|
|
one("neutral_last_air_roll_positive",input,(Vec4){359,45,4,1},(Vec4){0,45,3,7},0,0,1);
|
|
one("neutral_last_air_forward",input,(Vec4){325,290,340,1},(Vec4){-40,290,-25,7},0,0,1);
|
|
one("neutral_last_air_backward",input,(Vec4){8,359,12,1},(Vec4){10,359,15,7},0,0,1);
|
|
one("clean_tilt_retained",input,(Vec4){10,155,15,1},(Vec4){0,155,0,7},0,0,0);
|
|
one("forward_levels",input,(Vec4){325,290,340,1},(Vec4){-40,290,-25,7},1,0,1);
|
|
one("left_levels",input,(Vec4){325,290,340,1},(Vec4){-40,290,-25,7},0,1,1);
|
|
puts("JIMMY_LANDING_ROTATION_COMPLETE");return 0;
|
|
}
|