MasterUnit.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. {
  2. TIGCC IDE
  3. Copyright (C) 2000-2004 Sebastian Reichelt
  4. Copyright (C) 2005 Fréderic Bour
  5. Copyright (C) 2006 Kevin Kofler
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software Foundation,
  16. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. }
  18. unit MasterUnit;
  19. interface
  20. uses
  21. CalcUnit, ProcessUnit, ParsingUnit,
  22. LinkUnit,
  23. Classes, Graphics, SourceEditUnit;
  24. const
  25. IDELocation = 'Bin\';
  26. LinkLibLocation = 'Bin\';
  27. GCCLocation = 'Bin\';
  28. AsLocation = 'Bin\';
  29. A68kLocation = 'Bin\';
  30. PackLocation = 'Bin\';
  31. ASMIncludeLocation = 'Include\ASM\';
  32. GASIncludeLocation = 'Include\S\';
  33. CIncludeLocation = 'Include\C\';
  34. QuillIncludeLocation = 'Include\Quill\';
  35. DocLocation = 'Doc\';
  36. ProjectsLocation = 'Projects\';
  37. StdLibLocation = 'Lib\';
  38. TIPatchLocation = 'Lib\';
  39. PStarterLocation = 'Lib\';
  40. TemplatesLocation = 'Bin\';
  41. CompletionLocation = 'Include\C\Completion\';
  42. DefaultGCCSwitches = '-B .\ -I- -I ..\Include\C\';
  43. DefaultAsSwitches = '-mc68000 -I ..\Include\S\';
  44. DefaultA68kSwitches = '-i..\Include\ASM';
  45. SpecialQuillGCCSwitches = '-I ..\Include\Quill\';
  46. ProjectFileExt = '.tpr';
  47. MaxNameLength = 8;
  48. type
  49. TSpecialSupportOption = (ssA68k, ssQuill, ssPack, ssFlashOS, ssFargo);
  50. TSpecialSupport = set of TSpecialSupportOption;
  51. TProjectTarget = (ptRegular, ptFlashOS, ptFargo, ptArchive);
  52. TTransferTarget = (ttNone, ttVTI, ttCalc, ttTIEmu);
  53. TVTICalcType = (cvVTINone, cvVTITI89, cvVTITI92Plus, cvVTITI92);
  54. TTiEmuCalcType = (cvTIEmuNone = 0, cvTIEmuTI92 = 1, cvTIEmuTI89 = 2, cvTIEmuTI92Plus = 4, cvTIEmuV200 = 8, cvTIEmuTI89Ti = 16);
  55. TKernelFormat = (kfUnknown, kfNone, kfStandard, kfCompressedTables);
  56. TRelocFormat = (rfUnknown, rfNone, rfDirect, rfAMS, rfKernel, rfCompressed, rfMlink, rfFLine);
  57. TPredefinedLibOptions = class(TObject)
  58. CalcDests: TCalcDests;
  59. OptimizeCalcConsts: Boolean;
  60. KernelFormat: TKernelFormat;
  61. UseMinAMS: Boolean;
  62. MinAMS: string;
  63. UnofficialOSSupport: Boolean;
  64. RelocFormat,
  65. ROMCallFormat,
  66. BSSRefFormat,
  67. DataRefFormat: TRelocFormat;
  68. UseFLineJumps,
  69. Use4ByteFLineJumps,
  70. OptimizeROMCalls,
  71. UseInternalFLineEmulator: Boolean;
  72. UseReturnValue,
  73. EnableErrorReturn: Boolean;
  74. SaveScreen: Boolean;
  75. function GetSwitches: string;
  76. end;
  77. var
  78. MainConsole: TProcessConsole;
  79. StopOnErrors,
  80. DeleteAssemblyFiles,
  81. DeleteObjectFiles,
  82. AssumeUndefined,
  83. AutoBlocks,
  84. AutoNews,
  85. UseDataVar,
  86. DataVarCopy,
  87. DataVarCopyIfArchived,
  88. Pack,
  89. DebugInfo,
  90. StdLib,
  91. InitBSS,
  92. OptimizeNOPs,
  93. OptimizeReturns,
  94. OptimizeBranches,
  95. OptimizeMoves,
  96. OptimizeTests,
  97. OptimizeCalculations,
  98. RemoveUnusedSections,
  99. CutUnusedRanges,
  100. ReorderSections,
  101. MergeConstants,
  102. OutputBin: Boolean;
  103. ProjectTarget: TProjectTarget;
  104. GCCSwitches,
  105. AsSwitches,
  106. AsmSwitches,
  107. DataVar,
  108. PackVar,
  109. CommandLine,
  110. PostBuildProcessFile: string;
  111. PredefinedLibOptions: TPredefinedLibOptions;
  112. ProxyName: string;
  113. ProxyPort: Integer;
  114. TIGCCFolder: string;
  115. Temp: string;
  116. OperationCancelled,
  117. OperationSuccessful: Boolean;
  118. ProjectFileName: string;
  119. SyntaxC,
  120. SyntaxAsmGNU,
  121. SyntaxAsm,
  122. SyntaxQuill: TSyntaxColoring;
  123. TabSizeC,
  124. TabSizeAsm: Integer;
  125. EditorColor: TColor;
  126. EditorFont: TFont;
  127. EditorOnFly,
  128. EditorDragDrop,
  129. EditorRemoveTrSp: Boolean;
  130. LastNewsDate: Integer;
  131. TransferTarget: TTransferTarget;
  132. VTIPath: string;
  133. TIEmuPath: string;
  134. LinkPort: TLinkPort;
  135. LinkCable: TLinkCableType;
  136. SpecialSupport: TSpecialSupport;
  137. Compiling,
  138. CompFinishAndStop,
  139. CompStopNow: Boolean;
  140. CompStartTime,
  141. CompFileStartTime,
  142. CompLastTime: TDateTime;
  143. CompStartFile: procedure of object;
  144. CompStop: procedure of object;
  145. CompSetMessage: procedure(const Msg: string) of object;
  146. CompUpdate: procedure of object;
  147. CompUpdateProgramOutput: procedure of object;
  148. {$IFDEF CanSplit}
  149. var
  150. SplitFiles: Boolean;
  151. {$ENDIF}
  152. function StartsWith(const SubStr: string; var Str: string; CaseSensitive: Boolean = False; Remove: Boolean = False): Boolean;
  153. procedure WaitForMainConsole(const ProcessDesc: string);
  154. function Runnable: Boolean;
  155. implementation
  156. uses
  157. SysUtils, Forms;
  158. procedure WaitForMainConsole(const ProcessDesc: string);
  159. begin
  160. CompUpdate;
  161. while MainConsole.Running do begin
  162. CompUpdate;
  163. Application.ProcessMessages;
  164. if CompFinishAndStop then begin
  165. OperationCancelled := True;
  166. CompSetMessage ('Finishing ' + ProcessDesc + ' Process');
  167. end;
  168. if CompStopNow then begin
  169. OperationCancelled := True;
  170. MainConsole.KillProcess;
  171. Break;
  172. end;
  173. end;
  174. CompUpdate;
  175. end;
  176. function Runnable: Boolean;
  177. begin
  178. Result := (ProjectTarget <> ptArchive) and (ProjectTarget <> ptFlashOS) and (TransferTarget <> ttNone);
  179. end;
  180. function StartsWith(const SubStr: string; var Str: string; CaseSensitive: Boolean; Remove: Boolean): Boolean;
  181. begin
  182. if CaseSensitive then
  183. Result := Copy (Str, 1, Length (SubStr)) = SubStr
  184. else
  185. Result := UpperCase (Copy (Str, 1, Length (SubStr))) = UpperCase (SubStr);
  186. if Remove and Result then
  187. Delete (Str, 1, Length (SubStr));
  188. end;
  189. { TPredefinedLibOptions }
  190. function TPredefinedLibOptions.GetSwitches: string;
  191. procedure AddSwitch(Define: string; const Value: string = '');
  192. begin
  193. if Length (Result) > 0 then
  194. Result := Result + ' ';
  195. Define := '-D' + Define;
  196. if Length (Value) > 0 then
  197. Define := '"' + Define + '=' + Value + '"';
  198. Result := Result + Define;
  199. end;
  200. begin
  201. Result := '';
  202. if cdTI92 in CalcDests then
  203. AddSwitch ('USE_TI92');
  204. if cdTI89 in CalcDests then
  205. AddSwitch ('USE_TI89');
  206. if cdTI92Plus in CalcDests then
  207. AddSwitch ('USE_TI92PLUS');
  208. if cdV200 in CalcDests then
  209. AddSwitch ('USE_V200');
  210. if OptimizeCalcConsts then
  211. AddSwitch ('OPTIMIZE_CALC_CONSTS');
  212. if KernelFormat in [kfStandard, kfCompressedTables] then begin
  213. AddSwitch ('USE_KERNEL');
  214. if KernelFormat = kfCompressedTables then
  215. AddSwitch ('USE_PREOS_COMPRESSED_TABLES');
  216. end;
  217. if UseMinAMS then try
  218. AddSwitch ('MIN_AMS', IntToStr (Round (StrToFloat (MinAMS) * 100)));
  219. except end;
  220. if UnofficialOSSupport then
  221. AddSwitch ('UNOFFICIAL_OS_SUPPORT');
  222. if KernelFormat = kfCompressedTables then begin
  223. if BSSRefFormat = rfNone then
  224. AddSwitch ('MERGE_BSS');
  225. end else begin
  226. case RelocFormat of
  227. rfKernel: AddSwitch ('KERNEL_FORMAT_RELOCS');
  228. rfCompressed: AddSwitch ('COMPRESSED_FORMAT_RELOCS');
  229. rfMLink: AddSwitch ('MLINK_FORMAT_RELOCS');
  230. rfFLine: AddSwitch ('USE_FLINE_JUMPS');
  231. end;
  232. case ROMCallFormat of
  233. rfKernel: AddSwitch ('KERNEL_FORMAT_ROM_CALLS');
  234. rfCompressed: AddSwitch ('COMPRESSED_FORMAT_ROM_CALLS');
  235. rfMlink: AddSwitch ('MLINK_FORMAT_ROM_CALLS');
  236. rfFLine: begin
  237. AddSwitch ('USE_FLINE_ROM_CALLS');
  238. Result := Result + ' -fno-function-cse';
  239. end;
  240. end;
  241. case BSSRefFormat of
  242. rfNone: AddSwitch ('MERGE_BSS');
  243. rfKernel: AddSwitch ('KERNEL_FORMAT_BSS');
  244. rfCompressed: AddSwitch ('COMPRESSED_FORMAT_BSS');
  245. rfMlink: AddSwitch ('MLINK_FORMAT_BSS');
  246. end;
  247. end;
  248. case DataRefFormat of
  249. rfKernel: AddSwitch ('KERNEL_FORMAT_DATA_VAR');
  250. rfCompressed: AddSwitch ('COMPRESSED_FORMAT_DATA_VAR');
  251. rfMlink: AddSwitch ('MLINK_FORMAT_DATA_VAR');
  252. end;
  253. if UseFLineJumps then begin
  254. AddSwitch ('USE_FLINE_JUMPS');
  255. if Use4ByteFLineJumps then
  256. AddSwitch ('USE_4_BYTE_FLINE_JUMPS');
  257. end;
  258. if OptimizeROMCalls then
  259. AddSwitch ('OPTIMIZE_ROM_CALLS');
  260. if UseInternalFLineEmulator then
  261. AddSwitch ('USE_INTERNAL_FLINE_EMULATOR');
  262. if UseReturnValue then
  263. AddSwitch ('RETURN_VALUE');
  264. if EnableErrorReturn then
  265. AddSwitch ('ENABLE_ERROR_RETURN');
  266. if SaveScreen then
  267. AddSwitch ('SAVE_SCREEN');
  268. end;
  269. initialization
  270. PredefinedLibOptions := TPredefinedLibOptions.Create;
  271. PredefinedLibOptions.MinAMS := '1.01';
  272. MainConsole := TProcessConsole.Create;
  273. SyntaxC := TSyntaxColoring.Create (nil);
  274. SyntaxAsm := TSyntaxColoring.Create (nil);
  275. SyntaxAsmGNU := TSyntaxColoring.Create (nil);
  276. SyntaxQuill := TSyntaxColoring.Create (nil);
  277. EditorFont := TFont.Create;
  278. with SyntaxC do begin
  279. Enabled := True;
  280. SymbolColor := clOlive;
  281. SymbolStyle := [fsBold];
  282. SymbolCustomStyle := True;
  283. NumberColor := clMaroon;
  284. NumberStyle := [];
  285. NumberCustomStyle := False;
  286. with WordLists.Add do begin
  287. Caption := 'C Keywords';
  288. Words.CommaText :=
  289. '__alignof__,__asm__,__attribute__,__complex__,__const__,__extension__,__imag__,__inline__,__label__,__real__,__typeof__,' +
  290. 'asm,auto,break,case,char,const,continue,default,do,double,else,enum,extern,float,for,goto,if,inline,int,long,register,return,short,signed,sizeof,static,struct,switch,typedef,typeof,union,unsigned,void,volatile,while';
  291. CaseSensitive := True;
  292. CustomColor := True;
  293. Color := clBlue;
  294. CustomStyle := True;
  295. Style := [fsBold];
  296. end;
  297. with CustomStyles.Add do begin
  298. Caption := 'Comment Area';
  299. CustomColor := True;
  300. Color := clGreen;
  301. CustomStyle := True;
  302. Style := [fsItalic];
  303. BeginText := '/*';
  304. EndText := '*/';
  305. Switchable := False;
  306. end;
  307. with CustomStyles.Add do begin
  308. Caption := 'Comment Line';
  309. CustomColor := True;
  310. Color := clGreen;
  311. CustomStyle := True;
  312. Style := [fsItalic];
  313. BeginText := '//';
  314. EndText := #13;
  315. Switchable := False;
  316. end;
  317. with CustomStyles.Add do begin
  318. Caption := 'String';
  319. CustomColor := True;
  320. Color := clMaroon;
  321. CustomStyle := False;
  322. Style := [];
  323. BeginText := '"';
  324. EndText := '"';
  325. IgnoreChar := '\';
  326. Switchable := False;
  327. end;
  328. with CustomStyles.Add do begin
  329. Caption := 'Character';
  330. CustomColor := True;
  331. Color := clMaroon;
  332. CustomStyle := False;
  333. Style := [];
  334. BeginText := '''';
  335. EndText := '''';
  336. IgnoreChar := '\';
  337. Switchable := False;
  338. end;
  339. with CustomStyles.Add do begin
  340. Caption := 'Preprocessor Directive';
  341. CustomColor := True;
  342. Color := clTeal;
  343. CustomStyle := True;
  344. Style := [fsBold];
  345. BeginText := '#';
  346. EndText := ' ';
  347. Switchable := False;
  348. end;
  349. ParenthesisColors.CommaText := '$800080,$C08000,$8080FF,$008000';
  350. ParenthesisStyle := [fsBold];
  351. ParenthesisCustomStyle := True;
  352. end;
  353. with SyntaxAsmGNU do begin
  354. NumberColor := SyntaxC.NumberColor;
  355. NumberStyle := SyntaxC.NumberStyle;
  356. NumberCustomStyle := SyntaxC.NumberCustomStyle;
  357. SymbolColor := SyntaxC.SymbolColor;
  358. SymbolStyle := SyntaxC.SymbolStyle;
  359. SymbolCustomStyle := SyntaxC.SymbolCustomStyle;
  360. ParenthesisColors.Assign (SyntaxC.ParenthesisColors);
  361. ParenthesisStyle := SyntaxC.ParenthesisStyle;
  362. ParenthesisCustomStyle := SyntaxC.ParenthesisCustomStyle;
  363. with CustomStyles.Add do begin
  364. Caption := 'Comment Area';
  365. CustomColor := True;
  366. Color := clGreen;
  367. CustomStyle := True;
  368. Style := [fsItalic];
  369. BeginText := '/*';
  370. EndText := '*/';
  371. Switchable := False;
  372. end;
  373. with CustomStyles.Add do begin
  374. Caption := 'Comment Line (|)';
  375. CustomColor := True;
  376. Color := clGreen;
  377. CustomStyle := True;
  378. Style := [fsItalic];
  379. BeginText := '|';
  380. EndText := #13;
  381. Switchable := False;
  382. end;
  383. with CustomStyles.Add do begin
  384. Caption := 'Comment Line (#)';
  385. CustomColor := True;
  386. Color := clGreen;
  387. CustomStyle := True;
  388. Style := [fsItalic];
  389. BeginText := '#';
  390. EndText := #13;
  391. Switchable := False;
  392. LineStartOnly := True;
  393. end;
  394. with CustomStyles.Add do begin
  395. Caption := 'String';
  396. CustomColor := True;
  397. Color := clMaroon;
  398. CustomStyle := False;
  399. Style := [];
  400. BeginText := '"';
  401. EndText := '"';
  402. IgnoreChar := '\';
  403. Switchable := False;
  404. end;
  405. with CustomStyles.Add do begin
  406. Caption := 'Character';
  407. CustomColor := True;
  408. Color := clMaroon;
  409. CustomStyle := False;
  410. Style := [];
  411. BeginText := '''';
  412. EndText := '''';
  413. IgnoreChar := '\';
  414. Switchable := False;
  415. end;
  416. with WordLists.Add do begin
  417. Caption := 'Data Movement';
  418. Words.CommaText := 'EXG,LEA,LINK,MOV,MOVE,MOVEA,MOVEM,MOVEP,MOVEQ,MOVM,MOVP,MOVQ,PEA,UNLK';
  419. Color := clBlue;
  420. CustomColor := True;
  421. CaseSensitive := False;
  422. end;
  423. with WordLists.Add do begin
  424. Caption := 'Integer Arithmetic';
  425. Words.CommaText := 'ADD,ADDA,ADDI,ADDQ,ADDX,CLR,CMP,CMPA,CMPI,CMPM,DIVS,DIVU,EXT,MULS,MULU,NEG,NEGX,SUB,SUBA,SUBI,SUBQ,SUBX,TAS';
  426. Color := clBlue;
  427. CustomColor := True;
  428. CaseSensitive := False;
  429. end;
  430. with WordLists.Add do begin
  431. Caption := 'Logical Instructions';
  432. Words.CommaText := 'AND,ANDI,EOR,EORI,NOT,OR,ORI';
  433. Color := clBlue;
  434. CustomColor := True;
  435. CaseSensitive := False;
  436. end;
  437. with WordLists.Add do begin
  438. Caption := 'Shift/Rotation Instructions';
  439. Words.CommaText := 'ASL,ASR,LSL,LSR,ROL,ROR,ROXL,ROXR,SWAP';
  440. Color := clBlue;
  441. CustomColor := True;
  442. CaseSensitive := False;
  443. end;
  444. with WordLists.Add do begin
  445. Caption := 'Bit Manipulation';
  446. Words.CommaText := 'BCHG,BCLR,BSET,BTST';
  447. Color := clBlue;
  448. CustomColor := True;
  449. CaseSensitive := False;
  450. end;
  451. with WordLists.Add do begin
  452. Caption := 'Program Control';
  453. Words.CommaText := 'BCC,BCS,BEQ,BGE,BGT,BHI,BLE,BLS,BLT,BMI,BNE,BPL,BRA,BSR,BVC,BVS,JBCC,JBCS,JBEQ,JBGE,JBGT,JBHI,JBLE,JBLS,JBLT,JBMI,JBNE,JBPL,JBRA,JBSR,JBVC,JBVS,JSR,JRA,JMP,'
  454. + 'NOP,RTR,RTS,SCC,SCS,SEQ,SF,SGE,SGT,SHI,SLE,SLS,SLT,SMI,SNE,SPL,ST,SVC,SVS,TST,'
  455. + 'JHI,JLS,JCC,JCS,JNE,JEQ,JVC,JVS,JPL,JMI,JGE,JLT,JGT,JLE,DBHI,DBLS,DBCC,DBCS,DBNE,DBEQ,DBVC,DBVS,DBPL,DBMI,DBGE,DBLT,DBGT,DBLE,DBF,DBRA,DBT,'
  456. + 'FJNE,FJEQ,FJGE,FJLT,FJGT,FJLE,FJF,FJT,FJGL,FJGLE,FJNGE,FJNGL,FJNGLE,FJNGT,FJNLE,FJNLT,FJOGE,FJOGL,FJOGT,FJOLE,FJOLT,FJOR,FJSEQ,FJSF,FJSNE,FJST,FJUEQ,FJUGE,FJUGT,FJULE,FJULT,FJUN';
  457. Color := clBlue;
  458. CustomColor := True;
  459. CaseSensitive := False;
  460. end;
  461. with WordLists.Add do begin
  462. Caption := 'System Control';
  463. Words.CommaText := 'ILLEGAL,RTE,TRAP';
  464. Color := clBlue;
  465. CustomColor := True;
  466. CaseSensitive := False;
  467. end;
  468. with WordLists.Add do begin
  469. Caption := 'Extensions';
  470. Words.CommaText := 'B,L,S,W';
  471. Color := $408000;
  472. CustomColor := True;
  473. CaseSensitive := False;
  474. end;
  475. with WordLists.Add do begin
  476. Caption := 'Assembler Directives';
  477. Words.CommaText := 'abort,align,altmacro,ascii,asciz,balign,balignw,balignl,byte,comm,data,'
  478. + 'def,dim,double,eject,else,end,elseif,endef,endfunc,endif,endm,endr,equ,equiv,'
  479. + 'err,even,exitm,extern,fail,file,fill,float,func,global,globl,hword,ident,if,include,'
  480. + 'incbin,int,irp,irpc,lcomm,lflags,line,ln,list,long,macro,mri,noaltmacro,nolist,octa,org,'
  481. + 'p2align,p2alignw,p2alignl,print,psize,purgem,quad,rept,sbttl,scl,section,set,'
  482. + 'short,single,size,sleb128,skip,space,stabd,stabn,stabs,string,struct,tag,text,'
  483. + 'title,type,uleb128,val,vtable_entry,word,xdef';
  484. Color := clBlue;
  485. CustomColor := True;
  486. Style := [fsBold];
  487. CustomStyle := True;
  488. CaseSensitive := True;
  489. end;
  490. with WordLists.Add do begin
  491. Caption := 'Registers';
  492. Words.CommaText := 'a0,a1,a2,a3,a4,a5,a6,a7,d0,d1,d2,d3,d4,d5,d6,d7,fp,pc,sp,sr';
  493. Color := clRed;
  494. CustomColor := True;
  495. Style := [fsUnderline];
  496. CustomStyle := True;
  497. CaseSensitive := False;
  498. end;
  499. end;
  500. with SyntaxAsm do begin
  501. NumberColor := SyntaxC.NumberColor;
  502. NumberStyle := SyntaxC.NumberStyle;
  503. NumberCustomStyle := SyntaxC.NumberCustomStyle;
  504. SymbolColor := SyntaxC.SymbolColor;
  505. SymbolStyle := SyntaxC.SymbolStyle;
  506. SymbolCustomStyle := SyntaxC.SymbolCustomStyle;
  507. ParenthesisColors.Assign (SyntaxC.ParenthesisColors);
  508. ParenthesisStyle := SyntaxC.ParenthesisStyle;
  509. ParenthesisCustomStyle := SyntaxC.ParenthesisCustomStyle;
  510. with CustomStyles.Add do begin
  511. Caption := 'Comment';
  512. CustomColor := True;
  513. Color := clGreen;
  514. CustomStyle := True;
  515. Style := [fsItalic];
  516. BeginText := ';';
  517. EndText := #13;
  518. Switchable := False;
  519. end;
  520. with CustomStyles.Add do begin
  521. Caption := 'String (double-quoted)';
  522. CustomColor := True;
  523. Color := clMaroon;
  524. CustomStyle := False;
  525. Style := [];
  526. BeginText := '"';
  527. EndText := '"';
  528. IgnoreChar := '';
  529. Switchable := False;
  530. end;
  531. with CustomStyles.Add do begin
  532. Caption := 'String (single-quoted)';
  533. CustomColor := True;
  534. Color := clMaroon;
  535. CustomStyle := False;
  536. Style := [];
  537. BeginText := '''';
  538. EndText := '''';
  539. IgnoreChar := '';
  540. Switchable := False;
  541. end;
  542. with WordLists.Add do begin
  543. Caption := 'Data Movement';
  544. Words.CommaText := 'EXG,LEA,LINK,MOVE,MOVEA,MOVEM,MOVEP,MOVEQ,PEA,UNLK';
  545. Color := clBlue;
  546. CustomColor := True;
  547. CaseSensitive := False;
  548. end;
  549. with WordLists.Add do begin
  550. Caption := 'Integer Arithmetic';
  551. Words.CommaText := 'ADD,ADDA,ADDI,ADDQ,ADDX,CLR,CMP,CMPA,CMPI,CMPM,DIVS,DIVU,EXT,MULS,MULU,NEG,NEGX,SUB,SUBA,SUBI,SUBQ,SUBX,TAS';
  552. Color := clBlue;
  553. CustomColor := True;
  554. CaseSensitive := False;
  555. end;
  556. with WordLists.Add do begin
  557. Caption := 'Logical Instructions';
  558. Words.CommaText := 'AND,ANDI,EOR,EORI,NOT,OR,ORI';
  559. Color := clBlue;
  560. CustomColor := True;
  561. CaseSensitive := False;
  562. end;
  563. with WordLists.Add do begin
  564. Caption := 'Shift/Rotation Instructions';
  565. Words.CommaText := 'ASL,ASR,LSL,LSR,ROL,ROLX,ROR,RORX,ROXL,ROXR,SWAP';
  566. Color := clBlue;
  567. CustomColor := True;
  568. CaseSensitive := False;
  569. end;
  570. with WordLists.Add do begin
  571. Caption := 'Bit Manipulation';
  572. Words.CommaText := 'BCHG,BCLR,BSET,BTST';
  573. Color := clBlue;
  574. CustomColor := True;
  575. CaseSensitive := False;
  576. end;
  577. with WordLists.Add do begin
  578. Caption := 'Program Control';
  579. Words.CommaText := 'BCC,BCS,BEQ,BGE,BGT,BHI,BHS,BLE,BLO,BLS,BLT,BMI,BNE,BPL,BRA,BSR,BVC,BVS,DBCC,DBCS,DBEQ,DBF,DBGE,DBGT,DBHI,DBHS,DBLE,DBLO,DBLS,DBLT,DBMI,DBNE,DBPL,DBRA,DBT,DBVC,DBVS,JMP,JSR,NOP,RTR,RTS,'
  580. + 'SCC,SCS,SEQ,SF,SGE,SGT,SHI,SHS,SLE,SLO,SLS,SLT,SMI,SNE,SPL,ST,SVC,SVS,TST';
  581. Color := clBlue;
  582. CustomColor := True;
  583. CaseSensitive := False;
  584. end;
  585. with WordLists.Add do begin
  586. Caption := 'System Control';
  587. Words.CommaText := 'ILLEGAL,RTE,TRAP';
  588. Color := clBlue;
  589. CustomColor := True;
  590. CaseSensitive := False;
  591. end;
  592. with WordLists.Add do begin
  593. Caption := 'Extensions';
  594. Words.CommaText := 'B,L,S,W';
  595. Color := $408000;
  596. CustomColor := True;
  597. CaseSensitive := False;
  598. end;
  599. with WordLists.Add do begin
  600. Caption := 'Assembler Directives';
  601. Words.CommaText := 'BSS,CNOP,CSEG,DSEG,DC,DCB,DS,END,ENDC,ENDIF,ENDM,EQU,EQUR,EVEN,FAR,IDNT,IFC,IFD,IFEQ,IFGE,IFGT,IFLE,IFLT,IFNC,IFND,IFNE,INCBIN,INCLUDE,LIST,MACRO,NEAR,NOLIST,ORG,PAGE,PUBLIC,REG,RORG,SECTION,SET,SPC,TITLE,TTL,XDEF,XREF';
  602. Color := clBlue;
  603. CustomColor := True;
  604. Style := [fsBold];
  605. CustomStyle := True;
  606. CaseSensitive := False;
  607. end;
  608. with WordLists.Add do begin
  609. Caption := 'Registers';
  610. Words.CommaText := 'a0,a1,a2,a3,a4,a5,a6,a7,d0,d1,d2,d3,d4,d5,d6,d7,fp,pc,sp,sr';
  611. Color := clRed;
  612. CustomColor := True;
  613. Style := [fsUnderline];
  614. CustomStyle := True;
  615. CaseSensitive := False;
  616. end;
  617. end;
  618. SyntaxQuill.Assign (SyntaxC);
  619. with SyntaxQuill do begin
  620. with WordLists.Add do begin
  621. Caption := 'Sections';
  622. Words.CommaText := '$$ACTIONS,$$CONNECTIONS,$$END,$$END_TEST,$$EVENTS,$$EXTERN,$$LOCATIONS,$$MESSAGES,$$OBJECTS,$$OLDSTYLE_SYSTEM_MESSAGES,$$PICTURES,$$PICTURES_TEST,$$SYSTEM_MESSAGES,$$TITLE,$$VOCABULARY';
  623. CaseSensitive := True;
  624. CustomColor := True;
  625. Color := $0000FF;
  626. CustomStyle := True;
  627. Style := [fsBold];
  628. end;
  629. with WordLists.Add do begin
  630. Caption := 'Section-specific Keywords';
  631. Words.CommaText := 'ACTION,BITMAP,CBLOCK,CONN,DEFINE,DRAWING,END_BITMAP,END_CBLOCK,END_DRAWING,END_PACKED_BITMAP,EVENT,FROM,LOC,MSG,OBJ,PACKED_BITMAP,WORD';
  632. CaseSensitive := True;
  633. CustomColor := True;
  634. Color := $808040;
  635. CustomStyle := True;
  636. Style := [fsBold];
  637. end;
  638. with WordLists.Add do begin
  639. Caption := 'Additional Keywords';
  640. Words.CommaText := 'CONTINUE,ELSE';
  641. CaseSensitive := True;
  642. CustomColor := True;
  643. Color := $808040;
  644. CustomStyle := True;
  645. Style := [fsBold];
  646. end;
  647. with WordLists.Add do begin
  648. Caption := 'Non-functional Keywords';
  649. Words.CommaText := 'BEEP,BLOCK,BORDER,BRIGHT,FLASH,INK,PAPER';
  650. CaseSensitive := True;
  651. CustomColor := True;
  652. Color := $C0C0C0;
  653. CustomStyle := True;
  654. Style := [fsBold];
  655. end;
  656. with WordLists.Add do begin
  657. Caption := 'Predefined Aliases';
  658. Words.CommaText := '$ALSOSEE,$ARG,$CARRIED,$CENTER,$CNT1,$CNT2,$CNT3,$CNT4,$CONT,$CURLOC,$DARK,$DARKCNT,$DESC,$DESC_CNT,$DESC_DARKCNT,$DESC_NOLIGHTCNT,$DONE,$ENDGAME,$EXIT,$FAIL,$FONT,$FULLSCR,$GCONTROL,$LSOURCE,'
  659. + '$MAXCAR,$NOLIGHTCNT,$NOUN,$NOWHERE,$NULL,$NUMCAR,$PROMPT,$RESTART,$SCORE,$SPECIAL,$SUBROUTINE,$TURNHI,$TURNLO,$VERB,$WORN';
  660. CaseSensitive := True;
  661. CustomColor := True;
  662. Color := $800080;
  663. CustomStyle := True;
  664. Style := [fsBold];
  665. end;
  666. with WordLists.Add do begin
  667. Caption := 'Conditions';
  668. Words.CommaText := 'ABSENT,AT,ATGT,ATLT,CARRIED,CHANCE,CREATED,EQ,EQWORD,EXTWORD,GT,HERE,ISAT,ISDESC,ISNOTAT,ISNOTNULL,ISNULL,LT,NEQWORD,NOTAT,NOTCARR,NOTCREATED,NOTEQ,NOTHERE,NOTSAME,NOTWORN,NOTZERO,PRESENT,SAME,TRYMOVE,WORN,ZERO';
  669. CaseSensitive := True;
  670. CustomColor := True;
  671. Color := $FF0000;
  672. CustomStyle := True;
  673. Style := [fsBold];
  674. end;
  675. with WordLists.Add do begin
  676. Caption := 'Actions';
  677. Words.CommaText := 'ADD,ALSOSEE,ANYKEY,AUTOD,AUTOG,AUTOR,AUTOW,BIGFONT,CANCEL,CLEAR,CLS,COPYFF,COPYFO,COPYOF,COPYOO,CREATE,DECCAR,DESC,DESTROY,DONE,DROP,DROPALL,END,ENDDESC,EXIT,EXTERN,GET,GETWORD,GOTO,INCCAR,INVEN,LET,'
  678. + 'LISTAT,LISTOBJ,LOAD,MAXCAR,MES,MESFLAG,MESSAGE,MINUS,NEWLINE,NOTDONE,OK,PAUSE,PICNORM,PICOFF,PICON,PLACE,PLUS,PRINT,PROMPT,PUTO,QUIT,QVERSION,RAMLOAD,RAMSAVE,RANDOM,REDRAW,REMOVE,RESTART,SAVE,SCORE,'
  679. + 'SET,SETNOUN,SETVERB,SHOWLOC,SMLFONT,SUB,SWAP,SYSMESS,TURNS,WEAR,WHATO,WHEREO,ZAPSCR';
  680. CaseSensitive := True;
  681. CustomColor := True;
  682. Color := $A00000;
  683. CustomStyle := True;
  684. Style := [fsBold];
  685. end;
  686. with WordLists.Add do begin
  687. Caption := 'Drawing Primitives';
  688. Words.CommaText := 'AMOVE,CALL,ELLIPSE,FILL,INV_ELLIPSE,INV_LINE,INV_PLOT,INV_RPLOT,LINE,MOVE,PLOT,RPLOT,SHADE,XOR_ELLIPSE,XOR_LINE,XOR_PLOT,XOR_RPLOT';
  689. CaseSensitive := True;
  690. CustomColor := True;
  691. Color := $FF8000;
  692. CustomStyle := True;
  693. Style := [fsBold];
  694. end;
  695. with WordLists.Add do begin
  696. Caption := 'Drawing Directions';
  697. Words.CommaText := 'DOWN,DOWN_LEFT,DOWN_RIGHT,LEFT,LEFT_DOWN,LEFT_UP,RIGHT,RIGHT_DOWN,RIGHT_UP,UP,UP_LEFT,UP_RIGHT';
  698. CaseSensitive := True;
  699. CustomColor := True;
  700. Color := $008000;
  701. CustomStyle := True;
  702. Style := [fsBold];
  703. end;
  704. with WordLists.Add do begin
  705. Caption := 'Shading Patterns';
  706. Words.CommaText := '$BKSLASHFILL,$BRICKFILL,$CHAINFILL,$CIRCLEFILL,$CLOSEDASHFILL,$CLOSEDOTFILL,$CLOSEWAVEFILL,$CROSSFILL,$DASHFILL,$DOTFILL,$HATCHFILL,$INTERLEAVEFILL,$LIGHTDOTFILL,$LIGHTLINEFILL,$LINEFILL,$SLASHFILL,'
  707. + '$SOLIDFILL,$SQDOTFILL,$SQUAREFILL,$THICKBKSLASHFILL,$THICKHATCHFILL,$THICKLINEFILL,$THICKSLASHFILL,$VDASHFILL,$VINTERLEAVEFILL,$VLDOTFILL,$VLIGHTLINEFILL,$VLINEFILL,$VTHICKLINEFILL,$WAVEFILL,$WIDEDOTFILL,$XMARKFILL,$ZIGZAGFILL';
  708. CaseSensitive := True;
  709. CustomColor := True;
  710. Color := $800080;
  711. CustomStyle := True;
  712. Style := [fsBold];
  713. end;
  714. with WordLists.Add do begin
  715. Caption := 'External Symbols';
  716. Words.CommaText := '$ACTIONS$,$ARG$,$BMPUT$,$BPCKPUT$,$BUFFER$,$CONNECTIONS$,$EVENTS$,$EXTERN$,$FLAGS$,$FLAGS_BACKUP$,$GDF$,$GETLINE$,$LOCATIONS$,$LQL$,$MAXCAR$,$MESSAGES$,$NFLAG$,$NLOC$,$NMSG$,$NOBJ$,$NSYSMSG$,$NWORD$,'
  717. + '$OBJECTS$,$PDRAW$,$PICTURE$,$PRINT$,$RAM_SAVED$,$SCALEX$,$SCALEY$,$SSCR$,$SYSTEM_MESSAGES$,$WORDS$';
  718. CaseSensitive := True;
  719. CustomColor := True;
  720. Color := $408000;
  721. CustomStyle := True;
  722. Style := [fsBold];
  723. end;
  724. end;
  725. EditorFont.Name := 'Courier New';
  726. EditorFont.Size := 10;
  727. EditorColor := clWindow;
  728. DecimalSeparator := '.';
  729. finalization
  730. EditorFont.Free;
  731. SyntaxQuill.Free;
  732. SyntaxAsm.Free;
  733. SyntaxAsmGNU.Free;
  734. SyntaxC.Free;
  735. MainConsole.Free;
  736. PredefinedLibOptions.Free;
  737. end.