mirror of
https://github.com/vapaamies/KolibriOS.git
synced 2025-09-22 07:03:53 +02:00
CRT unit with colored console example added
This commit is contained in:
@@ -1,27 +1,17 @@
|
||||
program LoadFileApp;
|
||||
|
||||
uses
|
||||
KolibriOS;
|
||||
KolibriOS, CRT;
|
||||
|
||||
var
|
||||
hConsole: Pointer;
|
||||
ConsoleInit: procedure(WndWidth, WndHeight, ScrWidth, ScrHeight: LongWord; Caption: PKolibriChar); stdcall;
|
||||
ConsoleExit: procedure(bCloseWindow: Cardinal); stdcall;
|
||||
WriteN: procedure(Str: PKolibriChar; Count: LongWord); stdcall;
|
||||
|
||||
FileSize: LongWord;
|
||||
Buffer: Pointer;
|
||||
|
||||
begin
|
||||
hConsole := LoadLibrary('/sys/lib/console.obj');
|
||||
ConsoleInit := GetProcAddress(hConsole, 'con_init');
|
||||
ConsoleExit := GetProcAddress(hConsole, 'con_exit');
|
||||
WriteN := GetProcAddress(hConsole, 'con_write_string');
|
||||
|
||||
ConsoleInit($FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, 'Load File');
|
||||
ConsoleInit('Load File');
|
||||
|
||||
Buffer := LoadFile('/sys/example.asm', FileSize);
|
||||
WriteN(Buffer, FileSize);
|
||||
WriteText(Buffer, FileSize);
|
||||
|
||||
ConsoleExit(0);
|
||||
ConsoleExit(False);
|
||||
end.
|
||||
|
Reference in New Issue
Block a user