mrcrowbar.lib.games.sam module

File format classes for the Secret Agent engine (DOS, 1992)

Sources: ProGraphx tileset format http://www.shikadi.net/moddingwiki/ProGraphx_Toolbox_tileset_format

Secret Agent encryption http://www.shikadi.net/moddingwiki/Secret_Agent_encryption

class mrcrowbar.lib.games.sam.Loader[source]

Bases: Loader

post_load()[source]
class mrcrowbar.lib.games.sam.SAMEncryption(length=None)[source]

Bases: Transform

KEY = b'Copyright 1991 Peder Jungck\x00'
export_data(buffer, parent=None)[source]

Perform a transform on a byte string.

buffer

Source byte string.

parent

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

import_data(buffer, parent=None)[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.sam.SAMGfx16(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.

tilesets = <BlockField: 0x00007f0c83564410>
class mrcrowbar.lib.games.sam.SAMGfx8(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.

tilesets = <BlockField: 0x00007f0c83564910>
class mrcrowbar.lib.games.sam.SAMTileset16(*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 = <UInt8: offset=0x0>
height = <UInt8: offset=0x2>
image_data = <Bytes: offset=0x3, length=8061, transform=<mrcrowbar.lib.images.base.Planarizer object>>
mask_data = <Bytes: offset=0x3, length=8061, transform=<mrcrowbar.lib.images.base.Planarizer object>>
property plane_size
property width
width_raw = <UInt8: offset=0x1>
class mrcrowbar.lib.games.sam.SAMTileset8(*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 = <UInt8: offset=0x0>
height = <UInt8: offset=0x2>
image_data = <Bytes: offset=0x3, length=2045, transform=<mrcrowbar.lib.images.base.Planarizer object>>
mask_data = <Bytes: offset=0x3, length=2045, transform=<mrcrowbar.lib.images.base.Planarizer object>>
property plane_size
property width
width_raw = <UInt8: offset=0x1>