|
@@ -422,6 +422,8 @@ type
|
|
|
OptimizeInfo: TLinkLibOptimizeInfo;
|
|
|
Funcs: TSourceFileFunctions;
|
|
|
CurrentStrings: TMemoryStream;
|
|
|
+ CurVTIType: TVTICalcType;
|
|
|
+ CurTIEmuType: TTIEmuCalcType;
|
|
|
RecentFiles: TStringList;
|
|
|
ToolsList: TToolsList;
|
|
|
property ProjectFile: string read FProjectFile write SetProjectFile;
|
|
@@ -518,7 +520,7 @@ uses
|
|
|
StartupScreenUnit, PreferencesUnit, ProjectOptionsUnit,
|
|
|
AboutUnit, SourceFileWinUnit, FunctionsWinUnit,
|
|
|
OpenFileStatusUnit, NewsUnit, SendProgressUnit, ToolsUnit,
|
|
|
- ProgramOutputUnit, VTIStartUnit,
|
|
|
+ ProgramOutputUnit, VTIStartUnit, TIEmuStartUnit,
|
|
|
LinkUnit,
|
|
|
UtilsDos, UtilsWin, HandleWaitThreadUnit, FileReadToBufferThreadUnit,
|
|
|
ShellAPI, ShlObj, IniFiles, Registry, WinSpool, ClipBrd{$IFDEF CODINGEXT}, CompletionForm{$ENDIF},
|
|
@@ -825,7 +827,7 @@ begin
|
|
|
SplitFiles := True;
|
|
|
{$ENDIF}
|
|
|
DeleteErrors := True;
|
|
|
- TransferTarget := ttVTI;
|
|
|
+ TransferTarget := ttTIEmu;
|
|
|
LinkPort.PortType := lpCOM;
|
|
|
LinkPort.PortNumber := 1;
|
|
|
LinkCable := lcBlack;
|
|
@@ -2828,12 +2830,15 @@ begin
|
|
|
case TransferTarget of
|
|
|
ttVTI:
|
|
|
VTIBox.Checked := True;
|
|
|
+ ttTIEmu:
|
|
|
+ TIEmuBox.Checked := True;
|
|
|
ttCalc:
|
|
|
RealCalcBox.Checked := True;
|
|
|
else
|
|
|
NoneBox.Checked := True;
|
|
|
end;
|
|
|
VTIPathEdit.Text := VTIPath;
|
|
|
+ TIEmuPathEdit.Text := TIEmuPath;
|
|
|
case LinkPort.PortType of
|
|
|
lpCOM: begin
|
|
|
case LinkPort.PortNumber of
|
|
@@ -2888,11 +2893,14 @@ begin
|
|
|
MainMenu.Images := nil;
|
|
|
if VTIBox.Checked then
|
|
|
TransferTarget := ttVTI
|
|
|
+ else if TIEmuBox.Checked then
|
|
|
+ TransferTarget := ttTIEmu
|
|
|
else if RealCalcBox.Checked then
|
|
|
TransferTarget := ttCalc
|
|
|
else
|
|
|
TransferTarget := ttNone;
|
|
|
VTIPath := VTIPathEdit.Text;
|
|
|
+ TIEmuPath := TIEmuPathEdit.Text;
|
|
|
LinkPort.PortType := lpCOM;
|
|
|
if PortCOM1Box.Checked then
|
|
|
LinkPort.PortNumber := 1
|
|
@@ -3021,8 +3029,10 @@ begin
|
|
|
end;
|
|
|
if ValueExists ('Transfer Target') then
|
|
|
TransferTarget := TTransferTarget (ReadInteger ('Transfer Target') + 1);
|
|
|
+ if ValueExists ('VTI Path') then
|
|
|
+ VTIPath := ReadString ('VTI Path');
|
|
|
if ValueExists ('TiEmu Path') then
|
|
|
- VTIPath := ReadString ('TiEmu Path');
|
|
|
+ TIEmuPath := ReadString ('TiEmu Path');
|
|
|
if ValueExists ('Link Port') then
|
|
|
LinkPort.PortNumber := ReadInteger ('Link Port') and $FF;
|
|
|
if ValueExists ('Link Cable') then begin
|
|
@@ -3191,7 +3201,8 @@ begin
|
|
|
WriteBool ('Flat Buttons', MainToolbar.Flat);
|
|
|
WriteBool ('Menu Bitmaps', Assigned (MainMenu.Images));
|
|
|
WriteInteger ('Transfer Target', Integer (TransferTarget) - 1);
|
|
|
- WriteString ('TiEmu Path', VTIPath);
|
|
|
+ WriteString ('VTI Path', VTIPath);
|
|
|
+ WriteString ('TiEmu Path', TIEmuPath);
|
|
|
WriteInteger ('Link Port', LinkPort.PortNumber);
|
|
|
case LinkCable of
|
|
|
lcBlack: WriteInteger ('Link Cable', 1);
|
|
@@ -4693,19 +4704,19 @@ begin
|
|
|
OleCheck(Unknown.QueryInterface(ITiEmuOLE, Result));
|
|
|
end else begin
|
|
|
{ If no TiEmu path is set, try looking it up from the registry. }
|
|
|
- if Length (VTIPath) = 0 then begin
|
|
|
+ if Length (TIEmuPath) = 0 then begin
|
|
|
with TRegistry.Create do try
|
|
|
RootKey := HKey_Classes_Root;
|
|
|
if OpenKeyReadOnly ('\CLSID\{B2A17B13-9D6F-4DD4-A2A9-6FE06ADC1D33}\LocalServer32') then try
|
|
|
if ValueExists ('') then
|
|
|
- VTIPath := ReadString ('');
|
|
|
+ TIEmuPath := ReadString ('');
|
|
|
except end;
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
end;
|
|
|
- if Length (VTIPath) > 0 then begin
|
|
|
- with TVTIStartForm.Create (Self) do try
|
|
|
+ if Length (TIEmuPath) > 0 then begin
|
|
|
+ with TTIEmuStartForm.Create (Self) do try
|
|
|
if ShowModal = mrOK then begin
|
|
|
Result := TiEmuInterface;
|
|
|
end else
|
|
@@ -4725,7 +4736,7 @@ var
|
|
|
I: Integer;
|
|
|
FirstI: Integer;
|
|
|
TiEmuInterface: ITiEmuOLE;
|
|
|
- TiEmuCalcType: TTiEmuCalcType;
|
|
|
+ TiEmuCalcType: TTIEmuCalcType;
|
|
|
Ready: Boolean;
|
|
|
Connection: TLinkConnection;
|
|
|
Size: Word;
|
|
@@ -4736,7 +4747,7 @@ begin
|
|
|
OperationSuccessful := False;
|
|
|
OperationCancelled := False;
|
|
|
if Length (FNList) > 0 then begin
|
|
|
- if TransferTarget = ttVTI then begin
|
|
|
+ if TransferTarget = ttTIEmu then begin
|
|
|
TiEmuInterface := GetTiEmuInterface;
|
|
|
Enabled := False;
|
|
|
try
|
|
@@ -4753,28 +4764,28 @@ begin
|
|
|
until Ready;
|
|
|
{ Now obtain the model from TiEmu. }
|
|
|
try
|
|
|
- TiEmuCalcType := TTiEmuCalcType(TiEmuInterface.emulated_calc_type);
|
|
|
- if TiEmuCalcType = cvNone then Abort;
|
|
|
+ TiEmuCalcType := TTIEmuCalcType(TiEmuInterface.emulated_calc_type);
|
|
|
+ if TiEmuCalcType = cvTIEmuNone then Abort;
|
|
|
except
|
|
|
ShowDefaultMessageBox ('OLE function call failed.', 'Error', mtProgramError);
|
|
|
Abort;
|
|
|
end;
|
|
|
{ Select the correct files for the model. }
|
|
|
- if (TiEmuCalcType <> cvTI92) and (ProjectTarget = ptFargo) then begin
|
|
|
+ if (TiEmuCalcType <> cvTIEmuTI92) and (ProjectTarget = ptFargo) then begin
|
|
|
ShowDefaultMessageBox ('Can''t send Fargo program to a TI-89/89Ti/92+/V200.', 'Error', mtProgramError);
|
|
|
Abort;
|
|
|
end;
|
|
|
- if (TiEmuCalcType = cvTI92) and (ProjectTarget <> ptFargo) then begin
|
|
|
+ if (TiEmuCalcType = cvTIEmuTI92) and (ProjectTarget <> ptFargo) then begin
|
|
|
ShowDefaultMessageBox ('Can''t send AMS program to a TI-92.', 'Error', mtProgramError);
|
|
|
Abort;
|
|
|
end;
|
|
|
for I := Low (FNList) to High (FNList) do begin
|
|
|
case TiEmuCalcType of
|
|
|
- cvTI92Plus:
|
|
|
+ cvTIEmuTI92Plus:
|
|
|
FNList [I] := StringReplace (FNList [I], '.89', '.9x', []);
|
|
|
- cvV200:
|
|
|
+ cvTIEmuV200:
|
|
|
FNList [I] := StringReplace (FNList [I], '.89', '.v2', []);
|
|
|
- cvTI92:
|
|
|
+ cvTIEmuTI92:
|
|
|
FNList [I] := StringReplace (FNList [I], '.89', '.92', []);
|
|
|
end;
|
|
|
if not FileExists (FNList [I]) then begin
|
|
@@ -4875,7 +4886,7 @@ var
|
|
|
TiEmuInterface: ITiEmuOLE;
|
|
|
Connection: TLinkConnection;
|
|
|
begin
|
|
|
- if TransferTarget = ttVTI then begin
|
|
|
+ if TransferTarget = ttTIEmu then begin
|
|
|
TiEmuInterface := GetTiEmuInterface;
|
|
|
try
|
|
|
if not TiEmuInterface.execute_command(Line) then Abort;
|
|
@@ -4987,8 +4998,8 @@ var
|
|
|
begin
|
|
|
CanRun := Runnable;
|
|
|
ActionDebugRun.Enabled := not Compiling;
|
|
|
- ActionDebugPause.Enabled := (not Compiling) and (TransferTarget = ttVTI);
|
|
|
- ActionDebugReset.Enabled := (not Compiling) and (TransferTarget = ttVTI);
|
|
|
+ ActionDebugPause.Enabled := (not Compiling) and ((TransferTarget = ttVTI) or (TransferTarget = ttTIEmu));
|
|
|
+ ActionDebugReset.Enabled := (not Compiling) and ((TransferTarget = ttVTI) or (TransferTarget = ttTIEmu));
|
|
|
MainMenuDebug.Visible := CanRun;
|
|
|
if not CanRun then
|
|
|
ToolBarDebugLine.Parent := nil;
|
|
@@ -5012,6 +5023,8 @@ begin
|
|
|
ProjectCompile (Sender);
|
|
|
end else if (Key = vk_F9) and (Shift = [ssShift, ssCtrl, ssAlt]) then begin
|
|
|
if TransferTarget = ttVTI then
|
|
|
+ TransferTarget := ttTIEmu
|
|
|
+ else if TransferTarget = ttTiEmu then
|
|
|
TransferTarget := ttCalc
|
|
|
else
|
|
|
TransferTarget := ttVTI;
|