Jill of the Jungle Sound Effects

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

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-5-16 @ 18:04

I never noticed that the lava was supposed to be animated, having used v1.2d as a reference before.

It's definitely something in the original v1.2d executables. I have a distribution that has both v1.2b (as JJFILE1.EXE) and v1.2d (as JJFILE01.EXE) in the same directory. JJFILE1 (v1.2b) has animated lava, JJFILE01 (v1.2d) has not. That version is even more broken than I previously thought. If v1.2b and v1.2c did not have that hideous timer-driven sample playback routine, I would consider making a patch to downgrade from 1.2d to 1.2c.

Oh well, another issue to investigate....
NewRisingSun
Oldbie
 
Posts: 766
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby K1n9_Duk3 » 2017-5-16 @ 22:14

I'll save you some time and tell you what caused the issue:

For some odd reason, the compiler that was used to build version 1.2d did something wierd. Basically, the original code used to be
Code: Select all
setboard(x, y, bd[x][y] | ((msg_block(x, y, msg_update)!=0)*mod_screen))

and the compiler decided it was a good idea to read the value from bd[x][y] before calling msg_block(), which updates the value at bd[x][y] with the next frame of the tile's animation cycle. So the tile number is reset to its previous value immediately after it was updated and you never see the animation.

The code in question was "updbkgnd()" in "JMAN.C" (starting at seg022:120F when I open the executable in IDA Freeware 5.0).

I recommend replacing the code with something resembling this:
Code: Select all
if (msg_block(x, y, msg_update))
   setboard(x, y, bd[x][y] | mod_screen)

I used the names from the Xargon source code and the debugging information from the Jill executable itself. If you don't want to look up the values for msg_update and mod_screen yourself, here you go:
Code: Select all
msg_update = 2
mod_screen = 0xC000


There were some other issues in v1.2d that prevented the screen from updating when some tiles were changed by a trigger or a switch. I don't know if you already fixed that. The issue is caused by calling the setboard() function without the "| mod_screen" part. I think the call at seg015:2715 is responsible for this, but it might be hard to add the "| mod_screen" there just by hacking the executable.
User avatar
K1n9_Duk3
Newbie
 
Posts: 42
Joined: 2016-9-30 @ 11:07

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-5-17 @ 04:08

Thank-you. That should help a lot.
K1n9_Duk3 wrote:and the compiler decided it was a good idea to read the value from bd[x][y] before calling msg_block()
As I understand the C standard, the order of evaluation in this case is undefined, so the programmer was wrong to assume a particular order.
K1n9_Duk3 wrote:and the debugging information from the Jill executable itself
Did you get IDA FW 5.0 to make use of that debugging information?
NewRisingSun
Oldbie
 
Posts: 766
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby K1n9_Duk3 » 2017-5-17 @ 05:28

No, I did not manage to get IDA itself to use the debugging information. I have written a tool that extracts C-style strings from binary files (basically just replacing any 0 bytes with line breaks) and used the resulting text file and the Xargon source code to assign the names of functions and variables in IDA. I should also mention that I used an older freeware version of IDA for the initial analysis of the executable, since that version can detect compiler signatures and will assign the correct names to the runtime library functions.

The Xargon source code does not contain the source files for all parts of the game, though. Some files are only included as .OBJ files in Xargon, like the low-level graphics code in GRL.OBJ and GRASM.OBJ. Opening these in IDA will make use of the names stored in the .OBJ file, but I guess you already know that.
User avatar
K1n9_Duk3
Newbie
 
Posts: 42
Joined: 2016-9-30 @ 11:07

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-5-17 @ 18:03

K1n9_Duk3 wrote:The issue is caused by calling the setboard() function without the "| mod_screen" part
But how could that part have disappeared when recompiling the game?

I think I have fixed the lava animation and switch-flipping screen update issue in all three executables at the locations that K1n9_Duk3 mentioned, and from what I can tell, they seem to work correctly now. But have not had the time to play through the games again. I am posting this as a "-TEST" patch until someone who has tested it more extensively tells me that I can replace the main patch with it. Install JILLUPD-TEST instead of JILLUPD on an unpatched game distribution, and apply EPICFM on top of it if you wish.

Edit: Patch updated in the latest post.
Last edited by NewRisingSun on 2017-5-21 @ 06:47, edited 1 time in total.
NewRisingSun
Oldbie
 
Posts: 766
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby K1n9_Duk3 » 2017-5-17 @ 20:47

NewRisingSun wrote:
K1n9_Duk3 wrote:The issue is caused by calling the setboard() function without the "| mod_screen" part
But how could that part have disappeared when recompiling the game?

In the Xargon source code, there is a macro definition for setboard():
Code: Select all
#define setboard(x,y,n) bd[x][y]=n|mod_screen;

My guess is they replaced the macro with an actual function in v1.2d (the setboard() function checks if x and y are in range, to avoid memory corruption). The older versions probably used this macro since I cannot find a setboard() function in them.
User avatar
K1n9_Duk3
Newbie
 
Posts: 42
Joined: 2016-9-30 @ 11:07

Re: Jill of the Jungle Sound Effects

Postby SaxxonPike » 2017-5-18 @ 16:26

NewRisingSun wrote:
K1n9_Duk3 wrote:The issue is caused by calling the setboard() function without the "| mod_screen" part
But how could that part have disappeared when recompiling the game?

I think I have fixed the lava animation and switch-flipping screen update issue in all three executables at the locations that K1n9_Duk3 mentioned, and from what I can tell, they seem to work correctly now. But have not had the time to play through the games again. I am posting this as a "-TEST" patch until someone who has tested it more extensively tells me that I can replace the main patch with it. Install JILLUPD-TEST instead of JILLUPD on an unpatched game distribution, and apply EPICFM on top of it if you wish.

Thank you both so much for your work on this bug. I'll play through them and let you know. It's especially good if this also fixes the issue where using switches for platforms that are within the viewport don't update on screen. The two problems likely have the same cause in the D release of the game. Time to confirm :)
User avatar
SaxxonPike
Member
 
Posts: 193
Joined: 2004-9-08 @ 20:04
Location: Wisconsin, USA

Re: Jill of the Jungle Sound Effects

Postby James-F » 2017-5-19 @ 05:13

I have tested ver C and there are no bugs with Water/Lava/Switches.
But ver D (episode 1 shareware) has all three animation problems.

I don't have 1.2D trilogy, so I can only attest for 1.2C trilogy.
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Jill of the Jungle Sound Effects

Postby SaxxonPike » 2017-5-20 @ 22:38

I'm happy to report everything is working great with the latest patch, animations and all.
User avatar
SaxxonPike
Member
 
Posts: 193
Joined: 2004-9-08 @ 20:04
Location: Wisconsin, USA

Re: Jill of the Jungle Sound Effects

Postby NewRisingSun » 2017-5-21 @ 06:46

I have updated JILLUPD to correct version 1.2d's missing screen updates.

  • Restore map level jokes about Epic Megagames crushing the competition that were removed after v1.0 of the game (as in previous version of the patch)
  • Clear the high score table (as in previous version of the patch)
  • Wait 50 ms for an interrupt during IRQ detection (independently of CPU speed) (as in previous version of the patch)
  • Always set the DMA controller to auto-init mode, even as the SB DSP is programmed for single-cycle playback (workaround against SB16 DSP hardware bug) (as in previous version of the patch)
  • Send End-of-Interrupt signal to Interrupt Controller before IRQ detection (needed under Windows 98) (as in previous version of the patch)
  • Change sample cache slot memory buffer size from 6,144 to 12,228 bytes (prevents memory corruption manifesting itself in sound effect dropouts) (as in previous version of the patch)
  • Correct block size in auto-generated VOC header, add block type 0 at end (prevents possible freeze) (as in previous version of the patch)
  • Disable mixer writes (leave my mixer settings alone!) (as in previous version of the patch)
  • Use the BLASTER= environment variable for Sound Blaster settings (as in previous version of the patch)
  • Remove garbage write to I/O address 00h in graphics code (prevented DMA channel 0 from working) (as in previous version of the patch)
  • Correct missing lava and water animation (credit goes to K1n9_Duk3 for identifying the root cause) (new)
  • Update the screen when a switch is flipped (credit goes to K1n9_Duk3 for identifying the root cause) (new)
  • Remove unnecessary symbolic information from executable files (new)
And also JILLFM/EPICFM:
  • Play music through SBFMDRV.COM of the user's choice (supplied: v1.22, as in original release of the game) (as in previous version of the patch)
  • Exit with an error message if a memory-resident program (such as SBPVOL) that interferes with EPICFM.EXE is active (as in previous version of the patch)
  • Use the BLASTER= environment variable for Sound Blaster settings (as in previous version of the patch)
Note: DMA channel 0 will not work in (vanilla) DOSBox, a limitation of the emulator, not of the Sound Blaster code/patch.
Attachments
JILLUPD.ZIP
(465.88 KiB) Downloaded 47 times
JILLFM.ZIP
(5.88 KiB) Downloaded 45 times
NewRisingSun
Oldbie
 
Posts: 766
Joined: 2005-9-02 @ 02:26

Previous

Return to DOS

Who is online

Users browsing this forum: silikone and 1 guest