[mouse] block cursor

This commit is contained in:
Kevin Lange 2011-10-30 19:11:04 -05:00
parent 64a4d880be
commit bce5d78bed
3 changed files with 14 additions and 6 deletions

View File

@ -31,12 +31,15 @@ void mouse_handler(struct regs *r) {
if (actual_x > 10230) actual_x = 10230;
if (actual_y < 0) actual_y = 0;
if (actual_y > 7670) actual_y = 7670;
uint32_t color = 0x00FF00;
if (mouse_byte[0] & 0x01) color = 0xFF00FF;
bochs_draw_line(previous_x / 10, actual_x / 10, 767 - (previous_y / 10), 767 - (actual_y / 10), color);
#if 0
kprintf("[mouse] %d %d %x\n", (uint32_t)actual_x, (uint32_t)actual_y, (uint32_t)mouse_byte[0]);
#endif
uint32_t color = 0x444444;
if (mouse_byte[0] & 0x01) color = 0xFF0000;
if (mouse_byte[0] & 0x02) color = 0x0000FF;
int c_x = (int)(previous_x / 10 / 8);
int c_y = (int)((7670 - previous_y) / 10 / 12);
int b_x = (int)(actual_x / 10 / 8);
int b_y = (int)((7670 - actual_y) / 10 / 12);
bochs_redraw_cell(c_x,c_y);
bochs_fill_rect(b_x * 8, b_y * 12,8,12,color);
break;
}
}

View File

@ -646,3 +646,7 @@ bochs_set_cell(int x, int y, char c) {
cell_set(x, y, c, current_fg, current_bg, 0);
cell_redraw(x, y);
}
void bochs_redraw_cell(int x, int y) {
cell_redraw(x,y);
}

View File

@ -295,6 +295,7 @@ extern int bochs_get_width();
extern int bochs_get_height();
extern void bochs_set_cell(int x, int y, char c);
extern uintptr_t bochs_get_address();
extern void bochs_redraw_cell(int x, int y);
/* ANSI Terminal Escape Processor */
void ansi_put(char c);