-
Notifications
You must be signed in to change notification settings - Fork 0
/
cga.bas
63 lines (48 loc) · 1.69 KB
/
cga.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
1 REM CGA COLOR PALETTES
2 REM SETS FIRST 16 COLORS TO FULL 4-BIT CGA PALETTE
3 REM SETS PALETTE OFFSETS (PO) 1-6 TO CORRESPONDING CGA 2-BIT PALETTES
4 REM SETS PO 7-10 TO MODE 5 GREEN AND AMBER MONOCHROME EMULATION
5 REM ALL COLORS ABOVE PO+3 ARE TRANSPARENT/BLACK IN EACH 2-BIT PO
9 REM 4-BIT PALETTE
10 DATA $000,$00A,$0A0,$0AA
20 DATA $A00,$A0A,$A50,$AAA
30 DATA $555,$55F,$5F5,$5FF
40 DATA $F55,$F5F,$FF5,$FFF
98 REM 2-BIT PALETTES
99 REM MODE 4, PALETTE 0, LOW INTENSITY
100 DATA $000,$0A0,$A00,$A50
199 REM MODE 4, PALETTE 0, HIGH INTENSITY
200 DATA $000,$5F5,$F55,$FF5
299 REM MODE 4, PALETTE 1, LOW INTENSITY
300 DATA $000,$0AA,$A0A,$AAA
399 REM MODE 4, PALETTE 1, HIGH INTENSITY
400 DATA $000,$5FF,$F5F,$FFF
499 REM MODE 5, LOW INTENSITY, COLOR
500 DATA $000,$0AA,$A00,$AAA
499 REM MODE 5, HIGH INTENSITY, COLOR
600 DATA $000,$5FF,$F55,$FFF
599 REM MODE 5, LOW INTENSITY, GREEN
700 DATA $000,$030,$070,$0A0
799 REM MODE 5, HIGH INTENSITY, GREEN
800 DATA $000,$050,$0A0,$0F0
899 REM MODE 5, LOW INTENSITY, AMBER
900 DATA $000,$740,$A61,$A93
999 REM MODE 5, HIGH INTENSITY, AMBER
1000 DATA $000,$C60,$FA1,$FF5
1099 REM MAP ALL TO 8-BIT PALETTE
1100 DIM C(255)
1200 FOR I=0 TO 19: READ C(I): NEXT I
1300 FOR I=32 TO 35: READ C(I): NEXT I
1400 FOR I=48 TO 51: READ C(I): NEXT I
1500 FOR I=64 TO 67: READ C(I): NEXT I
1600 FOR I=80 TO 83: READ C(I): NEXT I
1700 FOR I=96 TO 99: READ C(I): NEXT I
1800 FOR I=112 TO 115: READ C(I): NEXT I
1900 FOR I=128 TO 131: READ C(I): NEXT I
2000 FOR I=144 TO 147: READ C(I): NEXT I
2100 FOR I=160 TO 163: READ C(I): NEXT I
2999 REM WRITE TO VRAM PALETTE
3000 FOR I=0 TO 255
3100 VPOKE $F,$1000+I*2,C(I) AND $FF
3200 VPOKE $F,$1000+I*2+1,(C(I) AND $F00) / $100
3300 NEXT I