home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / atari / st / 21120 < prev    next >
Encoding:
Text File  |  1993-01-27  |  2.4 KB  |  64 lines

  1. Path: sparky!uunet!opl.com!hri.com!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!uunet.ca!xenitec!tdkcs.waterloo.on.ca!semprini.tdkcs.waterloo.on.ca!cherborth
  2. From: cherborth@semprini.tdkcs.waterloo.on.ca (Chris Herborth)
  3. Newsgroups: comp.sys.atari.st
  4. Subject: Re: Hexmines v1.2
  5. Message-ID: <H.ea.dl0lu3NFGmA@semprini.tdkcs.waterloo.on.ca>
  6. Date: 25 Jan 93 16:50:58 GMT
  7. References: <H.ea.kVX8Hq&7qfI@semprini.tdkcs.waterloo.on.ca>
  8.     <8698@laas.laas.fr>
  9. Reply-To: cherborth@semprini.tdkcs.waterloo.on.ca
  10. Organization: InterZONE Design
  11. Lines: 50
  12. X-Software: HERMES GUS 1.04 Rev. Sep  5 1992
  13.  
  14. In <8698@laas.laas.fr>, Jean-Etienne Doucet writes:
  15. > Quite a long time ago, I've asked -- on the net -- if there were
  16. > some ways to simulate the GET/PUT GFA Basic instructions in C ?
  17. > (Preferably HSC)
  18.  
  19. Nobody answered?!?  Sheesh!  We all must've been in a flame war or
  20. something...  ;-)
  21.  
  22. > So what ? I stick to GFA Basic for writing games and only use
  23. > C for writing programs with no (or little) graphics
  24.  
  25. IMHO, GFA BASIC is nasty and hellishly incompatible...  Hopefully I
  26. won't start another flame war by saying that.
  27.  
  28. > For people who don't know what GET and PUT are:
  29. > GET x1,y1,x2,y2,CH$
  30. >     copy the screen portion given by x1,x2,y1,y2 into the string CH$
  31. > PUT x,y,CH$
  32. >     copy back the screen portion in CH$ as a rectangle with x,y being
  33. >     the upper left point coordinates.
  34.  
  35. Have you done any VDI programming?  It needs a little bit of setting up,
  36. but not too much.  And it'll generally work in any resolution...
  37.  
  38. vro_cpyfm() is the function you're after:
  39.  
  40. Copy Raster, Opaque
  41.  
  42. int vid_handle, mode, points[8];
  43. struct fdbstr
  44. {
  45.     int *fd_addr;       /* ptr to image data area [just a buffer] */
  46.     int fd_w;           /* width in pixels */
  47.     int fd_h;           /* height in pixels */
  48.     int fd_wdwidth;        /* image width in words (ie, 16-bits) */
  49.     int fd_stand;        /* standard format or ST format flag */
  50.     int fd_nplanes;        /* number of colour bit planes */
  51.     int fd_r1, fd_r2,    /* reserved for future use */
  52.         fd_r3;
  53. } src, dst;
  54.  
  55. vro_cpyfm( vdi_handle, mode, points, &src, &dst );
  56.  
  57. For more info, grab a VDI book, or beg someone for sample code...  ;-) 
  58. I'd type the rest of the manual page, but it's quite long.  Useful mode
  59. values are 3 (replace dst with src), 6 (XOR dst with src).
  60. -- 
  61. -------------------========================================-------------------
  62. Chris Herborth
  63. cherborth@semprini.tdkcs.waterloo.on.ca
  64.