• R/O
  • SSH
  • HTTPS

chnosproject: Commit


Commit MetaInfo

Revisión86 (tree)
Tiempo2010-03-31 20:58:13
Autorhikarupsp

Log Message

ついにスクロールマウス対応!!!

Cambiar Resumen

Diferencia incremental

--- beta/tolset_chn_000/chnos_006/bootpack.c (revision 85)
+++ beta/tolset_chn_000/chnos_006/bootpack.c (revision 86)
@@ -14,6 +14,7 @@
1414 struct SHEET32 *sht_back, *sht_mouse;
1515 struct WINDOWINFO *winfo1;
1616 int fifobuf[256], i = 0,mx = binfo->scrnx / 2, my = binfo->scrny / 2;
17+ int scrool = 0;
1718 volatile int time_tick;
1819 unsigned int all_mem_size = memtest(0x00400000, 0xbffffffff);
1920 unsigned int free_mem_size = 0;
@@ -86,7 +87,7 @@
8687 io_sti();
8788 if (decode_mouse(i) == 1) {
8889 boxfill_i(buf_win, INT_MONITOR_LONG, 0x000000, 0,64,INT_MONITOR_LONG , 80);
89- sprintf(s,"INT 2C(IRQ-12) : PS/2 マウス(%02X,%02X,%02X)",mdec.buf[0], mdec.buf[1], mdec.buf[2]);
90+ sprintf(s,"INT 2C(IRQ-12) : PS/2 マウス(%02X,%02X,%02X,%02X)",mdec.buf[0], mdec.buf[1], mdec.buf[2], mdec.whinfo);
9091 putfonts_asc_i(buf_win, INT_MONITOR_LONG, 0,64,0xffffff,s);
9192 boxfill_i(buf_win, INT_MONITOR_LONG, 0x000000, 0,80,INT_MONITOR_LONG , 96);
9293 sprintf(s,"[lcr %4d %4d]",mdec.x, mdec.y);
@@ -103,7 +104,9 @@
103104
104105 sheet_slide(sht_mouse, mx,my);
105106 boxfill_i(buf_win, INT_MONITOR_LONG, 0x000000, 0,96,INT_MONITOR_LONG,112);
106- sprintf(s,"(%4d,%4d) %X",mx,my,vinfo->PhysBasePtr);
107+ if(mdec.scrool == 0xffffffff) scrool++;
108+ if(mdec.scrool == 0x00000001) scrool--;
109+ sprintf(s,"(%4d,%4d) %d,%X",mx,my,scrool,vinfo->PhysBasePtr,mdec.scrool);
107110 putfonts_asc_i(buf_win, INT_MONITOR_LONG, 0,96,0xffffff,s);
108111 slide_window(winfo1, 0, 0);
109112 }
--- beta/tolset_chn_000/chnos_006/mouse.c (revision 85)
+++ beta/tolset_chn_000/chnos_006/mouse.c (revision 86)
@@ -21,12 +21,18 @@
2121 mdec = mdec0;
2222 mdec->phase = 0;
2323 /* マウスの初期化 */
24+ sendto_mouse(MOUSECMD_ENABLE);
25+ io_out8(PIC1_IMR, io_in8(PIC1_IMR) & 0xef);
26+ return; /*成功すれば、0xfaがマウスからやってくる。*/
27+}
28+
29+void sendto_mouse(int data)
30+{
2431 wait_KBC_sendready();
2532 io_out8(PORT_KEYCMD, KEYCMD_SENDTO_MOUSE);
2633 wait_KBC_sendready();
27- io_out8(KEYB_DATA, MOUSECMD_ENABLE);
28- io_out8(PIC1_IMR, io_in8(PIC1_IMR) & 0xef);
29- return; /*成功すれば、0xfaがマウスからやってくる。*/
34+ io_out8(KEYB_DATA, data);
35+ return;
3036 }
3137
3238 int decode_mouse (unsigned int dat)
@@ -33,7 +39,9 @@
3339 {
3440 switch (mdec->phase){
3541 case 0:
36- if(dat == 0xfa) mdec->phase = 1;
42+ if(dat == 0xfa) mdec->phase = 4;
43+ sendto_mouse(0xf3);
44+ sendto_mouse(200);
3745 break;
3846 case 1:
3947 if((dat & 0xc8) == 0x08) {
@@ -55,6 +63,59 @@
5563 if((mdec->buf[0] & 0x20) != 0) mdec->y |= 0xffffff00;
5664 mdec->y = - mdec->y;
5765 return 1;
66+ case 4:
67+ if(dat == 0xfa) mdec->phase = 5;
68+ sendto_mouse(0xf3);
69+ sendto_mouse(100);
70+ break;
71+ case 5:
72+ if(dat == 0xfa) mdec->phase = 6;
73+ sendto_mouse(0xf3);
74+ sendto_mouse(80);
75+ break;
76+ case 6:
77+ if(dat == 0xfa) mdec->phase = 7;
78+ sendto_mouse(0xf2);
79+ break;
80+ case 7:
81+ if(dat == 0xfa) break;
82+ if(dat == 0x00){
83+ mdec->whinfo = 0x00;
84+ mdec->scrool = 0x00;
85+ mdec->phase = 1;
86+ } else {
87+ mdec->whinfo = dat;
88+ mdec->phase = 8;
89+ }
90+ break;
91+ case 8:
92+ if((dat & 0xc8) == 0x08) {
93+ mdec->buf[0] = dat;
94+ mdec->phase = 9;
95+ }
96+ break;
97+ case 9:
98+ mdec->buf[1] = dat;
99+ mdec->phase = 10;
100+ break;
101+ case 10:
102+ mdec->buf[2] = dat;
103+ mdec->btn = mdec->buf[0];
104+ mdec->x = mdec->buf[1];
105+ mdec->y = mdec->buf[2];
106+ if((mdec->buf[0] & 0x10) != 0) mdec->x |= 0xffffff00;
107+ if((mdec->buf[0] & 0x20) != 0) mdec->y |= 0xffffff00;
108+ mdec->y = - mdec->y;
109+ mdec->phase = 11;
110+ break;
111+ case 11:
112+ mdec->phase = 8;
113+ mdec->buf[3] = dat;
114+ mdec->scrool = mdec->buf[3] & 0x0f;
115+ if(mdec->scrool & 0x08) {
116+ mdec->scrool |= 0xfffffff0;
117+ }
118+ return 1;
58119 }
59120 return -1;
60121 }
--- beta/tolset_chn_000/chnos_006/core.h (revision 85)
+++ beta/tolset_chn_000/chnos_006/core.h (revision 86)
@@ -150,8 +150,8 @@
150150 };
151151
152152 struct MOUSE_DECODE {
153- unsigned int buf[3];
154- int x,y,btn;
153+ unsigned int buf[4],scrool;
154+ int x,y,btn,whinfo;
155155 unsigned char phase;
156156
157157 };
@@ -418,6 +418,7 @@
418418 void inthandler2c(int *esp);
419419 void init_mouse(struct FIFO32 *fifo, int data0, struct MOUSE_DECODE *mdec0);
420420 int decode_mouse (unsigned int dat);
421+void sendto_mouse(int data);
421422
422423
423424 /*timer.c タイマー関係*/
Show on old repository browser