Jump to content
Jet Set Willy & Manic Miner Community

Playing around with the in-game tune in JSW


IRF

Recommended Posts

To make the in-game music in Jet Set Willy play twice as fast, simply change the value of #8B48 to '3f' (i.e. the operand of an AND command) and NOP out (replace with '00') the byte at #8B49 (an RRCA instruction).

To follow: How to slow down the in-game music...

Edited by IRF
Link to comment
Share on other sites

To make the in-game music in Jet Set Willy play half as fast, change the value of #8B48 to 'fc' (i.e. the operand of the AND command at #8B47) and add an extra '0f' after the existing one at #8B49 (so that there are two consecutive RRCA instructions).

 

N.B. To achieve this requires some consolidation to allow the extra byte to be inserted.  However, if you don't mind losing the effect that deteriorates the pitch of the tune as Willy loses lives, then the 11 bytes from #8B51-#8B5B can all be NOPped out (filled with '00'), which is very handy for this purpose!  If you are carrying out the latter change (removing the 'tune pitch deterioration' sub-routine), then you also need to alter the values of two other addresses - the '5a' instructions at #8B5F and #8B68 should be changed to '5e'.

 

Other topics to follow: How to alter the code to allow for a tune that is twice as long (128 notes instead of 64), or half as long (32 notes).

Edited by IRF
Link to comment
Share on other sites

The standard in-game Jet Set Willy tune takes up 64 bytes.

 

It is possible to alter the length of the code that the program selects when playing the tune, by a factor of 2 either way.  So you could insert tunes that are either 32 bytes or 128 bytes in length.

 

To play a 32-byte tune, simply alter the value of the byte at #8B48 to '3e'.  (In original JSW, this will have the effect of just looping the first half of the 'Rich Man' tune, ignoring the second half.)

 

To play a 128-byte tune, alter the value of the byte at #8B48 to 'fe'.  You would then have to insert another 64 bytes of tune code immediately after the existing in-game tune - this would involve overwriting the [no longer necessary] 'security code entry' routine.  (Otherwise the game will play 64 bytes of 'noise' - trying to interpret the 'code entry screen' data as a tune - before reverting back to the start of 'Rich Man'.)

Link to comment
Share on other sites

Shout out to Andy (Spider) - I'm not sure whether or not this stuff should be in the 'Remakes' section instead?

 

Also, I considered amalgamating the three tune-related threads into a single one, but I couldn't figure out how to alter the title of a topic (even one that I've created), or how to delete topics if they are defunct as a result of consolidating them into other topics.  It that something that you or a moderator could do?  I think a generic topic title like "Playing around with the in-game tune in JSW" would cover the longer/shorter/faster/slower tunes topics.

Link to comment
Share on other sites

You can edit the title by clicking 'Use Full Editor' when you edit it. :) Ensure it is the first post in the topic you are editing if you want to change the title of it.

 

Just tell me if you want any deleting or merging together, or click 'report' and tell me there.

Link to comment
Share on other sites

Here's some relevant info from another discussion:
 
Ian (IRF)'s idea:
 
I was considering approaching this from a completely different perspective - removing the ability to turn the music off altogether, thinking that would save a fair few extra bytes in the main loop (keychecks etc), it would remove the need to reset the border colour after the item-collection/arrow-fire border 'special effects', and the player can always press the mute button on their hardware if they don't want to hear the music!
 
Andy (Spider)'s reply:

 

That's very easy, you can chop code out but the quick fix is to change:
 
35626 JR Z,35638 Jump if not
 
Default is: 35626,40 and 35627,10 (#8B2A,#28 and #8B2A,#0A)
 
Change it to this: only one byte needs changing:
 
35626 JR 35638 Jump anyway!
 
Which is:
 
35626,24 and 35627,10 (#8B2A,#18 and #8B2A,#0A)
 
Summary: To turn off the ability to turn off ( ! ) the in game tune via JSWED then just do a #8B2A,#18 , to restore it back to normal change that address back to #28

Edited by Spider
Link to comment
Share on other sites

  • 1 month later...

I believe it should be possible to modify the code at #8B51-8B5B, such that the pitch of the tune doesn't deteriorate with loss of lives, but instead based on the value of the Game Mode Indicator at #85DF.

 

The idea being that the tune reflects the fact that Willy gets more 'sick' the closer he gets to the toilet dash!!

 

The SUB and NEG commands at #8B56-8B59 would not be necessary (unless you wanted the pitch to increase through the Game Modes), as the adjustment would be made based on a variable which increments throughout the game, whereas the number of lives of course decrements.

 

However, I anticipate that one or two extra RLCA commands (on top of the existing two) could be useful to give the decrementation of the tune pitch a wider 'range' (given that the Game Mode Indicator only ever reaches a value of '3').

 

e.g. one extra RLCA (three in total) would mean that each Game Mode increment would yield a drop in pitch, equivalent to that which occurs when Willy loses two lives in original JSW.

 

But since the SUB and NEG commands use two bytes each, whereas each RLCA only uses one byte, there should be a net saving in bytes from modifying the code in this way.

 

P.S.  This would also mean that the pitch deterioration would still be showcased in a walkthrough recording, even if the player had used 'rollback' to avoid apparently losing lives!

Edited by IRF
Link to comment
Share on other sites

Following on from my previous post, see the attached test file.

 

There is one item in the game to collect (Bathroom tap).

 

If you leave the tap, walk left to Top Landing and lose some lives by hitting the Swiss Army Knife, you'll notice that the tune pitch deterioration appears to be disabled.

 

But if you collect the tap, then proceed to the Master Bed, then let Willy run to the toilet, you'll notice that at each stage (change of Game Mode), the pitch deteriorates!

 

The command at #8B51 which loads up the number of lives remaining from #85CC to the A register, is instead picking up the Game Mode Indicator (#85DF).

 

I've also removed the SUB and NEG commands, and added a couple more RLCA instructions (four in total now), as suggested in the previous post.  Fewer RLCA's will yield a more subtle deterioration of the tune.  If you wanted a more extreme deterioration, add more RLCA's.

(EDIT: Actually, on that latter point, to be more byte-efficient I believe you could replace the RLCA's with RRCA's and have fewer than four. i.e. rotate the bits of A along in the opposite direction.  3xRRCA achieves the same thing as 5xRLCA, 2xRRCA is equivalent to 6xRLCA, etc.)

pitchbygamemode.z80

Edited by IRF
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.