Skip to content

1.9.2

Latest

Choose a tag to compare

@kibertoad kibertoad released this 19 Nov 23:22
· 104 commits to main since this release
a831555

What's Changed

Highlights

AdLib Gold 1000

rust-dos now emulates Ad Lib's AdLib Gold 1000. Turn it on with adlibgold=true, or import a DOSBox configuration with oplmode=opl3gold. The card is emulated in full as games use it:

  • the control chip with its EEPROM, volumes and relocation, so games and the card's own drivers find it
  • the OPL3 behind it, with the timer interrupt on the card's IRQ
  • the digital sound channels (the YMZ263 MMA): PCM and ADPCM samples fed by the CPU or DMA, with their FIFO interrupt and timers
  • the surround module (YM7128B) and the stereo processor (TDA8425) with bass, treble and pseudo-stereo in the mix

Games that offer an AdLib Gold choice get its music and digital effects, such as Walt Disney's The Jungle Book, whose sound effects play through the card's digital channels. Settings: adlibgoldbase, adlibgoldirq, adlibgolddma and adlibgoldsurround in CONFIGURATION.md. Recording, the MIDI port and keeping the EEPROM between runs aren't emulated yet

Added by @kibertoad in #1471

Hardware emulation

Timing and speed

  • Recompiler: translate BT, BTS, BTR and BTC of memory by a register, and BSF and BSR (Oni's play: 89% fewer trips to the interpreter, and the emulation thread about 2.5 points less busy, on all cores and on 4) by @kibertoad in #1380
  • Recompiler: translate FRNDINT and FABS (MechCommander's missions ran 300,000 FRNDINTs a second through the interpreter) by @kibertoad in #1369
  • Recompiler: translate FSIN, FCOS, FPTAN, XADD and string moves going down (games that call sine, cosine, tangent or Interlocked functions often, such as Phoenix - Deep Space Resurrection, run with less overhead) by @kibertoad in #1421
  • Recompiler: a displacement a program writes into its own loop before each pass is read where it is, instead of leaving the translated code every time (Witchaven's level 1: 116.6 million exits in 10 s down to 115,000, and the game holds full speed) by @kibertoad in #1446
  • Upper memory between the ROMs (C8000h-EFFFFh) is plain RAM to the recompiler on x86-64 and AArch64 (Witchaven's Smacker intro, whose player keeps its task state and stack there, reaches real time instead of half of it) by @kibertoad in #1447
  • Built-in Windows: a new memory region's place is found in one pass over the process's regions instead of comparing every region with every other (Magic & Mayhem: The Art of Magic's first minute of loading takes 64 s of the host's time instead of 135 s) by @kibertoad in #1365
  • KERNEL32: QueryPerformanceCounter takes the time of the timer chip's port accesses that Windows 98's VTD makes, about 2.75 µs (a frame limiter that polls it no longer spins millions of times a second: MechCommander's mission loads are 7% less busy) by @kibertoad in #1370
  • cycles=auto brings a loading boost down within a few frames when the program starts work the host runs far slower, such as Zanzarah's intro movie, and goes back to a protected-mode program's speed right after it stops loading, also when it keeps drawing a little (as Millennia: Altered Destinies' intro does) by @kibertoad in #1408
  • cycles=auto brings a busy scene that follows a quiet one up to its full frame rate within about half a second (Omikron's main menu after the intro movies took up to 5 s) by @kibertoad in #1425
  • Idle skip: MFC idle loops of the built-in Windows 3.1 are skipped, and proofs follow the clock to the deadline a loop waits for (Metal Marines' title at about a fifth of the host load, Biosys's sensor panel at about half) by @kibertoad in #1426
  • Idle skip: programs that wait for a key through DOS's console functions (INT 21h AH=06h and 0Bh) no longer keep the host busy (Yendorian Tales 3: over 99% of its menu and town loops skipped) by @kibertoad in #1440
  • ToadForce: a scene's end doesn't settle the queue (Direct3D games that end many scenes a frame draw faster with the OpenGL renderer; Phoenix: 35 to 50 fps in combat on a 4-core host) by @kibertoad in #1405
  • Text modes: a byte written into text memory with the value it already holds no longer marks its row for repainting (Sink or Swim rewrote its whole menu every retrace: screen drawing from 17% to under 1% of the emulator's time) by @kibertoad in #1509

Sound

  • AdLib Gold 1000 (adlibgold=true, or oplmode=opl3gold from a DOSBox configuration): the control chip with its EEPROM, the surround module (YM7128B), the stereo processor (TDA8425), and the digital channels (YMZ263 MMA) fed by the CPU or DMA, with their interrupt and timers; the OPL3's timer interrupt goes out on the card's IRQ by @kibertoad in #1471
  • PC speaker: the level is band-limited before it is brought to the mix rate, so square waves and pulse-width sound no longer fold back into false tones by @kibertoad in #1463
  • PC speaker: each mix sample plays the speaker's mean level over its time, from PIT channel 2's output in every mode and port 61h, as DOSBox-X does. Digitized sound by pulse-width modulation (Access's RealSound, as in Mean Streets) and by switching the speaker bit directly plays, and high tones no longer fold down into false low tones by @kibertoad in #1448
  • PC speaker: music and effects no longer go silent after a program parks the speaker at an ultrasonic frequency between notes (Xenon 2 - Megablast) by @kibertoad in #1434

Improved hardware support

  • Keyboard BIOS: the keyboard interrupt (INT 09h) calls INT 15h AH=4Fh with each scan code, as an AT BIOS does, so a program's hook can drop or change a key, and the BIOS feature byte says so by @kibertoad in #1507
  • Timer (8254): mode 3 loads a new count at the end of the half-cycle, odd counts split their halves as the chip does, the read-back command works, and channel 1 counts by @kibertoad in #1461
  • Video BIOS: the EGA Register Interface (INT 10h AH=F0h-F5h and FAh) on EGA and VGA cards, under the built-in DOS by @kibertoad in #1476
  • Keyboard BIOS: INT 16h AH=03h, 09h and 0Ah are answered at the DOS prompt, and the keyboard controller gives the translated keyboard ID (AB 41) while it translates by @kibertoad in #1483
  • Video: writes to the CRTC ports of the display adapter that isn't there are ignored silently, as on a real PC by @kibertoad in #1496
  • BIOS: interrupt vectors 78h-FFh start out null as on a real PC, so drivers that look for a free vector there install (Creative's SBFMDRV) by @kibertoad in #1436
  • VGA: the Screen Off bit (SR01 bit 5, or INT 10h AH=12h BL=36h) blanks the screen by @kibertoad in #1438
  • Mouse driver: its INT 33h handler sits in low memory, as a real driver's does, so programs that check the vector's bytes find it; INT 33h AX=0031h returns the virtual coordinates' range, AX=0026h the maximum, and AX=0032h lists the advanced functions answered by @kibertoad in #1456 and #1452
  • Direct3D 8: a full-screen device's window covers the screen of the mode it set, after CreateDevice and Reset, as on Windows by @kibertoad in #1366
  • Direct3D 8: the focus window's messages go to DefWindowProc while the device moves its windows, through Direct3D's own window procedure, as on Windows by @kibertoad in #1409 and #1416
  • OpenGL: textures keep their texels when the display mode changes, through ChangeDisplaySettings or DirectDraw's SetDisplayMode by @kibertoad in #1377
  • OpenGL: glReadPixels reads the depth buffer (GL_DEPTH_COMPONENT) as floats, unsigned and signed integers, laid out as the pack settings say by @kibertoad in #1381

DOS and Windows

  • Shell: DOSBox's CONFIG -set in a package's batch file changes the setting before the next line runs (eXoDOS launchers' composite colour choice) by @kibertoad in #1506
  • DOS: freeing a block that is already free (INT 21h AH=49h) succeeds, as MS-DOS's own code does by @kibertoad in #1485
  • DOS: a program setting a file's date and time (INT 21h AX=5701h, SetFileTime) sets the host file's time too, rounded as Windows 98 rounds it by @kibertoad in #1499
  • Built-in Windows 98: USER32's desktop and window station functions, which fail as on Windows 98 instead of being missing by @kibertoad in #1497
  • Built-in Windows 98: EnumDisplayDevices lists the monitor on the adapter, and ChangeDisplaySettingsEx takes the adapter's name by @kibertoad in #1498
  • Built-in Windows 98: CreateScalableFontResource writes .FOT files and AddFontResource reads them by @kibertoad in #1500
  • DPMI: closing a DPMI program from the emulator gives the interrupt vectors it hooked back, so the next program doesn't hang with the timer stopped; a resident handler chained to a released stub reaches the BIOS by @kibertoad in #1460
  • DPMI: a segment limit above 1 MB that doesn't end a page covers the page (function 0008h), as DOS/4GW's and CWSDPMI's hosts do, instead of failing with 8021h by @kibertoad in #1462
  • Shell: on the return to the prompt, only the interrupt vectors that point into memory the shell takes back are reset; a vector a program pointed at the BIOS stays, as on DOS by @kibertoad in #1437
  • DOS: a program can free the environment the shell gave it (INT 21h AH=49h) by @kibertoad in #1439
  • DOS: Get Device Parameters (INT 21h AX=440Dh CX=0860h) copies 25 bytes of BPB, as MS-DOS does, and leaves the rest of the caller's block alone by @kibertoad in #1392
  • Built-in Windows 3.1: a loaded module is found by the file asked for, not by the name inside it, so a program can load a copy of itself by @kibertoad in #1391
  • Built-in Windows 3.1: TOOLHELP's global heap functions (GlobalEntryHandle, GlobalFirst, GlobalNext and the others) work by @kibertoad in #1418
  • Built-in KERNEL32: the Toolhelp32 snapshot functions by @kibertoad in #1399
  • Built-in Windows: TrueType fonts a program adds with AddFontResource are drawn and listed by @kibertoad in #1411
  • Built-in Windows: a window holding the mouse capture gets its button messages when its parent is disabled, and a click on a disabled child control goes to the window it is in by @kibertoad in #1413 and #1395
  • USER32: GetMessage and PeekMessage call the thread's WH_KEYBOARD and WH_MOUSE hooks as they take input by @kibertoad in #1404
  • WINMM: an I/O procedure a program installs for DOS files is used before the built-in one by @kibertoad in #1400

Games fixed and optimized

Magic & Mayhem: The Art of Magic

  • Direct3D 8: the device window covers the screen (at 800x600 the mouse reaches past 640x480 again, so the right-hand panel and the mission's start button can be clicked) by @kibertoad in #1366
  • Built-in Windows: free regions found in one pass (texture loading 2.1 times as fast) by @kibertoad in #1365

Oni

  • OpenGL: textures survive a change of the display mode (picking 800x600 or 1024x768 in Options no longer leaves the screen black for good) by @kibertoad in #1377
  • Recompiler: BT*, BSF and BSR translated (lower host load in play) by @kibertoad in #1380
  • OpenGL: glReadPixels reads depth (the game gets the real depth of the pixel it asks for each frame, where it read stale memory) by @kibertoad in #1381

MechCommander

  • KERNEL32: QueryPerformanceCounter takes its time (mission loads 7% less busy) by @kibertoad in #1370
  • Recompiler: FRNDINT and FABS translated (two thirds fewer trips to the interpreter in missions) by @kibertoad in #1369

Phoenix - Deep Space Resurrection

  • Built-in KERNEL32: Toolhelp32 (the game starts instead of ending at once) by @kibertoad in #1399
  • ToadForce: scene ends don't settle the queue (35 to 50 fps in combat on a 4-core host) by @kibertoad in #1405
  • Recompiler: FSIN, FCOS, FPTAN and XADD translated by @kibertoad in #1421

Stratosphere: Conquest of the Skies

  • WINMM: the game's own DOS I/O procedure is used (it no longer stops on its loading screen) by @kibertoad in #1400
  • USER32: keyboard and mouse hooks are called (missions take keys and mouse buttons) by @kibertoad in #1404

Outpost

  • Built-in Windows 3.1: Sierra's setup (Outpost 1.51) runs its copy of itself and installs by @kibertoad in #1391
  • DOS: Get Device Parameters no longer overwrites the setup's stack (it ended with a stack fault) by @kibertoad in #1392
  • Built-in Windows 3.1: TOOLHELP's global heap (Outpost 1.1, the floppy release, no longer ends at start) by @kibertoad in #1418

Tribal Rage

  • Built-in Windows: added TrueType fonts drawn (the buy panel's arrows show) by @kibertoad in #1411
  • Built-in Windows: capture in a disabled frame (the menu no longer stops taking clicks after a battle) by @kibertoad in #1413

Metal Marines

  • Idle skip: the Win16 MFC title loop is skipped (about a fifth of the host load) by @kibertoad in #1426

Zanzarah, Millennia: Altered Destinies and Omikron

  • cycles=auto: loading boosts end on slow frames and when work stops, and a busy scene after a load reaches its frame rate at once by @kibertoad in #1408 and #1425

Zeppelin: Giants of the Sky

  • Shell: the CD patch's INT 21h pointer survives the return to the prompt (the CD version starts from its ZEPPELIN.BAT instead of looping in the sound setup) by @kibertoad in #1437

Xenon 2 - Megablast

Yendorian Tales 3: The Tyrants of Thaine

  • BIOS: vectors 78h-FFh start null (SBFMDRV installs, so the FM music plays) by @kibertoad in #1436
  • Idle skip: DOS console polls skipped (the host no longer runs 57-71% busy while the game waits for input) by @kibertoad in #1440

Witchaven

  • Recompiler: poked displacements read in place (level 1 holds full speed) by @kibertoad in #1446
  • Upper memory is plain RAM (the intro reaches real time) by @kibertoad in #1447

Wasteland

  • Mouse driver in low memory (the game finds the mouse and can be played with it) by @kibertoad in #1456

Mean Streets

  • PC speaker: the RealSound title music plays by @kibertoad in #1448
  • PC speaker: band-limited (the RealSound title music without false tones) by @kibertoad in #1463

Walt Disney's The Jungle Book

  • DPMI: hooked vectors given back on close (after the game is closed, its INSTALL and other programs run instead of hanging) by @kibertoad in #1460
  • AdLib Gold (with adlibgold=true and the card at 380h, as the game's setup names it, its sound effects play through the card's digital channels) by @kibertoad in #1471

Virtuoso

  • DPMI: page-ending segment limits (the game gets past the manual check with the built-in DPMI host instead of crashing in its sound driver) by @kibertoad in #1462

A-Train

  • EGA Register Interface (the map, the satellite view and the Construction Set's map are drawn in colour instead of two colours) by @kibertoad in #1476

1830: Railroads & Robber Barons

  • Repeated EMS and DOS failures are logged a few times (a 29-minute game no longer writes 1.36 million log lines) by @kibertoad in #1484
  • INT 16h keyboard functions at the prompt (the sound setup's call is answered) by @kibertoad in #1483

Shamus

  • CONFIG -set (the launcher's composite colour choice applies) by @kibertoad in #1506

Myth III: The Wolf Age

  • The monitor on the adapter, desktop functions and .FOT fonts (the game and its QuickTime 5 installer start instead of ending at once) by @kibertoad in #1498 and #1497 and #1500
  • Host file times (the official 1.0.2 patch accepts the installed game) by @kibertoad in #1499

Sink or Swim

  • Keyboard interrupt calls INT 15h AH=4Fh (the game's own keyboard hook gets the keys: the setup menu and the game take input) by @kibertoad in #1507

Documentation

  • Moto Racer on a Voodoo3 image needs driver 4.11.01.1151 by @kibertoad in #830
  • Rage of Mages and Rage of Mages II setup on the built-in Windows by @kibertoad in #1177 and #1184

Other changes:

  • CI: a pull request marked ready doesn't run the tests again when a run on its commit covers them by @kibertoad in #1468
  • The game-polish skill builds the default branch once and shares the build between sessions; a pull request that changes only .claude/ skips the Rust workflow by @kibertoad in #1467
  • CI: both conformance test sets run in one job by @kibertoad in #1415
  • Debugging: the disassembler, the instruction trace and the profiler name the built-in Win16 modules' functions (KERNEL, USER, MMSYSTEM...) instead of unrelated Win32 ones, and the profile counts Win16 calls apart by @kibertoad in #1368
  • The game-polish skill's watcher script skips a failed sample instead of stopping, and stops when another emulator takes its port by @kibertoad in #1371

Full Changelog: v1.9.1...v1.9.2