MasterUnit.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. unit MasterUnit;
  2. interface
  3. uses
  4. CalcUnit, ProcessUnit, ParsingUnit,
  5. LinkUnit,
  6. Classes, Graphics, SourceEditUnit;
  7. const
  8. IDELocation = 'Bin\';
  9. LinkLibLocation = 'Bin\';
  10. GCCLocation = 'Bin\';
  11. AsLocation = 'Bin\';
  12. A68kLocation = 'Bin\';
  13. PackLocation = 'Bin\';
  14. ASMIncludeLocation = 'Include\ASM\';
  15. GASIncludeLocation = 'Include\S\';
  16. CIncludeLocation = 'Include\C\';
  17. QuillIncludeLocation = 'Include\Quill\';
  18. DocLocation = 'Doc\';
  19. ProjectsLocation = 'Projects\';
  20. StdLibLocation = 'Lib\';
  21. TIPatchLocation = 'Lib\';
  22. PStarterLocation = 'Lib\';
  23. TemplatesLocation = 'Bin\';
  24. CompletionLocation = 'Include\C\Completion\';
  25. DefaultGCCSwitches = '-B .\ -I- -I ..\Include\C\';
  26. DefaultAsSwitches = '-mc68000 -I ..\Include\S\';
  27. DefaultA68kSwitches = '-i..\Include\ASM';
  28. SpecialQuillGCCSwitches = '-I ..\Include\Quill\';
  29. ProjectFileExt = '.tpr';
  30. MaxNameLength = 8;
  31. type
  32. TSpecialSupportOption = (ssA68k, ssQuill, ssPack, ssFlashOS, ssFargo);
  33. TSpecialSupport = set of TSpecialSupportOption;
  34. TProjectTarget = (ptRegular, ptFlashOS, ptFargo, ptArchive);
  35. TTransferTarget = (ttNone, ttVTI, ttCalc);
  36. TCurVTIType = (cvNone, cvTI89, cvTI92Plus, cvTI92);
  37. TKernelFormat = (kfUnknown, kfNone, kfStandard, kfCompressedTables);
  38. TRelocFormat = (rfUnknown, rfNone, rfDirect, rfAMS, rfKernel, rfCompressed, rfMlink, rfFLine);
  39. TPredefinedLibOptions = class(TObject)
  40. CalcDests: TCalcDests;
  41. OptimizeCalcConsts: Boolean;
  42. KernelFormat: TKernelFormat;
  43. UseMinAMS: Boolean;
  44. MinAMS: string;
  45. UnofficialOSSupport: Boolean;
  46. RelocFormat,
  47. ROMCallFormat,
  48. BSSRefFormat,
  49. DataRefFormat: TRelocFormat;
  50. UseFLineJumps,
  51. Use4ByteFLineJumps,
  52. OptimizeROMCalls,
  53. UseInternalFLineEmulator: Boolean;
  54. UseReturnValue,
  55. EnableErrorReturn: Boolean;
  56. SaveScreen: Boolean;
  57. function GetSwitches: string;
  58. end;
  59. var
  60. MainConsole: TProcessConsole;
  61. StopOnErrors,
  62. DeleteAssemblyFiles,
  63. DeleteObjectFiles,
  64. AssumeUndefined,
  65. AutoBlocks,
  66. AutoNews,
  67. UseDataVar,
  68. DataVarCopy,
  69. DataVarCopyIfArchived,
  70. Pack,
  71. DebugInfo,
  72. StdLib,
  73. InitBSS,
  74. OptimizeNOPs,
  75. OptimizeReturns,
  76. OptimizeBranches,
  77. OptimizeMoves,
  78. OptimizeTests,
  79. OptimizeCalculations,
  80. RemoveUnusedSections,
  81. CutUnusedRanges,
  82. ReorderSections,
  83. MergeConstants,
  84. OutputBin: Boolean;
  85. ProjectTarget: TProjectTarget;
  86. GCCSwitches,
  87. AsSwitches,
  88. AsmSwitches,
  89. DataVar,
  90. PackVar,
  91. CommandLine,
  92. PostBuildProcessFile: string;
  93. PredefinedLibOptions: TPredefinedLibOptions;
  94. ProxyName: string;
  95. ProxyPort: Integer;
  96. TIGCCFolder: string;
  97. Temp: string;
  98. OperationCancelled,
  99. OperationSuccessful: Boolean;
  100. ProjectFileName: string;
  101. SyntaxC,
  102. SyntaxAsmGNU,
  103. SyntaxAsm,
  104. SyntaxQuill: TSyntaxColoring;
  105. TabSizeC,
  106. TabSizeAsm: Integer;
  107. EditorColor: TColor;
  108. EditorFont: TFont;
  109. EditorOnFly,
  110. EditorDragDrop,
  111. EditorRemoveTrSp: Boolean;
  112. LastNewsDate: Integer;
  113. TransferTarget: TTransferTarget;
  114. VTIPath: string;
  115. LinkPort: TLinkPort;
  116. LinkCable: TLinkCableType;
  117. SpecialSupport: TSpecialSupport;
  118. Compiling,
  119. CompFinishAndStop,
  120. CompStopNow: Boolean;
  121. CompStartTime,
  122. CompFileStartTime,
  123. CompLastTime: TDateTime;
  124. CompStartFile: procedure of object;
  125. CompStop: procedure of object;
  126. CompSetMessage: procedure(const Msg: string) of object;
  127. CompUpdate: procedure of object;
  128. CompUpdateProgramOutput: procedure of object;
  129. {$IFDEF CanSplit}
  130. var
  131. SplitFiles: Boolean;
  132. {$ENDIF}
  133. function StartsWith(const SubStr: string; var Str: string; CaseSensitive: Boolean = False; Remove: Boolean = False): Boolean;
  134. procedure WaitForMainConsole(const ProcessDesc: string);
  135. function Runnable: Boolean;
  136. implementation
  137. uses
  138. SysUtils, Forms;
  139. procedure WaitForMainConsole(const ProcessDesc: string);
  140. begin
  141. CompUpdate;
  142. while MainConsole.Running do begin
  143. CompUpdate;
  144. Application.ProcessMessages;
  145. if CompFinishAndStop then begin
  146. OperationCancelled := True;
  147. CompSetMessage ('Finishing ' + ProcessDesc + ' Process');
  148. end;
  149. if CompStopNow then begin
  150. OperationCancelled := True;
  151. MainConsole.KillProcess;
  152. Break;
  153. end;
  154. end;
  155. CompUpdate;
  156. end;
  157. function Runnable: Boolean;
  158. begin
  159. Result := (ProjectTarget <> ptArchive) and (TransferTarget <> ttNone);
  160. end;
  161. function StartsWith(const SubStr: string; var Str: string; CaseSensitive: Boolean; Remove: Boolean): Boolean;
  162. begin
  163. if CaseSensitive then
  164. Result := Copy (Str, 1, Length (SubStr)) = SubStr
  165. else
  166. Result := UpperCase (Copy (Str, 1, Length (SubStr))) = UpperCase (SubStr);
  167. if Remove and Result then
  168. Delete (Str, 1, Length (SubStr));
  169. end;
  170. { TPredefinedLibOptions }
  171. function TPredefinedLibOptions.GetSwitches: string;
  172. procedure AddSwitch(Define: string; const Value: string = '');
  173. begin
  174. if Length (Result) > 0 then
  175. Result := Result + ' ';
  176. Define := '-D' + Define;
  177. if Length (Value) > 0 then
  178. Define := '"' + Define + '=' + Value + '"';
  179. Result := Result + Define;
  180. end;
  181. begin
  182. Result := '';
  183. if cdTI92 in CalcDests then
  184. AddSwitch ('USE_TI92');
  185. if cdTI89 in CalcDests then
  186. AddSwitch ('USE_TI89');
  187. if cdTI92Plus in CalcDests then
  188. AddSwitch ('USE_TI92PLUS');
  189. if cdV200 in CalcDests then
  190. AddSwitch ('USE_V200');
  191. if OptimizeCalcConsts then
  192. AddSwitch ('OPTIMIZE_CALC_CONSTS');
  193. if KernelFormat in [kfStandard, kfCompressedTables] then begin
  194. AddSwitch ('USE_KERNEL');
  195. if KernelFormat = kfCompressedTables then
  196. AddSwitch ('USE_PREOS_COMPRESSED_TABLES');
  197. end;
  198. if UseMinAMS then try
  199. AddSwitch ('MIN_AMS', IntToStr (Round (StrToFloat (MinAMS) * 100)));
  200. except end;
  201. if UnofficialOSSupport then
  202. AddSwitch ('UNOFFICIAL_OS_SUPPORT');
  203. if KernelFormat = kfCompressedTables then begin
  204. if BSSRefFormat = rfNone then
  205. AddSwitch ('MERGE_BSS');
  206. end else begin
  207. case RelocFormat of
  208. rfKernel: AddSwitch ('KERNEL_FORMAT_RELOCS');
  209. rfCompressed: AddSwitch ('COMPRESSED_FORMAT_RELOCS');
  210. rfMLink: AddSwitch ('MLINK_FORMAT_RELOCS');
  211. rfFLine: AddSwitch ('USE_FLINE_JUMPS');
  212. end;
  213. case ROMCallFormat of
  214. rfKernel: AddSwitch ('KERNEL_FORMAT_ROM_CALLS');
  215. rfCompressed: AddSwitch ('COMPRESSED_FORMAT_ROM_CALLS');
  216. rfMlink: AddSwitch ('MLINK_FORMAT_ROM_CALLS');
  217. rfFLine: begin
  218. AddSwitch ('USE_FLINE_ROM_CALLS');
  219. Result := Result + ' -fno-function-cse';
  220. end;
  221. end;
  222. case BSSRefFormat of
  223. rfNone: AddSwitch ('MERGE_BSS');
  224. rfKernel: AddSwitch ('KERNEL_FORMAT_BSS');
  225. rfCompressed: AddSwitch ('COMPRESSED_FORMAT_BSS');
  226. rfMlink: AddSwitch ('MLINK_FORMAT_BSS');
  227. end;
  228. end;
  229. case DataRefFormat of
  230. rfKernel: AddSwitch ('KERNEL_FORMAT_DATA_VAR');
  231. rfCompressed: AddSwitch ('COMPRESSED_FORMAT_DATA_VAR');
  232. rfMlink: AddSwitch ('MLINK_FORMAT_DATA_VAR');
  233. end;
  234. if UseFLineJumps then begin
  235. AddSwitch ('USE_FLINE_JUMPS');
  236. if Use4ByteFLineJumps then
  237. AddSwitch ('USE_4_BYTE_FLINE_JUMPS');
  238. end;
  239. if OptimizeROMCalls then
  240. AddSwitch ('OPTIMIZE_ROM_CALLS');
  241. if UseInternalFLineEmulator then
  242. AddSwitch ('USE_INTERNAL_FLINE_EMULATOR');
  243. if UseReturnValue then
  244. AddSwitch ('RETURN_VALUE');
  245. if EnableErrorReturn then
  246. AddSwitch ('ENABLE_ERROR_RETURN');
  247. if SaveScreen then
  248. AddSwitch ('SAVE_SCREEN');
  249. end;
  250. initialization
  251. PredefinedLibOptions := TPredefinedLibOptions.Create;
  252. PredefinedLibOptions.MinAMS := '1.01';
  253. MainConsole := TProcessConsole.Create;
  254. SyntaxC := TSyntaxColoring.Create (nil);
  255. SyntaxAsm := TSyntaxColoring.Create (nil);
  256. SyntaxAsmGNU := TSyntaxColoring.Create (nil);
  257. SyntaxQuill := TSyntaxColoring.Create (nil);
  258. EditorFont := TFont.Create;
  259. with SyntaxC do begin
  260. Enabled := True;
  261. SymbolColor := clOlive;
  262. SymbolStyle := [fsBold];
  263. SymbolCustomStyle := True;
  264. NumberColor := clMaroon;
  265. NumberStyle := [];
  266. NumberCustomStyle := False;
  267. with WordLists.Add do begin
  268. Caption := 'C Keywords';
  269. Words.CommaText :=
  270. '__alignof__,__asm__,__attribute__,__complex__,__const__,__extension__,__imag__,__inline__,__label__,__real__,__typeof__,' +
  271. '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';
  272. CaseSensitive := True;
  273. CustomColor := True;
  274. Color := clBlue;
  275. CustomStyle := True;
  276. Style := [fsBold];
  277. end;
  278. with CustomStyles.Add do begin
  279. Caption := 'Comment Area';
  280. CustomColor := True;
  281. Color := clGreen;
  282. CustomStyle := True;
  283. Style := [fsItalic];
  284. BeginText := '/*';
  285. EndText := '*/';
  286. Switchable := False;
  287. end;
  288. with CustomStyles.Add do begin
  289. Caption := 'Comment Line';
  290. CustomColor := True;
  291. Color := clGreen;
  292. CustomStyle := True;
  293. Style := [fsItalic];
  294. BeginText := '//';
  295. EndText := #13;
  296. Switchable := False;
  297. end;
  298. with CustomStyles.Add do begin
  299. Caption := 'String';
  300. CustomColor := True;
  301. Color := clMaroon;
  302. CustomStyle := False;
  303. Style := [];
  304. BeginText := '"';
  305. EndText := '"';
  306. IgnoreChar := '\';
  307. Switchable := False;
  308. end;
  309. with CustomStyles.Add do begin
  310. Caption := 'Character';
  311. CustomColor := True;
  312. Color := clMaroon;
  313. CustomStyle := False;
  314. Style := [];
  315. BeginText := '''';
  316. EndText := '''';
  317. IgnoreChar := '\';
  318. Switchable := False;
  319. end;
  320. with CustomStyles.Add do begin
  321. Caption := 'Preprocessor Directive';
  322. CustomColor := True;
  323. Color := clTeal;
  324. CustomStyle := True;
  325. Style := [fsBold];
  326. BeginText := '#';
  327. EndText := ' ';
  328. Switchable := False;
  329. end;
  330. ParenthesisColors.CommaText := '$800080,$C08000,$8080FF,$008000';
  331. ParenthesisStyle := [fsBold];
  332. ParenthesisCustomStyle := True;
  333. end;
  334. with SyntaxAsmGNU do begin
  335. NumberColor := SyntaxC.NumberColor;
  336. NumberStyle := SyntaxC.NumberStyle;
  337. NumberCustomStyle := SyntaxC.NumberCustomStyle;
  338. SymbolColor := SyntaxC.SymbolColor;
  339. SymbolStyle := SyntaxC.SymbolStyle;
  340. SymbolCustomStyle := SyntaxC.SymbolCustomStyle;
  341. ParenthesisColors.Assign (SyntaxC.ParenthesisColors);
  342. ParenthesisStyle := SyntaxC.ParenthesisStyle;
  343. ParenthesisCustomStyle := SyntaxC.ParenthesisCustomStyle;
  344. with CustomStyles.Add do begin
  345. Caption := 'Comment Area';
  346. CustomColor := True;
  347. Color := clGreen;
  348. CustomStyle := True;
  349. Style := [fsItalic];
  350. BeginText := '/*';
  351. EndText := '*/';
  352. Switchable := False;
  353. end;
  354. with CustomStyles.Add do begin
  355. Caption := 'Comment Line (|)';
  356. CustomColor := True;
  357. Color := clGreen;
  358. CustomStyle := True;
  359. Style := [fsItalic];
  360. BeginText := '|';
  361. EndText := #13;
  362. Switchable := False;
  363. end;
  364. with CustomStyles.Add do begin
  365. Caption := 'Comment Line (#)';
  366. CustomColor := True;
  367. Color := clGreen;
  368. CustomStyle := True;
  369. Style := [fsItalic];
  370. BeginText := '#';
  371. EndText := #13;
  372. Switchable := False;
  373. LineStartOnly := True;
  374. end;
  375. with CustomStyles.Add do begin
  376. Caption := 'String';
  377. CustomColor := True;
  378. Color := clMaroon;
  379. CustomStyle := False;
  380. Style := [];
  381. BeginText := '"';
  382. EndText := '"';
  383. IgnoreChar := '\';
  384. Switchable := False;
  385. end;
  386. with CustomStyles.Add do begin
  387. Caption := 'Character';
  388. CustomColor := True;
  389. Color := clMaroon;
  390. CustomStyle := False;
  391. Style := [];
  392. BeginText := '''';
  393. EndText := '''';
  394. IgnoreChar := '\';
  395. Switchable := False;
  396. end;
  397. with WordLists.Add do begin
  398. Caption := 'Data Movement';
  399. Words.CommaText := 'EXG,LEA,LINK,MOV,MOVE,MOVEA,MOVEM,MOVEP,MOVEQ,MOVM,MOVP,MOVQ,PEA,UNLK';
  400. Color := clBlue;
  401. CustomColor := True;
  402. CaseSensitive := False;
  403. end;
  404. with WordLists.Add do begin
  405. Caption := 'Integer Arithmetic';
  406. Words.CommaText := 'ADD,ADDA,ADDI,ADDQ,ADDX,CLR,CMP,CMPA,CMPI,CMPM,DIVS,DIVU,EXT,MULS,MULU,NEG,NEGX,SUB,SUBA,SUBI,SUBQ,SUBX';
  407. Color := clBlue;
  408. CustomColor := True;
  409. CaseSensitive := False;
  410. end;
  411. with WordLists.Add do begin
  412. Caption := 'Logical Instructions';
  413. Words.CommaText := 'AND,ANDI,EOR,EORI,NOT,OR,ORI';
  414. Color := clBlue;
  415. CustomColor := True;
  416. CaseSensitive := False;
  417. end;
  418. with WordLists.Add do begin
  419. Caption := 'Shift/Rotation Instructions';
  420. Words.CommaText := 'ASL,ASR,LSL,LSR,ROL,ROR,ROXL,ROXR,SWAP';
  421. Color := clBlue;
  422. CustomColor := True;
  423. CaseSensitive := False;
  424. end;
  425. with WordLists.Add do begin
  426. Caption := 'Bit Manipulation';
  427. Words.CommaText := 'BCHG,BCLR,BSET,BTST';
  428. Color := clBlue;
  429. CustomColor := True;
  430. CaseSensitive := False;
  431. end;
  432. with WordLists.Add do begin
  433. Caption := 'Program Control';
  434. 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,'
  435. + 'NOP,RTR,RTS,SCC,SCS,SEQ,SF,SGE,SGT,SHI,SLE,SLS,SLT,SMI,SNE,SPL,ST,SVC,SVS,TST,'
  436. + '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,'
  437. + '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';
  438. Color := clBlue;
  439. CustomColor := True;
  440. CaseSensitive := False;
  441. end;
  442. with WordLists.Add do begin
  443. Caption := 'System Control';
  444. Words.CommaText := 'ILLEGAL,RTE,TRAP';
  445. Color := clBlue;
  446. CustomColor := True;
  447. CaseSensitive := False;
  448. end;
  449. with WordLists.Add do begin
  450. Caption := 'Extensions';
  451. Words.CommaText := 'B,L,S,W';
  452. Color := $408000;
  453. CustomColor := True;
  454. CaseSensitive := False;
  455. end;
  456. with WordLists.Add do begin
  457. Caption := 'Assembler Directives';
  458. Words.CommaText := 'abort,align,ascii,asciz,balign,balignw,balignl,byte,comm,data,'
  459. + 'def,dim,double,eject,else,end,elseif,endef,endfunc,endif,endm,endr,equ,equiv,'
  460. + 'err,even,exitm,extern,fail,file,fill,float,func,global,hword,ident,if,include,'
  461. + 'incbin,int,irp,irpc,lcomm,lflags,line,ln,list,long,macro,mri,nolist,octa,org,'
  462. + 'p2align,p2alignw,p2alignl,print,psize,purgem,quad,rept,sbttl,scl,section,set,'
  463. + 'short,single,size,sleb128,skip,space,stabd,stabn,stabs,string,struct,tag,text,'
  464. + 'title,type,uleb128,val,vtable_entry,word';
  465. Color := clBlue;
  466. CustomColor := True;
  467. Style := [fsBold];
  468. CustomStyle := True;
  469. CaseSensitive := True;
  470. end;
  471. with WordLists.Add do begin
  472. Caption := 'Registers';
  473. Words.CommaText := 'a0,a1,a2,a3,a4,a5,a6,a7,d0,d1,d2,d3,d4,d5,d6,d7,fp,pc,sp,sr';
  474. Color := clRed;
  475. CustomColor := True;
  476. Style := [fsUnderline];
  477. CustomStyle := True;
  478. CaseSensitive := False;
  479. end;
  480. end;
  481. with SyntaxAsm do begin
  482. NumberColor := SyntaxC.NumberColor;
  483. NumberStyle := SyntaxC.NumberStyle;
  484. NumberCustomStyle := SyntaxC.NumberCustomStyle;
  485. SymbolColor := SyntaxC.SymbolColor;
  486. SymbolStyle := SyntaxC.SymbolStyle;
  487. SymbolCustomStyle := SyntaxC.SymbolCustomStyle;
  488. ParenthesisColors.Assign (SyntaxC.ParenthesisColors);
  489. ParenthesisStyle := SyntaxC.ParenthesisStyle;
  490. ParenthesisCustomStyle := SyntaxC.ParenthesisCustomStyle;
  491. with CustomStyles.Add do begin
  492. Caption := 'Comment';
  493. CustomColor := True;
  494. Color := clGreen;
  495. CustomStyle := True;
  496. Style := [fsItalic];
  497. BeginText := ';';
  498. EndText := #13;
  499. Switchable := False;
  500. end;
  501. with CustomStyles.Add do begin
  502. Caption := 'String (double-quoted)';
  503. CustomColor := True;
  504. Color := clMaroon;
  505. CustomStyle := False;
  506. Style := [];
  507. BeginText := '"';
  508. EndText := '"';
  509. IgnoreChar := '';
  510. Switchable := False;
  511. end;
  512. with CustomStyles.Add do begin
  513. Caption := 'String (single-quoted)';
  514. CustomColor := True;
  515. Color := clMaroon;
  516. CustomStyle := False;
  517. Style := [];
  518. BeginText := '''';
  519. EndText := '''';
  520. IgnoreChar := '';
  521. Switchable := False;
  522. end;
  523. with WordLists.Add do begin
  524. Caption := 'Data Movement';
  525. Words.CommaText := 'EXG,LEA,LINK,MOV,MOVE,MOVEA,MOVEM,MOVEP,MOVEQ,PEA,UNLK';
  526. Color := clBlue;
  527. CustomColor := True;
  528. CaseSensitive := False;
  529. end;
  530. with WordLists.Add do begin
  531. Caption := 'Integer Arithmetic';
  532. Words.CommaText := 'ADD,ADDA,ADDI,ADDQ,ADDX,CLR,CMP,CMPA,CMPI,CMPM,DIVS,DIVU,EXT,MULS,MULU,NEG,NEGX,SUB,SUBA,SUBI,SUBQ,SUBX';
  533. Color := clBlue;
  534. CustomColor := True;
  535. CaseSensitive := False;
  536. end;
  537. with WordLists.Add do begin
  538. Caption := 'Logical Instructions';
  539. Words.CommaText := 'AND,ANDI,EOR,EORI,NOT,OR,ORI';
  540. Color := clBlue;
  541. CustomColor := True;
  542. CaseSensitive := False;
  543. end;
  544. with WordLists.Add do begin
  545. Caption := 'Shift/Rotation Instructions';
  546. Words.CommaText := 'ASL,ASR,LSL,LSR,ROL,ROLX,ROR,RORX,ROXL,ROXR,SWAP';
  547. Color := clBlue;
  548. CustomColor := True;
  549. CaseSensitive := False;
  550. end;
  551. with WordLists.Add do begin
  552. Caption := 'Bit Manipulation';
  553. Words.CommaText := 'BCHG,BCLR,BSET,BTST';
  554. Color := clBlue;
  555. CustomColor := True;
  556. CaseSensitive := False;
  557. end;
  558. with WordLists.Add do begin
  559. Caption := 'Program Control';
  560. 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,'
  561. + 'SCC,SCS,SEQ,SF,SGE,SGT,SHI,SHS,SLE,SLO,SLS,SLT,SMI,SNE,SPL,ST,SVC,SVS,TST';
  562. Color := clBlue;
  563. CustomColor := True;
  564. CaseSensitive := False;
  565. end;
  566. with WordLists.Add do begin
  567. Caption := 'System Control';
  568. Words.CommaText := 'ILLEGAL,RTE,TRAP';
  569. Color := clBlue;
  570. CustomColor := True;
  571. CaseSensitive := False;
  572. end;
  573. with WordLists.Add do begin
  574. Caption := 'Extensions';
  575. Words.CommaText := 'B,L,S,W';
  576. Color := $408000;
  577. CustomColor := True;
  578. CaseSensitive := False;
  579. end;
  580. with WordLists.Add do begin
  581. Caption := 'Assembler Directives';
  582. 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';
  583. Color := clBlue;
  584. CustomColor := True;
  585. Style := [fsBold];
  586. CustomStyle := True;
  587. CaseSensitive := False;
  588. end;
  589. with WordLists.Add do begin
  590. Caption := 'Registers';
  591. Words.CommaText := 'a0,a1,a2,a3,a4,a5,a6,a7,d0,d1,d2,d3,d4,d5,d6,d7,fp,pc,sp,sr';
  592. Color := clRed;
  593. CustomColor := True;
  594. Style := [fsUnderline];
  595. CustomStyle := True;
  596. CaseSensitive := False;
  597. end;
  598. end;
  599. SyntaxQuill.Assign (SyntaxC);
  600. with SyntaxQuill do begin
  601. with WordLists.Add do begin
  602. Caption := 'Sections';
  603. Words.CommaText := '$$ACTIONS,$$CONNECTIONS,$$END,$$END_TEST,$$EVENTS,$$EXTERN,$$LOCATIONS,$$MESSAGES,$$OBJECTS,$$OLDSTYLE_SYSTEM_MESSAGES,$$PICTURES,$$PICTURES_TEST,$$SYSTEM_MESSAGES,$$TITLE,$$VOCABULARY';
  604. CaseSensitive := True;
  605. CustomColor := True;
  606. Color := $0000FF;
  607. CustomStyle := True;
  608. Style := [fsBold];
  609. end;
  610. with WordLists.Add do begin
  611. Caption := 'Section-specific Keywords';
  612. 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';
  613. CaseSensitive := True;
  614. CustomColor := True;
  615. Color := $808040;
  616. CustomStyle := True;
  617. Style := [fsBold];
  618. end;
  619. with WordLists.Add do begin
  620. Caption := 'Additional Keywords';
  621. Words.CommaText := 'CONTINUE,ELSE';
  622. CaseSensitive := True;
  623. CustomColor := True;
  624. Color := $808040;
  625. CustomStyle := True;
  626. Style := [fsBold];
  627. end;
  628. with WordLists.Add do begin
  629. Caption := 'Non-functional Keywords';
  630. Words.CommaText := 'BEEP,BLOCK,BORDER,BRIGHT,FLASH,INK,PAPER';
  631. CaseSensitive := True;
  632. CustomColor := True;
  633. Color := $C0C0C0;
  634. CustomStyle := True;
  635. Style := [fsBold];
  636. end;
  637. with WordLists.Add do begin
  638. Caption := 'Predefined Aliases';
  639. 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,'
  640. + '$MAXCAR,$NOLIGHTCNT,$NOUN,$NOWHERE,$NULL,$NUMCAR,$PROMPT,$RESTART,$SCORE,$SPECIAL,$SUBROUTINE,$TURNHI,$TURNLO,$VERB,$WORN';
  641. CaseSensitive := True;
  642. CustomColor := True;
  643. Color := $800080;
  644. CustomStyle := True;
  645. Style := [fsBold];
  646. end;
  647. with WordLists.Add do begin
  648. Caption := 'Conditions';
  649. 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';
  650. CaseSensitive := True;
  651. CustomColor := True;
  652. Color := $FF0000;
  653. CustomStyle := True;
  654. Style := [fsBold];
  655. end;
  656. with WordLists.Add do begin
  657. Caption := 'Actions';
  658. 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,'
  659. + '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,'
  660. + 'SET,SETNOUN,SETVERB,SHOWLOC,SMLFONT,SUB,SWAP,SYSMESS,TURNS,WEAR,WHATO,WHEREO,ZAPSCR';
  661. CaseSensitive := True;
  662. CustomColor := True;
  663. Color := $A00000;
  664. CustomStyle := True;
  665. Style := [fsBold];
  666. end;
  667. with WordLists.Add do begin
  668. Caption := 'Drawing Primitives';
  669. 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';
  670. CaseSensitive := True;
  671. CustomColor := True;
  672. Color := $FF8000;
  673. CustomStyle := True;
  674. Style := [fsBold];
  675. end;
  676. with WordLists.Add do begin
  677. Caption := 'Drawing Directions';
  678. Words.CommaText := 'DOWN,DOWN_LEFT,DOWN_RIGHT,LEFT,LEFT_DOWN,LEFT_UP,RIGHT,RIGHT_DOWN,RIGHT_UP,UP,UP_LEFT,UP_RIGHT';
  679. CaseSensitive := True;
  680. CustomColor := True;
  681. Color := $008000;
  682. CustomStyle := True;
  683. Style := [fsBold];
  684. end;
  685. with WordLists.Add do begin
  686. Caption := 'Shading Patterns';
  687. Words.CommaText := '$BKSLASHFILL,$BRICKFILL,$CHAINFILL,$CIRCLEFILL,$CLOSEDASHFILL,$CLOSEDOTFILL,$CLOSEWAVEFILL,$CROSSFILL,$DASHFILL,$DOTFILL,$HATCHFILL,$INTERLEAVEFILL,$LIGHTDOTFILL,$LIGHTLINEFILL,$LINEFILL,$SLASHFILL,'
  688. + '$SOLIDFILL,$SQDOTFILL,$SQUAREFILL,$THICKBKSLASHFILL,$THICKHATCHFILL,$THICKLINEFILL,$THICKSLASHFILL,$VDASHFILL,$VINTERLEAVEFILL,$VLDOTFILL,$VLIGHTLINEFILL,$VLINEFILL,$VTHICKLINEFILL,$WAVEFILL,$WIDEDOTFILL,$XMARKFILL,$ZIGZAGFILL';
  689. CaseSensitive := True;
  690. CustomColor := True;
  691. Color := $800080;
  692. CustomStyle := True;
  693. Style := [fsBold];
  694. end;
  695. with WordLists.Add do begin
  696. Caption := 'External Symbols';
  697. 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$,'
  698. + '$OBJECTS$,$PDRAW$,$PICTURE$,$PRINT$,$RAM_SAVED$,$SCALEX$,$SCALEY$,$SSCR$,$SYSTEM_MESSAGES$,$WORDS$';
  699. CaseSensitive := True;
  700. CustomColor := True;
  701. Color := $408000;
  702. CustomStyle := True;
  703. Style := [fsBold];
  704. end;
  705. end;
  706. EditorFont.Name := 'Courier New';
  707. EditorFont.Size := 10;
  708. EditorColor := clWindow;
  709. DecimalSeparator := '.';
  710. finalization
  711. EditorFont.Free;
  712. SyntaxQuill.Free;
  713. SyntaxAsm.Free;
  714. SyntaxAsmGNU.Free;
  715. SyntaxC.Free;
  716. MainConsole.Free;
  717. PredefinedLibOptions.Free;
  718. end.