Skip to content

Commit

Permalink
Update TMT Pascal
Browse files Browse the repository at this point in the history
  • Loading branch information
RetroNick2020 committed Dec 31, 2023
1 parent aebed71 commit b874cdc
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
4 changes: 2 additions & 2 deletions rmabout.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ interface
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,lclintf;

Const
ProgramName ='Raster Master v2.8 R95';
ProgramLicense = 'Released December 23 - 2023 under MIT License';
ProgramName ='Raster Master v2.9 R96';
ProgramLicense = 'Released December 31 - 2023 under MIT License';

type

Expand Down
11 changes: 11 additions & 0 deletions rmmain.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,17 @@ object RMMainForm: TRMMainForm
OnClick = PaletteExportTurboPascalClick
end
end
object PaletteExportTMTPascal: TMenuItem
Caption = 'TMT Pascal'
object TMTPaletteArray: TMenuItem
Caption = 'Palette Array'
OnClick = PaletteExportTurboPascalClick
end
object TMTPaletteCommands: TMenuItem
Caption = 'Palette Commands'
OnClick = PaletteExportTurboPascalClick
end
end
end
object EditColor: TMenuItem
Caption = 'Edit Colors'
Expand Down
29 changes: 26 additions & 3 deletions rmmain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ TRMMainForm = class(TForm)
fbRayLibRGB: TMenuItem;
MenuItem1: TMenuItem;
MenuItem12: TMenuItem;
PaletteExportTMTPascal: TMenuItem;
TMTPaletteArray: TMenuItem;
TMTPaletteCommands: TMenuItem;
TMTPutImageFile: TMenuItem;
TMTPutImageArray: TMenuItem;
QB64: TMenuItem;
Expand Down Expand Up @@ -347,6 +350,7 @@ TRMMainForm = class(TForm)
procedure ListView1Click(Sender: TObject);
procedure DeleteAllClick(Sender: TObject);
procedure MapEditMenuClick(Sender: TObject);
procedure TMTPaletteExportClick(Sender: TObject);
procedure OpenWatcomCClick(Sender: TObject);
procedure PaletteExportOWCClick(Sender: TObject);
procedure PaletteXGA256Click(Sender: TObject);
Expand All @@ -372,6 +376,7 @@ TRMMainForm = class(TForm)
procedure RESExportClick(Sender: TObject);
procedure FileDeleteClick(Sender: TObject);
procedure SaveProjectFileClick(Sender: TObject);
procedure TMTPaletteCommandsClick(Sender: TObject);
procedure ToolEllipseMenuClick(Sender: TObject);
procedure PaletteExportQuickCClick(Sender: TObject);
procedure PaletteExportTurboCClick(Sender: TObject);
Expand Down Expand Up @@ -670,7 +675,6 @@ procedure TRMMainForm.ToolScrollDownMenuClick(Sender: TObject);
ca : TClipAreaRec;
begin
RMDrawTools.GetClipAreaCoords(ca);
ClearClipAreaOutline;
RMDrawTools.ScrollDown(ca.x,ca.y,ca.x2,ca.y2);
UpdateActualArea;
UpdateZoomArea;
Expand All @@ -682,7 +686,6 @@ procedure TRMMainForm.ToolScrollLeftMenuClick(Sender: TObject);
ca : TClipAreaRec;
begin
RMDrawTools.GetClipAreaCoords(ca);
ClearClipAreaOutline;
RMDrawTools.ScrollLeft(ca.x,ca.y,ca.x2,ca.y2);
UpdateActualArea;
UpdateZoomArea;
Expand Down Expand Up @@ -2594,6 +2597,8 @@ function TRMMainForm.ExportPaletteTextFileToClipboard(Sender: TObject; ColorForm
'TPPaletteCommands' : error:=WritePalStatements(FileName,TPLan,ColorFormat);
'FPPaletteArray' : error:=WritePalConstants(FileName,FPLan,ColorFormat);
'FPPaletteCommands' : error:=WritePalStatements(FileName,FPLan,ColorFormat);
'TMTPaletteArray' : error:=WritePalConstants(FileName,TMTLan,ColorEightBitFormat);
'TMTPaletteCommands' : error:=WritePalStatements(FileName,TMTLan,ColorEightBitFormat);

'GWPaletteData' : error:=WritePalData(FileName,GWLan,ColorFormat);
'GWPaletteCommands' : error:=WritePalStatements(FileName,GWLan,ColorFormat);
Expand Down Expand Up @@ -3339,6 +3344,7 @@ procedure TRMMainForm.PaletteExportGWBasicClick(Sender: TObject);
end;
end;


procedure TRMMainForm.PaletteExportTurboPascalClick(Sender: TObject);
var
pm : integer;
Expand All @@ -3349,6 +3355,9 @@ procedure TRMMainForm.PaletteExportTurboPascalClick(Sender: TObject);
'TPPaletteCommands' : ExportDialog.Filter :='Turbo Pascal Palette Commands|*.pas';
'FPPaletteArray' : ExportDialog.Filter := 'FreePascal Palette Array|*.pas';
'FPPaletteCommands' : ExportDialog.Filter :='FreePascal Palette Commands|*.pas';
'TMTPaletteArray' : ExportDialog.Filter := 'TMT Pascal Palette Array|*.pas';
'TMTPaletteCommands' : ExportDialog.Filter :='TMT Pascal Palette Commands|*.pas';

end;

ColorFormat:=ColorEightBitFormat;
Expand All @@ -3359,11 +3368,13 @@ procedure TRMMainForm.PaletteExportTurboPascalClick(Sender: TObject);

if ExportDialog.Execute then
begin

Case (Sender As TMenuItem).Name of 'TPPaletteArray' : error:=WritePalConstants(ExportDialog.FileName,TPLan,ColorFormat);
'TPPaletteCommands' : error:=WritePalStatements(ExportDialog.FileName,TPLan,ColorFormat);
'FPPaletteArray' : error:=WritePalConstants(ExportDialog.FileName,FPLan,ColorFormat);
'FPPaletteCommands' : error:=WritePalStatements(ExportDialog.FileName,FPLan,ColorFormat);
'TMTPaletteArray' : error:=WritePalConstants(ExportDialog.FileName,TMTLan,ColorEightBitFormat);
'TMTPaletteCommands' : error:=WritePalStatements(ExportDialog.FileName,TMTLan,ColorEightBitFormat);

end;

if error<>0 then
Expand Down Expand Up @@ -3595,6 +3606,11 @@ procedure TRMMainForm.MapEditMenuClick(Sender: TObject);
MapEdit.WindowState:=wsNormal;
end;

procedure TRMMainForm.TMTPaletteExportClick(Sender: TObject);
begin

end;

procedure TRMMainForm.RayLibExportClick(Sender: TObject);
var
x,y,x2,y2 : integer;
Expand Down Expand Up @@ -4024,6 +4040,13 @@ procedure TRMMainForm.SaveProjectFileClick(Sender: TObject);
end;
end;

procedure TRMMainForm.TMTPaletteCommandsClick(Sender: TObject);
begin

end;



procedure TRMMainForm.NewClick(Sender: TObject);
begin
if ImageThumbBase.GetCount >= MaxThumbImages then exit;
Expand Down
11 changes: 6 additions & 5 deletions rwpal.pas
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function LanToStr(Lan: integer) : string;
FPLan:LanToStr:='FreePascal';
OWLan:LanToStr:='Open Watcom C';
BAMLan:LanToStr:='BAM Basic';
TMTLan:LanToStr:='TMT Pascal';

end;
end;
Expand All @@ -98,7 +99,7 @@ function PaletteCmdToStr(Lan,ColorFormat : integer) : string;
begin
PaletteCmdToStr:='SetPalette(';
end
else if (Lan=TPLan) OR (Lan=FPLan) then
else if (Lan=TPLan) OR (Lan=FPLan) OR (Lan=TMTLan) then
begin
PaletteCmdToStr:='SetRGBPalette(';
end
Expand Down Expand Up @@ -127,23 +128,23 @@ function PaletteCmdToStr(Lan,ColorFormat : integer) : string;
function LineTrmToStr(Lan : integer) : string;
begin
LineTrmToStr:='';
Case Lan of QPLan,TPLan,FPLan,APLan:LineTrmToStr:=');';
Case Lan of QPLan,TPLan,FPLan,TMTLan,APLan:LineTrmToStr:=');';
TCLan,QCLan,ACLan,OWLan:LineTrmToStr:='};';
end;
end;

function CommentBeginToStr(Lan : integer) : string;
begin
CommentBeginToStr:=#39;
Case Lan of QPLan,TPLan,FPLan,APLan:CommentBeginToStr:='(*';
Case Lan of QPLan,TPLan,FPLan,TMTLan,APLan:CommentBeginToStr:='(*';
TCLan,QCLan,ACLan,OWLan:CommentBeginToStr:='/*';
end;
end;

function CommentEndToStr(Lan : integer) : string;
begin
CommentEndToStr:='';
Case Lan of QPLan,TPLan,FPLan,APLan:CommentEndToStr:='*)';
Case Lan of QPLan,TPLan,FPLan,TMTLan,APLan:CommentEndToStr:='*)';
TCLan,QCLan,ACLan,OWLan:CommentEndToStr:='*/';
end;
end;
Expand Down Expand Up @@ -238,7 +239,7 @@ function WritePalConstants(filename : string; Lan,rgbFormat : integer) : word;
begin
arraysize:=Ncolors*3;
end;
If (Lan=TPlan) OR (Lan =FPLan) OR (Lan=QPlan) OR (Lan = APLan) then
If (Lan=TPlan) OR (Lan =FPLan) OR (Lan=QPlan) OR (Lan=TMTlan) OR (Lan = APLan) then
begin
Writeln(F,palettenamestr, ' : array[0..',arraysize-1,'] of byte = (');
end
Expand Down

0 comments on commit b874cdc

Please sign in to comment.