aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/MacOSX/Wrapper
diff options
context:
space:
mode:
authoreddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-08 18:51:40 +0000
committereddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-08 18:51:40 +0000
commit6ca1db26350a589b5bcb3e2eac35a7965d5ab448 (patch)
tree37f4d6bef02b3bbeccefbaafa5eeb94a3942a7f8 /Game/Code/MacOSX/Wrapper
parenta5ca459937cf9f08d47ca6aca16e777153821f25 (diff)
downloadusdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.tar.gz
usdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.tar.xz
usdx-6ca1db26350a589b5bcb3e2eac35a7965d5ab448.zip
Mac OS X: Added PseudoThread for debugging, because debugging of threaded code causes problems with Xcode and FreePascal.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@594 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rwxr-xr-xGame/Code/MacOSX/Wrapper/MidiFile.pas102
-rwxr-xr-xGame/Code/MacOSX/Wrapper/MidiOut.pas62
-rwxr-xr-xGame/Code/MacOSX/Wrapper/PNGImage.pas14
-rwxr-xr-xGame/Code/MacOSX/Wrapper/PseudoThread.pas48
-rwxr-xr-xGame/Code/MacOSX/Wrapper/zlportio.pas31
5 files changed, 48 insertions, 209 deletions
diff --git a/Game/Code/MacOSX/Wrapper/MidiFile.pas b/Game/Code/MacOSX/Wrapper/MidiFile.pas
deleted file mode 100755
index c91711cc..00000000
--- a/Game/Code/MacOSX/Wrapper/MidiFile.pas
+++ /dev/null
@@ -1,102 +0,0 @@
-unit MidiFile;
-
-{$I switches.inc}
-
-interface
-
-type
-
- TMidiEvent = record
- event: byte;
- data1: byte;
- data2: byte;
- str: string;
- dticks: integer;
- time: integer;
- mtime: integer;
- len: integer;
- end;
- PMidiEvent = ^TMidiEvent;
-
- TOnMidiEvent = procedure(event: PMidiEvent) of object;
-
-
- TMidiTrack = class
- private
- public
- OnMidiEvent: TOnMidiEvent;
- function getEventCount: integer;
- function getEvent(index: integer): PMidiEvent;
- end;
-
- TMidiFile = class
- private
- FOnMidiEvent : TOnMidiEvent;
- public
- TicksPerQuarter,
- NumberOfTracks,
- BPM : Integer;
- Filename : String;
- Constructor Create(AParent : TObject);
- procedure StartPlaying;
- procedure StopPlaying;
- procedure ReadFile;
- function GetTrack(index: integer): TMidiTrack;
- function getCurrentTime: integer;
- function getTrackLength: integer;
- property OnMidiEvent: TOnMidiEvent read FOnMidiEvent write FOnMidiEvent;
- end;
-
-
-implementation
-
-{ TMidiFile }
-
-constructor TMidiFile.Create(AParent: TObject);
-begin
-
-end;
-
-function TMidiFile.getCurrentTime: integer;
-begin
-
-end;
-
-function TMidiFile.GetTrack(index: integer): TMidiTrack;
-begin
- Result := TMidiTrack.Create;
-end;
-
-function TMidiFile.getTrackLength: integer;
-begin
-
-end;
-
-procedure TMidiFile.ReadFile;
-begin
-
-end;
-
-procedure TMidiFile.StartPlaying;
-begin
-
-end;
-
-procedure TMidiFile.StopPlaying;
-begin
-
-end;
-
-{ TMidiTrack }
-
-function TMidiTrack.getEvent(index: integer): PMidiEvent;
-begin
-
-end;
-
-function TMidiTrack.getEventCount: integer;
-begin
-
-end;
-
-end.
diff --git a/Game/Code/MacOSX/Wrapper/MidiOut.pas b/Game/Code/MacOSX/Wrapper/MidiOut.pas
deleted file mode 100755
index e57da9d0..00000000
--- a/Game/Code/MacOSX/Wrapper/MidiOut.pas
+++ /dev/null
@@ -1,62 +0,0 @@
-unit MidiOut;
-
-{$I switches.inc}
-
-interface
-
-type
-
- TMidiOutput = class
- public
- ProductName : String;
- Constructor Create(AParent : TObject);
- procedure PutShort(MidiMessage: Byte; Data1: Byte; Data2: Byte); virtual;
- function Open: Boolean; virtual;
- function Close: Boolean; virtual;
- {property MIDIHandle: Hmidiout read FMIDIHandle;
- property DriverVersion: Version read FDriverVersion;
- property Technology: OutPortTech read FTechnology write SetTechnology default opt_Synth;
- property Voices: Word read FVoices;
- property Notes: Word read FNotes;
- property ChannelMask: Word read FChannelMask;
- property Support: DWORD read FSupport;
- property Error: Word read FError;
- property Numdevs: Word read FNumdevs;
-
- procedure PutMidiEvent(theEvent: TMyMidiEvent); virtual;
- procedure PutLong(TheSysex: Pointer; msgLength: Word); virtual;
- procedure SetVolume(Left: Word; Right: Word);
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
-
- property ProductName: string read FProductName write SetProductName;
-
- property DeviceID: Integer read FDeviceID write SetDeviceID default 0;
- property Onmidioutput: TNotifyEvent read FOnmidioutput write FOnmidioutput;}
- end;
-
-implementation
-
-{ TMidiOutput }
-
-function TMidiOutput.Close: Boolean;
-begin
-
-end;
-
-constructor TMidiOutput.Create(AParent: TObject);
-begin
- ProductName := 'UltraStar MidiOut Wrapper';
-end;
-
-function TMidiOutput.Open: Boolean;
-begin
-
-end;
-
-procedure TMidiOutput.PutShort(MidiMessage, Data1, Data2: Byte);
-begin
-
-end;
-
-end.
diff --git a/Game/Code/MacOSX/Wrapper/PNGImage.pas b/Game/Code/MacOSX/Wrapper/PNGImage.pas
deleted file mode 100755
index e2454a01..00000000
--- a/Game/Code/MacOSX/Wrapper/PNGImage.pas
+++ /dev/null
@@ -1,14 +0,0 @@
-unit PNGImage;
-
-{$I switches.inc}
-
-interface
-
-uses GlueGraphics;
-
-type
- TPNGObject = TBitmap;
-
-implementation
-
-end.
diff --git a/Game/Code/MacOSX/Wrapper/PseudoThread.pas b/Game/Code/MacOSX/Wrapper/PseudoThread.pas
new file mode 100755
index 00000000..d81a5cfe
--- /dev/null
+++ b/Game/Code/MacOSX/Wrapper/PseudoThread.pas
@@ -0,0 +1,48 @@
+unit PseudoThread;
+
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
+{$I switches.inc}
+
+interface
+
+type
+
+ // Debugging threads with XCode doesn't seem to work.
+ // We use PseudoThread in Debug mode to get proper debugging.
+ TPseudoThread = class(TObject)
+ private
+ protected
+ Terminated,
+ FreeOnTerminate : Boolean;
+ procedure Execute; virtual; abstract;
+ procedure Resume;
+ procedure Suspend;
+ public
+ constructor Create(const suspended : Boolean);
+ end;
+
+implementation
+
+{ TPseudoThread }
+
+constructor TPseudoThread.Create(const suspended : Boolean);
+begin
+ if not suspended then begin
+ Execute;
+ end;
+end;
+
+procedure TPseudoThread.Resume;
+begin
+ Execute;
+end;
+
+procedure TPseudoThread.Suspend;
+begin
+end;
+
+end.
+
diff --git a/Game/Code/MacOSX/Wrapper/zlportio.pas b/Game/Code/MacOSX/Wrapper/zlportio.pas
deleted file mode 100755
index 92b4a505..00000000
--- a/Game/Code/MacOSX/Wrapper/zlportio.pas
+++ /dev/null
@@ -1,31 +0,0 @@
-unit zlportio;
-
-{$I switches.inc}
-
-interface
-
-uses GlueWindows;
-
- procedure zlioportwrite( const Port,DataType,Data:dword );
- procedure portwriteb( const Port:Dword;const Data:byte );
- function GetTime : Real;
-
-implementation
-
-uses SysUtils;
-
-procedure zlioportwrite( const Port,DataType,Data:dword );
-begin
-end;
-
-procedure portwriteb( const Port:Dword;const Data:byte );
-begin
-end;
-
-function GetTime : Real;
-begin
- Result := Now;
-end;
-
-end.
-