Match Jimmy controller arithmetic and facing to original probes

This commit is contained in:
UnixNight committed 2026-11-05 09:47:28 -05:00
1 parent 42ea2b8cd5
commit 0e2f426d42
60 files changed
+6027 -48

No files matched your search

+69
View File
@@ -0,0 +1,69 @@
/* Appended to airborne fixture setup. Full copied437F90, synthetic actor/world,
effect timer, jump/support, animation and inventory; no game entrypoint/body. */
static uintptr_t outer_table[0x180/4];
static unsigned char fire_effect[0x700],level_object[0x500];
static Vec acceleration,impulse;static int jump_button,inventory,pose,start_calls,stop_calls,radius_calls;static float radius;
static Vec*TC root(void*self,Vec*out){(void)self;*out=(Vec){0,100,0,1};return out;}
static Vec*TC get_accel(void*self,Vec*out){(void)self;*out=acceleration;return out;}
static void TC set_accel(void*self,float x,float y,float z){(void)self;acceleration=(Vec){x,y,z,0};}
static void TC set_impulse(void*self,float x,float y,float z){(void)self;impulse=(Vec){x,y,z,0};}
static void TC set_radius(void*self,float r){(void)self;radius=r;radius_calls++;}
static int TC jump_held(void*self){(void)self;return jump_button;}
static void TC nop(void*self){(void)self;}
static void TC start(void*self,int kind){(void)self;require(kind==2,"start gadget selector");start_calls++;}
static void TC stop(void*self){(void)self;stop_calls++;}
static void TC animation(void*self,const char*name){(void)self;pose=!strcmp(name,"JUMP")?1:!strcmp(name,"FALL")?2:!strcmp(name,"FLY")?3:0;require(pose!=0,"animation alias");}
static void TC animation_loop(void*self,const char*name,int loop){require(loop==1,"loop flag");animation(self,name);}
static int get_item(int group,int item){require(group==0&&item==3,"jetpack inventory slot");return inventory;}
static void log_nop(const char*format,...){(void)format;}
static void gauge(float value){(void)value;}
static void extend(void){
for(int i=0;i<6;i++){uint32_t*v=(void*)AT(0x4387ac+i*4);*v=(uintptr_t)AT(*v);}
for(int i=0;i<5;i++){uint32_t*v=(void*)AT(0x4387c4+i*4);*v=(uintptr_t)AT(*v);}
jump(AT(0x403950),get_item);jump(AT(0x472970),log_nop);jump(AT(0x4037f0),gauge);
for(unsigned i=0;i<sizeof(outer_table)/4;i++)outer_table[i]=(uintptr_t)missing;
outer_table[0xe0/4]=(uintptr_t)animation_loop;outer_table[0x150/4]=(uintptr_t)animation;
outer_table[0x138/4]=(uintptr_t)start;outer_table[0x140/4]=(uintptr_t)stop;
outer_table[0x148/4]=(uintptr_t)nop;outer_table[0x158/4]=(uintptr_t)jump_held;
game_table[0x270/4]=(uintptr_t)get_accel;game_table[0x278/4]=(uintptr_t)set_accel;
game_table[0x28c/4]=(uintptr_t)set_impulse;game_table[0x264/4]=(uintptr_t)set_radius;game_table[0x310/4]=(uintptr_t)root;
*(void**)AT(0x509948)=level_object;F(0x5cfc04)=-800;
}
static void one(const char*name,int state,float hold,float burn,int ground,int jump,float vy,float shadow,int item,float energy,const char*level,int gadget,float dt,float extra,int effect){
reset();*(void**)AT(0x509948)=level_object;*(void**)object=outer_table;memset(fire_effect,0,sizeof(fire_effect));
*(short*)(object+0x7e8)=state;*(short*)(object+0x7c4)=1;OF(0x874)=hold;OF(0x86c)=shadow;OF(0x884)=8;
*(void**)(object+0x7f8)=effect?fire_effect:NULL;*(float*)(fire_effect+0x6c0)=burn;
supported=ground;jump_button=jump;inventory=item;pose=start_calls=stop_calls=radius_calls=0;radius=60;
acceleration=(Vec){3,extra,5,0};impulse=(Vec){0,0,0,0};velocity=(Vec){0,vy,0,0};friction=.8f;
F(0x4f83d4)=energy;*(short*)AT(0x4f0588)=gadget;
*(uint32_t*)(level_object+0x490)=((uint32_t)level[0]<<24)|((uint32_t)level[1]<<16)|((uint32_t)level[2]<<8)|level[3];
((void(TC*)(void*,float))AT(0x437f90))(object,dt);
printf("JUMP %s in=%d,%.9g,%.9g,%d,%d,%.9g,%.9g,%d,%.9g,%s,%d,%.9g,%.9g,%d out=%d,%.9g,%.9g,%.9g,%.9g,%.9g,%d,%d,%d,%.9g,%d\n",name,state,hold,burn,ground,jump,vy,shadow,item,energy,level,gadget,dt,extra,effect,*(short*)(object+0x7e8),OF(0x874),*(float*)(fire_effect+0x6c0),impulse.y,velocity.y,acceleration.y,pose,start_calls,stop_calls,radius,radius_calls);
}
int main(void){
setup();extend();
for(int state=0;state<=5;state++)for(int held_=0;held_<=1;held_++){
char n[40];sprintf(n,"state%d_%s",state,held_?"held":"released");one(n,state,.2f,4,0,held_,20,200,1,100,"LV1B",-1,.1f,-264,1);
}
one("takeoff",0,0,0,1,1,0,75.9f,0,100,"LV1B",-1,1.f/60,0,1);
one("land_held",3,.7f,4,1,1,-40,75.9f,1,100,"LV1B",-1,.1f,880,1);
one("land_state5",5,.7f,4,1,1,-40,75.9f,1,100,"LV1B",-1,.1f,880,1);
one("hold_equal",1,.3f,0,0,1,200,200,1,100,"LV1B",-1,.1f,-264,1);
one("hold_exact_input",1,.4f,0,0,1,200,200,1,100,"LV1B",-1,0,-264,1);
one("hold_tick",1,23.f/60,0,0,1,200,200,1,100,"LV1B",-1,1.f/60,-264,1);
one("hold_over",1,.4f,0,0,1,200,200,1,100,"LV1B",-1,.001f,-264,1);
one("no_inventory",2,.2f,0,0,1,-20,200,0,100,"LV1B",-1,.1f,-264,1);
one("disabled_inventory",2,.2f,0,0,1,-20,200,4,100,"LV1B",-1,.1f,-264,1);
one("no_energy",2,.2f,0,0,1,-20,200,1,0,"LV1B",-1,.1f,-264,1);
one("tutorial_bypass",2,.2f,0,0,1,-20,200,0,0,"VR04",6,.1f,-264,1);
one("blocked_level",2,.2f,0,0,1,-20,200,1,100,"LEV3",-1,.1f,-264,1);
one("blocked_gadget",2,.2f,0,0,1,-20,200,1,100,"LV1B",7,.1f,-264,1);
one("expired_3",3,.2f,0,0,1,-20,200,1,100,"LV1B",-1,.1f,-264,1);
one("expired_4",4,.2f,-.1f,0,0,-20,200,1,100,"LV1B",-1,.1f,-264,1);
one("null_effect",2,.2f,0,0,1,-20,200,1,100,"LV1B",-1,.1f,-264,0);
one("far_burn",3,.2f,4,0,1,-20,500,1,100,"LV1B",-1,.1f,-264,1);
one("near_fall",3,.2f,4,0,1,-2,499,1,100,"LV1B",-1,.1f,-264,1);
one("near_edge",3,.2f,4,0,1,-1,499,1,100,"LV1B",-1,.1f,-264,1);
one("fraction_extra",1,.2f,4,0,0,20,200,1,100,"LV1B",-1,.1f,17.75f,1);
puts("JIMMY_JUMP_MOTION_COMPLETE");return 0;
}