Hunting Down Invalid BGL Opcodes

dvslats

Charter Member
Hi All,
Would anyone know how to find these in a .sca file ?

An example from the log .txt

Code:
[3]  BGL_RESLIST (0x1A) found at 0x1E6342
                        [4]  Interpolation Table found at 0x1E6414
                        [4]  BGL_RETURN (0x22) found at 0x1E64BE
                        [4]  Interpolation Table found at 0x1E64C0
                        [4]  BGL_RETURN (0x22) found at 0x1E64C2
                        ....................................................................................................Invalid BGL Opcodes [COLOR=red](0x43)[/COLOR] found at [COLOR=red]0x1E64C4[/COLOR]
                        [4]  Interpolation Table found at 0x1E64C6
                        [4]  BGL_RETURN (0x22) found at 0x1E64C8
                        [4]  BGL_IFIN1 (0x24) found at 0x1E64CA

What would 0x1E64C4 translate to in scasm ?

Thanks In Advance, Dave
 
Hi Dave, are you compiling an .asm with bglc? and it is throwing an error?

the opcode 0x43 is a valid opcode

BGLOP_NEW_TEXTURE EQU 000000043h
Technical info from fs2k sdk

Code:
BGL_TEXTURE2 (0x43) – Loads a texture map to cover a surface (polygon).  This is also an implied BGL_SURFACE.

    Length    variable (contained in the command)
    ENUM16    opcode    BGLOP_TEXTURE2 = 0x43
    UINT16    length    total length of the command in bytes
    UINT16    index    internal index MUST BE 0
    FLAGS8    characteristics    the characteristics of this texture
        category:3    bits 0-2 category of this texture.  Used to be able to
            turn these categories on and off, but that was 
            removed in version 7.0.  (0 = None, 1 = aircraft, 2 = 
            map, 3 = water, 4 = sky, 5 = ground, 6 = buildings, 
            7 = effects)
        season_spring:1    bit 3 has spring seasonal texture (a “_SP” is 
            appended to the base name for the spring texture 
            name)
        season_fall:1    bit 4 has fall seasonal texture (a “_FA” is appended 
            to the base name for the fall texture name)
        season_winter:1    bit 5 has a winter seasonal texture (a “_WI” is 
            appended to the base name for the fall texture 
            name)
        season_hard:1    bit 6 has a hard winter texture (a “_HW” is 
            appended to the base name for the hard winter 
            texture name)
        light_map:1    bit 7 has a light map texture that can be blended at 
            dawn and dusk (a “_LM” is appended to the base 
            name for the light map texture name)
    UINT8    checksum    internal checksum MUST BE 0
    UNICOL    color    fall back color until the texture loads or if it does 
            not load
    STRINGZ    name [], 0, [0]    filename of the texture.  Must be terminated with a 
            0.  Another 0 is added if it is an odd length.



What would 0x1E64C4 translate to in scasm?
Well
0x1E64C4 is a byte offset. Open the file in a hex editor and you will find it easily.
BGLC and SCASM both use symbolic lables, in scasm a label starts: it could be :L001E64C4 but it is a label it could be :anylabelyoulike and still be valid.
 
Hey There simonu,
are you compiling an .asm with bglc? and it is throwing an error?
Yes sir, that's what I'm attempting to do. They are some extremal stores from an Fs9 model. Don't want to say from what on a public forum, but that's what it is.

With what you have posted in your reply, me thinks now that the light map is the bugger. I got bit from that byte. :kilroy:

Thanks Simon for giving my brain a kick start.
Dave
 
Back
Top