Want to use PC Speaker and not Sound Blaster in StarControl 1

Here you can discuss the development of patches.

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby wd » 2011-10-29 @ 17:34

mingw usually works fine, in the later versions some flags are needed for static c lib compilation though.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby bloodbat » 2011-10-29 @ 23:18

ripa wrote:
NOTE FOR NOT DEVELOPERS: The exe file you provide requires some dll files to run. Installing Microsoft Visual C++ 2010 Redistributable Package (x86) will solve that.

I tried building a version that doesn't require the user to install a new version of MSVCRT, but it didn't work. I wonder how the official Dosbox build gets around that...


What did it spew? If you don't want to use Mingw, you need to rebuild everything (libraries and such) to use Multithreaded (/MT) instead of Multithreaded DLL (/MD). If using Visual C++, under the 2010 version: C/C++ -> Code Generation -> Runtime library
User avatar
bloodbat
Oldbie
 
Posts: 783
Joined: 2009-12-06 @ 07:11

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby ripa » 2011-10-30 @ 15:05

Code: Select all
1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>msvcrt.lib(MSVCR100.dll) : error LNK2005: _isspace already defined in LIBCMT.lib(_ctype.obj)
1>msvcrt.lib(MSVCR100.dll) : error LNK2005: _fprintf already defined in LIBCMT.lib(fprintf.obj)
.
.
.

I guess all the other libraries (SDL etc.) would need to be built with static c runtime library too.
ripa
Oldbie
 
Posts: 539
Joined: 2005-4-18 @ 00:53
Location: Finland

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby wd » 2011-10-30 @ 15:54

Yep.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby ripsaw8080 » 2011-10-30 @ 21:47

The square waves in the 3rd patch appear to be above center (waveform has a DC bias); but are centered in this latest patch. Base speaker volume seems a bit high now compared to the other mixer inputs.

I hear vibrato in the Miner 2049er title music that isn't present with official source; which is interesting, but don't know if it's supposed to be that way.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3983
Joined: 2006-4-25 @ 23:24

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby TeaRex » 2011-11-14 @ 04:13

ripa wrote:I guess all the other libraries (SDL etc.) would need to be built with static c runtime library too.


There's an sf project called sdl-static that should have most things you need in either prebuilt or at least an easy to build shape. The resulting DOSBox binary will run without needing any external DLLs at all (other than the normal Windows core DLLs of course).
tearex
TeaRex
Member
 
Posts: 398
Joined: 2005-2-06 @ 07:39

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby HunterZ » 2012-2-07 @ 15:17

This looks like some good work. I see wd is watching the thread, so I hope this makes it into the official source eventually :)
User avatar
HunterZ
l33t++
 
Posts: 5988
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby wd » 2012-2-07 @ 16:34

Nah I'm not tracking patches ;)
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby NY00123 » 2013-10-05 @ 18:12

As an excuse for bumping this thread, I am attaching a patch against revision 3833 that should bring the functionality from dosbox_patched4.zip. This is basically what you get by downloading r3833 first, then replacing four source files with ones from the zip archive and finally (re)updating the years in the copyright notices from 2002-2011 to 2002-2013.

Although my main interest with the patch is in games that do not seem to do any kind of digitized output from the emulated PC speaker, as I said before it is surely doing its job when it comes to such games! I basically refer here to corrections of PC speaker outputs in various games originally distributed by Apogee Software Ltd. and related, like Commander Keen 1-3 (also 4-6 up to some level) and Dangerous Dave; Oh and, say, also Overkill (aka Overkill: The Last-Planet Mega Blast), at least partially.

To the ones not familiar with what I'm talking about: Multiple successive beeps of the same frequency should sound like different beeps (once the patch is applied), rather than a longer beep.
You do not have the required permissions to view the files attached to this post.
NY00123
Member
 
Posts: 210
Joined: 2010-2-13 @ 19:42

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby Kirben » 2015-8-04 @ 09:44

Unfortunately this patch seems to causes regressions in some games, any hope for further improvements?

I was trying Impossible Mission II, but the elevator barely makes a sound when using this patch. Only the MCGA version of the game seems effected, the other versions (CGA, EGA, TANDY) still seem fine.
Kirben
Newbie
 
Posts: 27
Joined: 2010-7-10 @ 06:11
Location: Australia

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby ripa » 2015-8-04 @ 20:45

I'll take a look at this patch again, but I won't promise anything :-)
ripa
Oldbie
 
Posts: 539
Joined: 2005-4-18 @ 00:53
Location: Finland

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby VileRancour » 2016-9-15 @ 20:34

Here's the speaker patch updated against current SVN (r3995):
dosbox_r3995_digi_pcspkr.diff

and for testing purposes, a debug-enabled win32 build:
dosbox_r3995_digi_pcspkr.zip

======================

I had a look at the reported Impossible Mission II regression. All versions seem to be affected, but there *is* a difference between the MCGA executable and the others:

- with IM2_MCGA.EXE, both the footsteps and the elevator sound are replaced with silence (padded with clicks).
- with IM2_EGA.EXE, the footsteps are still click-padded silence. The elevator makes a sound, but not the same sound as in unpatched DOSBox.

Perhaps the difference has to do with the fact that the MCGA version continuously messes with the timer, while the other versions do not. It does this over and over:
Code: Select all
PIT:PIT 0 Timer at 72.5780 Hz mode 3


Some captures for demonstration:
IM2_comparison_WAV.zip

IM2_comparison_WAV.png

Hope this helps. It looks like this patch generally improves accuracy in every test case I've tried, *except* this one. Are there any other regressions that anyone can see?
You do not have the required permissions to view the files attached to this post.
User avatar
VileRancour
Oldbie
 
Posts: 1501
Joined: 2003-5-14 @ 22:11
Location: 1-01-80 0:00a

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby aaronp » 2016-12-09 @ 02:20

I'm getting messages like "mixer callback wants too many samples from pc speaker emulator: 883" playing Commander Keen. Is this to be expected/indicate a bug/problem with my config?
aaronp
Newbie
 
Posts: 5
Joined: 2016-10-16 @ 19:32

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby ripa » 2016-12-10 @ 10:29

It's expected and you can ignore it.
ripa
Oldbie
 
Posts: 539
Joined: 2005-4-18 @ 00:53
Location: Finland

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby HunterZ » 2016-12-11 @ 00:53

This video is out of date but mentions some regressions that should probably be tested against if they haven't already been addressed: https://www.youtube.com/watch?v=kBasp2kPgXI&t=2s
User avatar
HunterZ
l33t++
 
Posts: 5988
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby aaronp » 2016-12-30 @ 02:39

It's definitely not perfect.

Playing CAMBOD.MOD using iplay a la this video sounds really good in dosbox-svn, but terrible with this patch.

Also does this patch make the volume louder? I'm frequently having to turn the volume down for pc speaker games.

Still, for games there are some noticeable improvements imo. For Monkey Island, I think the intro sounds more muffled on dosbox-svn. I'm not sure which is more accurate, and I'm not a sound guy so I can't really articulate the difference. :dead:
aaronp
Newbie
 
Posts: 5
Joined: 2016-10-16 @ 19:32

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby James-F » 2017-1-07 @ 07:28

Not perfect but 99.99% there, and much better than vanilla DOSBox.
In each MP3 attached you can hear: Real PC-Speaker (through SB16), Patched DOSBox, Vanilla DOSBox, In that order.

Thank you ripa for your excellent work, and thanks VileRancour for posting the latest diff.

HunterZ wrote:This video is out of date but mentions some regressions that should probably be tested against if they haven't already been addressed: https://www.youtube.com/watch?v=kBasp2kPgXI&t=2s

This video mentions the regression in MI with the older NY00123 patch, the latest by ripa has fixed the regression in MI, I tested it.
I hope ripa has some strength and will left to perfect the patch even further.

@ripa, is there any updates or patch4 is the latest?
I know there are several threads with several patches, but your patch4 appears to be the most accurate with the least regressions.
You do not have the required permissions to view the files attached to this post.
User avatar
James-F
Oldbie
 
Posts: 1158
Joined: 2015-11-30 @ 04:10

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby ripa » 2017-1-08 @ 15:29

I'm sorry, but I haven't and don't have the time to work on this further. Maybe some day...

Thanks for those recordings - I'm very happy that the latest patch sounds the same as the real thing xD
ripa
Oldbie
 
Posts: 539
Joined: 2005-4-18 @ 00:53
Location: Finland

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby James-F » 2017-1-08 @ 16:26

ripa wrote:Thanks for those recordings - I'm very happy that the latest patch sounds the same as the real thing xD

Your patch is practically indistinguishable from the real PC-Speaker, that sure is an amazing work ripa.
Thank You!
User avatar
James-F
Oldbie
 
Posts: 1158
Joined: 2015-11-30 @ 04:10

Re: Want to use PC Speaker and not Sound Blaster in StarControl 1

Postby Yesterplay80 » 2017-1-09 @ 18:01

James-F pointed me towards this thread and the patch and asked me if I could integrate it in my enhanced DOSBox builds. And so I did, so starting from Version r4003 PC speaker playback should sound better using my enhanced builds (see signature). :)
My full-featured DOSBox SVN builds (without debugger) for Windows and Linux: Vanilla DOSBox and DOSBox ECE (Enhanced Community Edition)
User avatar
Yesterplay80
Member
 
Posts: 181
Joined: 2016-2-23 @ 11:02
Location: Germany

PreviousNext

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest