1
0
Fork 0
Commit graph

66 commits

Author SHA1 Message Date
Patryk Obara
c4dba16740 Move drives.h to common include dir
Judging by the usage, this header belongs in there instead of being
limited to dos module only.  This change makes it easier to reuse code
for new features related to drives mounting/unmounting.
2020-01-04 08:26:22 +01:00
Patryk Obara
2694aca2b2 Fix effc++ warnings in drives.cpp 2020-01-04 08:26:22 +01:00
Patryk Obara
8da42c5983 Remove false friend declarations
The single use from friended class is in public interface. Removal of
friend designators allows Clang to pinpoint few additional unused
private fields.
2020-01-04 08:26:22 +01:00
Patryk Obara
5f282f6015 Use shared_ptr to prevent double free on imageDisk
Also, replacing unique_ptr with shared_ptr makes it unnecessary to move
a pointer when swapping boot disks; moving shared_ptr would lead to
inconsistent internal state.

Fixes: #94
2019-12-18 23:56:28 +01:00
krcroft
c9198b2944 Fix unsafe memory operations and warnings in the fatDrive class
- Move imageDiskList from pointer to vector of unique_ptr
- Replace string operations with size-limited versions
- Initialize members
- Eliminate unecessary casts
- Eliminate memory-leak on pointer assignment
2019-12-09 08:19:26 +01:00
krcroft
cff6b05559 Improve memory safety in the DOS Drive Cache class
- Fix Bitu printf format type
- Check a pointer prior to dereferencing it
- Prevent writing one-beyond the last index
- Replace strcpy with with helper safe_strcpy, provided by @dreamer - thank you!
- Replace strcat with strncat
- Add constructor intializers for scalars and arrays
- Initialize and replace 0-value pointers with nullptr
- Pass in the buffer length when strncpy'ing into a function variable
2019-12-07 19:08:47 +01:00
Peter Veenstra
19478d45f5 Fix several logic errors with regards to deleted directories.
Should fix that directories with the same length as a deleted directory had some small issues.
Also blocks the creation of files in directories marked as deleted.
Small speed up to MakeDir, so it doesn't rely on mkdir when a directory is created inside a deleted directory.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4268
2019-10-09 20:46:40 +00:00
Peter Veenstra
1d01c8d151 Add experimental code to have overlay only directories. Add ability to remove directories and create them while in overlay mode.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4217
2019-04-22 14:57:24 +00:00
Peter Veenstra
202bfa1155 New Drive type: overlay.
When active, this drive redirects new and changed files to a different location.
The files in the overlay and normal drive are merged on startup and kept up to date when the game changes something. 
Files in the overlay are priotizedi, if they exists, above the normal files. 
The drive will switch to an overlayed version of the file on the first write! (Not when opening the file in write-mode).
The overlay is capable of creating missing directories.

With the help of DBOVERLAY files, the drive keeps track of files that are present in the normal directory but deleted by the game. 
All changes are preserved between sessions. 

Current design principles/limitations/requirements:
1) All directories that can be used for saving, must exist already in the base before mounting. (they will be created by DOSBox if missing in the overlay)
2) All filenames inside the overlay directories are UPPERCASE and conform to the 8.3 standard except for the special DBOVERLAY files.
3) To keep point 1 valid at all times, support for creating/renaming/removing directories has been disabled.

Thanks for the help GOG.


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4196
2019-03-25 13:49:25 +00:00
Peter Veenstra
1fbaff47fc Update year and address of FSF
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4183
2019-01-25 14:09:58 +00:00
ripsaw8080
2ec871f0e1 FAT drive fixes and improvements. Identify floppy format, and support filesystems that use only part of the disk. Fixes Make Your Own Murder Party and Music/Pinball Construction Set.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4130
2018-07-10 16:05:17 +00:00
ripsaw8080
be146f5c44 Improve disk image mounting: cycle disks only for the drive being mounted, make B: drive usable for BIOS access, and be insensitive to the order that drive letters are mounted.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4129
2018-07-10 15:51:16 +00:00
ripsaw8080
30ef5aefe9 Fix GetLabel() for the virtual drive.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4128
2018-07-10 15:38:55 +00:00
Peter Veenstra
5bb10db88b Time keeps on ticking
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4109
2018-05-29 12:58:58 +00:00
Peter Veenstra
6cf39c1fc6 Years update
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4021
2017-05-30 11:35:08 +00:00
ripsaw8080
933174fb3e Add support for High Sierra format cdrom images.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3886
2015-01-08 17:23:15 +00:00
Peter Veenstra
0f4c92ca32 Year update.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3878
2015-01-06 14:40:32 +00:00
Peter Veenstra
2fea508f7f Year update
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3812
2013-01-15 09:03:13 +00:00
Peter Veenstra
5eb1217cb4 Move buffer to class for upcomming multiple floppy support (rcblanke). Remove heavy bios_disk dependency from drives.h
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3806
2012-12-26 16:14:19 +00:00
Sebastian Strohhäcker
1887b2590b speed up fat drive access
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3714
2011-05-28 20:26:12 +00:00
Peter Veenstra
999f33de27 Update year. Remove CVS tags
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3700
2011-04-26 09:34:55 +00:00
Peter Veenstra
a408781809 Hide associated files. Fixes Last Express when installing from an ISO. Thanks ripsaw
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3633
2010-08-07 18:39:22 +00:00
Peter Veenstra
a78b2c4f8b Update year
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3548
2010-02-11 13:36:50 +00:00
Peter Veenstra
84dbcce5d5 No . or .. in root dir for isos.(GT Racing 97) (ripsaw,rc1)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3543
2010-02-05 08:37:17 +00:00
Peter Veenstra
b8dd53b7fc Include debian general spelling suggestions.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3530
2010-01-11 10:09:46 +00:00
Peter Veenstra
16d14b78e1 Some year and version numbers
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3410
2009-05-27 09:15:42 +00:00
Peter Veenstra
c90ebb3028 Header updates.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3289
2009-02-01 14:24:38 +00:00
Peter Veenstra
ac66214dab Emulate a trailing dot on volume labels of 8 characters when on a cdrom drive. mscdex weirdness. Fixes Fifa96 cdrom detection.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3033
2007-11-01 12:15:34 +00:00
Peter Veenstra
0382a13bd3 Add basic support for audio cds only when dealing with images.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2982
2007-08-22 11:54:35 +00:00
Peter Veenstra
a5ac3216ba Some more const stuff. Silences a few warnings and removes a few casts. Update description of dss.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2886
2007-06-14 08:23:46 +00:00
Sebastian Strohhäcker
e608297aae add imagedisk swapping capabilities (prompt, slightly modified sf patch #1505951); fix int13 write sectors return code
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2778
2007-01-21 16:21:22 +00:00
Peter Veenstra
fdd16dea1a Happy New Year\!
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2728
2007-01-08 19:45:42 +00:00
Sebastian Strohhäcker
60b6c06b54 increase iso image directory entry name size (prompt/hakonrk)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2717
2006-11-05 17:30:54 +00:00
Peter Veenstra
3ea5a913a9 Add rewriten form of patch "[ 1498334 ] CD Images unmounting" created by Kronutz
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2658
2006-06-22 13:15:07 +00:00
Peter Veenstra
329d32a8dd Fix some issues with mounting floppy images with invalid bootsector.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2602
2006-04-17 10:45:32 +00:00
Peter Veenstra
2315b01df0 Add patch:"
[ 1391443 ] directory iterators for the iso drive" from prompt


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2486
2006-02-12 13:32:30 +00:00
Peter Veenstra
df67775306 time passes on and on....
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2480
2006-02-09 11:47:57 +00:00
Peter Veenstra
ad7700fa3b Add patch:126539:"cd image, fix for files without extension" from prompt. Fix a typo that probably broke endian support for isos
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2302
2005-09-07 19:15:09 +00:00
Peter Veenstra
b3771fdeec new drivelabel functions (mechwarrior 2)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2143
2005-03-25 08:39:05 +00:00
Peter Veenstra
8618ef8870 basic hidden file detection. Used as initial check by mechwarrior 2
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2128
2005-03-16 20:44:56 +00:00
Peter Veenstra
2094d8b985 Year update
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2106
2005-02-10 10:21:12 +00:00
Peter Veenstra
e9df6e56ab Change fpu for Elvira. Added isRemovable to drive for dott.cd and alike.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2047
2004-11-03 23:13:55 +00:00
Peter Veenstra
62ad4ff475 Made it gcc2.95 friendly. Fix drivelabels on iso's. Fix Various stability issues with images
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2016
2004-10-05 19:55:03 +00:00
Peter Veenstra
02ff2737d7 Add Patch 1001897 by Martin. Disabled modem and ipx networking by default as they depend on libraries not everybody may have. Reduces alarmed firewall people and is nicer on unix hosts as port 23 is a bit tricky
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1904
2004-08-13 19:43:02 +00:00
Peter Veenstra
ca409fd57c Typo in preamble
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1899
2004-08-04 09:12:57 +00:00
Peter Veenstra
67253f9e9b Added support for attribute searching with extend fcbs.
Added support for volume label searching on Virtual Drives.
Added warnings for volume searching on Drive Fat.
Improved support for Filelabel searching on drive_local to include fcbfinds
Added Drivelabel "DOSBOX" to Virtual Drives.
Changed default Label for localdrives to "NO_LABEL".
Made DOS_FindFirst fcb finds aware.


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1770
2004-04-18 14:49:50 +00:00
Dean Beeler
d0e2bfa15f Added FAT image access and DOS booter functionality
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1757
2004-04-03 19:24:59 +00:00
Peter Veenstra
fcbd0fe854 Copyright to 2004
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1552
2004-01-10 14:03:36 +00:00
Peter Veenstra
735883416c moved shell_inc.h to include
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1494
2003-12-17 21:55:42 +00:00
Sjoerd van der Berg
9d0029f51b Add method for checking a remote drive.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1417
2003-11-08 18:00:47 +00:00