• R/O
  • SSH
  • HTTPS

chnosproject: コミット


コミットメタ情報

リビジョン314 (tree)
日時2012-02-23 18:42:23
作者hikarupsp

ログメッセージ

シートの8bitカラーはほとんど完成した。
タイマ機能も、ほぼ完成した。
タスク管理はある程度進んだ。
FIFOデータ受信時のタスク自動起動も行われるようになっている。
Bochsで、キー操作途中から動かなくなるのは、メインタスクのFIFOがあふれているためだと判明。
タイマーをすべて切れば解決すると思われる。ウィンドウ移動に時間がかかるのが原因。
ウィンドウ移動専用タスクの作成の必要があるかもしれない。

変更サマリ

差分

--- beta/tolset_chn_000/chnos_010/chnos/sheet.c (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/sheet.c (revision 314)
@@ -171,7 +171,10 @@
171171 {
172172 UI_Sheet **search;
173173 uint i;
174+ bool no_change_height;
174175
176+ no_change_height = False;
177+
175178 if(sheet == Null){
176179 #ifdef CHNOSPROJECT_DEBUG_SHEET
177180 debug("Sheet_Show:Null sheet.\n");
@@ -191,6 +194,9 @@
191194 }
192195 return 2;
193196 }
197+ if(sheet->flags.bit.visible == True){
198+ return 3;
199+ }
194200
195201 //At First, clear old height link.
196202
@@ -197,6 +203,10 @@
197203 search = &sheet->parent->child;
198204 for(i = 0; i < SHEET_MAX_CHILDREN; i++){
199205 if(*search == sheet){
206+ if(i == height){
207+ no_change_height = True;
208+ break;
209+ }
200210 *search = sheet->next;
201211 break;
202212 }
@@ -204,46 +214,42 @@
204214 }
205215
206216 //Next, set new height link.
207- search = &sheet->parent->child;
208- for(i = 0; i < SHEET_MAX_CHILDREN; i++){
209- if(i == height){
210- #ifdef CHNOSPROJECT_DEBUG_SHEET
211- debug("Sheet_Show:Search:Break(height).\n");
212- #endif
213- break;
217+ if(!no_change_height){
218+ search = &sheet->parent->child;
219+ for(i = 0; i < SHEET_MAX_CHILDREN; i++){
220+ if(i == height){
221+ #ifdef CHNOSPROJECT_DEBUG_SHEET
222+ debug("Sheet_Show:Search:Break(height).\n");
223+ #endif
224+ break;
225+ }
226+ if(*search == Null){
227+ #ifdef CHNOSPROJECT_DEBUG_SHEET
228+ debug("Sheet_Show:Search:Break(End of link).\n");
229+ #endif
230+ break;
231+ }
232+ search = &(*search)->next;
214233 }
215- if(*search == Null){
234+ if(i == SHEET_MAX_CHILDREN){
216235 #ifdef CHNOSPROJECT_DEBUG_SHEET
217- debug("Sheet_Show:Search:Break(End of link).\n");
236+ debug("Sheet_Show:Number of sheets is over SHEET_MAX_CHILDREN.\n");
218237 #endif
219- break;
238+ return 3;
220239 }
221- search = &(*search)->next;
240+
241+ sheet->next = *search;
242+ *search = sheet;
222243 }
223- if(i == SHEET_MAX_CHILDREN){
224- #ifdef CHNOSPROJECT_DEBUG_SHEET
225- debug("Sheet_Show:Number of sheets is over SHEET_MAX_CHILDREN.\n");
226- #endif
227- return 3;
244+
245+ if(px != SHEET_LOCATION_NOCHANGE){
246+ sheet->location.x = px;
228247 }
229-
230- sheet->next = *search;
231- *search = sheet;
232-
248+ if(py != SHEET_LOCATION_NOCHANGE){
249+ sheet->location.y = px;
250+ }
233251 sheet->flags.bit.visible = True;
234- if(px != SHEET_LOCATION_NOCHANGE && py != SHEET_LOCATION_NOCHANGE){
235- Sheet_Slide_Absolute(sheet, px, py);
236- } else{
237- if(px != SHEET_LOCATION_NOCHANGE){
238- Sheet_Slide_Absolute(sheet, px, sheet->location.y);
239- }
240- if(py != SHEET_LOCATION_NOCHANGE){
241- Sheet_Slide_Absolute(sheet, sheet->location.x, py);
242- }
243- if(px == SHEET_LOCATION_NOCHANGE && py == SHEET_LOCATION_NOCHANGE){
244- Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + sheet->size.x - 1, sheet->location.y + sheet->size.y - 1, False);
245- }
246- }
252+ Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + sheet->size.x - 1, sheet->location.y + sheet->size.y - 1, False);
247253
248254 Sheet_RefreshSheet_All(sheet);
249255
@@ -283,18 +289,8 @@
283289 return 0;
284290 }
285291
286- sheet->flags.bit.visible = False;
287- Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + (int)sheet->size.x - 1, sheet->location.y + (int)sheet->size.y - 1, True);
288- Sheet_RefreshAllInRange(sheet->parent, sheet->location.x, sheet->location.y, sheet->location.x + (int)sheet->size.x - 1, sheet->location.y + (int)sheet->size.y - 1);
292+ retv = Sheet_Internal_SlideSub(sheet, apx - sheet->location.x, apy - sheet->location.y);
289293
290- sheet->location.x = apx;
291- sheet->location.y = apy;
292-
293- sheet->flags.bit.visible = True;
294- Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + (int)sheet->size.x - 1, sheet->location.y + (int)sheet->size.y - 1, False);
295-
296- retv = Sheet_RefreshSheet_All(sheet);
297-
298294 if(retv != 0){
299295 return retv + 2;
300296 }
@@ -326,19 +322,8 @@
326322 return 0;
327323 }
328324
329- sheet->flags.bit.visible = False;
325+ retv = Sheet_Internal_SlideSub(sheet, rpx, rpy);
330326
331- Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + (int)sheet->size.x - 1, sheet->location.y + (int)sheet->size.y - 1, True);
332- Sheet_RefreshAllInRange(sheet->parent, sheet->location.x, sheet->location.y, sheet->location.x + (int)sheet->size.x - 1, sheet->location.y + (int)sheet->size.y - 1);
333-
334- sheet->location.x += rpx;
335- sheet->location.y += rpy;
336-
337- sheet->flags.bit.visible = True;
338- Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + (int)sheet->size.x - 1, sheet->location.y + (int)sheet->size.y - 1, False);
339-
340- retv = Sheet_RefreshSheet_All(sheet);
341-
342327 if(retv != 0){
343328 return retv + 2;
344329 }
--- beta/tolset_chn_000/chnos_010/chnos/shtfunc.c (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/shtfunc.c (revision 314)
@@ -134,11 +134,11 @@
134134 if(p.y < 0){
135135 p.y = 0;
136136 }
137- if(r.x >= sheet->parent->size.x){
138- r.x = sheet->parent->size.x - 1;
137+ if(r.x >= (int)sheet->parent->size.x){
138+ r.x = (int)sheet->parent->size.x - 1;
139139 }
140- if(r.y >= sheet->parent->size.y){
141- r.y = sheet->parent->size.y - 1;
140+ if(r.y >= (int)sheet->parent->size.y){
141+ r.y = (int)sheet->parent->size.y - 1;
142142 }
143143
144144 if(force){
@@ -201,11 +201,11 @@
201201 if(p.y < 0){
202202 p.y = 0;
203203 }
204- if(r.x >= sheet->parent->size.x){
205- r.x = sheet->parent->size.x - 1;
204+ if(r.x >= (int)sheet->parent->size.x){
205+ r.x = (int)sheet->parent->size.x - 1;
206206 }
207- if(r.y >= sheet->parent->size.y){
208- r.y = sheet->parent->size.y - 1;
207+ if(r.y >= (int)sheet->parent->size.y){
208+ r.y = (int)sheet->parent->size.y - 1;
209209 }
210210
211211 if(force){
@@ -346,11 +346,11 @@
346346 if(py0 < 0){
347347 py0 = 0;
348348 }
349- if(px1 >= sheet->parent->size.x){
350- px1 = sheet->parent->size.x - 1;
349+ if(px1 >= (int)sheet->parent->size.x){
350+ px1 = (int)sheet->parent->size.x - 1;
351351 }
352- if(py1 >= sheet->parent->size.y){
353- py1 = sheet->parent->size.y - 1;
352+ if(py1 >= (int)sheet->parent->size.y){
353+ py1 = (int)sheet->parent->size.y - 1;
354354 }
355355
356356 if(!nolocationchanged){
@@ -432,11 +432,11 @@
432432 if(p.y < 0){
433433 p.y = 0;
434434 }
435- if(r.x >= sheet->parent->size.x){
436- r.x = sheet->parent->size.x - 1;
435+ if(r.x >= (int)sheet->parent->size.x){
436+ r.x = (int)sheet->parent->size.x - 1;
437437 }
438- if(r.y >= sheet->parent->size.y){
439- r.y = sheet->parent->size.y - 1;
438+ if(r.y >= (int)sheet->parent->size.y){
439+ r.y = (int)sheet->parent->size.y - 1;
440440 }
441441
442442 for(y = p.y; y <= r.y; y++){
@@ -450,3 +450,174 @@
450450 return 0;
451451 }
452452
453+//uint Sheet_Internal_SlideSub(UI_Sheet *sheet, int rpx, int rpy);
454+//slide高速化サブ関数。シートの座標も変更する。引数は、移動量を示す符号あり整数。
455+uint Sheet_Internal_SlideSub(UI_Sheet *sheet, int rpx, int rpy)
456+{
457+ int xsize, ysize;
458+ DATA_Location2D A, B;
459+ int apx, apy;
460+
461+ xsize = (int)sheet->size.x;
462+ ysize = (int)sheet->size.y;
463+
464+ if(rpx < 0){
465+ apx = -rpx;
466+ } else{
467+ apx = rpx;
468+ }
469+
470+ if(rpy < 0){
471+ apy = -rpy;
472+ } else{
473+ apy = rpy;
474+ }
475+
476+ sheet->flags.bit.visible = False;
477+
478+ if(apx >= xsize || apy >= ysize){
479+ Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + xsize - 1, sheet->location.y + ysize - 1, True);
480+ Sheet_RefreshAllInRange(sheet->parent, sheet->location.x, sheet->location.y, sheet->location.x + xsize - 1, sheet->location.y + ysize - 1);
481+ sheet->location.x += rpx;
482+ sheet->location.y += rpy;
483+ sheet->flags.bit.visible = True;
484+ Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + xsize - 1, sheet->location.y + ysize - 1, False);
485+
486+ Sheet_RefreshSheet_All(sheet);
487+ return 0;
488+ }
489+
490+ if(rpx == 0){
491+ //x方向に移動しない
492+ if(rpy < 0){
493+ //yの負の方向に移動=上方向
494+ A.x = sheet->location.x;
495+ A.y = sheet->location.y + ysize - apy;
496+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
497+ Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
498+ sheet->location.x += rpx;
499+ sheet->location.y += rpy;
500+ sheet->flags.bit.visible = True;
501+ A.y -= ysize;
502+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
503+ } else if(rpy > 0){
504+ //yの正の方向に移動=下方向
505+ A.x = sheet->location.x;
506+ A.y = sheet->location.y;
507+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
508+ Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
509+ sheet->location.x += rpx;
510+ sheet->location.y += rpy;
511+ sheet->flags.bit.visible = True;
512+ A.y += ysize;
513+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
514+ } else{
515+ //y方向にも移動しない=そのまま
516+ sheet->flags.bit.visible = True;
517+ }
518+ } else if(rpx < 0){
519+ //xの負の方向に移動
520+ if(rpy < 0){
521+ //yの負の方向に移動=左上方向
522+ A.x = sheet->location.x;
523+ A.y = sheet->location.y + ysize - apy;
524+ B.x = sheet->location.x + xsize - apx;
525+ B.y = sheet->location.y;
526+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
527+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, True);
528+ Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
529+ Sheet_RefreshAllInRange(sheet->parent, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
530+ sheet->location.x += rpx;
531+ sheet->location.y += rpy;
532+ sheet->flags.bit.visible = True;
533+ A.x -= apx;
534+ A.y -= ysize;
535+ B.x -= xsize;
536+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
537+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, False);
538+ } else if(rpy > 0){
539+ //yの正の方向に移動=左下方向
540+ A.x = sheet->location.x;
541+ A.y = sheet->location.y;
542+ B.x = sheet->location.x + xsize - apx;
543+ B.y = sheet->location.y + apy;
544+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
545+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, True);
546+ Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
547+ Sheet_RefreshAllInRange(sheet->parent, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
548+ sheet->location.x += rpx;
549+ sheet->location.y += rpy;
550+ sheet->flags.bit.visible = True;
551+ A.x -= apx;
552+ A.y += ysize;
553+ B.x -= xsize;
554+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
555+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, False);
556+ } else{
557+ //y方向に移動しない=左方向
558+ A.x = sheet->location.x + xsize - apx;
559+ A.y = sheet->location.y;
560+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1, True);
561+ Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + apx - 1, A.y + ysize - 1);
562+ sheet->location.x += rpx;
563+ sheet->location.y += rpy;
564+ sheet->flags.bit.visible = True;
565+ A.x -= xsize;
566+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1, False);
567+ }
568+ } else{
569+ //xの正の方向に移動
570+ if(rpy < 0){
571+ //yの負の方向に移動=右上方向
572+ A.x = sheet->location.x;
573+ A.y = sheet->location.y + ysize - apy;
574+ B.x = sheet->location.x;
575+ B.y = sheet->location.y;
576+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
577+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, True);
578+ Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
579+ Sheet_RefreshAllInRange(sheet->parent, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
580+ sheet->location.x += rpx;
581+ sheet->location.y += rpy;
582+ sheet->flags.bit.visible = True;
583+ A.x += apx;
584+ A.y -= ysize;
585+ B.x += xsize;
586+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
587+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, False);
588+ } else if(rpy > 0){
589+ //yの正の方向に移動=右下方向
590+ A.x = sheet->location.x;
591+ A.y = sheet->location.y;
592+ B.x = sheet->location.x;
593+ B.y = sheet->location.y + apy;
594+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, True);
595+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, True);
596+ Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + xsize - 1, A.y + apy - 1);
597+ Sheet_RefreshAllInRange(sheet->parent, B.x, B.y, B.x + apx - 1, B.y + ysize - apy);
598+ sheet->location.x += rpx;
599+ sheet->location.y += rpy;
600+ sheet->flags.bit.visible = True;
601+ A.x += apx;
602+ A.y += ysize;
603+ B.x += xsize;
604+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + xsize - 1, A.y + apy - 1, False);
605+ Sheet_Internal_MapRefresh(sheet, B.x, B.y, B.x + apx - 1, B.y + ysize - apy, False);
606+ } else{
607+ //y方向に移動しない=右方向
608+ A.x = sheet->location.x;
609+ A.y = sheet->location.y;
610+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1, True);
611+ Sheet_RefreshAllInRange(sheet->parent, A.x, A.y, A.x + apx - 1, A.y + ysize - 1);
612+ sheet->location.x += rpx;
613+ sheet->location.y += rpy;
614+ sheet->flags.bit.visible = True;
615+ A.x += xsize;
616+ Sheet_Internal_MapRefresh(sheet, A.x, A.y, A.x + apx - 1, A.y + ysize - 1, False);
617+ }
618+ }
619+
620+ Sheet_RefreshSheet_All(sheet);
621+ return 0;
622+}
623+
--- beta/tolset_chn_000/chnos_010/chnos/mtask.c (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/mtask.c (revision 314)
@@ -17,6 +17,8 @@
1717 ctrl->start = maintask;
1818 ctrl->now = maintask;
1919
20+ maintask->flags.linked = True;
21+
2022 return ctrl;
2123 }
2224
@@ -77,7 +79,8 @@
7779 task->next = 0;
7880 task->count = 0;
7981
80- task->fifo = FIFO32_Initialise(ctrl->sysmemctrl, 128);
82+ task->fifo = FIFO32_Initialise(ctrl->sysmemctrl, TASK_FIFOSIZE);
83+ FIFO32_Set_Task(task->fifo, task);
8184
8285 task->flags.initialized = True;
8386 task->flags.linked = False;
@@ -87,23 +90,45 @@
8790
8891 void MultiTask_Task_Run(UI_TaskControl *ctrl, UI_Task *task)
8992 {
90- UI_Task *last;
93+ UI_Task **last;
9194
92- for(last = ctrl->start; last->next != 0; last = last->next){
93- if(last == task){ /*すでにタスク実行リンクに入っていたら*/
95+ #ifdef CHNOSPROJECT_DEBUG_MULTITASK
96+ debug("MultiTask_Task_Run:Start Running Rq(sel:0x%X).\n", task->selector);
97+ #endif
98+
99+ if(task->flags.linked){
100+ #ifdef CHNOSPROJECT_DEBUG_MULTITASK
101+ debug("MultiTask_Task_Run:Task has already been running(sel:0x%X).\n", task->selector);
102+ #endif
103+ return;
104+ }
105+
106+ for(last = &ctrl->start; ; last = &(*last)->next){
107+ if(*last == task){
108+ #ifdef CHNOSPROJECT_DEBUG_MULTITASK
109+ debug("MultiTask_Task_Run:Task has already been running2(sel:0x%X).\n", task->selector);
110+ #endif
94111 return;
95112 }
113+ if(*last == Null){
114+ break;
115+ }
96116 }
97117
98- task->next = 0;
99- last->next = task;
118+ #ifdef CHNOSPROJECT_DEBUG_MULTITASK
119+ debug("MultiTask_Task_Run:Start Running(sel:0x%X last:0x%X start:0x%X).\n", task->selector, last, ctrl->start);
120+ #endif
121+
122+ task->next = Null;
123+ *last = task;
100124 task->flags.linked = True;
125+
101126 return;
102127 }
103128
104129 void MultiTask_TaskSwitch(UI_TaskControl *ctrl)
105130 {
106- if(ctrl->now->next == 0){ //タスクリンクの終端
131+ if(ctrl->now->next == Null){ //タスクリンクの終端
107132 if(ctrl->start != ctrl->now){ //同一タスクでなければタスクスイッチ
108133 ctrl->now = ctrl->start;
109134 ctrl->now->count++;
@@ -123,15 +148,29 @@
123148
124149 uint eflags;
125150
126- for(find = &ctrl->start; (*find) != 0; find = &(*find)->next){
151+ if(task == ctrl->now && task == ctrl->start){
152+ eflags = IO_Load_EFlags();
153+ IO_STIHLT();
154+ IO_Store_EFlags(eflags);
155+ return;
156+ }
157+
158+ for(find = &ctrl->start; (*find) != Null; find = &(*find)->next){
127159 if(*find == task){ /*タスク実行リンクからみつけたら*/
128160 break;
129161 }
130162 }
131163 if((*find) == 0){ /*見つけたのでなく、終端だったら*/
164+ #ifdef CHNOSPROJECT_DEBUG_MULTITASK
165+ debug("MultiTask_Task_Sleep:Task sleep Failed(sel:0x%X).\n", task->selector);
166+ #endif
132167 return;
133168 }
134169
170+ #ifdef CHNOSPROJECT_DEBUG_MULTITASK
171+ debug("MultiTask_Task_Sleep:Task sleep (sel:0x%X).\n", task->selector);
172+ #endif
173+
135174 eflags = IO_Load_EFlags();
136175 IO_CLI();
137176
--- beta/tolset_chn_000/chnos_010/chnos/error.c (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/error.c (revision 314)
@@ -218,6 +218,10 @@
218218 {
219219 uint i;
220220
221+ IO_SegmentDescriptor *gdt;
222+
223+ gdt = (IO_SegmentDescriptor *)0x00270000;
224+
221225 Error_Put_String("#PUSHAD by _asm_CPU_ExceptionHandler");
222226 for(i = 0; i < 4; i++){
223227 Error_Put_String("%s:0x%08X %s:0x%08X", cpu_exception_infos[i << 1], esp[i << 1], cpu_exception_infos[(i << 1) + 1], esp[(i << 1) + 1]);
@@ -228,7 +232,7 @@
228232 Error_Put_String("%s:0x%08X %s:0x%08X", cpu_exception_infos[i << 1], esp[i << 1], cpu_exception_infos[(i << 1) + 1], esp[(i << 1) + 1]);
229233 }
230234
231- Error_Put_String("#PUSH by CPU\n");
235+ Error_Put_String("#PUSH by CPU");
232236 for(; i < 8; i++){
233237 Error_Put_String("%s:0x%08X %s:0x%08X", cpu_exception_infos[i << 1], esp[i << 1], cpu_exception_infos[(i << 1) + 1], esp[(i << 1) + 1]);
234238 }
@@ -239,7 +243,7 @@
239243 Error_Put_String("CR3 = 0x%08X", Load_CR3());
240244 Error_Put_String("CR4 = 0x%08X", Load_CR4());
241245
242- Error_Put_String("Opcode[0x%X]:0x%X", esp[0x0b], ((uchar *)(esp[0x0b]))[0]);
246+ Error_Put_String("Opcode[0x%X:0x%X]:0x%X", SegmentDescriptor_Get_Base(&gdt[esp[0x0c] >> 3]), esp[0x0b], ((uchar *)(SegmentDescriptor_Get_Base(&gdt[esp[0x0c] >> 3])))[esp[0x0b]]);
243247 return;
244248 }
245249
@@ -247,6 +251,10 @@
247251 {
248252 uint i;
249253
254+ IO_SegmentDescriptor *gdt;
255+
256+ gdt = (IO_SegmentDescriptor *)0x00270000;
257+
250258 Error_Put_String("#PUSHAD by _asm_CPU_ExceptionHandler");
251259 for(i = 0; i < 4; i++){
252260 Error_Put_String("%s:0x%08X %s:0x%08X", cpu_exception_infos[i << 1], esp[i << 1], cpu_exception_infos[(i << 1) + 1], esp[(i << 1) + 1]);
@@ -268,5 +276,7 @@
268276 Error_Put_String("CR0 = 0x%08X", Load_CR0());
269277 Error_Put_String("CR2 = 0x%08X", Load_CR2());
270278 Error_Put_String("CR3 = 0x%08X", Load_CR3());
279+
280+ Error_Put_String("Opcode[0x%X:0x%X]:0x%X", SegmentDescriptor_Get_Base(&gdt[esp[0x0b] >> 3]), esp[0x0a], ((uchar *)(SegmentDescriptor_Get_Base(&gdt[esp[0x0b] >> 3])))[esp[0x0a]]);
271281 return;
272282 }
--- beta/tolset_chn_000/chnos_010/chnos/core.h (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/core.h (revision 314)
@@ -160,6 +160,7 @@
160160 DATA_FIFO32 *FIFO32_Initialise(IO_MemoryControl memctrl, uint size);
161161 int FIFO32_Put(DATA_FIFO32 *fifo, uint data);
162162 int FIFO32_Put_Arguments(DATA_FIFO32 *fifo, uint args, ...);
163+void FIFO32_Set_Task(DATA_FIFO32 *fifo, UI_Task *task);
163164 uint FIFO32_Get(DATA_FIFO32 *fifo);
164165 uint FIFO32_Status(DATA_FIFO32 *fifo);
165166 void FIFO32_Free(DATA_FIFO32 *fifo);
@@ -231,6 +232,7 @@
231232 uint Sheet_Internal_MapRebuild(UI_Sheet *parent, int px0, int py0, int px1, int py1);
232233 uint Sheet_Internal_MapRefresh(UI_Sheet *sheet, int px0, int py0, int px1, int py1, bool nolocationchanged);
233234 uint Sheet_Internal_RefreshSheet(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
235+uint Sheet_Internal_SlideSub(UI_Sheet *sheet, int rpx, int rpy);
234236
235237 /*system.c システムデータ・初期化関連*/
236238 void Initialise_System(void);
@@ -258,10 +260,15 @@
258260 IO_DisplayControl *System_Display_Get_Controller(void);
259261
260262 /*timer.c タイマー関連*/
261-void Initialise_ProgrammableIntervalTimer(void);
263+UI_TimerControl *Initialise_ProgrammableIntervalTimer(void);
262264 void InterruptHandler20(uint *esp);
263265 void Timer_Set_TaskSwitch(void (*TaskSwitchFunction)(void));
264266 void Timer_TaskSwitch_Invalid(void);
267+UI_Timer *Timer_Initialise(void);
268+uint Timer_Config(UI_Timer *timer, uint tick_ms, DATA_FIFO32 *fifo, uint fifo_putdata, bool interval);
269+uint Timer_Run(UI_Timer *timer);
270+uint Timer_TimeOut(void);
271+uint Timer_GetTick(void);
265272
266273 /*vgatmode.c VGAテキストモード関連*/
267274 uchar VGA_CRTController_ReadRegister(uchar regno);
--- beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 314)
@@ -12,6 +12,8 @@
1212 IO_DisplayControl *disp_ctrl;
1313 UI_Sheet *vramsheet, *testsheet, *testsheet2, *sheet_desktop;
1414 int x, y;
15+ UI_Timer *timer1, *timer2, *timer3;
16+ uint counter1, counter2, counter3;
1517
1618 Initialise_System();
1719
@@ -44,7 +46,7 @@
4446
4547 for(;;){
4648 if(FIFO32_MyTaskFIFO_Status() == 0){
47-
49+ System_MultiTask_Task_Sleep(mytask);
4850 } else{
4951 data = FIFO32_MyTaskFIFO_Get();
5052 if(MAIN_KEYBASE <= data && data <= (MAIN_KEYBASE + 0xFFFF)){
@@ -97,8 +99,8 @@
9799 sheet_desktop = Sheet_Initialise();
98100
99101 Sheet_SetBuffer(vramsheet, disp_ctrl->vram, disp_ctrl->xsize, disp_ctrl->ysize, disp_ctrl->bpp);
100- Sheet_SetBuffer(testsheet, System_Memory_Allocate(128 * 64 * 1), 128, 64, 8);
101- Sheet_SetBuffer(testsheet2, System_Memory_Allocate(160 * 100 * 1), 160, 100, 8);
102+ Sheet_SetBuffer(testsheet, System_Memory_Allocate(256 * 128 * 1), 256, 128, 8);
103+ Sheet_SetBuffer(testsheet2, System_Memory_Allocate(128 * 64 * 1), 128, 64, 8);
102104 Sheet_SetBuffer(sheet_desktop, System_Memory_Allocate(disp_ctrl->xsize * disp_ctrl->ysize * (disp_ctrl->bpp >> 3)), disp_ctrl->xsize, disp_ctrl->ysize, disp_ctrl->bpp);
103105
104106 for(y = 0; y < disp_ctrl->ysize; y++){
@@ -112,11 +114,14 @@
112114 ((uchar*)testsheet->vram)[y * testsheet->size.x + x] = x * 2;
113115 }
114116 }
117+ Drawing08_Fill_Rectangle(testsheet->vram, testsheet->size.x, 0xc6c6c6, 4, 24, testsheet->size.x - 4 - 1, testsheet->size.y - 4 - 1);
118+
115119 for(y = 0; y < testsheet2->size.y; y++){
116120 for(x = 0; x < testsheet2->size.x; x++){
117121 ((uchar*)testsheet2->vram)[y * testsheet2->size.x + x] = y * 2 + x;
118122 }
119123 }
124+ Drawing08_Fill_Rectangle(testsheet2->vram, testsheet2->size.x, 0xc6c6c6, 4, 24, testsheet2->size.x - 4 - 1, testsheet2->size.y - 4 - 1);
120125
121126 Drawing08_Put_String(testsheet->vram, testsheet->size.x, 4, 4, 0xffffff, "TestSheet");
122127 Drawing08_Put_String(testsheet2->vram, testsheet2->size.x, 4, 4, 0xffffff, "TestSheet2");
@@ -128,11 +133,26 @@
128133 Sheet_Show(testsheet, 1, 10, 10);
129134
130135 Sheet_SetParent(testsheet2, vramsheet);
131- Sheet_Show(testsheet2, 2, 20, 20);
136+ Sheet_Show(testsheet2, 2, 80, 80);
132137
138+ timer1 = Timer_Initialise();
139+ Timer_Config(timer1, 50, mytask->fifo, 11, True);
140+ counter1 = 0;
141+ Timer_Run(timer1);
142+
143+ timer2 = Timer_Initialise();
144+ Timer_Config(timer2, 50, mytask->fifo, 12, False);
145+ counter2 = 0;
146+ Timer_Run(timer2);
147+
148+ timer3 = Timer_Initialise();
149+ Timer_Config(timer3, 200, mytask->fifo, 13, True);
150+ counter3 = 0;
151+ Timer_Run(timer3);
152+
133153 for(;;){
134154 if(FIFO32_MyTaskFIFO_Status() == 0){
135-
155+ System_MultiTask_Task_Sleep(mytask);
136156 } else{
137157 data = FIFO32_MyTaskFIFO_Get();
138158 if(MAIN_KEYBASE <= data && data <= (MAIN_KEYBASE + 0xFFFF)){
@@ -139,17 +159,54 @@
139159 data -= MAIN_KEYBASE;
140160 if(!(data & KEYID_MASK_BREAK) && (data & KEYID_MASK_EXTENDED)){
141161 if((data & KEYID_MASK_ID) == KEYID_CURSOR_U){
142- Sheet_Slide_Relative(testsheet, 0, -5);
162+ if(data & KEYID_MASK_STATE_SHIFT){
163+ Sheet_Slide_Relative(testsheet, 5, -5);
164+ } else{
165+ Sheet_Slide_Relative(testsheet, 0, -5);
166+ }
143167 } else if((data & KEYID_MASK_ID) == KEYID_CURSOR_D){
144- Sheet_Slide_Relative(testsheet, 0, 5);
168+ if(data & KEYID_MASK_STATE_SHIFT){
169+ Sheet_Slide_Relative(testsheet, -5, 5);
170+ } else{
171+ Sheet_Slide_Relative(testsheet, 0, 5);
172+ }
145173 } else if((data & KEYID_MASK_ID) == KEYID_CURSOR_L){
146- Sheet_Slide_Relative(testsheet, -5, 0);
174+ if(data & KEYID_MASK_STATE_SHIFT){
175+ Sheet_Slide_Relative(testsheet, -5, -5);
176+ } else{
177+ Sheet_Slide_Relative(testsheet, -5, 0);
178+ }
147179 } else if((data & KEYID_MASK_ID) == KEYID_CURSOR_R){
148- Sheet_Slide_Relative(testsheet, 5, 0);
180+ if(data & KEYID_MASK_STATE_SHIFT){
181+ Sheet_Slide_Relative(testsheet, 5, 5);
182+ } else{
183+ Sheet_Slide_Relative(testsheet, 5, 0);
184+ }
149185 } else if((data & KEYID_MASK_ID) == KEYID_ENTER){
150186 Sheet_Slide_Absolute(testsheet, disp_ctrl->xsize >> 1, disp_ctrl->ysize >> 1);
151187 }
152188 }
189+ } else if(data == 11){
190+ Drawing08_Fill_Rectangle(testsheet->vram, testsheet->size.x, 0xc6c6c6, 8, 24, 8 + (20 * 8) - 1, 24 + (16 * 2) - 1);
191+ snprintf(s, sizeof(s), "Tick :%d", Timer_GetTick());
192+ Drawing08_Put_String(testsheet->vram, testsheet->size.x, 8, 24, 0xffffff, s);
193+ snprintf(s, sizeof(s), "Tick1:%d", counter1);
194+ Drawing08_Put_String(testsheet->vram, testsheet->size.x, 8, 24 + 16, 0xffffff, s);
195+ Sheet_RefreshSheet(testsheet, 8, 24, 8 + (20 * 8) - 1, 24 + (16 * 2) - 1);
196+ counter1++;
197+ } else if(data == 12){
198+ Drawing08_Fill_Rectangle(testsheet->vram, testsheet->size.x, 0xc6c6c6, 8, 24 + 16 * 2, 8 + (20 * 8) - 1, 24 + (16 * 3) - 1);
199+ snprintf(s, sizeof(s), "Tick2:%d", counter2);
200+ Drawing08_Put_String(testsheet->vram, testsheet->size.x, 8, 24 + 16 * 2, 0xffffff, s);
201+ Sheet_RefreshSheet(testsheet, 8, 24 + 16 * 2, 8 + (20 * 8) - 1, 24 + (16 * 3) - 1);
202+ Timer_Run(timer2);
203+ counter2++;
204+ } else if(data == 13){
205+ Drawing08_Fill_Rectangle(testsheet->vram, testsheet->size.x, 0xc6c6c6, 8, 24 + 16 * 3, 8 + (20 * 8) - 1, 24 + (16 * 4) - 1);
206+ snprintf(s, sizeof(s), "Tick3:%d", counter3);
207+ Drawing08_Put_String(testsheet->vram, testsheet->size.x, 8, 24 + 16 * 3, 0xffffff, s);
208+ Sheet_RefreshSheet(testsheet, 8, 24 + 16 * 3, 8 + (20 * 8) - 1, 24 + (16 * 4) - 1);
209+ counter3++;
153210 }
154211 }
155212 }
@@ -177,9 +234,12 @@
177234
178235 for(;;){
179236 if(FIFO32_MyTaskFIFO_Status() == 0){
180-
237+ System_MultiTask_Task_Sleep(mytask);
181238 } else{
182239 data = FIFO32_MyTaskFIFO_Get();
240+ #ifdef CHNOSPROJECT_DEBUG_KBCT
241+ debug("KBCT:Receive data from FIFO(data:0x%X).\n", data);
242+ #endif
183243 if(0x100 <= data && data <= 0x1ff){
184244 data -= 0x100;
185245 data = Keyboard_Decode_KeyCode(data);
--- beta/tolset_chn_000/chnos_010/chnos/keyid.h (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/keyid.h (revision 314)
@@ -16,7 +16,7 @@
1616
1717 //つまり、FIFOで受け取って、バイアスを引いたら、KEYID_EXTENDEDフラグを調べる。
1818 //次に、BREAKフラグを調べる。
19-//そして、下位8ビットのみを参照する。
19+//そして、下位7ビットのみを参照する。
2020
2121 #define KEYID_MASK_ID 0x007f
2222 #define KEYID_MASK_BREAK 0x0080
--- beta/tolset_chn_000/chnos_010/chnos/timer.c (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/timer.c (revision 314)
@@ -1,14 +1,22 @@
11
22 #include "core.h"
33
4-uint PIT_10ms_Tick;
5-void (*TaskSwitch)(void);
4+UI_TimerControl *timerctrl;
65
7-void Initialise_ProgrammableIntervalTimer(void)
6+UI_TimerControl *Initialise_ProgrammableIntervalTimer(void)
87 {
9- PIT_10ms_Tick = 0;
10- TaskSwitch = &Timer_TaskSwitch_Invalid;
8+ timerctrl = (UI_TimerControl *)System_Memory_Allocate(sizeof(UI_TimerControl));
119
10+ timerctrl->tick_10ms = 0;
11+ timerctrl->TaskSwitch = &Timer_TaskSwitch_Invalid;
12+
13+//config watch
14+ timerctrl->timer_root = Timer_Initialise();
15+ Timer_Config(timerctrl->timer_root, 0xfffffff, Null, 0, True);
16+ timerctrl->timer_root->timeout = 0xffffffff;
17+ timerctrl->timer_root->flags.bit.running = True;
18+
19+//config PIT
1220 IO_Out8(PIT_CTRL, 0x34);
1321 IO_Out8(PIT_CNT0, 0x9c);
1422 IO_Out8(PIT_CNT0, 0x2e);
@@ -15,21 +23,20 @@
1523 System_GateDescriptor_Set(0x20, (uint)asm_InterruptHandler20, 0x02, AR_INTGATE32);
1624 ProgrammableInterruptController_InterruptMask_Clear(0x00);
1725
18- return;
26+ return timerctrl;
1927 }
2028
2129 void InterruptHandler20(uint *esp)
2230 {
23- //uchar s[32];
24-
2531 ProgrammableInterruptController_InterruptRequest_Complete(0x00);
26- PIT_10ms_Tick++;
32+ timerctrl->tick_10ms++;
2733
28- //snprintf(s, sizeof(s), "10ms_Tick:%u", PIT_10ms_Tick);
29- //TextMode_Put_String_Absolute(s, white, 50, 0);
34+ if(timerctrl->timer_root->timeout <= timerctrl->tick_10ms){
35+ Timer_TimeOut();
36+ }
3037
31- if((PIT_10ms_Tick & 0x00000002) == 0){
32- TaskSwitch();
38+ if((timerctrl->tick_10ms & 0x00000003) == 0){
39+ timerctrl->TaskSwitch();
3340 }
3441
3542 return;
@@ -37,10 +44,10 @@
3744
3845 void Timer_Set_TaskSwitch(void (*TaskSwitchFunction)(void))
3946 {
40- if(TaskSwitchFunction != 0){
41- TaskSwitch = TaskSwitchFunction;
47+ if(TaskSwitchFunction != Null){
48+ timerctrl->TaskSwitch = TaskSwitchFunction;
4249 } else{
43- TaskSwitch = Timer_TaskSwitch_Invalid;
50+ timerctrl->TaskSwitch = Timer_TaskSwitch_Invalid;
4451 }
4552 return;
4653 }
@@ -50,18 +57,128 @@
5057 return;
5158 }
5259
53-typedef struct UI_TIMER {
54- uint tick;
55- uint timeout;
56- struct UI_TIMER *root_next;
57- struct UI_TIMER *tree_next;
58- DATA_FIFO32 *fifo;
59- uint fifo_putdata;
60- union UI_TIMER_FLAGS {
61- uint flags;
62- struct UI_TIMER_FLAGS_BITS {
63- unsigned initialized : 1;
64- unsigned configured : 1;
65- } bit;
66- } flags;
67-} UI_Timer;
60+UI_Timer *Timer_Initialise(void)
61+{
62+ UI_Timer *timer;
63+
64+ timer = System_Memory_Allocate(sizeof(UI_Timer));
65+
66+ timer->flags.bit.initialized = True;
67+
68+ #ifdef CHNOSPROJECT_DEBUG_TIMER
69+ debug("Timer_Initialise:[0x%08X]\n", timer);
70+ #endif
71+
72+ return timer;
73+}
74+
75+uint Timer_Config(UI_Timer *timer, uint tick_ms, DATA_FIFO32 *fifo, uint fifo_putdata, bool interval)
76+{
77+ if(timer == Null){
78+ return 1;
79+ }
80+
81+ if(!timer->flags.bit.initialized){
82+ return 2;
83+ }
84+
85+ timer->tick = tick_ms / 10;
86+ timer->fifo = fifo;
87+ timer->fifo_putdata = fifo_putdata;
88+ timer->flags.bit.interval = interval;
89+
90+ timer->flags.bit.configured = True;
91+
92+ return 0;
93+}
94+
95+uint Timer_Run(UI_Timer *timer)
96+{
97+ uint eflags;
98+ UI_Timer **search;
99+
100+ if(timer == Null){
101+ return 1;
102+ }
103+
104+ if(!timer->flags.bit.configured){
105+ return 2;
106+ }
107+
108+ if(timer->flags.bit.running){
109+ return 3;
110+ }
111+
112+ timer->timeout = timer->tick + timerctrl->tick_10ms;
113+ search = &timerctrl->timer_root;
114+
115+ eflags = IO_Load_EFlags();
116+
117+ for(;;){
118+ if((*search) == Null){
119+ #ifdef CHNOSPROJECT_DEBUG_TIMER
120+ debug("Timer_Run:Invalid link. Abort.\n");
121+ #endif
122+ INT_3();
123+ }
124+ if((*search)->timeout > timer->timeout){
125+ IO_CLI();
126+ timer->root_next = *search;
127+ *search = timer;
128+ timer->tree_next = Null;
129+ timer->flags.bit.running = True;
130+ break;
131+ }
132+ if((*search)->timeout == timer->timeout){
133+ IO_CLI();
134+ search = &(*search)->tree_next;
135+ for(;;){
136+ if(*search == Null){
137+ break;
138+ }
139+ search = &(*search)->tree_next;
140+ }
141+ timer->root_next = Null;
142+ *search = timer;
143+ timer->tree_next = Null;
144+ timer->flags.bit.running = True;
145+ break;
146+ }
147+ search = &(*search)->root_next;
148+ }
149+
150+ IO_Store_EFlags(eflags);
151+
152+ return 0;
153+}
154+
155+uint Timer_TimeOut(void)
156+{
157+ UI_Timer *search, *old;
158+
159+ search = timerctrl->timer_root;
160+ timerctrl->timer_root = timerctrl->timer_root->root_next;
161+
162+ for(;;){
163+ if(search->fifo != Null){
164+ FIFO32_Put(search->fifo, search->fifo_putdata);
165+ }
166+ old = search;
167+ search = old->tree_next;
168+ old->tree_next = 0;
169+ old->flags.bit.running = False;
170+ if(old->flags.bit.interval){
171+ Timer_Run(old);
172+ }
173+ if(search == Null){
174+ break;
175+ }
176+ }
177+ return 0;
178+}
179+
180+uint Timer_GetTick(void)
181+{
182+ return timerctrl->tick_10ms;
183+}
184+
--- beta/tolset_chn_000/chnos_010/chnos/fifo.c (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/fifo.c (revision 314)
@@ -33,6 +33,9 @@
3333 IO_CLI();
3434
3535 if(fifo->free == 0){
36+ #ifdef CHNOSPROJECT_DEBUG_FIFO
37+ debug("FIFO32_Put:Overflow data.\n");
38+ #endif
3639 fifo->flags.overflow = True;
3740 return -1;
3841 }
@@ -42,13 +45,21 @@
4245 fifo->p = 0;
4346 }
4447 fifo->free--;
45-/*
46- if(fifo->task != 0){
47- if(fifo->task->state != inuse){
48- MultiTask_Task_Run(fifo->task);
48+
49+
50+ if(fifo->task != Null){
51+ if(!fifo->task->flags.linked){
52+ #ifdef CHNOSPROJECT_DEBUG_FIFO
53+ debug("FIFO32_Put:Task run start.\n");
54+ #endif
55+ System_MultiTask_Task_Run(fifo->task);
56+ #ifdef CHNOSPROJECT_DEBUG_FIFO
57+ debug("FIFO32_Put:Task run end.\n");
58+ #endif
59+
4960 }
5061 }
51-*/
62+
5263 IO_Store_EFlags(eflags);
5364
5465 return 0;
@@ -86,13 +97,13 @@
8697
8798 return i;
8899 }
89-/*
100+
90101 void FIFO32_Set_Task(DATA_FIFO32 *fifo, UI_Task *task)
91102 {
92103 fifo->task = task;
93104 return;
94105 }
95-*/
106+
96107 uint FIFO32_Get(DATA_FIFO32 *fifo)
97108 {
98109 int data;
--- beta/tolset_chn_000/chnos_010/chnos/coredef0.h (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef0.h (revision 314)
@@ -6,14 +6,16 @@
66
77 #ifdef CHNOSPROJECT_DEBUG
88 //#define CHNOSPROJECT_DEBUG_MEMORY
9- #define CHNOSPROJECT_DEBUG_MEMORY_ALLOCATE_AND_FREE
9+ //#define CHNOSPROJECT_DEBUG_MEMORY_ALLOCATE_AND_FREE
1010 //#define CHNOSPROJECT_DEBUG_EMULATOR_X86
1111 //#define CHNOSPROJECT_DEBUG_CALLBIOS
1212 //#define CHNOSPROJECT_DEBUG_FIFO
1313 //#define CHNOSPROJECT_DEBUG_KBCT
1414 //#define CHNOSPROJECT_DEBUG_DISPLAY
15- #define CHNOSPROJECT_DEBUG_DRAWING
16- #define CHNOSPROJECT_DEBUG_SHEET
15+ //#define CHNOSPROJECT_DEBUG_DRAWING
16+ //#define CHNOSPROJECT_DEBUG_SHEET
17+ //#define CHNOSPROJECT_DEBUG_TIMER
18+ //#define CHNOSPROJECT_DEBUG_MULTITASK
1719 #endif
1820
1921 /*defines*/
@@ -296,7 +298,7 @@
296298 #define SIGNAL_ARGUMENTS_END 0xfefe1234
297299
298300 /*task*/
299-#define TASK_FIFOSIZE 128;
301+#define TASK_FIFOSIZE 128
300302
301303 /*exceptions esp[] data with errorcode*/
302304 #define EXCEPTION_INFO_EDI 0x00
--- beta/tolset_chn_000/chnos_010/chnos/coredef1.h (revision 313)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef1.h (revision 314)
@@ -202,6 +202,7 @@
202202 unsigned initialized : 1;
203203 unsigned overflow : 1;
204204 } flags;
205+ struct UI_TASK *task;
205206 } DATA_FIFO32;
206207
207208 /*task*/
@@ -423,3 +424,31 @@
423424 uint vramsize;
424425 uint mapsize;
425426 } UI_Sheet;
427+
428+/*timer*/
429+typedef struct UI_TIMER {
430+ uint tick;
431+ uint timeout;
432+ struct UI_TIMER *root_next;
433+ struct UI_TIMER *tree_next;
434+ DATA_FIFO32 *fifo;
435+ uint fifo_putdata;
436+ union UI_TIMER_FLAGS {
437+ uint flags;
438+ struct UI_TIMER_FLAGS_BITS {
439+ unsigned initialized : 1;
440+ unsigned configured : 1;
441+ unsigned running : 1;
442+ unsigned interval : 1;
443+ } bit;
444+ } flags;
445+} UI_Timer;
446+
447+typedef struct UI_TIMER_CONTROL {
448+ uint tick_10ms;
449+ void (*TaskSwitch)(void);
450+ UI_Timer *timer_root;
451+} UI_TimerControl;
452+
453+
454+
旧リポジトリブラウザで表示