Fix Rocketship wall damage flash misinterpreted as model scaling
This commit is contained in:
1 parent
b5ef5b8b64
commit
62e908e26d
13 files changed
+255
-21
No files matched your search
@@ -14,6 +14,7 @@ import struct
|
||||
|
||||
from checkpoint_script_state import EXE_SHA256, find_case, read_va
|
||||
from pe_inspect import PE
|
||||
from shrink_heading import DLL_SHA256
|
||||
|
||||
ROCKET_ID = 0x33524f43
|
||||
BODIES = (
|
||||
@@ -39,6 +40,30 @@ def f32(value):
|
||||
return struct.unpack('<f',struct.pack('<f',value))[0]
|
||||
|
||||
|
||||
def material_color_contract(original: Path | str):
|
||||
"""Guard the impact writer, material allocation and actual diffuse consumer.
|
||||
|
||||
The four floats are RGBA. Historical probe labels did not identify their
|
||||
meaning; the constructor and DLL renderer establish it independently.
|
||||
"""
|
||||
spans=[]
|
||||
for name,identity,ranges in (
|
||||
('Neutron.exe',EXE_SHA256,(
|
||||
(0x43e76e,0x43e7aa,'52fb46c6a2271fd06691be976a277a53350aaf6dd2b7083a623ffa797eb8819f'),
|
||||
(0x40dca0,0x40dcf6,'fd3810ec3db075e35a81025c0ebec5bd0c2504072306dafac78e5a818c817aff'))),
|
||||
('OMT2.dll',DLL_SHA256,(
|
||||
(0x10037874,0x100378fa,'32a2fea66ca6438d44061ba85730509d8c7509ac045001688273c65042619ae4'),)),
|
||||
):
|
||||
pe=PE(find_case(Path(original),name))
|
||||
if hashlib.sha256(pe.data).hexdigest()!=identity:raise ValueError(f'Unexpected {name} identity')
|
||||
for start,end,expected in ranges:
|
||||
if hashlib.sha256(read_va(pe,start,end-start)).hexdigest()!=expected:
|
||||
raise ValueError(f'Changed material color span at {start:x}')
|
||||
spans.append(dict(image=name,va=hex(start),end_va=hex(end),file_offset=hex(pe.offset(start-pe.base)),sha256=expected))
|
||||
return dict(spans=spans,fields={'red':0x4c,'green':0x50,'blue':0x54,'alpha':0x58},
|
||||
target='first material at Rocketship interface+500',geometry_scale=False)
|
||||
|
||||
|
||||
def collect(original: Path | str):
|
||||
pe=PE(find_case(Path(original),'Neutron.exe'))
|
||||
if hashlib.sha256(pe.data).hexdigest()!=EXE_SHA256:
|
||||
@@ -60,7 +85,7 @@ def collect(original: Path | str):
|
||||
if read_va(pe,va,len(text)+1)!=text+b'\0':raise ValueError('Changed animation binding')
|
||||
for va,fmt,value in [(0x495324,'f',20.),(0x492a58,'d',1.),(0x48e5d0,'d',.5)]:
|
||||
if struct.unpack('<'+fmt,read_va(pe,va,struct.calcsize(fmt)))[0]!=value:
|
||||
raise ValueError('Changed impact scale constant')
|
||||
raise ValueError('Changed impact color constant')
|
||||
return dict(sha256=EXE_SHA256,bodies=bodies,virtuals=[dict(table=hex(t),slot=hex(s),target=hex(v)) for t,s,v in tables],
|
||||
owned_pointer='Jimmy complete+AB0',rider_pointer='rocket complete+740/interface+680',
|
||||
reuse_id=ROCKET_ID,reuse_flag='interface+9',retained_flag='interface+11/+139=0',
|
||||
@@ -95,7 +120,7 @@ def impact_tail(active,timer,duration,impulse_flag,seconds,drive_burst=False):
|
||||
if not all(math.isfinite(v) for v in (timer,duration,seconds)) or timer<0 or duration<0 or not 0<=seconds<1:
|
||||
raise ValueError('Unsupported impact input')
|
||||
impulses=[]
|
||||
scale=None
|
||||
color=None
|
||||
drive=False
|
||||
if active:
|
||||
if impulse_flag:impulses.append(-700.)
|
||||
@@ -105,13 +130,13 @@ def impact_tail(active,timer,duration,impulse_flag,seconds,drive_burst=False):
|
||||
timer=f32(source_time)
|
||||
if source_time>duration:
|
||||
active=impulse_flag=False
|
||||
scale=(1.,1.,1.,1.)
|
||||
color=(1.,1.,1.,1.)
|
||||
drive=True
|
||||
else:
|
||||
pulse=f32((math.sin(source_time*20.)+1.)*.5)
|
||||
scale=(1.,pulse,pulse,1.)
|
||||
color=(1.,pulse,pulse,1.)
|
||||
if drive_burst:impulses.append(-750.)
|
||||
return dict(active=active,timer=timer,impulse_flag=impulse_flag,scale=scale,
|
||||
return dict(active=active,timer=timer,impulse_flag=impulse_flag,color=color,
|
||||
select_drive=drive,queued_y=impulses)
|
||||
|
||||
|
||||
@@ -165,7 +190,7 @@ static void run(const char*name,int active,float timer,float duration,int strong
|
||||
F(g,0xe88)=timer;F(g,0xec4)=duration;g[0xe84]=active;g[0xed0]=strong;g[0xec0]=burst;
|
||||
for(int i=0;i<4;i++)F(render,0x4c+i*4)=1.25f;
|
||||
selected=impulse_count=0;memset(impulses,0,sizeof(impulses));((void(TC*)(void*,float))thunk)(g,dt);
|
||||
printf("CASE %s active=%u timer=%.9g strong=%u scale=%.9g,%.9g,%.9g,%.9g drive=%d count=%d impulses=%.9g,%.9g\n",name,g[0xe84],F(g,0xe88),g[0xed0],F(render,0x4c),F(render,0x50),F(render,0x54),F(render,0x58),selected,impulse_count,impulses[0],impulses[1]);
|
||||
printf("CASE %s active=%u timer=%.9g strong=%u rgba=%.9g,%.9g,%.9g,%.9g drive=%d count=%d impulses=%.9g,%.9g\n",name,g[0xe84],F(g,0xe88),g[0xed0],F(render,0x4c),F(render,0x50),F(render,0x54),F(render,0x58),selected,impulse_count,impulses[0],impulses[1]);
|
||||
}
|
||||
int main(void){map_copy();
|
||||
run("inactive",0,.75f,1,0,.1f,0);
|
||||
|
||||
Reference in new issue
Block a user