Documentation
¶
Overview ¶
Package dump extracts and decodes retro CGA graphics dumps into modern images. These can be found from a number of sources in programs for PC/MS-DOS:
- saved raw 16KB dumps.
- saved BSAVE files.
- DOS .COM files with embedded dumps.
- DOS .COM files with "SPI" RLE-compressed dumps.
These forms of hidden art were commonly used by PC game developers of the 1980s, especially with titles that only supported CGA graphics. And briefly by software pirates on the PC from possibly 1987-1990. Who would use tools such as PC Paint to create draw their own crack-screens, then ship them in their own .COM files to act as static crack-tros.
Index ¶
Constants ¶
const ( // Width is the native horizontal resolution of CGA 320x200 4-color graphics. Width = 320 // Height is the native vertical resolution of CGA 320x200 4-color graphics. Height = 200 // Scale is the integer nearest-neighbor multiplier applied to decoded CGA images. Scale = 4 )
Variables ¶
var ( // PaletteCyan is CGA mode 4, palette 1, high intensity. PaletteCyan = color.Palette{cgaBlack, cgaLightCyan, cgaLightMagenta, cgaWhite} // PaletteCyanLow is CGA mode 4, palette 1, low intensity. PaletteCyanLow = color.Palette{cgaBlack, cgaCyan, cgaMagenta, cgaLightGray} // PaletteGreen is CGA mode 4, palette 0, high intensity. PaletteGreen = color.Palette{cgaBlack, cgaLightGreen, cgaLightRed, cgaYellow} // PaletteGreenLow is CGA mode 4, palette 0, low intensity. PaletteGreenLow = color.Palette{cgaBlack, cgaGreen, cgaRed, cgaBrown} // PaletteRed is CGA mode 5, high intensity. PaletteRed = color.Palette{cgaBlack, cgaLightCyan, cgaLightRed, cgaWhite} // PaletteRedLow is CGA mode 5, low intensity. PaletteRedLow = color.Palette{cgaBlack, cgaCyan, cgaRed, cgaLightGray} )
Standard 4-color CGA graphics palettes (Mode 4 Palettes 0 & 1 and Mode 5, high and low intensity). For a visualization of the palettes, see https://en.wikipedia.org/wiki/Color_Graphics_Adapter#320_%C3%97_200
var ErrUnsupported = errors.New("unsupported CGA graphics dump")
ErrUnsupported indicates the input does not contain a recognized CGA graphics dump.
Functions ¶
func CGACustom ¶
CGACustom reads a CGA graphics dump from the src path, decodes it, and writes the dst PNG path.
func CGAImage ¶
CGAImage reads a CGA graphics dump from the src path, decodes it, and writes the dst PNG path. It uses the default cyan palette and scales the graphics by x4 to create a 1280x800 pixel image.
func DecodeCGA ¶
DecodeCGA to a pixel-exact x-scaled (1280x800) paletted image. By default it uses a 4x scale value, meaning a 320x200 dump will be resized into a 1280x800 image.
func ExtractCGA ¶
ExtractCGA extracts or decompresses a 16KB CGA graphics VRAM buffer.
Types ¶
This section is empty.