dump

package
v1.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: GPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

View Source
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

View Source
var ErrUnsupported = errors.New("unsupported CGA graphics dump")

ErrUnsupported indicates the input does not contain a recognized CGA graphics dump.

Functions

func CGACustom

func CGACustom(src, dst string, pal color.Palette, scale int) error

CGACustom reads a CGA graphics dump from the src path, decodes it, and writes the dst PNG path.

func CGAImage

func CGAImage(src, dst string) error

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

func DecodeCGA(data []byte, pal color.Palette, scale int) *image.Paletted

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

func ExtractCGA(data []byte) ([]byte, error)

ExtractCGA extracts or decompresses a 16KB CGA graphics VRAM buffer.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL