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

  1. /* this script shows the actual Spectrum's screen */
  2.     
  3.     address command
  4.     
  5.     if ~show(ports,ZXAM_REXX) then do
  6.         requestchoice 'title "ZXAM Script error..." body "I can''t find the emulator''s port!!" gadgets "AARGH!"'
  7.         exit 0
  8.         end
  9.  
  10.     /* store the initial status of the emulator */
  11.     running=zxamactrun()    /* 1=running */
  12.     zxamstop()              /* stop the emulation */
  13.  
  14. /* open file */
  15.  
  16.     if ~OPEN('fichero','t:zxamscreen.tmp','Write') then exit 0
  17.     
  18. /* ID header */
  19.     dummy=writech('fichero','FORM')
  20.     dummy=writech('fichero','000060a8'x)    /* total size */
  21.     dummy=writech('fichero','ILBM')
  22.  
  23. /* chunk ANNO */
  24.     dummy=writech('fichero','ANNO')
  25.     dummy=writech('fichero','00000033'x)    /* size 51 chars */
  26.     dummy=writech('fichero','Saved by ZXAM Spectrum Emulator AGA (by Toni Pomar)')
  27.     dummy=writech('fichero','00'x)        /* pad to align */
  28.  
  29. /* chunk BMHD */
  30.     dummy=writech('fichero','BMHD')
  31.     dummy=writech('fichero','00000014'x)    /* size 20 */
  32.     dummy=writech('fichero','0100'x)    /* width */
  33.     dummy=writech('fichero','00c0'x)    /* height */
  34.     dummy=writech('fichero','0000'x)    /* pos x */
  35.     dummy=writech('fichero','0000'x)    /* pos y */
  36.     dummy=writech('fichero','04'x)        /* nro bitplanes */
  37.     dummy=writech('fichero','00'x)        /* masking */
  38.     dummy=writech('fichero','00'x)        /* compression */
  39.     dummy=writech('fichero','00'x)        /* Pad1 */
  40.     dummy=writech('fichero','0000'x)    /* transparent color */
  41.     dummy=writech('fichero','2c2c'x)    /* aspect 44:44 */
  42.     dummy=writech('fichero','0140'x)    /* width source page (320) */
  43.     dummy=writech('fichero','0100'x)    /* heigth source page (256) */
  44.  
  45. /* chunk CAMG */
  46.     dummy=writech('fichero','CAMG')
  47.     dummy=writech('fichero','00000004'x)    /* size 4 */
  48.     dummy=writech('fichero','00000000'x)    /* 00021000 = PAL:Lo-res */
  49.  
  50. /* chunk CMAP */
  51.  
  52.     dummy=writech('fichero','CMAP')
  53.     dummy=writech('fichero','00000030'x)    /* size 48 (16 colors*3 bytes) */
  54.  
  55.     /* border color */
  56.     /* color 0 to 7 acts as an index to acces to the array */
  57.  
  58.         dummy=writech('fichero',x2c(substr('000000000099990000aa00aa00aa0000bbbbcccc00dddddd',(zxamgetreg(bor)*6)+1,6)))
  59.  
  60.     dummy=writech('fichero','000099'x)    /* color 1 */
  61.     dummy=writech('fichero','990000'x)    /* color 2 */
  62.     dummy=writech('fichero','aa00aa'x)    /* color 3 */
  63.     dummy=writech('fichero','00aa00'x)    /* color 4 */
  64.     dummy=writech('fichero','00bbbb'x)    /* color 5 */
  65.     dummy=writech('fichero','cccc00'x)    /* color 6 */
  66.     dummy=writech('fichero','dddddd'x)    /* color 7 */
  67.     dummy=writech('fichero','000000'x)    /* color 8 */
  68.     dummy=writech('fichero','0000aa'x)    /* color 9 */
  69.     dummy=writech('fichero','bb0000'x)    /* color 10 */
  70.     dummy=writech('fichero','cc00cc'x)    /* color 11 */
  71.     dummy=writech('fichero','00cc00'x)    /* color 12 */
  72.     dummy=writech('fichero','00dddd'x)    /* color 13 */
  73.     dummy=writech('fichero','eeee00'x)    /* color 14 */
  74.     dummy=writech('fichero','ffffff'x)    /* color 15 */
  75.     
  76.  
  77. /* chunk BODY */
  78.  
  79.     dummy=writech('fichero','BODY')
  80.     dummy=writech('fichero','00006000'x)    /* size 6144*4 (4 bpls of 256*192) */
  81.  
  82. /* we use a special emulator's function to extract and convert to bitplanes */
  83.  
  84.     dummy=writech('fichero',zxamgetscr())
  85.  
  86.     dummy=close('fichero')
  87.     
  88.     address command
  89.  
  90.     'sys:utilities/multiview <nil: >nil: t:zxamscreen.tmp window'
  91.     
  92.     'delete >nil: t:zxamscreen.tmp'
  93.  
  94.     /* restore the status */
  95.     if running=1 then zxamrun()
  96.  
  97.     exit
  98.