Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
484 changes: 484 additions & 0 deletions dosbox-x/README.md

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions dosbox-x/component_functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#!/bin/bash

component_name="$(basename "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
component_config="/app/retrodeck/components/$component_name/rd_config"

dosbox_x_config="$XDG_CONFIG_HOME/dosbox-x/dosbox-x.conf" # Base config always appended to the WinPlay! calls. If we need to tweak something globally for all systems, this is the spot.
dosbox_x_mapper="$XDG_CONFIG_HOME/dosbox-x/mapper-dosbox-x.map" # DosBox-X default controls mapper file
dosbox_x_os_configs_dir="$component_config/os_configs" # WinPlay! will use the configs in this folder as pre-configured templates to generate temporary configs for OS installation and running, if we need to tweak something globally for a system, this is the spot
dosbox_x_generated_conf="$XDG_CONFIG_HOME/dosbox-x/generated.conf" # Used by WinPlay! to generate temporary configs for OS installation and running, this is disposable and will be delete/overwritten multiple times
winplay="open_component dosbox-x"

_prepare_component::dosbox-x() {
local action="$1"
shift

local component_config="$(get_own_component_path)/rd_config"

case "$action" in

reset)
log i "----------------------"
log i "Preparing $component_name"
log i "----------------------"

create_dir "$XDG_CONFIG_HOME/dosbox-x"
cp -fT "$component_config/dosbox-x.conf" "$dosbox_x_config"

# Default General Storage
create_dir "$storage_path/windows/dosbox-x"
set_setting_value "$dosbox_x_config" "working directory default" "$storage_path/windows/dosbox-x" "dosbox-x"

# Logs path
create_dir "$logs_path/dosbox-x"
set_setting_value "$dosbox_x_config" "logfile" "$logs_path/dosbox-x/dosbox-x.log" "dosbox-x"
;;

esac

}


dosbox_x_install_win98() {
log i "DosBox-X Windows 98 Installer started"
if [ -f "$storage_path/dosbox-x/win98.vhd" ]; then
log i "Existing Windows 98 installation found."
rd_zenity --question --text="An existing Windows 98 installation was found at \"$storage_path/dosbox-x/win98.vhd\".\n\nDo you want to run this existing installation instead of creating a new one?" --ok-label="Use Existing" --cancel-label="Create New"
if [ $? -eq 0 ]; then
log i "User chose to use the existing Windows 98 installation for DOSBox-X"
dosbox_x_run_win98
return
else
log i "User chose to create a new Windows 98 installation for DOSBox-X, existing installation will be overwritten"
rd_zenity --question --text="Are you sure you want to create a new Windows 98 installation? This will overwrite the existing installation and all its data at \"$storage_path/dosbox-x/win98.vhd\"." --ok-label="Yes, Create New" --cancel-label="No, Keep Existing"
if [ $? -ne 0 ]; then
log i "User aborted creating a new Windows 98 installation for DOSBox-X, existing installation will be kept"
return
else
log i "User confirmed creating a new Windows 98 installation for DOSBox-X"
rm -f "$storage_path/dosbox-x/win98.vhd"
fi
fi
fi
rd_zenity --info --text="This will create a disk layer in DOSBox-X on which you can install Windows 98.\nPlease select the CD-ROM image file for Windows 98 installation.\n\nNOTE: you will need a legit Windows 98 CD Key to complete the installation." --ok-label="Proceed" --cancel-label="Abort"
win98_cdrom=$(file_browse "This will install Windows 98 in DOSBox-X.\nSelect the CD-ROM image file for Windows 98 installation") || exit 0
$winplay --makefs win98
if ( $winplay --install win98 --cd-rom "$win98_cdrom" ); then
log i "Windows 98 installation completed successfully"
rd_zenity --info --text="First step of Windows 98 installation completed successfully.\n\nNow Windows 98 will boot.\nPlease prepare the environment like setting your desired resolution and colors.\nWhen finished please turn off Windows 98 from the Start menu to end the installation and save the changes to the disk layer."
dosbox_x_run_win98
rd_zenity --info --text="Windows 98 installation completed successfully.\nYou can now run install games in this Windows 98 environment using the 'DOSBox-X: Install Windows 98 Game' option in the Configurator."
else
log i "Windows 98 installation aborted"
fi
}

dosbox_x_run_win98() {
log i "DosBox-X starting Windows 98 layer"
rd_zenity --info --text="WARNING: editing Windows 98 Installation might cause to break already installed games.\nMake sure to backup your Windows 98 installation layer before making any changes."
$winplay --desktop win98
}
dosbox_x_install_win98_game() {
log i "DosBox-X Windows 98 Game Installer started"
rd_zenity --question --text="This will install the selected game for Windows 98 in DOSBox-X.\nMake sure your Windows 98 installation is ready.\n\nAre you installing your game from a CD-ROM or a Floppy disk image?" --switch --extra-button="CD-ROM" --extra-button="Floppy Disk" --extra-button="Abort"
case $? in
0)
local media_type="cd-rom"
local pretty_media_type="CD-ROM"
log i "User selected CD-ROM installation for Windows 98 game"
;;
1)
local media_type="floppy"
local pretty_media_type="Floppy Disk"
log i "User selected Floppy Disk installation for Windows 98 game"
;;
2) log i "Windows 98 game installation aborted by user"
exit 0
esac
game_image_path="$(file_browse "Select the $pretty_media_type image file for $game installation")"
local game="$(basename "$game_image_path" | sed 's/\.[^.]*$//')"
game="$(rd_zenity --entry --text="Enter the name of the game you want to install" --entry-text="$game" --title="Game Name Input")"
if ( ! $(rd_zenity --info --text="The game folder will be located in \"$roms_path/win98/$game\".\n\nProceed with the installation?" --ok-label="Proceed" --cancel-label="Abort") ); then
log i "User confirmed game installation for Windows 98 game: \"$game\" in \"$roms_path/win98/$game\" folder"
else
log i "Windows 98 game \"$game\" installation aborted by user"
return
fi
log d running command: $winplay --install win98 --$media_type "$game_image_path"
if ( $winplay --install win98 --$media_type "$game_image_path" ); then
log i "Windows 98 game \"$game\" installation completed"
rd_zenity --info --text="Windows 98 game \"$game\" installation completed.\nYou can now run install games in this Windows 98 environment using the 'DOSBox-X: Install Windows 98 Game' option in the Configurator."
else
log i "Windows 98 game \"$game\" installation aborted by user"
fi
}
17 changes: 17 additions & 0 deletions dosbox-x/component_launcher.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Setting component name and path based on the directory name
export component_name="$(basename "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
export component_path="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"

# Set LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$component_path/lib:$ffmpeg_path/25.08:$rd_shared_libs:$rd_shared_libs/org.freedesktop.Platform/25.08/:$rd_shared_libs/org.gnome.Platform/49/:$rd_shared_libs/org.freedesktop.Platform/25.08/:${DEFAULT_LD_LIBRARY_PATH}"
export QT_PLUGIN_PATH="$rd_shared_libs/org.freedesktop.Platform/25.08/plugins/:${QT_PLUGIN_PATH}"
export QT_QPA_PLATFORM_PLUGIN_PATH="$rd_shared_libs/org.freedesktop.Platform/25.08/plugins/platforms/:${QT_QPA_PLATFORM_PLUGIN_PATH}"

log i "RetroDECK is now launching $component_name"
log d "Library path is: $LD_LIBRARY_PATH"
log d "QT plugin path is: $QT_PLUGIN_PATH"
log d "QT QPA PLATFORM plugin path is: $QT_QPA_PLATFORM_PLUGIN_PATH"

exec "$component_path/bin/winplay.sh" "$@"
48 changes: 48 additions & 0 deletions dosbox-x/component_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"dosbox-x": {
"name": "DOSBox-X",
"url_rdwiki": "https://retrodeck.readthedocs.io/en/latest/wiki_engine_guides/dosbox-x/dosbox-x-guide/",
"url_webpage": "https://dosbox-x.com/",
"url_donation_purchase": "",
"url_source": "https://github.com/joncampbell123/dosbox-x",
"description": "DOSBox-X is a DOS, Windows 3.x and 9x emulator.",
"component_type": "Emulator",
"system_friendly_name": [
"Microsoft Windows 3x",
"Microsoft Windows 9x",
"Microsoft DOS"
],
"system": [
"windows3x",
"windows9x",
"dos"
],
"configurator_menus": {
"tools": {
"dosbox_x":{
"dosbox_x_install_win98": {
"name": "WinPlay! Install Windows 98",
"description": "Install Windows 98 in DOSBox-X emulator.",
"command": {
"zenity": "dosbox_x_install_win98"
}
},
"dosbox_x_run_win98": {
"name": "WinPlay! Run Windows 98",
"description": "Run the Windows 98 base layer in DOSBox-X emulator.",
"command": {
"zenity": "dosbox_x_run_win98"
}
},
"dosbox_x_install_win98_game": {
"name": "WinPlay! Install Windows 98 Game",
"description": "Install a Windows 98 game in DOSBox-X emulator.",
"command": {
"zenity": "dosbox_x_install_win98_game"
}
}
}
}
}
}
}
77 changes: 77 additions & 0 deletions dosbox-x/component_recipe.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"dosbox-x": [
{
"source_url": "com.dosbox_x.DOSBox-X",
"source_type": "flatpak_id",
"version": "$DOSBOX_X_DESIRED_VERSION",
"dest": "user",
"extraction_type": "flatpak",
"assets": [
{
"type": "dir",
"source": "bin",
"dest": "bin"
},
{
"type": "create",
"dest": "component_version",
"contents": "$SOURCE_VERSION"
},
{
"type": "dir",
"source": "$REPO_ROOT/$COMPONENT_NAME/rd_assets/winplay",
"dest": "bin"
},
{
"type": "dir",
"source": "$REPO_ROOT/$COMPONENT_NAME/rd_assets/rd_config",
"dest": "rd_config"
},
{
"type": "file",
"source": "$REPO_ROOT/$COMPONENT_NAME/component_functions.sh",
"dest": "$COMPONENT_ARTIFACT_ROOT"
},
{
"type": "file",
"source": "$REPO_ROOT/$COMPONENT_NAME/component_launcher.sh",
"dest": "$COMPONENT_ARTIFACT_ROOT"
},
{
"type": "file",
"source": "$REPO_ROOT/$COMPONENT_NAME/component_manifest.json",
"dest": "$COMPONENT_ARTIFACT_ROOT"
},
{
"type": "file",
"source": "$REPO_ROOT/$COMPONENT_NAME/component_recipe.json",
"dest": "$COMPONENT_ARTIFACT_ROOT"
}
],
"libs": [
{
"library": "libslirp.so.0",
"source": "lib",
"dest": "shared-libs"
},
{
"library": "libfluidsynth.so.3",
"source": "lib",
"dest": "shared-libs"
},
{
"library": "libSDL3.so.0",
"runtime_name": "org.freedesktop.Platform",
"runtime_version": "25.08",
"dest": "shared-libs"
},
{
"library": "libc.so.6",
"runtime_name": "org.freedesktop.Platform",
"runtime_version": "25.08",
"dest": "shared-libs"
}
]
}
]
}
30 changes: 30 additions & 0 deletions dosbox-x/rd_assets/later/os_configs/win30.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[sdl]
autolock=true

[dosbox]
title=Windows 3.0
memsize=16
machine=svga_et4000

[dos]
hard drive data rate limit=0
floppy drive data rate limit=0

[cpu]
cputype=pentium
core=normal

[sblaster]
sbtype=sbpro1

[pci]
voodoo=false

[ide, primary]
int13fakeio=true
int13fakev86io=false

[render]
scaler=none

[autoexec]
42 changes: 42 additions & 0 deletions dosbox-x/rd_assets/later/os_configs/win95.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[sdl]
autolock=true

[dosbox]
title=Windows 95
memsize=480

[video]
vmemsize=8
vesa modelist width limit=0
vesa modelist height limit=0

[dos]
# Set 'ver=7.1' if using Win95 OSR2 (95B) or later
ver=7.0
hard drive data rate limit=0
floppy drive data rate limit=0

[cpu]
cputype=pentium_mmx
core=normal
turbo = false

[sblaster]
sbtype=sb16vibra

[fdc, primary]
int13fakev86io=true

[ide, primary]
int13fakeio=true
int13fakev86io=true

[ide, secondary]
int13fakeio=true
int13fakev86io=true
cd-rom insertion delay=4000

[render]
scaler=none

[autoexec]
41 changes: 41 additions & 0 deletions dosbox-x/rd_assets/later/os_configs/win95osr2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[sdl]
autolock=true

[dosbox]
title=Windows 95 OSR2 - 2.5
memsize=480

[video]
vmemsize=8
vesa modelist width limit=0
vesa modelist height limit=0

[dos]
ver=7.1
hard drive data rate limit=0
floppy drive data rate limit=0

[cpu]
cputype=pentium_mmx
core=normal
turbo = false

[sblaster]
sbtype=sb16vibra

[fdc, primary]
int13fakev86io=true

[ide, primary]
int13fakeio=true
int13fakev86io=true

[ide, secondary]
int13fakeio=true
int13fakev86io=true
cd-rom insertion delay=4000

[render]
scaler=none

[autoexec]
Loading