Skip to content
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

Adding DOSBox as core for DOS TASing #4217

Open
wants to merge 97 commits into
base: master
Choose a base branch
from

Conversation

SergioMartin86
Copy link
Contributor

@SergioMartin86 SergioMartin86 commented Feb 11, 2025

  • Add floppy disk mounting
  • Add CD-ROM mounting
  • Add disk swapping
  • Add mem-based R/W Hard Disk
  • Add multiple pre-formatted disk images
  • Save Hard Disk to SaveRAM
  • Load Hard Disk from SaveRAM
  • Remove SDL dependency
  • Add video buffer getting
  • Add sound
  • Add keyboard
  • Add mouse
  • Add joystick
  • Create machine presets
  • Add setting overriding
  • Add file type association
  • Add input mnemonics
  • Add drive access light callbacks
  • Add mem domains
  • Add basic sound management settings
  • Add basic video management settings
  • Add basic cpu management settings
  • Add check for saveRAM (if hd size is different, do not load it)

Lag frame detection cannot be implemented since these machines are IRQ, not polling based

Pending Fixes:

  • CDRom images should be able to be passed as plain files (iso, cue+bin, etc), not as DiscAsset. -> Implemented a pseudo-fix: forcing cdrom images passed to DOSBox to be renamed to extension e.g., '.dosbox-iso', instead of .iso. Is there a better fix?
  • Timing seems to be a bit off (too fast)
  • Audio seems to be clicking (is this related to timing)
  • Figure out why windows 3.1 doesn't detect the mouse: requires a special driver. Otherwise it works correctly.

Test Tools:

Used this to test joystick and mouse support:
https://www.vogons.org/viewtopic.php?p=187168#p187168

Check if completed:

@@ -1937,7 +1938,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 MGBAHawk or NeoGeoPort or NES { BoardName: "FDS" } or DOSBox)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #4242.

private int _currentCDROM = 0;
private string GetFullName(IRomAsset rom) => rom.Game.Name + rom.Extension;

public override int VirtualWidth => LibDOSBox.SVGA_MAX_WIDTH;
Copy link
Contributor

@vadosnaprimer vadosnaprimer Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VirtualWidth represents how the framebuffer should be stretched by frontend to look authentic to how the user saw the final thing back in the day. For IBM PC that means it's just a 4:3 monitor. Now since height can't be stretched (because it represents scanlines), we should just tell frontend to resize width to be 4/3 of height.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I made the corresponding change and it looks correct now

@vadosnaprimer
Copy link
Contributor

Currently loading .dosbox-iso (the only thing I tried) opens this dialog

0cbcd2b824f19688

@vadosnaprimer
Copy link
Contributor

vadosnaprimer commented Feb 28, 2025

Mouse movement is now recognized! But is there a way to send deltas directly to the core without working with absolute values? Ideally relative mouse input would be exposed to user in addition to absolute position, so they could pick which of them to use for their particular game. In Doom core mouse movement ended up being relative-only, I think it would work for this core too as an option. This is valuable because absolute movement is very limited, like we saw with Doom, but relative movement allows unlimited turning, which is required for comfortable play.

SergioMartin86 and others added 3 commits February 28, 2025 18:09
scanlines remain constant so they aren't stretched, and width is adjusted to be 4/3 of height, because video modes in DOS were designed for a 4:3 monitor. exact pixel shapes may slightly differ depending on exact pixel clock but setting 4:3 for DOS is standard.
@SergioMartin86
Copy link
Contributor Author

Mouse movement is now recognized! But is there a way to send deltas directly to the core without working with absolute values? Ideally relative mouse input would be exposed to user in addition to absolute position, so they could pick which of them to use for their particular game. In Doom core mouse movement ended up being relative-only, I think it would work for this core too as an option. This is valuable because absolute movement is very limited, like we saw with Doom, but relative movement allows unlimited turning, which is required for comfortable play.

Yes, we can pass deltas, but we also need the absolutes for games that use it (Simcity) since it preserves the exact same position of the pointer as in the host window.

@vadosnaprimer
Copy link
Contributor

That's what I mean by it being optional: just expose both mouse controls for users to decide which to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants