From 0a4e32c794a974a6b106d72db583a6edf7ae4363 Mon Sep 17 00:00:00 2001 From: Marrub Date: Tue, 5 Feb 2019 00:10:54 -0500 Subject: [PATCH] unindent MarathonData --- MarathonData.md | 656 ++++++++++++++++++++++++------------------------ 1 file changed, 326 insertions(+), 330 deletions(-) diff --git a/MarathonData.md b/MarathonData.md index 68f1c29..6e3f0cb 100644 --- a/MarathonData.md +++ b/MarathonData.md @@ -1,17 +1,17 @@ # LICENSING ################################################################### - To the extent possible under law, I, Alison Sanderson, have waived all - copyright and related or neighboring rights to this Document as described - by the Creative Commons Zero license linked below. +To the extent possible under law, I, Alison Sanderson, have waived all +copyright and related or neighboring rights to this Document as described by +the Creative Commons Zero license linked below. - + - All of the information in this Document is original research. Marathon and - Forge are owned by Bungie, Inc. QuickDraw, QuickTime and Macintosh are owned - by Apple. Aleph One (also referred to as A1 in this Document) is owned by - Bungie, Inc. et al. Igni Ferroque, Ferro, and Atque are owned by Gregory - Smith (treellama.) Maraiah is owned by Project Golan. Any other copyrights - belong to their respective owners. +All of the information in this Document is original research. Marathon and +Forge are owned by Bungie, Inc. QuickDraw, QuickTime and Macintosh are owned by +Apple. Aleph One (also referred to as A1 in this Document) is owned by Bungie, +Inc. et al. Igni Ferroque, Ferro, and Atque are owned by Gregory Smith +(treellama.) Maraiah is owned by Project Golan. Any other copyrights belong to +their respective owners. # CONTENTS #################################################################### @@ -25,68 +25,68 @@ | ENUMERATIONS | Names for integers used in Marathon's structures. | | FLAGS | Names for bit field flags used in Marathon's structures. | - You can scroll through sections of this document by searching for `/^# /`. - Specific sections can be searched by their name here. +You can scroll through sections of this document by searching for `/^# /`. +Specific sections can be searched by their name here. # TERMINAL CODE ############################################################### - The terminal definition format is extremely straightforward. - Terminal commands begin lines and are in the format: +The terminal definition format is extremely straightforward. Terminal commands +begin lines and are in the format: ``` - #COMMAND_NAME parameters +#COMMAND_NAME parameters ``` - In Forge and Maraiah, commands need not be uppercase. - Atque does require all commands to be uppercase. +In Forge and Maraiah, commands need not be uppercase. Atque does require all +commands to be uppercase. - Comments also begin lines (they can't be after the beginning of one) and - will disable any text proceeding them. They are formed like: +Comments also begin lines (they can't be after the beginning of one) and will +disable any text proceeding them. They are formed like: ``` - ; comment content here +; comment content here ``` - Terminals are numbered, and this is used in the map to determine which - terminal to display when a computer is used. +Terminals are numbered, and this is used in the map to determine which terminal +to display when a computer is used. ## Blocks ## ### Terminal Blocks ### - The number for the terminal being currently defined is set with - the `#TERMINAL` and `#ENDTERMINAL` commands. These are formed as: +The number for the terminal being currently defined is set with the `#TERMINAL` +and `#ENDTERMINAL` commands. These are formed as: ``` - #TERMINAL number - #ENDTERMINAL number +#TERMINAL number +#ENDTERMINAL number ``` - For example, defining a terminal numbered "1" would be: +For example, defining a terminal numbered "1" would be: ``` - #TERMINAL 1 +#TERMINAL 1 - ; terminal's contents here +; terminal's contents here - #ENDTERMINAL 1 +#ENDTERMINAL 1 ``` ### Sections ### - There are four possible sections in a terminal, which are between - the `#TERMINAL` and `#ENDTERMINAL` blocks: +There are four possible sections in a terminal, which are between the +`#TERMINAL` and `#ENDTERMINAL` blocks: ``` - #UNFINISHED - #FINISHED - #FAILURE - #SUCCESS +#UNFINISHED +#FINISHED +#FAILURE +#SUCCESS ``` - These all mark the start of where the terminal will display, depending on - the current status of your mission. +These all mark the start of where the terminal will display, depending on the +current status of your mission. | Name | Will display when | | ---- | ----------------- | @@ -95,37 +95,36 @@ | `FAILURE` | you have failed your objective | | `SUCCESS` | you have succeeded in your objective | - Sections must have an end, which is defined with: +Sections must have an end, which is defined with: ``` - #END +#END ``` - Between sections may be any amount of regular commands. - There are two kinds of these normal commands: Text commands, and interactive - commands. +Between sections may be any amount of regular commands. There are two kinds of +these normal commands: Text commands, and interactive commands. ## Text Commands ## - All text commands may have (but do not require) text following them, - which may be formatted. +All text commands may have (but do not require) text following them, which may +be formatted. - Line breaks will break in-game, but unbroken lines will automatically wrap. - It is generally best to just put all of your text onto one line, even if - this destroys your sanity. Use a text editor with line wrapping for this. +Line breaks will break in-game, but unbroken lines will automatically wrap. It +is generally best to just put all of your text onto one line, even if this +destroys your sanity. Use a text editor with line wrapping for this. - Example: +Example: ``` - #PICT 10007 - ~text interface terminal malfunction error ~2992dud +#PICT 10007 +~text interface terminal malfunction error ~2992dud - welcome to mabmap i am durandal the most pretty ai in ever i made the pfhor ded and won all the everything you should go shoot some things I put here because reasons +welcome to mabmap i am durandal the most pretty ai in ever i made the pfhor ded and won all the everything you should go shoot some things I put here because reasons ``` ### Formatting ### - Text effects are designated by a '$' and then one of the following: +Text effects are designated by a '$' and then one of the following: | $-code | Effect | | ------ | ------ | @@ -134,230 +133,228 @@ | `U/u` | enables/disables underlined text | | `Cn` | changes the text color, where "n" is a number 0 through 9 | - For more information on colors, see section ENUMERATIONS, Terminal Color. +For more information on colors, see section ENUMERATIONS, Terminal Color. - Example: +Example: ``` - $C1$BoOooO$IooOOoo$i$b$C0 ... $C6did I $Uspook$u you?$C0 +$C1$BoOooO$IooOOoo$i$b$C0 ... $C6did I $Uspook$u you?$C0 ``` ### Text Command Overview ### - Text commands include: +Text commands include: ``` - #PICT pict_id alignment - #LOGON pict_id - #LOGOFF pict_id - #INFORMATION - #CHECKPOINT goal_id - #BRIEFING level_number +#PICT pict_id alignment +#LOGON pict_id +#LOGOFF pict_id +#INFORMATION +#CHECKPOINT goal_id +#BRIEFING level_number ``` ### `#PICT` ### ``` - #PICT pict_id alignment +#PICT pict_id alignment ``` - `#PICT` is the most basic and most used command throughout M2 and Infinity. +`#PICT` is the most basic and most used command throughout M2 and Infinity. - It displays a picture to the specified alignment and text to the other side. +It displays a picture to the specified alignment and text to the other side. - It will: - * Wait for input before proceeding. - * Display 45 characters per line, and display up to 22 lines on one page. - * Display text aligned to the left on the right side of the screen. +It will: +* Wait for input before proceeding. +* Display 45 characters per line, and display up to 22 lines on one page. +* Display text aligned to the left on the right side of the screen. - If alignment is specified as RIGHT, text is aligned to the right - on the left of the screen. If alignment is specified as CENTER, no text may - be displayed, only an image. If no alignment is specified, it will default - to an image on the left and text on the right. +If alignment is specified as RIGHT, text is aligned to the right on the left of +the screen. If alignment is specified as CENTER, no text may be displayed, only +an image. If no alignment is specified, it will default to an image on the left +and text on the right. - Example: +Example: ``` - #PICT 10007 - ~text interface terminal malfunction error ~2992dud +#PICT 10007 +~text interface terminal malfunction error ~2992dud - hellote this is example text from durnadle prettiest ai in ever thank u for reading goodbye +hellote this is example text from durnadle prettiest ai in ever thank u for reading goodbye ``` ### `#LOGON`, `#LOGOFF` ### ``` - #LOGON pict_id - #LOGOFF pict_id +#LOGON pict_id +#LOGOFF pict_id ``` - `#LOGON` and `#LOGOFF` are generally used first and last in a terminal. +`#LOGON` and `#LOGOFF` are generally used first and last in a terminal. - These two display a PICT in the middle of the screen and text below the - image if you supply it. They both do things to the screen borders. +These two display a PICT in the middle of the screen and text below the image +if you supply it. They both do things to the screen borders. - They will: - * Automatically continue, an input will interrupt it. - * Only display one line of text, at most 72 characters. - * Display text aligned to the center in the middle of the screen. +They will: +* Automatically continue, an input will interrupt it. +* Only display one line of text, at most 72 characters. +* Display text aligned to the center in the middle of the screen. - Example: +Example: ``` - #LOGON 1600 - - ; ... content ... - #LOGOFF 1600 - ehhg.431.4122// +#LOGON 1600 + +; ... content ... +#LOGOFF 1600 +ehhg.431.4122// ``` ### `#INFORMATION` ### ``` - #INFORMATION +#INFORMATION ``` - `#INFORMATION` will just display text, and is mostly used in Marathon 1. +`#INFORMATION` will just display text, and is mostly used in Marathon 1. - It will: - * Wait for input before proceeding. - * Display 72 characters per line, and display up to 22 lines on one page. - * Display text aligned to the left on the left side of the screen. +It will: +* Wait for input before proceeding. +* Display 72 characters per line, and display up to 22 lines on one page. +* Display text aligned to the left on the left side of the screen. - Example: +Example: ``` - #INFORMATION - you suck at videogames love durandal - p.s. if you don't win i'm erasing your home planet from existence +#INFORMATION +you suck at videogames love durandal +p.s. if you don't win i'm erasing your home planet from existence ``` ### `#CHECKPOINT` ### ``` - #CHECKPOINT goal_id +#CHECKPOINT goal_id ``` - `#CHECKPOINT` may only be used in M1, unless you're using Aleph One 1.1+. +`#CHECKPOINT` may only be used in M1, unless you're using Aleph One 1.1+. - This shows a map centered on the specified goal point, with the goal - circled, on the left of the screen. +This shows a map centered on the specified goal point, with the goal circled, +on the left of the screen. - The map will only show polygons connected to the polygon the goal is in, - so if you have a separated area where the goal point is, it will only - display that. It will also not display secret areas and any polygons - proceding them. +The map will only show polygons connected to the polygon the goal is in, so if +you have a separated area where the goal point is, it will only display that. +It will also not display secret areas and any polygons proceding them. - It will: - * Wait for input before proceeding. - * Display 45 characters per line, and display up to 22 lines on one page. - * Display text aligned to the left on the right side of the screen. +It will: +* Wait for input before proceeding. +* Display 45 characters per line, and display up to 22 lines on one page. +* Display text aligned to the left on the right side of the screen. - Example: +Example: ``` - #CHECKPOINT 7 - go shoot these things so i can claim this victory as mine forever and tell you about the things that i totally shot for approximately 200 years +#CHECKPOINT 7 +go shoot these things so i can claim this victory as mine forever and tell you about the things that i totally shot for approximately 200 years ``` ### `#BRIEFING` ### ``` - #BRIEFING level_number +#BRIEFING level_number ``` - BRIEFING may only be used in Marathon 1. It is identical to INFORMATION, - but after you're done reading, it will teleport you to the specified level. +BRIEFING may only be used in Marathon 1. It is identical to INFORMATION, but +after you're done reading, it will teleport you to the specified level. ## Interactive Commands ## - Interactive commands are all actions carried out by the game that - do not all effect the active terminal. +Interactive commands are all actions carried out by the game that do not all +effect the active terminal. ### Interactive Command Overview ### - Interactive commands include: +Interactive commands include: ``` - #INTERLEVEL TELEPORT level_number - #INTRALEVEL TELEPORT polygon_tag - #TAG tag - #SOUND sound_number - #STATIC duration +#INTERLEVEL TELEPORT level_number +#INTRALEVEL TELEPORT polygon_tag +#TAG tag +#SOUND sound_number +#STATIC duration ``` ### `#INTERLEVEL TELEPORT` ### ``` - #INTERLEVEL TELEPORT level_number +#INTERLEVEL TELEPORT level_number ``` - `#INTERLEVEL TELEPORT` exits the terminal and teleports you to the - specified level. If the level number is "256", this ends the game. +`#INTERLEVEL TELEPORT` exits the terminal and teleports you to the specified +level. If the level number is "256", this ends the game. - Example: +Example: ``` - #INTERLEVEL TELEPORT 7 +#INTERLEVEL TELEPORT 7 ``` ### `#INTRALEVEL TELEPORT` ### ``` - #INTRALEVEL TELEPORT polygon_tag +#INTRALEVEL TELEPORT polygon_tag ``` - `#INTRALEVEL TELEPORT` exits the terminal and teleports you to the centroid - of the specified polygon within the map. +`#INTRALEVEL TELEPORT` exits the terminal and teleports you to the centroid of +the specified polygon within the map. - Example: +Example: ``` - #INTRALEVEL TELEPORT 77 +#INTRALEVEL TELEPORT 77 ``` ### `#TAG` ### ``` - #TAG tag +#TAG tag ``` - `#TAG` activates all lights and platforms with the specified tag. +`#TAG` activates all lights and platforms with the specified tag. - Example: +Example: ``` - #TAG 77 +#TAG 77 ``` ### `#SOUND` ### ``` - #SOUND sound_number +#SOUND sound_number ``` - `#SOUND` plays the specified sound from the Sounds file or from the - Scenario/Map file. +`#SOUND` plays the specified sound from the Sounds file or from the Scenario. - Example: +Example: ``` - #SOUND 77 +#SOUND 77 ``` ### `#STATIC` ### ``` - #STATIC duration +#STATIC duration ``` - `#STATIC` fills the terminal with TV static for the specified duration in - 1/30ths seconds. Aleph One only. +`#STATIC` fills the terminal with TV static for the specified duration in +1/30ths seconds. Aleph One only. - Example: +Example: ``` - #STATIC 60 +#STATIC 60 ``` @@ -365,8 +362,8 @@ ## Wad ## - Wad files are used as a container for many different data formats. The - following sub-sections all use the Wad format. +Wad files are used as a container for many different data formats. The +following sub-sections all use the Wad format. ### Marathon 2 Scenarios (`.sceA`) ### @@ -379,7 +376,7 @@ | `LITE` | Array of Lights | | `NOTE` | Not analyzed (annotations) | | `OBJS` | Array of Objects | -| `p'th` | No test data (' is $8C) (guardpaths) | +| `påth` | No test data (å is $8C) (guardpaths) | | `Minf` | Static Map Info | | `plac` | Not analyzed (item placement) | | `door` | No test data (extra door data) | @@ -394,16 +391,16 @@ | `MMLS` | Not analyzed (MML scripts) | | `LUAS` | Not analyzed (Lua scripts) | - Map files can be identified by the Minf chunk. +Map files can be identified by the Minf chunk. - Map files will always have either a PNTS or EPNT chunk, depending on what - the map (and editor) use. PNTS are plain and have no more information than - the actual position, while EPNT has flags and some extra stuff to help the - engine load quicker (not that it needs it.) +Map files will always have either a PNTS or EPNT chunk, depending on what the +map (and editor) use. PNTS are plain and have no more information than the +actual position, while EPNT has flags and some extra stuff to help the engine +load quicker (not that it needs it.) ### Marathon 1 Scenarios (`.scen`) ### - Not analyzed +Not analyzed ### Images (`.imgA`, `.imgs`) ### @@ -412,7 +409,7 @@ | `PICT` | Picture Resource | | `clut` | Unused(?) | - Images can be identified by the PICT chunk. +Images can be identified by the PICT chunk. ### Marathon 2 Physics (`.phyA`) ### @@ -426,57 +423,56 @@ ## Marathon 1 Physics (`.phys`) ## - Not analyzed +Not analyzed ## Marathon 2 Shapes (`.shpA`) ## - Not analyzed +Not analyzed ## Marathon 1 Shapes (`.shps`) ## - Not analyzed +Not analyzed ## Marathon 2 Sounds (`.sndA`) ## - Not analyzed +Not analyzed ## Marathon 1 Sounds (`.sndz`) ## - Not analyzed +Not analyzed ## Save Game (`.sgaA`) ## - Not analyzed +Not analyzed ## Film (`.filA`) ## - Not analyzed +Not analyzed # STRUCTURES ################################################################## - All integers here are big-endian unless specified. +All integers here are big-endian unless specified. ## Wad ## ### Wad File ### - Wad files are structured like: - * Wad Header - * Entries/Chunks - * Directory +Wad files are structured like: +* Wad Header +* Entries/Chunks +* Directory - It *must* be in this order because the engine assumes that the data directly - after the 128th byte is entry data. +It *must* be in this order because the engine assumes that the data directly +after the 128th byte is entry data. ### Wad Header ### - The Wad header is always at the very beginning of the file, except when - it's a MacBin file or an AppleSingle file, in which case it's at the start - of the resource fork. You'll have to account for that yourself. An example - of a proper header loader that handles both is attached. +The Wad header is always at the very beginning of the file, except when it's a +MacBin file or an AppleSingle file, in which case it's at the start of the +resource fork. You'll have to account for that yourself. - The Wad Header is 128 bytes. +The Wad Header is 128 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -485,7 +481,7 @@ | u8[64] | Original filename, null byte terminated | OrigName | | u32 | Checksum of entire file with this value as 0 | CRC | - If WadVer is greater than or equal to VerDir: +If WadVer is greater than or equal to VerDir: | Type | Description | Name | | ---- | ----------- | ---- | @@ -495,11 +491,11 @@ | u16 | Size of chunks | ChunkSize | | u16 | Size of directory entries | EntrySize | - ChunkSize and EntrySize may be zero, in which case it will default to - 16 and 10 respectively. They exist for forward compatibility with Wad - patching, although are actually pointless and serve no practical purpose. +ChunkSize and EntrySize may be zero, in which case it will default to 16 and 10 +respectively. They exist for forward compatibility with Wad patching, although +are actually pointless and serve no practical purpose. - If WadVer is greater than or equal to VerOver: +If WadVer is greater than or equal to VerOver: | Type | Description | Name | | ---- | ----------- | ---- | @@ -507,18 +503,18 @@ ### Directory Entry ### - Following this structure is AppData bytes (N), supposed to be used by - editor applications for storing arbitrary extra data, and will be ignored by - the engine. +Following this structure is AppData bytes (N), supposed to be used by editor +applications for storing arbitrary extra data, and will be ignored by the +engine. - Directory Entry is 8 bytes if WadVer is VerBase, or EntrySize+AppData bytes. +Directory Entry is 8 bytes if WadVer is VerBase, or EntrySize+AppData bytes. | Type | Description | Name | | ---- | ----------- | ---- | | u32 | Offset to start of data (from start of file) | Offset | | u32 | Length of entry data | Size | - If WadVer is greater than or equal to VerDir: +If WadVer is greater than or equal to VerDir: | Type | Description | Name | | ---- | ----------- | ---- | @@ -527,11 +523,11 @@ ### Chunk ### - Most Wad entries are made up of tagged data formats, the engine assumes - this for every entry and so every entry has at least one chunk. - These are similar to IFF or PNG chunks. +Most Wad entries are made up of tagged data formats, the engine assumes this +for every entry and so every entry has at least one chunk. These are similar to +IFF or PNG chunks. - Chunk is 12 bytes if WadVer is VerBase, or ChunkSize bytes. +Chunk is 12 bytes if WadVer is VerBase, or ChunkSize bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -539,7 +535,7 @@ | u32 | Absolute file offset of next chunk (-file header) | Offset | | u32 | Size of chunk (not including the header) | Size | - If WadVer is greater than or equal to VerDir: +If WadVer is greater than or equal to VerDir: | Type | Description | Name | | ---- | ----------- | ---- | @@ -549,9 +545,9 @@ ### LtFn ### - Light function specification. +Light function specification. - LtFn is 14 bytes. +LtFn is 14 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -565,9 +561,9 @@ ### SideTex ### - Just stores a texture and an offset. +Just stores a texture and an offset. - SideTex is 6 bytes. +SideTex is 6 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -577,9 +573,9 @@ ### Point ### - A geometric point. +A geometric point. - Point is 4 bytes. +Point is 4 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -588,9 +584,9 @@ ### Endpoint ### - More advanced point structure. +More advanced point structure. - Endpoint is 16 bytes. +Endpoint is 16 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -603,9 +599,9 @@ ### Line ### - A geometric line segment. +A geometric line segment. - Line is 32 bytes. +Line is 32 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -622,9 +618,9 @@ ### Side ### - One side of a line segment. +One side of a line segment. - Side is 64 bytes. +Side is 64 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -646,9 +642,9 @@ ### Polygon ### - A geometric polygon, essentially Doom's "sector," but must be convex. +A geometric polygon, essentially Doom's "sector," but must be convex. - Polygon is 128 bytes. +Polygon is 128 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -689,7 +685,7 @@ ### Light ### - Light is 77 bytes. +Light is 77 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -701,7 +697,7 @@ ### Object ### - Object is 16 bytes. +Object is 16 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -716,43 +712,43 @@ ### Static Map Info ### - Static Map Info is 88 bytes. +Static Map Info is 88 bytes. -| Type | Description | Name | -| ---- | ----------- | ---- | -| u16 | Environment Code | EnvCode | -| u16 | Physics model | PhysicsId | -| u16 | Music number | MusicId | -| u16 | Mission Flags | MissionFlags | -| u16 | Environment Flags | EnvFlags | -| 8 bytes | Unused | | -| u8[66] | Level name | Name | -| u32 | Entry point flags | EntryFlags | +| Type | Description | Name | +| ---- | ----------- | ---- | +| u16 | Environment Code | EnvCode | +| u16 | Physics model | PhysicsId | +| u16 | Music number | MusicId | +| u16 | Mission Flags | MissionFlags | +| u16 | Environment Flags | EnvFlags | +| 8 bytes | Unused | | +| u8[66] | Level name | Name | +| u32 | Entry point flags | EntryFlags | - The level name was intended to be 65 bytes, but one padding byte was left - over, so the real length is 66 bytes. It is unknown why the entry point - flags are stored in a 32-bit integer when they can fit in 8 bits. +The level name was intended to be 65 bytes, but one padding byte was left over, +so the real length is 66 bytes. It is unknown why the entry point flags are +stored in a 32-bit integer when they can fit in 8 bits. ## Terminal ## ### Terminal ### - Terminal text can be encoded with some weird xor bullshit for some reason. - You can decode it and encode it with the same method: +Terminal text can be encoded with some weird xor bullshit for some reason. +You can decode it and encode it with the same method: ```c - for(i = 0; i < len / 4; i++) {p += 2; *p++ ^= 0xFE; *p++ ^= 0xED;} - for(i = 0; i < len % 4; i++) *p++ ^= 0xFE; +for(i = 0; i < len / 4; i++) {p += 2; *p++ ^= 0xFE; *p++ ^= 0xED;} +for(i = 0; i < len % 4; i++) *p++ ^= 0xFE; ``` - * Terminal Header - * Terminal Groups - * Text Faces - * Terminal text (null byte terminated) +* Terminal Header +* Terminal Groups +* Text Faces +* Terminal text (null byte terminated) ### Terminal Header ### - Terminal Header is 10 bytes. +Terminal Header is 10 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -764,7 +760,7 @@ ### Terminal Group ### - Terminal Group is 12 bytes. +Terminal Group is 12 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -777,7 +773,7 @@ ### Text Face ### - Text Face is 6 bytes. +Text Face is 6 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -789,17 +785,17 @@ ### Picture Resource ### - Pictures are formed with a header and then a variable number of operations. - In other words, a small state machine is used to form an image through - effects and various fill instructions. QuickDraw is horrifying. This is the - native image format. It's a fucking metafile. +Pictures are formed with a header and then a variable number of operations. In +other words, a small state machine is used to form an image through effects and +various fill instructions. QuickDraw is horrifying. This is the native image +format. It's a fucking metafile. - * Picture Header - * Picture Opcodes +* Picture Header +* Picture Opcodes ### Picture Header ### - All QuickDraw PICTs begin with a basic 10 byte header as follows. +All QuickDraw PICTs begin with a basic 10 byte header as follows. | Type | Ignored | Description | Name | | ---- | :-----: | ----------- | ---- | @@ -811,7 +807,7 @@ ### CopyBits ### - If direct copy: +If direct copy: | Type | Description | Name | | ---- | ----------- | ---- | @@ -825,13 +821,13 @@ | u16 | Y end | Bottom | | u16 | X end | Right | - If PICT2: - * PixMap +If PICT2: +* PixMap - Else: - * assume pack type is default and bit depth is 1 +Else: +* assume pack type is default and bit depth is 1 - If packed pixmap: +If packed pixmap: | Type | Description | Name | | ---- | ----------- | ---- | @@ -840,7 +836,7 @@ | u16 | Number of color table entries (N) | ClutNum | | Clut[N] | Color lookup table | Clut | - The following are ignored in Aleph One: +The following are ignored in Aleph One: | Type | Description | Name | | ---- | ----------- | ---- | @@ -854,14 +850,14 @@ | u16 | Destination x end | DstRight | | u16 | Transfer mode | XferMode | - If clip: - * Clip Region (skipped the same way as opcode $0001 in A1) +If clip: +* Clip Region (skipped the same way as opcode $0001 in A1) - Image data follows. +Image data follows. ### PixMap ### - PixMap is 36 bytes. +PixMap is 36 bytes. | Type | Ignored | Description | Name | | ---- | :-----: | ----------- | ---- | @@ -879,7 +875,7 @@ ### Clut ### - Clut is 8 bytes. +Clut is 8 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -890,7 +886,7 @@ ### Header Op ### - Header Op is 24 bytes. +Header Op is 24 bytes. | Type | Description | Name | | ---- | ----------- | ---- | @@ -906,42 +902,42 @@ ### QuickTime Image ### - TODO +TODO - * 68 bytes +* 68 bytes - if matte: - * U32: matte ID size - * matte id size - 4 bytes +if matte: +* U32: matte ID size +* matte id size - 4 bytes - * U32: id size - * char[4]: codec type - * 36 bytes - * U32: data size - * 38 bytes - * image data follows - * some other bullshit +* U32: id size +* char[4]: codec type +* 36 bytes +* U32: data size +* 38 bytes +* image data follows +* some other bullshit # ENUMERATIONS ################################################################ - Here is a list of names and descriptions for enumerations used throughout - this document. The names may not match those used in the original engine - and are re-named for clarity of purpose. +Here is a list of names and descriptions for enumerations used throughout this +document. The names may not match those used in the original engine and are +re-named for clarity of purpose. ### Picture Opcode ### - Operations used in QuickDraw images. Aleph One ignores most of these, so - it's only necessary to document what's ignored and how to process CopyBits. - (If you're interested in the QuickDraw format, Apple has legacy documents - still available on the Internet.) +Operations used in QuickDraw images. Aleph One ignores most of these, so it's +only necessary to document what's ignored and how to process CopyBits. (If +you're interested in the QuickDraw format, Apple has legacy documents still +available on the Internet.) - Opcodes `$0100` through `$7FFF` are skipped by seeking forward by - the most significant byte's value times two. +Opcodes `$0100` through `$7FFF` are skipped by seeking forward by the most +significant byte's value times two. - Opcodes `$8000` through `$8100` are reserved and therefore ignored. +Opcodes `$8000` through `$8100` are reserved and therefore ignored. - Any unspecified opcodes are not worth skipping, and the state machine should - exit upon reading them. +Any unspecified opcodes are not worth skipping, and the state machine should +exit upon reading them. | Value | Ignored | Extra data | Name | | ----- | :-----: | ---------- | ---- | @@ -1021,27 +1017,27 @@ ### Polygon Type ### -| Value | Description | Permutation | Name | -| ----- | ----------- | ----------- | ---- | -| 0 | Normal, no effects | None | Normal | -| 1 | Items may not pass | None | ImpassItem | -| 2 | Monsters may not pass | None | ImpassMons | -| 3 | Hill (for King of the Hill) | None | Hill | -| 4 | Base (for Capture The Flag et al) | Team | Base | -| 5 | Platform | Plat index | Platform | -| 6 | Triggers light on | Light index | TrigLightOn | -| 7 | Triggers platform on | Plat index | TrigPlatOn | -| 8 | Triggers light off | Poly index | TrigLightOff | -| 9 | Triggers platform off | Poly index | TrigPlatOff | -| 10 | Teleports to polygon centroid | Poly index | Teleporter | -| 11 | Zone border | None | ZoneBorder | -| 12 | Goal point | None | Goal | -| 13 | Triggers near-by visible monsters | None | TrigMonsVis | -| 14 | Triggers near-by invisible monsters | None | TrigMonsInv | -| 15 | Same as TrigMonsInv | None | TrigMonsDual | -| 16 | Triggers near-by invisible items | None | TrigItems | -| 17 | Must be entered for Exploration | None | MustExplore | -| 18 | Teleports to next level if success | None | AutoExit | +| Value | Description | Permutation | Name | +| ----- | ----------- | ----------- | ---- | +| 0 | Normal, no effects | None | Normal | +| 1 | Items may not pass | None | ImpassItem | +| 2 | Monsters may not pass | None | ImpassMons | +| 3 | Hill (for King of the Hill) | None | Hill | +| 4 | Base (for Capture The Flag et al) | Team | Base | +| 5 | Platform | Plat index | Platform | +| 6 | Triggers light on | Light index | TrigLightOn | +| 7 | Triggers platform on | Plat index | TrigPlatOn | +| 8 | Triggers light off | Poly index | TrigLightOff | +| 9 | Triggers platform off | Poly index | TrigPlatOff | +| 10 | Teleports to polygon centroid | Poly index | Teleporter | +| 11 | Zone border | None | ZoneBorder | +| 12 | Goal point | None | Goal | +| 13 | Triggers near-by visible monsters | None | TrigMonsVis | +| 14 | Triggers near-by invisible monsters | None | TrigMonsInv | +| 15 | Same as TrigMonsInv | None | TrigMonsDual | +| 16 | Triggers near-by invisible items | None | TrigItems | +| 17 | Must be entered for Exploration | None | MustExplore | +| 18 | Teleports to next level if success | None | AutoExit | ### Control Panel Type ### @@ -1067,9 +1063,9 @@ | 3 | Composite texture (Not implemented) | Composite | | 4 | First texture for ceiling panel, second for floor | Split | - "Panel" here refers to a pertrusion inbetween two polygons. These would be - mapped to upper/lower textures in Doom for instance. Even the source code - for Marathon 2 itself acknowledges how redundant this enumeration is. +"Panel" here refers to a pertrusion inbetween two polygons. These would be +mapped to upper/lower textures in Doom for instance. Even the source code for +Marathon 2 itself acknowledges how redundant this enumeration is. ### Saved Object Group ### @@ -1119,7 +1115,7 @@ ### Wad Version ### - Used to determine how the engine loads the Wad file. +Used to determine how the engine loads the Wad file. | Value | Description | Name | | ----- | ----------- | ---- | @@ -1130,7 +1126,7 @@ ### Data Version ### - Used to determine how the engine loads map data. +Used to determine how the engine loads map data. | Value | Description | Name | | ----- | ----------- | ---- | @@ -1161,7 +1157,7 @@ ### Terminal Color ### - These are the default colors. These can be overridden with mods. +These are the default colors. These can be overridden with mods. | Value | Description | Name | | ----- | ----------- | ---- | @@ -1180,24 +1176,24 @@ ### Endpoint Flags ### -| Value | Description | Name | -| ----- | ----------- | ---- | -| `$0001` | Point belongs to any solid line | Solid | -| `$0002` | All polys with this point have the same height | SameHeight | -| `$0004` | Point does not belong to an un-transparent line | Transparent | +| Value | Description | Name | +| ----- | ----------- | ---- | +| `$0001` | Point belongs to any solid line | Solid | +| `$0002` | All polys with this point have the same height | SameHeight | +| `$0004` | Point does not belong to an un-transparent line | Transparent | - Note that the SameHeight flag is set relative to the endpoint's lines. +Note that the SameHeight flag is set relative to the endpoint's lines. ### Line Flags ### -| Value | Description | Name | -| ----- | ----------- | ---- | -| `$0200` | Line has a transparent side | TransSide | -| `$0400` | Polygons on either side do not have same heights | ElevVar | -| `$0800` | Differing height between this line's polygons | Elevation | -| `$1000` | Line shows only sky | Landscape | -| `$2000` | Both sides are see-through | Transparent | -| `$4000` | Can't be walked through | Solid | +| Value | Description | Name | +| ----- | ----------- | ---- | +| `$0200` | Line has a transparent side | TransSide | +| `$0400` | Polygons on either side do not have same heights | ElevVar | +| `$0800` | Differing height between this line's polygons | Elevation | +| `$1000` | Line shows only sky | Landscape | +| `$2000` | Both sides are see-through | Transparent | +| `$4000` | Can't be walked through | Solid | ### Side Flags ### @@ -1231,13 +1227,13 @@ ### Mission Flags ### -| Value | Description | Name | -| ----- | ----------- | ---- | -| `$0001` | Kill a certain percentage of monsters | Extermination | -| `$0002` | Must explore marked polygons | Exploration | -| `$0004` | Must grab marked items | Retrieval | -| `$0008` | Must flip marked switches | Repair | -| `$0010` | Must keep certain percent of BoBs alive | Rescue | +| Value | Description | Name | +| ----- | ----------- | ---- | +| `$0001` | Kill a certain percentage of monsters | Extermination | +| `$0002` | Must explore marked polygons | Exploration | +| `$0004` | Must grab marked items | Retrieval | +| `$0008` | Must flip marked switches | Repair | +| `$0010` | Must keep certain percent of BoBs alive | Rescue | ### Environment Flags ###