{"modulePath":"github.com/Defacto2/server","version":"v1.16.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package jsdos\n\nPackage jsdos configures the js-dos v6.22 emulator.\n\n## Constants\n\n```go\nconst AudioRate = \"44100\" // AudioRate is the sample rate of the audio that is emulated.\n\n```\n\n## Functions\n\n```go\nfunc Binaries(paths ...string) []string\n```\nBinaries returns a list of the executable files from the archive paths.\n\n```go\nfunc Binary(paths ...string) string\n```\nBinary returns a path to the most likely executable file from the archive paths. The search order is .bat, .exe, .com, with the root paths having priority. If no executable is found then an empty string is returned.\n\n```go\nfunc FindBinary(filename, zipContent string) string\n```\nFindBinary 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.\n\n```go\nfunc Finds(filename string, paths ...string) string\n```\nFinds 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.\n\n```go\nfunc Paths(zipContent string) []string\n```\nPaths returns a list of file and directory paths from the zip content.\n\n```go\nfunc Valid(s string) bool\n```\nValid returns true if the sequence of MS-DOS commands is valid. Multiple commands are separated by the '\u0026\u0026' 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.\n\n## Types\n\n```go\ntype CPU string // CPU model and method used in the emulation.\n\n```\n\n```go\nconst (\n\tIAuto    CPU = auto           // IAuto is the fastest CPU type.\n\tI386     CPU = \"386\"          // I386 is the optimal Intel 80386.\n\tI386Pre  CPU = \"386_prefetch\" // I386Pre is the optimal Intel 80386 with a normal core.\n\tI386Slow CPU = \"386_slow\"     // I386Slow is the slowest Intel 80386 with a normal core.\n\tI486Slow CPU = \"486_slow\"     // I486Slow is the Intel 80486.\n\tI586Slow CPU = \"pentium_slow\" // I586Slow is the Intel 80586 aka Pentium.\n)\n```\n\n```go\ntype Core string // Core used in the CPU emulation.\n\n```\n\n```go\nconst (\n\tAutoCore Core = auto     // Auto sets real-mode programs to use the normal core, for protected mode programs it switches to dynamic core.\n\tDynamic  Core = auto     // [unsupported] \"dynamic\"  Dynamic is the optimal core for most games, except for programs that employ massive self-modifying code.\n\tNormal   Core = \"normal\" // Normal has the program interpreted instruction by instruction.\n\tSimple   Core = \"simple\" // Simple has the program interpreted instruction by instruction, optimized for (8088/8086/286) real-mode games.\n)\n```\n\n```go\ntype Cycles string // Cycles is the amount of instructions to attempt to emulate each millisecond.\n\n```\n\n```go\nconst (\n\tAutoCycles Cycles = auto          // CycleAuto, real-mode programs will run at 3000 cycles and protected mode games run with Max.\n\tMax        Cycles = \"max\"         // Max all programs run at the maximum speed the browser permits.\n\tFix5Mhz    Cycles = \"fixed 330\"   // Fix5Mhz attempts to run at a fixed 5MHz 8086, 0.330 MIPS.\n\tFix10Mhz   Cycles = \"fixed 750\"   // Fix10Mhz attempts to run at a fixed 10MHz 8088, 0.750 MIPS.\n\tFix12Mhz   Cycles = \"fixed 1280\"  // Fix12Mhz attempts to run at a fixed 12MHz 80286, 1.280 MIPS.\n\tFix16Mhz   Cycles = \"fixed 2150\"  // Fix16Mhz attempts to run at a fixed 16MHz 80386DX, 2.15 MIPS.\n\tFix33Mhz   Cycles = \"fixed 4300\"  // Fix33Mhz attempts to run at a fixed 33MHz 80386DX, 4.3 MIPS.\n\tFix25Mhz   Cycles = \"fixed 8700\"  // Fix25Mhz attempts to run at a fixed 25MHz 80486DX, 8.7 MIPS.\n\tFix66Mhz   Cycles = \"fixed 25600\" // Fix25Mhz attempts to run at a fixed 66MHz 80486DX2, 25.6 MIPS.\n)\n```\n\n```go\ntype DOS struct {\n\tXMS string `ini:\"xms\"` // XMS is the Extended Memory used for programs that require more than 1 MB of memory.\n\tEMS string `ini:\"ems\"` // EMS is the Expanded Memory used for programs that require more than 1 MB of memory.\n\tUMB string `ini:\"umb\"` // UMB is the Upper Memory Blocks used for programs that require more than 640 KB of memory.\n}\n```\nDOS is the \\[dos] section of the configuration file.\n\n```go\ntype Dosbox struct {\n\tMachine Platform `ini:\"machine\"`\n\tMemSize RAM      `ini:\"memsize\"`\n}\n```\nDosbox is the \\[dosbox] section of the configuration file.\n\n```go\ntype GUS struct {\n\tEnable string `ini:\"gus\"`      // Enable is the Gravis UltraSound card.\n\tRate   string `ini:\"gusrate\"`  // Rate is the sample rate of the Gravis UltraSound card.\n\tBase   string `ini:\"gusbase\"`  // Base is the I/O port address of the Gravis UltraSound card.\n\tIRQ    string `ini:\"gusirq\"`   // IRQ is the interrupt request line of the Gravis UltraSound card.\n\tDMA    string `ini:\"gusdma\"`   // DMA is the direct memory access channel of the Gravis UltraSound card.\n\tDir    string `ini:\"ultradir\"` // Dir is the directory within the emulation where the driver patch files for GUS playback are located.\n}\n```\nGUS is the \\[gus] section of the configuration file.\n\n```go\ntype Jsdos struct {\n\tDosbox    `ini:\"dosbox\"`\n\tProcessor `ini:\"cpu\"`\n\tMidi      `ini:\"midi\"`\n\tSBlaster  `ini:\"sblaster\"`\n\tGUS       `ini:\"gus\"`\n\tSpeaker   `ini:\"speaker\"`\n\tDOS       `ini:\"dos\"`\n}\n```\nJsdos is the dynamic generated configuration file for the js-dos v6.22 emulator.\n\n```go\nfunc (j *Jsdos) Beeper()\n```\nBeeper enables the PC speaker audio.\n\n```go\nfunc (j *Jsdos) CPU(value string)\n```\nCPU sets the CPU model, core and speed used in the emulation. The value can be \"8086\", \"386\", \"486\", or \"auto\".\n\n```go\nfunc (j *Jsdos) Covox()\n```\nCovox enables the Covox Speech Thing audio also sold as the Disney Sound Source.\n\n```go\nfunc (j *Jsdos) FM()\n```\nFM enables FM synthesis music aka the AdLib range of cards.\n\n```go\nfunc (j *Jsdos) Machine(value string)\n```\nMachine 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.\n\n```go\nfunc (j *Jsdos) NoBeeper()\n```\nNoBeeper disables the use of the PC speaker.\n\n```go\nfunc (j *Jsdos) NoBlaster()\n```\nNoBlaster disables the use of the Sound Blaster card.\n\n```go\nfunc (j *Jsdos) NoEMS(value bool)\n```\nNoEMS disables the use of the EMS memory. This is useful for software that does not support the Expanded Memory Specification.\n\n```go\nfunc (j *Jsdos) NoGUS()\n```\nNoGUS disables the use of the Gravis UltraSound card.\n\n```go\nfunc (j *Jsdos) NoMIDI()\n```\nNoMIDI disables the use of the MIDI devices for music.\n\n```go\nfunc (j *Jsdos) NoUMB(value bool)\n```\nNoUMB disables the use of the upper memory blocks. This is useful for software that conflicts with the UMB memory.\n\n```go\nfunc (j *Jsdos) NoXMS(value bool)\n```\nNoXMS disables the use of the XMS memory. This is useful for software that does not support the Extended Memory Specification.\n\n```go\nfunc (j *Jsdos) Sound(value string)\n```\nSound sets the sound card and audio output. The value can be \"sb16\", \"sb1\", \"pcspeaker\", \"none\", \"gus\", or \"covox\".\n\n```go\nfunc (j *Jsdos) Tandy()\n```\nTandy enables the Tandy 1000 series, 3-channel sound chip.\n\n```go\ntype Midi struct {\n\tMPU401 string `ini:\"mpu401\"`\n\tDevice string `ini:\"mididevice\"`\n}\n```\nMidi is the \\[midi] section of the configuration file.\n\n```go\ntype Platform string // Platform is the machine dosbox tries to emulate.\n\n```\n\n```go\nconst (\n\tHercules         Platform = \"hercules\"      // Hercules graphics mode circa 1982.\n\tCGA              Platform = \"cga\"           // CGA (Color Graphics Adapter) graphics mode circa 1981.\n\tTandy            Platform = \"tandy\"         // Tandy 1000 emulation which uses the Tandy Graphics Adapter and the 3-channel Tandy speaker circa 1984.\n\tPCjr             Platform = \"pcjr\"          // PCjr (Personal Computer Junior) emulation which uses the PCjr graphics and sound circa 1984.\n\tEGA              Platform = \"ega\"           // EGA (Enhanced Graphics Adapter) graphics mode circa 1984.\n\tVGAOnly          Platform = \"vgaonly\"       // VGAOnly is the VGA graphics mode for compatibility with software that fails with SuperVGA.\n\tSuperVgaS3       Platform = \"svga_s3\"       // SuperVgaS3 is SuperVGA using the s3 Trio 64 chip.\n\tSuperVgaET3000   Platform = \"svga_et3000\"   // SuperVgaET3000 is SuperVGA using the Tseng Labs ET3000 graphics mode.\n\tSuperVgaET4000   Platform = \"svga_et4000\"   // SuperVgaET4000 is SuperVGA using the Tseng Labs ET4000 graphics mode.\n\tSuperVgaParadise Platform = \"svga_paradise\" // SuperVgaParadise is SuperVGA using the Paradise PVGA1A chip, common in the late 1980s.\n\tVesaNoFrameBuff  Platform = \"vesa_nolfb\"    // VesaNoFrameBuff is the VESA graphics mode without the Linear Frame Buffer that is sometimes faster than SuperVgaS3.\n\tVesaV1           Platform = \"vesa_oldvbe\"   // VesaV1 is the VESA graphics mode using the old VBE 1.2 standard.\n)\n```\n\n```go\ntype Processor struct {\n\tCore   Core   `ini:\"core\"`\n\tModel  CPU    `ini:\"cputype\"`\n\tCycles Cycles `ini:\"cycles\"`\n}\n```\nProcessor is the \\[cpu] section of the configuration file.\n\n```go\ntype RAM string // RAM is the amount of memory to emulate.\n\n```\n\n```go\nconst (\n\tMem286 RAM = \"1\"  // Mem286 is 1MB of RAM.\n\tMem386 RAM = \"4\"  // Mem386 is 4MB of RAM.\n\tMem486 RAM = \"16\" // Mem486 is 16MB of RAM.\n)\n```\n\n```go\ntype SBlaster struct {\n\tType    string `ini:\"sbtype\"`\n\tBase    string `ini:\"sbbase\"`\n\tIRQ     string `ini:\"irq\"`\n\tDMA     string `ini:\"dma\"`\n\tHDMA    string `ini:\"hdma\"`\n\tMixer   string `ini:\"sbmixer\"`\n\tOplMode string `ini:\"oplmode\"`\n\tOplRate string `ini:\"oplrate\"`\n\tOplEmu  string `ini:\"oplemu\"`\n}\n```\nSBlaster is the \\[sblaster] section of the configuration file.\n\n```go\ntype Speaker struct {\n\tEnable    string `ini:\"pcspeaker\"` // Enable is the PC speaker audio.\n\tRate      string `ini:\"pcrate\"`    // Rate is the sample rate of the PC speaker.\n\tTandy     string `ini:\"tandy\"`     // Tandy 3-channel sound chip emulation.\n\tTandyRate string `ini:\"tandyrate\"` // TandyRate is sample rate of the Tandy 3-channel sound chip.\n\tDisney    string `ini:\"disney\"`    // Disney Sound Source aka Covox Speech Thing emulation.\n}\n```\nSpeaker is the \\[speaker] section of the configuration file.\n\n","path":"github.com/Defacto2/server/handler/jsdos","name":"jsdos","synopsis":"Package jsdos configures the js-dos v6.22 emulator.","isRedistributable":true}
