Tuesday, April 25, 2023

📚 The SCREEN modes

ModeWidth
X Height
(Pixels)
Columns
X Rows
(Characters)
Screen
Aspect
Font
Height
Colour
Mode
Bits
Per
Pixel
0640 X 20080 X 252.48p164
1320 X 20040 X 251.28p42
2640 X 20080 X 252.48p21
7320 X 20040 X 251.28p164
8640 X 20080 X 252.48p164
9640 X 35080 X 25480/35014p164
10640 X 35080 X 25480/35014p21
11640 X 48080 X 30116p21
12640 X 48080 X 30116p164
13320 X 20040 X 251.28p2568
14320 X 20040 X 2518p2568
15320 X 20040 X 252.48p2568
16320 X 20040 X 251.216p2568
17320 X 20040 X 25116p2568
23640 X 40080 X 251.28pRGB24
24640 X 40080 X 2518pRGB24
25640 X 40080 X 252.48pRGB24
26640 X 40080 X 251.216pRGB24
27640 X 40080 X 25116pRGB24
ModeNumber
of
Colour
Attributes
Bits
Per
Pixel
p221
p442
p16164
p25625616
pRGBundefined24
  • Note: p2, p4, p16 and p256: references to colour attributes allow "Colour attribute looping".

About Colour Attribute Looping

In BASIC Anywhere Machine, when working with colour modes that have colour attributes, we normally refer to those attributes as attributes zero to whatever maximum for that colour mode. (For example, attributes 0 to 15 in colour mode p16.)

When we refer to attributes with numbers outside of the range, BASIC Anywhere Machine loops around (treating the list of attributes like a circle.) So in colour mode p16, attribute 16 means attribute 0, and attribute 17 means attribute 1.

The same works in the other direction. In colour mode p16, attribute -1 means attribute 15, and attribute -2 means attribute 14.

The following statements and functions have been tested to make sure that works:

  • COLOR
  • CIRCLE
  • LINE
  • PAING
  • PSET
p2 colours

0Black
1White

p4 colours

IDRGB Colour Value
0
███RGB(0, 0, 0)
███RGB(0, 0, 0)
1
███RGB(0, 170, 170)
███RGB(0, 170, 170)
2
███RGB(170, 0, 170)
███RGB(170, 0, 170)
3
███RGB(170, 170, 170)
███RGB(170, 170, 170)

p16 colours

IDRGB Colour Value
0
███RGB(0, 0, 0)
███RGB(0, 0, 0)
1
███RGB(0, 0, 170)
███RGB(0, 0, 170)
2
███RGB(0, 170, 0)
███RGB(0, 170, 0)
3
███RGB(0, 170, 170)
███RGB(0, 170, 170)
4
███RGB(170, 0, 0)
███RGB(170, 0, 0)
5
███RGB(170, 0, 170)
███RGB(170, 0, 170)
6
███RGB(170, 85, 0)
███RGB(170, 85, 0)
7
███RGB(170, 170, 170)
███RGB(170, 170, 170)
8
███RGB(85, 85, 85)
███RGB(85, 85, 85)
9
███RGB(85, 85, 255)
███RGB(85, 85, 255)
10
███RGB(85, 255, 85)
███RGB(85, 255, 85)
11
███RGB(85, 255, 255)
███RGB(85, 255, 255)
12
███RGB(255, 85, 85)
███RGB(255, 85, 85)
13
███RGB(255, 85, 255)
███RGB(255, 85, 255)
14
███RGB(255, 255, 85)
███RGB(255, 255, 85)
15
███RGB(255, 255, 255)
███RGB(255, 255, 255)

p256 colours

The BASIC Anywhere Machine default colours match "EGA" colours for attributes 0 to 63.

Attributes 64-254 are set to black, and attribute 255 is set to white.

IDRGB Colour Value
0
███RGB(0, 0, 0)
███RGB(0, 0, 0)
1
███RGB(0, 0, 170)
███RGB(0, 0, 170)
2
███RGB(0, 170, 0)
███RGB(0, 170, 0)
3
███RGB(0, 170, 170)
███RGB(0, 170, 170)
4
███RGB(170, 0, 0)
███RGB(170, 0, 0)
5
███RGB(170, 0, 170)
███RGB(170, 0, 170)
6
███RGB(170, 170, 0)
███RGB(170, 170, 0)
7
███RGB(170, 170, 170)
███RGB(170, 170, 170)
8
███RGB(0, 0, 85)
███RGB(0, 0, 85)
9
███RGB(0, 0, 255)
███RGB(0, 0, 255)
10
███RGB(0, 170, 85)
███RGB(0, 170, 85)
11
███RGB(0, 170, 255)
███RGB(0, 170, 255)
12
███RGB(170, 0, 85)
███RGB(170, 0, 85)
13
███RGB(170, 0, 255)
███RGB(170, 0, 255)
14
███RGB(170, 170, 85)
███RGB(170, 170, 85)
15
███RGB(170, 170, 255)
███RGB(170, 170, 255)
16
███RGB(0, 85, 0)
███RGB(0, 85, 0)
17
███RGB(0, 85, 170)
███RGB(0, 85, 170)
18
███RGB(0, 255, 0)
███RGB(0, 255, 0)
19
███RGB(0, 255, 170)
███RGB(0, 255, 170)
20
███RGB(170, 85, 0)
███RGB(170, 85, 0)
21
███RGB(170, 85, 170)
███RGB(170, 85, 170)
22
███RGB(170, 255, 0)
███RGB(170, 255, 0)
23
███RGB(170, 255, 170)
███RGB(170, 255, 170)
24
███RGB(0, 85, 85)
███RGB(0, 85, 85)
25
███RGB(0, 85, 255)
███RGB(0, 85, 255)
26
███RGB(0, 255, 85)
███RGB(0, 255, 85)
27
███RGB(0, 255, 255)
███RGB(0, 255, 255)
28
███RGB(170, 85, 85)
███RGB(170, 85, 85)
29
███RGB(170, 85, 255)
███RGB(170, 85, 255)
30
███RGB(170, 255, 85)
███RGB(170, 255, 85)
31
███RGB(170, 255, 255)
███RGB(170, 255, 255)
32
███RGB(85, 0, 0)
███RGB(85, 0, 0)
33
███RGB(85, 0, 170)
███RGB(85, 0, 170)
34
███RGB(85, 170, 0)
███RGB(85, 170, 0)
35
███RGB(85, 170, 170)
███RGB(85, 170, 170)
36
███RGB(255, 0, 0)
███RGB(255, 0, 0)
37
███RGB(255, 0, 170)
███RGB(255, 0, 170)
38
███RGB(255, 170, 0)
███RGB(255, 170, 0)
39
███RGB(255, 170, 170)
███RGB(255, 170, 170)
40
███RGB(85, 0, 85)
███RGB(85, 0, 85)
41
███RGB(85, 0, 255)
███RGB(85, 0, 255)
42
███RGB(85, 170, 85)
███RGB(85, 170, 85)
43
███RGB(85, 170, 255)
███RGB(85, 170, 255)
44
███RGB(255, 0, 85)
███RGB(255, 0, 85)
45
███RGB(255, 0, 255)
███RGB(255, 0, 255)
46
███RGB(255, 170, 85)
███RGB(255, 170, 85)
47
███RGB(255, 170, 255)
███RGB(255, 170, 255)
48
███RGB(85, 85, 0)
███RGB(85, 85, 0)
49
███RGB(85, 85, 170)
███RGB(85, 85, 170)
50
███RGB(85, 255, 0)
███RGB(85, 255, 0)
51
███RGB(85, 255, 170)
███RGB(85, 255, 170)
52
███RGB(255, 85, 0)
███RGB(255, 85, 0)
53
███RGB(255, 85, 170)
███RGB(255, 85, 170)
54
███RGB(255, 255, 0)
███RGB(255, 255, 0)
55
███RGB(255, 255, 170)
███RGB(255, 255, 170)
56
███RGB(85, 85, 85)
███RGB(85, 85, 85)
57
███RGB(85, 85, 255)
███RGB(85, 85, 255)
58
███RGB(85, 255, 85)
███RGB(85, 255, 85)
59
███RGB(85, 255, 255)
███RGB(85, 255, 255)
60
███RGB(255, 85, 85)
███RGB(255, 85, 85)
61
███RGB(255, 85, 255)
███RGB(255, 85, 255)
62
███RGB(255, 255, 85)
███RGB(255, 255, 85)
63
███RGB(255, 255, 255)
███RGB(255, 255, 255)

pRGB colours

Well, maybe this should be called "Full RGB Range", as in the 16,777,216 colours that span the RGB colour model.

To specify a colour when in a screen mode that has the "undefined" colour scheme, this requires specifying the colour number with math related to RGB.

Each of the R, G, and B, values range from 0 to 255.

  • color = R * (256 ^ 2) + G * (256 ^ 1) + B * (256 ^ 0)
  • or: color = R * (256 ^ 2) + G * (256 ^ 1) + B * (256 ^ 0)



No comments:

Post a Comment

🖥 Pongy game

This program is a port (and slight mod) of the QB64pe program by SierraKen.  (SierraKen's program shared with the QB64pe community in th...