9 #define srand(seed) (void) (rand_seed = (seed))
\r
10 extern unsigned int rand_seed;
\r
13 #define RGB16(r,g,b) ((r)<<11|(g)<<5|(b))
\r
17 #include "core_set.h"
\r
19 /*new object types*/
\r
20 typedef enum _bool { false, true} bool;
\r
21 typedef enum _state_alloc { none, initialized, allocated, configured, inuse} state_alloc;
\r
22 typedef enum _col_text { black, blue, green, skyblue, red, purple, brown, white} col_text;
\r
23 typedef enum _timer_mode { once, interval} timer_mode;
\r
24 typedef enum _mouse_type { threebtn, threebtn_scroll} mouse_type;
\r
25 typedef enum _mcursor_state { normal, wait} mcursor_state;
\r
26 typedef unsigned char uchar;
\r
27 typedef unsigned short ushort;
\r
28 typedef unsigned int uint;
\r
29 typedef struct { uint low, high; } uint64;
\r
30 typedef uchar sector[512];
\r
33 struct SEGMENT_DESCRIPTOR {
\r
34 ushort limit_low, base_low;
\r
35 uchar base_mid, access_right;
\r
36 uchar limit_high, base_high;
\r
39 struct GATE_DESCRIPTOR {
\r
40 ushort offset_low, selector;
\r
41 uchar dw_count, access_right;
\r
45 struct ACPI_MemoryMapEntry {
\r
57 ushort scrnx, scrny;
\r
59 ushort VESA_Version;
\r
61 uint ACPI_MemoryMapEntries;
\r
62 struct ACPI_MemoryMapEntry ACPI_MemoryMap[16];
\r
66 struct VESAINFO {/*0xe00--->512byte*/
\r
67 ushort ModeAttributes;
\r
68 uchar WinAAttributes;
\r
69 uchar WinBAttributes;
\r
70 ushort WinGranularity;
\r
75 ushort BytesPerScanLine;
\r
80 uchar NumberOfPlanes;
\r
82 uchar NumberOfBanks;
\r
85 uchar NumberOfImagePages;
\r
88 uchar RedFieldPosition;
\r
89 uchar GreenMaskSize;
\r
90 uchar GreenFieldPosition;
\r
92 uchar BlueFieldPosition;
\r
94 uchar RsvdFieldPodition;
\r
95 uchar DirectColorModeInfo;
\r
101 uint p, q, size, free, flags;
\r
105 struct MEMORY_CONTROL_TAG {
\r
110 struct MEMORY_CONTROL {
\r
116 struct POSITION_2D {
\r
128 struct TIMER *next;
\r
129 struct TIMER *tree;
\r
132 struct FIFO32 *fifo;
\r
138 struct TIMER_CONTROL {
\r
140 struct TIMER *next;
\r
144 struct MOUSE_EVENT_ARGUMENTS {
\r
145 struct SHEET *focus;
\r
146 struct POSITION_2D move;
\r
147 struct POSITION_2D position_local;
\r
149 uint button_before;
\r
154 struct POSITION_2D position;
\r
155 struct POSITION_2D size;
\r
158 struct SHEET *next;
\r
159 struct SHEET *before;
\r
160 void (*Refresh)(struct SHEET *sheet, int px0, int py0, int px1, int py1);
\r
161 void (*WriteMap)(struct SHEET *sheet, int x0, int y0, int x1, int y1);
\r
163 bool mouse_movable;
\r
164 struct SHEET_CONTROL *myctrl;
\r
165 void (*MouseEventProcedure)(struct MOUSE_EVENT_ARGUMENTS *e);
\r
166 uint msignal_flags;
\r
167 struct FIFO32 *fifo;
\r
168 uint ksignal_flags;
\r
171 struct SHEET_CONTROL {
\r
174 struct POSITION_2D mainvramsize;
\r
178 struct MEMORY_CONTROL *memctrl;
\r
181 struct UI_INPUTBOX {
\r
182 struct SHEET *sheet;
\r
183 uint forecol, backcol;
\r
185 uint input_buf_size;
\r
187 struct POSITION_2D cursor;
\r
188 struct POSITION_2D prompt;
\r
193 struct MOUSE_DECODE {
\r
194 uint buf[4], scroll;
\r
195 struct POSITION_2D move;
\r
201 struct UI_MOUSE_CURSOR {
\r
202 struct SHEET *sheet;
\r
203 struct POSITION_2D position;
\r
204 struct POSITION_2D move_range0;
\r
205 struct POSITION_2D move_range1;
\r
206 mcursor_state state;
\r
209 struct DATA_CPU_IDENTITY {
\r
215 uchar brand_string[48];
\r
257 struct MEMORY_BLOCK {
\r
260 struct MEMORY_BLOCK *next;
\r
261 struct MEMORY_CONTROL *ctrl;
\r
262 uchar description[MEMORY_DESCRIPTION_LENGTH];
\r
265 struct TASK_STATUS_SEGMENT {
\r
266 ushort backlink, reserve00;
\r
268 ushort ss0, reserve01;
\r
270 ushort ss1, reserve02;
\r
272 ushort ss2, reserve03;
\r
284 ushort es, reserve04;
\r
285 ushort cs, reserve05;
\r
286 ushort ss, reserve06;
\r
287 ushort ds, reserve07;
\r
288 ushort fs, reserve08;
\r
289 ushort gs, reserve09;
\r
290 ushort ldtr, reserve10;
\r
291 ushort flags, iomap;
\r
294 struct TASK_CONTROL {
\r
295 struct TASK *now, *main, *idle, *next;
\r
300 struct TASK_STATUS_SEGMENT tss;
\r
302 uchar description[TASK_DESCRIPTION_LENGTH];
\r
307 struct CONSOLE *cons;
\r
311 struct LISTENER *next;
\r
312 struct FIFO32 *fifo;
\r
317 struct DEVICE_FLOPPYDISK {
\r
319 struct DEVICE_FLOPPYDISK_RDE {
\r
320 uchar name[8]; //0x00:empty
\r
322 //0x2e:(only directory)
\r
323 //. 0x2e:current directory
\r
324 //.. 0x2e, 0x2e:parent directory
\r
325 //0xe5:deleted(usable)
\r
327 uchar attribute; //bit0:readonly
\r
333 //0x0f=LongFileNameEntry
\r
335 uchar VFAT_createTimeMs;
\r
336 ushort VFAT_createTime;
\r
337 ushort VFAT_createDate;
\r
338 ushort VFAT_accessDate;
\r
339 ushort VFAT_clusterHighWord;
\r
340 ushort updatetime; //0 -4 bit:second/2
\r
343 ushort updatedate; //0 -4 bit:day(1-31)
\r
344 //5 -8 bit:month(1-12)
\r
345 //9 -15bit:year(from 1980)
\r
349 sector *userdataarea;
\r
360 struct SHEET *client;
\r
361 struct SHEET *control;
\r
362 uchar title[WINDOW_TITLE_LENGTH];
\r
363 struct WINDOW *next;
\r
367 struct WINDOW *win;
\r
368 struct UI_INPUTBOX *input;
\r
369 struct CONSOLE *next;
\r
370 struct FIFO32 fifo;
\r
371 struct TIMER *ctimer;
\r
372 struct FILEINFO app_codefile;
\r
377 struct SYSTEM_COMMON_DATA {
\r
378 struct BOOTINFO *bootinfo;
\r
379 struct VESAINFO *vesainfo;
\r
380 struct TASK *maintask;
\r
381 struct FIFO32 sysfifo;
\r
382 struct TASK *keyctrltask;
\r
383 struct FIFO32 keyboardfifo;
\r
384 struct FIFO32 keycmdfifo;
\r
386 struct TASK *mousectrltask;
\r
387 struct FIFO32 mousefifo;
\r
388 struct MOUSE_DECODE mousedecode;
\r
389 struct UI_MOUSE_CURSOR mouse_cursor;
\r
390 struct SHEET *focus;
\r
391 struct SHEET *key_focus;
\r
392 struct WINDOW windowctrl;
\r
393 struct CONSOLE consctrl;
\r
394 struct DEVICE_FLOPPYDISK *fd_boot;
\r
397 /*typedef structures*/
\r
398 typedef struct SEGMENT_DESCRIPTOR IO_SegmentDescriptor;
\r
399 typedef struct GATE_DESCRIPTOR IO_GateDescriptor;
\r
400 typedef struct BOOTINFO DATA_BootInfo;
\r
401 typedef struct VESAINFO DATA_VESAInfo;
\r
402 typedef struct FIFO32 DATA_FIFO;
\r
403 typedef struct MEMORY_CONTROL_TAG IO_MemoryControlTag;
\r
404 typedef struct MEMORY_CONTROL IO_MemoryControl;
\r
405 typedef struct POSITION_2D DATA_Position2D;
\r
406 typedef struct UI_INPUTBOX UI_InputBox;
\r
407 typedef struct KEYINFO UI_KeyInfo;
\r
408 typedef struct TIMER_CONTROL UI_TimerControl;
\r
409 typedef struct TIMER UI_Timer;
\r
410 typedef struct SHEET_CONTROL UI_Sheet_Control;
\r
411 typedef struct SHEET UI_Sheet;
\r
412 typedef struct MOUSE_DECODE UI_MouseInfo;
\r
413 typedef struct UI_MOUSE_CURSOR UI_MouseCursor;
\r
414 typedef struct DATA_CPU_IDENTITY DATA_CPUID;
\r
415 typedef struct MEMORY_BLOCK Memory;
\r
416 typedef struct TASK_STATUS_SEGMENT IO_TaskStatusSegment;
\r
417 typedef struct TASK_CONTROL UI_TaskControl;
\r
418 typedef struct TASK UI_Task;
\r
419 typedef struct LISTENER UI_Listener;
\r
420 typedef struct DEVICE_FLOPPYDISK_RDE IO_FloppyDisk_RootDirectoryEntry;
\r
421 typedef struct DEVICE_FLOPPYDISK IO_FloppyDisk;
\r
422 typedef struct FILEINFO IO_File;
\r
423 typedef struct WINDOW UI_Window;
\r
424 typedef struct MOUSE_EVENT_ARGUMENTS UI_MouseEventArguments;
\r
425 typedef struct CONSOLE UI_Console;
\r
426 typedef struct SYSTEM_COMMON_DATA System_CommonData;
\r
428 /*virtual classes*/
\r
431 extern uchar hankaku[4096];
\r
432 extern UI_Sheet_Control sys_sheet_ctrl;
\r
433 extern IO_MemoryControl sys_mem_ctrl;
\r
434 extern Memory SystemMemory;
\r
435 extern UI_TaskControl *taskctrl;
\r
436 extern uint *ADR_Paging_Directory;
\r
437 extern uchar *ACPI_MemoryMap_Type[5];
\r
440 /*api.c API
\8f\88\97\9d*/
\r
441 uint *API_Execute(uint edi, uint esi, uint ebp, uint esp, uint ebx, uint edx, uint ecx, uint eax);
\r
443 /*bootpack.c
\8aî
\8a²
\95\94\95ª*/
\r
444 void CHNOS_KeyboardControlTask(void);
\r
445 void CHNOS_MouseControlTask(void);
\r
446 void CHNOS_UI_KeyFocus_Change(UI_Sheet *focus_new);
\r
449 void Initialise_Console(UI_Console *consctrl, System_CommonData *systemdata);
\r
450 UI_Console *Console_Create(uint xchars, uint ychars);
\r
451 void Console_MainTask(UI_Console *cons);
\r
452 void Console_Command_memmap(UI_Console *cons);
\r
453 void Console_Command_memblock(UI_Console *cons);
\r
454 void Console_Command_mem(UI_Console *cons);
\r
455 void Console_Command_systeminfo(UI_Console *cons);
\r
456 void Console_Command_task(UI_Console *cons);
\r
457 void Console_Command_window(UI_Console *cons);
\r
458 void Console_Command_console(UI_Console *cons);
\r
459 void Console_Command_type(UI_Console *cons, const uchar filename[]);
\r
460 void Console_Command_dir(UI_Console *cons);
\r
461 void Console_Command_gdt(UI_Console *cons);
\r
462 void Console_Command_midi(UI_Console *cons, const uchar filename[]);
\r
463 uint Console_Command_midi_Convert_VariableLengthValue(uchar *base, uint *offset);
\r
464 void Console_Command_midi_Beep_Set_NoteNumber(uchar n);
\r
465 void Console_Execute(UI_Console *cons);
\r
466 void Console_Execute_CHNOSProject(UI_Console *cons, int n);
\r
467 void Console_Execute_haribote(UI_Console *cons, int n);
\r
470 void CPU_Identify(DATA_CPUID *id);
\r
472 /*dsctbl.c
\83f
\83B
\83X
\83N
\83\8a\83v
\83^
\81[
\81E
\83e
\81[
\83u
\83\8b\8aÖ
\98A*/
\r
473 void Initialise_GlobalDescriptorTable(void);
\r
474 void Initialise_InterruptDescriptorTable(void);
\r
475 void SegmentDescriptor_Set(IO_SegmentDescriptor *seg_desc, uint limit, uint base, uint ar);
\r
476 uint SegmentDescriptor_Get_Base(IO_SegmentDescriptor *seg_desc);
\r
477 uint SegmentDescriptor_Get_Limit(IO_SegmentDescriptor *seg_desc);
\r
478 uint SegmentDescriptor_Get_AccessRight(IO_SegmentDescriptor *seg_desc);
\r
479 void GateDescriptor_Set(IO_GateDescriptor *gate_desc, uint offset, uint selector, uint ar);
\r
480 void System_SegmentDescriptor_Set_Absolute(uint selector, uint limit, uint base, uint ar);
\r
481 uint System_SegmentDescriptor_Get_Base(uint selector);
\r
482 uint System_SegmentDescriptor_Get_Limit(uint selector);
\r
483 uint System_SegmentDescriptor_Get_AccessRight(uint selector);
\r
484 uint System_SegmentDescriptor_Set(uint limit, int base, int ar);
\r
485 void System_GateDescriptor_Set(uint irq, uint offset, uint selector, uint ar);
\r
487 /*fifo.c FIFO
\83o
\83b
\83t
\83@
\8aÖ
\98A*/
\r
488 int FIFO32_Initialise(DATA_FIFO *fifo, uint size);
\r
489 int FIFO32_Put(DATA_FIFO *fifo, uint data);
\r
490 int FIFO32_Put_Arguments(DATA_FIFO *fifo, uint args, ...);
\r
491 void FIFO32_Set_Task(DATA_FIFO *fifo, UI_Task *task);
\r
492 uint FIFO32_Get(DATA_FIFO *fifo);
\r
493 uint FIFO32_Status(DATA_FIFO *fifo);
\r
494 int FIFO32_Free(DATA_FIFO *fifo);
\r
496 /*file.c
\83t
\83@
\83C
\83\8b\8aÖ
\98A*/
\r
497 IO_FloppyDisk *FloppyDisk_Initialise(void *img);
\r
498 int FloppyDisk_Search_File(IO_FloppyDisk *fd, const uchar *name);
\r
499 int FloppyDisk_Load_File(IO_FloppyDisk *fd, IO_File *fileinfo, int fileno);
\r
500 int File_Free(IO_File *fileinfo);
\r
501 void FloppyDisk_Decode_FAT16(uchar *img, ushort *fat, bool backup);
\r
504 void Draw_Put_Font_08(void *vram, uint xsize, uint x, uint y, uint c, const uchar *font);
\r
505 void Draw_Put_String_08(void *vram, uint xsize, uint x, uint y, uint c, const uchar *s);
\r
506 void Draw_Fill_Rectangle_08(void *vram, uint xsize, uint c, uint x0, uint y0, uint x1, uint y1);
\r
507 void Draw_Slide_Line_08(void *vram, uint xsize, uint ysize, uint vxsize, uint px, uint py);
\r
508 void Draw_Initialise_Palette(void);
\r
509 void Draw_Set_Palette(int start, int end, uchar *rgb);
\r
511 void Draw_Put_Font_16(void *vram, uint xsize, uint x, uint y, uint c, const uchar *font);
\r
512 void Draw_Put_String_16(void *vram, uint xsize, uint x, uint y, uint c, const uchar *s);
\r
513 void Draw_Fill_Rectangle_16(void *vram, uint xsize, uint c, uint x0, uint y0, uint x1, uint y1);
\r
514 void Draw_Slide_Line_16(void *vram, uint xsize, uint ysize, uint vxsize, uint px, uint py);
\r
516 void Draw_Put_Font_32(void *vram, uint xsize, uint x, uint y, uint c, const uchar *font);
\r
517 void Draw_Put_String_32(void *vram, uint xsize, uint x, uint y, uint c, const uchar *s);
\r
518 void Draw_Fill_Rectangle_32(void *vram, uint xsize, uint c, uint x0, uint y0, uint x1, uint y1);
\r
519 void Draw_Slide_Line_32(void *vram, uint xsize, uint ysize, uint vxsize, uint px, uint py);
\r
521 void Initialise_Graphic(uint bpp);
\r
522 uchar RGB_32_To_08(uint c32);
\r
523 uchar RGB_32_To_08_xy(uint c32, int x, int y);
\r
524 ushort RGB_32_To_16(uint c32);
\r
525 extern void (*Draw_Put_String)(void *vram, uint xsize, uint x, uint y, uint c, const uchar *s);
\r
526 extern void (*Draw_Fill_Rectangle)(void *vram, uint xsize, uint c, uint x0, uint y0, uint x1, uint y1);
\r
527 extern void (*Draw_Slide_Line)(void *vram, uint xsize, uint ysize, uint vxsize, uint px, uint py);
\r
528 void Emergency_Out_Reset(void);
\r
529 int Emergency_Out(const uchar *format, ...);
\r
532 void Initialise_System(System_CommonData *systemdata);
\r
535 UI_InputBox *InputBox_Initialise(UI_Sheet_Control *sheetctrl, IO_MemoryControl *memctrl, uint x, uint y, uint xsize, uint ysize, uint txtbufsize, uint forecol, uint backcol, uint height);
\r
536 int InputBox_Put_String(UI_InputBox *box, const uchar *s);
\r
537 int InputBox_Put_Character(UI_InputBox *box, uchar c);
\r
538 void InputBox_Put_String_Main(UI_InputBox *box, const uchar *str);
\r
539 void InputBox_Check_NewLine(UI_InputBox *box);
\r
540 void InputBox_NewLine_No_Prompt(UI_InputBox *box);
\r
541 void InputBox_NewLine(UI_InputBox *box);
\r
542 void InputBox_Slide_Line(UI_InputBox *box);
\r
543 void InputBox_Slide_Line(UI_InputBox *box);
\r
544 void InputBox_Put_Prompt(UI_InputBox *box);
\r
545 void InputBox_Reset_Input_Buffer(UI_InputBox *box);
\r
546 void InputBox_Change_Cursor_State(UI_InputBox *box);
\r
547 void InputBox_Clear(UI_InputBox *box);
\r
548 void InputBox_Set_Record(UI_InputBox *box, bool record);
\r
550 /*intrpt.c
\8a\84\82è
\8d\9e\82Ý
\90Ý
\92è
\82Æ
\82Ç
\82±
\82É
\82à
\91®
\82³
\82È
\82¢
\8a\84\82è
\8d\9e\82Ý
\83n
\83\93\83h
\83\89\81[*/
\r
551 void Initialise_ProgrammableInterruptController(void);
\r
552 void InterruptHandler27(int *esp);
\r
555 uchar IO_Read_CMOS(uchar addr);
\r
556 void IO_Beep(uint fq, uint microsec);
\r
557 void IO_Wait(uint microsec);
\r
560 void Initialise_Keyboard(DATA_FIFO *sendto, DATA_FIFO *keycmd, uint offset, uint leds, int *keycmd_wait);
\r
561 void InterruptHandler21(int *esp);
\r
562 void Keyboard_Decode(UI_KeyInfo *info, uint data);
\r
563 void Keyboard_KeyLock(uint led);
\r
564 void Keyboard_Controller_Wait_SendReady(void);
\r
565 uint Keyboard_Get_KeyShift(void);
\r
567 /*memblock.c
\83\81\83\82\83\8a\8aÖ
\98A*/
\r
568 void Initialise_MemoryBlock(IO_MemoryControl *mainctrl);
\r
569 void *MemoryBlock_Allocate_System(uint size);
\r
570 void *MemoryBlock_Allocate_User(uint size, IO_MemoryControl *ctrl);
\r
571 Memory *MemoryBlock_Verify(void *addr);
\r
572 int MemoryBlock_Write_Description(void *addr, const uchar *description);
\r
573 int MemoryBlock_Free(void *addr);
\r
576 /*memory.c
\83\81\83\82\83\8a\8aÖ
\98A*/
\r
577 uint Memory_Test(uint start, uint end);
\r
578 void MemoryControl_Initialise(IO_MemoryControl *ctrl, void *start, uint size);
\r
579 uint MemoryControl_FreeSize(IO_MemoryControl *ctrl);
\r
580 void *MemoryControl_Allocate(IO_MemoryControl *ctrl, uint size);
\r
581 int MemoryControl_Free(IO_MemoryControl *ctrl, void *addr0, uint size);
\r
582 void *MemoryControl_Allocate_Page(IO_MemoryControl *ctrl);
\r
583 void MemoryControl_Output_Info(IO_MemoryControl *ctrl);
\r
584 void System_MemoryControl_Initialise(void);
\r
585 uint System_MemoryControl_FullSize(void);
\r
586 uint System_MemoryControl_FreeSize(void);
\r
587 void *System_MemoryControl_Allocate(uint size);
\r
588 int System_MemoryControl_Free(void *addr0, uint size);
\r
589 void *System_MemoryControl_Allocate_Page(void);
\r
590 void System_MemoryControl_Output_Info(void);
\r
592 /*mouse.c
\83}
\83E
\83X
\8aÖ
\98A*/
\r
593 extern uchar mcursor_pattern0[24][24];
\r
594 void Initialise_Mouse(DATA_FIFO *sendto, uint offset, UI_MouseInfo *decode);
\r
595 void InterruptHandler2c(int *esp);
\r
596 int Mouse_Decode(uint data);
\r
597 void Mouse_Send_Command(uint data);
\r
598 void Mouse_Make_MouseCursor(UI_MouseCursor *cursor, int rangex0, int rangey0, int rangex1, int rangey1, uint height);
\r
599 void Mouse_Draw_MouseCursor(UI_MouseCursor *cursor, mcursor_state state);
\r
600 void Mouse_Move_Relative(UI_MouseCursor *cursor, int movex, int movey);
\r
601 void Mouse_Move_Absolute(UI_MouseCursor *cursor, int px, int py);
\r
603 /*mtask.c
\83}
\83\8b\83`
\83^
\83X
\83N
\8aÖ
\98A*/
\r
604 void Initialise_MultiTask(void);
\r
605 UI_Task *MultiTask_Task_Get(const uchar *description);
\r
606 void MultiTask_Task_Change_Quantum(UI_Task *task, uint quantum);
\r
607 void MultiTask_Task_Run(UI_Task *task);
\r
608 void MultiTask_Task_Sleep(UI_Task *task);
\r
609 void MultiTask_Task_Remove(UI_Task *task);
\r
610 void MultiTask_Task_Arguments(UI_Task *task, int args, ...);
\r
611 void MultiTask_TaskSwitch(void);
\r
612 UI_Task *MultiTask_Get_NowTask(void);
\r
613 void MultiTask_IdleTask(void);
\r
615 /*paging.c
\83y
\81[
\83W
\83\93\83O
\8aÖ
\98A*/
\r
616 void Initialise_Paging(void *vram, uint xsize, uint ysize, uint bpp);
\r
617 void Paging_Set_Entry_Directory(uint *dir_entry, uint *table_base, uint attribute, uint available);
\r
618 void Paging_Set_Entry_Table(uint *table_entry, uint *page_base, uint attribute, uint available);
\r
619 uint *Paging_Get_Entry_Setting_Address(uint entry);
\r
621 /*serial.c
\83V
\83\8a\83A
\83\8b\92Ê
\90M
\8aÖ
\98A*/
\r
622 void Initialise_SerialPort(void);
\r
623 void Send_SerialPort(uchar *s);
\r
624 int debug(const uchar *format, ...);
\r
626 /*sheet.c
\83V
\81[
\83g
\8aÖ
\98A*/
\r
627 void Sheet_Initialise(UI_Sheet_Control *sheetctrl, IO_MemoryControl *memctrl, void *vram, uint xsize, uint ysize, uint bpp);
\r
628 UI_Sheet *Sheet_Get(UI_Sheet_Control *ctrl, uint xsize, uint ysize, uint bpp, uint invcol);
\r
629 uint Sheet_Show(UI_Sheet *sheet, int px, int py, uint height);
\r
630 void Sheet_Set_Movable(UI_Sheet *sheet, bool movable);
\r
631 void Sheet_Set_MouseEventProcedure(UI_Sheet *sheet, void (*procedure)(UI_MouseEventArguments *e), uint flags);
\r
632 void Sheet_Set_FIFO(UI_Sheet *sheet, DATA_FIFO *fifo, uint flags);
\r
633 void Sheet_Slide(UI_Sheet *sheet, int px, int py);
\r
634 uint Sheet_UpDown(UI_Sheet *sheet, uint height);
\r
635 void Sheet_Remove(UI_Sheet *sheet);
\r
636 void Sheet_Refresh_Map(UI_Sheet *sheet, int x0, int y0, int x1, int y1);
\r
637 void Sheet_Write_Map_32(UI_Sheet *sheet, int x0, int y0, int x1, int y1);
\r
638 void Sheet_Write_Map_16(UI_Sheet *sheet, int x0, int y0, int x1, int y1);
\r
639 void Sheet_Write_Map_08(UI_Sheet *sheet, int x0, int y0, int x1, int y1);
\r
640 void Sheet_Write_Map_NoInvisible(UI_Sheet *sheet, int x0, int y0, int x1, int y1);
\r
641 void Sheet_Refresh_All(UI_Sheet *sheet0, UI_Sheet *sheet1, int x0, int y0, int x1, int y1);
\r
642 void Sheet_Refresh_32from32(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
\r
643 void Sheet_Refresh_16from32(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
\r
644 void Sheet_Refresh_08from32(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
\r
645 void Sheet_Refresh_16from16(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
\r
646 void Sheet_Refresh_08from08(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
\r
647 void Sheet_Refresh_Invalid(UI_Sheet *sheet, int px0, int py0, int px1, int py1);
\r
648 void Sheet_Draw_Put_String(UI_Sheet *sheet, uint x, uint y, uint c, const uchar *s);
\r
649 void Sheet_Draw_Put_String_With_BackColor(UI_Sheet *sheet, uint x, uint y, uint c, uint bc, const uchar *s);
\r
650 void Sheet_Draw_Fill_Rectangle(UI_Sheet *sheet, uint c, uint x0, uint y0, uint x1, uint y1);
\r
651 void Sheet_Draw_Fill_Rectangle_Gradation_Vertical(UI_Sheet *sheet, uint c0, uint c1, uint x0, uint y0, uint x1, uint y1);
\r
652 void Sheet_Draw_Point(UI_Sheet *sheet, uint c, uint x, uint y);
\r
653 void System_Sheet_Initialise(void *vram, uint xsize, uint ysize, uint bpp);
\r
654 UI_Sheet *System_Sheet_Get(uint xsize, uint ysize, uint bpp, uint invcol);
\r
655 UI_Sheet *Sheet_Get_From_Position(UI_Sheet_Control *ctrl, int x, int y);
\r
656 uint Sheet_Get_Top_Of_Height(UI_Sheet_Control *ctrl);
\r
657 uint System_Sheet_Get_Top_Of_Height(void);
\r
659 /*timer.c
\83^
\83C
\83}
\81[
\8aÖ
\98A*/
\r
660 void Initialise_ProgrammableIntervalTimer(void);
\r
661 void InterruptHandler20(int *esp);
\r
662 uint Timer_Get_Tick(void);
\r
663 UI_Timer *Timer_Get(DATA_FIFO *fifo, uint data);
\r
664 void Timer_Set(UI_Timer *timer, uint count, timer_mode mode);
\r
665 void Timer_Run(UI_Timer *timer);
\r
666 void Timer_Cancel(UI_Timer *timer);
\r
667 void Timer_TaskSwitch_Set(UI_Timer *ts);
\r
669 /*window.c
\83E
\83B
\83\93\83h
\83E
\8aÖ
\98A*/
\r
670 void Initialise_Window(UI_Window *windowctrl);
\r
671 UI_Window *Window_Create(const uchar *title, uint flags, uint xsize, uint ysize);
\r
672 UI_Window *Window_Create_User(const uchar *title, uint flags, UI_Sheet *client);
\r
673 UI_Window *Window_Get_From_Sheet(UI_Sheet *sheet);
\r
674 void Window_Control_MouseEventProcedure(UI_MouseEventArguments *e);
\r
675 void Window_Draw_CloseButton(UI_Window *win, bool pressed);
\r
677 /*xception.c CPU
\97á
\8aO
\8aÖ
\98A*/
\r
678 void CPU_Exception_Abort(int exception, int *esp);
\r
679 uint *CPU_Exception_Fault(int exception, int *esp);
\r
680 void CPU_ExceptionHandler00(int *esp);
\r
681 void CPU_ExceptionHandler01(int *esp);
\r
682 void CPU_ExceptionHandler02(int *esp);
\r
683 void CPU_ExceptionHandler03(int *esp);
\r
684 void CPU_ExceptionHandler04(int *esp);
\r
685 void CPU_ExceptionHandler05(int *esp);
\r
686 void CPU_ExceptionHandler06(int *esp);
\r
687 void CPU_ExceptionHandler07(int *esp);
\r
688 void CPU_ExceptionHandler08(int *esp);
\r
689 void CPU_ExceptionHandler09(int *esp);
\r
690 void CPU_ExceptionHandler0a(int *esp);
\r
691 void CPU_ExceptionHandler0b(int *esp);
\r
692 void CPU_ExceptionHandler0c(int *esp);
\r
693 uint *CPU_ExceptionHandler0d(int *esp);
\r
694 void CPU_ExceptionHandler0e(int *esp);
\r
695 void CPU_ExceptionHandler0f(int *esp);
\r
696 void CPU_ExceptionHandler10(int *esp);
\r
697 void CPU_ExceptionHandler11(int *esp);
\r
698 void CPU_ExceptionHandler12(int *esp);
\r
699 void CPU_ExceptionHandler13(int *esp);
\r
700 void CPU_ExceptionHandler14(int *esp);
\r
701 void CPU_ExceptionHandler15(int *esp);
\r
702 void CPU_ExceptionHandler16(int *esp);
\r
703 void CPU_ExceptionHandler17(int *esp);
\r
704 void CPU_ExceptionHandler18(int *esp);
\r
705 void CPU_ExceptionHandler19(int *esp);
\r
706 void CPU_ExceptionHandler1a(int *esp);
\r
707 void CPU_ExceptionHandler1b(int *esp);
\r
708 void CPU_ExceptionHandler1c(int *esp);
\r
709 void CPU_ExceptionHandler1d(int *esp);
\r
710 void CPU_ExceptionHandler1e(int *esp);
\r
711 void CPU_ExceptionHandler1f(int *esp);
\r
713 /*nasfunc0.nas
\91¼
\82Ì
\8aÖ
\90\94\82É
\91S
\82
\88Ë
\91¶
\82µ
\82È
\82¢
\83A
\83Z
\83\93\83u
\83\89\8aÖ
\90\94\8cQ*/
\r
714 void IO_HLT(void); //CPU
\82ð
\92â
\8e~
\82³
\82¹
\82é
\81B
\8a\84\82è
\8d\9e\82Ý
\82ª
\82 \82é
\82Æ
\8dÄ
\8aJ
\82·
\82é
\81B
\93Á
\8c \96½
\97ß
\81B
\r
715 void IO_CLI(void); //CPU
\82Ö
\82Ì
\8aO
\95\94\8a\84\82è
\8d\9e\82Ý
\82ð
\92â
\8e~
\82³
\82¹
\82é
\81B
\93Á
\8c \96½
\97ß
\81BNMI
\82Æ
\97á
\8aO
\82É
\82Í
\8cø
\82©
\82È
\82¢
\81B
\r
716 void IO_STI(void); //CPU
\82Ö
\82Ì
\8aO
\95\94\8a\84\82è
\8d\9e\82Ý
\82ð
\8dÄ
\8aJ
\82³
\82¹
\82é
\81B
\93Á
\8c \96½
\97ß
\81B
\r
717 void IO_STIHLT(void); //CPU
\82Ö
\82Ì
\8aO
\95\94\8a\84\82è
\8d\9e\82Ý
\82ð
\8dÄ
\8aJ
\82³
\82¹
\82½
\8cã
\81ACPU
\82ð
\92â
\8e~
\82³
\82¹
\82é
\81Bsti
\82Æhlt
\82Ì
\8aÔ
\82É
\94
\90¶
\82·
\82é
\8a\84\82è
\8d\9e\82Ý
\82Ö
\82Ì
\91Î
\8dô
\81B
\81B
\r
718 uint IO_In8(uint port); //port
\94Ô
\82ÌI/O
\83|
\81[
\83g
\82©
\82ç
\83f
\81[
\83^
\82ð
\83o
\83C
\83g
\92P
\88Ê
\82Å
\8eó
\82¯
\8eæ
\82é
\81B
\96ß
\82è
\92l
\82Í
\8eó
\82¯
\8eæ
\82Á
\82½
\83f
\81[
\83^
\81BI/O
\93Á
\8c \96½
\97ß
\81B
\r
719 void IO_Out8(uint port, uint data); //port
\94Ô
\82ÌI/O
\83|
\81[
\83g
\82Édata
\82ð
\83o
\83C
\83g
\92P
\88Ê
\82Å
\8fo
\97Í
\82·
\82é
\81BI/O
\93Á
\8c \96½
\97ß
\81B
\r
720 uint IO_In16(uint port); //port
\94Ô
\82ÌI/O
\83|
\81[
\83g
\82©
\82ç
\83f
\81[
\83^
\82ð
\83\8f\81[
\83h
\92P
\88Ê
\82Å
\8eó
\82¯
\8eæ
\82é
\81B
\96ß
\82è
\92l
\82Í
\8eó
\82¯
\8eæ
\82Á
\82½
\83f
\81[
\83^
\81BI/O
\93Á
\8c \96½
\97ß
\81B
\r
721 void IO_Out16(uint port, uint data); //port
\94Ô
\82ÌI/O
\83|
\81[
\83g
\82Édata
\82ð
\83\8f\81[
\83h
\92P
\88Ê
\82Å
\8fo
\97Í
\82·
\82é
\81BI/O
\93Á
\8c \96½
\97ß
\81B
\r
722 uint IO_In32(uint port); //port
\94Ô
\82ÌI/O
\83|
\81[
\83g
\82©
\82ç
\83f
\81[
\83^
\82ð
\83_
\83u
\83\8b\83\8f\81[
\83h
\92P
\88Ê
\82Å
\8eó
\82¯
\8eæ
\82é
\81B
\96ß
\82è
\92l
\82Í
\8eó
\82¯
\8eæ
\82Á
\82½
\83f
\81[
\83^
\81BI/O
\93Á
\8c \96½
\97ß
\81B
\r
723 void IO_Out32(uint port, uint data); //port
\94Ô
\82ÌI/O
\83|
\81[
\83g
\82Édata
\82ð
\83_
\83u
\83\8b\83\8f\81[
\83h
\92P
\88Ê
\82Å
\8fo
\97Í
\82·
\82é
\81BI/O
\93Á
\8c \96½
\97ß
\81B
\r
724 uint IO_Load_EFlags(void); //EFLAGS
\83\8c\83W
\83X
\83^
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
\81B
\r
725 void IO_Store_EFlags(uint eflags); //EFLAGS
\83\8c\83W
\83X
\83^
\82ðeflags
\82É
\95Ï
\8dX
\82·
\82é
\81B
\r
726 uint Load_CR0(void); //
\83R
\83\93\83g
\83\8d\81[
\83\8b\83\8c\83W
\83X
\83^0
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
\81B
\93Á
\8c \96½
\97ß
\81B
\r
727 void Store_CR0(uint cr0); //
\83R
\83\93\83g
\83\8d\81[
\83\8b\83\8c\83W
\83X
\83^0
\82ðcr0
\82É
\95Ï
\8dX
\82·
\82é
\81B
\93Á
\8c \96½
\97ß
\81B
\r
728 uint Load_CR2(void); //
\83R
\83\93\83g
\83\8d\81[
\83\8b\83\8c\83W
\83X
\83^2
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
\81B
\93Á
\8c \96½
\97ß
\81B
\r
729 void Store_CR2(uint cr2); //
\83R
\83\93\83g
\83\8d\81[
\83\8b\83\8c\83W
\83X
\83^2
\82ðcr2
\82É
\95Ï
\8dX
\82·
\82é
\81B
\93Á
\8c \96½
\97ß
\81B
\r
730 uint Load_CR3(void); //
\83R
\83\93\83g
\83\8d\81[
\83\8b\83\8c\83W
\83X
\83^3
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
\81B
\93Á
\8c \96½
\97ß
\81B
\r
731 void Store_CR3(uint cr3); //
\83R
\83\93\83g
\83\8d\81[
\83\8b\83\8c\83W
\83X
\83^3
\82ðcr3
\82É
\95Ï
\8dX
\82·
\82é
\81B
\93Á
\8c \96½
\97ß
\81B
\r
732 uint Load_CR4(void); //
\83R
\83\93\83g
\83\8d\81[
\83\8b\83\8c\83W
\83X
\83^4
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
\81B
\93Á
\8c \96½
\97ß
\81B
\r
733 void Store_CR4(uint cr4); //
\83R
\83\93\83g
\83\8d\81[
\83\8b\83\8c\83W
\83X
\83^4
\82ðcr4
\82É
\95Ï
\8dX
\82·
\82é
\81B
\93Á
\8c \96½
\97ß
\81B
\r
734 void Load_GDTR(uint limit, uint addr); //
\83O
\83\8d\81[
\83o
\83\8b\81E
\83f
\83B
\83X
\83N
\83\8a\83v
\83^
\81E
\83e
\81[
\83u
\83\8b\81E
\83\8c\83W
\83X
\83^(GDTR)
\82É
\81Aaddr
\82©
\82çlimit
\82Ì
\94Í
\88Í
\82ðGDT
\82Æ
\82µ
\82Ä
\83\8d\81[
\83h
\82³
\82¹
\82é
\81B
\93Á
\8c \96½
\97ß
\81B
\r
735 void Load_IDTR(uint limit, uint addr); //
\83C
\83\93\83^
\83\89\83v
\83g
\81E
\83f
\83B
\83X
\83N
\83\8a\83v
\83^
\81E
\83e
\81[
\83u
\83\8b\81E
\83\8c\83W
\83X
\83^(IDTR)
\82É
\81Aaddr
\82©
\82çlimit
\82Ì
\94Í
\88Í
\82ðIDT
\82Æ
\82µ
\82Ä
\83\8d\81[
\83h
\82³
\82¹
\82é
\81B
\93Á
\8c \96½
\97ß
\81B
\r
736 void Load_TR(uint tr); //
\83Z
\83O
\83\81\83\93\83g
\81E
\83Z
\83\8c\83N
\83^tr
\82ð
\81A
\83^
\83X
\83N
\83\8c\83W
\83X
\83^
\82É
\8c»
\8dÝ
\82Ì
\83^
\83X
\83N
\82Æ
\82µ
\82Ä
\83\8d\81[
\83h
\82³
\82¹
\82é
\81B
\93Á
\8c \96½
\97ß
\81B
\r
737 void FarJMP(uint eip, uint cs); //
\8c»
\8dÝ
\82Ì
\83Z
\83O
\83\81\83\93\83g
\82Æ
\82Í
\88Ù
\82È
\82é
\83Z
\83O
\83\81\83\93\83gcs
\82Ì
\83I
\83t
\83Z
\83b
\83geip
\82É
\83v
\83\8d\83O
\83\89\83\80\82Ì
\90§
\8cä
\82ð
\88Ú
\82·
\81B
\r
738 void FarCall(uint eip, uint cs); //
\8c»
\8dÝ
\82Ì
\83Z
\83O
\83\81\83\93\83g
\82Æ
\82Í
\88Ù
\82È
\82é
\83Z
\83O
\83\81\83\93\83gcs
\82Ì
\83I
\83t
\83Z
\83b
\83geip
\82É
\83v
\83\8d\83O
\83\89\83\80\82Ì
\90§
\8cä
\82ð
\95ª
\8aò
\82³
\82¹
\82é
\81B
\r
739 void CLTS(void); //
\83R
\83\93\83g
\83\8d\81[
\83\8b\81E
\83\8c\83W
\83X
\83^0
\93à
\82É
\82 \82é
\81ATask-Switched
\83t
\83\89\83O
\82ð
\83N
\83\8a\83A
\82·
\82é
\81BFPU
\82Ì
\90§
\8cä
\82É
\97\98\97p
\81B
\93Á
\8c \96½
\97ß
\81B
\r
740 void FNSave(uint *addr); //FPU
\93®
\8dì
\8aÂ
\8b«
\82ðaddr
\82©
\82ç
\8en
\82Ü
\82é108
\83o
\83C
\83g
\82É
\8ai
\94[
\82µ
\81AFPU
\82ð
\8f\89\8aú
\89»
\82·
\82é
\81B
\8fÚ
\8d×
\82È
\83`
\83F
\83b
\83N
\82Í
\8ds
\82í
\82È
\82¢
\81B
\r
741 void FRStore(uint *addr); //FPU
\93®
\8dì
\8aÂ
\8b«
\82ðaddr
\82©
\82ç
\8en
\82Ü
\82é108
\83o
\83C
\83g
\82©
\82ç
\95\9c\8c³
\82·
\82é
\81B
\r
742 void PIT_Beep_On(void); //
\83r
\81[
\83v
\89¹
\82ð
\8aJ
\8en
\82·
\82é
\81B
\r
743 void PIT_Beep_Off(void); //
\83r
\81[
\83v
\89¹
\82ð
\92â
\8e~
\82·
\82é
\81B
\r
744 void PIT_Beep_Set(uint fq); //
\83r
\81[
\83v
\89¹
\82Ì
\8eü
\94g
\90\94\82ð
\81AfqHz
\82É
\95Ï
\8dX
\82·
\82é
\81B
\r
746 //C:262 C#:277 D:294 D#:311 E:330 F:349 F#:370 G:392 G#:415 A:440 A#:466 B:494 C:523
\r
747 void CPUID(void *addr, uint id); //addr
\94Ô
\92n
\82Ìuint[4]
\82É
\81ACPU
\82Ì
\8e¯
\95Ê
\8fî
\95ñid
\94Ô
\82ðEAX
\81EEBX
\81EEDX
\81EECX
\82Ì
\8f\87\94Ô
\82Å
\8ai
\94[
\82·
\82é
\81B
\r
748 void CPUID2(void *addr, uint id); //addr
\94Ô
\92n
\82Ìuint[4]
\82É
\81ACPU
\82Ì
\8e¯
\95Ê
\8fî
\95ñid
\94Ô
\82ðEAX
\81EEBX
\81EECX
\81EEDX
\82Ì
\8f\87\94Ô
\82Å
\8ai
\94[
\82·
\82é
\81B
\r
749 //
\8fã
\8bL
\93ñ
\82Â
\82Ì
\8aÖ
\90\94\82Í
\81AEFLAGS
\93à
\82ÌID
\83t
\83\89\83O(
\83r
\83b
\83g21)
\82ª
\95Ï
\8dX
\89Â
\94\
\82È
\8fê
\8d\87\82Ì
\82Ý
\8eÀ
\8ds
\82Å
\82«
\82é
\81B
\r
750 void Read_TSC(uint *addr); //addr
\94Ô
\92n
\82Ìuint[2]
\82É
\81A
\83}
\83V
\83\93\8cÅ
\97L
\83\8c\83W
\83X
\83^(MSR)
\93à
\82É
\82 \82é
\81A
\83^
\83C
\83\80\81E
\83X
\83^
\83\93\83v
\81E
\83J
\83E
\83\93\83^
\82Ì
\8fã
\88Ê
\81E
\89º
\88Ê
\82»
\82ê
\82¼
\82ê32
\83r
\83b
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ
\81B
\r
751 //
\82±
\82Ì
\8aÖ
\90\94\82Í
\81Acpuid
\82ÌTSC
\83r
\83b
\83g
\82ª
\97L
\8cø
\82Å
\82È
\82¯
\82ê
\82Î
\8eg
\97p
\82Å
\82«
\82È
\82¢
\81B
\r
752 uint Memory_Test_Sub(uint start, uint end);
\r
753 void INT_3(void); //
\83u
\83\8c\81[
\83N
\83|
\83C
\83\93\83g
\97á
\8aO
\82ð
\94
\90¶
\82³
\82¹
\82é
\81B
\r
754 void APP_Run(uint eip, uint cs, uint esp, uint ds, uint *esp0);
\r
756 /*nasfunc1.nas C
\8c¾
\8cê
\82Ì
\8aÖ
\90\94\82É
\88Ë
\91¶
\82·
\82é
\8aÖ
\90\94\8cQ
\81B
\82¨
\82à
\82É
\8a\84\82è
\8d\9e\82Ý
\8aÖ
\8cW
\81B*/
\r
757 void asm_CPU_ExceptionHandler00(void);
\r
758 void asm_CPU_ExceptionHandler01(void);
\r
759 void asm_CPU_ExceptionHandler02(void);
\r
760 void asm_CPU_ExceptionHandler03(void);
\r
761 void asm_CPU_ExceptionHandler04(void);
\r
762 void asm_CPU_ExceptionHandler05(void);
\r
763 void asm_CPU_ExceptionHandler06(void);
\r
764 void asm_CPU_ExceptionHandler07(void);
\r
765 void asm_CPU_ExceptionHandler08(void);
\r
766 void asm_CPU_ExceptionHandler09(void);
\r
767 void asm_CPU_ExceptionHandler0a(void);
\r
768 void asm_CPU_ExceptionHandler0b(void);
\r
769 void asm_CPU_ExceptionHandler0c(void);
\r
770 void asm_CPU_ExceptionHandler0d(void);
\r
771 void asm_CPU_ExceptionHandler0e(void);
\r
772 void asm_CPU_ExceptionHandler0f(void);
\r
773 void asm_CPU_ExceptionHandler10(void);
\r
774 void asm_CPU_ExceptionHandler11(void);
\r
775 void asm_CPU_ExceptionHandler12(void);
\r
776 void asm_CPU_ExceptionHandler13(void);
\r
777 void asm_CPU_ExceptionHandler14(void);
\r
778 void asm_CPU_ExceptionHandler15(void);
\r
779 void asm_CPU_ExceptionHandler16(void);
\r
780 void asm_CPU_ExceptionHandler17(void);
\r
781 void asm_CPU_ExceptionHandler18(void);
\r
782 void asm_CPU_ExceptionHandler19(void);
\r
783 void asm_CPU_ExceptionHandler1a(void);
\r
784 void asm_CPU_ExceptionHandler1b(void);
\r
785 void asm_CPU_ExceptionHandler1c(void);
\r
786 void asm_CPU_ExceptionHandler1d(void);
\r
787 void asm_CPU_ExceptionHandler1e(void);
\r
788 void asm_CPU_ExceptionHandler1f(void);
\r
789 void asm_InterruptHandler20(void);
\r
790 void asm_InterruptHandler21(void);
\r
791 void asm_InterruptHandler27(void);
\r
792 void asm_InterruptHandler2c(void);
\r
793 void asm_API_Execute(void);
\r