Updated PCI IDs to latest snapshot.
[tangerine.git] / arch / .unmaintained / m68k-pp-native / boot / gfx.c
blob61c4bf02752e0781c21c13d34f8affc7aa2489ca
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <Pilot.h>
8 #include <registers.h>
10 void pause(Long x)
12 Long i = 0,a = 1;
13 while (i < x) {
14 a *=a*a;
15 i++;
19 void drawlinehoriz(int y)
21 Long lssa = RREG_L(LSSA);
22 Long height = RREG_W(LYMAX);
23 Long width = RREG_W(LXMAX)>>3;
24 Long x = 0;
26 if (y < 0 || y >= height)
27 return;
29 while (x <= width) {
30 *(Byte *)(lssa+((width+1)*y)+x) = 0xff;
31 x++;
36 void drawlinevert(int x)
38 Long lssa = RREG_L(LSSA);
39 Long height = RREG_W(LYMAX);
40 Long width = RREG_W(LXMAX);
41 Long y = 0;
43 if (x < 0 || x >= width)
44 return;
45 width >>= 3;
46 while (y < height) {
47 *(Byte *)(lssa+((width+1)*y)+(x>>3)) |= 1<<(7-(x&7));
48 y++;
53 void setpixel(int x, int y)
55 Long lssa = RREG_L(LSSA);
56 Long height = RREG_W(LYMAX);
57 Long width = RREG_W(LXMAX);
59 if (x < 0 || x >= width || y < 0 || y >= height)
60 return;
62 width>>=3;
64 *(Byte *)(lssa+((width+1)*y)+(x>>3)) |= 1<<(7-(x&7));
68 void clearpixel(int x, int y)
70 Long lssa = RREG_L(LSSA);
71 Long height = RREG_W(LYMAX);
72 Long width = RREG_W(LXMAX);
74 if (x < 0 || x >= width || y < 0 || y >= height)
75 return;
77 width>>=3;
79 *(Byte *)(lssa+((width+1)*y)+(x>>3)) &= ~(1<<(7-(x&7)));
83 void clearscreen(int value)
85 Long lssa = RREG_L(LSSA);
86 Long height = RREG_W(LYMAX);
87 Long width = RREG_W(LXMAX)>>3;
88 Long y = 0,x;
90 while (y < height) {
91 x = 0;
92 while (x <= width) {
93 *(Byte *)(lssa+((width+1)*y)+x) = value;
94 x++;
96 y++;
100 void flashscreen(int loop)
102 int i = 0, d;
103 while (i < loop) {
104 clearscreen(0);
105 d = 0;
106 while (d < 10000)
107 d++;
108 clearscreen(255);
109 d = 0;
110 while (d < 10000)
111 d++;
112 i++;
116 void drawcross(void)
118 clearscreen(0);
119 drawlinehoriz(80);
120 drawlinevert(80);
121 pause(100000);
124 void showsuccess(void)
126 Long height = RREG_W(LXMAX);
128 Long c = 0;
129 while (c < height) {
130 drawlinehoriz(c);
131 c++;
132 pause(10000);
134 clearscreen(0);