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: 7017
Author: ian.rushforth
Date: 11/01/2017
Subject: Re: Pixel patterns for cells in MM with 'undefined' colour-attribute
Andrew wrote:
> I'm not sure about JSW64's policy of using the Cell-Class 1 pixel- pattern for disassociated colour-attributes. > Manic Miner uses seemingly random pixel-patterns - my guess is that it runs through memory (even > after the cell-class definitions) looking for the first occurrence of the colour-attribute, and using the
> next 8 bytes as the pixel-pattern.
Close, but no cigar!
If the CPIR loop in the 'Draw the current cavern' routine comes to an end without having found a matching attribute byte (or, via the Cell-Graphics Bug, a matching graphic byte), then HL will have been incremented to point at #8068 (the address that immediately follows after the last graphic byte of the final cell-type in the cell table). By default, the next eight bytes (#8068-#806F) are interpreted as graphic bytes for all cells in the cavern whose attribute bytes didn't generate a match.
So the pixel-pattern of all 'unmatched' cells in a particular cavern are identical, even if you have more than one 'undefined' colour-attribute placed within the layout. You can see that if you hack 'The Final Barrier' (POKE 25502, 201) to prevent the top-third of the screen from being overwritten. [N.B. Although there are a few instances of cells taht appear to break this rule by having different non-standard pixel-patterns, that's because their particular attribute bytes cause the Cell-Graphics Bug to occur, and the pixel-patterns in question can be found within the cell table.]
However, if you have two caverns which each contain cells with undefined colour-attributes, the pixel patterns displayed may be different, if the values stored at #8068-#806F are different for the two caverns.
Finally, close scrutiny of the hacked 'Final Barrier' has confirmed that the first seven pixel-rows for the cells with non-matching attributes correspond to the seven bytes (#8068-#806E) which define Willy's state upon entry to the cavern (his coordinates, frame of animation, etc).
Whilst the eighth and final pixel-row, with a value taken from #806F, corresponds to the direction byte of the conveyor for the cavern.
