#include <stdio.h>
#include <string.h>
#include "mac.h"
#include "../../common/platform.h"
#include "../../common/common_utils.h"
#include "../../loaders/tga.h"
#include "../../memory/memory.h"
#include "../../string/wtstring.h"
#include "../../filesys/file.h"

Data Structures | |
| struct | spriteRun |
Functions | |
| PRIVATE W8 * | getResourceBlock (W32 offset, W32 length, W32 *glen) |
| Get block of resource data. | |
| PRIVATE void | Decode_LZSS (W8 *dst, const W8 *src, W32 length) |
| Decodes a block of data that was encoded with LZSS. | |
| PRIVATE void | ConvertPaletteToRGB (W8 *dst, W8 *src, W32 length, W8 *palette) |
| Convert 256 palette data to RGB. | |
| PRIVATE void | setPalette (W32 offset) |
| Set global palette. | |
| PRIVATE void | DecodeBJMapImage (W32 offset, W32 length) |
| Decodes BJ map image and writes data to tga file. | |
| PRIVATE void | DecodeBJIntermImages (W32 offset, W32 length) |
| Decodes BJ intermission images and writes data to tga file. | |
| PRIVATE void | DecodeScreen (W32 offset, W32 length, const char *filename) |
| Decode screen from Macintosh resource fork. | |
| PRIVATE void | decodeScreens (void) |
| Decodes art data from Macintosh resource fork. | |
| PRIVATE W8 * | obverseWall (const W8 *src, W16 width, W16 height) |
| Realign wall image. | |
| PRIVATE void | DecodeWall (W32 offset, W32 length, W32 *retval, const char *filename) |
| Decode then save wall data as TARGA image file. | |
| PRIVATE void | decodeWalls (void) |
| Extract wall image data from resource fork. | |
| PRIVATE void | DecodeSprite (W32 offset, W32 length, W32 *retval, const char *filename) |
| Decode then save sprite data as TARGA image file. | |
| PRIVATE void | decodeSprites (void) |
| Extract sprites from resource fork. | |
| PRIVATE W8 * | DecodeItem (W8 *data, W8 *pal) |
| Convert item data into RGB raw data. | |
| PRIVATE void | decodeItems (void) |
| Extract pic images from resource file. | |
| PRIVATE void | decodeMidi (void) |
| Extract midi files from resource fork. | |
| PRIVATE wtBoolean | parseMacBinaryHead (void) |
| Parse mac binary header. | |
| PUBLIC void | Macintosh_Decoder (void) |
| Interface to Macintosh data extractor. | |
| PUBLIC void | wolf3do_decoder (void) |
| Interface to Wolfenstein 3DO data extractor. | |
Variables | |
| PRIVATE W32 | DATAFORKLENGTH = 105754L |
| PRIVATE W32 | RESFORKLENGTH = 2424697L |
| PRIVATE W32 | MACPAL = 898370L |
| PRIVATE W32 | IDPAL = 899142L |
| PRIVATE W32 | GAMEPAL = 946811L |
| PRIVATE W32 | INTERPAL = 997211L |
| PRIVATE W32 | YUMMYPAL = 1011345L |
| PRIVATE W32 | TITLEPAL = 2235007L |
| PRIVATE W32 | PALETTE_SIZE = 768 |
| PRIVATE const char * | MAC_FEXT = "*.MAC" |
| PRIVATE const char * | MACBINFILENAME = "Wolfenstein 3D" |
| PRIVATE const char * | FILETYPECREATOR = "APPLWOLF" |
| PRIVATE W8 * | macPalette |
| PRIVATE FILE * | fResHandle |
| PRIVATE void ConvertPaletteToRGB | ( | W8 * | dst, | |
| W8 * | src, | |||
| W32 | length, | |||
| W8 * | palette | |||
| ) |
Convert 256 palette data to RGB.
| [in,out] | dst | Destination buffer to convert to. |
| [in] | src | 256 palette data. |
| [in] | length | Length of source data. |
| [in] | palette | Pointer to 256*3 array. |

| PRIVATE void Decode_LZSS | ( | W8 * | dst, | |
| const W8 * | src, | |||
| W32 | length | |||
| ) |
Decodes a block of data that was encoded with LZSS.
| [in,out] | dst | Buffer to hold uncompressed data. |
| [in] | src | Compressed data block. |
| [in] | Length | Length of source data block in bytes. |

| PRIVATE void DecodeBJIntermImages | ( | W32 | offset, | |
| W32 | length | |||
| ) |
Decodes BJ intermission images and writes data to tga file.
| [in] | offset | Offset in bytes the resource block. |
| [in] | length | Length of encoded data in bytes. |


| PRIVATE void DecodeBJMapImage | ( | W32 | offset, | |
| W32 | length | |||
| ) |
Decodes BJ map image and writes data to tga file.
| [in] | offset | Offset in bytes the resource block. |
| [in] | length | Length of encoded data in bytes. |


| PRIVATE W8* DecodeItem | ( | W8 * | data, | |
| W8 * | pal | |||
| ) |
Convert item data into RGB raw data.
| [in] | data | data chunk to decode. |
| [in] | pal | palette. |

| PRIVATE void DecodeScreen | ( | W32 | offset, | |
| W32 | length, | |||
| const char * | filename | |||
| ) |
Decode screen from Macintosh resource fork.
| [in] | offset | Offset in bytes the resource block. |
| [in] | length | Length of encoded data in bytes. |
| [in] | filename | Name of file to save as. |


| PRIVATE void DecodeSprite | ( | W32 | offset, | |
| W32 | length, | |||
| W32 * | retval, | |||
| const char * | filename | |||
| ) |
Decode then save sprite data as TARGA image file.
| [in] | offset | Offset from the start of the resource file in bytes. |
| [in] | length | Length of data block in bytes. |
| [out] | retval | Length of next data block in bytes. |
| [in] | filename | Name of file to save as. |


| PRIVATE void DecodeWall | ( | W32 | offset, | |
| W32 | length, | |||
| W32 * | retval, | |||
| const char * | filename | |||
| ) |
Decode then save wall data as TARGA image file.
| [in] | offset | Offset from the start of the resource file in bytes. |
| [in] | length | Length of data in bytes. |
| [out] | retval | Length of next block in bytes. |
| [in] | filename | Name of file to save as. |


| PRIVATE W8* getResourceBlock | ( | W32 | offset, | |
| W32 | length, | |||
| W32 * | glen | |||
| ) |
Get block of resource data.
| [in] | offset | Number of bytes from start of file. |
| [in] | length | Length of resource block. |
| [in] | glen | Next four bytes after block. |

| PRIVATE W8* obverseWall | ( | const W8 * | src, | |
| W16 | width, | |||
| W16 | height | |||
| ) |
Realign wall image.
| [in] | src | Source data. |
| [in] | width | Width of wall image in pixels. |
| [in] | height | Height of wall image in pixels. |

| PRIVATE wtBoolean parseMacBinaryHead | ( | void | ) |
Parse mac binary header.

| PRIVATE void setPalette | ( | W32 | offset | ) |
Set global palette.
| [in] | offset | Offset of palette in resource file. |

