Skip to content

Adding DOSBox as core for DOS TASing #4217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 222 commits into from
Apr 20, 2025
Merged
Show file tree
Hide file tree
Changes from 207 commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
29dff3c
Adding dosbox
SergioMartin86 Feb 11, 2025
08f48c7
Adding placeholder
SergioMartin86 Feb 11, 2025
291ded4
Adding initial placeholder for DOSBox
SergioMartin86 Feb 11, 2025
20b320f
update
SergioMartin86 Feb 13, 2025
a010b13
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 13, 2025
37e6fbd
Update
SergioMartin86 Feb 13, 2025
526fdeb
Update
SergioMartin86 Feb 13, 2025
5ed0937
progress
SergioMartin86 Feb 13, 2025
141ee39
Progress
SergioMartin86 Feb 13, 2025
7b4ac53
Merge branch 'master' into dosbox
SergioMartin86 Feb 13, 2025
d7301e4
Increasing mem capacity
SergioMartin86 Feb 13, 2025
572b420
Progress
SergioMartin86 Feb 15, 2025
c160b74
Now running timer correctly
SergioMartin86 Feb 16, 2025
5489374
Progress
SergioMartin86 Feb 16, 2025
ef15559
Stable
SergioMartin86 Feb 16, 2025
6c7eca4
Parsin inputs
SergioMartin86 Feb 16, 2025
3c15351
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 16, 2025
e5ee631
Keyboard working
SergioMartin86 Feb 17, 2025
8cf111d
stable before using memfiles
SergioMartin86 Feb 17, 2025
148390a
Now accepting rw hdds
SergioMartin86 Feb 19, 2025
73184cb
Hard disk rw working
SergioMartin86 Feb 20, 2025
a311140
merging with latest
SergioMartin86 Feb 20, 2025
bbec1d2
Fixing conflict
SergioMartin86 Feb 20, 2025
e177ec9
Getting samples
SergioMartin86 Feb 20, 2025
d59527e
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 20, 2025
26ca007
Reading samples but sounds too low
SergioMartin86 Feb 20, 2025
9030ae3
Reading samples but sounds too low
SergioMartin86 Feb 20, 2025
686aa47
Now accepting multiple cdrom/floppy images
SergioMartin86 Feb 21, 2025
fce80c6
Allowing swapping
SergioMartin86 Feb 21, 2025
e0a6b58
Enabling cdrom and disk swapping
SergioMartin86 Feb 21, 2025
75f6730
Updating
SergioMartin86 Feb 21, 2025
37e8fa4
Simplifying
SergioMartin86 Feb 22, 2025
93b249b
Simplifying
SergioMartin86 Feb 22, 2025
736064d
Simplifications
SergioMartin86 Feb 22, 2025
4ef0b11
Simplfiications
SergioMartin86 Feb 22, 2025
20d72f1
Capturing sdl delay
SergioMartin86 Feb 22, 2025
159e9fd
Adding configuration presets
SergioMartin86 Feb 22, 2025
363e902
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 22, 2025
f320439
Enabling joystick
SergioMartin86 Feb 22, 2025
5c13c91
Enabling joysticks
SergioMartin86 Feb 22, 2025
bfa12ba
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 22, 2025
54024de
Added mouse support
SergioMartin86 Feb 22, 2025
4996a0d
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 22, 2025
ff3b929
Adding mouse support
SergioMartin86 Feb 22, 2025
270f3e7
Progress with hard disk
SergioMartin86 Feb 22, 2025
182d1db
merging changes
SergioMartin86 Feb 22, 2025
55a46e6
Adding default hard disk images and making them selectable
SergioMartin86 Feb 22, 2025
b77c7be
Adding mnemonics, more configs, and some refactoring on the standard …
SergioMartin86 Feb 23, 2025
d629626
Processing file extensions
SergioMartin86 Feb 23, 2025
fe1e520
Adding sram
SergioMartin86 Feb 23, 2025
2307bc2
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 23, 2025
3952c93
Adding saveram
SergioMartin86 Feb 23, 2025
cca7ae3
Adding drive lights
SergioMartin86 Feb 23, 2025
c549add
Adding drive lights
SergioMartin86 Feb 23, 2025
887d7d5
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 23, 2025
75c231f
Adding memory domains
SergioMartin86 Feb 23, 2025
cb4f8d0
Removing warnings
SergioMartin86 Feb 23, 2025
8515d30
Fixing warning
SergioMartin86 Feb 23, 2025
7f14c7c
Revert unrelated changes to Multi-Disk Bundler
YoshiRulz Feb 23, 2025
3e62253
Re-alphabetise lists and clean up diff
YoshiRulz Feb 23, 2025
9a89fe3
Missed a bit
YoshiRulz Feb 23, 2025
2bf20f1
Make `DOSBox`' `ISaveRam` implementations `override`
YoshiRulz Feb 23, 2025
b7874ca
Fix `DOSBox`' `[PortedCore]`
YoshiRulz Feb 23, 2025
37198b4
Clean up string comparisons in `DOSBox` ctor
YoshiRulz Feb 23, 2025
94e63c4
Set values for `WriteableHardDiskOptions` instead of translating
YoshiRulz Feb 23, 2025
18335d5
Clean up reading of DOSBox config presets from embedded resources
YoshiRulz Feb 23, 2025
05540e9
Fix code style warning
YoshiRulz Feb 23, 2025
5841416
Removing duped line
SergioMartin86 Feb 24, 2025
338a1e6
Fixing extension parsing
SergioMartin86 Feb 24, 2025
363c8b2
Small adjustments
SergioMartin86 Feb 24, 2025
c42ce50
Aligning fps to that of normal DOS
SergioMartin86 Feb 25, 2025
ff8689f
merging with c# changes
SergioMartin86 Feb 25, 2025
964a118
Aligning fps to that of normal DOS
SergioMartin86 Feb 25, 2025
3655185
Simplified extension getting and adding base config file resource
SergioMartin86 Feb 25, 2025
7be1d54
Remove unused import
YoshiRulz Feb 25, 2025
faf8932
Properly measuring extended mem size
SergioMartin86 Feb 25, 2025
f4a3a8e
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 25, 2025
c226049
Adding more settings and simplifying machine presets
SergioMartin86 Feb 25, 2025
3e28bf1
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 25, 2025
6d1a6a2
Adding check for SRAM size to prevent wrong-sized HD being loaded
SergioMartin86 Feb 25, 2025
93b7dc9
Removing unnecessary directive
SergioMartin86 Feb 25, 2025
0d11d21
Update correct DOS framerate
SergioMartin86 Feb 26, 2025
738d588
Adding sensible configuration presets
SergioMartin86 Feb 26, 2025
5a173ce
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 26, 2025
c69820e
Adding to the config preset description text
SergioMartin86 Feb 26, 2025
94caf33
Update src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicL…
SergioMartin86 Feb 27, 2025
f8c505f
Merge branch 'master' into dosbox
SergioMartin86 Feb 27, 2025
a09a9d4
Removing stale config files
SergioMartin86 Feb 27, 2025
5be138c
Fixed mouse emulation
SergioMartin86 Feb 28, 2025
4202fa8
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 28, 2025
1312913
Fixed mouse emulation
SergioMartin86 Feb 28, 2025
eeb848b
Removing unused keyboard flag
SergioMartin86 Feb 28, 2025
c9fda85
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Feb 28, 2025
d254538
Addressing feos' comment about virtual height/width
SergioMartin86 Feb 28, 2025
a4fc304
Fixed bug with saveram
SergioMartin86 Feb 28, 2025
b5e3e70
fix VirtualWidth
vadosnaprimer Feb 28, 2025
5b1c4c1
DependentUpon
vadosnaprimer Feb 28, 2025
de62678
Making FPS configurable
SergioMartin86 Mar 2, 2025
7bc5f29
Making FPS configurable
SergioMartin86 Mar 2, 2025
6404f20
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Mar 2, 2025
7d8e10e
Adding fps num/denom
SergioMartin86 Mar 6, 2025
3a97201
Implementing proper fps numerator / denominator defaults for DOS
SergioMartin86 Mar 6, 2025
9c8f6a9
Passing mouse deltas from bk
SergioMartin86 Mar 7, 2025
20f9c33
Passing mouse deltas from bk to the core
SergioMartin86 Mar 7, 2025
37c5aa6
expose and use deltas directly
vadosnaprimer Mar 8, 2025
d73e8c3
Implementing support for .cue+.bin and other cdrom types
SergioMartin86 Mar 8, 2025
ebc7ed7
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Mar 8, 2025
92956d9
Fixing sensitivity
SergioMartin86 Mar 8, 2025
cdbab95
Fixing conflict
SergioMartin86 Mar 8, 2025
3553861
Adjusting mouse sensitivity
SergioMartin86 Mar 8, 2025
b822e2b
Fixing integration for windows
SergioMartin86 Mar 8, 2025
69d6cdc
updating with upstream
SergioMartin86 Mar 16, 2025
79a8e81
[WIP] loading cds from bk
SergioMartin86 Mar 16, 2025
7c7c12a
[WIP] loading cds from bk
SergioMartin86 Mar 16, 2025
47f63b7
Using .cdrom extension for cdroms, and passing disk name to the read …
SergioMartin86 Mar 16, 2025
5756436
Using .cdrom extension for cdroms, and passing disk name to the read …
SergioMartin86 Mar 16, 2025
b4de985
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Mar 16, 2025
cddad21
Cleanup and fixing .iso loading and swapping
SergioMartin86 Mar 17, 2025
ac5057d
Fixing .iso loading and cdrom swapping
SergioMartin86 Mar 17, 2025
94e557a
Adding default controllers
SergioMartin86 Mar 17, 2025
6235b76
Fix warning
SergioMartin86 Mar 17, 2025
b33ebf3
Added callback for video updates to prevent tearing
SergioMartin86 Mar 17, 2025
399855a
merge with latest changes
SergioMartin86 Mar 17, 2025
a56e127
Removing unnecessary message
SergioMartin86 Mar 17, 2025
716e3d6
Merge branch 'master' into dosbox
YoshiRulz Mar 17, 2025
3ec532f
Fix line endings in `Bk2MnemonicLookup.cs`
YoshiRulz Mar 17, 2025
d59ee09
Fix indentation
YoshiRulz Mar 17, 2025
ca370bc
Fix misc. whitespace crimes
YoshiRulz Mar 17, 2025
c3133b1
Drop redundant `<None Remove/>`
YoshiRulz Mar 17, 2025
6e806aa
More whitespace fixes
YoshiRulz Mar 17, 2025
948b856
More code style fixes
YoshiRulz Mar 17, 2025
1b07dc0
Small fixes
SergioMartin86 Mar 18, 2025
355dce2
Fixing misc comments
SergioMartin86 Mar 18, 2025
72ba79b
Adjusting naming
SergioMartin86 Mar 18, 2025
985cc02
Fixing values
SergioMartin86 Mar 18, 2025
eae719a
Removing dead code
SergioMartin86 Mar 18, 2025
4ecb8f9
Clarifying the source of DOS framerate chosen
SergioMartin86 Mar 18, 2025
02e5f00
Removing unused variable
SergioMartin86 Mar 18, 2025
82a3bd5
Removing duped assignments
SergioMartin86 Mar 18, 2025
19d9ef7
Fixing typo
SergioMartin86 Mar 18, 2025
d229a7a
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Mar 18, 2025
7d140f5
Removing no-longer required SRAM management
SergioMartin86 Mar 18, 2025
a9387ee
Removing no longer required sram management functions
SergioMartin86 Mar 18, 2025
488ec5d
Removing no-longer needed SRAM logic
SergioMartin86 Mar 18, 2025
a4a19aa
Fixing framerates as per feos's comment
SergioMartin86 Mar 19, 2025
f5b2d63
Passing init struct for a more tidy initialization. Also fixing ident…
SergioMartin86 Mar 19, 2025
54c8180
Fixing hard landing on failure to load SRAM. This is needed to preven…
SergioMartin86 Mar 19, 2025
a25b23b
Added missing submodule and artifact
SergioMartin86 Mar 19, 2025
bb9e0f7
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Mar 19, 2025
bb1491d
Reverting unnecessary change
SergioMartin86 Mar 19, 2025
3e9c5a6
Removing no longer needd dosbox-iso extensions
SergioMartin86 Mar 19, 2025
af205a8
Removing no-longer necessary virtuals
SergioMartin86 Mar 19, 2025
adbb218
fix
SergioMartin86 Mar 19, 2025
e8a976c
Adding lines into readme
SergioMartin86 Mar 19, 2025
5319a73
fixing indentation
SergioMartin86 Mar 19, 2025
be374cb
Reducing job concurrency for dosbox -- otherwise the server gets over…
SergioMartin86 Mar 19, 2025
3ef3f8c
adding recursive submodule for dosbox-x
SergioMartin86 Mar 19, 2025
4a1d977
Simplifying
SergioMartin86 Mar 20, 2025
c0559c9
Simplifying
SergioMartin86 Mar 20, 2025
bc0b826
Simplifying
SergioMartin86 Mar 20, 2025
4a84de9
Simplifying
SergioMartin86 Mar 20, 2025
4e22c2b
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Mar 20, 2025
3e43a74
Only offer drive switching if more than one drive is present
SergioMartin86 Mar 21, 2025
7774d4a
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Mar 21, 2025
071667c
Adding proper Disc identification for ISO9660 / Joliet (default targe…
SergioMartin86 Mar 22, 2025
eb72fc7
Adding CDROM case
SergioMartin86 Mar 22, 2025
9797d58
Moving comments to proper place
SergioMartin86 Mar 23, 2025
88d2a58
Moving comments to proper place
SergioMartin86 Mar 23, 2025
e68aa2e
Code style fixes
YoshiRulz Mar 27, 2025
1bbceeb
Clean up handling of Next Disc buttons
YoshiRulz Mar 27, 2025
3fe534b
Clean up `DOSBoxKeyboard` definition
YoshiRulz Mar 27, 2025
47e4df8
Remove redundant button mnemonic overrides
YoshiRulz Mar 27, 2025
4f603db
remove leftover hack from my initial 2-byte range
vadosnaprimer Mar 29, 2025
c7b5459
Fixing mouse buttons getting stuck and aligning mouse speed minmaxes …
SergioMartin86 Mar 29, 2025
55e1f4b
Fixing mouse
SergioMartin86 Mar 29, 2025
27ef76b
Removing default framerate for DOS
SergioMartin86 Mar 29, 2025
6ed550b
set mouse speed range to match raw deltas range
vadosnaprimer Apr 12, 2025
9f9148b
fix casing on public fields
vadosnaprimer Apr 12, 2025
942c708
fix num/denom values to match dosbox-x for when it launches into dos
vadosnaprimer Apr 12, 2025
90833fc
use an existing thing instead of GetFullName
vadosnaprimer Apr 13, 2025
10e4e08
Move init of new `MouseState` to top and eliminate locals
YoshiRulz Apr 13, 2025
7119fd4
fix naming for mouse states
vadosnaprimer Apr 13, 2025
c42f033
update submodules
vadosnaprimer Apr 13, 2025
c667431
Adding function to get video refresh rate
SergioMartin86 Apr 13, 2025
ced12c5
Adding report on video refresh rate update
SergioMartin86 Apr 13, 2025
e5b16a6
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Apr 13, 2025
7654254
Revert "Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk in…
SergioMartin86 Apr 13, 2025
47eab9b
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Apr 13, 2025
4f1636c
Removing unnecessary directive
SergioMartin86 Apr 13, 2025
4e2dbae
Merge branch 'master' into dosbox
SergioMartin86 Apr 13, 2025
e06154b
Fixing reboot
SergioMartin86 Apr 13, 2025
03bebd8
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Apr 13, 2025
3998332
fps notice formatting
vadosnaprimer Apr 13, 2025
0eeada6
Zero init fps vals
SergioMartin86 Apr 13, 2025
529e783
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Apr 13, 2025
0846112
Using variable framerates
SergioMartin86 Apr 13, 2025
ea0e1bc
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Apr 13, 2025
54c2f7a
Now accepting variable framerates as given by the core
SergioMartin86 Apr 13, 2025
66b61e2
Moving ISO9660 detection lower
SergioMartin86 Apr 14, 2025
11e83ee
Storing refresh rate in savestate -- update it on load if different
SergioMartin86 Apr 14, 2025
e72bb9e
fix GetFullName()
vadosnaprimer Apr 14, 2025
c9c13af
Adding function to get number of ran cycles
SergioMartin86 Apr 14, 2025
ea70a8f
Adding ICycleTiming
SergioMartin86 Apr 14, 2025
bcf8283
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Apr 14, 2025
a73f61c
attoseconds are obsolete now
vadosnaprimer Apr 14, 2025
5eb69bb
fix loading CDs with spaces in their name
vadosnaprimer Apr 14, 2025
204ea04
Message duration needs to be left to the user to configure. Just pass…
SergioMartin86 Apr 15, 2025
a358f56
Setting notify times back to 4 seconds cause these require a bit more…
SergioMartin86 Apr 15, 2025
c223120
Updating CycleCount from within wbx
SergioMartin86 Apr 15, 2025
87218e6
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Apr 15, 2025
49e7a29
Simplifying cycle timing
SergioMartin86 Apr 15, 2025
5354ac0
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Apr 15, 2025
6d33cb9
Removing FPS change notification, using default waiting times
SergioMartin86 Apr 15, 2025
088865c
Updating submodule
SergioMartin86 Apr 15, 2025
3f51434
Fixing bug in disc swapping
SergioMartin86 Apr 16, 2025
a01b786
Adding drive selection functionality
SergioMartin86 Apr 16, 2025
2a44bf9
Merge branch 'dosbox' of github.com:SergioMartin86/BizHawk into dosbox
SergioMartin86 Apr 16, 2025
ec2c341
fixing period input
SergioMartin86 Apr 16, 2025
b4bc072
Adding logic to present disc swapping operations from repeating when …
SergioMartin86 Apr 17, 2025
8831190
added defines for drive id
SergioMartin86 Apr 19, 2025
fb339fb
point submodule to specific branch
vadosnaprimer Apr 20, 2025
8dbe453
Merge remote-tracking branch 'remotes/origin/master' into dosbox
vadosnaprimer Apr 20, 2025
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
2 changes: 2 additions & 0 deletions .github/workflows/waterbox-cores.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
git submodule update --init uae/libretro-uae;
git submodule update --init stella/core;
git submodule update --init dsda/core;
git submodule update --init --recursive dosbox/dosbox-x;
- name: Install clang 18
run: wget https://apt.llvm.org/llvm.sh;
chmod u+x llvm.sh;
Expand All @@ -61,6 +62,7 @@ jobs:
Assets/dll/ares64_interpreter.wbx.zst
Assets/dll/ares64_recompiler.wbx.zst
Assets/dll/bsnes.wbx.zst
Assets/dll/dosbox.wbx.zst
Assets/dll/dsda.wbx.zst
Assets/dll/faust.wbx.zst
Assets/dll/gpgx.wbx.zst
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
[submodule "ExternalProjects/FlooohChips/chips"]
path = ExternalProjects/FlooohChips/chips
url = https://github.com/floooh/chips.git
[submodule "waterbox/dosbox/dosbox-x"]
path = waterbox/dosbox/dosbox-x
url = https://github.com/TASEmulators/dosbox-x.git
[submodule "waterbox/dsda/core"]
path = waterbox/dsda/core
url = https://github.com/TASEmulators/dsda-doom.git
Expand Down
22 changes: 22 additions & 0 deletions Assets/defctrl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,28 @@
"Mult": 1.0,
"Deadzone": 0.0
}
},
"DOSBox Controller": {
"Mouse Position X": {
"Value": "WMouse X",
"Mult": 1.0,
"Deadzone": 0.0
},
"Mouse Position Y": {
"Value": "WMouse Y",
"Mult": 1.0,
"Deadzone": 0.0
},
"Mouse Speed X": {
"Value": "RMouse X",
"Mult": 1.0,
"Deadzone": 0.0
},
"Mouse Speed Y": {
"Value": "RMouse Y",
"Mult": 1.0,
"Deadzone": 0.0
}
}
},
"AllTrollersFeedbacks": {
Expand Down
Binary file added Assets/dll/dosbox.wbx.zst
Binary file not shown.
8 changes: 8 additions & 0 deletions src/BizHawk.Client.Common/RomLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ void NoCoreForSystem(string sysID)
}
switch (discType)
{
case DiscType.DOS:
game.System = VSystemID.Raw.DOS;
break;

case DiscType.SegaSaturn:
game.System = VSystemID.Raw.SAT;
break;
Expand Down Expand Up @@ -998,6 +1002,8 @@ private static class RomFileExtensions

public static readonly IReadOnlyCollection<string> Doom = new[] { "wad" };

public static readonly IReadOnlyCollection<string> DOS = new[] { "ima", "img", "xdf", "dmf", "fdd", "fdi", "nfd", "d88" };

public static readonly IReadOnlyCollection<string> GB = new[] { "gb", "gbc", "sgb" };

public static readonly IReadOnlyCollection<string> GBA = new[] { "gba" };
Expand Down Expand Up @@ -1056,6 +1062,7 @@ private static class RomFileExtensions
.Concat(C64)
.Concat(Coleco)
.Concat(Doom)
.Concat(DOS)
.Concat(GB)
.Concat(GBA)
.Concat(GEN)
Expand Down Expand Up @@ -1099,6 +1106,7 @@ private static class RomFileExtensions
new FilesystemFilter(/*VSystemID.Raw.C64*/"SID Commodore 64 Music File", Array.Empty<string>(), devBuildExtraExts: new[] { "sid" }, devBuildAddArchiveExts: true),
new FilesystemFilter(/*VSystemID.Raw.Coleco*/"ColecoVision", RomFileExtensions.Coleco, addArchiveExts: true),
new FilesystemFilter(/*VSystemID.Raw.Doom*/"Doom / Hexen / Heretic WAD File", RomFileExtensions.Doom),
new FilesystemFilter(/*VSystemID.Raw.DOS*/"DOS", RomFileExtensions.DOS),
new FilesystemFilter(/*VSystemID.Raw.GB*/"Gameboy", RomFileExtensions.GB.Concat(new[] { "gbs" }).ToList(), addArchiveExts: true),
new FilesystemFilter(/*VSystemID.Raw.GBA*/"Gameboy Advance", RomFileExtensions.GBA, addArchiveExts: true),
new FilesystemFilter(/*VSystemID.Raw.GEN*/"Genesis", RomFileExtensions.GEN.Concat(FilesystemFilter.DiscExtensions).ToList(), addArchiveExts: true),
Expand Down
4 changes: 4 additions & 0 deletions src/BizHawk.Client.EmuHawk/MainForm.VSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using BizHawk.Emulation.Cores.Computers.AmstradCPC;
using BizHawk.Emulation.Cores.Computers.AppleII;
using BizHawk.Emulation.Cores.Computers.Commodore64;
using BizHawk.Emulation.Cores.Computers.DOS;
using BizHawk.Emulation.Cores.Computers.Doom;
using BizHawk.Emulation.Cores.Computers.MSX;
using BizHawk.Emulation.Cores.Computers.SinclairSpectrum;
Expand Down Expand Up @@ -1192,6 +1193,9 @@ ToolStripMenuItemEx CreateCoreSubmenu(VSystemCategory cat, string coreName, para
// Cygne
items.Add(CreateCoreSubmenu(VSystemCategory.Handhelds, CoreNames.Cygne, CreateGenericCoreConfigItem<WonderSwan>(CoreNames.Cygne)));

// DOSBox
items.Add(CreateCoreSubmenu(VSystemCategory.PCs, CoreNames.DOSBox, CreateGenericCoreConfigItem<DOSBox>(CoreNames.DOSBox)));

// DSDA-Doom
items.Add(CreateCoreSubmenu(VSystemCategory.Other, CoreNames.DSDA, CreateGenericCoreConfigItem<DSDA>(CoreNames.DSDA)));

Expand Down
3 changes: 2 additions & 1 deletion src/BizHawk.Client.EmuHawk/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using BizHawk.Emulation.Cores;
using BizHawk.Emulation.Cores.Computers.AppleII;
using BizHawk.Emulation.Cores.Computers.Commodore64;
using BizHawk.Emulation.Cores.Computers.DOS;
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
using BizHawk.Emulation.Cores.Consoles.SNK;
using BizHawk.Emulation.Cores.Nintendo.GBA;
Expand Down Expand Up @@ -2015,7 +2016,7 @@ private void LoadSaveRam()
byte[] sram;

// some cores might not know how big the saveram ought to be, so just send it the whole file
if (Emulator is AppleII or C64 or MGBAHawk or NeoGeoPort or NES { BoardName: "FDS" })
if (Emulator is AppleII or C64 or DOSBox or MGBAHawk or NeoGeoPort or NES { BoardName: "FDS" })
{
sram = File.ReadAllBytes(saveRamPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public MultiDiskBundler()
VSystemID.Raw.Arcade,
VSystemID.Raw.C64,
VSystemID.Raw.Doom,
VSystemID.Raw.DOS,
VSystemID.Raw.GBL,
VSystemID.Raw.GEN,
VSystemID.Raw.GGL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,86 @@
["Weapon Select 6"] = '6',
["Weapon Select 7"] = '7',
},
[VSystemID.Raw.DOS] = new()

Check warning on line 856 in src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-22.04)

Check warning on line 856 in src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest)

{
["Joystick Button 1"] = '1',
["Joystick Button 2"] = '2',
["Joystick Up"] = 'U',
["Joystick Down"] = 'D',
["Joystick Left"] = 'L',
["Joystick Right"] = 'R',
["Mouse Left Button"] = 'l',
["Mouse Middle Button"] = 'm',
["Mouse Right Button"] = 'r',
["Next Floppy Disk"] = '>',
["Next CDROM"] = '}',
["F1"] = 'F',
["F2"] = 'F',
["F3"] = 'F',
["F4"] = 'F',
["F5"] = 'F',
["F6"] = 'F',
["F7"] = 'F',
["F8"] = 'F',
["F9"] = 'F',
["F10"] = 'F',
["F11"] = 'F',
["F12"] = 'F',
["Escape"] = 'e',
["Tab"] = 't',
["Backspace"] = 'b',
["Enter"] = 'e',
["Space"] = 's',
["LeftAlt"] = 'a',
["RightAlt"] = 'a',
["LeftCtrl"] = 'c',
["RightCtrl"] = 'c',
["LeftShift"] = 's',
["RightShift"] = 's',
["CapsLock"] = 'C',
["ScrollLock"] = 'S',
["NumLock"] = 'N',
["Grave"] = '`',
["Minus"] = '-',
["Equals"] = '=',
["Backslash"] = 'b',
["LeftBracket"] = '[',
["RightBracket"] = ']',
["Semicolon"] = ';',
["Quote"] = '\'',
["Period"] = '.',
["Comma"] = ',',
["Slash"] = '/',
["ExtraLtGt"] = '>',
["PrintScreen"] = 'p',
["Pause"] = 'p',
["Insert"] = 'i',
["Home"] = 'h',
["Pageup"] = 'p',
["Delete"] = 'd',
["End"] = 'e',
["Pagedown"] = 'p',
["Left"] = 'l',
["Up"] = 'u',
["Down"] = 'd',
["Right"] = 'r',
["Keypad1"] = '1',
["Keypad2"] = '2',
["KeyPad3"] = '3',
["KeyPad4"] = '4',
["KeyPad5"] = '5',
["KeyPad6"] = '6',
["KeyPad7"] = '7',
["KeyPad8"] = '8',
["KeyPad9"] = '9',
["KeyPad0"] = '0',
["KeyPadDivide"] = '/',
["KeyPadMultiply"] = '*',
["KeyPadMinus"] = '-',
["keyPadPlus"] = '+',
["KeyPadEnter"] = 'e',
["KeyPadPeriod"] = '.',
}
};

private static readonly Dictionary<string, string> BaseAxisLookupTable = new Dictionary<string, string>
Expand Down
4 changes: 4 additions & 0 deletions src/BizHawk.Emulation.Common/Database/Database.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ public static GameInfo GetGameInfo(byte[] romData, string fileName)
game.System = VSystemID.Raw.Amiga;
break;

case ".D88" or ".DMF" or ".FDD" /*or ".FDI"*/ or ".IMA" or ".IMG" or ".NFD" or ".XDF":
game.System = VSystemID.Raw.DOS;
break;

case ".IPF":
var ipfId = new IpfIdentifier(romData);
game.System = ipfId.IdentifiedSystem;
Expand Down
1 change: 1 addition & 0 deletions src/BizHawk.Emulation.Common/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static class EmulatorExtensions
[VSystemID.Raw.Coleco] = "ColecoVision",
// DEBUG
[VSystemID.Raw.Doom] = "Doom",
[VSystemID.Raw.DOS] = "DOS",
[VSystemID.Raw.GBL] = "Game Boy Link",
[VSystemID.Raw.GB] = "GB",
[VSystemID.Raw.SGB] = "SGB",
Expand Down
1 change: 1 addition & 0 deletions src/BizHawk.Emulation.Common/VSystemID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static class Raw
public const string Coleco = "Coleco";
public const string DEBUG = "DEBUG";
public const string Doom = "Doom";
public const string DOS = "DOS";
public const string Dreamcast = "Dreamcast";
public const string GameCube = "GameCube";
public const string GB = "GB";
Expand Down
1 change: 1 addition & 0 deletions src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<Compile Update="Computers/AppleII/AppleII.*.cs" DependentUpon="AppleII.cs" />
<Compile Update="Computers/Commodore64/C64.*.cs" DependentUpon="C64.cs" />
<Compile Update="Computers/Doom/DSDA.*.cs" DependentUpon="DSDA.cs" />
<Compile Update="Computers/DOS/DOSBox.*.cs" DependentUpon="DOSBox.cs" />
<Compile Update="Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.*.cs" DependentUpon="NECUPD765.cs" />
<Compile Update="Computers/SinclairSpectrum/Hardware/Disk/NECUPS765.Static.cs" DependentUpon="NECUPD765.cs" />
<Compile Update="Computers/SinclairSpectrum/Machine/Pentagon128K/Pentagon128.*.cs" DependentUpon="Pentagon128.cs" />
Expand Down
128 changes: 128 additions & 0 deletions src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.Controllers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
using System.Collections.Generic;
using BizHawk.Common;
using BizHawk.Emulation.Common;

namespace BizHawk.Emulation.Cores.Computers.DOS
{
public partial class DOSBox
{
// A class to store the current state of the mouse for delta and button activation calculation
private class MouseState
{
public int PosX = 0;
public int PosY = 0;
public bool LeftButtonHeld = false;
public bool MiddleButtonHeld = false;
public bool RightButtonHeld = false;
}

private MouseState _lastMouseState = new MouseState();

private static readonly (string Name, LibDOSBox.DOSBoxKeyboard Key)[] _keyboardMap = CreateKeyboardMap();

private static (string Name, LibDOSBox.DOSBoxKeyboard Value)[] CreateKeyboardMap()
{
var keyboardMap = new List<(string, LibDOSBox.DOSBoxKeyboard)>();
// ReSharper disable once LoopCanBeConvertedToQuery
foreach (var k in Enum.GetValues(typeof(LibDOSBox.DOSBoxKeyboard)))
{
if (k is LibDOSBox.DOSBoxKeyboard.Key_None) continue;
var name = Enum.GetName(typeof(LibDOSBox.DOSBoxKeyboard), k)!.Replace('_', ' ');
keyboardMap.Add((name, (LibDOSBox.DOSBoxKeyboard) k));
}

return keyboardMap.ToArray();
}

private static ControllerDefinition CreateControllerDefinition(SyncSettings settings, int floppyDiskCount, int cdROMCount)
{
var controller = new ControllerDefinition("DOSBox Controller");

// Adding joystick buttons
if (settings.EnableJoystick1)
{
foreach (var button in JoystickButtonCollection)
{
controller.BoolButtons.Add("P1 " + Inputs.Joystick + " " + button);
}
}

if (settings.EnableJoystick2)
{
foreach (var button in JoystickButtonCollection)
{
controller.BoolButtons.Add("P2 " + Inputs.Joystick + " " + button);
}
}

// Adding mouse inputs
if (settings.EnableMouse)
{
controller.BoolButtons.Add(Inputs.Mouse + " " + MouseInputs.LeftButton);
controller.BoolButtons.Add(Inputs.Mouse + " " + MouseInputs.MiddleButton);
controller.BoolButtons.Add(Inputs.Mouse + " " + MouseInputs.RightButton);

// Although most apps (including windows) use speed to compute the mouse position, some games (SimCity) use the absolute value
// The absolute values needs to be 1:1 with the video size, as this is translated 1:1 to the core.
// The effect is that the position on BK's window translates perfectly to the core
controller.AddAxis(Inputs.Mouse + " " + MouseInputs.PosX, (0).RangeTo(LibDOSBox.SVGA_MAX_WIDTH), LibDOSBox.SVGA_MAX_WIDTH / 2);
controller.AddAxis(Inputs.Mouse + " " + MouseInputs.PosY, (0).RangeTo(LibDOSBox.SVGA_MAX_HEIGHT), LibDOSBox.SVGA_MAX_HEIGHT / 2);

// Range above 180 results in minimal mouse movement values bigger than 1, and we need 1 as a basis before sensitivity is applied
// To adjust sensitivity, use the corresponding sync setting (global sensitivity for raw deltas is a TODO)
controller.AddAxis(Inputs.Mouse + " " + MouseInputs.SpeedX, (-180).RangeTo(180), 0);
controller.AddAxis(Inputs.Mouse + " " + MouseInputs.SpeedY, (-180).RangeTo(180), 0);
}

// Adding drive management buttons
if (floppyDiskCount > 1) controller.BoolButtons.Add(Inputs.NextFloppyDisk);
if (cdROMCount > 1) controller.BoolButtons.Add(Inputs.NextCDROM);

foreach (var (name, _) in _keyboardMap)
{
controller.BoolButtons.Add(name);
controller.CategoryLabels[name] = "Keyboard";
}

return controller.MakeImmutable();
}

private static string[] JoystickButtonCollection = [
JoystickButtons.Up,
JoystickButtons.Down,
JoystickButtons.Left,
JoystickButtons.Right,
JoystickButtons.Button1,
JoystickButtons.Button2
];

private static class JoystickButtons
{
public const string Up = "Up";
public const string Down = "Down";
public const string Left = "Left";
public const string Right = "Right";
public const string Button1 = "Button 1";
public const string Button2 = "Button 2";
}

private static class MouseInputs
{
public const string LeftButton = "Left Button";
public const string RightButton = "Right Button";
public const string MiddleButton = "Middle Button";
public const string PosX = "Position X";
public const string PosY = "Position Y";
public const string SpeedX = "Speed X"; // How many pixels has it changed in a single frame
public const string SpeedY = "Speed Y";
}

private static class Inputs
{
public const string Joystick = "Joystick";
public const string Mouse = "Mouse";
public const string NextFloppyDisk = "Next Floppy Disk";
public const string NextCDROM = "Next CDROM";
}
}
}
Loading
Loading