Changes

Speccy Port

1,608 bytes added, 13:01, 1 October 2012
/* Graphics with transparency */
If we consider a sprite which is 16x16. Each byte contains 8 pixels. 2 bytes would be needed for pixel data and 2 bytes for mask. The total storage space required would be (2+2)*8 = 32 bytes.
Now, if the same representation was used If we consider mode 1 on the Amstrad, and mode 1 was we usedthe same representation, we could freely use 4 colours for the sprites. The Amstrad would also need 2 times the ram space to store the data, because in mode 1 there is half the number of pixels per byte.
So, each byte contains 4 pixels. 4 bytes would be needed for pixel data and 4 for mask: (4+4)*8 = 64 bytes.
However, if we sacrific sacrifice 1 colour, so we have 1 pen for transparency which is fully transparent and 3 for opaque sprite colours, then we don't need the maskto be stored this way. The mask is common for all spritesand we could store this as a single 256 byte array. We would still need 4 bytes for the pixel data but the result now is: 4*8 = 32 bytes. The same weight as the Spectrum. Mode 2 is generally not used for games on the Amstrad. The pixels in this mode are half as wide as the Spectrum's. If the Spectrum data was used directly, which it could be, then the sprites would be half the width of the Spectrum's. We would still be forced to store mask and pixels the same as on the Spectrum, and to maintain the same resolution we would need to double up each pixel, effectively magnifying it in the width by 2. The result would be twice the size of the Spectrum data. If mode 0 is used, we could either store a mask and byte, as for the Spectrum, or more commonly we use pen 0 for full transparent and leave the other 15 pens to define the sprite. We could then use half the number of pixels horizontally and lower resolution too. Each byte now contains 2 pixels. The sprite is 8x16 now = (8/2)*16 = 64 bytes. So again twice the size.
Therefore, depending on the representation, this would determine how much ram is consumed on the Amstrad.
 
The best it seems is to go for mode 1, and use a common mask table, with 3 colours per sprite.
 
The situation is different if you consider tiles, here we don't need a mask.
 
For the spectrum a 8x16 tile: (8/8)x16 = 16 bytes.
CPC mode 1: (8/4)x16 = 32 bytes
CPC mode 0: (4/2)x16 = 32 bytes
CPC mode 2: (8/8)x16 = 16 bytes
 
Examples of games probably ported from the Spectrum (the use a Spectrum sized screen), in mode 1 and recoloured:
* HeroQuest
* Head over Heels
* Shadow of the Beast
 
So we show that some games could be recoloured and still use about the same amount of data as the Spectrum.
=====Real-Time Conversion of Spectrum graphics=====
2,541
edits