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: 4079
Author: andrewbroad
Date: 16/04/2004
Subject: Re: Changing Willy's colour
carlwoffenden wrote:
>This doesn't actually change Willy's colour, but rather the OR-mask
> During my disassembling I've stumbled upon this: poking 38445 in
> JSW, or 37486 in MM (Bug Byte edition) changes Willy's colour
> attributes.
> It's from this code:
>
> LD A, (#80A0) ; bkgnd block (#8020 in MM)
> OR #07 ; set the ink to white
> LD (HL), A
>
> Pointless but now I can have a purple Willy.
which is applied to the background INK-colour to generate Willy's
colour.
With an OR-mask of 7 (binary 111), this makes Willy always white.
But with an OR-mask of 3 (binary 011), this makes Willy either
magenta (if the background INK is black 000, blue 001, red 010 or
magenta 011) or white (if the background INK is green 100, cyan 101,
yellow 101 or white 111).
With POKE 37486,3 in MM (Bug-Byte), check out "Solar Power
Generator" for a white Willy. "Eugene's Lair" kills you on entry
because Willy now has the same colour-attribute as the second static
nasty.
With POKE 38445,3 in JSW, Willy is white in, for example, "Cold
Store" and "Swimming Pool".
To change Willy's colour properly, you could insert an AND 0
instruction (to make Willy black) before OR x, where x is Willy's
INK-colour, which would of course entail code-motion to accommodate
this insertion.
A coloured Willy cannot collect items. To rectify this in JSW, POKE
37872,x makes items collect themselves when they're drawn on a
square of colour-attribute x:
AND 7
CP x
Try visiting "Swimming Pool" with POKE 38445,3 and POKE 37872,3 and
see what happens! And check out the magenta saw collecting items for
you in "West Wing Roof"!
Arrows cannot collide with a coloured Willy. POKE 37504,x makes
arrows collide with x-INK pixels (regardless of whether they are
Willy's pixels):
AND 7
CP x
One of Geoff Eddy's patch-vectors recolours Willy at the end of a
time-frame (after the collision-detection), giving the illusion of a
non-white Willy without the above concerns.
http://www.cix.co.uk/~morven/jsw/patches.html
--
Dr. Andrew Broad
http://www.geocities.com/andrewbroad/
http://www.geocities.com/andrewbroad/spectrum/
http://www.geocities.com/andrewbroad/spectrum/willy/
