home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Emulation / ZXAMSpectrum / ZXAM_Rexx / English / ZXAMRun.dopus < prev    next >
Text File  |  1995-07-31  |  1KB  |  41 lines

  1. /* This script loads a snapshot from disk */
  2.  
  3. /* Used originaly fo load games from DirOpus, through a FileType */
  4.  
  5. /* Needs the emulator to be previously loaded in memory, unless you modify */
  6. /* the script to run the emulator when the emulator port is not found */
  7.  
  8. parse arg nombre    /* gets the only argument */
  9.  
  10. /* Uses the internal loaders of the emulator */
  11.  
  12.     address command
  13.  
  14.     if ~show(ports,ZXAM_REXX) then do
  15.         requestchoice 'title "ZXAM Script error..." body "I couldn't find the emulators port!!" gadgets "AARGH!"'
  16.         exit
  17.         end
  18.  
  19.  
  20. /* Store the initial state of the emulator */
  21.  
  22.     running=zxamactrun()    /* 1=running */
  23.     zxamstop()              /* stop the emulator */
  24.  
  25.  
  26. /* load the snapshot */
  27.     
  28.     bloque=zxampploadfile(nombre)    /* load the whole file */
  29.     
  30.     formato=zxamparseloaded(bloque)        /* checks the format and loads the file */
  31.     
  32.     if formato~='' then do
  33.         zxamnameformat(zxamfilepart(nombre),formato)
  34.         zxamloadpath(zxampathpart(nombre))
  35.         zxamenablereload()
  36.         end
  37.     
  38.     if running=1 then zxamrun()
  39.  
  40.     exit
  41.