home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / beehive / bbs / picsuncr.arc / PICSMAIN.UNC < prev    next >
Text File  |  1991-08-11  |  2KB  |  74 lines

  1. { PICSMAIN.UNC - Pascal Integrated Communications System mainline code}
  2. { 5/25/87 Ver 1.6 Copyright 1987 by Les Archambault }
  3.  
  4. { 02mar88 wb - Modifed to go directly into file mode with heap restored
  5.   when chaining back from PICSUNCR.CHN uncrunch program. Renamed from
  6.   PICSmain.inc to PICSmain.unc }
  7.  
  8. begin { PICS }
  9.  
  10.   { Go directly into file mode if PICS is executed by Turbo
  11.     Pascal instead of CP/M. }
  12.  
  13.   turbo_executed := (cmdline_bfr > 127);
  14.   if not turbo_executed then
  15.     begin
  16.       { Raise heap address to make room for uncrunch program }
  17.       HeapPtr:=$9300;
  18.       HeapFre:=$9300;
  19.       for i:=0 to 3 do
  20.         mem[HeapPtr+i]:=0;
  21.       { Save heap address so heap can be restored after chain }
  22.       heap_low:=HeapPtr;
  23.       heap_hi:=RecurPtr;
  24.       system_init;
  25.       cold_start;
  26.       setup;
  27.       wait_for_user;
  28.       check_300_restrict;
  29.     end;
  30.   cmdline_bfr := 128;
  31.   while not fini do
  32.     begin
  33.       if turbo_executed then
  34.         begin
  35.           UsrOutPtr:=addr(putchar); { Reassign USR: to ROS output driver }
  36.           HeapPtr:=heap_ptr;        { Restore heap pointers }
  37.           HeapFre:=heap_fre;
  38.         end
  39.       else
  40.         begin
  41.           login;
  42.           if online and in_use then Set_Initial_areas;
  43.         end;
  44.       while online and in_use do
  45.         begin
  46.           if op_chat
  47.             then op_chat := chat;
  48.           check_time;
  49.           make_prompt;
  50.           writeln(USR);
  51.           write_status_line;
  52.           st:=prompt(st,50,'ES?M');
  53.           if length(st)=1 then ch := st[1]
  54.           else ch:=' ';
  55.           if (not op_chat) then
  56.             begin
  57.               case mode of
  58.                 message_mode: process_messages;
  59.                   files_mode: process_files;
  60.                 utility_mode: process_utility;
  61.                   sysop_mode: process_sysop;
  62.               end;
  63.             end;
  64.         end;
  65.       exit_system;
  66.       wait_for_user;
  67.       check_300_restrict;
  68.     end;
  69.   system_de_init
  70. end.
  71.  
  72. {End of PICSmain.unc }
  73.  
  74.