1
0
Fork 0
Commit graph

622 commits

Author SHA1 Message Date
Patryk Obara
5f9ac5eeab Remove code ifdefed for OS/2
Cleanup before replacing SDL1.2 with SDL2.

OS/2 support was introduced in DOSBox in March 2006.  OS/2 reached EOL
in December 2006.

As of 2019, OS/2 is being continued by proprietary 32-bit only ArcaOS,
although there is no official SDL2 support, despite pledges from SDL2
maintainers.
2019-12-09 16:27:11 +01:00
krcroft
ef2686ac02 Switch from std::vector to std::array 2019-12-09 09:11:16 +01:00
krcroft
78cc6be86d Make use of template variable, and reformat whitespace 2019-12-09 08:19:26 +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
48106d6046 Explicitly delete copy and assignment operators 2019-12-07 21:07:38 +01:00
krcroft
8c6758c8d1 Memory overrun and C++11 updates
- Limit write length into buffer, and add comment about corner-case
- Use C++11's syntax to explicitly remove private copy and assignment operators
- Use C++11 container loop syntax to shorting a cleanup function
2019-12-07 19:08:47 +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
krcroft
b55b43f543 Use PRIuPTR and define it for Windows GCC 64-bit 2019-12-03 05:12:28 +01:00
Patryk Obara
7d21bb1408 Move definition out of autoconfig 2019-12-03 05:12:28 +01:00
Patryk Obara
6214b39f9e Revert "Break compilation to test GitHub badges"
This reverts commit 6ae50d77af.
2019-12-01 18:35:25 +01:00
Patryk Obara
6ae50d77af Break compilation to test GitHub badges 2019-12-01 18:09:00 +01:00
krcroft
eaeb001b17 Play into subsequent track(s) if playback length exceeds the the current track
Issue reported by Dagar and Pr3tty F1y, and confirmed as a bug by ripsaw8080.
Thank you!

This fixes the GoG release of Betrayal at Krondor which (either due to CD mastering
issues or a faulty rip), requests playback of a given track at the tail end
of the prior track.

In debugging and performing this fix, many debug messages were improved as well
as making some small small code adjustments, such as using iterators to point to
individual tracks (track->attribute) instead of using the tracks array
(tracks[track -1].attribute).
2019-11-24 17:34:54 +01:00
Patryk Obara
6c42f3adf8 Fix several unused-private-field warnings 2019-11-24 17:14:32 +01:00
Patryk Obara
8e5f7dd55d Merge branch 'svn/trunk' r4290 2019-11-16 12:14:23 +01:00
Peter Veenstra
a533565297 Init some more fields in the constructors, else uninited stuff gets copied in copy constructors.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4289
2019-11-15 18:37:20 +00:00
Patryk Obara
34112dd2da Merge branch 'svn/trunk' r4282 2019-11-12 08:56:37 +01:00
krcroft
d1a6f373cb Refactor CD-DA flow by removing intermediate buffers and loops
Thanks to @ripsaw8080 for insight into CD-DA channel mapping,
@hail-to-the-ryzen for testing and flagging a position-tracking bug,
and @dreamer_ for guidance and code review.

The CD-DA volume and channel mapping loops were moved to generic mixer
calls and no longer require a pre-processing loop:
 - Application-controlled CD-DA volume adjustment is now applied using
   an existing mixer volume scalar that was previously unused by the
   CD-DA code.
 - Mapping of CD-DA left and right channels is now applied at the tail
   end of the mixer's sample ingest sequence.

The following have been removed:
 - The CD-DA callback chunk-wise circular buffer
 - The decode buffers in the Opus and MP3 decoders
 - The decode buffer and conversion buffers in SDL_Sound
These removals and API changes allow the image player's buffer
to be passed-through ultimately to the audio codec, skipping multiple
intermediate buffers.
2019-11-12 08:16:53 +01:00
Peter Veenstra
8f3474ecfd Make it possible to compile without CoreMIDI and CoreAudio on Mac OS X using a non-Apple compiler. Give some feedback to user in this case. (modified version of patch by krcroft with input from jmarsh, Dominus and Qbix)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4281
2019-11-10 14:50:11 +00:00
Patryk Obara
d68af8b650 Merge branch 'svn/trunk' r4279 2019-11-02 19:30:48 +01:00
Sjoerd van der Berg
e20e8fa92c Some dma changes to make the world a better place
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4279
2019-11-02 11:21:48 +00:00
Patryk Obara
9099f0620e Merge branch 'svn/trunk' 2019-10-20 07:15:43 +02:00
Peter Veenstra
276b187181 Make frameskip an integer.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4273
2019-10-19 19:52:24 +00:00
Patryk Obara
a323e173c2 Merge branch 'svn/trunk' 2019-10-03 23:44:48 +02:00
Peter Veenstra
60204619d0 - Fix url to forum.
- Fix Bit8u instead of char weirdness for imageDisk (dreamer_)
- Give device_t a virtual empty destructor so some warning program
  doesn't go crazy.
- Give the code that moves the Z drive its own function for readability.
- Give sizes arrays default values again for warning program.
- Rewrite IMGMOUNT in order to exit early for clarity and attempt
  to group things together.



Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4267
2019-10-03 20:03:43 +00:00
Patryk Obara
b62a637157 Import svn:ignore props to .gitignore files 2019-09-15 20:34:57 +02:00
Peter Veenstra
ad88f982c0 Add some size checks when accessing Drives[], mostly needed when DOS_DRIVES is not set to 26, make size parsing not go outside the target array.
Let's not try to assign a drive in the switchlist to a too high number.
Don't access imagelist for drives >D when unmounting. 


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4239
2019-06-25 06:12:13 +00:00
Peter Veenstra
e90de61263 Create fopen_wrapper so we can filter out specific directories, which DOS games should have no access to
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4238
2019-06-24 20:09:59 +00:00
Peter Veenstra
f8dd3db095 Add functionality to add overlay directories to drive_cache.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4216
2019-04-22 14:21:53 +00:00
Peter Veenstra
eb26b9a58e Change first_shell to be DOS_Shell instead of Program. Makes future manipulations easier.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4211
2019-04-20 13:48:55 +00:00
Peter Veenstra
dc6a76d354 Store whether generated code is 16 or 32 bit, so this information can be used when checking for self modifying code. Some code is identical except for being 32 or 16 bit. Fixes some hard to reproduce problems (with small codeblocks). Thanks jmarsh!
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4206
2019-04-19 12:16:14 +00:00
Peter Veenstra
c03a6f497c We use the old style headers in other places and use the functions/types without std::
Should help compilation on FreeBSD.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4203
2019-04-06 17:02:40 +00:00
ripsaw8080
3978e05909 Improve prefetch and simple cores to not switch to normal core on trap execution. Fixes the demo version of Prehistorik 2 and similar cases that use the trap flag and prefetch tricks. Thanks NewRisingSun.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4201
2019-04-01 22:06:11 +00:00
Peter Veenstra
4a1ef4d3d7 Refine stack overflow and underflow for the fpu a bit.
Overflow is still treated as Exit.
Underflow is ignored in release mode as it happens every now and then and doesn't seem to cause issues if ignored, thus restoring 0.74 behaviour.



Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4199
2019-04-01 14:32:18 +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
ripsaw8080
64d25c4be4 Acknowledge mouse interrupt before entering user routine; fixes sound stutter during mouse movement in Eye of the Beholder III and Casino Tournament of Champions. Clear button counters in the mouse driver reset function; prevents unintended skipping of intro in MechWarrior and others.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4188
2019-02-04 15:15:58 +00:00
Peter Veenstra
fdd8358de7 Make feature checks consistent, include right header for memset, correct one off error in paging table size compare for when not using USE_FULL_TLB (jmarsh)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4185
2019-01-28 14:26:19 +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
Peter Veenstra
cf85eb0d9b Remove file that has not been used in a long time
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4181
2019-01-25 09:31:50 +00:00
ripsaw8080
e0a7ede037 Don't generate sound after DMA is masked at end of single-cycle transfer. Prevents issues with some games.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4176
2018-11-23 21:55:12 +00:00
Sjoerd van der Berg
3bde40bc91 Make a dma channel go masked when it reaches end of count without autoinit
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4175
2018-11-19 22:02:13 +00:00
Peter Veenstra
f522e81d32 Quick fix for dma channel 0 having no page porthandler.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4165
2018-09-29 16:17:36 +00:00
ripsaw8080
66b813ef9c Support some installer disk detection methods: block device count, and specific MBR/boot sector contents. Fixes (original) SimCity, Amberstar, and later MicroProse installers.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4120
2018-06-21 17:46:52 +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
54c993669a Strip spaces properly. Fixes bug #480
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4100
2018-05-06 19:34:22 +00:00
ripsaw8080
630b9befb5 ANSI emulation is activated for the session when an escape sequence is encountered other than those used by internal messages. Fixes LucasArts setup programs (Bug #458) provided that ANSI emulation is not activated.
Compatible scroll fill for ANSI emulation.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4097
2018-05-03 16:49:48 +00:00
Peter Veenstra
ae683cd794 Remove exception specifiers as they are depreciated. Remove some trailing spaces and add some spaces for readability.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4079
2018-02-17 15:16:44 +00:00
Peter Veenstra
21a0040650 Move definition of LocalFile to header file, requested by bruenor41, makes sense to make it available at a larger scope.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4058
2017-10-10 14:21:31 +00:00
ripsaw8080
4aa821d0e6 Implement waiting for retrace in VBE functions. Remove range checks in protected mode functions, consistent with UniVBE and other VBE implementations. Fixes hang and graphics glitches in Jack Orlando.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4048
2017-09-10 11:29:34 +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
d6e983b08d Handle errant IRQs as a real BIOS does. Fixes Tandy DAC in Chuck Yeager's Air Combat. Also remove r3263 workaround, as it's no longer needed.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4009
2017-05-01 15:32:29 +00:00