mirror of
https://github.com/yourtion/30dayMakeOS.git
synced 2026-02-06 03:23:21 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2fc0dc0f5 | ||
|
|
e4a94836dd |
@@ -124,7 +124,7 @@ void HariMain(void)
|
||||
|
||||
for (;;) {
|
||||
if (fifo32_status(&keycmd) > 0 && keycmd_wait < 0) {
|
||||
/* <EFBFBD>L<EFBFBD>[<5B>{<7B>[<5B>h<EFBFBD>R<EFBFBD><52><EFBFBD>g<EFBFBD><67><EFBFBD>[<5B><><EFBFBD>ɑ<EFBFBD><C991><EFBFBD>f<EFBFBD>[<5B>^<5E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<CE81><41><EFBFBD><EFBFBD> */
|
||||
/* 如果存在向键盘控制器发送的数据,则发送它 */
|
||||
keycmd_wait = fifo32_get(&keycmd);
|
||||
wait_KBC_sendready();
|
||||
io_out8(PORT_KEYDAT, keycmd_wait);
|
||||
|
||||
@@ -15,7 +15,7 @@ void HariMain(void)
|
||||
char s[40];
|
||||
struct FIFO32 fifo, keycmd;
|
||||
int fifobuf[128], keycmd_buf[32], *cons_fifo[2];
|
||||
int mx, my, i;
|
||||
int mx, my, i, new_mx = -1, new_my = 0, new_wx = 0x7fffffff, new_wy = 0;
|
||||
unsigned int memtotal;
|
||||
struct MOUSE_DEC mdec;
|
||||
struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR;
|
||||
@@ -124,15 +124,26 @@ void HariMain(void)
|
||||
|
||||
for (;;) {
|
||||
if (fifo32_status(&keycmd) > 0 && keycmd_wait < 0) {
|
||||
/* <EFBFBD>L<EFBFBD>[<5B>{<7B>[<5B>h<EFBFBD>R<EFBFBD><52><EFBFBD>g<EFBFBD><67><EFBFBD>[<5B><><EFBFBD>ɑ<EFBFBD><C991><EFBFBD>f<EFBFBD>[<5B>^<5E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<CE81><41><EFBFBD><EFBFBD> */
|
||||
/* 如果存在向键盘控制器发送的数据,则发送它 */
|
||||
keycmd_wait = fifo32_get(&keycmd);
|
||||
wait_KBC_sendready();
|
||||
io_out8(PORT_KEYDAT, keycmd_wait);
|
||||
}
|
||||
io_cli();
|
||||
if (fifo32_status(&fifo) == 0) {
|
||||
task_sleep(task_a);
|
||||
io_sti();
|
||||
/* FIFO为空,当存在搁置的绘图操作时立即执行*/
|
||||
if (new_mx >= 0) {
|
||||
io_sti();
|
||||
sheet_slide(sht_mouse, new_mx, new_my);
|
||||
new_mx = -1;
|
||||
} else if (new_wx != 0x7fffffff) {
|
||||
io_sti();
|
||||
sheet_slide(sht, new_wx, new_wy);
|
||||
new_wx = 0x7fffffff;
|
||||
} else {
|
||||
task_sleep(task_a);
|
||||
io_sti();
|
||||
}
|
||||
} else {
|
||||
i = fifo32_get(&fifo);
|
||||
io_sti();
|
||||
@@ -232,7 +243,8 @@ void HariMain(void)
|
||||
if (my > binfo->scrny - 1) {
|
||||
my = binfo->scrny - 1;
|
||||
}
|
||||
sheet_slide(sht_mouse, mx, my);/* 包含sheet_refresh含sheet_refresh */
|
||||
new_mx = mx;
|
||||
new_my = my;
|
||||
if ((mdec.btn & 0x01) != 0) { /* 按下左键 */
|
||||
if (mmx < 0) {
|
||||
/*如果处于通常模式*/
|
||||
@@ -253,6 +265,7 @@ void HariMain(void)
|
||||
mmx = mx; /*进入窗口移动模式*/
|
||||
mmy = my;
|
||||
mmx2 = sht->vx0;
|
||||
new_wy = sht->vy0;
|
||||
}
|
||||
if (sht->bxsize - 21 <= x && x < sht->bxsize - 5 && 5 <= y && y < 19) {
|
||||
/*点击“×”按钮*/
|
||||
@@ -271,14 +284,19 @@ void HariMain(void)
|
||||
}
|
||||
} else {
|
||||
/*如果处于窗口移动模式*/
|
||||
x = mx - mmx; /*计算鼠标的移动距离*/
|
||||
x = mx - mmx; /*计算鼠标指针移动量*/
|
||||
y = my - mmy;
|
||||
sheet_slide(sht, (mmx2 + x + 2) & ~3, sht->vy0 + y);
|
||||
mmy = my; /*更新到移动后的坐标*/
|
||||
new_wx = (mmx2 + x + 2) & ~3;
|
||||
new_wy = new_wy + y;
|
||||
mmy = my;
|
||||
}
|
||||
} else {
|
||||
/*没有按下左键*/
|
||||
mmx = -1; /*返回通常模式*/
|
||||
mmx = -1; /*切换到一般模式*/
|
||||
if (new_wx != 0x7fffffff) {
|
||||
sheet_slide(sht, new_wx, new_wy); /*固定图层位置*/
|
||||
new_wx = 0x7fffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user