Jill of the Jungle Sound Effects

Getting old DOS games working on modern hardware. (DOSBox topics belong in DOSBox areas below, not here).

Re: Jill of the Jungle Sound Effects

Postby ripsaw8080 » 2017-4-20 @ 00:05

NewRisingSun wrote:EPICFM.EXE already supports the 1994 version of Kiloblaster, which also has the bad internal .CMF player.

Appears to work with the Xargon trilogy (v3.0) as well, but have to copy XARGON.BAT to JILLA.BAT or KILOA.BAT until more direct support is arranged. ;)
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4389
Joined: 2006-4-25 @ 23:24

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-20 @ 02:29

Yeah, yeah. Run PATCH.BAT to make changes to the Sound Blaster code that should prevent dropouts on the Sound Blaster 16, similar to what I have done with "Jill of the Jungle". There only seems to be one version of Xargon, so no need for an update patch here. (Unless there are also four different "3.0" versions as there were four different "1.2" versions of "Jill of the Jungle". I have not compared the .EXE files from several sources against each other to find out whether that is the case.)

Although EPICFM works with the newer version of Kiloblaster, I still need to make an update patch to convert the older version of Kiloblaster to the newer one, which apparently has graphical changes as well.
Attachments
XARGUPD.ZIP
(6.74 KiB) Downloaded 78 times
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby ripsaw8080 » 2017-4-20 @ 04:46

NewRisingSun wrote:Although EPICFM works with the newer version of Kiloblaster, I still need to make an update patch to convert the older version of Kiloblaster to the newer one, which apparently has graphical changes as well.

There's no need to bother with update patches for Kiloblaster or Xargon when one can download their last release versions for free, with source code, thanks to the generosity of the author.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4389
Joined: 2006-4-25 @ 23:24

Re: Jill of the Jungle Sound Effects

Postby James-F » 2017-4-22 @ 05:42

I have a patched Jill freeze report on my Pentium rig with dual SB configuration.
This happen with L1 disabled or not, so it's not speed related.
SBPro2 A220 I7 D1.
SB16 A240 I5 D0.
SET BLASTER=A220 I7 D1

Patched Jill trilogy 1.2C will freeze when entering Map 1, but plays okay in the world map.
When I run jilla.bat without the epic patch the game does not freeze.
User avatar
James-F
Oldbie
 
Posts: 1448
Joined: 2015-11-30 @ 04:10

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-22 @ 18:12

Unfortunately, I was unable to reproduce any freezing, both using DOSBox as well as actual hardware running pure DOS. I have however changed the code a little to prevent what I could imagine might theoretically cause problems in certain scenarios. Try the attached EPICFM and tell me if it fixes anything. I assume you are using the included SBFMDRV.
Attachments
EPICFM.zip
(5.63 KiB) Downloaded 56 times
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby James-F » 2017-4-22 @ 18:27

With jill.bat the games runs faster than usual and has absolutely no FM sound.
Disabling L1 cache, behaves the same.
User avatar
James-F
Oldbie
 
Posts: 1448
Joined: 2015-11-30 @ 04:10

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-22 @ 18:33

Well, then I have absolutely no idea. You can PM me with a zip of your Jill directory as it is, so I can see whether the patch applied correctly or not, but other than that, I'm stumped.
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby James-F » 2017-4-22 @ 18:58

Okay, it was SBPVOL.COM which is a resident TSR that I can control SBPro mixer with keyboard keys, it was interfering with epicfm, unloading the TSR and the patched Jill doesn't freeze.
User avatar
James-F
Oldbie
 
Posts: 1448
Joined: 2015-11-30 @ 04:10

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-22 @ 19:06

Ah. Is that utility on the Creative SBPro driver disks? Then I can take a look and at least make EPICFM exit gracefully.

Speaking of mixer, I noticed that Jill annoyingly writes its own mixer settings without asking the user. Maybe I'll patch that out as well, because I almost fell out of my chair earlier when I tried the game on my real DOS machine.
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby James-F » 2017-4-22 @ 19:12

No, its a third party utility that lets me control the mixer from within a game by keyboard shortcuts.
http://www.vogonsdrivers.com/getfile.php?fileid=55&menustate=0
I use it to turn the Output Filter On/Off and Stereo/Mono switches of the SBPro by a simple keyboard shortcut.
It also uses the keyboard 3 leds as indicators when you switch settings.
VERY useful piece of software for every SBPro owner.

Indeed, Jill resets the mixer.
It would be very nice if you could completely remove that.
User avatar
James-F
Oldbie
 
Posts: 1448
Joined: 2015-11-30 @ 04:10

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-22 @ 21:27

In addition to the mixer issue, there are two remaining problems:
  1. Worx toolkit's method of IRQ detection fails under Windows 98. Basically, the routine starts a short DMA transfer and checks whether the interrupt service routine has been invoked. Such a method is not uncommon, but other sound drivers do this once with all possible interrupt service routines set up, and then look which one of them was invoked. Worx on the other hand does the DMA transfer for every possible IRQ, which means that four out of five times, an IRQ is generated that is never handled anywhere. This seems to work under pure DOS, but Windows doesn't like it at all and will not allow any IRQs after the first.
  2. The game has some sort of sample cache that occasionally gets corrupted for unknown reasons, even in the unpatched game version 1.2d. This manifests itself as one or two selected sound effects no longer playing, usually the jump or land sound, at least until the next level is loaded and the sample cache is flushed. Very rarely, this can also lead to the Sound Blaster IRQ handler freezing as it picks up an illegal entry into the jump table of the .VOC file block handler. If it happens, then usually at the beginning of the "Hut" level.
1. is conceptually easy to fix, but 2. occurs so sporadically that it's hard to find the root cause.
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-23 @ 08:02

Having debugged Jill's sample caching code, it's becoming plain to me what the problem is:

The game caches four samples at a time. If all four slots are used up and a sample is requested that is not in the cache, the sample that has been used the least so far gets replaced by reading directly from JILLx.VCL into the respective sample cache slot memory. For this reason, the code counts the number each sample has been requested throughout the entire game session. So far, so good.

The problem is that each cache slot is exactly 6,144 (1800h) bytes large. If a sample is shorter than that, then fine. If it is longer than that, the memory that comes after the 1800h bytes reserved for that slot is overwritten and thus corrupted. 5 out of 24 samples in Episode 1, 3 out of 25 samples in Episode 2, and 1 out of 24 samples in Episode 3 are larger than 6,112 bytes (6,144 minus the "Creative Voice File" header that the program generates on-the-fly). The largest sample has 11518 bytes in Episode 1, 8160 bytes in Episode 2 and 11518 bytes long in Episode 3, each without the "Creative Voice File" header.

So, why does then does the game memory that follows the sample cache not get corrupted, leading to horrible crashes? Because the game allocates memory for five rather than four sample cache slots. Apparently the programmers did notice that the game would otherwise crash all the time. Doing so however only guards against corruption if a large sample is loaded into the *fourth* slot. If a large sample is loaded into slots one to three, the other samples still get corrupted. The reason this leads to dropouts rather than garbage sounds is that the "Creative Voice File" header gets overwritten as well, and without that header present, Worx will just refuse to play the file, leading to no sound at all. Since these large samples are only played at infrequent occasions in the game, most players don't even notice it. The solution is to increase the slot memory size from 6,144 to something like 12,048 bytes, and allocate memory for only four instead of five slots. That should not be too difficult, as the memory is allocated on the heap when the program starts.

Another bug in the sample cache code is that although it makes up a "Creative Voice File" header on the spot, it fails to include the sample rate byte in the header's block size field. That's actually a good thing, because it also forgets to add the final 00h byte indicating an "end-of-file" block in the Creative Voice File format. Instead, because of the incorrect block size field in the header, the last sample gets interpreted as a block type, and since Worx mercifully performs a range check and treats all block types above 9 as "end of file", and because that last sample almost always has a value above 09h, the game does not crash every single time.

Worx will freeze the game however if that last sample, that is interpreted as a block marker, should ever have the values 3 or 5-8, as Worx ignores them but fails to advance the file position. That does not seem to be the case at the end of any of the samples that the game uses, but is something that could arise from the the memory corruption bug mentioned above, and would lead to very occasional game freezes. The solution is to make the code that creates the "Creative Voice File" header put the correct sample size into the header and add a 00h byte after the file data.

Edit: Both errors are quite visible in the Xargon source code, file SOURCE\MUSIC.C.
Last edited by NewRisingSun on 2017-4-23 @ 10:41, edited 3 times in total.
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-23 @ 09:47

Patch updated in the latest post.
Last edited by NewRisingSun on 2017-5-21 @ 06:46, edited 6 times in total.
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby James-F » 2017-4-23 @ 10:45

Report;

In Win98SE I disable SBPro completely and use PnP SB16 on A240 I5 D0 because A220 I7 D1 is taken by the non-PnP SBpro.
Jill doesn't respect SET BLASTER, it always runs on address 220, hence I get no sound or FM in Win98SE with SB16.
Or any other configuration besides A220 even in DOS.

With jillA.bat I get FM but no sound in Win98SE.
Maybe because without SBFMDRV it uses A388, while with SBFMDRV it uses A220?

Not many people use dual SB configuration so trying to fix the ignoring of SET BLASTER is not a must, but it would definitely be great additional feature.
Otherwise, all else works correctly.


EDIT:
I can un-patch by simply copying the original files from OLD directory, right?
Or do I have to keep a completely un-patched version of the game and apply the patch to it?
Last edited by James-F on 2017-4-23 @ 11:53, edited 1 time in total.
User avatar
James-F
Oldbie
 
Posts: 1448
Joined: 2015-11-30 @ 04:10

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-23 @ 11:21

Copying over the files from the OLD subdirectory reverses JILLUPD. And JILLA.BAT avoids JILLFM, as you already know.

Querying the BLASTER environment variable is of course possible, but is not something that can be done in a few bytes. And Worx seems to be hard-wired to DMA 1, I think. Changing this based on the BLASTER setting is possible as well, but somewhat involved. I'll see what I can do, without promising anything.
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-23 @ 16:28

Updated and reuploaded JILLUPD and JILLFM yet again.

JJFILE1-3.EXE as well as the supplied SBFMDRV.COM now take their settings from the BLASTER= environment variable. I had to add 328 additional bytes to each of the three main executable files for this.

Testing the various settings exposed another programming error in the graphics section of Jill's original code, namely a garbage write to I/O address 00h, which is otherwise the offset register of DMA channel 0. Hexadecimal BLASTER= address settings (e.g. 2C0) are supported by my code, though not by Creative Labs' original utilities such as DIAGNOSE or MIXERSET, it seems.

Edit: I have corrected a small error in my BLASTER environment variable processing code. The error affected original IBM 5170s with the earliest BIOS revision that have Sound Blasters set to IRQ 2/9. ;)
Last edited by NewRisingSun on 2017-4-23 @ 20:58, edited 2 times in total.
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby James-F » 2017-4-23 @ 17:54

Fantastic it works!

Now I can switch between SBPro and SB16 changing the SET BLASTER= command with a simple batch under DOS.
It also works in Win98SE with a SB16 using abnormal A240 I5 D0 settings.
From my side, I think the patch is done.

The SB16 clicks after playing a PCM sample which can be clearly heard in Noisemaker inside the game, but that's is another issue.
The click can clearly be heard with the '6' key (Yeah!! sound) in the middle of the playback, and 'A' key at the end of playback.
SBPro doesn't click, so I'll stick to it for games that don't use Auto-initialize DMA Mode.
User avatar
James-F
Oldbie
 
Posts: 1448
Joined: 2015-11-30 @ 04:10

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-4-26 @ 20:53

Great Hierophant wrote:ther than the stereo effect, is that really what Froelich would have heard? If so, then by all means add it.
I only noticed now that Dan Froelich has put up a recording of FUNKY.ROL. While it has some additional reverb applied to it, you can hear that it sounds quite different from SBFMDRV's output. The drums are very close to my custom FM player's recording in pitch, although the volumes are very different yet again.

All in all, ROL2CMF commits the following errors:
  1. Fails to take into account that the AdLib Visual Composer ignores the pitches of Snare, Top Cymbal and Hi-Hat. It should set their note number to the correct fixed value.
  2. Ignores the waveform register of all instruments. I had always thought that when Creative Labs converted THECLOUD.ROL from the AdLib Song Album #8 to THECLOUD.CMF for use in their "Sound Blaster 16 Features" demo, they deliberately changed some of the instruments. No: they just sound different because they are not converted properly!
  3. Does not seem to honor the AM modulation bit in any instrument.

SBFMDRV furthermore commits the following errors:
  1. Fails to initialize instruments in percussion mode if they are not used. For the OPL2's percussion mode to work reliably, all five percussion instruments must be fully initialized even when not all five of them are used.
  2. Velocity handling is never 100% right. ROL2CMF just takes the floating point value of the .ROL file and multiplies it with 127, which is basically correct, but SBFMDRV does something strange, and that strange thing is different in every version of the driver. By "strange" I mean that it multiplies instrument's base volume and the velocity. That's wrong. Since the OPL's attenuation register is logarithmic, two volumes must be added, not multiplied.
NewRisingSun
Oldbie
 
Posts: 852
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby SaxxonPike » 2017-5-10 @ 02:18

Thank you so much for these patches! I'm going to try them out on a real machine tonight.
User avatar
SaxxonPike
Member
 
Posts: 238
Joined: 2004-9-08 @ 20:04
Location: Wisconsin, USA

Re: Jill of the Jungle Sound Effects

Postby SaxxonPike » 2017-5-16 @ 17:01

The game patches have worked out excellently. Thanks again.

Related to the game, but unrelated to the problem, I notice in many versions of Jill of the Jungle, the animations for lava and water don't play. Also, when flipping a switch for a barrier on-screen, it doesn't disappear, even though you can walk through it - but if you go away and come back, it's clear as it should be. It occurs to me that the screen is not being updated. Know why that might be?

I'm experiencing that in both Dosbox and on a real machine.
User avatar
SaxxonPike
Member
 
Posts: 238
Joined: 2004-9-08 @ 20:04
Location: Wisconsin, USA

PreviousNext

Return to DOS

Who is online

Users browsing this forum: No registered users and 3 guests