MaddTheSane / Boxer

The DOS game emulator that's fit for your Mac.
http://boxerapp.com/
GNU General Public License v2.0
423 stars 39 forks source link

Filesystem Write/Access issues #25

Closed troydm closed 2 years ago

troydm commented 3 years ago

Tried using latest version built from source and it has a weird filesystem access/write issue, when I try to create a folder from inside dos cli using mkdir nothing happens and folder is not created, also I can cd to newly created folder despite dir command not showing it but anything from there is not possible like creating files in a folder... etc....

ticky commented 3 years ago

Can confirm, I’ve seen the same behaviour on an M1. I initially thought it might be a Full-Disk Access thing, but even when Boxer is granted that access it’s an issue. Running the latest Homebrew-provided DOSBox pointed at the same mount points works fine.

troydm commented 3 years ago

@ticky yup, forgot to mention I've too tried granting 'Full Disk' and 'Files and Folders' access with no luck

kcgen commented 3 years ago

@troydm , @ticky --

My understanding is that the MaddTheSane's Boxer is based on DOSBox Staging.

Can you check if the current DOSBox Staging macOS builds are similarly affected? Binaries are here: https://dosbox-staging.github.io/downloads/devel/

If Staging passes, then odds are likely that this will be fixed when @MaddTheSane sync's up w/ Staging again.

@dreamer, anything else you can think of?

ticky commented 3 years ago

Ah, good to know!

I just gave it a go with dosbox-staging v0.77.0-alpha-623-g8d890, and v0.76.0 and it works fine in both.

MaddTheSane commented 3 years ago

It looks like some of the old hooks to emulate overlay drives in Boxer aren't passing some things through.

MaddTheSane commented 3 years ago

Try using the useDBOverlay branch. That branch uses Boxer's own Overlay_Drive class.

troydm commented 3 years ago

@MaddTheSane well initially it works fine, but as soon as you start deleting folders from Norton Commander using F8 it starts messing things up like it shows folders and files that only exist inside dos session but outside they can't be found in the machine's C.harddisk folder, for example I've installed Borland C++ in C:\BCC folder from inside DOS using INSTALL.exe and tried to run newly installed BC.EXE file and it crashes vm as BCC folder doesn't exists in C.harddisk however when I run vm again I see C:\BCC in DOS session as if it exists and I can cd into folder structure but I can't view or run files because as soon as I try to do that it crashes boxer vm. But it's a progress, also running dir prints weird SHELL_CMD_DIR_VOLUME message before printing output of the folder

P.S. also small issue, Ins key is not working inside NC, not sure if it's not working anywhere else as I've not checked it, but inside standard DosBox installed from homebrew it works fine

ticky commented 3 years ago

Yeah, same experience here, you can create files and directories fine but deleting them acts quite weird.

bmoren commented 3 years ago

popping in to say I cant save in fallout1, I think this is a filesystem / permission issue? it can create a folder, but it cannot create the save file.

2017 mbp i7, 10.15.7

edit/update: Version 2.0.0-alpha | build 2.0.0-alpha+20160215.1 From the https://boxer.thec0de.com/ pre-compiled binary

troydm commented 3 years ago

@bmoren yup, seems like the same issue we all are having

kyods commented 3 years ago

The issue apparently lies with creating new saves, as overwriting works fine. A workaround, until an actual fix is introduced: if you have any existing saves in your game, copy them with new names in the directory the game stores its saves in the game's C drive (show package contents -> C.harddisk) using Finder. If you don't, launch the game in DOSBox / DOSBox-X, save, then copy-paste the file with the savegame into the game's C drive in Boxer. Make multiple copies with different names, if you need multiple saves.

amcgregor commented 2 years ago

Seems related to Apple's sandboxing or Boxer's own "save states" process. There is a disparity between where Boxer is reading from and writing to. It appears to read the actual container (dir shows no files), and files written by installers from attached CD to the virtual C: drive asks "are you sure you wish to overwrite X", even though dir shows nothing. Certain filesystem-related commands (touch, sync) lock up the emulation.

Turns out, all the files are actually being written to ~/Library/Application Support/Boxer/Gamebox States/{uuid}/Current.boxerstate and not the actual game box. Can we disable this functionality, and get working primary containers?

"Merge and re-launch" is an interesting thing to need to remember to do!

Edit to explicitly note: this makes backing up the actual .boxer "files" essentially pointless; they don't actually contain the files for that package.

JoshHrach commented 2 years ago

I'm experiencing this issue on the latest beta release. Others have said you can overwrite existing files, but I'm finding that that's not even working for me.

Trying to create a directory results in:

Unable to make folder

Deleting a file caused a crash.

image

I'm unable to send a crash report because it causes an error 414 - Request URI too large. Below is the decoded error from the URI


http://boxerapp.com/report-an-issue?title=Unrecoverable emulation error when running Star Trek 25th Anniversary&body=*Please add a description here of what you were doing (or what the game was doing) when this error occurred.*

## Error details ##

**Error message:** Failed creation of /Users/joshhrach/Library/Application Support/Boxer/Gamebox States/4003D76F-6C78-4F93-89B4-0CFA6FDD0CDE/Current.boxerstate/C.harddiskTREKCD/DBOVERLAY_DEL_SAVEGAME.3
**In function:** `void Overlay_Drive::add_special_file_to_disk(const char *, const char *)` (line 972)
**Full stack trace:**

    Boxer -- boxer_emulatorException::boxer_emulatorException(char const*, char const*, char const*, int) (118)
    Boxer -- boxer_emulatorException::boxer_emulatorException(char const*, char const*, char const*, int) (13)
    Boxer -- boxer_die (190)
    Boxer -- Overlay_Drive::add_special_file_to_disk(char const*, char const*) (254)
    Boxer -- Overlay_Drive::add_deleted_file(char const*, bool) (142)
    Boxer -- Overlay_Drive::FileUnlink(char*) (785)
    Boxer -- DOS_UnlinkFile(char const*) (89)
    Boxer -- DOS_Shell::CMD_DELETE(char*) (393)
    Boxer -- DOS_Shell::DoCommand(char*) (384)
    Boxer -- DOS_Shell::ParseLine(char*) (434)
    Boxer -- DOS_Shell::Run() (913)
    Boxer -- SHELL_Init() (2715)
    Boxer -- Config::StartUp() (11)
    Boxer -- -[BXEmulator(BXEmulatorInternals) _startDOSBox] (472)
    Boxer -- -[BXEmulator start] (206)
    Boxer -- -[BXSession _startEmulator] (508)
    Foundation -- __NSFireDelayedPerform (440)
    CoreFoundation -- __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ (20)
    CoreFoundation -- __CFRunLoopDoTimer (931)
    CoreFoundation -- __CFRunLoopDoTimers (307)

## Game details ##

**Session path:** /Users/joshhrach/DOS Games/Star Trek 25th Anniversary.boxer
**DOSBox processes:**

    Y:\UTILS\RM.BAT SAVEGAME.3
MaddTheSane commented 2 years ago

Looking at the error report, the C.harddiskTREKCD makes me think that whatever file is supposed to be created by Overlay_Drive::add_special_file_to_disk isn't properly adding an ending slash.

Looking at Overlay_Drive::add_special_file_to_disk, it seems to be doing that (or the Overlay_Drive class was supposed to be passed the path with an ending slash).

AndreiSchapov commented 2 years ago

I also seem to have the same issue, Boxer can't create savegames nor install games onto C: drive from ISO image. Does it mean any games that require writing to disk are not supported right now, or this is a specific issue?

shinra-electric commented 2 years ago

I opened issue #37, but I'm also experiencing this and I think this might be the root cause. For that issue I can't get Roland sound working, but I think it's because the app can't save the preferences.

For example, when setting up Dune 2 for the first time it goes through a pile of setup questions and then freezes when it tries to save them:

Screenshot 2022-01-25 at 18 54 32