jsdos

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package jsdos configures the js-dos v6.22 emulator.

Index

Constants

View Source
const AudioRate = "44100" // AudioRate is the sample rate of the audio that is emulated.

Variables

This section is empty.

Functions

func Binaries

func Binaries(paths ...string) []string

Binaries returns a list of the executable files from the archive paths.

func Binary

func Binary(paths ...string) string

Binary returns a path to the most likely executable file from the archive paths. The search order is .bat, .com, .exe. with the root paths having priority. If no executable is found then an empty string is returned.

func FindBinary

func FindBinary(filename, zipContent string) string

FindBinary returns the most likely executable file from the archive paths. Binaries that matches the filename take priority over other executables. If no executable is found then an empty string is returned.

func Finds

func Finds(filename string, paths ...string) string

Finds the most likely executable in the archive paths. Binaries that matches the filename take priority over other executables. If no executable is found then an empty string is returned.

func Paths

func Paths(zipContent string) []string

Paths returns a list of file and directory paths from the zip content.

func Valid

func Valid(s string) bool

Valid returns true if the sequence of MS-DOS commands is valid. Multiple commands are separated by the '&&' operator and are case-insensitive. Each command checked for valid FAT 12/16 filenames and paths. MS-DOS and Linux arguments (forward slash and hyphen) are passed but are not checked.

Types

type CPU

type CPU string // CPU model and method used in the emulation.
const (
	IAuto    CPU = auto           // IAuto is the fastest CPU type.
	I386     CPU = "386"          // I386 is the optimal Intel 80386.
	I386Pre  CPU = "386_prefetch" // I386Pre is the optimal Intel 80386 with a normal core.
	I386Slow CPU = "386_slow"     // I386Slow is the slowest Intel 80386 with a normal core.
	I486Slow CPU = "486_slow"     // I486Slow is the Intel 80486.
	I586Slow CPU = "pentium_slow" // I586Slow is the Intel 80586 aka Pentium.
)

type Core

type Core string // Core used in the CPU emulation.
const (
	AutoCore Core = auto     // Auto sets real-mode programs to use the normal core, for protected mode programs it switches to dynamic core.
	Dynamic  Core = auto     // [unsupported] "dynamic"  Dynamic is the optimal core for most games, except for programs that employ massive self-modifying code.
	Normal   Core = "normal" // Normal has the program interpreted instruction by instruction.
	Simple   Core = "simple" // Simple has the program interpreted instruction by instruction, optimized for (8088/8086/286) real-mode games.
)

type Cycles

type Cycles string // Cycles is the amount of instructions to attempt to emulate each millisecond.
const (
	AutoCycles Cycles = auto          // CycleAuto, real-mode programs will run at 3000 cycles and protected mode games run with Max.
	Max        Cycles = "max"         // Max all programs run at the maximum speed the browser permits.
	Fix5Mhz    Cycles = "fixed 330"   // Fix5Mhz attempts to run at a fixed 5MHz 8086, 0.330 MIPS.
	Fix10Mhz   Cycles = "fixed 750"   // Fix10Mhz attempts to run at a fixed 10MHz 8088, 0.750 MIPS.
	Fix12Mhz   Cycles = "fixed 1280"  // Fix12Mhz attempts to run at a fixed 12MHz 80286, 1.280 MIPS.
	Fix16Mhz   Cycles = "fixed 2150"  // Fix16Mhz attempts to run at a fixed 16MHz 80386DX, 2.15 MIPS.
	Fix33Mhz   Cycles = "fixed 4300"  // Fix33Mhz attempts to run at a fixed 33MHz 80386DX, 4.3 MIPS.
	Fix25Mhz   Cycles = "fixed 8700"  // Fix25Mhz attempts to run at a fixed 25MHz 80486DX, 8.7 MIPS.
	Fix66Mhz   Cycles = "fixed 25600" // Fix25Mhz attempts to run at a fixed 66MHz 80486DX2, 25.6 MIPS.
)

type DOS

type DOS struct {
	XMS string `ini:"xms"` // XMS is the Extended Memory used for programs that require more than 1 MB of memory.
	EMS string `ini:"ems"` // EMS is the Expanded Memory used for programs that require more than 1 MB of memory.
	UMB string `ini:"umb"` // UMB is the Upper Memory Blocks used for programs that require more than 640 KB of memory.
}

DOS is the [dos] section of the configuration file.

type Dosbox

type Dosbox struct {
	Machine Platform `ini:"machine"`
	MemSize RAM      `ini:"memsize"`
}

Dosbox is the [dosbox] section of the configuration file.

type GUS

type GUS struct {
	Enable string `ini:"gus"`      // Enable is the Gravis UltraSound card.
	Rate   string `ini:"gusrate"`  // Rate is the sample rate of the Gravis UltraSound card.
	Base   string `ini:"gusbase"`  // Base is the I/O port address of the Gravis UltraSound card.
	IRQ    string `ini:"gusirq"`   // IRQ is the interrupt request line of the Gravis UltraSound card.
	DMA    string `ini:"gusdma"`   // DMA is the direct memory access channel of the Gravis UltraSound card.
	Dir    string `ini:"ultradir"` // Dir is the directory within the emulation where the driver patch files for GUS playback are located.
}

GUS is the [gus] section of the configuration file.

type Jsdos

type Jsdos struct {
	Dosbox    `ini:"dosbox"`
	Processor `ini:"cpu"`
	Midi      `ini:"midi"`
	SBlaster  `ini:"sblaster"`
	GUS       `ini:"gus"`
	Speaker   `ini:"speaker"`
	DOS       `ini:"dos"`
}

Jsdos is the dynamic generated configuration file for the js-dos v6.22 emulator.

func (*Jsdos) Beeper

func (j *Jsdos) Beeper()

Beeper enables the PC speaker audio.

func (*Jsdos) CPU

func (j *Jsdos) CPU(value string)

CPU sets the CPU model, core and speed used in the emulation. The value can be "8086", "386", "486", or "auto".

func (*Jsdos) Covox

func (j *Jsdos) Covox()

Covox enables the Covox Speech Thing audio also sold as the Disney Sound Source.

func (*Jsdos) FM

func (j *Jsdos) FM()

FM enables FM synthesis music aka the AdLib range of cards.

func (*Jsdos) Machine

func (j *Jsdos) Machine(value string)

Machine sets the machine to emulate, either the personal computer series or the graphics hardware. The value can be "vga", "tandy", "svga", "paradise", "oldvbe", "nolfb", "et4000", "et3000", "ega", or "cga". The "tandy" machine will also enable the Tandy 3-channel sound chip.

func (*Jsdos) NoBeeper

func (j *Jsdos) NoBeeper()

NoBeeper disables the use of the PC speaker.

func (*Jsdos) NoBlaster

func (j *Jsdos) NoBlaster()

NoBlaster disables the use of the Sound Blaster card.

func (*Jsdos) NoEMS

func (j *Jsdos) NoEMS(value bool)

NoEMS disables the use of the EMS memory. This is useful for software that does not support the Expanded Memory Specification.

func (*Jsdos) NoGUS

func (j *Jsdos) NoGUS()

NoGUS disables the use of the Gravis UltraSound card.

func (*Jsdos) NoMIDI

func (j *Jsdos) NoMIDI()

NoMIDI disables the use of the MIDI devices for music.

func (*Jsdos) NoUMB

func (j *Jsdos) NoUMB(value bool)

NoUMB disables the use of the upper memory blocks. This is useful for software that conflicts with the UMB memory.

func (*Jsdos) NoXMS

func (j *Jsdos) NoXMS(value bool)

NoXMS disables the use of the XMS memory. This is useful for software that does not support the Extended Memory Specification.

func (*Jsdos) Sound

func (j *Jsdos) Sound(value string)

Sound sets the sound card and audio output. The value can be "sb16", "sb1", "pcspeaker", "none", "gus", or "covox".

func (*Jsdos) Tandy

func (j *Jsdos) Tandy()

Tandy enables the Tandy 1000 series, 3-channel sound chip.

type Midi

type Midi struct {
	MPU401 string `ini:"mpu401"`
	Device string `ini:"mididevice"`
}

Midi is the [midi] section of the configuration file.

type Platform

type Platform string // Platform is the machine dosbox tries to emulate.
const (
	Hercules         Platform = "hercules"      // Hercules graphics mode circa 1982.
	CGA              Platform = "cga"           // CGA (Color Graphics Adapter) graphics mode circa 1981.
	Tandy            Platform = "tandy"         // Tandy 1000 emulation which uses the Tandy Graphics Adapter and the 3-channel Tandy speaker circa 1984.
	PCjr             Platform = "pcjr"          // PCjr (Personal Computer Junior) emulation which uses the PCjr graphics and sound circa 1984.
	EGA              Platform = "ega"           // EGA (Enhanced Graphics Adapter) graphics mode circa 1984.
	VGAOnly          Platform = "vgaonly"       // VGAOnly is the VGA graphics mode for compatibility with software that fails with SuperVGA.
	SuperVgaS3       Platform = "svga_s3"       // SuperVgaS3 is SuperVGA using the s3 Trio 64 chip.
	SuperVgaET3000   Platform = "svga_et3000"   // SuperVgaET3000 is SuperVGA using the Tseng Labs ET3000 graphics mode.
	SuperVgaET4000   Platform = "svga_et4000"   // SuperVgaET4000 is SuperVGA using the Tseng Labs ET4000 graphics mode.
	SuperVgaParadise Platform = "svga_paradise" // SuperVgaParadise is SuperVGA using the Paradise PVGA1A chip, common in the late 1980s.
	VesaNoFrameBuff  Platform = "vesa_nolfb"    // VesaNoFrameBuff is the VESA graphics mode without the Linear Frame Buffer that is sometimes faster than SuperVgaS3.
	VesaV1           Platform = "vesa_oldvbe"   // VesaV1 is the VESA graphics mode using the old VBE 1.2 standard.
)

type Processor

type Processor struct {
	Core   Core   `ini:"core"`
	Model  CPU    `ini:"cputype"`
	Cycles Cycles `ini:"cycles"`
}

Processor is the [cpu] section of the configuration file.

type RAM

type RAM string // RAM is the amount of memory to emulate.
const (
	Mem286 RAM = "1"  // Mem286 is 1MB of RAM.
	Mem386 RAM = "4"  // Mem386 is 4MB of RAM.
	Mem486 RAM = "16" // Mem486 is 16MB of RAM.
)

type SBlaster

type SBlaster struct {
	Type    string `ini:"sbtype"`
	Base    string `ini:"sbbase"`
	IRQ     string `ini:"irq"`
	DMA     string `ini:"dma"`
	HDMA    string `ini:"hdma"`
	Mixer   string `ini:"sbmixer"`
	OplMode string `ini:"oplmode"`
	OplRate string `ini:"oplrate"`
	OplEmu  string `ini:"oplemu"`
}

SBlaster is the [sblaster] section of the configuration file.

type Speaker

type Speaker struct {
	Enable    string `ini:"pcspeaker"` // Enable is the PC speaker audio.
	Rate      string `ini:"pcrate"`    // Rate is the sample rate of the PC speaker.
	Tandy     string `ini:"tandy"`     // Tandy 3-channel sound chip emulation.
	TandyRate string `ini:"tandyrate"` // TandyRate is sample rate of the Tandy 3-channel sound chip.
	Disney    string `ini:"disney"`    // Disney Sound Source aka Covox Speech Thing emulation.
}

Speaker is the [speaker] section of the configuration file.

Directories

Path Synopsis
Package msdos provides functions for working with MS-DOS FAT 12/16 file system filenames.
Package msdos provides functions for working with MS-DOS FAT 12/16 file system filenames.

Jump to

Keyboard shortcuts

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