Skip to content

Commit

Permalink
- more sound dropout issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvids committed Nov 3, 2021
1 parent d8e7710 commit 714e04a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -63,10 +63,12 @@ Version History
- Automap tracing has been improved to cut off visibility at unopened doors. This improvement reduces automap errors where visibility would "seep through" areas that the player hasn't explored yet but has already been "seen" by the ray-casting engine, which is caused by precision errors when checking for wall collisions. This issue also affects other source ports and derivative games that rely on the ray-casting engine for automapping, such as ECWolf and the DOS version of Super 3-D Noah's Ark. (The actual precision errors are left untouched because fixing them may affect the speed and determinism of the renderer and may cause subtle differences in gameplay.)
- Now marks previously-seen stationary enemies on the map if they are the only ones left and you have seen all of them (only on "Show hints if clear" automap mode or higher, renamed from "Show secrets if clear"). The rationale for this is that the automap is supposed to help the player determine where enemies may still be hiding, and if these stationary enemies were seen but never alerted, they should obviously remain where they are. If they are not marked (and the map is already mostly explored), then the player is forced to explore every part of the level again, which just wastes time and adds to frustration. However, if there are any moving enemies left (aside from ghosts), no enemy positions will be marked unless the player sees them directly, because their positions _should_ be uncertain to the player.
- Fixed modern-controls bug where items can still be picked up even when they are made inaccessible by pushing a secret wall on top of them. This bug did not affect the MPU-only version because the spotvis algorithm was modified only in the modern-controls version (to support showing walls on the automap).
- Fixed so that pushwall spots do not reactivate when another pushwall is pushed into its place and the user saves and reloads the game. To reenable the previous behavior, use new COMP flag 32.
- Fixed a classic bug where pushwall spots reactivate when another pushwall is pushed into its place and the user saves and reloads the game. To reenable the previous behavior, use new COMP flag 32.
- Fixed so that the OPL2 device is cleaned up twice on system exit. The original EXEs were actually doing this second clean-up in the main game code, but it does not respect the "noal" option, so it was #ifdef-ed out for safety. But then I later noticed that not cleaning up twice caused the game to sometimes not detect the OPL2 properly on the next startup, so I reimplemented it with proper support for "noal". This might be a DOSBox-only thing, but I'm not taking chances.
- Fixed a bug that causes lower-priority digitized sounds to never play again when a high-priority sound's ending portion was delayed from playing.
- The hidden PC Speaker digitized sound mode is improved, fixing dropout issues when combining digitized and non-digitized PC sound effects. If no Disney Sound Source or Covox Speech Thing is present (or if the "noss" command-line parameter is supplied), its menu option is now replaced with PC Speaker, officially making it a non-hidden mode. Also, door sound effects now revert to their non-digitized counterparts because they are too noisy and unintelligible (and play very often in a level); hopefully this makes PC Speaker digitized sound much more tolerable. For DOSBox users, it is recommended to set the volume of the emulated PC Speaker device to 40 (or below) using the DOSBox command line "MIXER SPKR 40" for proper loudness relative to the emulated SB and FM devices.
- Fixed a classic bug that causes sounds to get cut off at the last segment (which sometimes even causes lower-priority digitized sounds to never play again).
- Fixed a classic bug where the engine tries (and fails) to play back both digitized and non-digitized PC Speaker sounds simultaneously. What for? See the next fix. ;)
- If no Disney Sound Source is present (or if the "noss" command-line parameter is supplied), its menu option is now replaced with the glorious PC Speaker option. For DOSBox users, it is recommended to set the volume of the emulated PC Speaker device to 40 (or below) using the DOSBox command line "MIXER SPKR 40" for proper loudness relative to the emulated SB and FM devices.
- Door sound effects now revert to their non-digitized counterparts when playing on PC Speaker because the samples are too noisy and unintelligible (and play very often in a level); hopefully this makes PC Speaker digitized sound much more tolerable.

1.42 (2021-10-29)
-----------------
Expand Down
21 changes: 11 additions & 10 deletions WOLFSRC/ID_SD.C
Expand Up @@ -1549,24 +1549,25 @@ SD_Poll(void)
}
if (DigiMissed && DigiNextAddr)
{
#ifdef WOLFDOSMPU
memptr addr = DigiNextAddr; // prevent race condition
DigiNextAddr = nil;
DigiMissed = false;
SDL_PlayDigiSegment(addr,DigiNextLen);

// the code we replaced was causing issues such as disabling lower priority sounds,
// cutting off sounds at the end because the interrupt does not fire anymore, etc.
// (why is it reporting sound playback as finished even if it is still playing?!)
#else // WOLFDOSMPU
SDL_PlayDigiSegment(DigiNextAddr,DigiNextLen);
DigiNextAddr = nil;
DigiMissed = false;
if (DigiLastSegment)
{
DigiPlaying = false;
DigiLastSegment = false;
#ifdef WOLFDOSMPU
// fix for low-priority sounds not playing after a high-priority sound is interrupted
if ((DigiMode == sds_PC) && (SoundMode == sdm_PC))
{
SDL_SoundFinished();
}
else
DigiNumber = DigiPriority = 0;
SoundPositioned = false;
#endif // WOLFDOSMPU
}
#endif // WOLFDOSMPU
}
SDL_SetTimerSpeed();
}
Expand Down
12 changes: 11 additions & 1 deletion WOLFSRC/ID_SD_A.ASM
Expand Up @@ -130,6 +130,13 @@ extreme dw ?
; Macro used to do the sound effects code
;
MACRO DOFX

IFDEF WOLFDOSMPU
mov al,[BYTE PTR cs:pcindicate]
or al,al
jnz @@nopc ; PC digitized sound effect ongoing
ENDIF ; WOLFDOSMPU

les di,[pcSound] ; PC sound effects
mov ax,es
or ax,di
Expand Down Expand Up @@ -370,6 +377,9 @@ ENDIF ; WOLFDOSMPU
and al,11111100b
out pcSpeaker,al

IFDEF WOLFDOSMPU
mov [cs:pcindicate],0
ENDIF ; WOLFDOSMPU
call SDL_DigitizedDone

@@donereg:
Expand Down Expand Up @@ -504,7 +514,7 @@ ENDIF ; WOLFDOSMPU
IFDEF WOLFDOSMPU
mov ax,[ssStatus]
cmp ax,1
jle @@ssdone
jle @@ssdone ; SB Direct or Covox sound effect ongoing
ENDIF ; WOLFDOSMPU

les di,[ssSample] ; Get pointer to Sound Source sample
Expand Down
2 changes: 2 additions & 0 deletions diffbase.cmd
@@ -0,0 +1,2 @@
@echo off
git diff base --diff-filter=d

0 comments on commit 714e04a

Please sign in to comment.