joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.64k stars 374 forks source link

SQLite databases get corrupted when created on Win10 using DOSBox-X MinGW #3898

Open SuperIlu opened 1 year ago

SuperIlu commented 1 year ago

Describe the bug

Steps to reproduce the behaviour

  1. Download DOjS 1.9.1
  2. Download SQLite testcase
  3. Run DOJS.EXE -rt sqlite.js
  4. Observe SQL errors in JSLOG.TXT or on-screen
>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>> DOjS V1.9.1 (Nov  5 2022 15:26:26) starting with file sqlite.js
>>> Mouse detected
>>> Sound output: PCM[Sound Blaster 16; SB 16 (22727 hz) on port 220, using IRQ 7 and DMA channel 5; 64], FM[Adlib (OPL3); OPL3 synth on port 220; 18]
>>> Sound input: OK
>>> 3dfx cards detected: 1
>>> Joystick found.
>>> TCP/IP stack disabled
>>> Screen size: 640x480x32
>>> Memory: {"remaining":26791936,"total":32030720}
>>> Long file names: true
>>> Command line args: ["sqlite.js"]
>>> SerialPorts: ["0x3e8"]
>>> ParallelPorts: ["0x378","0x278"]
>>> FDD: 1, HDD: 2
>>> init_sqlite
CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT);
INSERT INTO test (id, name) VALUES (42, 'zweiundvierzig');
Error: SQL error: no such table: test

    at SQLite.prototype.Exec (native)
    at exec (sqlite.js:16)
    at Setup (sqlite.js:55)
INSERT INTO test (id, name) VALUES (23, 'dreiundzwanzig');
Error: SQL error: no such table: test

    at SQLite.prototype.Exec (native)
    at exec (sqlite.js:16)
    at Setup (sqlite.js:56)
[...]
>>> DOjS Shutdown...

Expected behavior

The test should run with no errors beside a unique constraint (logfiles below created with 0.83.24

>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>> DOjS V1.9.1 (Nov  5 2022 15:26:26) starting with file sqlite.js
>>> Mouse detected
>>> Sound output: PCM[Sound Blaster 16; SB 16 (22727 hz) on port 220, using IRQ 7 and DMA channel 5; 64], FM[Adlib (OPL3); OPL3 synth on port 220; 18]
>>> Sound input: OK
>>> 3dfx cards detected: 1
>>> Joystick found.
>>> TCP/IP stack disabled
>>> Screen size: 640x480x32
>>> Memory: {"remaining":26791936,"total":32030720}
>>> Long file names: true
>>> Command line args: ["sqlite.js"]
>>> SerialPorts: ["0x3e8"]
>>> ParallelPorts: ["0x378","0x278"]
>>> FDD: 1, HDD: 2
>>> init_sqlite
CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT);
INSERT INTO test (id, name) VALUES (42, 'zweiundvierzig');
INSERT INTO test (id, name) VALUES (23, 'dreiundzwanzig');
INSERT INTO test (id, name) VALUES (23, 'dreiundzwanzig');
Error: SQL error: UNIQUE constraint failed: test.id

    at SQLite.prototype.Exec (native)
    at exec (sqlite.js:16)
    at Setup (sqlite.js:59)
SELECT * from test;
[{"id":"23","name":"dreiundzwanzig"},{"id":"42","name":"zweiundvierzig"}]
SELECT * from test WHERE id=23;
[{"id":"23","name":"dreiundzwanzig"}]
CREATE TABLE t1 (a PRIMARY KEY, b TEXT, c REAL);
BEGIN TRANSACTION;
INSERT INTO t1 (a, b, c) VALUES (0, '0', 0);
INSERT INTO t1 (a, b, c) VALUES (1, '1', 0.3333333333333333);
INSERT INTO t1 (a, b, c) VALUES (2, '2', 0.6666666666666666);
INSERT INTO t1 (a, b, c) VALUES (3, '3', 1);
INSERT INTO t1 (a, b, c) VALUES (4, '4', 1.3333333333333333);
INSERT INTO t1 (a, b, c) VALUES (5, '5', 1.6666666666666668);
INSERT INTO t1 (a, b, c) VALUES (6, '6', 2);
INSERT INTO t1 (a, b, c) VALUES (7, '7', 2.3333333333333337);
INSERT INTO t1 (a, b, c) VALUES (8, '8', 2.6666666666666667);
INSERT INTO t1 (a, b, c) VALUES (9, '9', 3);
COMMIT;
CREATE INDEX idx_t1 ON t1 (b);
UPDATE t1 set b='foo' where a=666;
UPDATE t1 set b='bar' where a BETWEEN 23 AND 42;
BEGIN TRANSACTION;
DELETE FROM t1;
ROLLBACK;
SELECT * from t1 WHERE b='foo' OR b='bar';
>>> DOjS Shutdown...

What operating system(s) this bug have occurred on?

Windows 10 22H2

What version(s) of DOSBox-X have this bug?

all releases since 0.83.24

Used configuration

# This is the configuration file for DOSBox-X 0.83.11. (Please use the latest version of DOSBox-X)
# Lines starting with a # are comment lines and are ignored by DOSBox-X.
# They are used to (briefly) document the effect of each option.
# To write out ALL options, use command 'config -all' with -wc or -writeconf options.

[sdl]
#        fullscreen: Start DOSBox-X directly in fullscreen. (Press [F11/F12]+F to go back)
#        fulldouble: Use double buffering in fullscreen. It can reduce screen flickering, but it can also result in a slow DOSBox-X.
#    fullresolution: What resolution to use for fullscreen: original, desktop or a fixed size (e.g. 1024x768).
#                        Using your monitor's native resolution with aspect=true might give the best results.
#                        If you end up with small window on a large screen, try an output different from surface.
#  windowresolution: Scale the window to this size IF the output device supports hardware scaling.
#                        (output=surface does not!)
#    windowposition: Set the window position at startup in the positionX,positionY format (e.g.: 1300,200)
#           display: Specify a screen/display number to use for a multi-screen setup (0 = default).
#            output: What video system to use for output (openglnb = OpenGL nearest; openglpp = OpenGL perfect; ttf = TrueType font output).
#                      Possible values: default, surface, overlay, opengl, openglnb, openglhq, openglpp, ddraw.
#          autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock)
# clip_mouse_button: Select the mouse button or use arrow keys for the shared clipboard copy/paste function.
#                      The default mouse button is "right", which means using the right mouse button to select text, copy to and paste from the host clipboard.
#                      Set to "middle" to use the middle mouse button, "arrows" to use arrow keys instead of a mouse button, or "none" to disable this feature.
#                      Possible values: none, middle, right, arrows.
# clip_key_modifier: Change the keyboard modifier for the shared clipboard copy/paste function using a mouse button or arrow keys.
#                      The default modifier is "shift" (both left and right shift keys). Set to "none" if no modifier is desired.
#                      Possible values: none, ctrl, lctrl, rctrl, alt, lalt, ralt, shift, lshift, rshift, ctrlalt, ctrlshift, altshift, lctrlalt, lctrlshift, laltshift, rctrlalt, rctrlshift, raltshift.
#   clip_paste_bios: Specify whether to use BIOS keyboard functions for the clipboard pasting instead of the keystroke method.
#                      For pasting clipboard text into Windows 3.x/9x applications (e.g. Notepad), make sure to use the keystroke method.
#                      Possible values: true, false, 1, 0, default.
#  clip_paste_speed: Set keyboard speed for pasting text from the shared clipboard.
#                      If the default setting of 30 causes lost keystrokes, increase the number.
#                      Or experiment with decreasing the number for applications that accept keystrokes quickly.
#       sensitivity: Mouse sensitivity. The optional second parameter specifies vertical sensitivity (e.g. 100,-50).
#   mouse_emulation: When is mouse emulated ?
#                      integration: when not locked
#                      locked:      when locked
#                      always:      every time
#                      never:       at no time
#                      If disabled, the mouse position in DOSBox-X is exactly where the host OS reports it.
#                      When using a high DPI mouse, the emulation of mouse movement can noticeably reduce the
#                      sensitiveness of your device, i.e. the mouse is slower but more precise.
#                      Possible values: integration, locked, always, never.
#   mouse_wheel_key: Convert mouse wheel movements into keyboard presses such as arrow keys.
#                      0: disabled; 1: up/down arrows; 2: left/right arrows; 3: PgUp/PgDn keys.
#                      Putting a minus sign in front will disable the conversion for guest systems.
#       waitonerror: Wait before closing the console if DOSBox-X has an error.
#          priority: Priority levels for DOSBox-X. Second entry behind the comma is for when DOSBox-X is not focused/minimized.
#                        pause is only valid for the second entry.
#                      Possible values: lowest, lower, normal, higher, highest, pause.
#        mapperfile: File used to load/save the key/event mappings from. Resetmapper only works with the default value.
#      usescancodes: Avoid usage of symkeys, might not work on all operating systems.
#                      If set to "auto" (default), it is enabled for SDL1 and non-US keyboards.
#                      Possible values: true, false, 1, 0, auto.
#          titlebar: Change the string displayed in the DOSBox-X title bar.
#         showbasic: If set, DOSBox-X will show basic information including the DOSBox-X version number and current running speed in the title bar.
#       showdetails: If set, DOSBox-X will show the cycles count (FPS) and emulation speed relative to realtime in the title bar.
#          showmenu: Whether to show the menu bar (if supported). Default true.
windowresolution  = 1024x768
output            = opengl
# fullscreen        = false
# fulldouble        = false
# fullresolution    = original
# windowposition    = 
# display           = 0
# autolock          = true
# clip_mouse_button = right
# clip_key_modifier = shift
# clip_paste_bios   = default
# clip_paste_speed  = 30
# sensitivity       = 100
# mouse_emulation   = locked
# mouse_wheel_key   = -1
# waitonerror       = true
# priority          = higher,normal
# mapperfile        = mapper-0.74.map
# usescancodes      = true
#titlebar          = 
# showbasic         = true
# showdetails       = false
showmenu          = true

[log]
# logfile: file where the log messages will be saved to
logfile = 

[dosbox]
#              language: Select another language file.
#                 title: Additional text to place in the title bar of the window.
#          fastbioslogo: If set, DOSBox-X will skip the BIOS screen by activating fast BIOS logo mode (without 1-second pause).
#           startbanner: If set (default), DOSBox-X will display the welcome banner when it starts.
#      bannercolortheme: You can specify a different background color theme for the welcome banner from the default one.
#                          Possible values: default, black, red, green, yellow, blue, magenta, cyan, white.
#             dpi aware: Set this option (auto by default) to indicate to your OS that DOSBox-X is DPI aware.
#                          If it is not set, Windows Vista/7/8/10 and higher may upscale the DOSBox-X window
#                          on higher resolution monitors which is probably not what you want.
#                          Possible values: true, false, 1, 0, auto.
#          quit warning: Set this option to indicate whether DOSBox-X should show a warning message when the user tries to close its window.
#                          If set to auto (default), DOSBox-X will warn if a DOS program, game or a guest system is currently running.
#                          If set to autofile, DOSBox-X will warn if there are open file handles or a guest system is currently running.
#                          Possible values: true, false, 1, 0, auto, autofile.
# show advanced options: If set, the Configuration Tool will display all config options (including advanced ones) by default.
#               hostkey: By default, DOSBox-X uses the mapper-defined host key, which defaults to F11 on Windows and F12 on other platforms.
#                          You may alternatively specify a host key with this setting and bypass the host key as defined in the mapper.
#                          This can also be done from the menu ("Main" => "Select host key").
#                          Possible values: ctrlalt, ctrlshift, altshift, mapper.
#       mapper send key: Select the key the mapper SendKey function will send.
#                          Possible values: winlogo, winmenu, alttab, ctrlesc, ctrlbreak, ctrlaltdel.
#      synchronize time: If set, DOSBox-X will try to automatically synchronize time with the host, unless you decide to change the date/time manually.
#               machine: The type of machine DOSBox-X tries to emulate.
#                          Possible values: hercules, cga, cga_mono, cga_rgb, cga_composite, cga_composite2, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe, amstrad, pc98, pc9801, pc9821, fm_towns, mcga, mda.
#              captures: Directory where things like wave, midi, screenshot get captured.
#              autosave: Enable the auto-save state feature. Specify a time interval in seconds, and optionally a save slot or start and end save slots.
#                          For example, "autosave=10 11-20" will set a 10-second time interval for auto-saving, and the save slots used will be between 11 and 20.
#                          You can additionally specify up to 9 programs for this feature, e.g. "autosave=10 11-20 EDIT:21-30 EDITOR:35" for "EDIT" and "EDITOR".
#                          Putting a minus sign (-) before the time interval causes the auto-saving function to not be activated at start.
#              saveslot: Select the default save slot (1-100) to save/load states.
#              savefile: Select the default save file to save/load states. If specified it will be used instead of the save slot.
#            saveremark: If set, the save state feature will ask users to enter remarks when saving a state.
#        forceloadstate: If set, DOSBox-X will load a saved state even if it finds there is a mismatch in the DOSBox-X version, machine type, program name and/or the memory size.
#               memsize: Amount of memory DOSBox-X has in megabytes.
#                          This value is best left at its default to avoid problems with some games,
#                          although other games and applications may require a higher value.
#                          Programs that use 286 protected mode like Windows 3.0 in Standard Mode may crash with more than 15MB.
#            nocachedir: If set, MOUNT commands will mount with -nocachedir (disable directory caching) by default.
#           freesizecap: If set to "cap" (="true"), the value of MOUNT -freesize will apply only if the actual free size is greater than the specified value.
#                          If set to "relative", the value of MOUNT -freesize will change relative to the specified value.
#                          If set to "fixed" (="false"), the value of MOUNT -freesize will be a fixed one to be reported all the time.
#                          Possible values: true, false, fixed, relative, cap, 2, 1, 0.
language              = 
title                 = 
fastbioslogo          = false
startbanner           = true
bannercolortheme      = default
dpi aware             = auto
quit warning          = auto
show advanced options = false
hostkey               = mapper
mapper send key       = ctrlaltdel
synchronize time      = false
machine               = svga_s3
captures              = capture
autosave              = 
saveslot              = 1
savefile              = 
saveremark            = true
forceloadstate        = false
memsize               = 32
nocachedir            = false
freesizecap           = cap

[video]
#                vmemsize: Amount of video memory in megabytes.
#                              The maximum resolution and color depth the svga_s3 will be able to display
#                              is determined by this value.
#                              -1: auto (vmemsizekb is ignored)
#                              0: 512k (800x600  at 256 colors) if vmemsizekb=0
#                              1: 1024x768  at 256 colors or 800x600  at 64k colors
#                              2: 1600x1200 at 256 colors or 1024x768 at 64k colors or 640x480 at 16M colors
#                              4: 1600x1200 at 64k colors or 1024x768 at 16M colors
#                              8: up to 1600x1200 at 16M colors
#                            For build engine games, use more memory than in the list above so it can
#                            use triple buffering and thus won't flicker.
#                            
#              vmemsizekb: Amount of video memory in kilobytes, in addition to vmemsize.
# high intensity blinking: Set to false if you want to see high-intensity background colors instead of blinking foreground text.
#                            This option has no effect in PC-98 and some other video modes.
vmemsize                = -1
vmemsizekb              = 0
high intensity blinking = true

[pc98]
#     pc-98 BIOS copyright string: If set, the PC-98 BIOS copyright string is placed at E800:0000. Enable this for software that detects PC-98 vs Epson.
#                  pc-98 fm board: In PC-98 mode, selects the FM music board to emulate.
#                                    Possible values: auto, off, false, board14, board26k, board86, board86c.
#          pc-98 enable 256-color: Allow 256-color graphics mode if set, disable if not set
#           pc-98 enable 16-color: Allow 16-color graphics mode if set, disable if not set
#               pc-98 enable grcg: Allow GRCG graphics functions if set, disable if not set
#                pc-98 enable egc: Allow EGC graphics functions if set, disable if not set
#                 pc-98 bus mouse: Enable PC-98 bus mouse emulation. Disabling this option does not disable INT 33h emulation.
# pc-98 force ibm keyboard layout: Force to use a default keyboard layout like IBM US-English for PC-98 emulation.
#                                    Will only work with apps and games using BIOS for keyboard.
pc-98 BIOS copyright string     = false
pc-98 fm board                  = auto
pc-98 enable 256-color          = true
pc-98 enable 16-color           = true
pc-98 enable grcg               = true
pc-98 enable egc                = true
pc-98 bus mouse                 = true
pc-98 force ibm keyboard layout = false

[render]
#        frameskip: How many frames DOSBox-X skips before drawing one.
#           aspect: Aspect ratio correction mode. Can be set to the following values:
#                       'false' (default):
#                           'direct3d'/opengl outputs: image is simply scaled to full window/fullscreen size, possibly resulting in disproportional image
#                           'surface' output: it does no aspect ratio correction (default), resulting in disproportional images if VGA mode pixel ratio is not 4:3
#                       'true':
#                           'direct3d'/opengl outputs: uses output driver functions to scale / pad image with black bars, correcting output to proportional 4:3 image
#                               In most cases image degradation should not be noticeable (it all depends on the video adapter and how much the image is upscaled).
#                               Should have none to negligible impact on performance, mostly being done in hardware
#                               For the pixel-perfect scaling (output=openglpp), it is recommended to enable this whenever the emulated display has an aspect ratio of 4:3
#                           'surface' output: inherits old DOSBox aspect ratio correction method (adjusting rendered image line count to correct output to 4:3 ratio)
#                               Due to source image manipulation this mode does not mix well with scalers, i.e. multiline scalers like hq2x/hq3x will work poorly
#                               Slightly degrades visual image quality. Has a tiny impact on performance
#                               When using xBRZ scaler with 'surface' output, aspect ratio correction is done by the scaler itself, so none of the above apply
#                     Possible values: false, true, 0, 1, yes, no, nearest, bilinear.
#             euro: Display Euro symbol instead of the specified ASCII character (33-255).
#                     For example, setting it to 128 allows Euro symbol to be displayed instead of C-cedilla.
#       doublescan: If set, doublescanned output emits two scanlines for each source line, in the
#                     same manner as the actual VGA output (320x200 is rendered as 640x400 for example).
#                     If clear, doublescanned output is rendered at the native source resolution (320x200 as 320x200).
#                     This affects the raster PRIOR to the software or hardware scalers. Choose wisely.
#                     For pixel-perfect scaling (output=openglpp), it is recommended to turn this option off.
#           scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended,
#                     then the scaler will be used even if the result might not be desired.
#                     To fit a scaler in the resolution used at full screen may require a border or side bars.
#                     To fill the screen entirely, depending on your hardware, a different scaler/fullresolution might work.
#                     Scalers should work with most output options, but they are ignored for openglpp and TrueType font outputs.
#                     Possible values: none, normal2x, normal3x, normal4x, normal5x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x, gray, gray2x, hardware_none, hardware2x, hardware3x, hardware4x, hardware5x, xbrz, xbrz_bilinear.
#         glshader: Path to GLSL shader source to use with OpenGL output ("none" to disable, or "default" for default shader).
#                     Can be either an absolute path, a file in the "glshaders" subdirectory of the DOSBox-X configuration directory,
#                     or one of the built-in shaders (e.g. "sharp" for the pixel-perfect scaling mode):
#                     advinterp2x, advinterp3x, advmame2x, advmame3x, rgb2x, rgb3x, scan2x, scan3x, tv2x, tv3x, sharp.
#      pixelshader: Set Direct3D pixel shader program (effect file must be in Shaders subdirectory). If 'forced' is appended,
#                     then the pixel shader will be used even if the result might not be desired.
#          autofit: Best fits image to window
#                     - Intended for output=direct3d, fullresolution=original, aspect=true
#   monochrome_pal: Specify the color of monochrome display.
#                     Possible values: green, amber, gray, white
#                     Append 'bright' for a brighter look.
#                     Possible values: green, amber, gray, white.
#         ttf.font: Specifies a TrueType font to use for the TTF output. If not specified, the built-in TrueType font will be used.
#                     Either a font name or full font path can be specified. If file ends with the .TTF extension then the extension can be omitted.
#                     For a font name or relative path, directories such as the working directory and default system font directory will be searched.
#                     For example, setting it to "consola" or "consola.ttf" will use the Consola font; similar for other TTF fonts.
# ttf.outputswitch: Specifies the output that DOSBox-X should switch to from the TTF output when a graphical mode is requiested, or auto for automatic selection.
#                     Possible values: auto, surface, opengl, openglnb, openglhq, openglpp.
#      ttf.winperc: Specifies the window percentage for the TTF output (100 = full screen). Ignored if the ttf.ptsize setting is specified.
#       ttf.ptsize: Specifies the font point size for the TTF output. If specified (minimum: 10), it will override the ttf.winperc setting.
#         ttf.lins: Specifies the number of rows on the screen for the TTF output (0 = default).
#         ttf.cols: Specifies the number of columns on the screen for the TTF output (0 = default).
#           ttf.wp: You can specify a word processor for the TTF output (WP=WordPerfect, WS=WordStar, XY=XyWrite) and optionally also a version number.
#                     For example, WP6 will set the word processor as WordPerfect 6, and XY4 will set the word processor as XyWrite 4.
#                     Word processor-specific features like on-screen text styles and 512-character font will be enabled based on this.
#       ttf.blinkc: If set to true, the cursor blinks for the TTF output; setting it to false will turn the blinking off.
#                     You can also change the blinking rate by setting an interger between 1 (fastest) and 7 (slowest), or 0 for no cursor.
frameskip        = 0
aspect           = false
euro             = -1
doublescan       = true
scaler           = normal2x
glshader         = none
pixelshader      = none
autofit          = true
monochrome_pal   = green
ttf.font         = 
ttf.outputswitch = auto
ttf.winperc      = 60
ttf.ptsize       = 0
ttf.lins         = 0
ttf.cols         = 0
ttf.wp           = 
ttf.blinkc       = true

[vsync]
# vsyncmode: Synchronize vsync timing to the host display. Requires calibration within DOSBox-X.
#              Possible values: off, on, force, host.
# vsyncrate: Vsync rate used if vsync is enabled. Ignored if vsyncmode is set to host (win32).
#              Possible values:.
vsyncmode = off
vsyncrate = 75

[cpu]
#       core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate.
#               For the dynamic core, both dynamic_x86 and dynamic_rec are supported (dynamic_x86 is preferred).
#               Windows 95 or other preemptive multitasking OSes will not work with the dynamic_rec core.
#               Possible values: auto, dynamic, dynamic_x86, dynamic_nodhfpu, dynamic, dynamic_rec, normal, full, simple.
#        fpu: Enable FPU emulation
#    cputype: CPU Type used in emulation. auto emulates a 486 which tolerates Pentium instructions.
#               Possible values: auto, 8086, 8086_prefetch, 80186, 80186_prefetch, 286, 286_prefetch, 386, 386_prefetch, 486old, 486old_prefetch, 486, 486_prefetch, pentium, pentium_mmx, ppro_slow.
#     cycles: Amount of instructions DOSBox-X tries to emulate each millisecond.
#               Setting this value too high results in sound dropouts and lags.
#               Cycles can be set in 3 ways:
#                 'auto'          tries to guess what a game needs.
#                                 It usually works, but can fail for certain games.
#                 'fixed #number' will set a fixed amount of cycles. This is what you usually
#                                 need if 'auto' fails (Example: fixed 4000).
#                 'max'           will allocate as much cycles as your computer is able to
#                                 handle.
#               Possible values: auto, fixed, max.
#    cycleup: Amount of cycles to decrease/increase with the mapped keyboard shortcut.
#  cycledown: Setting it lower than 100 will be a percentage.
#    apmbios: Emulate Advanced Power Management (APM) BIOS calls.
# isapnpbios: Emulate ISA Plug & Play BIOS. Enable if using DOSBox-X to run a PnP aware DOS program or if booting Windows 9x.
#               Do not disable if Windows 9x is configured around PnP devices, you will likely confuse it.
core       = auto
fpu        = true
cputype    = pentium_mmx
cycles     = max
;cputype    = 486
;cycles     = 50000
cycleup    = 10
cycledown  = 20
apmbios    = true
isapnpbios = true

[keyboard]
#            aux: Enable emulation of the 8042 auxiliary port. PS/2 mouse emulation requires this to be enabled.
#                   You should enable this if you will be running Windows ME or any other OS that does not use the BIOS to receive mouse events.
# controllertype: Type of keyboard controller (and keyboard) attached.
#                   auto     Automatically pick according to machine type
#                   at       AT (PS/2) type keyboard
#                   xt       IBM PC/XT type keyboard
#                   pcjr     IBM PCjr type keyboard (only if machine=pcjr)
#                   pc98     PC-98 keyboard emulation (only if machine=pc98)
#                   Possible values: auto, at, xt, pcjr, pc98.
#      auxdevice: Type of PS/2 mouse attached to the AUX port
#                   Possible values: none, 2button, 3button, intellimouse, intellimouse45.
aux            = true
controllertype = auto
auxdevice      = intellimouse

[voodoo]
# voodoo_card: Enable support for the 3dfx Voodoo card.
#                Possible values: false, software, opengl, auto.
#       glide: Enable Glide emulation (Glide API passthrough to the host).
#                Requires a Glide wrapper - glide2x.dll (Windows), libglide2x.so (Linux), or libglide2x.dylib (macOS).
#      splash: Show 3dfx splash screen for Glide emulation (Windows; requires 3dfxSpl2.dll).
voodoo_card = auto
glide       = false
splash      = true

[mixer]
#    nosound: Enable silent mode, sound is still emulated though.
# swapstereo: Swaps the left and right stereo channels.
#       rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality.
#  blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged.
#               Possible values: 1024, 2048, 4096, 8192, 512, 256.
nosound    = false
swapstereo = false
rate       = 44100
blocksize  = 1024

[midi]
#          mpu401: Type of MPU-401 to emulate.
#                    Possible values: intelligent, uart, none.
#         mpubase: The IO address of the MPU-401.
#                    Set to 0 to use a default I/O address.
#                    300h to 330h are for use with IBM PC mode.
#                    C0D0h to F8D0h (in steps of 800h) are for use with NEC PC-98 mode (MPU98).
#                    80D2h through 80DEh are for use with NEC PC-98 Sound Blaster 16 MPU-401 emulation.
#                    If not assigned (0), 330h is the default for IBM PC and E0D0h is the default for PC-98.
#                    Possible values: 0, 300, 310, 320, 330, 332, 334, 336, 340, 360, c0d0, c8d0, d0d0, d8d0, e0d0, e8d0, f0d0, f8d0, 80d2, 80d4, 80d6, 80d8, 80da, 80dc, 80de.
#      mididevice: Device that will receive the MIDI data from MPU-401.
#                    Possible values: default, win32, alsa, oss, coreaudio, coremidi, mt32, synth, fluidsynth, timidity, none.
#      midiconfig: Special configuration options for the device driver. This is usually the id or part of the name of the device you want to use
#                    (find the id/name with mixer/listmidi).
#                    Or in the case of coreaudio or synth, you can specify a soundfont here.
#                    When using a Roland MT-32 rev. 0 as midi output device, some games may require a delay in order to prevent 'buffer overflow' issues.
#                    In that case, add 'delaysysex', for example: midiconfig=2 delaysysex
#                    See the README/Manual for more details.
#      samplerate: Sample rate for MIDI synthesizer, if applicable.
#                    Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
#          mpuirq: MPU-401 IRQ. -1 to automatically choose.
#     mt32.romdir: Name of the directory where MT-32 Control and PCM ROM files can be found. Emulation requires these files to work.
#                      Accepted file names are as follows:
#                        MT32_CONTROL.ROM or CM32L_CONTROL.ROM - control ROM file.
#                        MT32_PCM.ROM or CM32L_PCM.ROM - PCM ROM file.
#    fluid.driver: Driver to use with Fluidsynth, not needed under Windows. Available drivers depend on what Fluidsynth was compiled with.
#                    Possible values: pulseaudio, alsa, oss, coreaudio, dsound, portaudio, sndman, jack, file, default.
# fluid.soundfont: Soundfont to use with Fluidsynth. One must be specified.
mpu401          = intelligent
mpubase         = 0
mididevice      = default
midiconfig      = 
samplerate      = 44100
mpuirq          = -1
mt32.romdir     = 
fluid.driver    = default
fluid.soundfont = 

[sblaster]
#                       sbtype: Type of Sound Blaster to emulate. 'gb' is Game Blaster.
#                                 Possible values: sb1, sb2, sbpro1, sbpro2, sb16, sb16vibra, gb, ess688, reveal_sc400, none.
#                       sbbase: The IO address of the Sound Blaster.
#                                 220h to 2E0h are for use with IBM PC Sound Blaster emulation.
#                                 D2h to DEh are for use with NEC PC-98 Sound Blaster 16 emulation.
#                                 Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, d2, d4, d6, d8, da, dc, de.
#                          irq: The IRQ number of the Sound Blaster. Set to -1 to start DOSBox-X with the IRQ unassigned
#                                 Possible values: 7, 5, 3, 9, 10, 11, 12.
#                          dma: The DMA number of the Sound Blaster. Set to -1 to start DOSBox-X with the DMA unassigned
#                                 Possible values: 1, 5, 0, 3, 6, 7.
#                         hdma: The High DMA number of the Sound Blaster. Set to -1 to start DOSBox-X with the High DMA unassigned
#                                 Possible values: 1, 5, 0, 3, 6, 7.
#               enable speaker: Start the DOS virtual machine with the Sound Blaster speaker enabled.
#                                 Sound Blaster Pro and older cards have a speaker disable/enable command.
#                                 Normally the card boots up with the speaker disabled. If a DOS game or demo
#                                 attempts to play without enabling the speaker, set this option to true to
#                                 compensate. This setting has no meaning if emulating a Sound Blaster 16 card.
#                      sbmixer: Allow the Sound Blaster mixer to modify the DOSBox-X mixer.
#                      oplmode: Type of OPL emulation. On 'auto' the mode is determined by the 'sbtype' setting.
#                                 All OPL modes are AdLib-compatible, except for 'cms' (set 'sbtype=none' with 'cms' for a Game Blaster).
#                                 Possible values: auto, cms, opl2, dualopl2, opl3, opl3gold, none, hardware, hardwaregb.
#                       oplemu: Provider for the OPL emulation. 'compat' might provide better quality.
#                                 'nuked' is the most accurate (but the most CPU-intensive). See oplrate as well.
#                                 Possible values: default, compat, fast, nuked, mame, opl2board, opl3duoboard.
#                      oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).
#                                 Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000.
#                      oplport: Serial port of the OPL2 Audio Board when oplemu=opl2board, opl2mode will become 'opl2' automatically.
#                 hardwarebase: base address of the real hardware Sound Blaster:
#                                 210,220,230,240,250,260,280
#                     goldplay: Enable goldplay emulation.
# blaster environment variable: Whether or not to set the BLASTER environment variable automatically at startup
sbtype                       = sb16
sbbase                       = 220
irq                          = 7
dma                          = 1
hdma                         = 5
enable speaker               = false
sbmixer                      = true
oplmode                      = auto
oplemu                       = default
oplrate                      = 44100
oplport                      = 
hardwarebase                 = 220
goldplay                     = true
blaster environment variable = true

[gus]
#               gus: Enable the Gravis Ultrasound emulation.
#           gusrate: Sample rate of Ultrasound emulation.
#                      Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
#        gusmemsize: Amount of RAM on the Gravis Ultrasound in KB. Set to -1 for default.
# gus master volume: Master Gravis Ultrasound GF1 volume, in decibels. Reducing the master volume can help with games or demoscene productions where the music is too loud and clipping
#           gusbase: The IO base address of the Gravis Ultrasound.
#                      Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300, 210, 230, 250.
#            gusirq: The IRQ number of the Gravis Ultrasound.
#                      Possible values: 5, 3, 7, 9, 10, 11, 12.
#            gusdma: The DMA channel of the Gravis Ultrasound.
#                      Possible values: 3, 0, 1, 5, 6, 7.
#           gustype: Type of Gravis Ultrasound to emulate.
#                      classic             Original Gravis Ultrasound chipset
#                      classic37           Original Gravis Ultrasound with ICS Mixer (rev 3.7)
#                      max                 Gravis Ultrasound MAX emulation (with CS4231 codec)
#                      interwave           Gravis Ultrasound Plug & Play (interwave)
#                      Possible values: classic, classic37, max, interwave.
#          ultradir: Path to Ultrasound directory. In this directory
#                      there should be a MIDI directory that contains
#                      the patch files for GUS playback. Patch sets used
#                      with Timidity should work fine.
gus               = false
gusrate           = 44100
gusmemsize        = -1
gus master volume = 0.00
gusbase           = 240
gusirq            = 5
gusdma            = 3
gustype           = classic
ultradir          = C:\ULTRASND

[innova]
#     innova: Enable the Innovation SSI-2001 emulation.
# samplerate: Sample rate of Innovation SSI-2001 emulation
#               Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
#    sidbase: SID base port (typically 280h).
#               Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300.
#    quality: Set SID emulation quality level (0 to 3).
#               Possible values: 0, 1, 2, 3.
innova     = false
samplerate = 22050
sidbase    = 280
quality    = 0

[speaker]
#    pcspeaker: Enable PC-Speaker emulation.
#       pcrate: Sample rate of the PC-Speaker sound generation.
#                 Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
#        tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.
#                 Possible values: auto, on, off.
#    tandyrate: Sample rate of the Tandy 3-Voice generation.
#                 Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
#       disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).
#     ps1audio: Enable PS1 audio emulation.
#                 Possible values: on, off.
# ps1audiorate: Sample rate of the PS1 audio emulation.
#                 Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.
pcspeaker    = true
pcrate       = 44100
tandy        = auto
tandyrate    = 44100
disney       = false
ps1audio     = off
ps1audiorate = 22050

[joystick]
# joysticktype: Type of joystick to emulate: auto (default),
#                 none (disables joystick emulation),
#                 2axis (supports two joysticks),
#                 4axis (supports one joystick, first joystick used),
#                 4axis_2 (supports one joystick, second joystick used),
#                 fcs (Thrustmaster), ch (CH Flightstick).
#                 auto chooses emulation depending on real joystick(s).
#                 (Remember to reset DOSBox-X's mapperfile if you saved it earlier)
#                 Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.
#        timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away).
#     autofire: continuously fires as long as you keep the button pressed.
#       swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.
#   buttonwrap: enable button wrapping at the number of emulated buttons.
joysticktype = auto
timed        = true
autofire     = false
swap34       = false
buttonwrap   = false

[mapper]
# joy1deadzone0-: deadzone for joystick 1 axis 0-
# joy1deadzone0+: deadzone for joystick 1 axis 0+
# joy1deadzone1-: deadzone for joystick 1 axis 1-
# joy1deadzone1+: deadzone for joystick 1 axis 1+
# joy1deadzone2-: deadzone for joystick 1 axis 2-
# joy1deadzone2+: deadzone for joystick 1 axis 2+
# joy1deadzone3-: deadzone for joystick 1 axis 3-
# joy1deadzone3+: deadzone for joystick 1 axis 3+
# joy1deadzone4-: deadzone for joystick 1 axis 4-
# joy1deadzone4+: deadzone for joystick 1 axis 4+
# joy1deadzone5-: deadzone for joystick 1 axis 5-
# joy1deadzone5+: deadzone for joystick 1 axis 5+
# joy1deadzone6-: deadzone for joystick 1 axis 6-
# joy1deadzone6+: deadzone for joystick 1 axis 6+
# joy1deadzone7-: deadzone for joystick 1 axis 7-
# joy1deadzone7+: deadzone for joystick 1 axis 7+
# joy2deadzone0-: deadzone for joystick 2 axis 0-
# joy2deadzone0+: deadzone for joystick 2 axis 0+
# joy2deadzone1-: deadzone for joystick 2 axis 1-
# joy2deadzone1+: deadzone for joystick 2 axis 1+
# joy2deadzone2-: deadzone for joystick 2 axis 2-
# joy2deadzone2+: deadzone for joystick 2 axis 2+
# joy2deadzone3-: deadzone for joystick 2 axis 3-
# joy2deadzone3+: deadzone for joystick 2 axis 3+
# joy2deadzone4-: deadzone for joystick 2 axis 4-
# joy2deadzone4+: deadzone for joystick 2 axis 4+
# joy2deadzone5-: deadzone for joystick 2 axis 5-
# joy2deadzone5+: deadzone for joystick 2 axis 5+
# joy2deadzone6-: deadzone for joystick 2 axis 6-
# joy2deadzone6+: deadzone for joystick 2 axis 6+
# joy2deadzone7-: deadzone for joystick 2 axis 7-
# joy2deadzone7+: deadzone for joystick 2 axis 7+
joy1deadzone0- = 0.60
joy1deadzone0+ = 0.60
joy1deadzone1- = 0.60
joy1deadzone1+ = 0.60
joy1deadzone2- = 0.60
joy1deadzone2+ = 0.60
joy1deadzone3- = 0.60
joy1deadzone3+ = 0.60
joy1deadzone4- = 0.60
joy1deadzone4+ = 0.60
joy1deadzone5- = 0.60
joy1deadzone5+ = 0.60
joy1deadzone6- = 0.60
joy1deadzone6+ = 0.60
joy1deadzone7- = 0.60
joy1deadzone7+ = 0.60
joy2deadzone0- = 0.60
joy2deadzone0+ = 0.60
joy2deadzone1- = 0.60
joy2deadzone1+ = 0.60
joy2deadzone2- = 0.60
joy2deadzone2+ = 0.60
joy2deadzone3- = 0.60
joy2deadzone3+ = 0.60
joy2deadzone4- = 0.60
joy2deadzone4+ = 0.60
joy2deadzone5- = 0.60
joy2deadzone5+ = 0.60
joy2deadzone6- = 0.60
joy2deadzone6+ = 0.60
joy2deadzone7- = 0.60
joy2deadzone7+ = 0.60

[serial]
#       serial1: serial1-9 -- set type of device connected to the serial (COM) port.
#                  Can be disabled, dummy, file, modem, nullmodem, directserial.
#                  Additional parameters must be in the same line in the form of
#                  parameter:value. Parameter for all types is irq (optional).
#                  for file: specify an output file
#                  Additional parameters:
#                      timeout:<milliseconds> = how long to wait before closing the file on inactivity (default:0),
#                      squote to use single quotes instad of double quotes for quoted program commands.
#                      shellhide to hide the command window when opening programs on the Windows platform.
#                      openwith:<program>: start a program to open the output file.
#                      openerror:<program>: start a program to open the output file if an error had occurred.
#                  for directserial: realport (required), rxdelay (optional).
#                                   (realport:COM1 realport:ttyS0).
#                  for modem: listenport (optional).
#                  for nullmodem: server, rxdelay, txdelay, telnet, usedtr,
#                                 transparent, port, inhsocket, nonlocal (all optional).
#                                 connections are limited to localhost unless you specify nonlocal:1
#                  Example: serial1=modem listenport:5000
#                  Note: COM1-4 are standard COM ports in DOS, whereas COM5-9 are extended COM ports.
#                        You can optionally specify base addresses and IRQs for them with base: and irq: options.
#                  Possible values: dummy, disabled, modem, nullmodem, serialmouse, directserial, log, file.
#       serial2: see serial1
#                  Possible values: dummy, disabled, modem, nullmodem, serialmouse, directserial, log, file.
#       serial3: see serial1
#                  Possible values: dummy, disabled, modem, nullmodem, serialmouse, directserial, log, file.
#       serial4: see serial1
#                  Possible values: dummy, disabled, modem, nullmodem, serialmouse, directserial, log, file.
#       serial5: see serial1
#                  Possible values: dummy, disabled, modem, nullmodem, serialmouse, directserial, log, file.
#       serial6: see serial1
#                  Possible values: dummy, disabled, modem, nullmodem, serialmouse, directserial, log, file.
#       serial7: see serial1
#                  Possible values: dummy, disabled, modem, nullmodem, serialmouse, directserial, log, file.
#       serial8: see serial1
#                  Possible values: dummy, disabled, modem, nullmodem, serialmouse, directserial, log, file.
#       serial9: see serial1
#                  Possible values: dummy, disabled, modem, nullmodem, serialmouse, directserial, log, file.
# phonebookfile: File used to map fake phone numbers to addresses.
serial1       = directserial realport:COM7
serial2       = disabled
serial3       = dummy
serial4       = disabled
serial5       = disabled
serial6       = disabled
serial7       = disabled
serial8       = disabled
serial9       = disabled
phonebookfile = phonebook-dosbox-x.txt

[parallel]
# parallel1: parallel1-9 -- set type of device connected to the parallel (LPT) port.
#              Can be:
#                 reallpt (direct parallel port passthrough),
#                 file (records data to a file or passes it to a device),
#                 printer (virtual dot-matrix printer, see [printer] section)
#                     disney (attach Disney Sound Source emulation to this port)
#              Additional parameters must be in the same line in the form of
#              parameter:value.
#                for reallpt:
#                Windows:
#                  realbase (the base address of your real parallel port).
#                    Default: 378
#                  ecpbase (base address of the ECP registers, optional).
#                Linux: realport (the parallel port device i.e. /dev/parport0).
#                for file:
#                  dev:<devname> (i.e. dev:lpt1) to forward data to a device,
#                  or append:<file> appends data to the specified file.
#                  Without the above parameters data is written to files in the capture dir.
#                  Additional parameters:
#                  timeout:<milliseconds> = how long to wait before closing the file on inactivity (default:0 or 500),
#                  squote to use single quotes instad of double quotes for quoted program commands.
#                  shellhide to hide the command window when opening programs on the Windows platform.
#                  addFF to add a formfeed when closing, addLF to add a linefeed if the app doesn't.
#                  cp:<codepage number> to perform codepage translation, i.e. cp:437
#                  openps:<program>: start a program to open the file if the print output is detected to be PostScript.
#                  openpcl:<program>: start a program to open the file if the print output is detected to be PCL.
#                  openwith:<program>: start a program to open the file in all other conditions.
#                  openerror:<program>: start a program to open the file if an error had occurred.
#                for printer:
#                  printer still has it's own configuration section above.
#              Note: LPT1-3 are standard LPT ports in DOS, whereas LPT4-9 are extended LPT ports.
#                    You can optionally specify base addresses and IRQs for them with base: and irq: options.
# parallel2: see parallel1
# parallel3: see parallel1
# parallel4: see parallel1
# parallel5: see parallel1
# parallel6: see parallel1
# parallel7: see parallel1
# parallel8: see parallel1
# parallel9: see parallel1
#    dongle: Enable dongle
parallel1 = file dev:lpt1
parallel2 = file
parallel3 = disabled
parallel4 = disabled
parallel5 = disabled
parallel6 = disabled
parallel7 = disabled
parallel8 = disabled
parallel9 = disabled
dongle    = false

[printer]
#     printer: Enable printer emulation.
#         dpi: Resolution of printer (default 360).
#       width: Width of paper in 1/10 inch (default 85 = 8.5'').
#      height: Height of paper in 1/10 inch (default 110 = 11.0'').
# printoutput: Output method for finished pages:
#                  png     : Creates PNG images (default)
#                  ps      : Creates PostScript
#                  bmp     : Creates BMP images (very huge files, not recommended)
#                  printer : Send to an actual printer in Windows (specify a printer, or Print dialog will appear)
#   multipage: Adds all pages to one PostScript file or printer job until CTRL-F2 is pressed.
#      device: Specify the Windows printer device to use. You can see the list of devices from the Help
#                  menu ('List printer devices') or the Status Window. Then make your choice and put either
#                  the printer device number (e.g. 2) or your printer name (e.g. Microsoft Print to PDF).
#                  Leaving it empty will show the Windows Print dialog (or '-' for showing once).
#     docpath: The path (directory) where the output files are stored.
#    fontpath: The path (directory) where the printer fonts (courier.ttf, ocra.ttf, roman.ttf, sansserif.ttf, script.ttf) are located.
#    openwith: Start the specified program to open the output file.
#   openerror: Start the specified program to open the output file if an error had occurred.
#   shellhide: If set, the command window will be hidden for openwith/openerror options on the Windows platform.
#     timeout: (in milliseconds) if nonzero: the time the page will be ejected automatically after when no more data arrives at the printer.
printer     = true
dpi         = 360
width       = 85
height      = 110
printoutput = png
multipage   = false
device      = -
docpath     = .
fontpath    = FONTS
openwith    = 
openerror   = 
shellhide   = false
timeout     = 0

[dos]
#                             xms: Enable XMS support.
#                     xms handles: Number of XMS handles available for the DOS environment, or 0 to use a reasonable default
# shell configuration as commands: Allow entering dosbox-x.conf configuration parameters as shell commands to get and set settings.
#                                    This is disabled by default to avoid conflicts between commands and executables.
#                                    It is recommended to get and set dosbox-x.conf settings using the CONFIG command instead.
#                                    Compatibility with DOSBox SVN can be improved by enabling this option.
#                             hma: Report through XMS that HMA exists (not necessarily available)
#                        ansi.sys: If set (by default), ANSI.SYS emulation is on. If clear, ANSI.SYS is not emulated and will not appear to be installed.
#                                    NOTE: This option has no effect in PC-98 mode where MS-DOS systems integrate ANSI.SYS into the DOS kernel.
#                           share: Report SHARE.EXE as resident. This will allow file locking to be performed, although not all SHARE functions are emulated.
#               file access tries: If a positive integer is set, DOSBox-X will try to read/write/lock files directly on mounted local drives for the specified number of times before failing on Windows systems.
#              network redirector: Report DOS network redirector as resident. This will allow the host name to be returned unless the secure mode is enabled.
#                                    Set either "ipx=true" in [ipx] section or "ne2000=true" in [ne2000] section for a full network redirector environment.
#                minimum mcb free: Minimum free segment value to leave free. At startup, the DOS kernel will allocate memory
#                                    up to this point. This can be used to deal with EXEPACK issues or DOS programs that cannot
#                                    be loaded too low in memory. If you want more free conventional memory to be reported,
#                                    you can for example set its value to 1.
#                            dosv: Enable DOS/V emulation and specify which version to emulate. This option is intended for
#                                    use with games or software originating from Asia that use the double byte character set
#                                    encodings and the DOS/V extensions to display Japanese, Chinese, or Korean text.
#                                    Note that enabling DOS/V replaces 80x25 text mode (INT 10h mode 3) with a EGA/VGA graphics
#                                    mode that emulates text mode to display the characters and may be incompatible with non-Asian
#                                    software that assumes direct access to the text mode via segment 0xB800.
#                                    WARNING: This option is very experimental at this time.
#                                    Possible values: off, japanese, chinese, korean.
#                             ems: Enable EMS support. The default (=true) provides the best
#                                    compatibility but certain applications may run better with
#                                    other choices, or require EMS support to be disabled (=false)
#                                    to work at all.
#                                    Possible values: true, emsboard, emm386, false, 1, 0.
#                             umb: Enable UMB support.
#                    quick reboot: If set, the DOS restart call will reboot the emulated DOS (integrated DOS or guest DOS) instead of the virtual machine.
#                                    
#                             ver: Set DOS version. Specify as major.minor format. A single number is treated as the major version (compatible with LFN support). Common settings are:
#                                    auto (or unset)                  Pick a DOS kernel version automatically
#                                    3.3                              MS-DOS 3.3 emulation (not tested!)
#                                    5.0                              MS-DOS 5.0 emulation (recommended for DOS gaming)
#                                    6.22                             MS-DOS 6.22 emulation
#                                    7.0                              MS-DOS 7.0 (or Windows 95 pure DOS mode) emulation
#                                    7.1                              MS-DOS 7.1 (or Windows 98 pure DOS mode) emulation
#                                    Long filename (LFN) support will be enabled with a reported DOS version of 7.0 or higher with "lfn=auto" (default).
#                                    Similarly, FAT32 disk images will be supported with a reported DOS version of 7.1 or higher.
#                                    
#                             lfn: Enable long filename support. If set to auto (default), it is enabled if the reported DOS version is at least 7.0.
#                                    If set to autostart, the builtin VER command won't activate/disactivate LFN support according to the reported DOS version.
#                                    Possible values: true, false, 1, 0, auto, autostart.
#                       automount: Enable automatic drive mounting in Windows.
#                    automountall: Automatically mount all available Windows drives at start.
#                    mountwarning: If set, a warning will be displayed if you try to mount C:\ in Windows or / in other platforms.
#                  autofixwarning: If set to true or both, DOSBox-X will show messages when trying to automatically fix the "Packed file is corrupt" error.
#                                    If set to false or none, DOSBox-X will not show such messages on the screen when the error occurred.
#                                    If set to "a20fix" or "loadfix", DOSBox-X will show the message for the a20fix or the loadfix only.
#                                    Possible values: true, false, 1, 0, both, a20fix, loadfix, none.
#                        startcmd: Allow starting Windows programs or commands to run on the Windows host including the use of START command.
#                       startwait: Specify whether DOSBox-X should wait for the Windows applications after they are started.
#                      startquiet: If set, before launching Windows applications to run on the host DOSBox-X will not show messages like "Now run it as a Windows application".
#                           int33: Enable INT 33H for mouse support.
#                  keyboardlayout: Language code of the keyboard layout (or none).
#     dos clipboard device enable: If enabled, a DOS device will be added for bidirectional communications with the shared clipboard.
#                                    Setting to "read" will only allow read access, and setting to "write" will only allow write access.
#                                    Setting to "full" or "true" enables both; setting to "false" or "disabled" disables the access or device.
#                                    The default device name is CLIP$, but can be changed with the "dos clipboard device name" setting below.
#       dos clipboard device name: Set DOS device name (up to 8 characters) for bidirectional communications with the shared clipboard.
#                                    If unset or invalid, the default name CLIP$ will be used (e.g. "TYPE CLIP$" shows the clipboard contents).
#                                    It has no effect if "dos clipboard device enable" is disabled, and it is deactivated if the secure mode is enabled.
#               dos clipboard api: If set, DOS APIs for communications with the Windows clipboard will be enabled for shared clipboard communications.
xms                             = true
xms handles                     = 0
shell configuration as commands = false
hma                             = true
ansi.sys                        = true
share                           = true
file access tries               = 0
network redirector              = true
minimum mcb free                = 0
dosv                            = off
ems                             = true
umb                             = true
quick reboot                    = false
ver                             = 
lfn                             = true
automount                       = true
automountall                    = false
mountwarning                    = true
autofixwarning                  = true
startcmd                        = false
startwait                       = true
startquiet                      = false
int33                           = true
keyboardlayout                  = auto
dos clipboard device enable     = false
dos clipboard device name       = CLIP$
dos clipboard api               = true

[ide, primary]
# enable: Enable IDE interface
#    pnp: List IDE device in ISA PnP BIOS enumeration
enable = true
pnp    = true

[ide, secondary]
enable = true
pnp    = true

[ide, tertiary]
enable = false
pnp    = true

[ide, quaternary]
enable = false
pnp    = true

[ide, quinternary]
enable = false
pnp    = true

[ide, sexternary]
enable = false
pnp    = true

[ide, septernary]
enable = false
pnp    = true

[ide, octernary]
enable = false
pnp    = true

[fdc, primary]
# enable: Enable floppy controller interface
#    pnp: List floppy controller in ISA PnP BIOS enumeration
#   mode: Floppy controller mode. What the controller acts like.
#             ps2                          PS/2 mode (most common)
#             ps2_model30                  PS/2 model 30
#             at                           AT mode
#             xt                           PC/XT mode
enable = false
pnp    = true
mode   = ps2

[4dos]
rem = This section is the 4DOS.INI file, if you use 4DOS as the command shell

[ipx]
# ipx: Enable ipx over UDP/IP emulation.
ipx = false

[ne2000]
#  ne2000: Enable Ethernet passthrough. Requires [Win]Pcap.
# nicbase: The base address of the NE2000 board.
#  nicirq: The interrupt it uses. Note serial2 uses IRQ3 as default.
# realnic: Specifies which of your network interfaces is used.
#            Write 'list' here to see the list of devices from the Help
#            menu ('List network interfaces') or from the Status Window.
#            Then make your choice and put either the interface number
#            (e.g. 2) or a part of your adapters name (e.g. VIA here).
ne2000  = true
nicbase = 300
nicirq  = 3

[ethernet, pcap]
realnic=11

[config]
#       rem: Records comments (remarks).
#     break: Sets or clears extended CTRL+C checking.
#              Possible values: on, off.
#   numlock: Sets the initial state of the NumLock key.
#              Possible values: on, off, .
#     shell: Specifies the command shell (COMMAND.COM or 4DOS.COM).
#       dos: Reports whether DOS occupies HMA and allocates UMB memory (if available).
#      fcbs: Number of FCB handles available to DOS programs (1-255).
#     files: Number of file handles available to DOS programs (8-255).
#   country: The country code for date/time formats and optionally the code page for TTF output.
# lastdrive: The maximum drive letter that can be accessed by programs.
#              Possible values: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z.
rem         = This section is DOS's CONFIG.SYS file, not all CONFIG.SYS options supported
break       = off
numlock     = 
shell       = 
dos         = high, umb
fcbs        = 100
files       = 200
country     = 
lastdrive   = a
set path    = Z:\
set prompt  = $P$G
set temp    = 
install     = 
installhigh = 
device      = 
devicehigh  = 

[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
mount c E:\_DEVEL\DOjS\
mount g E:\_DEVEL\GitHub\TPASM\RELEASE\tpasm-1.12-dos
c:
ne2000 0x60 3 0x300
rem set MTCPCFG=c:\tmp\mtcp\samples\sample.cfg
rem c:\tmp\mtcp\dhcp
rem dojs -r tests\ogl13.js
rem dojs -r examples\gltixy.js
rem dojs -r tests\sqlite.js
rem dojs -rtsf tests\curl.js >>out.txt

Output log

No response

Additional information

No response

Have you checked that no similar bug report(s) exist?

Code of Conduct & Contributing Guidelines

SuperIlu commented 1 year ago

The same behavior can be observed using the stand alone SQLite.EXE. Makefile/compiler switches can be found here Compiler is DJGPP 2.05 with GCC 7.2.0 Use the following batch file to reproduce:

del test.db
sqlite test.db "create table foo (a integer primary key, b text); insert into foo (a,b) values (23,'42'); select * from foo;"

image

maron2000 commented 1 year ago

I don't see any flaws with the latest release. You may want to clarify the actual steps to reproduce your said issue. sqlite_test2 sqlite_test

SuperIlu commented 1 year ago

Hi, thanks for checking. You are right, the error does not occur with the default config. It does, however, occur with my config.

I narrowed it down: The error does not happen with lfn=off or lfn=auto, I could reproduce it with the following dosbox.config

[dos]
lfn = on

[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
mount c C:\Users\iluvatar\Desktop\SQLite-bug
c:
del test.db
sqlite test.db "create table foo (a integer primary key, b text); insert into foo (a,b) values (23,'42'); select * from foo;"
rderooy commented 1 year ago

This would be something for @Wengier as he implemented the LFN support (assuming he is available)...

Does it work properly if you boot MS-DOS 7.1 inside DOSBox and run it from there?

rderooy commented 1 year ago

FYI, lfn=auto means to enable LFN if the DOS version is >= 7.0, otherwise it is disabled. This is because some DOS programs get confused if they find LFN support on older DOS versions.

So you may want to try setting ver=7.1 to see if it makes any difference.

SuperIlu commented 1 year ago

I can confirm that lfn=auto and ver=7.1 also breaks SQLite.

SuperIlu commented 1 year ago

I can also confirm that lfn=true does not affect my Linux build (see initial post for details).

rderooy commented 1 year ago

Since you reported that it worked on version 0.83.24, any chance of doing a git bisect to find the offending commit?

SuperIlu commented 1 year ago

I'd love to help, but

  1. I was not able to compile the MinGW version on Windows with the existing documentation (maybe I missed something?)
  2. I never used git bisect before...
grapeli commented 1 year ago

I'd love to help, but

  1. I was not able to compile the MinGW version on Windows with the existing documentation (maybe I missed something?)
  2. I never used git bisect before...

Git bisect may not be necessary. First determine exactly in which configuration it does not work. I am not able to confirm this error with lfn=true or false in dosbox-x-mingw-win64-20221227040641.

Your proposed configuration is incorrect.

I narrowed it down: The error does not happen with lfn=off or lfn=auto, I could reproduce it with the following dosbox.config

[dos]
lfn = on

Get help. Each option has a description.

lfn: Enable long filename support. If set to auto (default), LFN support is enabled if the reported DOS version is at least 7.0.

If set to autostart, the built-in VER command won't activate/deactivate LFN support according to the reported DOS version.

lfn accepts only these values.

Possible values: true, false, 1, 0, auto, autostart.

SuperIlu commented 1 year ago

This is the exact configuration. I may have made a typo, switching on for true. But nonetheless it does happen when LFN is enabled.

image

grapeli commented 1 year ago

@SuperIlu I confirm. I ran dosbox-x-mingw-win64-20221227040641 under win10 and sqlite with lfn=true doesn't work properly with the command you provided. It works in wine under linux.

Git bisect can be done without compiling. All needed dosbox-x builds are available here.

You just have to narrow down your search. Not commit after commit, only halfway between working version and non-working version. With any luck, you'll only need to download dosbox-x ten times (maybe more or less) and run the same number of times. It is trivially simple, although you need to spend some time on it.

SuperIlu commented 1 year ago

@grapeli I'm not able to find the builds (to old? expired? skipped?).

I'll install msys2 and try compiling myself again...

grapeli commented 1 year ago

@SuperIlu I misled you a bit. I didn't realize these builds are unavailable for download after a certain amount of time (sucks).

In this case, if you want to play self-compilation, you have a lot more work to do. Remember that compilation is not always successful. This is a task for people who play with it every day. You can only waste your time.

SuperIlu commented 1 year ago

You are talking to someone who spent more than 3 years implementing Javascript on MS-DOS. I know how to waste my time properly! :)

It seems the offending commit is https://github.com/joncampbell123/dosbox-x/commit/a8cdcecd200fa9769b3b80acaf3940840ffcbf00

I have attached the transcript of my git bisect session for interested readers... bisect.log

iluvatar@twilight UCRT64 /e/_DEVEL/tmp/bisect/dosbox-x
$ git bisect good
a8cdcecd200fa9769b3b80acaf3940840ffcbf00 is the first bad commit
commit a8cdcecd200fa9769b3b80acaf3940840ffcbf00
Merge: bf2d8bd95 86644ca78
Author: Jonathan Campbell <6245486+joncampbell123@users.noreply.github.com>
Date:   Wed Apr 20 22:58:29 2022 -0700

    Merge branch 'master' into master

 .gitignore                            |   3 +
 CHANGELOG                             |  12 +-
 include/fpu.h                         |  91 +++--
 src/cpu/core_dyn_x86/decoder.h        |   4 +
 src/cpu/core_dyn_x86/dyn_fpu.h        |   4 -
 src/cpu/core_dynrec/decoder.h         |   4 +
 src/cpu/core_dynrec/dyn_fpu.h         |   4 -
 src/cpu/core_full/optable.h           |   8 +-
 src/cpu/core_normal/prefix_0f.h       |   7 +-
 src/cpu/mmx.cpp                       |   3 +-
 src/debug/debug.cpp                   |   8 +-
 src/dos/dos.cpp                       |  12 +-
 src/dos/dos_ioctl.cpp                 |   3 +
 src/dos/dos_programs.cpp              |   5 +
 src/fpu/fpu.cpp                       |  22 +-
 src/fpu/fpu_instructions.h            |   7 +-
 src/fpu/fpu_instructions_longdouble.h |   7 +-
 src/fpu/fpu_instructions_x86.h        | 201 ++++++-----
 src/gui/sdlmain.cpp                   |   2 +-
 src/hardware/memory.cpp               |  12 +-
 src/ints/bios.cpp                     |   5 +
 src/ints/bios_disk.cpp                |  15 +
 src/ints/int10.cpp                    |  12 +-
 src/ints/int10_char.cpp               | 614 ++++++++++++----------------------
 src/ints/int10_modes.cpp              |  32 +-
 src/ints/int_dosv.cpp                 | 178 ++--------
 26 files changed, 558 insertions(+), 717 deletions(-)
rderooy commented 1 year ago

Not what you want to get from a git bisect.... a huge commit that is all over the place.

grapeli commented 1 year ago

Commit a8cdcec is pull request #3399 consisting of many smaller changes.

grapeli commented 1 year ago

Although the individual builds available for download in Actions have a 90-day limit, you can download releases. This also allows you to narrow down possible git bisect.

maron2000 commented 1 year ago

I downloaded the MinGW 0.83.24 release, but it DIDN'T work. I'm pretty confused. Are you sure that you tried the MinGW version? test_mingw0 83 24

And the latest Visual Studio version works regardless of lfn option.

test_vs_latest

maron2000 commented 1 year ago

The screenshot you uploaded has a Debug menu, which is NOT available in MinGW builds. screenshot

SuperIlu commented 1 year ago

Ah damn, seems like I switched from VS to MinGW without realizing. That renders the bisect useless I guess. :(

But now I'm very confused now that I got "good" and "bad" builds on the way...

maron2000 commented 1 year ago

Yeah, very confusing. At least we know that a flaw exists. We can take some time to figure out what the cause is, since there are multiple workarounds.

SuperIlu commented 1 year ago

No worries and thanks for caring.

My main problem right now is that I need SLIRP as well as LFN for DOjS development, but I have enough alternatives so I'm good...

grapeli commented 1 year ago

I think the title of the bug report needs to be corrected. Indications that only the mingw version is affected when lfn=true.

The difference in dosbox-x logs between vs and mingw comes down to this. sqlite dosbox-x log diff

grapeli commented 1 year ago

Dosbox-x-git-cfb71b3 built with the clang 16.0.0 compiler with address sanitizer with lfn=true terminates causing stack buffer overflow. This is not the case with lfn=false. Tested under linux. dosbox-x.lfn.true.log

JayQ2K commented 1 year ago

Should lfn=true actually even be a configurable option for anything below DOS 7.x? If SQLite actually does something with the reported MS-DOS version then anything under ver=7.0 could easily break things, since older version don't have LFN support whatsoever. In that case it wouldn't matter whether DosBox-X supports LFN itself, since the application running gets mixed messages and breaks down.

Now I read the following from @SuperIlu :

I can confirm that lfn=auto and ver=7.1 also breaks SQLite.

making this one a little more complex to solve, but the above question is also a bit broader. Should LFN support be allowed for configuration for any reported DOS version below 7.x?

rderooy commented 1 year ago

making this one a little more complex to solve, but the above question is also a bit broader. Should LFN support be allowed for configuration for any reported DOS version below 7.x?

Valid question. But note that on legacy systems DOS 7.0 does not automatically mean that there is LFN support either. e.g., IBM PC-DOS 7 does not have LFN...

SuperIlu commented 1 year ago

AFAIK the only 'valid' method to check for LFN is to call INT 71A0h and check if you get an error or not (see http://www.ctyme.com/intr/rb-3194.htm and http://www.fysnet.net/longfile.htm). LFN support on several DOS flavors is not tied to the version (e.g. FreeDOS), but if an TSR is loaded or not...

JayQ2K commented 1 year ago

The latter part might be worthy of becoming an issue in its own. @rderooy : True that, but since dosbox-x.reference.full.conf states that it reports the MS-DOS version, I didn't bother to include MS anymore in my writings. If the reported DOS version is broader than that (so it could also include IBM PC DOS), I guess that should be reflected in the config-file. Major feature difference btw between MS-DOS 7.0 and 7.1 is FAT32 support.

Even broader, the question is what the validity of the whole option is. With the exception of RxDOS and seemingly PDOS, there is no DOS version that has LFN support built-in and they will all depend on Windows 9x to actually enable LFN support. I kinda doubt whether Windows 9x will respond well if LFN support is delivered through the kernel and thus not via the MS delivered drivers. You probably still want the ver=7.1 if that is required to install Windows 98. The whole lfn=... however seems to be irrelevant. In the end, both 7.0 and 7.1 (if MS-DOS) should respond to INT 71A0h.

With lfn=auto and ver=7.1 configured, does DOSBox then enable doslfn? If so, doesn't that potentially interfere with Windows versions running on top of DOSBox? EDIT: If the above logic holds, then isn't that the reason why SQLite could break with lfn=auto and ver=7.1 (or lfn=true for that matter)?

rderooy commented 1 year ago

The moment you boot another OS in DOSBox-X, it no longer matters what the integrated emulated DOS supports or not, as it will have a clean slate.

If you're running the Win9x SETUP program from the integrated emulated DOS that DOSBox-X provides, you can run it from the default 5.0 reported version. The reason the example config files in the Win9x installation guides use VER=7.0 or VER=7.1 is simply to:

  1. make listing and copying files, prior to starting Win9x more user friendly as you will have LFN support
  2. support FAT32 volumes for VER=7.1
JayQ2K commented 1 year ago

@rderooy Do you say there in so many words that LFN support gets disabled if anything other than then built-in OS is being run? Because that might be the ideal way forward, but also adding to it being weird that SQLite crashes in the first place. If however some remnants still function while running Windows 10, there are effectively 2 places that can deal with INT 71A0h. That could easily lead to undesired results.

I am somewhat missing the logic though. INT 71A0h and accompanying functionalities get delivered through DOS kernel and then a driver (e.g., DOSLFN or Windows LFN API) "activates" this functionality. Why would you then include LFN support in DOSBox-X beyond INT 71A0h in the first place, since for True DOS the whole LFN thing wasn't a problem to begin with. With all those applications that are dependent on LFN having their own LFN API included it seems to be stacking features that do the same thing.

Not that I would immediately take out LFN support (again, beyond INT 71A0h), but the driver should be unloaded completely when anything else than built-in OS is being run to ensure for a mostly similar environment to being run on classic hardware, since that never included LFN support in DOS.

rderooy commented 1 year ago

@JayQ2K yes, the moment you use the boot command to start a guest OS inside DOSBox-X, things like LFN, EMS, XMS, mouse driver, etc are all gone. It is up to the guest OS to provide any such functions should it need it. DOSBox-X will only emulate the hardware side of things and the BIOS interfaces.

That is why I had asked you to boot MS-DOS 7.0 or 7.1 inside DOSBox-X to see if it makes any difference.

JayQ2K commented 1 year ago

I'll leave the booting to other people since I just tagged along later. However, reading the above storyline, someone installed Windows 10 (effectively leading to the same place as installing MS-DOS 7, correct?) and then SQLite. If that is the case, then why would SQLite crash in the first place.

EDIT: still confused though. It LFN support shuts down when not running the built-in OS, then why have a configuration switch for it? That way you could actually force it to remain available. ver=7.0 or ver=7.1 would effectively be called: LFN kernel support lfn=true or lfn=auto (with ver 7.x) tells whether the driver or API is going to be run The latter should not be a configurable option. You are, based on configuration, running with or without LFN kernel support and as long as you don't include your own application with LFN support, the driver will be run to enable FreeDOS LFN support.

rderooy commented 1 year ago

I don't understand why you mention Windows 10 in this context. Windows 10 cannot be run inside DOSBox-X as a guest OS. It can only be used as the host OS on the system, to then run DOSBox-X as an application.

JayQ2K commented 1 year ago

Sorry, turning some things upside down. It's DOSBox on a Windows 10 installation. My bad.

rderooy commented 1 year ago

@JayQ2K again, once you boot a guest OS, settings like ver= or lfn= no longer matter. Those settings are only for the integrated emulated DOS that DOSBox-X provides itself.

JayQ2K commented 1 year ago

OK...? But then the question comes back to why #3898 can be an issue in the first place. And ver= seems to be usefull for the whole install Windows 9x and have long file names appear.

maron2000 commented 1 year ago

@JayQ2K @rderooy I think you guys are not understanding this issue properly. Visual Studio (and possibly Linux) builds WORK with regardless of lfn=true and/or Reported version. Unfortunately, MinGW version doesn't, which is the point of this issue. I don't know about other builds such as MacOS.

As you see in the following screenshot, long file name works even reported version is 5.00 on Visual Studio build. And as you may know, we aren't talking about a booted guest, but a mounted folder on a native DOSBox-X prompt. command_000

rderooy commented 1 year ago

@maron2000 I don't have any Windows host systems for testing, so my own tests are only on Linux host systems, where there is not the issue of VisualStudio vs MinGW builds.

In any case I never claimed that sqlite could not work with older DOS versions with lfn=true. I just pointed out that some software may get confused if you use LFN with DOS versions prior to 7.0. This is also why Wengier made lfn=auto behave the way it does.

Lastly, I very much feel like we are going around in circles on this, so I will bail out of the discussion.

maron2000 commented 1 year ago

@rderooy I also can't test all platforms so we can help each other. I also want to remind you that the original poster of this issue already tried ver=7.1 doesn't work as well. And I am always thankful of your comments to help others.

JayQ2K commented 1 year ago

Figured as much the latter should become a separate issue. My thing mainly is (stemming out of this issue though): why have full LFN support in DOSBox-X and not just limit it to DOS LFN kernel support? When any application requires functionality as such, it will just rely on DOS LFN kernel support and be on its way.

ver=7.0 would then imply Int 21/AH=71h support ver=7.1 means Int 21/AH=71h and FAT32 support Int 21/AH=71h support would remain enabled with boot since any given Guest OS could depend on it (why else would you configure ver to a 7.x option).

rderooy commented 1 year ago

No, this makes no sense. When you boot a guest OS, LFN and FAT32 support cannot and should not remain.

JayQ2K commented 1 year ago

Ok. I'm done with this issue now, but: Int 21/AH=71h should be built in the kernel. An LFN API makes use of it if it gets exposed. So of course Int 21/AH=71h should survive boot. It's just the LFN API that must be shut down under boot. If you shut down Int 21/AH=71h altogether (meaning the result for 71h would be 7100h, not supported) after boot then no way any application that is dependent on that support will function.

maron2000 commented 1 year ago

@JayQ2K Although you wish to, DOSBox-X now doesn't tweak a booted guest OS to enhance its functions (not limited to lfn), and it is practically not possible to implement such feature. Just use an guest supporting LFN, or use native DOSBox-X if you need it. MinGW version will not be an option until it gets fixed.

maron2000 commented 8 months ago

PRs #4645 and/or #4647 seems to have fixed this issue. command_000