aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/ULCD.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-18 11:16:30 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-18 11:16:30 +0000
commite3fc5e2c58302159b79e0e25e183aa3e75397a41 (patch)
treebb3a3d66b990231ada3e445c2ba623f15018a5b9 /Game/Code/Classes/ULCD.pas
parent7e2e8a8f5a195ac0c49dcb941d065dd9bf0e0256 (diff)
downloadusdx-e3fc5e2c58302159b79e0e25e183aa3e75397a41.tar.gz
usdx-e3fc5e2c58302159b79e0e25e183aa3e75397a41.tar.xz
usdx-e3fc5e2c58302159b79e0e25e183aa3e75397a41.zip
added switches.inc , which will contain compiler directives used
( at least ) for porting to linux. this file now contains compiler directive UseSerialPort, which is conditionally set depending on the compiler. at this point lazarus will not use the serial port ( LCD or Light ) units. however this functionality should be maintained at this point in delphi. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@390 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/ULCD.pas')
-rw-r--r--Game/Code/Classes/ULCD.pas18
1 files changed, 15 insertions, 3 deletions
diff --git a/Game/Code/Classes/ULCD.pas b/Game/Code/Classes/ULCD.pas
index a3cdac73..52b0f96a 100644
--- a/Game/Code/Classes/ULCD.pas
+++ b/Game/Code/Classes/ULCD.pas
@@ -1,6 +1,7 @@
unit ULCD;
interface
+{$I switches.inc}
type
TLCD = class
@@ -41,16 +42,24 @@ const
implementation
uses
- SysUtils, zlportio, UTime;
+ SysUtils,
+ {$IFDEF UseSerialPort}
+ zlportio,
+ {$ENDIF}
+ UTime;
procedure TLCD.WriteCommand(B: Byte);
// Wysylanie komend sterujacych
begin
- if not HalfInterface then begin
+{$IFDEF UseSerialPort}
+ if not HalfInterface then
+ begin
zlioportwrite(Control, 0, $02);
zlioportwrite(Data, 0, B);
zlioportwrite(Control, 0, $03);
- end else begin
+ end
+ else
+ begin
zlioportwrite(Control, 0, $02);
zlioportwrite(Data, 0, B and $F0);
zlioportwrite(Control, 0, $03);
@@ -66,11 +75,13 @@ begin
Sleep(2)
else
TimeSleep(0.1);
+{$ENDIF}
end;
procedure TLCD.WriteData(B: Byte);
// Wysylanie danych
begin
+{$IFDEF UseSerialPort}
if not HalfInterface then begin
zlioportwrite(Control, 0, $06);
zlioportwrite(Data, 0, B);
@@ -89,6 +100,7 @@ begin
TimeSleep(0.1);
Inc(Position);
+{$ENDIF}
end;
procedure TLCD.WriteString(S: string);