home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Emulation / ZXAMSpectrum / ZXAM_Rexx / English / LoadSCR.zxam < prev    next >
Text File  |  1995-07-31  |  929b  |  34 lines

  1. /* this scrip loads a spectrum screen (files .scr saved by "Z80") */
  2.     
  3.     /* test if emulator is present */
  4.     address command
  5.     
  6.     if ~show(ports,ZXAM_REXX) then do
  7.         requestchoice 'title "ZXAM Script error..." body "I can''t find the emulator''s port!!" gadgets "AARGH!"'
  8.         exit
  9.         end
  10.  
  11.     /* store the initial status of the emulator */
  12.     running=zxamactrun()    /* 1=running */
  13.     zxamstop()              /* stop the emulation */
  14.  
  15.     /* LOAD requester */
  16.     oldpath=zxamactloadpath()
  17.     oldpattern=zxamactpattern()
  18.     zxampattern('#?.scr')
  19.     nombre=zxamloadrequester('Select the .scr file...')
  20.     zxamloadpath(oldpath)
  21.     zxampattern(oldpattern)
  22.     if nombre='' then exit 0    /* CANCEL */
  23.     
  24.     pantalla=zxampploadfile(nombre)    /* load the whole file */
  25.  
  26.     if length(pantalla)~=6912 then exit   /* test if it's a screen */
  27.     
  28.     zxamputmem(16384,pantalla)    /* place the file in the spectrum's screen */
  29.     
  30.     /* restore the status */
  31.     if running=1 then zxamrun()
  32.  
  33.     exit
  34.