From 8d012479578132455b9935c64eb39977c3406862 Mon Sep 17 00:00:00 2001 From: Freeman Date: Wed, 30 Dec 2020 00:45:11 +0300 Subject: [PATCH] Little code cleanup and styling --- Lib/KolibriOS.pas | 12 ++++++------ RTL/System.pas | 21 +++++++++------------ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Lib/KolibriOS.pas b/Lib/KolibriOS.pas index 13ea552..871fc83 100644 --- a/Lib/KolibriOS.pas +++ b/Lib/KolibriOS.pas @@ -309,26 +309,26 @@ const BS_TRANSPARENT_FILL = $40000000; BS_NO_FRAME = $20000000; - // OpenSharedMemory open\access flags + // Blit flags + BLIT_CLIENT_RELATIVE = $20000000; + + // OpenSharedMemory open/access flags SHM_OPEN = $00; SHM_OPEN_ALWAYS = $04; SHM_CREATE = $08; SHM_READ = $00; SHM_WRITE = $01; - // KeyboardLayout flags + // KeyboardLayout flags KBL_NORMAL = 1; KBL_SHIFT = 2; KBL_ALT = 3; - // SystemShutdown parameters + // SystemShutdown parameters SHUTDOWN_TURNOFF = 2; SHUTDOWN_REBOOT = 3; SHUTDOWN_RESTART = 4; - // Blit flags - BLIT_CLIENT_RELATIVE = $20000000; - {-1} procedure TerminateThread; stdcall; {0} procedure DrawWindow(Left, Top, Width, Height: LongInt; Caption: PKolibriChar; BackColor, Style, CapStyle: LongWord); stdcall; {1} procedure SetPixel(X, Y: LongInt; Color: LongWord); stdcall; diff --git a/RTL/System.pas b/RTL/System.pas index 5e796b2..7b94f0a 100644 --- a/RTL/System.pas +++ b/RTL/System.pas @@ -239,6 +239,7 @@ var procedure _HandleFinally; asm + MOV EAX, 1 end; procedure InitUnits; @@ -287,12 +288,10 @@ begin end; procedure _Halt0; -begin - FinalizeUnits; - asm - OR EAX, -1 - INT $40 - end; +asm + CALL FinalizeUnits + OR EAX, -1 + INT $40 end; function Get8087CW: Word; @@ -303,12 +302,10 @@ asm end; procedure Set8087CW(Value: Word); -begin - Default8087CW := Value; - asm - FNCLEX - FLDCW Default8087CW - end; +asm + MOV Default8087CW, AX + FNCLEX + FLDCW Default8087CW end; // Produce random values in a given range [MinValue..MaxValue]