JSW... how does the game "finish" in assembly?
It seems the ZX and C64 versions of Jet Set Willy suffer from the same "unfinishable" problem. Thankfully the ZX version has been patched with pokes to fix it, but the C64 version has not. I changed 2 rooms in the C64 version so I can collect the items, so now I think I have all of them...
But nothing happens at the bedroom. Maria has disappeared but the bed is still deadly.
Judging by my experiences changing the room data, a lot of JSW has been ported from the ZX version, perhaps the room data is even byte for byte. What I need to know from this page though...
http://www.geocities.com/andrewbroad/spectrum/willy/disassemblies.html
is what exactly
8F05 3ADF85 LD A, (#85DF) ; All items collected? *** Not MM ***
8F08 E602 AND #02
8F0A 0F RRCA
8F0B AB XOR E
means? No matter what I cheat and set the C64 items total to the bed remains deadly. So perhaps I need to collect the last item and then a trigger is set, rather than touching the bed and then the game checking my items total?
Any musings much appreciated!!
(As I pointed out at c.s.s., I am fully aware of the direness of the C64 port. The stairs and jumping are suckola. I just want to see what the ending is like really!)
Thanks all.
But nothing happens at the bedroom. Maria has disappeared but the bed is still deadly.
Judging by my experiences changing the room data, a lot of JSW has been ported from the ZX version, perhaps the room data is even byte for byte. What I need to know from this page though...
http://www.geocities.com/andrewbroad/spectrum/willy/disassemblies.html
is what exactly
8F05 3ADF85 LD A, (#85DF) ; All items collected? *** Not MM ***
8F08 E602 AND #02
8F0A 0F RRCA
8F0B AB XOR E
means? No matter what I cheat and set the C64 items total to the bed remains deadly. So perhaps I need to collect the last item and then a trigger is set, rather than touching the bed and then the game checking my items total?
Any musings much appreciated!!
(As I pointed out at c.s.s., I am fully aware of the direness of the C64 port. The stairs and jumping are suckola. I just want to see what the ending is like really!)
Thanks all.
Post edited by DanSolo on
Comments
http://www.rzxarchive.co.uk/videos/jsw.php
:smile:
...is meaningless in this context. A number gets masked and divided by two making it odd or even and is then mushed with another value!
Blah!
NEED MORE INFO!
85DE 00 DEFB #00 ; number of items collected
85DF 00 DEFB #00 ; game/item status:
; 0: normal
1: all collected
2: running from bedroom
3: in toilet
8F04 5F LD E, A
8F05 3ADF85 LD A, (#85DF) ; All items collected? *** Not MM ***
8F08 E602 AND #02
8F0A 0F RRCA
8F0B AB XOR E
I'm only going by what I know of 6502 assembly, so I guess this part is checking 85DF to see what do next at the end of the game. But can anyone see in this code where 85DF gets set to 1? There is this bit
8F8F 3ADF85 LD A, (#85DF) ; *** Item to collect? ***
8F92 CB4F BIT 1, A
8F94 2026 JR NZ, #8FBC
8F96 AF XOR A
but I don't know what it does. Maybe I should go back to the C64 emulator, set the items to 70 or so and collect 15 items. Maybe that will trigger the ending.
Didn't mean to insult you.
WHAT IS BOLLOCKS!
I need to know what happens before and after these instructions!
Can you just give me a chuck before and after too!
Is it a conditional jump or return or does it add a value to beeper tone of reduce your lives or change the border colour or sprite position or end game or pause game or what?
What does 'A' hold at the start of this code?
hmmm, search something like this:
no_maria lda POSITION ; Get Willys position
and #$1F ; Get X coordinate
cmp #$06 ; Further left than X=6?
bcs _rts ; Not reached the bed yet
!!! lda #$02 ; Reached the bed
!!! sta STATUS ; Set STATUS to 2 to indicate fleeing
_rts rts
The byte at #85DF is a completion flag with the following values:
0 => Normal
1 => All items have been collected
2 => Willy is running to the right
3 => Willy's head is down the toilet.
The code that's already been posted relates to keyboard control (if bit 1 of that byte is set, Willy is not under the player's full control). In the disassembly at http://mdfs.net/Software/JSW/JGH/Docs/jsw48.lst it starts on line 1504 at 8ED4h.
The code that draws Maria and checks for the start of the end sequence is from 9534h to 9583h. In particular, the very last bit, which xxl has handily translated into 6502 for you. Here it is in the original Z80:
Now, to C64-JSW. The code that handles Maria is at 3284h and adds Maria as a guardian:
However, unlike in the Spectrum version, I don't immediately see code that sets STATUS to 2 or 3. There doesn't seem to be another check for the room being 35 anywhere else, so if there is victory sequence code I'd expect it to be between 3284h and 32D4h. But all I can see there is Maria raising her arm. Hmm. Perhaps, on the C64 version, the cake is a lie.
Another player of the C64 version says that Maria does indeed disappear, when you collect over about 50 items, although this is not the total number of items, and there are the another 7 that cannot be collected in the original C64 version. Is it possible the "Maria disappear" and "make bed non-lethal" are different? I'll try to find that status register and all references to it in the 6502 code later. Master Bedroom is hex 23 in C64 version too...
Thanks for that... I know what to look for now anyway.
"Make bed non-lethal" is a bit of a misnomer. The pillow stays lethal but Willy gets sent running to the right before he reaches it. On the Spectrum, both of these are handled in the same code block; but the corresponding bit in the C64 version only covers drawing Maria or not, as appropriate.
....and nothing happens. Maria disappears alright, but touching the bed does nothing. When I set it to 2, which should make Willy walk to the right, nothing happens. Same with 3. I guess that's the end of it then, in more ways then one!
Sorry for the delay! I've failed rather miserably to repeat what you did here and find code that corresponds between the two versions. I'm seeing if I can add an ending to this game, but I need to find two parts of the C64 disassembly. The first is where it checks if Willy is on a conveyor Here I plan to jmp to some empty space, and if room = bedroom then set that status register to 2. Then jump back.
I might be able to find the control routines myself then by looking for references to the joystick address. Then I'll jump elsewhere, and if status = 2 then jump to control = move right.
I can probably shove the (if status = 2) and (if room = bathroom) and (if Willy's X and Y coordinates = whatever) routine that changes the toilet sprites in then.
Any help welcome!