Spider Posted May 8, 2020 Report Share Posted May 8, 2020 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... jetsetdanny 1 Quote Link to comment Share on other sites More sharing options...
IRF Posted May 8, 2020 Report Share Posted May 8, 2020 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... Spider and jetsetdanny 2 Quote Link to comment Share on other sites More sharing options...
Norman Sword Posted May 8, 2020 Report Share Posted May 8, 2020 (edited) 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 80B08FC8 LD A,($806C) Pick up the LSB of the address of Willy's location in the attribute buffer at 5C00 from 806C8FCB CP L Does it match that of the portal?8FCC JR NZ,$8FDF Jump if not8FCE LD A,($806D) Pick up the MSB of the address of Willy's location in the attribute buffer at 5C00 from 806D8FD1 CP H Does it match that of the portal?8FD2 JR NZ,$8FDF Jump if not8FD4 LD A,($808F) Pick up the portal's attribute byte from 808F8FD7 BIT 7,A Is the portal flashing?8FD9 JR Z,$8FDF Jump if not8FDB POP HL Drop the return address from the stack8FDC JP $9028 Move Willy to the next cavernWilly 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 808F8FE2 LD (HL),A Set the attribute bytes for the portal in the buffer at 5C008FE3 INC HL8FE4 LD (HL),A8FE5 LD DE,$001F8FE8 ADD HL,DE8FE9 LD (HL),A8FEA INC HL8FEB LD (HL),A8FEC LD DE,$8090 Point DE at the graphic data for the portal at 80908FEF LD HL,($80B2) Pick up the address of the portal's location in the screen buffer at 6000 from 80B28FF2 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 part28FE2 LD (HL),A Set the attribute bytes for the portal in the buffer at 5C008FE3 INC HL8FE4 LD (HL),A8FE5 LD DE,$001F8FE8 ADD HL,DE8FE9 LD (HL),A8FEA INC HL8FEB LD (HL),A8FEC LD DE,$8090 Point DE at the graphic data for the portal at 80908FEF LD HL,($80B2) Pick up the address of the portal's location in the screen buffer at 6000 from 80B28FF2 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 May 8, 2020 by Norman Sword Spider, IRF and jetsetdanny 3 Quote Link to comment Share on other sites More sharing options...
andrewbroad Posted May 8, 2020 Report Share Posted May 8, 2020 JSW64 Trigger Stopper Guardian Item Portal... :ph34r: jetsetdanny, Spider and IRF 3 Quote Link to comment Share on other sites More sharing options...
Spider Posted May 9, 2020 Author Report Share Posted May 9, 2020 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 Quote Link to comment Share on other sites More sharing options...
Spider Posted May 9, 2020 Author Report Share Posted May 9, 2020 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: Quote Link to comment Share on other sites More sharing options...
IRF Posted May 9, 2020 Report Share Posted May 9, 2020 (edited) 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 July 3, 2020 by IRF Spider and jetsetdanny 2 Quote Link to comment Share on other sites More sharing options...
Spider Posted May 9, 2020 Author Report Share Posted May 9, 2020 I'd not tested it. :) I suppose a tiny bit of cavern tweaking would allow it to happen but I do see what you're saying now. Quote Link to comment Share on other sites More sharing options...
Spider Posted July 2, 2020 Author Report Share Posted July 2, 2020 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 ;) IRF 1 Quote Link to comment Share on other sites More sharing options...
IRF Posted July 3, 2020 Report Share Posted July 3, 2020 (edited) 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 July 3, 2020 by IRF Spider and jetsetdanny 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.