87 |
} |
} |
88 |
if (change.what.screen_cur_line) |
if (change.what.screen_cur_line) |
89 |
{ |
{ |
|
off_t size = vcons->state.screen.width |
|
|
* vcons->state.screen.lines; |
|
|
off_t vis_start; |
|
90 |
uint32_t new_cur_line; |
uint32_t new_cur_line; |
|
int scrolling; |
|
|
off_t start; |
|
|
off_t end; |
|
91 |
|
|
92 |
new_cur_line = vcons->display->screen.cur_line; |
new_cur_line = vcons->display->screen.cur_line; |
93 |
scrolling = new_cur_line - vcons->state.screen.cur_line; |
if (new_cur_line != vcons->state.screen.cur_line) |
94 |
if (scrolling < 0) |
{ |
95 |
scrolling += vcons->state.screen.lines; |
off_t size = vcons->state.screen.width |
96 |
cons_vcons_scroll (vcons, scrolling); |
* vcons->state.screen.lines; |
97 |
vis_start = vcons->state.screen.width * new_cur_line; |
off_t vis_start; |
98 |
start = ((new_cur_line + vcons->state.screen.height |
uint32_t scrolling; |
99 |
- scrolling) * vcons->state.screen.width) % size; |
off_t start; |
100 |
end = start + scrolling * vcons->state.screen.width - 1; |
off_t end; |
101 |
cons_vcons_write (vcons, vcons->state.screen.matrix + start, |
|
102 |
end < size |
if (new_cur_line > vcons->state.screen.cur_line) |
103 |
? end - start + 1 |
scrolling = new_cur_line |
104 |
: size - start, |
- vcons->state.screen.cur_line; |
105 |
(start - vis_start) |
else |
106 |
% vcons->state.screen.width, |
scrolling = UINT32_MAX - vcons->state.screen.cur_line |
107 |
(start - vis_start) |
+ 1 + new_cur_line; |
108 |
/ vcons->state.screen.width); |
if (scrolling > vcons->state.screen.height) |
109 |
if (end >= size) |
scrolling = vcons->state.screen.height; |
110 |
cons_vcons_write (vcons, |
if (scrolling < vcons->state.screen.height) |
111 |
vcons->state.screen.matrix, |
cons_vcons_scroll (vcons, scrolling); |
112 |
end - size + 1, |
vis_start = vcons->state.screen.width |
113 |
(size - vis_start) |
* (new_cur_line % vcons->state.screen.lines); |
114 |
% vcons->state.screen.width, |
start = (((new_cur_line % vcons->state.screen.lines) |
115 |
(size - vis_start) |
+ vcons->state.screen.height - scrolling) |
116 |
/ vcons->state.screen.width); |
* vcons->state.screen.width) % size; |
117 |
cons_vcons_update (vcons); |
end = start + scrolling * vcons->state.screen.width - 1; |
118 |
vcons->state.screen.cur_line = new_cur_line; |
cons_vcons_write (vcons, |
119 |
|
vcons->state.screen.matrix + start, |
120 |
|
end < size |
121 |
|
? end - start + 1 |
122 |
|
: size - start, |
123 |
|
0, vcons->state.screen.height |
124 |
|
- scrolling); |
125 |
|
if (end >= size) |
126 |
|
cons_vcons_write (vcons, |
127 |
|
vcons->state.screen.matrix, |
128 |
|
end - size + 1, |
129 |
|
0, (size - vis_start) |
130 |
|
/ vcons->state.screen.width); |
131 |
|
cons_vcons_update (vcons); |
132 |
|
vcons->state.screen.cur_line = new_cur_line; |
133 |
|
} |
134 |
} |
} |
135 |
if (change.what.screen_scr_lines) |
if (change.what.screen_scr_lines) |
136 |
{ |
{ |
161 |
/* For clipping. */ |
/* For clipping. */ |
162 |
off_t size = vcons->state.screen.width*vcons->state.screen.lines; |
off_t size = vcons->state.screen.width*vcons->state.screen.lines; |
163 |
off_t rotate = vcons->state.screen.width |
off_t rotate = vcons->state.screen.width |
164 |
* vcons->state.screen.cur_line; |
* (vcons->state.screen.cur_line % vcons->state.screen.lines); |
165 |
off_t vis_end = vcons->state.screen.height |
off_t vis_end = vcons->state.screen.height |
166 |
* vcons->state.screen.width - 1; |
* vcons->state.screen.width - 1; |
167 |
off_t end2 = -1; |
off_t end2 = -1; |