How to use the hachoir.field.UInt8 function in hachoir

To help you get started, we’ve selected a few hachoir examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vstinner / hachoir / hachoir / parser / game / zsnes.py View on Github external
def createFields(self):
        yield UInt8(self, "sndrot", "rotates to use A,X or Y for sound skip")
        yield UInt8(self, "sndrot2", "rotates a random value for sound skip")
        yield UInt8(self, "INTEnab", "enables NMI(7)/VIRQ(5)/HIRQ(4)/JOY(0)")
        yield UInt8(self, "NMIEnab", "controlled in e65816 loop. Sets to 81h")
        yield UInt16(self, "VIRQLoc", "VIRQ Y location")
        yield UInt8(self, "vidbright", "screen brightness 0..15")
        yield UInt8(self, "previdbr", "previous screen brightness")
        yield UInt8(self, "forceblnk", "force blanking on/off ($80=on)")
        yield UInt32(self, "objptr", "pointer to object data in VRAM")
        yield UInt32(self, "objptrn", "pointer2 to object data in VRAM")
        yield UInt8(self, "objsize1", "1=8dot, 4=16dot, 16=32dot, 64=64dot")
        yield UInt8(self, "objsize2", "large object size")
        yield UInt8(self, "objmovs1", "number of bytes to move/paragraph")
        yield UInt16(self, "objadds1", "number of bytes to add/paragraph")
        yield UInt8(self, "objmovs2", "number of bytes to move/paragraph")
        yield UInt16(self, "objadds2", "number of bytes to add/paragraph")
        yield UInt16(self, "oamaddrt", "oam address")
        yield UInt16(self, "oamaddrs", "oam address at beginning of vblank")
        yield UInt8(self, "objhipr", "highest priority object #")
github vstinner / hachoir / hachoir / parser / image / photoshop_metadata.py View on Github external
def createFields(self):
        yield Enum(UInt8(self, "labels"), BOOL)
        yield Enum(UInt8(self, "crop_marks"), BOOL)
        yield Enum(UInt8(self, "color_bars"), BOOL)
        yield Enum(UInt8(self, "reg_marks"), BOOL)
        yield Enum(UInt8(self, "negative"), BOOL)
        yield Enum(UInt8(self, "flip"), BOOL)
        yield Enum(UInt8(self, "interpolate"), BOOL)
        yield Enum(UInt8(self, "caption"), BOOL)
        yield Enum(UInt8(self, "print_flags"), BOOL)
        yield Enum(UInt8(self, "unknown"), BOOL)
github vstinner / hachoir / hachoir / parser / game / zsnes.py View on Github external
yield UInt16(self, "mode7X0", "Center X for Mode 7")
        yield UInt16(self, "mode7Y0", "Center Y for Mode 7")
        yield UInt8(self, "JoyAPos", "Old-Style Joystick Read Position for Joy 1 & 3")
        yield UInt8(self, "JoyBPos", "Old-Style Joystick Read Position for Joy 2 & 4")
        yield UInt32(self, "compmult", "Complement Multiplication for Mode 7")
        yield UInt8(self, "joyalt", "temporary joystick alternation")
        yield UInt32(self, "wramrwadr", "continuous read/write to wram address")
        yield RawBytes(self, "dmadata", 129, "dma data (written from ports 43xx)")
        yield UInt8(self, "irqon", "if IRQ has been called (80h) or not (0)")
        yield UInt8(self, "nexthdma", "HDMA data to execute once vblank ends")
        yield UInt8(self, "curhdma", "Currently executed hdma")
        yield RawBytes(self, "hdmadata", 152, "4 dword register addresses, # bytes to transfer/line, address increment (word)")
        yield UInt8(self, "hdmatype", "if first time executing hdma or not")
        yield UInt8(self, "coladdr", "red value of color to add")
        yield UInt8(self, "coladdg", "green value of color to add")
        yield UInt8(self, "coladdb", "blue value of color to add")
        yield UInt8(self, "colnull", "keep this 0 (when accessing colors by dword)")
        yield UInt8(self, "scaddset", "screen/fixed color addition settings")
        yield UInt8(self, "scaddtype", "which screen to add/sub")
        yield UInt8(self, "Voice0Disabl2", "Disable Voice 0")
        yield UInt8(self, "Voice1Disabl2", "Disable Voice 1")
        yield UInt8(self, "Voice2Disabl2", "Disable Voice 2")
        yield UInt8(self, "Voice3Disabl2", "Disable Voice 3")
        yield UInt8(self, "Voice4Disabl2", "Disable Voice 4")
        yield UInt8(self, "Voice5Disabl2", "Disable Voice 5")
        yield UInt8(self, "Voice6Disabl2", "Disable Voice 6")
        yield UInt8(self, "Voice7Disabl2", "Disable Voice 7")
        yield RawBytes(self, "oamram", 1024, "OAMRAM (544 bytes)")
        yield RawBytes(self, "cgram", 512, "CGRAM")
        yield RawBytes(self, "pcgram", 512, "Previous CGRAM")
        yield UInt8(self, "vraminctype")
        yield UInt8(self, "vramincby8on", "if increment by 8 is on")
github vstinner / hachoir / hachoir / parser / game / zsnes.py View on Github external
yield UInt8(self, "vramincby8on", "if increment by 8 is on")
        yield UInt8(self, "vramincby8left", "how many left")
        yield UInt8(self, "vramincby8totl", "how many in total (32,64,128)")
        yield UInt8(self, "vramincby8rowl", "how many left in that row (start at 8)")
        yield UInt16(self, "vramincby8ptri", "increment by how many when rowl = 0")
        yield UInt8(self, "nexthprior")
        yield UInt8(self, "doirqnext")
        yield UInt16(self, "vramincby8var")
        yield UInt8(self, "screstype")
        yield UInt8(self, "extlatch")
        yield UInt8(self, "cfield")
        yield UInt8(self, "interlval")
        yield UInt16(self, "HIRQLoc HIRQ X")

        # NEWer ZST format
        yield UInt8(self, "KeyOnStA")
        yield UInt8(self, "KeyOnStB")
        yield UInt8(self, "SDD1BankA")
        yield UInt8(self, "SDD1BankB")
        yield UInt8(self, "SDD1BankC")
        yield UInt8(self, "SDD1BankD")
        yield UInt8(self, "vramread2")
        yield UInt8(self, "nosprincr")
        yield UInt16(self, "poamaddrs")
        yield UInt8(self, "ioportval")
        yield UInt8(self, "iohvlatch")
        yield UInt8(self, "ppustatus")

        yield PaddingBytes(self, "tempdat", 477, "Reserved/Unused")
github vstinner / hachoir / hachoir / parser / game / zsnes.py View on Github external
yield UInt8(self, "multa", "multiplier A")
        yield UInt16(self, "diva", "divisor C")
        yield UInt16(self, "divres", "quotent of divc/divb")
        yield UInt16(self, "multres", "result of multa * multb/remainder of divc/divb")
        yield UInt16(self, "latchx", "latched x value")
        yield UInt16(self, "latchy", "latched y value")
        yield UInt8(self, "latchxr", "low or high byte read for x value")
        yield UInt8(self, "latchyr", "low or high byte read for y value")
        yield UInt8(self, "frskipper", "used to control frame skipping")
        yield UInt8(self, "winl1", "window 1 left position")
        yield UInt8(self, "winr1", "window 1 right position")
        yield UInt8(self, "winl2", "window 2 left position")
        yield UInt8(self, "winr2", "window 2 right position")
        yield UInt8(self, "winbg1en", "Win1 on (IN/OUT) or Win2 on (IN/OUT) on BG1")
        yield UInt8(self, "winbg2en", "Win1 on (IN/OUT) or Win2 on (IN/OUT) on BG2")
        yield UInt8(self, "winbg3en", "Win1 on (IN/OUT) or Win2 on (IN/OUT) on BG3")
        yield UInt8(self, "winbg4en", "Win1 on (IN/OUT) or Win2 on (IN/OUT) on BG4")
        yield UInt8(self, "winobjen", "Win1 on (IN/OUT) or Win2 on (IN/OUT) on sprites")
        yield UInt8(self, "wincolen", "Win1 on (IN/OUT) or Win2 on (IN/OUT) on backarea")
        yield UInt8(self, "winlogica", "Window logic type for BG1 to 4")
        yield UInt8(self, "winlogicb", "Window logic type for Sprites and Backarea")
        yield UInt8(self, "winenabm", "Window logic enable for main screen")
        yield UInt8(self, "winenabs", "Window logic enable for sub sceen")
        yield UInt8(self, "mode7set", "mode 7 settings")
        yield UInt16(self, "mode7A", "A value for Mode 7")
        yield UInt16(self, "mode7B", "B value for Mode 7")
        yield UInt16(self, "mode7C", "C value for Mode 7")
        yield UInt16(self, "mode7D", "D value for Mode 7")
        yield UInt16(self, "mode7X0", "Center X for Mode 7")
        yield UInt16(self, "mode7Y0", "Center Y for Mode 7")
        yield UInt8(self, "JoyAPos", "Old-Style Joystick Read Position for Joy 1 & 3")
        yield UInt8(self, "JoyBPos", "Old-Style Joystick Read Position for Joy 2 & 4")
github vstinner / hachoir / hachoir / parser / game / zsnes.py View on Github external
yield UInt16(self, "vramincby8var")
        yield UInt8(self, "screstype")
        yield UInt8(self, "extlatch")
        yield UInt8(self, "cfield")
        yield UInt8(self, "interlval")
        yield UInt16(self, "HIRQLoc HIRQ X")

        # NEWer ZST format
        yield UInt8(self, "KeyOnStA")
        yield UInt8(self, "KeyOnStB")
        yield UInt8(self, "SDD1BankA")
        yield UInt8(self, "SDD1BankB")
        yield UInt8(self, "SDD1BankC")
        yield UInt8(self, "SDD1BankD")
        yield UInt8(self, "vramread2")
        yield UInt8(self, "nosprincr")
        yield UInt16(self, "poamaddrs")
        yield UInt8(self, "ioportval")
        yield UInt8(self, "iohvlatch")
        yield UInt8(self, "ppustatus")

        yield PaddingBytes(self, "tempdat", 477, "Reserved/Unused")
github vstinner / hachoir / hachoir / parser / archive / ace.py View on Github external
def markerHeader(self):
    yield String(self, "signature", 7, "Signature")
    yield UInt8(self, "ver_extract", "Version needed to extract archive")
    yield UInt8(self, "ver_created", "Version used to create archive")
    yield Enum(UInt8(self, "host_os", "OS where the files were compressed"), HOST_OS)
    yield UInt8(self, "vol_num", "Volume number")
    yield TimeDateMSDOS32(self, "time", "Date and time (MS DOS format)")
    yield Bits(self, "reserved", 64, "Reserved size for future extensions")
    flags = self["flags"]
    if flags["has_av_string"].value:
        yield PascalString8(self, "av_string", "AV String")
    if flags["has_comment"].value:
        size = filesizeHandler(UInt16(self, "comment_size", "Comment size"))
        yield size
        if size.value > 0:
            yield RawBytes(self, "compressed_comment", size.value,
                           "Compressed comment")
github vstinner / hachoir / hachoir / parser / game / zsnes.py View on Github external
yield UInt8(self, "forceblnk", "force blanking on/off ($80=on)")
        yield UInt32(self, "objptr", "pointer to object data in VRAM")
        yield UInt32(self, "objptrn", "pointer2 to object data in VRAM")
        yield UInt8(self, "objsize1", "1=8dot, 4=16dot, 16=32dot, 64=64dot")
        yield UInt8(self, "objsize2", "large object size")
        yield UInt8(self, "objmovs1", "number of bytes to move/paragraph")
        yield UInt16(self, "objadds1", "number of bytes to add/paragraph")
        yield UInt8(self, "objmovs2", "number of bytes to move/paragraph")
        yield UInt16(self, "objadds2", "number of bytes to add/paragraph")
        yield UInt16(self, "oamaddrt", "oam address")
        yield UInt16(self, "oamaddrs", "oam address at beginning of vblank")
        yield UInt8(self, "objhipr", "highest priority object #")
        yield UInt8(self, "bgmode", "graphics mode 0..7")
        yield UInt8(self, "bg3highst", "is 1 if background 3 has the highest priority")
        yield UInt8(self, "bgtilesz", "0=8x8, 1=16x16 bit0=bg1, bit1=bg2, etc.")
        yield UInt8(self, "mosaicon", "mosaic on, bit 0=bg1, bit1=bg2, etc.")
        yield UInt8(self, "mosaicsz", "mosaic size in pixels")
        yield UInt16(self, "bg1ptr", "pointer to background1")
        yield UInt16(self, "bg2ptr", "pointer to background2")
        yield UInt16(self, "bg3ptr", "pointer to background3")
        yield UInt16(self, "bg4ptr", "pointer to background4")
        yield UInt16(self, "bg1ptrb", "pointer to background1")
        yield UInt16(self, "bg2ptrb", "pointer to background2")
        yield UInt16(self, "bg3ptrb", "pointer to background3")
        yield UInt16(self, "bg4ptrb", "pointer to background4")
        yield UInt16(self, "bg1ptrc", "pointer to background1")
        yield UInt16(self, "bg2ptrc", "pointer to background2")
        yield UInt16(self, "bg3ptrc", "pointer to background3")
        yield UInt16(self, "bg4ptrc", "pointer to background4")
        yield UInt16(self, "bg1ptrd", "pointer to background1")
        yield UInt16(self, "bg2ptrd", "pointer to background2")
        yield UInt16(self, "bg3ptrd", "pointer to background3")
github vstinner / hachoir / hachoir / parser / file_system / fat.py View on Github external
target_size = size.value
                if self["directory"].value:
                    if target_size:
                        size.error("(FAT) value must be zero")
                        target_size = 0
                elif not target_size:
                    return
                self.target_size = 8 * target_size
                yield InodeLink(self, "data")
        else:
            yield UInt8(self, "seq_no", "Sequence Number")
            yield String(self, "name[]", 10, "(5 UTF-16 characters)",
                         charset="UTF-16-LE")
            yield UInt8(self, "magic", "Magic number (15)")
            yield NullBytes(self, "reserved", 1, "(always 0)")
            yield UInt8(self, "checksum", "Checksum of DOS file name")
            yield String(self, "name[]", 12, "(6 UTF-16 characters)",
                         charset="UTF-16-LE")
            yield UInt16(self, "first_cluster", "(always 0)")
            yield String(self, "name[]", 4, "(2 UTF-16 characters)",
                         charset="UTF-16-LE")
github vstinner / hachoir / hachoir / parser / game / zsnes.py View on Github external
yield UInt8(self, "scaddset", "screen/fixed color addition settings")
        yield UInt8(self, "scaddtype", "which screen to add/sub")
        yield UInt8(self, "Voice0Disabl2", "Disable Voice 0")
        yield UInt8(self, "Voice1Disabl2", "Disable Voice 1")
        yield UInt8(self, "Voice2Disabl2", "Disable Voice 2")
        yield UInt8(self, "Voice3Disabl2", "Disable Voice 3")
        yield UInt8(self, "Voice4Disabl2", "Disable Voice 4")
        yield UInt8(self, "Voice5Disabl2", "Disable Voice 5")
        yield UInt8(self, "Voice6Disabl2", "Disable Voice 6")
        yield UInt8(self, "Voice7Disabl2", "Disable Voice 7")
        yield RawBytes(self, "oamram", 1024, "OAMRAM (544 bytes)")
        yield RawBytes(self, "cgram", 512, "CGRAM")
        yield RawBytes(self, "pcgram", 512, "Previous CGRAM")
        yield UInt8(self, "vraminctype")
        yield UInt8(self, "vramincby8on", "if increment by 8 is on")
        yield UInt8(self, "vramincby8left", "how many left")
        yield UInt8(self, "vramincby8totl", "how many in total (32,64,128)")
        yield UInt8(self, "vramincby8rowl", "how many left in that row (start at 8)")
        yield UInt16(self, "vramincby8ptri", "increment by how many when rowl = 0")
        yield UInt8(self, "nexthprior")
        yield UInt8(self, "doirqnext")
        yield UInt16(self, "vramincby8var")
        yield UInt8(self, "screstype")
        yield UInt8(self, "extlatch")
        yield UInt8(self, "cfield")
        yield UInt8(self, "interlval")
        yield UInt16(self, "HIRQLoc HIRQ X")

        # NEWer ZST format
        yield UInt8(self, "KeyOnStA")
        yield UInt8(self, "KeyOnStB")
        yield UInt8(self, "SDD1BankA")