1
0
Fork 0
Commit graph

971 commits

Author SHA1 Message Date
krcroft
7375db2a83 Use type-specific host conversion funcs 2020-04-15 14:26:29 +02:00
krcroft
297229700c Make use of indexed reads and writes 2020-04-15 14:26:29 +02:00
Patryk Obara
c05bbafb5d Create byteorder header for host_to_le functions 2020-04-15 00:01:25 +02:00
Patryk Obara
f959484192 Make block_fnum unsigned in fmopl
This value is stored as 32-bit unsigned value elsewhere throughout this
file and is being compared against 32-bit unsigned in this function.
2020-03-28 05:41:04 +01:00
Patryk Obara
5983e820c4 Bring back C++11 foreach loop in fmopl
Upstream replaced C++11 code with C++ "almost-equivalents", when merging
code from MAME project.

Reverting this fixes few warnings (comparison of signed and unsigned
integer in this case) and makes it slightly easier for the compiler
to unroll the nested loops.
2020-03-28 05:41:04 +01:00
Patryk Obara
06805b28fb Change bpp to unsigned int around render code
Max value of bpp is 32, so there's really no reason to tie this variable
to architecture size.  This change prevents few -Wformat warnings.
2020-03-28 05:41:04 +01:00
NicknineTheEagle
e905a6bd5d Implement phone book to remap phone numbers to addresses for modem 2020-03-23 01:05:03 +01:00
NicknineTheEagle
de45c413ae Fix auto-answer (S0) behavior in modem 2020-03-23 01:02:42 +01:00
NicknineTheEagle
880d2d2ceb Implement DTR drop actions (&Dn) and DTR drop delay (S25) in modem
&D0 may be needed for old apps which don't set DTR or set it to garbage.
DTR drop delay is required for Quake otherwise it doesn't disconnect
properly.
2020-03-23 01:02:42 +01:00
NicknineTheEagle
9cb13f6158 Fix a bug with backspace handling in modem
Fixes a bug where entering backspace while command buffer was already
empty added backspace char to the buffer thus screwing it up.
2020-03-23 01:02:37 +01:00
Patryk Obara
2b6e4527be Initialize srcval on all codepaths in xga
Multiple code-paths were using this value uninitialized.
2020-03-19 01:01:23 +01:00
Patryk Obara
ffb9d62ade Change GetMixResult mixmode to uint32_t
There's no reason to use more than 32 bit for this parameter.

Also, limit scope of certain variables as much as possible without
bigger refactorizations.
2020-03-19 01:01:23 +01:00
Patryk Obara
6fe434571c Change DrawWaitSub mixmode to uint32_t
There's no reason to use more than 32 bit for this parameter; source
values are 16 bit, and they occassionally shifted, but always to values
fitting in 32 bit.
2020-03-19 01:01:23 +01:00
Patryk Obara
865ad54a87 Make XGA_DrawWaitSub a static function 2020-03-19 01:01:23 +01:00
Patryk Obara
e25e15ac1d Make XGA_GetMixResult a static function 2020-03-19 01:01:23 +01:00
Joshua Fern
f2029d71d8 Update copyright dates to 2020 2020-03-07 00:18:01 +01:00
Patryk Obara
19d1caa483 Avoid division by zero when initializing pcspeaker
Coverity detects possible division by zero in calculation of spkr.min_tr
few lines below; this is a false-positive issue detected by Coverity,
but only bacause int value passed by user has a set of pre-determined
values.  We can as well make sure that value is never going to be
smaller than the minimum allowed.
2020-03-01 21:23:04 +01:00
Patryk Obara
d0da4341fe Include cassert header in vga 2020-02-26 13:06:22 +01:00
Patryk Obara
cd93ea9507 Silence buffer overrun Coverity warning
This buffer overrun could happen if implementer forgets to fill pointer
svga.set_clock, but calls VGA_SetClock with index out of bounds.
Placing assert in here should clear out false positives detected by
Coverity.
2020-02-26 12:59:41 +01:00
krcroft
438870c75f Only resize the sendbuffer if needed 2020-02-19 19:25:47 +01:00
krcroft
fa64d98a52 Be explicit when we lose precision and change signedness 2020-02-19 19:25:47 +01:00
krcroft
4d34a80e7f Use K&R indents with some if statements 2020-02-19 19:25:47 +01:00
krcroft
7df5a30f98 Simplify by using the _TCPsocketX struct as-is
Unlike an array of 1-byte chars which only requires 1-byte
alignment (because the array's largest element is only one byte),
when we fool the compiler into allocating a _TCPsocketX as an arra
of chars, we similarly tell the compiler we only need 1-byte
alignment. But this requirement changes when we cast the 1-byte array
back to the _TCPsocketX and try to operate on members having sizes
larger than 1-byte (such as int32's); we now require 4-byte
alignment (after allocation).
2020-02-19 19:25:47 +01:00
Patryk Obara
6468e3c149 Initialize TCPsocket to nullptr
This typedef originates from SDL_net.h, it's an opaque data type used
for TCP connections.

It's a pointer, therefore prevent copying and assignment in
TCPServerSocket to prevent ownership problems.
2020-02-19 19:25:47 +01:00
Patryk Obara
75478a9a39 Make TCPClientSocket field private
Also, it is a pointer, therefore prevent bugs by disallowing copying
and assignment.
2020-02-19 19:25:47 +01:00
Patryk Obara
0e32c002ae Cleanup ifdef guards in serialport misc util 2020-02-19 19:25:47 +01:00
Patryk Obara
651aeb906c Initialize missed fields in TCPClientSocket
Also, do some code and style cleanup in c-tors.
2020-02-19 19:25:47 +01:00
Patryk Obara
534a603cb8 Remove some duplicated code in serialport
Reuse SendArray implementation instead of repeating the same code
pattern several times.

This change started as a removal of warning about comparison of
integer expressions of different signedness: ‘int’ and ‘Bitu’
(when comparing return value of SDLNet_TCP_Send), but turned into
a small cleanup and removal of dead code.
2020-02-19 19:25:47 +01:00
Marco Maccaferri
4aee47a770
Fix handling of escape characters in softmodem
When running BBS DOSBox's softmodem does not correctly handle
escape characters properly nor does it properly transition
to command mode:

Characters are swallowed instead of passed-through, this causes
issue when transmitting strings with the plus character.
Additional characters before and after the escape sequence don't
reset the counters causing switch to command mode even if not
intended. For example, connect to a remote and type a+++ it
switches to command mode, it should not. The attached proposed
patch fixes the escape handling:

Transmission pause is checked before and after the escape
sequence, so <pause>+++<pause> is the correct
sequence.</pause></pause> Extra characters cause the counters to
be reset so no unwanted switch is triggered. Use register S12 to
set the pause timer in 1/50th of seconds, default is 50 = 1 sec.
Plus characters are passed to the remote. With this fix I'm able
to run a BBS software and do file transfers with XModem and ZModem
without problems.

Imported-from: https://sourceforge.net/p/dosbox/patches/287/
2020-02-15 11:34:33 -08:00
Patryk Obara
6e89827d2b Change 'sblaster.oplemu = default' to select 'nuked'
Nuked emulator implementation seems to be the preferred one by the most
users at the moment.
2020-02-15 19:10:20 +01:00
Patryk Obara
6099ab60f3 Merge branch 'svn/trunk' r4326 2020-02-15 17:53:38 +01:00
Peter Veenstra
4d4c738ca7 fix two tiny bugs introduced by 4065.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4325
2020-02-14 21:20:31 +00:00
Peter Veenstra
5d7c4f0540 Fix bug 469. Give 640x480 and upwards square pixels and several fixes for high colour modes. (jmarsh)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4324
2020-02-14 19:02:29 +00:00
Patryk Obara
77c4523723 Byteswap captured audio samples on PPC
Fixes: #161
2020-02-08 14:56:14 +01:00
Peter Veenstra
987a48600d Rewrite video capturing and fix some endian issues with all captures as well. Thanks jmarsh
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4314
2020-02-06 10:36:10 +00:00
Patryk Obara
a1ceacb6f1 Unifdef unused function in mame implementation 2020-02-06 09:23:18 +01:00
Patryk Obara
a7a9f84ae2 Annotate auto_free with 'inline' to prevent redefinition
This way we prevent unused function warning coming from some files
including this header.
2020-02-06 09:23:18 +01:00
Patryk Obara
2e43cf551f Swap bytes for 15bpp and 16bpp screenshots on PPC
Fixes broken colours in screenshots taken on PPC machines.
2020-02-03 05:58:12 +01:00
Patryk Obara
df5c6f6e05 Fix printf warning 2020-02-03 05:58:12 +01:00
Patryk Obara
34b3549b41 Merge branch 'svn/trunk' r4313 2020-01-30 11:26:32 +01:00
VileRancour
ffe3c5ab7f Add cga_mono machine
Emulates the user using a CGA card with a monochrome monitor.
Monochrome monitor options are: green, amber, white or paperwhite.
The color can be changed at runtime with F11.

Include paperwhite color by Basic <basic@vogons.org>
https://www.vogons.org/viewtopic.php?p=587382#p587382

Vogons thread: https://www.vogons.org/viewtopic.php?f=41&t=29101

Signed-off-by: Michael Zijlstra <mzijlstra@gmail.com>
Signed-off-by: Patryk Obara <dreamer.tan@gmail.com>

Imported-from: https://www.vogons.org/viewtopic.php?p=238045#p238045
2020-01-29 13:46:23 +01:00
Peter Veenstra
95a689013e Quick fix for vgaonly on BIGENDIAN.(jmarsh)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4313
2020-01-29 12:07:40 +00:00
krcroft
878959a0aa Formatting and review fixes 2020-01-22 09:40:00 +01:00
krcroft
5da5c2931c Fix NULL issues in memory.cpp
There is no sense in testing the 'MemBase' pointer against null, as the memory was allocated
using the 'new' operator, which throws.
2020-01-22 09:40:00 +01:00
krcroft
6a1c90b6d8 Fix NULL issues in OPL code
The 'ptr' pointer in the 'ptr += sizeof (FM_OPL)' expression could be nullptr. In such case,
resulting value will be senseless and it should not be used.
2020-01-22 09:40:00 +01:00
Patryk Obara
2310498f79 Merge branch 'svn/trunk' r4308 2020-01-13 00:52:10 +01:00
Peter Veenstra
51aecb14c6 Refinement of the checks, so no IRQ is raised when not in autodma mode.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4307
2020-01-12 17:51:04 +00:00
Patryk Obara
f3f33c5ea1 Prevent resource leak during screenshot
Using RAII would be a better solution, but it requires non-trivial
code refactor in this area.
2020-01-11 20:52:55 +01:00
Patryk Obara
a8833b7ad6 Remove unused RAW_SIZE define 2020-01-09 22:50:47 +01:00
Patryk Obara
efacda1966 Simplify creation of OPL handler 2020-01-09 22:50:47 +01:00