Changes

Speccy Port

613 bytes added, 13:02, 19 January 2020
/* Storage */
A common way to do this is on the Spectrum is to store 1 byte of mask, followed by 1 byte of pixel data, and to repeat this for the width of the sprite divided by 8. (Each byte representing a 8 pixel wide single line slice of the sprite).
If we consider a sprite which is 16x16. Each byte contains 8 pixels. For each line 2 bytes would be needed for pixel data and 2 bytes for mask. The total storage space required would be (2+2)*8 16 = 32 64 bytes.
If we consider mode 1 on the Amstrad, and we used the 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. For each line 4 bytes would be needed for pixel data and 4 for mask: (4+4)*8 16 = 64 128 bytes.
However, if we sacrifice 1 colour, so we have 1 pen which is fully transparent and 3 for opaque sprite colours then we don't need the mask to be stored this way. The mask is common for all sprites and 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 16 = 32 64 bytes. The same weight as the Spectrum.
Mode 2 is generally not used for games on the Amstrad because of it's lack of colour. 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 In this case the data storage is the same as on the Spectrum, and . If we wanted 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 This the same storage sizeas for mode 1. If the size of the sprites were too small, then we would need to increase the size and the storage space.
Therefore, depending on the representation, this would determine how much ram is consumed on the Amstrad.
The best it seems is choices are to go for mode 1, and use a common mask table, with 3 colours per sprite. Here Or use mode 0, use a common mask table, with 15 colours per sprite. In both cases we use 256 bytes more than the Spectrum equivalent graphics.
So we show that some games could be recoloured and still use about the same amount of data as the Spectrum.
 
The above do not consider the size or speed of the code to clip or draw the sprite to the Amstrad's screen compared to the Spectrum code. The values above assume the Spectrum version is not storing pre-shifted sprites, or using a pre-shift table, and when drawing to pixel positions is shifting the pixel data during draw. The comparison becomes more complicated when these are involved.
Examples of games probably ported from the Spectrum (the use a Spectrum sized screen), in mode 1 and recoloured:
2,541
edits