Resource centre for ZX Spectrum games
using Manic Miner and Jet Set Willy game engines
Archive of the
Manic Miner & Jet Set Willy Yahoo! Group
messages
|
|
||
|
|
Message: 5478
Author: john_elliott_uk
Date: 08/02/2006
Subject: Solar Power
--- In manicminerandjetsetwilly@yahoogroups.com, dm_boozefreek
> Will it
Looking into it, it seems to be rather an easy patch vector. I don't
> ever be possible to have multiple solars without causing massive
> problems?
know what game variant you're using, but I conducted this experiment
with variant V.
The following code, in a patch vector, will add another solar beam:
LD HL,pos ; Beam start position, in the range 5C00h-5DFFh
LD DE,20h ; Initial beam direction: 20h for down, 0FFh for left.
; 0FFh for left. Other values will give other weird
; results - in particular, 01h starts off going right
; but if deflected it goes diagonal, and FFE0h starts
; off going up.
CALL 8721h ; Draw the beam
RET
(in hex, this is 21 xx 5x 11 20 00 CD 21 87 C9 )
To have multiple beams, repeat the sequence for each beam. Only the
last one should have the C9 at the end. You'll need to have the room's
normal solar beam turned on or the other one(s) won't be drawn.
With hindsight, I should really have done solar rays as guardians,
so that all the tuneable parameters (position, direction, deflection)
could have been part of the guardian definition. Have to bear that in
mind for next time.
> Also I'd like to know are solars made to only go left?
In stock MM and JSW64, yes. It's possible to change this globally,
or by having your patch vector switch it over at run time. The
following sequence makes all solar rays go right:
3e 21 32 46 87 3e 00 32 49 87
and this one makes them go left again:
3e df 32 46 87 3e 2f 32 49 87
> I don't recall seeing one ever go right?
Andrew's mirrored MM has one that does, which is done by patching
the game engine.
So, here's a worked example, in variant V, dealing with the Bathroom.
1. Go to the hex editor.
2. Go to C300h in bank 3; this corresponds to the Bathroom.
Type the following byte sequence:
3e 21 32 46 87 3e 00 32 49 87 -- beams go right
21 04 5c 11 20 00 cd 21 87 -- draw second beam
3e df 32 36 87 3e 2f 32 49 87 -- beams go left
c9 -- end of patch vector
3. Go to C2FDh and change the next two bytes to 00 81; this sets your
code as the patch vector for the room.
4. Press Ctrl+W. Then go to the room editor and place the normal solar
power somewhere in the room.
5. Playtest. If all goes well you should have a Bathroom with two
solar rays, one going right and one going left.
6. By playing with the room layout, it's possible to have the two
beams cross; this causes one beam to deflect the other, and makes the
air go down very fast.
7. I think different colour beams are possible, using the same sort of
dynamic patching that allows left- and right- facing beams in the same
room. But I've not researched the question.
