Rev 6603 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6603 | Rev 6699 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; ãªæ¨¨ à ¡®âë á ª®á®«ìî ¤«ï ¯à®£à ¬¬ ®«¨¡à¨ |
1 | ; ãªæ¨¨ à ¡®âë á ª®á®«ìî ¤«ï ¯à®£à ¬¬ ®«¨¡à¨ |
2 | ; diamond, 2006-2008 |
2 | ; diamond, 2006-2008 |
Line -... | Line 3... | ||
- | 3 | ||
Line 3... | Line -... | ||
3 | - | ||
4 | - | ||
5 | format MS COFF |
- | |
6 | - | ||
7 | public EXPORTS |
4 | format PE console 0.8 DLL at 7FEF0000h |
Line 8... | Line 5... | ||
8 | 5 | ||
9 | section '.flat' code readable align 16 |
6 | section '.flat' code readable executable |
10 | - | ||
11 | include 'font.inc' |
7 | |
12 | include 'conscrl.inc' |
- | |
13 | - | ||
14 | ;void __stdcall START(dword state); |
- | |
15 | START: |
- | |
16 | ; N.B. The current kernel implementation does not require |
- | |
17 | ; evident heap initialization, because if DLL is loaded, heap is already initialized |
- | |
18 | ; (if heap was not initialized, loader does this implicitly). |
- | |
19 | ; So this action does nothing useful, but nothing harmful. |
- | |
20 | push ebx |
- | |
21 | push 68 |
- | |
22 | pop eax |
- | |
23 | push 11 |
- | |
24 | pop ebx |
- | |
25 | int 0x40 |
- | |
Line 26... | Line 8... | ||
26 | pop ebx |
8 | include 'font.inc' |
27 | or eax, -1 |
9 | include 'conscrl.inc' |
28 | ret 4 |
10 | include '../../../export.inc' |
Line 29... | Line 11... | ||
29 | 11 | ||
30 | ; ¨æ¨ «¨§ æ¨ï ª®á®«¨ |
12 | ; ¨æ¨ «¨§ æ¨ï ª®á®«¨ |
- | 13 | ; void __stdcall con_init(dword wnd_width, dword wnd_height, |
|
- | 14 | ; dword scr_width, dword scr_height, const char* title); |
|
- | 15 | ||
- | 16 | align 4 |
|
- | 17 | con_init: |
|
Line 31... | Line 18... | ||
31 | ; void __stdcall con_init(dword wnd_width, dword wnd_height, |
18 | mov [con_flags], 7 |
32 | ; dword scr_width, dword scr_height, const char* title); |
19 | mov [con.cursor_height], (15*font_height+50)/100 |
33 | 20 | mov [con.input_start], con.input_buffer |
|
34 | align 4 |
21 | mov [con.input_end], con.input_buffer |
Line 1838... | Line 1825... | ||
1838 | popad |
1825 | popad |
1839 | ret |
1826 | ret |
Line 1840... | Line 1827... | ||
1840 | 1827 | ||
1841 | ; ®â®ª ®ª ª®á®«¨. ¡à ¡ âë¢ ¥â ¢¢®¤ ¨ ¢ë¢®¤. |
1828 | ; ®â®ª ®ª ª®á®«¨. ¡à ¡ âë¢ ¥â ¢¢®¤ ¨ ¢ë¢®¤. |
- | 1829 | con.thread: |
|
1842 | con.thread: |
1830 | or [con.vscroll_pt], -1 |
1843 | ; ®â®ª ॠ£¨àã¥â IPC, ª®â®à®¥ ¨á¯®«ì§ã¥âáï ⮫쪮 ¤«ï ⮣®, çâ®¡ë ¥£® ¬®¦® ¡ë«® "à §¡ã¤¨âì" |
1831 | ; ®â®ª ॠ£¨àã¥â IPC, ª®â®à®¥ ¨á¯®«ì§ã¥âáï ⮫쪮 ¤«ï ⮣®, çâ®¡ë ¥£® ¬®¦® ¡ë«® "à §¡ã¤¨âì" |
1844 | push 40 |
1832 | push 40 |
1845 | pop eax |
1833 | pop eax |
1846 | push 0x67 |
1834 | push 0x67 |
1847 | pop ebx |
1835 | pop ebx |
1848 | int 0x40 |
1836 | int 0x40 |
1849 | mov al, 60 |
1837 | mov al, 60 |
1850 | mov bl, 1 |
1838 | mov bl, 1 |
- | 1839 | mov ecx, con.ipc_buf |
|
1851 | mov ecx, con.ipc_buf |
1840 | mov byte [ecx+4], 8 |
1852 | push 0x11 |
1841 | push 0x11 |
1853 | pop edx |
1842 | pop edx |
1854 | int 0x40 |
1843 | int 0x40 |
1855 | mov al, 66 |
1844 | mov al, 66 |
Line 2543... | Line 2532... | ||
2543 | con.def_scr_width dd 80 |
2532 | con.def_scr_width dd 80 |
2544 | con.def_scr_height dd 300 |
2533 | con.def_scr_height dd 300 |
2545 | con.def_wnd_x dd 200 |
2534 | con.def_wnd_x dd 200 |
2546 | con.def_wnd_y dd 50 |
2535 | con.def_wnd_y dd 50 |
Line 2547... | Line -... | ||
2547 | - | ||
2548 | con.init_cmd db 0 |
2536 | |
Line 2549... | Line -... | ||
2549 | con.title_init_console db "Console",0 |
- | |
2550 | - | ||
2551 | struc process_info |
- | |
2552 | { |
- | |
2553 | cpu_usage dd ? ; +0 |
- | |
2554 | window_stack_position dw ? ; +4 |
- | |
2555 | window_stack_value dw ? ; +6 |
- | |
2556 | dw ? ; +8 |
- | |
2557 | process_name rb 12 ; +10 |
- | |
2558 | memory_start dd ? ; +22 |
- | |
2559 | used_memory dd ? ; +26 |
- | |
2560 | PID dd ? ; +30 |
- | |
2561 | box.x dd ? ; +34 |
- | |
2562 | box.y dd ? ; +38 |
- | |
2563 | box.width dd ? ; +42 |
- | |
2564 | box.height dd ? ; +46 |
- | |
2565 | slot_state dw ? ; +50 |
- | |
2566 | dw ? ; +52 |
- | |
2567 | client_box.x dd ? ; +54 |
- | |
2568 | client_box.y dd ? ; +58 |
- | |
2569 | client_box.width dd ? ; +62 |
- | |
2570 | client_box.height dd ? ; +66 |
- | |
2571 | wnd_state db ? ; +70 |
- | |
2572 | rb (1024-71) |
- | |
2573 | } |
- | |
2574 | process_info_buffer process_info |
- | |
2575 | window_status rd 1 |
- | |
2576 | - | ||
2577 | con.vscroll_pt dd -1 |
2537 | con.title_init_console db "Console",0 |
2578 | 2538 | ||
2579 | align 16 |
2539 | align 4 |
2580 | EXPORTS: |
2540 | data export |
2581 | dd szStart, START |
2541 | export 'console.dll', \ |
2582 | dd szVersion, 0x00020008 |
2542 | version, 'version', \ |
2583 | dd szcon_init, con_init |
2543 | con_init, 'con_init', \ |
2584 | dd szcon_write_asciiz, con_write_asciiz |
2544 | con_write_asciiz, 'con_write_asciiz', \ |
2585 | dd szcon_write_string, con_write_length |
2545 | con_write_length, 'con_write_string', \ |
2586 | dd szcon_printf, con_printf |
2546 | con_printf, 'con_printf', \ |
2587 | dd szcon_exit, con_exit |
2547 | con_exit, 'con_exit', \ |
2588 | dd szcon_get_flags, con_get_flags |
2548 | con_get_flags, 'con_get_flags', \ |
2589 | dd szcon_set_flags, con_set_flags |
2549 | con_set_flags, 'con_set_flags', \ |
2590 | dd szcon_kbhit, con_kbhit |
2550 | con_kbhit, 'con_kbhit', \ |
2591 | dd szcon_getch, con_getch |
2551 | con_getch, 'con_getch', \ |
2592 | dd szcon_getch2, con_getch2 |
2552 | con_getch2, 'con_getch2', \ |
2593 | dd szcon_gets, con_gets |
2553 | con_gets, 'con_gets', \ |
2594 | dd szcon_gets2, con_gets2 |
2554 | con_gets2, 'con_gets2', \ |
2595 | dd szcon_get_font_height, con_get_font_height |
2555 | con_get_font_height, 'con_get_font_height', \ |
2596 | dd szcon_get_cursor_height,con_get_cursor_height |
2556 | con_get_cursor_height, 'con_get_cursor_height', \ |
2597 | dd szcon_set_cursor_height,con_set_cursor_height |
2557 | con_set_cursor_height, 'con_set_cursor_height', \ |
2598 | dd szcon_cls, con_cls |
2558 | con_cls, 'con_cls', \ |
2599 | dd szcon_get_cursor_pos, con_get_cursor_pos |
2559 | con_get_cursor_pos, 'con_get_cursor_pos', \ |
2600 | dd szcon_set_cursor_pos, con_set_cursor_pos |
2560 | con_set_cursor_pos, 'con_set_cursor_pos', \ |
2601 | dd szcon_set_title, con_set_title |
- | |
2602 | dd 0 |
- | |
2603 | - | ||
2604 | con_flags dd 7 |
- | |
2605 | con.cursor_height dd (15*font_height+50)/100 |
- | |
2606 | con.input_start dd con.input_buffer |
- | |
2607 | con.input_end dd con.input_buffer |
- | |
2608 | - | ||
2609 | con_esc_attr_n dd 0 |
- | |
2610 | con_esc_attrs dd 0,0,0,0 |
- | |
2611 | con_esc db 0 |
- | |
2612 | con_sci db 0 |
- | |
2613 | - | ||
2614 | con.entered_char dw -1 |
- | |
2615 | con.bGetchRequested db 0 |
- | |
2616 | con.bWasE0 db 0 |
- | |
2617 | - | ||
2618 | szStart db 'START',0 |
- | |
2619 | - | ||
2620 | szcon_init db 'con_init',0 |
- | |
2621 | szcon_write_asciiz db 'con_write_asciiz',0 |
- | |
2622 | szcon_write_string db 'con_write_string',0 |
- | |
2623 | szcon_printf db 'con_printf',0 |
- | |
2624 | szcon_exit db 'con_exit',0 |
- | |
2625 | szVersion db 'version',0 |
- | |
2626 | szcon_get_flags db 'con_get_flags',0 |
- | |
2627 | szcon_set_flags db 'con_set_flags',0 |
- | |
2628 | szcon_kbhit db 'con_kbhit',0 |
- | |
2629 | szcon_getch db 'con_getch',0 |
- | |
2630 | szcon_getch2 db 'con_getch2',0 |
- | |
2631 | szcon_gets db 'con_gets',0 |
- | |
2632 | szcon_gets2 db 'con_gets2',0 |
- | |
2633 | szcon_get_font_height db 'con_get_font_height',0 |
- | |
2634 | szcon_get_cursor_height db 'con_get_cursor_height',0 |
- | |
2635 | szcon_set_cursor_height db 'con_set_cursor_height',0 |
- | |
2636 | szcon_cls db 'con_cls',0 |
- | |
2637 | szcon_get_cursor_pos db 'con_get_cursor_pos',0 |
- | |
Line -... | Line 2561... | ||
- | 2561 | con_set_title, 'con_set_title' |
|
2638 | szcon_set_cursor_pos db 'con_set_cursor_pos',0 |
2562 | end data |
2639 | szcon_set_title db 'con_set_title',0 |
2563 | |
2640 | 2564 | version dd 0x00020008 |
|
2641 | con.thread_err db 'Cannot create console thread!',13,10,0 |
2565 | con.thread_err db 'Cannot create console thread!',13,10,0 |
2642 | con.nomem_err db 'Not enough memory!',13,10,0 |
2566 | con.nomem_err db 'Not enough memory!',13,10,0 |
2643 | con.aFinished db ' [Finished]',0 |
- | |
2644 | con.aNull db '(null)',0 |
- | |
Line 2645... | Line 2567... | ||
2645 | con.beep db 0x90, 0x3C, 0x00 |
2567 | con.aFinished db ' [Finished]',0 |
- | 2568 | con.aNull db '(null)',0 |
|
- | 2569 | con.beep db 0x90, 0x3C, 0x00 |
|
- | 2570 | ||
- | 2571 | section '.data' data readable writable |
|
- | 2572 | con_flags dd ? |
|
- | 2573 | con.cursor_height dd ? |
|
- | 2574 | con.input_start dd ? |
|
- | 2575 | con.input_end dd ? |
|
- | 2576 | ||
- | 2577 | con_esc_attr_n dd ? |
|
- | 2578 | con_esc_attrs dd ?,?,?,? |
|
- | 2579 | con_esc db ? |
|
- | 2580 | con_sci db ? |
|
- | 2581 | ||
- | 2582 | con.entered_char dw ? |
|
Line 2646... | Line 2583... | ||
2646 | con.ipc_buf dd 0,8,0,0 |
2583 | con.bGetchRequested db ? |
Line 2647... | Line 2584... | ||
2647 | db 0 |
2584 | con.bWasE0 db ? |
2648 | 2585 | ||
Line 2673... | Line 2610... | ||
2673 | con.scroll_down_first_time rd 1 |
2610 | con.scroll_down_first_time rd 1 |
2674 | con.bUpPressed_saved rb 1 |
2611 | con.bUpPressed_saved rb 1 |
2675 | con.bDownPressed_saved rb 1 |
2612 | con.bDownPressed_saved rb 1 |
2676 | con.bScrollingUp_saved rb 1 |
2613 | con.bScrollingUp_saved rb 1 |
2677 | con.bScrollingDown_saved rb 1 |
2614 | con.bScrollingDown_saved rb 1 |
- | 2615 | con.vscroll_pt dd ? |
|
Line 2678... | Line 2616... | ||
2678 | 2616 | ||
2679 | con.input_buffer rw 128 |
2617 | con.input_buffer rw 128 |
Line 2680... | Line 2618... | ||
2680 | con.input_buffer_end = $ |
2618 | con.input_buffer_end = $ |
Line -... | Line 2619... | ||
- | 2619 | ||
- | 2620 | con.kbd_layout rb 128 |
|
2681 | 2621 | ||
2682 | con.kbd_layout rb 128 |
2622 | con.ipc_buf rb 0x11 |
2683 | 2623 | ||
2684 | ; 1 = exit, 2 = set title, 3 = redraw, 4 = getch |
2624 | ; 1 = exit, 2 = set title, 3 = redraw, 4 = getch |
2685 | con.thread_op rb 1 |
2625 | con.thread_op rb 1 |
2686 | con.bUpPressed rb 1 |
2626 | con.bUpPressed rb 1 |
Line 2687... | Line 2627... | ||
2687 | con.bDownPressed rb 1 |
2627 | con.bDownPressed rb 1 |
2688 | con.bScrollingUp rb 1 |
2628 | con.bScrollingUp rb 1 |
- | 2629 | con.bScrollingDown rb 1 |
|
- | 2630 | ||
- | 2631 | con.stack rb 1024 |
|
- | 2632 | con.stack_top = $ |
|
- | 2633 | ||
- | 2634 | struc process_info |
|
- | 2635 | { |
|
- | 2636 | cpu_usage dd ? ; +0 |
|
- | 2637 | window_stack_position dw ? ; +4 |
|
- | 2638 | window_stack_value dw ? ; +6 |
|
- | 2639 | dw ? ; +8 |
|
- | 2640 | process_name rb 12 ; +10 |
|
- | 2641 | memory_start dd ? ; +22 |
|
- | 2642 | used_memory dd ? ; +26 |
|
- | 2643 | PID dd ? ; +30 |
|
- | 2644 | box.x dd ? ; +34 |
|
- | 2645 | box.y dd ? ; +38 |
|
- | 2646 | box.width dd ? ; +42 |
|
- | 2647 | box.height dd ? ; +46 |
|
- | 2648 | slot_state dw ? ; +50 |
|
- | 2649 | dw ? ; +52 |
|
- | 2650 | client_box.x dd ? ; +54 |
|
- | 2651 | client_box.y dd ? ; +58 |
|
- | 2652 | client_box.width dd ? ; +62 |
|
- | 2653 | client_box.height dd ? ; +66 |
|
- | 2654 | wnd_state db ? ; +70 |