vro_cpy_fm() gfa?

GFA BASIC-related articles in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2272
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

vro_cpy_fm() gfa?

Postby charles » Sun Dec 03, 2017 4:57 pm

couple questions about using vro_cpyfm()

is it a built in gfa command already?
Last edited by charles on Sun Dec 03, 2017 5:38 pm, edited 1 time in total.
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2272
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: vro_cpyfm() gfa?

Postby charles » Sun Dec 03, 2017 5:31 pm

Code: Select all


' sof
'
' \\\save listing
SAVE "d:\gfafiles\vrocpy.gfa"
LIST "d:\vrocpyfm.lst"
'
' \\\mfdb space
DIM smfdb%(8),dmfdb%(8)
'
' \\\get handle
handle&=V~H
'
' \\\draw image
BOX 23,34,44,66
'
' \\\wait
~INP(2)
'
' \\\get  image area
GET 20,30,63,99,a$
'
' \\\clear screen
CLS
'
' \\\wait
~INP(2)
'
' \\\draw a second box so vro_cpy_fm()redraw differs
BOX 30,50,56,200
'
' \\\check if any image data
IF LEN(a$)>6
  '
  ' \\\set up memory form definition blocks
  smfdb%(0)=(V:a$+6)                  !pointer to img data
  smfdb%(1)=INT{V:a$}+16 AND &HFFF0   !img width in pixels
  smfdb%(2)=INT{V:a$+2}+1             !img height in pixels
  smfdb%(3)=INT((smfdb%(1)+15)/16)    !img width in words
  smfdb%(4)=3                         !standard format flag ??3
  smfdb%(5)=1                         !# of color bitplanes
  '
  dmfdb%(0)=XBIOS(2)
  dmfdb%(1)=639
  dmfdb%(2)=399
  dmfdb%(3)=40
  dmfdb%(4)=3
  dmfdb%(5)=1
  '
  ' \\\vs_clip screen area
  ' CLIP 1,1,639,399
  vs_clip(handle&,1,1,1,639,399)
  '
  ' \\\use the vro_cpyfm() raster draw opaque screen
  vro_cpy_fm(handle&,3,1,1,639,399,1,1,639,399,V:smfdb%(0),V:dmfdb%(0))
  '
  ' \\\wait
  ~INP(2)
  '
ELSE
  '
  ' \\\if image was <6 bytes
  ~FORM_ALERT(1,"[1][image contains no data][quit]")
  '
ENDIF
'
' \\\end prgm
END
'
'
> PROCEDURE vro_cpy_fm(dh&,mode&,xs&,ys&,ws&,hs&,xd&,yd&,wd&,hd&,src%,dst%)
  CONTRL(0)=109
  CONTRL(1)=4
  CONTRL(3)=1
  CONTRL(6)=dh&
  CONTRL(7)=INT(SWAP(src%))
  CONTRL(8)=INT(src%)
  CONTRL(9)=INT(SWAP(dst%))
  CONTRL(10)=INT(dst%)
  INTIN(0)=mode&
  PTSIN(0)=xs&
  PTSIN(1)=ys&
  PTSIN(2)=ws&
  PTSIN(3)=hs&
  PTSIN(4)=xd&
  PTSIN(5)=yd&
  PTSIN(6)=wd&
  PTSIN(7)=hd&
  VDISYS
RETURN
> PROCEDURE vr_trn_fm(dh&,src%,dst%)
  '
  ' \\\in place transformation vr_trn_fm()
  '
  ' CONTRL(0)=110
  ' CONTRL(1)=0
  ' CONTRL(3)=0
  ' CONTRL(6)=dh&
  ' CONTRL(7)=INT(SWAP(src%))
  ' CONTRL(8)=INT(src%)
  ' CONTRL(9)=INT(SWAP(dst%))
  ' CONTRL(10)=INT(dst%)
  ' VDISYS
  '
RETURN
> PROCEDURE vs_clip(dh&,mode&,x&,y&,w&,h&)
  CONTRL(0)=129
  CONTRL(1)=2
  CONTRL(3)=1
  CONTRL(6)=dh&
  INTIN(0)=mode&
  PTSIN(0)=x&
  PTSIN(1)=y&
  PTSIN(2)=w&
  PTSIN(3)=h&
  VDISYS
RETURN
'
' eof




atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2272
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: vro_cpy_fm() gfa?

Postby charles » Sun Dec 03, 2017 10:34 pm

small error in last listing ,
still haven't figured out how to convert a section of screen held in string from the command GET
to be used within vro_cpy_fm()

Code: Select all


' sof
'
' \\\save listing
LIST "d:\vro1.lst"
'
' \\\mfdb space
DIM smfdb&(9),dmfdb&(9)
'
' \\\get handle
handle&=V~H
'
' \\\draw image
BOX 21,31,39,49
'
' \\\get  image area
GET 20,30,40,50,a$
' \\\verify we have image
PUT 33,44,a$
'
' \\\wait
~INP(2)
'
' \\\clear screen
CLS
'
' \\\wait
~INP(2)
'
' \\\draw a second box so vro_cpy_fm()redraw differs
BOX 30,50,56,200
'
' \\\check if any image data
IF LEN(a$)>6
  '
  ' \\\set up memory form definition blocks
  LONG{V:smfdb&(0)}=(V:a$)+6                  !pointer to img data
  smfdb&(2)=WORD{V:a$}+15 AND &HFFF0   !img width in pixels
  smfdb&(3)=WORD{V:a$+2}+1             !img height in pixels
  smfdb&(4)=WORD((smfdb&(2)+15)\16)    !img width in words
  smfdb&(5)=3                         !standard format flag ??3
  smfdb&(6)=1                         !# of color bitplanes
  '
  '  bp&=WORD{LONG{GB+4}+20} !bit planes via gem
  '  PRINT bp&
  '
  LONG{V:dmfdb&(0)}=XBIOS(2)
  dmfdb&(2)=smfdb&(2)
  dmfdb&(3)=smfdb&(3)
  dmfdb&(4)=smfdb&(4)
  dmfdb&(5)=3
  dmfdb&(6)=1
  '
  ' \\\vs_clip screen area
  '  CLIP 1,1,639,399
  '  vs_clip(handle&,1,1,1,639,399)
  '
  ' \\\use the vro_cpyfm() raster draw opaque screen
  vro_cpy_fm(handle&,3,0,0,40,50,220,230,40,50,V:smfdb&(0),V:dmfdb&(0))
  '
  ' \\\wait
  ~INP(2)
  '
ELSE
  '
  ' \\\if image was <6 bytes
  ~FORM_ALERT(1,"[1][image contains no data][quit]")
  '
ENDIF
'
' \\\end prgm
END
'
'
PROCEDURE vro_cpy_fm(dh&,mode&,xs&,ys&,ws&,hs&,xd&,yd&,wd&,hd&,src%,dst%)
  CONTRL(0)=109
  CONTRL(1)=4
  CONTRL(3)=1
  CONTRL(6)=dh&
  LONG{CONTRL+14}=src%
  LONG{CONTRL+18}=dst%
  '
  INTIN(0)=mode&
  '
  PTSIN(0)=xs&
  PTSIN(1)=ys&
  PTSIN(2)=ws&
  PTSIN(3)=hs&
  '
  PTSIN(4)=xd&
  PTSIN(5)=yd&
  PTSIN(6)=wd&
  PTSIN(7)=hd&
  '
  VDISYS
  '
RETURN
> PROCEDURE vr_trn_fm(dh&,src%,dst%)
  '
  ' \\\in place transformation vr_trn_fm()
  '
  ' CONTRL(0)=110
  ' CONTRL(1)=0
  ' CONTRL(3)=0
  ' CONTRL(6)=dh&
  ' CONTRL(7)=INT(SWAP(src%))
  ' CONTRL(8)=INT(src%)
  ' CONTRL(9)=INT(SWAP(dst%))
  ' CONTRL(10)=INT(dst%)
  ' VDISYS
  '
RETURN
> PROCEDURE vs_clip(dh&,mode&,x&,y&,w&,h&)
  CONTRL(0)=129
  CONTRL(1)=2
  CONTRL(3)=1
  CONTRL(6)=dh&
  INTIN(0)=mode&
  PTSIN(0)=x&
  PTSIN(1)=y&
  PTSIN(2)=w&
  PTSIN(3)=h&
  VDISYS
RETURN
'
' eof
'
'



atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!


Social Media

     

Return to “GFA BASIC”

Who is online

Users browsing this forum: No registered users and 3 guests