home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Games Special 11 / CD_1.iso / wingames / corewar / usemars.pas < prev    next >
Pascal/Delphi Source File  |  1995-08-19  |  3KB  |  74 lines

  1. Unit UseMars;
  2. {$A+,B-,D+,F+,G+,I-,K+,L+,N-,P+,Q+,R-,S-,T+,V+,W+,X+,Y+}
  3. {(C) Barbara Tikart  Polarwolf Hard & Software, Erlenbach am Main}
  4. {UseMars: Schnittstelle zum Memory Array Redcode Simulator MARS.DLL}
  5. {Projekt: CoreWar 1.0}
  6.  
  7. Interface
  8.  
  9. Uses WinTypes;
  10.  
  11. Const MarsErr_Ok = 0;
  12.       MarsErr_Dos = 1;
  13.       MarsErr_Structure = 2;
  14.       MarsErr_IllegalOpcode = 3;
  15.       MarsErr_ToFewArg = 4;
  16.       MarsErr_ArgSyntax = 5;
  17.       MarsErr_ArgRange = 6;
  18.       MarsErr_ToManyArg = 7;
  19.       MarsErr_IllegalData = 8;
  20.       MarsErr_IllegalImmediate = 9;
  21.       MarsErr_NoImmediateJump = 10;
  22.       MarsErr_NoObjCode = 11;
  23.  
  24. Type TMarsHandle = LongInt;
  25.  
  26. Procedure LoadMarsObjCode (FileName: PChar; Var PRG: TMarsHandle);
  27. Procedure DiscardMarsObjCode (PRG: TMarsHandle);
  28. Procedure SaveMarsObjCode (PRG: TMarsHandle; FileName: PChar;
  29.             Var Result: Integer);
  30.  
  31. Procedure RedcodeCompile (FileName: PChar; Var PRG: TMarsHandle;
  32.             Var Result, LineNr: Integer);
  33. Procedure RedcodeReCompile (PRG: TMarsHandle; FileName: PChar;
  34.             Var Result: Integer);
  35.  
  36. Function  CreateMarsVM (Size: Integer): TMarsHandle;
  37. Procedure DestroyMarsVM (VM: TMarsHandle);
  38. Procedure ResetMarsVM (VM: TMarsHandle);
  39. Procedure LinkMarsPRG (VM, PRG: TMarsHandle; Var IP: Integer);
  40. Procedure SetMarsMem (VM: TMarsHandle; IP: Integer; RedcodeLine: PChar;
  41.             Var Result: Integer);
  42. Procedure GetMarsMem (VM: TMarsHandle; IP: Integer; RedcodeLine: PChar;
  43.             MaxLen: Integer);
  44. Function  IsMarsData (VM: TMarsHandle; IP: Integer): Bool;
  45. Procedure ExecMarsCmd (VM: TMarsHandle; Var IP, Modified: Integer);
  46.  
  47. Function  FindAttrInMarsObjCode (PRG: TMarsHandle; Attr: PChar;
  48.             MaxLen: Integer): Bool;
  49.  
  50. Procedure MarsErrorMSG (T: PChar; MaxLen, ErrorNr: Integer);
  51.  
  52. Implementation
  53.  
  54. Procedure LoadMarsObjCode (FileName: PChar; Var PRG: TMarsHandle); External 'MARS';
  55. Procedure DiscardMarsObjCode (PRG: TMarsHandle); External 'MARS';
  56. Procedure SaveMarsObjCode (PRG: TMarsHandle; FileName: PChar; Var Result: Integer); External 'MARS';
  57.  
  58. Procedure RedcodeCompile (FileName: PChar; Var PRG: TMarsHandle; Var Result, LineNr: Integer); External 'MARS';
  59. Procedure RedcodeReCompile (PRG: TMarsHandle; FileName: PChar; Var Result: Integer); External 'MARS';
  60.  
  61. Function  CreateMarsVM (Size: Integer): TMarsHandle; External 'MARS';
  62. Procedure DestroyMarsVM (VM: TMarsHandle); External 'MARS';
  63. Procedure ResetMarsVM (VM: TMarsHandle); External 'MARS';
  64. Procedure LinkMarsPRG (VM, PRG: TMarsHandle; Var IP: Integer); External 'MARS';
  65. Procedure SetMarsMem (VM: TMarsHandle; IP: Integer; RedcodeLine: PChar; Var Result: Integer); External 'MARS';
  66. Procedure GetMarsMem (VM: TMarsHandle; IP: Integer; RedcodeLine: PChar; MaxLen: Integer); External 'MARS';
  67. Function  IsMarsData (VM: TMarsHandle; IP: Integer): Bool; External 'MARS';
  68. Procedure ExecMarsCmd (VM: TMarsHandle; Var IP, Modified: Integer); External 'MARS';
  69.  
  70. Function  FindAttrInMarsObjCode (PRG: TMarsHandle; Attr: PChar; MaxLen: Integer): Bool; External 'MARS';
  71. Procedure MarsErrorMSG (T: PChar; MaxLen, ErrorNr: Integer); External 'MARS';
  72.  
  73. End.
  74.