help with a vc

gius

Charter Member
i'm unable to delete the vc in the alpha ju 87, i've tried with the hex editor, it works with the other planes, but no with this...
 
I don't know the plane Gius, if you require help, make it easy, post a link to the exact plane, give some clues as to what hex editing you tried. I mean bytes and offsets. Be exact, then I can help.
Otherwise it's guess work and lots of wasted time.
 
Simonu,
this is the ju87 produced by alpha simulations for cfs2 and posted by watchdog22 in his section at warbirds archive. here is the link:
http://www.sim-outhouse.com/downloads/download.php?lloc=downloads&FileID=12132

i've tried with xvi32 and i've modified the first two entries of the string 00 22 00 39 00 to 00 22 00 00 00, but without success. it works in other planes such as Rebuffat's 109s.
Thanks for the help,:salute::salute::salute:
GoodBye
Gius
 
Ok I think I see, Do you understand what your hex edit is doing?
The bytes you are replacing 00 22 00 39 for 00 22 00 00,
let us decode.

BGLOP_RETURN EQU 000000022h

BGLOP_IFMASK EQU 000000039h

you are removing BGLOP_IFMASK but to understand what the command does you need to take note of the parameters too

Heres the first two occurances
Code:
00 22 00 39 00 0A 00 68 00 10 00 22 00 39 00 D8 FF 68 00 08 00
the format for BGLOP code parameters is opcode, label, variable, mask.
The label is the offset to jump if the operation is not true.

The variable is 68 and the masks are 10 and 08 respectively

heres the explanation of what gen_model does

Code:
0068 gen_model [FLAGS32] Flags describing how to draw the model see table below. 
Name If this bit is set ... Action 
GEN_MODEL_INSIDE 0001h Virtual Cockpit (VC) model is drawn. 
GEN_MODEL_OUTSIDE 0002h Exterior model is shown. 
GEN_MODEL_DOWNWARD 0008h User is looking down. 
GEN_MODEL_FRONT 0010h User is looking straight ahead. 
GEN_MODEL_REAR 0020h User is looking back. 
GEN_MODEL_NOSHADOW 1000h Shadow is not drawn. 
GEN_MODEL_DISPLAY 8000h Aircraft is displayed in the Choose Aircraft dialog box.
N.B it is common that models do not use GEN_MODEL_INSIDE. The inside is drawn by default when the outside is not.
So lets take a look at the sequence in easy to read scasm, I include the occurance of 00 39 that comes prior to the sequence you are editing as well because it starts the sequence,
BGLOP_IFMASK = IfVarAnd in scasm
Code:
 :L0010C4
      ;uName:   uOffset: 0x68
      IfVarAnd( :L0010EE 0x68 0x8002 )         ;jump to :L0010EE if exterior not drawn
      Call( :L001106 )
      RefPoint( nsi :[ -152 ] 0x04 v1= 0 v2= 28 )
      SetScaleX( :[ -164 ] 0 0 7 )
      PBHCall( :L001132 0x1C )
:L0010EC
      Return

:L0010EE                                               ;interior model start
      ;uName:   uOffset: 0x68
      IfVarAnd( :L0010F8 0x68 0x10 )         ;jump to :L0010F8 if not looking straight a head
      Return

:L0010F8
      ;uName:   uOffset: 0x68
      IfVarAnd( :[ -40 ] 0x68 0x08 )          ;jump back 40 bytes if not looking down
      Call( :L00111C )
      Return
So I can see how removing the two IfVarAnd ops would stop the VC showing but you say it doesn't work in this model. Well Look at the scasm code, wouldnt it be easier to edit the first gen_model line make the address point to the return at :L0010EC

Code:
 :L0010C4
      ;uName:   uOffset: 0x68
      IfVarAnd( :L0010EE 0x68 0x8002 )         ;change :L0010EE to :L0010EC to force a skip 
      Call( :L001106 )
      RefPoint( nsi :[ -152 ] 0x04 v1= 0 v2= 28 )
      SetScaleX( :[ -164 ] 0 0 7 )
      PBHCall( :L001132 0x1C )
:L0010EC
      Return

:L0010EE                                              
      ;uName:   uOffset: 0x68
      IfVarAnd( :L0010F8 0x68 0x10 )         
      Return

:L0010F8
      ;uName:   uOffset: 0x68
      IfVarAnd( :[ -40 ] 0x68 0x08 )          
      Call( :L00111C )
      Return
In hex just find the label and make it two bytes less
Find the gen_model parameters
00 68 00 02 80
the address is the bytes before
39 00 2A 00 68 00 02 80
make it two bytes less
39 00 28 00 68 00 02 80

I have no idea if this will work, try it at your peril.
Cheers
 
Back
Top