• R/O
  • SSH
  • HTTPS

chnosproject: コミット


コミットメタ情報

リビジョン325 (tree)
日時2012-07-16 01:42:07
作者hikarupsp

ログメッセージ

console.cを追加。
コンソールタスクの作成及び入力のマウスでの切り替え等を実装した。
今まで気付かなかったが、initializeをinitialiseと書いてしまっていたので、全て置換した。

変更サマリ

差分

--- beta/tolset_chn_000/chnos_010/chnos/coredef3.h (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef3.h (revision 325)
@@ -5,4 +5,20 @@
55 //0x80000000から始まる。=31ビット目がTrueかつタスクのFIFOであれば、TCMである。
66 //タスク実行リンク中にないタスクには送信されないが、スリープ中のタスクには送信される。
77
8-#define TCM_INFO_DISPLAY_UPDATE_RESOLUTION 0x80000001
8+#define TCM_OFFSET 0x80000000
9+#define TCM_NULL 0x80000000
10+#define TCM_INFO_DISPLAY_UPDATE_RESOLUTION 0x00000001
11+
12+//その他、入力に使われるinputバッファでは、
13+//INPUTSIGNAL_OFFSETからSIGNAL_KEY_OFFSET-1は、各種情報の伝達に使うためにシステムで予約されている。
14+#define INPUTSIGNAL_OFFSET 0x08000
15+
16+#define INPUTSIGNAL_NULL 0x00000
17+#define INPUTSIGNAL_FOCUS_GOT 0x00001
18+#define INPUTSIGNAL_FOCUS_LOST 0x00002
19+#define INPUTSIGNAL_MAX 0x07fff
20+
21+//また、SIGNAL_KEY_OFFSETからSIGNAL_KEY_OFFSET+0xffffは、keyidの通知に使われる。
22+//詳細は、keyid.hを参照。
23+#define SIGNAL_KEY_OFFSET 0x10000
24+
--- beta/tolset_chn_000/chnos_010/chnos/keyboard.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/keyboard.c (revision 325)
@@ -322,7 +322,7 @@
322322 0x00
323323 };
324324
325-void Initialise_Keyboard(void)
325+void Initialize_Keyboard(void)
326326 {
327327 System_GateDescriptor_Set(0x21, (uint)asm_InterruptHandler21, 0x02, AR_INTGATE32);
328328 ProgrammableInterruptController_InterruptMask_Clear(0x01);
--- beta/tolset_chn_000/chnos_010/chnos/console.c (nonexistent)
+++ beta/tolset_chn_000/chnos_010/chnos/console.c (revision 325)
@@ -0,0 +1,126 @@
1+
2+#include "core.h"
3+
4+UI_Console *Console_Initialize(void)
5+{
6+ UI_Console *console;
7+
8+ console = (UI_Console *)System_CommonStruct_Allocate(SYSTEM_STRUCTID_CONSOLE);
9+
10+ console->task = System_MultiTask_Task_Initialize(0);
11+ console->task->tss->eip = (uint)&Console_MainTask;
12+ console->task->tss->cs = SYSTEM_CS << 3;
13+ console->task->tss->ss = SYSTEM_DS << 3;
14+ console->task->tss->ds = SYSTEM_DS << 3;
15+ console->task->tss->esp = (uint)System_Memory_Allocate(1024 * 32) + (1024 * 32);
16+ MultiTask_Push_Arguments(console->task, 1, console);
17+
18+ console->textbox = TextBox_Initialize();
19+
20+ console->flags.bit.initialized = True;
21+
22+ #ifdef CHNOSPROJECT_DEBUG_CONSOLE
23+ debug("Console_Initialize:initialized[0x%X]\n", console);
24+ #endif
25+
26+ return console;
27+}
28+
29+uint Console_SetSize(UI_Console *console, uint xchars, uint ychars)
30+{
31+ if(console == Null){
32+ return 1;
33+ }
34+
35+ if(!console->flags.bit.initialized){
36+ return 2;
37+ }
38+
39+ if(console->flags.bit.configured_size){
40+ return 3;
41+ }
42+
43+ TextBox_SetBuffer(console->textbox, xchars, ychars, 8, Null);
44+ System_Sheet_SetParentToVRAM(console->textbox->sheet);
45+ Sheet_SetMovable(console->textbox->sheet, True);
46+ Sheet_SetInputFIFO(console->textbox->sheet, console->task->fifo);
47+
48+ console->flags.bit.configured_size = True;
49+
50+ #ifdef CHNOSPROJECT_DEBUG_CONSOLE
51+ debug("Console_SetSize:configured[0x%X]\n", console);
52+ #endif
53+
54+ return 0;
55+}
56+
57+uint Console_Run(UI_Console *console)
58+{
59+ if(console == Null){
60+ return 1;
61+ }
62+
63+ if(!console->flags.bit.initialized){
64+ return 2;
65+ }
66+
67+ if(!console->flags.bit.configured_size){
68+ return 3;
69+ }
70+
71+ #ifdef CHNOSPROJECT_DEBUG_CONSOLE
72+ debug("Console_Run:start running[0x%X]\n", console);
73+ #endif
74+
75+ System_MultiTask_Task_Run(console->task);
76+ return 0;
77+}
78+
79+void Console_MainTask(UI_Console *myconsole)
80+{
81+ UI_Task *mytask;
82+ uint data;
83+
84+ data = 0;
85+
86+ mytask = System_MultiTask_GetNowTask();
87+
88+ #ifdef CHNOSPROJECT_DEBUG
89+ debug("CMT:ConsoleMainTask[UI_Task=0x%X] Start Running.\n", mytask);
90+ #endif
91+
92+ TextBox_Show(myconsole->textbox, SHEET_MAX_CHILDREN, (int)(myconsole->textbox->sheet->parent->size.x >> 1) - (int)(myconsole->textbox->sheet->size.x >> 1), (int)(myconsole->textbox->sheet->parent->size.y >> 1) - (int)(myconsole->textbox->sheet->size.y >> 1));
93+ if(myconsole->textbox->sheet->location.x < 0){
94+ Sheet_Slide_Absolute(myconsole->textbox->sheet, 0, SHEET_LOCATION_NOCHANGE);
95+ }
96+ if(myconsole->textbox->sheet->location.y < 0){
97+ Sheet_Slide_Absolute(myconsole->textbox->sheet, SHEET_LOCATION_NOCHANGE, 0);
98+ }
99+ TextBox_Put_Character(myconsole->textbox, '>');
100+ TextBox_SetEnable_RecordInputText(myconsole->textbox, True);
101+ myconsole->flags.bit.isprompt = True;
102+
103+ for(;;){
104+ if(FIFO32_MyTaskFIFO_Status() == 0){
105+ System_MultiTask_Task_Sleep(mytask);
106+ } else{
107+ data = FIFO32_MyTaskFIFO_Get();
108+ #ifdef CHNOSPROJECT_DEBUG_CMT
109+ debug("CMT:Receive data from FIFO(data:0x%X).\n", data);
110+ #endif
111+ if(data < INPUTSIGNAL_OFFSET){
112+ //汎用利用可能領域0
113+ } else if(data < SIGNAL_KEY_OFFSET){
114+ //入力通知領域
115+ } else if(data < SIGNAL_KEY_OFFSET + 0xffff){
116+ //keyid通知
117+ data -= SIGNAL_KEY_OFFSET;
118+ TextBox_Put_Character(myconsole->textbox, data);
119+ } else if(data < TCM_OFFSET){
120+ //汎用利用可能領域1
121+ } else{
122+ //TCM領域
123+ }
124+ }
125+ }
126+}
--- beta/tolset_chn_000/chnos_010/chnos/draw08.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/draw08.c (revision 325)
@@ -1,7 +1,7 @@
11
22 #include "core.h"
33
4-void Drawing08_Initialise_Palette(void)
4+void Drawing08_Initialize_Palette(void)
55 {
66 static uchar table_rgb[16 * 3] = {
77 0x00, 0x00, 0x00,
--- beta/tolset_chn_000/chnos_010/chnos/display.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/display.c (revision 325)
@@ -5,7 +5,7 @@
55
66 #define SIGNAL_BIOS_OPERATION_END 0xff
77
8-IO_DisplayControl *Initialise_Display(void)
8+IO_DisplayControl *Initialize_Display(void)
99 {
1010 //最初に現在の画面モードをVGA320*200-8bitに設定する。(BIOS)
1111
@@ -18,7 +18,7 @@
1818
1919 ctrl = (IO_DisplayControl *)System_Memory_Allocate(sizeof(IO_DisplayControl));
2020
21- ctrl->bios_signal = System_FIFO32_Initialise(64);
21+ ctrl->bios_signal = System_FIFO32_Initialize(64);
2222
2323 callbiosctrl = System_CallBIOS_Get_Controller();
2424 callbiosctrl->CallBIOS_Task->tss->eax = 0x0013;
@@ -42,11 +42,11 @@
4242 ctrl->ysize = VGA08_VRAM_YSIZE;
4343 ctrl->vram = VGA_VRAM_ADR;
4444
45- Drawing08_Initialise_Palette();
46- Initialise_Drawing();
45+ Drawing08_Initialize_Palette();
46+ Initialize_Drawing();
4747 Error_Set_Enable_Display_TextMode(False);
4848 Error_Set_Enable_Display_GraphicMode(True, ctrl->vram, ctrl->xsize, ctrl->ysize >> 4);
49- ctrl->vramsheet = Sheet_Initialise();
49+ ctrl->vramsheet = Sheet_Initialize();
5050 Sheet_SetBuffer(ctrl->vramsheet, ctrl->vram, ctrl->xsize, ctrl->ysize, ctrl->bpp);
5151
5252 //次に、VBEのBIOS情報を得る。
@@ -269,10 +269,10 @@
269269 }
270270 debug("\n");
271271 #endif
272- Initialise_Drawing();
272+ Initialize_Drawing();
273273 Error_Set_Enable_Display_GraphicMode(True, ctrl->vram, ctrl->xsize, ctrl->ysize >> 4);
274274 Sheet_SetBuffer(ctrl->vramsheet, ctrl->vram, ctrl->xsize, ctrl->ysize, ctrl->bpp);
275- System_TaskControlMessage_Send_AllTask(TCM_INFO_DISPLAY_UPDATE_RESOLUTION);
275+ System_TaskControlMessage_Send_AllTask(TCM_OFFSET + TCM_INFO_DISPLAY_UPDATE_RESOLUTION);
276276 return 0;
277277 }
278278
--- beta/tolset_chn_000/chnos_010/chnos/sheet.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/sheet.c (revision 325)
@@ -3,7 +3,7 @@
33
44 //各シートの左上をP、左下をQ、右下をR、右上をS(すべて書き込める座標)とする。
55
6-UI_Sheet *Sheet_Initialise(void)
6+UI_Sheet *Sheet_Initialize(void)
77 {
88 UI_Sheet *sheet;
99
@@ -13,7 +13,7 @@
1313 sheet->flags.bit.autorefresh_upperlevel = True;
1414
1515 #ifdef CHNOSPROJECT_DEBUG_SHEET
16- debug("Sheet_Initialise:[0x%08X]\n", sheet);
16+ debug("Sheet_Initialize:[0x%08X]\n", sheet);
1717 #endif
1818
1919 sheet->Drawing.Fill_Rectangle = &Sheet_Drawing_Fill_Rectangle_Invalid;
@@ -38,7 +38,7 @@
3838 }
3939 if(!sheet->flags.bit.initialized){
4040 #ifdef CHNOSPROJECT_DEBUG_SHEET
41- debug("Sheet_Free:Not Initialised sheet.\n");
41+ debug("Sheet_Free:Not Initialized sheet.\n");
4242 #endif
4343 return 1;
4444 }
@@ -97,7 +97,7 @@
9797 }
9898 if(!sheet->flags.bit.initialized){
9999 #ifdef CHNOSPROJECT_DEBUG_SHEET
100- debug("Sheet_SetBuffer:Not Initialised sheet.\n");
100+ debug("Sheet_SetBuffer:Not Initialized sheet.\n");
101101 #endif
102102 return 2;
103103 }
@@ -128,7 +128,7 @@
128128 }
129129
130130 if(sheet->flags.bit.using_map){
131- Sheet_Internal_MapInitialise(sheet);
131+ Sheet_Internal_MapInitialize(sheet);
132132 }
133133
134134 for(search = sheet->child; search != Null; search = search->next){
@@ -288,7 +288,7 @@
288288 sheet->flags.bit.visible = True;
289289
290290 if(!sheet->parent->flags.bit.using_map){
291- Sheet_Internal_MapInitialise(sheet->parent);
291+ Sheet_Internal_MapInitialize(sheet->parent);
292292 }
293293
294294 Sheet_Internal_MapRefresh(sheet, sheet->location.x, sheet->location.y, sheet->location.x + sheet->size.x - 1, sheet->location.y + sheet->size.y - 1);
@@ -345,8 +345,12 @@
345345 return 3;
346346 }
347347 if(!sheet->flags.bit.visible){
348- sheet->location.x = apx;
349- sheet->location.y = apy;
348+ if(apx != SHEET_LOCATION_NOCHANGE){
349+ sheet->location.x = apx;
350+ }
351+ if(apy != SHEET_LOCATION_NOCHANGE){
352+ sheet->location.y = apy;
353+ }
350354 return 0;
351355 }
352356
@@ -386,8 +390,12 @@
386390 return 3;
387391 }
388392 if(!sheet->flags.bit.visible){
389- sheet->location.x += rpx;
390- sheet->location.y += rpy;
393+ if(rpx != SHEET_LOCATION_NOCHANGE){
394+ sheet->location.x += rpx;
395+ }
396+ if(rpy != SHEET_LOCATION_NOCHANGE){
397+ sheet->location.y += rpy;
398+ }
391399 return 0;
392400 }
393401
@@ -582,9 +590,24 @@
582590 #ifdef CHNOSPROJECT_DEBUG_SHEET
583591 debug("Sheet_SetMovable:Null sheet.\n");
584592 #endif
585- return Null;
593+ return 1;
586594 }
587595
588596 sheet->flags.bit.movable = movable;
589597 return 0;
590598 }
599+
600+uint Sheet_SetInputFIFO(UI_Sheet *sheet, DATA_FIFO32 *fifo)
601+{
602+ if(sheet == Null){
603+ #ifdef CHNOSPROJECT_DEBUG_SHEET
604+ debug("Sheet_SetInputFIFO:Null sheet.\n");
605+ #endif
606+ return 1;
607+ }
608+
609+ sheet->input_fifo = fifo;
610+
611+ return 0;
612+}
613+
--- beta/tolset_chn_000/chnos_010/chnos/shtfunc.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/shtfunc.c (revision 325)
@@ -62,12 +62,12 @@
6262 return 0;
6363 }
6464
65-//uint Sheet_Internal_MapInitialise(UI_Sheet *parent);
65+//uint Sheet_Internal_MapInitialize(UI_Sheet *parent);
6666 //mapを初期化する。
6767 //すでにマップが確保されていた場合は、解放した後に再確保する。
6868 //マップの再構成も自動で行う。
6969
70-uint Sheet_Internal_MapInitialise(UI_Sheet *parent)
70+uint Sheet_Internal_MapInitialize(UI_Sheet *parent)
7171 {
7272 if(parent->flags.bit.using_map){
7373 parent->flags.bit.using_map = False;
@@ -81,7 +81,7 @@
8181 Sheet_Internal_MapRebuild(parent, 0, 0, parent->size.x - 1, parent->size.y - 1);
8282
8383 #ifdef CHNOSPROJECT_DEBUG_SHEET
84- debug("Sheet_Internal_MapInitialise:[0x%08X] map:[0x%08X]\n", parent, parent->map);
84+ debug("Sheet_Internal_MapInitialize:[0x%08X] map:[0x%08X]\n", parent, parent->map);
8585 #endif
8686
8787 return 0;
--- beta/tolset_chn_000/chnos_010/chnos/mtask.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/mtask.c (revision 325)
@@ -4,7 +4,7 @@
44 //FIFOによるタスクの自動起動は既定で有効ですが、タスクが明示的に実行されるまでは無効になっています。
55 //タスクはSTI下で開始されます(外部割り込み有効)。
66
7-UI_TaskControl *Initialise_MultiTask_Control(IO_MemoryControl sysmemctrl)
7+UI_TaskControl *Initialize_MultiTask_Control(IO_MemoryControl sysmemctrl)
88 {
99 UI_TaskControl *ctrl;
1010 UI_Task *maintask;
@@ -13,7 +13,7 @@
1313 ctrl->now = 0;
1414 ctrl->sysmemctrl = sysmemctrl;
1515
16- maintask = MultiTask_Task_Initialise(ctrl, 0);
16+ maintask = MultiTask_Task_Initialize(ctrl, 0);
1717
1818 Load_TR(maintask->selector << 3);
1919
@@ -28,7 +28,7 @@
2828 return ctrl;
2929 }
3030
31-UI_Task *MultiTask_Task_Initialise(UI_TaskControl *ctrl, uint tss_additional_size)
31+UI_Task *MultiTask_Task_Initialize(UI_TaskControl *ctrl, uint tss_additional_size)
3232 {
3333 UI_Task *task;
3434
@@ -85,7 +85,7 @@
8585 task->next = 0;
8686 task->count = 0;
8787
88- task->fifo = FIFO32_Initialise(ctrl->sysmemctrl, TASK_FIFOSIZE);
88+ task->fifo = FIFO32_Initialize(ctrl->sysmemctrl, TASK_FIFOSIZE);
8989
9090 task->flags.initialized = True;
9191 task->flags.linked = False;
--- beta/tolset_chn_000/chnos_010/chnos/serial.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/serial.c (revision 325)
@@ -1,7 +1,7 @@
11
22 #include "core.h"
33
4-void Initialise_SerialPort(void)
4+void Initialize_SerialPort(void)
55 {
66 IO_Out8(COM1_CTRL_LINE, 0x80); //ボーレート設定開始
77 IO_Out8(COM1_BAUD_LSB, 0x06); //0x06 = 19.2bps
--- beta/tolset_chn_000/chnos_010/chnos/intrpt.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/intrpt.c (revision 325)
@@ -1,7 +1,7 @@
11
22 #include "core.h"
33
4-void Initialise_ProgrammableInterruptController(void)
4+void Initialize_ProgrammableInterruptController(void)
55 {
66 /*
77 IRR:インタラプトリクエストレジスタ
--- beta/tolset_chn_000/chnos_010/chnos/system.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/system.c (revision 325)
@@ -114,7 +114,7 @@
114114 void System_Check_Memory(void);
115115 uint System_CPUID(void *addr, uint id);
116116
117-void Initialise_System(void)
117+void Initialize_System(void)
118118 {
119119 uint i;
120120 uchar s[128];
@@ -132,7 +132,7 @@
132132 System_Set_RunningPhase(0);
133133
134134 TextMode_Put_String("\tInitialising SerialPort...\n", white);
135- Initialise_SerialPort();
135+ Initialize_SerialPort();
136136 Error_Set_Enable_SerialPort(True);
137137
138138 #ifdef CHNOSPROJECT_DEBUG
@@ -150,7 +150,7 @@
150150 i = System_Get_PhisycalMemorySize();
151151 snprintf(s, sizeof(s), "\tMemory:%uByte %uKiB %uMib\n", i, i >> 10, i >> 20);
152152 TextMode_Put_String(s, white);
153- System.Controller.Memory = Memory_Initialise_Control((void *)PHYSICAL_MEMORY_ALLOCATION_START_ADDRESS, i - PHYSICAL_MEMORY_ALLOCATION_START_ADDRESS, SYSTEM_MEMORY_CONTROL_TAGS);
153+ System.Controller.Memory = Memory_Initialize_Control((void *)PHYSICAL_MEMORY_ALLOCATION_START_ADDRESS, i - PHYSICAL_MEMORY_ALLOCATION_START_ADDRESS, SYSTEM_MEMORY_CONTROL_TAGS);
154154
155155 i = Memory_Get_FreeSize(System.Controller.Memory);
156156 snprintf(s, sizeof(s), "\tFreeMemory:%uByte %uKiB %uMib\n", i, i >> 10, i >> 20);
@@ -157,28 +157,28 @@
157157 TextMode_Put_String(s, white);
158158
159159 TextMode_Put_String("\tInitialising GDT...\n", white);
160- Initialise_GlobalDescriptorTable();
160+ Initialize_GlobalDescriptorTable();
161161
162162 TextMode_Put_String("\tInitialising IDT...\n", white);
163- Initialise_InterruptDescriptorTable();
163+ Initialize_InterruptDescriptorTable();
164164
165165 TextMode_Put_String("\tInitialising PIC...\n", white);
166- Initialise_ProgrammableInterruptController();
166+ Initialize_ProgrammableInterruptController();
167167
168168 TextMode_Put_String("\tInitialising PIT...\n", white);
169- Initialise_ProgrammableIntervalTimer();
169+ Initialize_ProgrammableIntervalTimer();
170170
171171 TextMode_Put_String("\tInitialising Keyboard...\n", white);
172- Initialise_Keyboard();
172+ Initialize_Keyboard();
173173
174174 TextMode_Put_String("\tInitialising MultiTask...\n", white);
175- System.Controller.Task = Initialise_MultiTask_Control(System.Controller.Memory);
175+ System.Controller.Task = Initialize_MultiTask_Control(System.Controller.Memory);
176176 Timer_Set_TaskSwitch(&System_TaskSwitch);
177177 System.CoreTask.Main = System_MultiTask_GetNowTask();
178178 System.InputFocus = System.CoreTask.Main->fifo;
179179
180180 TextMode_Put_String("\tInitialising CallBIOS...\n", white);
181- System.Controller.CallBIOS = Initialise_CallBIOS();
181+ System.Controller.CallBIOS = Initialize_CallBIOS();
182182
183183 TextMode_Put_String("\tReading CPU Identification...\n", white);
184184 eflags.eflags = IO_Load_EFlags();
@@ -228,17 +228,17 @@
228228 }
229229
230230 TextMode_Put_String("\tInitialising PCI...\n", white);
231- Initialise_PCI();
231+ Initialize_PCI();
232232
233233 TextMode_Put_String("\tSystem Initialising Phase End.\n", white);
234234
235235 IO_STI();
236236
237- System.Controller.Display = Initialise_Display();
237+ System.Controller.Display = Initialize_Display();
238238
239239 //Core Task Run.
240240
241- System.CoreTask.KeyboardControl = System_MultiTask_Task_Initialise(0);
241+ System.CoreTask.KeyboardControl = System_MultiTask_Task_Initialize(0);
242242 System.CoreTask.KeyboardControl->tss->eip = (uint)&KeyboardControlTask;
243243 System.CoreTask.KeyboardControl->tss->cs = SYSTEM_CS << 3;
244244 System.CoreTask.KeyboardControl->tss->ss = SYSTEM_DS << 3;
@@ -247,13 +247,13 @@
247247 MultiTask_Push_Arguments(System.CoreTask.KeyboardControl, 1, &System.InputFocus);
248248 System_MultiTask_Task_Run(System.CoreTask.KeyboardControl);
249249
250- System.CoreTask.MouseControl = System_MultiTask_Task_Initialise(0);
250+ System.CoreTask.MouseControl = System_MultiTask_Task_Initialize(0);
251251 System.CoreTask.MouseControl->tss->eip = (uint)&MouseControlTask;
252252 System.CoreTask.MouseControl->tss->cs = SYSTEM_CS << 3;
253253 System.CoreTask.MouseControl->tss->ss = SYSTEM_DS << 3;
254254 System.CoreTask.MouseControl->tss->ds = SYSTEM_DS << 3;
255255 System.CoreTask.MouseControl->tss->esp = (uint)System_Memory_Allocate(1024 * 32) + (1024 * 32);
256- MultiTask_Push_Arguments(System.CoreTask.MouseControl, 2, &System.InputFocus, MouseCursor_Initialise(System.Controller.Display->vramsheet));
256+ MultiTask_Push_Arguments(System.CoreTask.MouseControl, 2, &System.InputFocus, MouseCursor_Initialize(System.Controller.Display->vramsheet));
257257 System_MultiTask_Task_Run(System.CoreTask.MouseControl);
258258
259259 return;
@@ -359,9 +359,9 @@
359359 return;
360360 }
361361
362-UI_Task *System_MultiTask_Task_Initialise(uint tss_additional_size)
362+UI_Task *System_MultiTask_Task_Initialize(uint tss_additional_size)
363363 {
364- return MultiTask_Task_Initialise(System.Controller.Task, tss_additional_size);
364+ return MultiTask_Task_Initialize(System.Controller.Task, tss_additional_size);
365365 }
366366
367367 void System_MultiTask_Task_Run(UI_Task *task)
@@ -418,9 +418,9 @@
418418 return;
419419 }
420420
421-DATA_FIFO32 *System_FIFO32_Initialise(uint size)
421+DATA_FIFO32 *System_FIFO32_Initialize(uint size)
422422 {
423- return FIFO32_Initialise(System.Controller.Memory, size);
423+ return FIFO32_Initialize(System.Controller.Memory, size);
424424 }
425425
426426 uint System_Display_VESA_Set_VideoMode(uint index)
@@ -459,6 +459,14 @@
459459 return Sheet_SetParent(sheet, System.Controller.Display->vramsheet);
460460 }
461461
462+uint System_InputFocus_Change(DATA_FIFO32 *fifo)
463+{
464+ FIFO32_Put(System.InputFocus, INPUTSIGNAL_FOCUS_LOST);
465+ System.InputFocus = fifo;
466+ FIFO32_Put(System.InputFocus, INPUTSIGNAL_FOCUS_GOT);
467+ return 0;
468+}
469+
462470 //
463471 void System_Check_Memory(void)
464472 {
--- beta/tolset_chn_000/chnos_010/chnos/makeset.txt (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/makeset.txt (revision 325)
@@ -1,3 +1,3 @@
11
2-OBJS_BOOTPACK = nasfunc0.obj nasfunc1.obj nasfunc2.obj hankaku.obj chnlogo.obj callbios.obj cfunc.obj color.obj debug.obj display.obj draw08.obj draw16.obj draw32.obj drawing.obj dsctbl.obj emu86.obj emu86asm.obj error.obj fifo.obj fmt_bmp.obj intrpt.obj keyboard.obj memory.obj mouse.obj mtask.obj pci.obj serial.obj sheet.obj sht08.obj sht16.obj sht32.obj shtdraw.obj shtfunc.obj struct.obj system.obj textbox.obj timer.obj vgatmode.obj xception.obj bootpack.obj
2+OBJS_BOOTPACK = nasfunc0.obj nasfunc1.obj nasfunc2.obj hankaku.obj chnlogo.obj callbios.obj cfunc.obj color.obj console.obj debug.obj display.obj draw08.obj draw16.obj draw32.obj drawing.obj dsctbl.obj emu86.obj emu86asm.obj error.obj fifo.obj fmt_bmp.obj intrpt.obj keyboard.obj memory.obj mouse.obj mtask.obj pci.obj serial.obj sheet.obj sht08.obj sht16.obj sht32.obj shtdraw.obj shtfunc.obj struct.obj system.obj textbox.obj timer.obj vgatmode.obj xception.obj bootpack.obj
33 HEADS_BOOTPACK = core.h coredef0.h coredef1.h coredef2.h coredef3.h keyid.h
--- beta/tolset_chn_000/chnos_010/chnos/callbios.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/callbios.c (revision 325)
@@ -1,7 +1,7 @@
11
22 #include "core.h"
33
4-IO_CallBIOSControl *Initialise_CallBIOS(void)
4+IO_CallBIOSControl *Initialize_CallBIOS(void)
55 {
66 IO_CallBIOSControl *ctrl;
77 uint i;
@@ -33,7 +33,7 @@
3333 cr4.bit.VME = True;
3434 Store_CR4(cr4.cr4);
3535
36- ctrl->CallBIOS_Task = System_MultiTask_Task_Initialise((256 >> 3) + (65536 >> 3) + 1);
36+ ctrl->CallBIOS_Task = System_MultiTask_Task_Initialize((256 >> 3) + (65536 >> 3) + 1);
3737 //CallBIOS 16Bit エミュレーションタスクはFIFOを使用しないのでタスクのFIFOを解放
3838 FIFO32_Free(ctrl->CallBIOS_Task->fifo);
3939 ctrl->CallBIOS_Task->fifo = Null;
--- beta/tolset_chn_000/chnos_010/chnos/drawing.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/drawing.c (revision 325)
@@ -8,7 +8,7 @@
88 //また、二点の座標をとる関数は、(基本的に)全て引数左側がx成分の小さい側(原点に近い)でなければならない。
99 //高レベル描画関数では、それらを上手くラップすべきである。
1010
11-void Initialise_Drawing(void)
11+void Initialize_Drawing(void)
1212 {
1313 IO_DisplayControl *dispctrl;
1414
@@ -18,7 +18,7 @@
1818 Drawing_Fill_Rectangle = Drawing08_Fill_Rectangle;
1919 Drawing_Put_String = Drawing08_Put_String;
2020 Drawing_Draw_Point = Drawing08_Draw_Point;
21- Drawing08_Initialise_Palette();
21+ Drawing08_Initialize_Palette();
2222 } else if(dispctrl->bpp == 16){
2323 Drawing_Fill_Rectangle = Drawing16_Fill_Rectangle;
2424 Drawing_Put_String = Drawing16_Put_String;
--- beta/tolset_chn_000/chnos_010/chnos/textbox.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/textbox.c (revision 325)
@@ -1,11 +1,11 @@
11
22 #include "core.h"
33
4-UI_TextBox *TextBox_Initialise(void)
4+UI_TextBox *TextBox_Initialize(void)
55 {
66 UI_TextBox *textbox;
77
8- textbox = System_Memory_Allocate(sizeof(UI_TextBox));
8+ textbox = (UI_TextBox *)System_CommonStruct_Allocate(SYSTEM_STRUCTID_TEXTBOX);
99 textbox->flags.bit.initialized = True;
1010
1111 textbox->forecol = 0x000000;
@@ -35,7 +35,7 @@
3535 textbox->chars.y = ychars;
3636 textbox->size_text_buf = textbox->chars.x * textbox->chars.y;
3737
38- textbox->sheet = Sheet_Initialise();
38+ textbox->sheet = Sheet_Initialize();
3939 Sheet_SetBuffer(textbox->sheet, Null, xchars << 3, ychars << 4, bpp);
4040 Sheet_SetParent(textbox->sheet, parent);
4141
@@ -94,58 +94,12 @@
9494 if(keyid & KEYID_MASK_EXTENDED){ /*制御文字*/
9595 switch(keyid & KEYID_MASK_ID){
9696 case KEYID_ENTER:
97-/*
98- if(TextBox_Internal_Put_Character_TextBuffer(textbox, '\n')){
99- textbox->location_cursor.x = 0;
100- textbox->location_cursor.y += 16;
101- }
102-*/
10397 TextBox_Put_Character(textbox, '\n');
10498 break;
10599 case KEYID_BACKSPACE:
106-/*
107- if(textbox->location_cursor.x <= 0 && textbox->location_cursor.y <= 0){
108- break;
109- }
110- if(TextBox_Internal_Put_Character_TextBuffer(textbox, '\b')){
111- textbox->location_cursor.x -= 8;
112- }
113- if(textbox->location_cursor.x < 0){
114- textbox->location_cursor.x = 0;
115- textbox->location_cursor.y -= 16;
116- if(textbox->flags.bit.record_input_text){
117- for(i = 0; i < textbox->using_text_buf; i++){
118- if(textbox->text_buf[textbox->using_text_buf - i - 1] == '\n'){
119- break;
120- }
121- textbox->location_cursor.x += 8;
122- if(textbox->location_cursor.x >= (int)textbox->sheet->size.x - (8 - 1)){
123- textbox->location_cursor.x = 0;
124- }
125- if(textbox->using_text_buf - i - 1 == 0){
126- break;
127- }
128- }
129- } else{
130- textbox->location_cursor.x = (int)textbox->sheet->size.x - 8;
131- }
132- }
133-*/
134100 TextBox_Put_Character(textbox, '\b');
135101 break;
136102 case KEYID_TAB:
137-/*
138- if(!textbox->flags.bit.record_input_text && TextBox_Internal_Put_Character_TextBuffer(textbox, '\b')){
139- textbox->location_cursor.x += 8 * (4 - ((textbox->location_cursor.x >> 3) & 3));
140- }
141- if(textbox->location_cursor.x > (int)textbox->sheet->size.x){
142- textbox->location_cursor.x = 8 * 4;
143- textbox->location_cursor.y += 16;
144- } else if(textbox->location_cursor.x == (int)textbox->sheet->size.x){
145- textbox->location_cursor.x = 0;
146- textbox->location_cursor.y += 16;
147- }
148-*/
149103 TextBox_Put_Character(textbox, '\t');
150104 break;
151105 }
@@ -164,7 +118,7 @@
164118 textbox->location_cursor.x -= 8;
165119 }
166120 if(textbox->location_cursor.x < 0){
167- textbox->location_cursor.x = 0;
121+ textbox->location_cursor.x = textbox->location_cursor_record_started.x;
168122 textbox->location_cursor.y -= 16;
169123 if(textbox->flags.bit.record_input_text){
170124 for(i = 0; i < textbox->using_text_buf; i++){
@@ -275,6 +229,7 @@
275229 if(enable){
276230 textbox->text_buf[0] = 0x00;
277231 textbox->using_text_buf = 0;
232+ textbox->location_cursor_record_started = textbox->location_cursor;
278233 }
279234 textbox->flags.bit.record_input_text = enable;
280235 }
--- beta/tolset_chn_000/chnos_010/chnos/core.h (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/core.h (revision 325)
@@ -14,7 +14,7 @@
1414
1515 /*callbios.c 32bitからBIOSをコールするための関数群*/
1616
17-IO_CallBIOSControl *Initialise_CallBIOS(void);
17+IO_CallBIOSControl *Initialize_CallBIOS(void);
1818 void CallBIOS_Execute(IO_CallBIOSControl *ctrl, uchar intn, DATA_FIFO32 *fifo, uint endsignal);
1919 void CallBIOS_Send_End_Of_Operation(IO_CallBIOSControl *ctrl, uint abort);
2020 void CallBIOS_Check_Privileged_Operation(uint *esp);
@@ -31,7 +31,7 @@
3131 int vsnprintf(uchar s[], uint n, const uchar format[], uint vargs[]);
3232 //
3333 int CFunction_vsnprintf(uchar s[], uint n, const uchar format[], uint vargs[]);
34-void CFunction_vsnprintf_Initialise_WorkArea(CFunction_vsnprintf_WorkArea *work, uchar s[], const uchar format[], uint n, uint vargs[]);
34+void CFunction_vsnprintf_Initialize_WorkArea(CFunction_vsnprintf_WorkArea *work, uchar s[], const uchar format[], uint n, uint vargs[]);
3535 int CFunction_vsnprintf_Check_FormatBuffer(CFunction_vsnprintf_WorkArea *work);
3636 int CFunction_vsnprintf_Check_DestinationBuffer(CFunction_vsnprintf_WorkArea *work);
3737 uchar CFunction_vsnprintf_Read_FormatBuffer(CFunction_vsnprintf_WorkArea *work);
@@ -52,6 +52,12 @@
5252 uchar RGB_32_To_08_xy(uint c32, int x, int y);
5353 ushort RGB_32_To_16(uint c32);
5454
55+/*console.c コンソール関連*/
56+UI_Console *Console_Initialize(void);
57+uint Console_SetSize(UI_Console *console, uint xchars, uint ychars);
58+uint Console_Run(UI_Console *console);
59+void Console_MainTask(UI_Console *myconsole);
60+
5561 /*debug.c デバッグ支援*/
5662 #ifdef CHNOSPROJECT_DEBUG
5763 void debug(const uchar format[], ...);
@@ -61,11 +67,11 @@
6167 #endif
6268
6369 /*display.c ディスプレイ制御関連*/
64-IO_DisplayControl *Initialise_Display(void);
70+IO_DisplayControl *Initialize_Display(void);
6571 uint Display_VESA_Set_VideoMode(IO_DisplayControl *ctrl, uint index);
6672
6773 /*draw08.c 8bit描画関連*/
68-void Drawing08_Initialise_Palette(void);
74+void Drawing08_Initialize_Palette(void);
6975 void Drawing08_Set_Palette(uint start, uint end, uchar *rgb);
7076 void Drawing08_Fill_Rectangle(void *vram, uint xsize, uint c, uint x0, uint y0, uint x1, uint y1);
7177 void Drawing08_Put_Font(void *vram, uint xsize, uint x, uint y, uint c, const uchar *font);
@@ -92,14 +98,14 @@
9298 void Drawing_Invalid_Fill_Rectangle(void *vram, uint xsize, uint c, uint x0, uint y0, uint x1, uint y1);
9399 void Drawing_Invalid_Draw_Point(void *vram, uint xsize, uint x, uint y, uint c);
94100 void Drawing_Invalid_Draw_Line_PQ(void *vram, uint xsize, uint c, uint x0, uint y0, uint x1, uint y1);
95-void Initialise_Drawing(void);
101+void Initialize_Drawing(void);
96102 void Drawing_Draw_Line_PQ(void *vram, uint xsize, uint c, uint x0, uint y0, uint x1, uint y1);
97103 void Drawing_Draw_Circle(void *vram, uint xsize, uint x, uint y, uint c, uint r);
98104 void Drawing_Fill_Circle(void *vram, uint xsize, uint x, uint y, uint c, uint r);
99105
100106 /*dsctbl.c セグメント・ゲートディスクリプタ関連*/
101-void Initialise_GlobalDescriptorTable(void);
102-void Initialise_InterruptDescriptorTable(void);
107+void Initialize_GlobalDescriptorTable(void);
108+void Initialize_InterruptDescriptorTable(void);
103109 void SegmentDescriptor_Set(IO_SegmentDescriptor *seg_desc, uint limit, uint base, uint ar);
104110 uint SegmentDescriptor_Get_Base(IO_SegmentDescriptor *seg_desc);
105111 uint SegmentDescriptor_Get_Limit(IO_SegmentDescriptor *seg_desc);
@@ -107,7 +113,7 @@
107113 void GateDescriptor_Set(IO_GateDescriptor *gate_desc, uint offset, uint selector, uint ar);
108114
109115 /*emu86.c x86エミュレーター関連*/
110-void Emulator_x86_Initialise(Emulator_x86_Environment *env);
116+void Emulator_x86_Initialize(Emulator_x86_Environment *env);
111117 uint Emulator_x86_Execute(Emulator_x86_Environment *env);
112118 uint Emulator_x86_Execute_Auto(Emulator_x86_Environment *env);
113119 int Emulator_x86_Put_EmulationInformation(Emulator_x86_Environment *env, const uchar format[], ...);
@@ -176,7 +182,7 @@
176182 void Error_CPU_Exception_Put_Registers_Without_ErrorCode(uint *esp);
177183
178184 /*fifo.c FIFOバッファ関連*/
179-DATA_FIFO32 *FIFO32_Initialise(IO_MemoryControl memctrl, uint size);
185+DATA_FIFO32 *FIFO32_Initialize(IO_MemoryControl memctrl, uint size);
180186 int FIFO32_Put(DATA_FIFO32 *fifo, uint data);
181187 int FIFO32_Put_Arguments(DATA_FIFO32 *fifo, uint args, ...);
182188 void FIFO32_Set_Task(DATA_FIFO32 *fifo, UI_Task *task);
@@ -190,13 +196,13 @@
190196 uint Format_BMP_DrawPicture(void *vram, uint xsize, uint x, uint y, uint pxsize, uint pysize, void *bmp);
191197
192198 /*intrpt.c 割り込み関連*/
193-void Initialise_ProgrammableInterruptController(void);
199+void Initialize_ProgrammableInterruptController(void);
194200 void ProgrammableInterruptController_InterruptMask_Clear(uint irq);
195201 void ProgrammableInterruptController_InterruptRequest_Complete(uint irq);
196202 void InterruptHandler27(uint *esp);
197203
198204 /*keyboard.c キーボード関連*/
199-void Initialise_Keyboard(void);
205+void Initialize_Keyboard(void);
200206 void InterruptHandler21(uint *esp);
201207 void Keyboard_Set_ReceiveFIFO(DATA_FIFO32 *fifo, uint data0);
202208 ushort Keyboard_Decode_KeyCode(uchar keycode);
@@ -207,7 +213,7 @@
207213
208214 /*memory.c メモリ関連*/
209215 uint Memory_Test(uint start, uint end);
210-IO_MemoryControl Memory_Initialise_Control(void *start, uint size, uint tags);
216+IO_MemoryControl Memory_Initialize_Control(void *start, uint size, uint tags);
211217 void Memory_Free(IO_MemoryControl ctrl, void *addr, uint size);
212218 void Memory_Free_Sub(IO_MemoryControl ctrl, uint tagno);
213219 void *Memory_Allocate(IO_MemoryControl ctrl, uint size);
@@ -215,11 +221,11 @@
215221 uint Memory_Get_FreeSize(IO_MemoryControl ctrl);
216222
217223 /*mouse.c マウス関連*/
218-IO_MouseControl *Initialise_Mouse(void);
224+IO_MouseControl *Initialize_Mouse(void);
219225 void InterruptHandler2c(uint *esp);
220226 void Mouse_Set_ReceiveFIFO(DATA_FIFO32 *fifo, uint data0);
221227 void Mouse_SendCommand(uint cmd);
222-UI_MouseCursor *MouseCursor_Initialise(UI_Sheet *parent);
228+UI_MouseCursor *MouseCursor_Initialize(UI_Sheet *parent);
223229 uint MouseCursor_Show(UI_MouseCursor *mcursor);
224230 uint MouseCursor_Move_Relative(UI_MouseCursor *mcursor, int rpx, int rpy);
225231 uint MouseCursor_Move_Absolute(UI_MouseCursor *mcursor, int apx, int apy);
@@ -226,8 +232,8 @@
226232 bool Mouse_Decode(IO_MouseControl *mctrl, uint data);
227233
228234 /*mtask.c マルチタスク関連*/
229-UI_TaskControl *Initialise_MultiTask_Control(IO_MemoryControl sysmemctrl);
230-UI_Task *MultiTask_Task_Initialise(UI_TaskControl *ctrl, uint tss_additional_size);
235+UI_TaskControl *Initialize_MultiTask_Control(IO_MemoryControl sysmemctrl);
236+UI_Task *MultiTask_Task_Initialize(UI_TaskControl *ctrl, uint tss_additional_size);
231237 uint MultiTask_Internal_Task_SetLink(UI_TaskControl *ctrl, UI_Task *task);
232238 uint MultiTask_Internal_Task_CleartLink(UI_TaskControl *ctrl, UI_Task *task);
233239 void MultiTask_Task_Run(UI_TaskControl *ctrl, UI_Task *task);
@@ -238,14 +244,14 @@
238244 uint MultiTask_Push_Arguments(UI_Task *task, uint args, ...);
239245
240246 /*pci.c PCI関連*/
241-void Initialise_PCI(void);
247+void Initialize_PCI(void);
242248
243249 /*serial.c シリアル通信関連*/
244-void Initialise_SerialPort(void);
250+void Initialize_SerialPort(void);
245251 void SerialPort_Send(const uchar s[]);
246252
247253 /*sheet.c シート関連*/
248-UI_Sheet *Sheet_Initialise(void);
254+UI_Sheet *Sheet_Initialize(void);
249255 uint Sheet_Free(UI_Sheet *sheet);
250256 uint Sheet_SetBuffer(UI_Sheet *sheet, void *vram, uint xsize, uint ysize, uint bpp);
251257 uint Sheet_SetParent(UI_Sheet *sheet, UI_Sheet *parent);
@@ -262,6 +268,7 @@
262268 uint Sheet_SetTopmost(UI_Sheet *sheet, bool topmost);
263269 UI_Sheet *Sheet_GetSheetFromLocation(UI_Sheet *parent, int px, int py);
264270 uint Sheet_SetMovable(UI_Sheet *sheet, bool movable);
271+uint Sheet_SetInputFIFO(UI_Sheet *sheet, DATA_FIFO32 *fifo);
265272
266273 /*sht08.c 8bitカラー シート関連*/
267274 uint Sheet08_Internal_SetBuffer(UI_Sheet *sheet, void *vram, uint xsize, uint ysize, uint bpp);
@@ -314,7 +321,7 @@
314321 uint Sheet_Internal_GetLocationQ(UI_Sheet *sheet, DATA_Location2D *dest);
315322 uint Sheet_Internal_GetLocationR(UI_Sheet *sheet, DATA_Location2D *dest);
316323 uint Sheet_Internal_GetLocationS(UI_Sheet *sheet, DATA_Location2D *dest);
317-uint Sheet_Internal_MapInitialise(UI_Sheet *parent);
324+uint Sheet_Internal_MapInitialize(UI_Sheet *parent);
318325 uint Sheet_Internal_MapWriteFromSheet(UI_Sheet *sheet, bool force, int px0, int py0, int px1, int py1);
319326 bool Sheet_Internal_IsLocationInRangeOfSheet(UI_Sheet *sheet, int px, int py);
320327 bool Sheet_Internal_IsRangeOverlappedWithSheet(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
@@ -332,7 +339,7 @@
332339
333340
334341 /*system.c システムデータ・初期化関連*/
335-void Initialise_System(void);
342+void Initialize_System(void);
336343 void System_Set_RunningPhase(uint phase);
337344 uint System_Get_RunningPhase(void);
338345 uint System_Get_PhisycalMemorySize(void);
@@ -343,7 +350,7 @@
343350 uint System_SegmentDescriptor_Set(uint limit, uint base, uint ar);
344351 void System_GateDescriptor_Set(uint irq, uint offset, uint selector, uint ar);
345352 void System_TaskSwitch(void);
346-UI_Task *System_MultiTask_Task_Initialise(uint tss_additional_size);
353+UI_Task *System_MultiTask_Task_Initialize(uint tss_additional_size);
347354 void System_MultiTask_Task_Run(UI_Task *task);
348355 void *System_Memory_Allocate(uint size);
349356 UI_Task *System_MultiTask_GetNowTask(void);
@@ -353,15 +360,16 @@
353360 void System_CallBIOS_Send_End_Of_Operation(uint abort);
354361 void System_MultiTask_Task_Sleep(UI_Task *task);
355362 void System_MultiTask_Task_Kill(UI_Task *task);
356-DATA_FIFO32 *System_FIFO32_Initialise(uint size);
363+DATA_FIFO32 *System_FIFO32_Initialize(uint size);
357364 uint System_Display_VESA_Set_VideoMode(uint index);
358365 IO_DisplayControl *System_Display_Get_Controller(void);
359366 uint System_Memory_Get_FreeSize(void);
360367 uint System_TaskControlMessage_Send_AllTask(uint message);
361368 uint System_Sheet_SetParentToVRAM(UI_Sheet *sheet);
369+uint System_InputFocus_Change(DATA_FIFO32 *fifo);
362370
363371 /*textbox.c テキスト入力UI関連*/
364-UI_TextBox *TextBox_Initialise(void);
372+UI_TextBox *TextBox_Initialize(void);
365373 uint TextBox_SetBuffer(UI_TextBox *textbox, uint xchars, uint ychars, uint bpp, UI_Sheet *parent);
366374 uint TextBox_Show(UI_TextBox *textbox, uint height, int px, int py);
367375 uint TextBox_Put_Character(UI_TextBox *textbox, ushort keyid);
@@ -370,11 +378,11 @@
370378 bool TextBox_SetEnable_RecordInputText(UI_TextBox *textbox, bool enable);
371379
372380 /*timer.c タイマー関連*/
373-UI_TimerControl *Initialise_ProgrammableIntervalTimer(void);
381+UI_TimerControl *Initialize_ProgrammableIntervalTimer(void);
374382 void InterruptHandler20(uint *esp);
375383 void Timer_Set_TaskSwitch(void (*TaskSwitchFunction)(void));
376384 void Timer_TaskSwitch_Invalid(void);
377-UI_Timer *Timer_Initialise(void);
385+UI_Timer *Timer_Initialize(void);
378386 uint Timer_Config(UI_Timer *timer, uint tick_ms, DATA_FIFO32 *fifo, uint fifo_putdata, bool interval);
379387 uint Timer_Run(UI_Timer *timer);
380388 uint Timer_TimeOut(void);
--- beta/tolset_chn_000/chnos_010/chnos/cfunc.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/cfunc.c (revision 325)
@@ -230,7 +230,7 @@
230230
231231 CFunction_vsnprintf_WorkArea work;
232232
233- CFunction_vsnprintf_Initialise_WorkArea(&work, s, format, n, vargs);
233+ CFunction_vsnprintf_Initialize_WorkArea(&work, s, format, n, vargs);
234234
235235 flag_fill_zero = False;
236236 fill_length = 0xffffffff;
@@ -411,7 +411,7 @@
411411 return work.index_destination_buf;
412412 }
413413
414-void CFunction_vsnprintf_Initialise_WorkArea(CFunction_vsnprintf_WorkArea *work, uchar s[], const uchar format[], uint n, uint vargs[])
414+void CFunction_vsnprintf_Initialize_WorkArea(CFunction_vsnprintf_WorkArea *work, uchar s[], const uchar format[], uint n, uint vargs[])
415415 {
416416 work->destination_buf = s;
417417 work->length_destination_buf = n;
--- beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 325)
@@ -14,11 +14,12 @@
1414 UI_Timer *timer1, *timer2, *timer3;
1515 uint counter1, counter2, counter3;
1616 UI_TextBox *textbox;
17+ UI_Console *console;
1718
1819 i = 0;
1920 data = 0;
2021
21- Initialise_System();
22+ Initialize_System();
2223
2324 mytask = System_MultiTask_GetNowTask();
2425 disp_ctrl = System_Display_Get_Controller();
@@ -76,7 +77,7 @@
7677 }
7778 }
7879
79- sheet_desktop = Sheet_Initialise();
80+ sheet_desktop = Sheet_Initialize();
8081 Sheet_SetBuffer(sheet_desktop, Null, disp_ctrl->xsize, disp_ctrl->ysize, disp_ctrl->bpp);
8182
8283 Sheet_Drawing_Fill_Rectangle(sheet_desktop, 0xffffff, 0, 0, disp_ctrl->xsize - 1, disp_ctrl->ysize - 1);
@@ -89,11 +90,11 @@
8990 Drawing_Draw_Circle(disp_ctrl->vram, disp_ctrl->xsize, 100, 250, 0xc6c6c6, i);
9091 }
9192
92- testsheet = Sheet_Initialise();
93+ testsheet = Sheet_Initialize();
9394
94- sheet08 = Sheet_Initialise();
95- sheet16 = Sheet_Initialise();
96- sheet32 = Sheet_Initialise();
95+ sheet08 = Sheet_Initialize();
96+ sheet16 = Sheet_Initialize();
97+ sheet32 = Sheet_Initialize();
9798
9899 Sheet_SetBuffer(testsheet, Null, 256, 128, 8);
99100 Sheet_SetBuffer(sheet08, Null, 128, 128, 8);
@@ -108,7 +109,7 @@
108109
109110 Drawing08_Fill_Rectangle(testsheet->vram, testsheet->size.x, 0xc6c6c6, 4, 24, testsheet->size.x - 4 - 1, testsheet->size.y - 4 - 1);
110111
111- textbox = TextBox_Initialise();
112+ textbox = TextBox_Initialize();
112113 TextBox_SetBuffer(textbox, 20, 6, 8, testsheet);
113114 TextBox_Show(textbox, 0, 4, 24);
114115 TextBox_Put_Character(textbox, '>');
@@ -151,23 +152,28 @@
151152
152153 Sheet_SetParent(testsheet, vramsheet);
153154 Sheet_SetMovable(testsheet, True);
155+ Sheet_SetInputFIFO(testsheet, mytask->fifo);
154156 Sheet_Show(testsheet, 6, 10, 10);
155157
156- timer1 = Timer_Initialise();
158+ timer1 = Timer_Initialize();
157159 Timer_Config(timer1, 50, mytask->fifo, 11, True);
158160 counter1 = 0;
159161 //Timer_Run(timer1);
160162
161- timer2 = Timer_Initialise();
163+ timer2 = Timer_Initialize();
162164 Timer_Config(timer2, 50, mytask->fifo, 12, False);
163165 counter2 = 0;
164166 //Timer_Run(timer2);
165167
166- timer3 = Timer_Initialise();
168+ timer3 = Timer_Initialize();
167169 Timer_Config(timer3, 200, mytask->fifo, 13, True);
168170 counter3 = 0;
169171 //Timer_Run(timer3);
170172
173+ console = Console_Initialize();
174+ Console_SetSize(console, 20, 6);
175+ Console_Run(console);
176+
171177 for(;;){
172178 if(FIFO32_MyTaskFIFO_Status() == 0){
173179 System_MultiTask_Task_Sleep(mytask);
@@ -276,7 +282,7 @@
276282 #endif
277283
278284 #ifdef CHNOSPROJECT_DEBUG_MCT
279- mouseinfosheet = Sheet_Initialise();
285+ mouseinfosheet = Sheet_Initialize();
280286 Sheet_SetBuffer(mouseinfosheet, Null, (4 * 2) + (8 * 16), 4 + 16 + (4 * 2) + (16 * 4), 8);
281287 System_Sheet_SetParentToVRAM(mouseinfosheet);
282288 Sheet_Drawing_Fill_Rectangle(mouseinfosheet, 0x99cc33, 0, 0, mouseinfosheet->size.x - 1, mouseinfosheet->size.y - 1);
@@ -284,7 +290,7 @@
284290 Sheet_Drawing_Put_String(mouseinfosheet, 4, 4, 0xffffff, "MouseInfo");
285291 #endif
286292
287- mctrl = Initialise_Mouse();
293+ mctrl = Initialize_Mouse();
288294
289295 #ifdef CHNOSPROJECT_DEBUG_MCT
290296 debug("MCT:Mouse Initialized.\n");
@@ -332,6 +338,7 @@
332338 moveorg_mfocus.x = mcursor->cursor_sheet->location.x;
333339 moveorg_mfocus.y = mcursor->cursor_sheet->location.y;
334340 mfocus = Sheet_GetSheetFromLocation(mcursor->cursor_sheet->parent, mcursor->cursor_sheet->location.x, mcursor->cursor_sheet->location.y);
341+ System_InputFocus_Change(mfocus->input_fifo);
335342 if(mfocus != Null && mfocus->flags.bit.movable == False){
336343 mfocus = Null;
337344 }
@@ -372,7 +379,7 @@
372379 #endif
373380 }
374381 }
375- } else if(data == TCM_INFO_DISPLAY_UPDATE_RESOLUTION){
382+ } else if(data == TCM_OFFSET + TCM_INFO_DISPLAY_UPDATE_RESOLUTION){
376383 MouseCursor_Move_Absolute(mcursor, mcursor->cursor_sheet->parent->size.x >> 1, mcursor->cursor_sheet->parent->size.y >> 1);
377384 MouseCursor_Show(mcursor);
378385 #ifdef CHNOSPROJECT_DEBUG_MCT
--- beta/tolset_chn_000/chnos_010/chnos/emu86.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/emu86.c (revision 325)
@@ -39,7 +39,7 @@
3939 "BH"
4040 };
4141
42-void Emulator_x86_Initialise(Emulator_x86_Environment *env)
42+void Emulator_x86_Initialize(Emulator_x86_Environment *env)
4343 {
4444 env->EFLAGS.eflags = 0x00000002;
4545 env->EIP = 0x0000fff0;
--- beta/tolset_chn_000/chnos_010/chnos/structid.h (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/structid.h (revision 325)
@@ -2,3 +2,5 @@
22 #define SYSTEM_STRUCTID_UNDEFINED 0
33 #define SYSTEM_STRUCTID_SHEET 1
44 #define SYSTEM_STRUCTID_FIFO32 2
5+#define SYSTEM_STRUCTID_TEXTBOX 3
6+#define SYSTEM_STRUCTID_CONSOLE 4
--- beta/tolset_chn_000/chnos_010/chnos/memory.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/memory.c (revision 325)
@@ -40,7 +40,7 @@
4040 //ctrl[0].size = tags;
4141 //Memory Control配列は、管理対象のメモリの終端に配置される。
4242
43-IO_MemoryControl Memory_Initialise_Control(void *start, uint size, uint tags)
43+IO_MemoryControl Memory_Initialize_Control(void *start, uint size, uint tags)
4444 {
4545 IO_MemoryControl ctrl;
4646
--- beta/tolset_chn_000/chnos_010/chnos/dsctbl.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/dsctbl.c (revision 325)
@@ -1,7 +1,7 @@
11
22 #include "core.h"
33
4-void Initialise_GlobalDescriptorTable(void)
4+void Initialize_GlobalDescriptorTable(void)
55 {
66 uint i;
77
@@ -17,7 +17,7 @@
1717 return;
1818 }
1919
20-void Initialise_InterruptDescriptorTable(void)
20+void Initialize_InterruptDescriptorTable(void)
2121 {
2222 uint i;
2323
--- beta/tolset_chn_000/chnos_010/chnos/pci.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/pci.c (revision 325)
@@ -103,7 +103,7 @@
103103 uchar *PCI_GetDeviceClass(uint id);
104104 uchar *PCI_GetDeviceType(uint id);
105105
106-void Initialise_PCI(void)
106+void Initialize_PCI(void)
107107 {
108108 #ifdef CHNOSPROJECT_DEBUG_PCI
109109 uint data, bus, device, function;
--- beta/tolset_chn_000/chnos_010/chnos/timer.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/timer.c (revision 325)
@@ -3,7 +3,7 @@
33
44 UI_TimerControl *timerctrl;
55
6-UI_TimerControl *Initialise_ProgrammableIntervalTimer(void)
6+UI_TimerControl *Initialize_ProgrammableIntervalTimer(void)
77 {
88 timerctrl = (UI_TimerControl *)System_Memory_Allocate(sizeof(UI_TimerControl));
99
@@ -11,7 +11,7 @@
1111 timerctrl->TaskSwitch = &Timer_TaskSwitch_Invalid;
1212
1313 //config watch
14- timerctrl->timer_root = Timer_Initialise();
14+ timerctrl->timer_root = Timer_Initialize();
1515 Timer_Config(timerctrl->timer_root, 0xfffffff, Null, 0, True);
1616 timerctrl->timer_root->timeout = 0xffffffff;
1717 timerctrl->timer_root->flags.bit.running = True;
@@ -57,7 +57,7 @@
5757 return;
5858 }
5959
60-UI_Timer *Timer_Initialise(void)
60+UI_Timer *Timer_Initialize(void)
6161 {
6262 UI_Timer *timer;
6363
@@ -66,7 +66,7 @@
6666 timer->flags.bit.initialized = True;
6767
6868 #ifdef CHNOSPROJECT_DEBUG_TIMER
69- debug("Timer_Initialise:[0x%08X]\n", timer);
69+ debug("Timer_Initialize:[0x%08X]\n", timer);
7070 #endif
7171
7272 return timer;
--- beta/tolset_chn_000/chnos_010/chnos/fifo.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/fifo.c (revision 325)
@@ -4,7 +4,7 @@
44 //指定サイズは、バイト単位。4バイト切り捨て。
55 //内部サイズは、エントリ(uint=4byte)単位。
66
7-DATA_FIFO32 *FIFO32_Initialise(IO_MemoryControl memctrl, uint size)
7+DATA_FIFO32 *FIFO32_Initialize(IO_MemoryControl memctrl, uint size)
88 {
99 DATA_FIFO32 *fifo;
1010
@@ -26,10 +26,14 @@
2626 {
2727 uint eflags;
2828
29- if(!fifo->flags.initialized){
29+ if(fifo == Null){
3030 return -1;
3131 }
3232
33+ if(!fifo->flags.initialized){
34+ return -2;
35+ }
36+
3337 eflags = IO_Load_EFlags();
3438 IO_CLI();
3539
@@ -73,10 +77,14 @@
7377 uint *vargs;
7478 uint eflags;
7579
76- if(!fifo->flags.initialized){
80+ if(fifo == Null){
7781 return -1;
7882 }
7983
84+ if(!fifo->flags.initialized){
85+ return -2;
86+ }
87+
8088 if(args == 0){
8189 return 0;
8290 }
@@ -102,6 +110,10 @@
102110
103111 void FIFO32_Set_Task(DATA_FIFO32 *fifo, UI_Task *task)
104112 {
113+ if(fifo == Null){
114+ return;
115+ }
116+
105117 fifo->task = task;
106118 return;
107119 }
@@ -110,6 +122,10 @@
110122 {
111123 int data;
112124
125+ if(fifo == Null){
126+ return 0;
127+ }
128+
113129 if(!fifo->flags.initialized){
114130 return 0;
115131 }
@@ -131,6 +147,10 @@
131147
132148 uint FIFO32_Status(DATA_FIFO32 *fifo)
133149 {
150+ if(fifo == Null){
151+ return 0;
152+ }
153+
134154 if(!fifo->flags.initialized){
135155 return 0;
136156 }
@@ -140,6 +160,10 @@
140160
141161 void FIFO32_Free(DATA_FIFO32 *fifo)
142162 {
163+ if(fifo == Null){
164+ return;
165+ }
166+
143167 if(!fifo->flags.initialized){
144168 return;
145169 }
--- beta/tolset_chn_000/chnos_010/chnos/struct.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/struct.c (revision 325)
@@ -16,6 +16,12 @@
1616 case SYSTEM_STRUCTID_FIFO32:
1717 strsize = sizeof(DATA_FIFO32);
1818 break;
19+ case SYSTEM_STRUCTID_TEXTBOX:
20+ strsize = sizeof(UI_TextBox);
21+ break;
22+ case SYSTEM_STRUCTID_CONSOLE:
23+ strsize = sizeof(UI_Console);
24+ break;
1925 default:
2026 #ifdef CHNOSPROJECT_DEBUG_COMMON_STRUCT
2127 debug("System_CommonStruct_Allocate:Unknown Struct.\n");
@@ -35,6 +41,8 @@
3541 switch(str->structid){
3642 case SYSTEM_STRUCTID_SHEET:
3743 case SYSTEM_STRUCTID_FIFO32:
44+ case SYSTEM_STRUCTID_TEXTBOX:
45+ case SYSTEM_STRUCTID_CONSOLE:
3846 break;
3947 default:
4048 #ifdef CHNOSPROJECT_DEBUG_COMMON_STRUCT
--- beta/tolset_chn_000/chnos_010/chnos/mouse.c (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/mouse.c (revision 325)
@@ -32,7 +32,7 @@
3232 "***.....................",
3333 };
3434
35-IO_MouseControl *Initialise_Mouse(void)
35+IO_MouseControl *Initialize_Mouse(void)
3636 {
3737 IO_MouseControl *mctrl;
3838
@@ -98,7 +98,7 @@
9898 return;
9999 }
100100
101-UI_MouseCursor *MouseCursor_Initialise(UI_Sheet *parent)
101+UI_MouseCursor *MouseCursor_Initialize(UI_Sheet *parent)
102102 {
103103 UI_MouseCursor *mcursor;
104104 uint x, y;
@@ -108,7 +108,7 @@
108108 }
109109
110110 mcursor = System_Memory_Allocate(sizeof(UI_MouseCursor));
111- mcursor->cursor_sheet = Sheet_Initialise();
111+ mcursor->cursor_sheet = Sheet_Initialize();
112112
113113 mcursor->cursors[0] = System_Memory_Allocate(24 * 24 * (8 >> 3));
114114 for(y = 0; y < 24; y++){
--- beta/tolset_chn_000/chnos_010/chnos/coredef0.h (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef0.h (revision 325)
@@ -22,6 +22,7 @@
2222 //#define CHNOSPROJECT_DEBUG_PCI
2323 //#define CHNOSPROJECT_DEBUG_COMMON_STRUCT
2424 //#define CHNOSPROJECT_DEBUG_TEXTBOX
25+ #define CHNOSPROJECT_DEBUG_CONSOLE
2526 #endif
2627
2728 /*defines*/
@@ -327,7 +328,6 @@
327328
328329 /*FIFO buffer*/
329330 #define SIGNAL_ARGUMENTS_END 0xfefe1234
330-#define SIGNAL_KEY_OFFSET 0x10000
331331 /*task*/
332332 #define TASK_FIFOSIZE (4 * 64)
333333
--- beta/tolset_chn_000/chnos_010/chnos/coredef1.h (revision 324)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef1.h (revision 325)
@@ -463,7 +463,7 @@
463463 System_CommonStruct common_tag;
464464 struct UI_SHEET *parent; //one sheet has one parent(if vramseet then:0)
465465 struct UI_SHEET *next; //same level sheet link
466- struct UI_SHEET *child; //children lowest height
466+ struct UI_SHEET *child; //lowest height sheet in children
467467 DATA_Location2D location;
468468 DATA_Location2DU size;
469469 ushort bpp;
@@ -494,6 +494,7 @@
494494 uint (*Put_String)(struct UI_SHEET *sheet, int x, int y, uint fc, const uchar s[]);
495495 uint (*Draw_Point)(struct UI_SHEET *sheet, int x, int y, uint c);
496496 } Drawing;
497+ DATA_FIFO32 *input_fifo;
497498 } UI_Sheet;
498499
499500 /*timer*/
@@ -562,14 +563,17 @@
562563
563564 /*textbox*/
564565 typedef struct UI_TEXT_BOX {
566+ System_CommonStruct common_tag;
565567 UI_Sheet *sheet;
566568 uint forecol;
567569 uint backcol;
568570 DATA_Location2D location_cursor;
571+ DATA_Location2D location_cursor_record_started;
569572 DATA_Location2DU chars;
570573 uchar *text_buf;
571574 uint size_text_buf;
572575 uint using_text_buf;
576+
573577 union UI_TEXT_BOX_FLAGS {
574578 uint flags;
575579 struct UI_TEXT_BOX_BITS {
@@ -580,3 +584,17 @@
580584 } flags;
581585 } UI_TextBox;
582586
587+typedef struct UI_CONSOLE {
588+ UI_TextBox *textbox;
589+ UI_Task *task;
590+ union UI_CONSOLE_FLAGS {
591+ uint flags;
592+ struct UI_CONSOLE_BITS {
593+ unsigned initialized : 1;
594+ unsigned configured_size : 1;
595+ unsigned isprompt : 1;
596+ } bit;
597+ } flags;
598+} UI_Console;
599+
600+
旧リポジトリブラウザで表示