Jump to content
Jet Set Willy & Manic Miner Community

Portal Change Idea


Spider

Recommended Posts

I did have an idea the other day and today thought I'd try it. Although I'd made a mistake in my code and it did not work (plus something else, namely I think needing to shuffle a bit of code about) , the idea I thought may of had merit.

 

Two ways of doing it, either set the airbourne counter to #FF and jump back into the main loop or drop into the collision detection "kill" routine. It does seem slightly confusing as to if a POP is needed here to zap the last return address off the stack however.

 

Simply put the idea was : The Portal is fatal on contact unless its active. :)

 

The Kong caverns might be possible if jump and left is held down (not tested!) as M.W will not be in contact with it if he walks left under the earth wall with jump held down, causing him to leap up as soon as possible.

 

Just a passing thought...

Link to comment
Share on other sites

The portal routine as now:-

 

 

 

Used by the routine at 870E. First check whether Willy has entered the portal.
8FC5 LD HL,($80B0) Pick up the address of the portal's location in the attribute buffer at 5C00 from 80B0
8FC8 LD A,($806C) Pick up the LSB of the address of Willy's location in the attribute buffer at 5C00 from 806C
8FCB CP L Does it match that of the portal?
8FCC JR NZ,$8FDF Jump if not
8FCE LD A,($806D) Pick up the MSB of the address of Willy's location in the attribute buffer at 5C00 from 806D
8FD1 CP H Does it match that of the portal?
8FD2 JR NZ,$8FDF Jump if not
8FD4 LD A,($808F) Pick up the portal's attribute byte from 808F
8FD7 BIT 7,A Is the portal flashing?
8FD9 JR Z,$8FDF Jump if not
8FDB POP HL Drop the return address from the stack
8FDC JP $9028 Move Willy to the next cavern
Willy has not entered the portal, or it's not flashing, so just draw it.
8FDF LD A,($808F) Pick up the portal's attribute byte from 808F
8FE2 LD (HL),A Set the attribute bytes for the portal in the buffer at 5C00
8FE3 INC HL
8FE4 LD (HL),A
8FE5 LD DE,$001F
8FE8 ADD HL,DE
8FE9 LD (HL),A
8FEA INC HL
8FEB LD (HL),A
8FEC LD DE,$8090 Point DE at the graphic data for the portal at 8090
8FEF LD HL,($80B2) Pick up the address of the portal's location in the screen buffer at 6000 from 80B2
8FF2 LD C,$00 C=0: overwrite mode
;--------------------------

 

The changed code preceded by -. on each line

 

 

-.8fc5  ld  de,(#80b0) ; portal  address to de
-.8fc8  ld hl,(#806c) ; will att to hl
-.8fcb  or a
-.8fcc  sbc hl,de    ;  a collision sets the zero flag
-.8fce  ex de,hl
-.8fcf  ld a,(#808f)   ;the portal colour
-.8fd2  jr nz,part2
-.8fd4  pop hl  ; we clear the stack
-.8fd5  bit 7,a  ; decide if portal or death
-.8fd7  jp nz,#9028 ; next cavern
-.8fda  jp #8d0f           ; the kill routine
-.8fdd nop       ; spare 5 bytes
-.8fde nop
-.8fdf nop

-.8ff0 nop
-.8fd1 nop

 

part2
8FE2 LD (HL),A Set the attribute bytes for the portal in the buffer at 5C00
8FE3 INC HL
8FE4 LD (HL),A
8FE5 LD DE,$001F
8FE8 ADD HL,DE
8FE9 LD (HL),A
8FEA INC HL
8FEB LD (HL),A
8FEC LD DE,$8090 Point DE at the graphic data for the portal at 8090
8FEF LD HL,($80B2) Pick up the address of the portal's location in the screen buffer at 6000 from 80B2
8FF2 LD C,$00 C=0: overwrite mode

 

 

; the problem that I see with doing this is the vagueness of the collision detection.

 

An outline :- subject to typing errors and miscalculations. plenty of space to fit the code.

Edited by Norman Sword
Link to comment
Share on other sites

Thanks all.

 

What I'd thought of (and just thought not tried that method) was just after the checks for if M.W is in the Portal or not and if its flashing or not, there's code to just draw it. Replacing that with the "Kill" routine might of worked, except the JR is a bit out of range. This would of needed two small jump address changes to ensure the routine jumped after the 'modified section'

 

I see I do not need to do this now, thanks. :D

Link to comment
Share on other sites

I think the check for whether Willy has entered a portal comes before the test for a standonable (or jumpoffable) platform underneath Willy.

 

Otherwise, Willy wouldn't be able to survive falling into the portal in Return of Kong...

Did you mean if he uses the Portal to hide ? :) In theory he could be walking left with jump enabled under the earth cell so should jump the gap and not touch the Portal.

 

As otherwise he'd only enter it when it was flashing at cavern completion ? :unsure:

Link to comment
Share on other sites

Did you mean if he uses the Portal to hide ? :) In theory he could be walking left with jump enabled under the earth cell so should jump the gap and not touch the Portal.

 

As otherwise he'd only enter it when it was flashing at cavern completion ? :unsure:

Can't do that in Manic Miner. If you try to jump over the portal when traversing at the lower level, then Willy doesn't land on the far side, but drops into the portal, and you have to jump back out again. (But with your modification, he would die before he got the chance to jump back out!)

 

You could perform such a jump in JSW, but only when jumping from right to left, not vice versa.

Edited by IRF
Link to comment
Share on other sites

  • 1 month later...

I think this may be something I'd like to implement in one future game project perhaps. Ideally with a warning and maybe some careful cavern design so that the Portal is 'in the way' a bit too, as in not buried in a corner harmlessly ;)

 

The portals in the Kong caverns are unavoidably "in the way" - i.e. it's impossible to collect all the items without passing through the portal en route.  So those layouts would need to be changed, in order to allow you to avoid entering the portal prematurely if it's fatal to do so!

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.