mrcrowbar.lib.games.lostvikings module

File format classes for the games The Lost Vikings (1992) and Blackthorne (1994).

class mrcrowbar.lib.games.lostvikings.Config(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

music_port = <UInt16_LE: offset=0x14>
music_type = <UInt16_LE: offset=0x12>
pad1 = <UInt16_LE: offset=0x0>
pad2 = <UInt16_LE: offset=0xa>
pad3 = <UInt16_LE: offset=0xe>
pad4 = <UInt16_LE: offset=0x10>
pad5 = <UInt16_LE: offset=0x16>
pad6 = <UInt16_LE: offset=0x18>
pad7 = <UInt16_LE: offset=0x1a>
pad8 = <UInt16_LE: offset=0x1c>
pad9 = <UInt16_LE: offset=0x1e>
sound_dma = <UInt16_LE: offset=0x8>
sound_irq = <UInt16_LE: offset=0x6>
sound_port = <UInt16_LE: offset=0x4>
sound_type = <UInt16_LE: offset=0x2>
unk1 = <UInt16_LE: offset=0xc>
class mrcrowbar.lib.games.lostvikings.Data(*args, **kwargs)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

count = <UInt32_LE: offset=0x0>
data_raw = <Bytes: offset=<EndOffset: offsets (rw)>>
offsets = <UInt32_LE: offset=0x4, bitmask=b'\xff\xff\xff?'>
class mrcrowbar.lib.games.lostvikings.Interlace[source]

Bases: Transform

import_data(buffer)[source]

Perform a reverse-transform on a byte string.

buffer

Source byte string.

parent

Parent object of the source (to provide context for Refs).

class mrcrowbar.lib.games.lostvikings.LZSS[source]

Bases: Transform

import_data(buffer)[source]

Perform a reverse-transform on a byte string.

buffer

Source byte string.

parent

Parent object of the source (to provide context for Refs).

class mrcrowbar.lib.games.lostvikings.MetaTile(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

bottom_left = <BlockField: 0x00007f0c834711d0>
bottom_right = <BlockField: 0x00007f0c83470f30>
property repr

Plaintext summary of the Block.

top_left = <BlockField: 0x00007f0c83470830>
top_right = <BlockField: 0x00007f0c83471010>
class mrcrowbar.lib.games.lostvikings.MetaTileMap(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

metatiles = <BlockField: 0x00007f0c83471390>
class mrcrowbar.lib.games.lostvikings.Tile(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

index = <UInt16_LE: offset=0x0>
class mrcrowbar.lib.games.lostvikings.TileMap(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

tiles = <BlockField: 0x00007f0c83470750>
class mrcrowbar.lib.games.lostvikings.TileQuad(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

flip_h = <Bits16: offset=0x0, bits=0b10000>
flip_v = <Bits16: offset=0x0, bits=0b100000>
index = <Bits16: offset=0x0, bits=0b1111111111000000>
property repr

Plaintext summary of the Block.

unk1 = <Bits16: offset=0x0, bits=0b1111>