Jump to content


Photo

Playing around with the in-game tune in JSW


  • Please log in to reply
23 replies to this topic

#11 IRF

IRF

    Advanced Member

  • Contributor
  • 4,485 posts

Posted 20 May 2016 - 09:58 AM

Something's just occurred to me - because of the INC A instruction at #8B43, the first note of the in-game tune may be skipped at the very start of the game.  This is something I've often wondered about, but I wasn't sure if it was my ears deceiving me!

 

To prevent it from occurring, the Music Note Index at #85E1 could be initialised to FF instead of 00.  Then on the first pass through the Main Loop, it will be incremented to zero, so the first note of the tune (or should we call it the '0th note'?) will be selected in the first instance.


Edited by IRF, 20 May 2016 - 02:54 PM.


#12 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 2,250 posts

Posted 20 May 2016 - 09:13 PM

Ian, when you say "may be skipped", does it mean it is sometimes skipped, and sometimes it isn't, or do you really mean it is *always* skipped (and hence the suggestion to modify the initialisation code)?

 

If it is only sometimes skipped, what does this depend on?



#13 IRF

IRF

    Advanced Member

  • Contributor
  • 4,485 posts

Posted 20 May 2016 - 10:33 PM

Ian, when you say "may be skipped", does it mean it is sometimes skipped, and sometimes it isn't, or do you really mean it is *always* skipped (and hence the suggestion to modify the initialisation code)?

If it is only sometimes skipped, what does this depend on?


In the original set-up, each note in the tune is played twice, but because the tune begins at a 'Music Note Index' value of 1, rather than Zero, the first note is heard at the very beginning, but for only half the duration - if you see what I mean? i.e. one instance of the first note at #865F, followed by two instances of the second note at #8660, two instances of the third note at #8661, etc. [Once the tune rendition has finished, the first note will play twice as the tune wraps round, so this 'glitch' will only affect the very start of the game.]

However, if you've changed the code (as previously discussed) so that the tune plays at double the normal speed (i.e. the first note of the game is played when the Music Note Index is at a value of 1, the second note when the Music Note Index is at 2, etc), then I think the first actual note in the code ('Note Zero' as it were; the note represented by byte #865F) will be missed out entirely at the start of the game - unless you've initialised the Music Note Index to FF (in which case the M.N.I. is incremented by #8B43 to a value of 00 prior to a note being played).

I hope that makes sense?


Edited by IRF, 09 September 2016 - 01:26 PM.


#14 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 2,250 posts

Posted 21 May 2016 - 10:55 AM

Yes, it makes sense and I think I understand, thanks, Ian  :) .


  • IRF likes this

#15 IRF

IRF

    Advanced Member

  • Contributor
  • 4,485 posts

Posted 05 July 2016 - 12:15 PM

To slow down* the rate at which Willy's spare lives 'dance' in the Status Bar, you can NOP out some or all of the RLCA instructions at #899B-899D in the 'Draw the remaining lives' routine.

 

e.g. if all three RLCA's are NOPped out [replaced with '00'], then the sprites will cycle through all Willy's animation frames once per rendition of the (normal) in-game tune.

 

(*By which I mean slow down the sprites in relation to the speed of the in-game tune.  The changes I suggested earlier in this thread slow down both the music and the speed of the 'remaining lives' sprites, in tandem.)



#16 IRF

IRF

    Advanced Member

  • Contributor
  • 4,485 posts

Posted 16 July 2016 - 06:08 PM

If you apply the following two POKEs:

#8B27, #1E
#8B29, #1E

then the ENTER key no longer toggles the in-game music on and off. However, the music can still be toggled via the H-J-K-L keys.

(The original value of those two bytes is #1F. Also, it is instructive to compare and contrast the two operands at #96DA and #96DC, which both have values of #01.)

I think that implementing the above would mean that the five bytes of code at #880E-8812 are no longer necessary? (The purpose of those bytes is to ensure that when pressing the ENTER key to start the game, if in doing so the player keeps the key pressed for too long, it doesn't accidentally toggle the in-game music on/off.)

It is also useful to be able to have a method of pausing and unpausing the game without the in-game music being switched off. (e.g. It keeps each rendition of the in-game tune in sync with the 'game minutes' on the status bar digital clock.)

Finally, I would say that ENTER is already treated differently to the rest of the keys with which it shares a 'port' (if that's the correct terminology?), because of the use of ENTER (and only ENTER) to start the game, and so it makes sense to fully differentiate the key's function in this way.


Edited by IRF, 09 September 2016 - 01:27 PM.


#17 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 2,250 posts

Posted 16 July 2016 - 11:29 PM

It is also useful to be able to have a method of pausing and unpausing the game without the in-game music being switched off. (e.g. It keeps each rendition of the in-game tune in sync with the 'game minutes' on the status bar digital clock.)
 

 

I believe this can be done in the original "JSW" (and the remakes) by pressing any of the keys that pause the game and then pressing one of the QWERTY keys (or thereabouts, I didn't check which ones exactly). This unpauses the game without changing the status of the music.



#18 IRF

IRF

    Advanced Member

  • Contributor
  • 4,485 posts

Posted 17 July 2016 - 12:25 AM

I believe this can be done in the original "JSW" (and the remakes) by pressing any of the keys that pause the game and then pressing one of the QWERTY keys (or thereabouts, I didn't check which ones exactly). This unpauses the game without changing the status of the music.

 

Sorry, I probably didn't make my thoughts clear.  What I meant to say was: it would be good to have an option of unpausing the game without having to press a 'movement key' and without having to switch the in-game music off.  (i.e. if you've paused the game when Willy is in a perilous position, you don't necessarily want to 'unpause' the game by pressing Jump or Left or Right, which might make Willy's situation worse!)


Edited by IRF, 17 July 2016 - 01:02 AM.


#19 IRF

IRF

    Advanced Member

  • Contributor
  • 4,485 posts

Posted 17 July 2016 - 08:47 PM

I think that implementing the above would mean that the five bytes of code at #880E-8812 are no longer necessary? (The purpose of those bytes is to ensure that when pressing the ENTER key to start the game, if in doing so the player keeps the key pressed for too long, it doesn't accidentally toggle the in-game music on/off.)

 

Incidentally, the game can also be started up by pressing the '0' key, which acts as a 'Jump' key during the game. But there is no equivalent check of the Keypress Flag when pressing jump, so starting the game in this way can indeed instigate a jump at the start of the game (if you keep the key pressed for too long).

N.B. Pressing the 'Fire' button on a joystick can also be used to start up the game when the title music 'Moonlight Sonata' is playing, which could have the same effect.  Although looking at the code it would appear that, curiously, the joystick Fire button does NOT provide the function of starting up the game whilst the scrolling message is in operation!


Edited by IRF, 18 July 2016 - 08:14 AM.


#20 IRF

IRF

    Advanced Member

  • Contributor
  • 4,485 posts

Posted 17 July 2016 - 09:08 PM

, the instructions at #880E-8812 (or the alternative approach of initialising #85E2 with a value of '1')

 

Note that there is an alternative approach to the instructions at #880E-8812, namely to initialise the value of #85E2 to '1'.  This can be achieved by inserting (via either consolidation, or a jump to elsewhere and back again) the following commands near the start of the 'Display the title screen...' routine (#87CA onwards):

LD A, 1 [or INC A if it follows the commands that set various parameters with a value of A=0]
LD (#85E2), A

The above ensures that the in-game music is always playing at the start of every game - even if it had been switched off during the previous game - as well as setting the Keypress Flag (Bit 0 of #85E2) to 1, to prevent the player from accidentally turning the music off if they keep the ENTER key depressed as the game begins.


Edited by IRF, 18 July 2016 - 08:20 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users