Personal Computer News


Pixel Packing Amstrad

 
Published in Personal Computer News #078

Pixel Packing Amstrad

Q. When defining characters on my Amstrad, I found that the explanation in the user instructions was not explicit as to the order and magnitude of the numbers for the SYMBOL command. My Amstrad seems to count the rows from top to bottom and columns from right to left.

This means that using the accepted convention of the bottom left cell of a matrix as (1.1), characters come out upside down and the wrong way round. Why is this?

D. Carnaghan
Watford, Herts

A. The answer is simple. Many home computers use an 8 by 8 matrix for characters. The rows of the matrix are numbered from 1 to 8 going downwards. When you want to set a pixel in the matrix, you have to work out its decimal value. This is found by the formula 2^n, where n is the bit position. Bit positions are numbered 0 to 7, from right to left. So, if you wanted alternate bits set on a row, (binary pattern 10101010) you'd convert this to decimal as 2*7 + 2*5 + 2*3 + 2*1 (i.e. 128 + 32 + 8 + 2), giving 170. This would be the value to pass to SYMBOL to define the pixel pattern for a row.

D. Carnaghan