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: 783
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: 72
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: 783
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: 72
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: 783
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: 72
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: 208
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: 1428
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: 208
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 101 times
JILLFM.ZIP
(5.88 KiB) Downloaded 84 times
NewRisingSun
Oldbie
 
Posts: 783
Joined: 2005-9-02 @ 02:26

Re: Jill of the Jungle Sound Effects

Postby SaxxonPike » 2018-5-17 @ 03:58

This version of the game, whichever it is, allows Jill to kill demons in one hit. Wonder if this was the intended behavior?

https://www.youtube.com/watch?v=dJZaSy3hwvk

I know in 1.2d they are SUPER difficult.
User avatar
SaxxonPike
Member
 
Posts: 208
Joined: 2004-9-08 @ 20:04
Location: Wisconsin, USA

Re: Jill of the Jungle Sound Effects

Postby K1n9_Duk3 » 2018-5-19 @ 22:10

Probably a hacked version of the game as far as I can tell.

What I can say for sure is that the demon code in version 1.0 of JILL1.EXE differs slightly from the code in v1.2d. In v1.0, any weapon can hurt the demons, not just the spinblade. Also, since the executable is uncompressed and contains debugging information, it's easy to find the code for the demons and modify the amount of hits a demon can take before it dies. Since the demon has 5 hit points and 4 frames of invulerability between hits in both the earliest and the latest version of JILL1.EXE, I doubt that it would be any different in other versions.
User avatar
K1n9_Duk3
Newbie
 
Posts: 72
Joined: 2016-9-30 @ 11:07

Re: Jill of the Jungle Sound Effects

Postby SaxxonPike » 2018-5-23 @ 02:10

The one hit kill demon thing happens in whatever version of the game they're using:
http://tasvideos.org/5779S.html

Filesizes and hashes are listed here and they touch on it in the section where they cover Level 9. I'm really curious what exactly is going on here...

Edit: The demo in Level 9 in Jill 2 also makes more sense with demons taking one hit. I don't have a legitimate 1.0 to verify (only original I have is 1.2c from the B&N release which has the difficult demons)
User avatar
SaxxonPike
Member
 
Posts: 208
Joined: 2004-9-08 @ 20:04
Location: Wisconsin, USA

Re: Jill of the Jungle Sound Effects

Postby K1n9_Duk3 » 2018-5-23 @ 21:00

After seeing the file size of JILL2.EXE on the page you linked to, I had to compare it to the known versions on the ModdingWiki: http://www.shikadi.net/moddingwiki/Jill_of_the_Jungle

Whatever version was used in the speedrun is definitely not listed on the ModdingWiki page. And as you can see, I was wrong about the executable being uncompressed, at least in the case of the earliest versions of Jill 2. I still think it's a hacked version or perhaps even a beta version, which would explain the weird demo you mentioned. But it could also be possible that the original release of Jill 2 had demon code that differed from the code in Jill 1, and that the modified code was accidently removed when they updated the code for the later versions. Given the animated tile issues that appeared in v1.2d, this wouldn't surprise me at all.

Without access to the JILL2.EXE from version 1.0, there's not much else I can say about this.
User avatar
K1n9_Duk3
Newbie
 
Posts: 72
Joined: 2016-9-30 @ 11:07

Previous

Return to DOS

Who is online

Users browsing this forum: No registered users and 4 guests