Difference between revisions of "Unit GlobalConfig"
From Ultibo.org
Line 190: | Line 190: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function WordBEtoN(Value:Word):Word; inline;</pre> | <pre style="border: 0; padding-bottom:0px;">function WordBEtoN(Value:Word):Word; inline;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert word Value | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert word Value from big endian to native</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 226: | Line 226: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function LongWordNtoBE(Value:LongWord):LongWord; inline;</pre> | <pre style="border: 0; padding-bottom:0px;">function LongWordNtoBE(Value:LongWord):LongWord; inline;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert longword Value | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert longword Value from native to big endian</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 238: | Line 238: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function LongWordBEtoN(Value:LongWord):LongWord; inline;</pre> | <pre style="border: 0; padding-bottom:0px;">function LongWordBEtoN(Value:LongWord):LongWord; inline;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert longword Value | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert longword Value from big endian to native</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 274: | Line 274: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function Int64NtoBE(const Value:Int64):Int64; inline;</pre> | <pre style="border: 0; padding-bottom:0px;">function Int64NtoBE(const Value:Int64):Int64; inline;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert int64 Value | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert int64 Value from native to big endian</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 286: | Line 286: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
<pre style="border: 0; padding-bottom:0px;">function Int64BEtoN(const Value:Int64):Int64; inline;</pre> | <pre style="border: 0; padding-bottom:0px;">function Int64BEtoN(const Value:Int64):Int64; inline;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert int64 Value | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert int64 Value from big endian to native</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 654: | Line 654: | ||
|- | |- | ||
! '''Format''' | ! '''Format''' | ||
− | | The color format to convert | + | | The color format to convert from (eg COLOR_FORMAT_RGB24) |
|- | |- | ||
! '''Source''' | ! '''Source''' | ||
Line 720: | Line 720: | ||
|- | |- | ||
! '''Format''' | ! '''Format''' | ||
− | | The color format to convert | + | | The color format to convert from (eg COLOR_FORMAT_RGB24) |
|- | |- | ||
! '''Source''' | ! '''Source''' |
Revision as of 01:59, 1 December 2016
Return to Unit Reference
Contents
[hide]Description
The GlobalConfig unit contains variables used throughout Ultibo core to provide configuration and parameters to common modules and sub systems. Many of these variables may also be passed on the command line as environment variables to customize the behavior of Ultibo core without needing to recompile the application. This unit also includes a small number of widely used common functions.
Constants
None defined
Type definitions
None defined
Public variables
To be documented
-
GetLastErrorHandler:TGetLastError;
- Registered handler for the global GetLastError function -
SetLastErrorHandler:TSetLastError;
- Registered handler for the global SetLastError function
Function declarations
Global functions
[Expand]
function Min(A,B:LongInt):LongInt; inline;
Description: Return the minimum value of A and B
[Expand]
function Max(A,B:LongInt):LongInt; inline;
Description: Return the maximum value of A and B
[Expand]
function RoundUp(Value,Multiple:LongWord):LongWord;
Description: Round Value to the next highest multiple of Multiple
[Expand]
function RoundDown(Value,Multiple:LongWord):LongWord;
Description: Round Value to the next lowest multiple of Multiple
[Expand]
function MAKELONG(A,B:LongInt):LongInt; inline;
Description: Make a longword value from A and B
[Expand]
function WordNtoBE(Value:Word):Word; inline;
Description: Convert word Value from native to big endian
[Expand]
function WordBEtoN(Value:Word):Word; inline;
Description: Convert word Value from big endian to native
[Expand]
function LongWordNtoBE(Value:LongWord):LongWord; inline;
Description: Convert longword Value from native to big endian
[Expand]
function LongWordBEtoN(Value:LongWord):LongWord; inline;
Description: Convert longword Value from big endian to native
[Expand]
function Int64NtoBE(const Value:Int64):Int64; inline;
Description: Convert int64 Value from native to big endian
[Expand]
function Int64BEtoN(const Value:Int64):Int64; inline;
Description: Convert int64 Value from big endian to native
[Expand]
function GetLastError:LongWord; inline;
Description: Return the last error code for the current thread
[Expand]
procedure SetLastError(LastError:LongWord); inline;
Description: Set the last error code for the current thread
Conversion functions
[Expand]
function ErrorToString(Error:LongWord):String;
Description: Convert an error code value to a string
[Expand]
function SysErrorToString(ErrorCode:Integer):String;
Description: Convert an error code value to a string (RTL)
[Expand]
function BooleanToString(Value:Boolean):String;
Description: Convert a boolean value to a string
[Expand]
function CPUTypeToString(CPUType:LongWord):String;
Description: Convert a CPU type constant to a string
[Expand]
function CPUModelToString(CPUModel:LongWord):String;
Description: Convert a CPU model constant to a string
[Expand]
function CPUIDToString(CPUID:LongWord):String;
Description: Convert a CPU ID constant to a string
[Expand]
function FPUTypeToString(FPUType:LongWord):String;
Description: Convert a FPU type constant to a string
[Expand]
function GPUTypeToString(GPUType:LongWord):String;
Description: Convert a GPU type constant to a string
[Expand]
function CacheTypeToString(CacheType:LongWord):String;
Description: Convert a filesystem Cache type constant to a string
[Expand]
function BoardTypeToString(BoardType:LongWord):String;
Description: Convert a Board type constant to a string
[Expand]
function MachineTypeToString(MachineType:LongWord):String;
Description: Convert a Machine type constant to a string
[Expand]
function PowerIDToString(PowerID:LongWord):String;
Description: Convert a Power ID constant to a string
[Expand]
function PowerStateToString(PowerState:LongWord):String;
Description: Convert a Power state constant to a string
[Expand]
function ClockIDToString(ClockID:LongWord):String;
Description: Convert a Clock ID constant to a string
[Expand]
function ClockStateToString(ClockState:LongWord):String;
Description: Convert a Clock state constant to a string
[Expand]
function TurboIDToString(TurboID:LongWord):String;
Description: Convert a Turbo ID constant to a string
[Expand]
function VoltageIDToString(VoltageID:LongWord):String;
Description: Convert a Voltage ID constant to a string
[Expand]
function TemperatureIDToString(TemperatureID:LongWord):String;
Description: Convert a Temperature ID constant to a string
[Expand]
function ColorFormatToBytes(Format:LongWord):LongWord;
Description: Convert a color format constant into the number of bytes per pixel
[Expand]
procedure ColorDefaultToFormat(Format,Color:LongWord; Dest:Pointer; Reverse:Boolean); inline;
Description: Convert a color value in the default format to the specified format
[Expand]
procedure ColorFormatToDefault(Format:LongWord; Source:Pointer; var Color:Longword; Reverse:Boolean); inline;
Description: Convert a color value in the specified format to the default format
[Expand]
procedure ColorDefaultAltToFormat(Format,Color:LongWord; Dest:Pointer; Reverse:Boolean); {Not inline}
Description: Convert a color value in the default format to the specified format (Alternate)
[Expand]
procedure PixelsDefaultToFormat(Format:LongWord; Source,Dest:Pointer; Count:LongWord; Reverse:Boolean);
Description: Convert one or more pixels in the default color format to the specified format
[Expand]
procedure PixelsFormatToDefault(Format:LongWord; Source,Dest:Pointer; Count:LongWord; Reverse:Boolean);
Description: Convert one or more pixels in the specified color format to the default format
[Expand]
function LogLevelToLoggingSeverity(LogLevel:LongWord):LongWord;
Description: Convert a log level constant to a severity level
Return to Unit Reference