Rev 106 | Rev 167 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 106 | Rev 125 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | * This function takes care of scrolling. |
67 | * This function takes care of scrolling. |
68 | */ |
68 | */ |
69 | void ega_check_cursor(void) |
69 | void ega_check_cursor(void) |
70 | { |
70 | { |
71 | if (ega_cursor < SCREEN) |
71 | if (ega_cursor < SCREEN) |
72 | return; |
72 | return; |
73 | 73 | ||
74 | memcopy(PA2KA(VIDEORAM) + ROW*2, PA2KA(VIDEORAM), (SCREEN - ROW)*2); |
74 | memcopy(PA2KA(VIDEORAM) + ROW*2, PA2KA(VIDEORAM), (SCREEN - ROW)*2); |
75 | memsetw(PA2KA(VIDEORAM) + (SCREEN - ROW)*2, ROW, 0x0720); |
75 | memsetw(PA2KA(VIDEORAM) + (SCREEN - ROW)*2, ROW, 0x0720); |
76 | ega_cursor = ega_cursor - ROW; |
76 | ega_cursor = ega_cursor - ROW; |
77 | } |
77 | } |
Line 83... | Line 83... | ||
83 | pri = cpu_priority_high(); |
83 | pri = cpu_priority_high(); |
84 | spinlock_lock(&egalock); |
84 | spinlock_lock(&egalock); |
85 | 85 | ||
86 | switch (ch) { |
86 | switch (ch) { |
87 | case '\n': |
87 | case '\n': |
88 | ega_cursor = (ega_cursor + ROW) - ega_cursor % ROW; |
88 | ega_cursor = (ega_cursor + ROW) - ega_cursor % ROW; |
89 | break; |
89 | break; |
90 | case '\t': |
90 | case '\t': |
91 | ega_cursor = (ega_cursor + 8) - ega_cursor % 8; |
91 | ega_cursor = (ega_cursor + 8) - ega_cursor % 8; |
92 | break; |
92 | break; |
93 | default: |
93 | default: |
94 | ega_display_char(ch); |
94 | ega_display_char(ch); |
95 | ega_cursor++; |
95 | ega_cursor++; |
96 | break; |
96 | break; |
97 | } |
97 | } |
98 | ega_check_cursor(); |
98 | ega_check_cursor(); |
99 | ega_move_cursor(); |
99 | ega_move_cursor(); |
100 | 100 | ||
101 | spinlock_unlock(&egalock); |
101 | spinlock_unlock(&egalock); |
102 | cpu_priority_restore(pri); |
102 | cpu_priority_restore(pri); |
103 | } |
103 | } |
104 | 104 | ||
105 | void ega_move_cursor(void) |
105 | void ega_move_cursor(void) |