Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
54 | pj | 1 | /* VGAlib version 1.2 - (c) 1993 Tommy Frandsen */ |
2 | /* */ |
||
3 | /* This library is free software; you can redistribute it and/or */ |
||
4 | /* modify it without any restrictions. This library is distributed */ |
||
5 | /* in the hope that it will be useful, but without any warranty. */ |
||
6 | |||
7 | /* Multi-chipset support Copyright 1993 Harm Hanemaayer */ |
||
8 | /* partially copyrighted (C) 1993 by Hartmut Schirmer */ |
||
9 | |||
10 | #include <stdio.h> |
||
11 | #include <string.h> |
||
12 | #include "vga.h" |
||
13 | #include "libvga.h" |
||
14 | #include "driver.h" |
||
15 | |||
16 | int vga_clear(void) |
||
17 | { |
||
18 | vga_screenoff(); |
||
19 | if (MODEX) |
||
20 | goto modeX; |
||
21 | switch (CM) { |
||
22 | case G320x200x256: |
||
23 | case G320x240x256: |
||
24 | case G320x400x256: |
||
25 | case G360x480x256: |
||
26 | case G400x300x256X: |
||
27 | modeX: |
||
28 | |||
29 | /* write to all planes */ |
||
30 | __svgalib_outseq(0x02,0x0f); |
||
31 | |||
32 | /* clear video memory */ |
||
33 | memset(GM, 0, 65536); |
||
34 | break; |
||
35 | |||
36 | default: |
||
37 | switch (CI.colors) { |
||
38 | case 2: |
||
39 | case 16: |
||
40 | vga_setcolor(0); |
||
41 | |||
42 | /* write to all bits */ |
||
43 | __svgalib_outseq(0x08,0xff); |
||
44 | |||
45 | default: |
||
46 | { |
||
47 | int i; |
||
48 | int pages = (CI.ydim * CI.xbytes + 65535) >> 16; |
||
49 | if (__svgalib_modeinfo_linearset & IS_LINEAR ) { |
||
50 | memset(LINEAR_POINTER, 0, pages<<16); |
||
51 | } else { |
||
52 | for (i = 0; i < pages; ++i) { |
||
53 | vga_setpage(i); |
||
54 | /* clear video memory */ |
||
55 | memset(GM, 0, 65536); |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 | break; |
||
60 | } |
||
61 | break; |
||
62 | } |
||
63 | |||
64 | vga_setcolor(15); |
||
65 | vga_screenon(); |
||
66 | |||
67 | return 0; |
||
68 | } |