2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
14 #define mybug(col,var) __asm__ __volatile__("move.l #"#col",0xf9002000+"#var"" :: );
16 #define mybug(col,var)
24 #define rkprintf(x...) scr_RawPutChars(tab, snprintf(tab,126, x))
26 extern unsigned long _end
;
27 extern unsigned long _edata
;
28 extern struct mac68k_init_stuff init_stuff
;
32 void setcursor(unsigned char col
, unsigned char row
);
33 void clearscreen(void);
34 void screen_init(void);
35 void scr_RawPutChars(char *chr
, int lim
);
37 void screen_init(void)
40 init_stuff
.vidaddr
= 0xf9000e00;
41 init_stuff
.vidrow
= 832;
42 init_stuff
.vidwidth
= 832;
43 init_stuff
.vidheight
= 624;
44 init_stuff
.viddepth
= 8;
47 if(init_stuff
.vidaddr
)
51 init_stuff
.chrrows
= init_stuff
.vidheight
/ 10 - 1;
52 init_stuff
.chrcols
= init_stuff
.vidwidth
/ 8 - 1;
53 init_stuff
.currow
= 0;
54 init_stuff
.curcol
= 0;
58 for(j
=0;j
<=init_stuff
.vidheight
;j
++)
60 k
=j
*init_stuff
.vidrow
;
61 for(i
=0;i
<=init_stuff
.vidrow
;i
++)
63 *(volatile unsigned char *)(init_stuff
.vidaddr
+i
+k
) = (unsigned char)i
;
72 unsigned char font_lut2
[16] = {
73 0x00, 0x03, 0x0c, 0x0f,
74 0x30, 0x33, 0x3c, 0x3f,
75 0xc0, 0xc3, 0xcc, 0xcf,
76 0xf0, 0xf3, 0xfc, 0xff
78 unsigned char font_lut4
[4] = {
79 0x00, 0x0f, 0xf0, 0xff
81 unsigned char i
,j
,k
,m
,temp
;
87 temp
= ~(Font6x10
[j
*10+i
]);
89 switch(init_stuff
.viddepth
)
92 init_stuff
.fontbyte
[j
][i
][0] = temp
;
95 init_stuff
.fontbyte
[j
][i
][1] = font_lut2
[temp
&0x0f];
97 init_stuff
.fontbyte
[j
][i
][0] = font_lut2
[temp
&0x0f];
100 init_stuff
.fontbyte
[j
][i
][3] = font_lut4
[temp
&0x03];
102 init_stuff
.fontbyte
[j
][i
][2] = font_lut4
[temp
&0x03];
104 init_stuff
.fontbyte
[j
][i
][1] = font_lut4
[temp
&0x03];
106 init_stuff
.fontbyte
[j
][i
][0] = font_lut4
[temp
&0x03];
109 for(k
=0,m
=7;k
<8;k
++,m
--)
113 init_stuff
.fontbyte
[j
][i
][m
] = 0xff;
117 init_stuff
.fontbyte
[j
][i
][m
] = 0x00;
126 void setcursor(unsigned char col
, unsigned char row
)
128 init_stuff
.curcol
= col
;
129 init_stuff
.currow
= row
;
134 unsigned long caddr
,pixel32
;
136 unsigned short pixel16
;
142 init_stuff
.curcol
= 0;
145 caddr
= init_stuff
.vidaddr
+ (init_stuff
.curcol
*init_stuff
.viddepth
) + (init_stuff
.currow
*10*init_stuff
.vidrow
);
149 switch(init_stuff
.viddepth
)
155 memcpy((unsigned long *)(caddr
), &(init_stuff
.fontbyte
[c
][i
][0]),init_stuff
.viddepth
);
160 temp
= init_stuff
.fontbyte
[c
][i
][m
];
161 pixel16
= ~((0x01<<15)|(temp
<<11)|(temp
<<6)|((0xf1&temp
)>>3));
162 *(volatile unsigned short *)(caddr
+m
*2) = pixel16
;
169 temp
= init_stuff
.fontbyte
[c
][i
][m
];
170 pixel32
= ~(0xff<<24|(temp
<< 16)|(temp
<< 8)|temp
);
172 *(volatile unsigned long *)(caddr
+m
*4) = pixel32
;
178 caddr
+= init_stuff
.vidrow
;
181 if(init_stuff
.curcol
< init_stuff
.chrcols
)
187 init_stuff
.curcol
= 0;
192 void clearscreen(void)
196 for(j
=0;j
<=init_stuff
.vidheight
;j
++)
198 k
=j
*init_stuff
.vidrow
;
199 for(i
=0;i
<=init_stuff
.vidrow
;i
+=4)
201 *(volatile unsigned long *)(init_stuff
.vidaddr
+i
+k
) = (unsigned long)0xffffffff;
206 void scr_RawPutChars(char *chr
, int lim
)
210 for (i
=0; i
<lim
; i
++)
214 #define scc_b_ctrl 0x0
215 #define scc_a_ctrl 0x2
216 #define scc_b_data 0x4
217 #define scc_a_data 0x6
221 unsigned char *sccbase
= (unsigned char *)0x50f0c020;
223 while(0x4 & sccbase
[scc_b_ctrl
]);
225 sccbase
[scc_b_data
] = c
;