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: 2106

Author: andrewbroad

Date: 12/03/2001

Subject: Non-white arrows/Willy

 

More FAQ material...

Yesterday, I managed
to get coloured arrows in JSW:

POKE 37512,
i
{0 <= i <= 7}

It's the operand of an OR
mask. The default value is of course 7 (111), which
means that arrows always appear white.

However,
if you set it to i < 7, then the arrow colour can
be contaminated as it passes through things with
non-black ink (including background), because the INK
colour of the thing it is drawn on is bitwise-ORed with
the mask i - it's an OR mask, rather than the INK
colour.

For example, if i = 0 (000), then the arrow has black
ink if it is drawn over black ink, but it gets its
INK colour from the character square it is drawn over
(effectively, you can specify the colour of arrows for each
room by setting the background INK).

This
discovery raises the prospect of scary invisible arrows,
too, which with the unhacked JSW game engine could
only happen in white-paper rooms :->

I
haven't tried i > 7, but I imagine that would extend
to the rest of the colour attribute (FBPPPIII) in
the obvious way.

Note that this POKE does not
affect the colour of the objects with which arrows
collide (still white), just the colour they appear
as.

It's just like having black Willy - Willy could be any
of the 8 colours, but his colour could be
contaminated because it's an OR mask (in the case of black
Willy, it's an AND mask instead - to reset rather than
set the bits). The solution for INK 1-6 Willy or
arrows without such contamination would be to have an
AND mask followed by an OR mask, to clear the ink
colour and then set it directly, but it's very fiddly as
it would involve code motion to insert the extra
instruction.

--
Andrew
Broad
http://www.cs.man.ac.uk/~broada/ target=new>http://www.cs.man.ac.uk/~broada/>
http://www.cs.man.ac.uk/~broada/spectrum/ target=new>http://www.cs.man.ac.uk/~broada/spectrum/>
http://www.cs.man.ac.uk/~broada/spectrum/willy/ target=new>http://www.cs.man.ac.uk/~broada/spectrum/willy/>

 

 

arrowleft
arrowright