over the past years ive made many .rsc files.
when going back to projects its difficult to remember the
flags state spec
of these object ,
so I wrote this small listing to decipher the data for myself ....
plan is eventually further develop this listing to save the data as a .ascii /.lst file
therefore I can embed rsc data into gfa programs ...
Code: Select all
' sof
'
SAVE "a:\rscsift.gfa"
LIST "d:\rscsift.lst"
KILL "A:\*.BAK"
' DUMP "" TO "d:\vars.lst"
'
RESERVE ((FRE(0) DIV 2) DIV 256)*256
'
DEFFILL 1,2,4
PBOX 0,0,WORK_OUT(0),WORK_OUT(1)
'
' ==variables
'
path$=""
item$=""
file$=""
exten$=""
title$=""
default$=""
'
a%=0
o.next%=0
o.head%=0
o.tail%=0
o.type%=0
o.flags%=0
o.state%=0
o.x%=0
o.y%=0
o.w%=0
o.h%=0
o.spec%=0
b%=0
flen%=0
'
x&=0
type&=0
spec&=0
a&=0
x.&=0
fram_spec&=0
xx&=0
pos&=0
'
drive|=0
'
' ==allocation
default$=STRING$(&H20,0)
path$=STRING$(&H40,0)
file$=STRING$(&H80,0)
'
DIM ted&(13)
DIM bit&(6)
DIM user%(1)
DIM icon&(17)
'
' ===================================================
make_path
main
' ===================================================
'
~RSRC_FREE()
'
ERASE ted&(),bit&(),user%(),icon&()
'
CLEAR
'
RESERVE
'
END
'
' ====PROCEDURES====
'
> PROCEDURE main
'
MID$(path$,1)=LEFT$(path$,RINSTR(path$,"\"))+"*.RSC"
'
FILESELECT path$,default$,file$
'
IF file$<>"" AND MID$(file$,RINSTR(file$,"."))=".RSC"
'
MID$(path$,1)=LEFT$(file$,RINSTR(file$,"\"))+"*.RSC"
'
~RSRC_LOAD(file$)
~RSRC_GADDR(0,0,a%)
'
treehop
'
ENDIF !{rsc disk load}
'
RETURN
'
> PROCEDURE treehop
'
xx&=0
WHILE a%>0
'
~OBJC_DRAW(a%,0,99,0,0,0,0)
~INP(2)
'
objecthop
'
INC xx&
~RSRC_GADDR(0,xx&,a%)
'
WEND
'
RETURN
'
> PROCEDURE objecthop
'
x&=0
'
REPEAT
'
CLS
' ========
o.next%=OB_NEXT(a%,x&)
next
o.head%=OB_HEAD(a%,x&)
head
o.tail%=OB_TAIL(a%,x&)
tail
'
' =========
o.type%=OB_TYPE(a%,x&)
type
o.spec%=OB_SPEC(a%,x&)
spec
o.flags%=OB_FLAGS(a%,x&)
flags
o.state%=OB_STATE(a%,x&)
state
'
ON spec& GOSUB boxinfo,tedinfo,address,bitblk,userblk,iconblk
'
' =========
o.x%=OB_X(a%,x&)
x_axis
o.y%=OB_Y(a%,x&)
y_axis
o.w%=OB_W(a%,x&)
width
o.h%=OB_H(a%,x&)
height
'
~INP(2)
'
ADD x&,1
'
UNTIL o.next%=0
'
RETURN
'
> PROCEDURE make_path
drive|=GEMDOS(&H19)
MID$(path$,1)=CHR$((ASC("A")+drive|))+":"+DIR$(drive|+1)+"\"
RETURN
'
'
> PROCEDURE next
PRINT o.next%;" ";
RETURN
'
> PROCEDURE head
PRINT o.head%;" ";
RETURN
'
> PROCEDURE tail
PRINT o.tail%;" "
RETURN
'
> PROCEDURE type
'
' PRINT o.type%;" ";
'
SELECT o.type%
'
CASE 20 !g_box boxinfo
spec&=1
PRINT "g_box> ";
CASE 25 !g_ibox boxinfo
spec&=1
PRINT "g_ibox> ";
CASE 27 !g_boxchar boxinfo
spec&=1
PRINT "g_boxchar> ";
'
CASE 21 !g_text tedinfo
spec&=2
PRINT "g_text> ";
CASE 22 !g_boxtext tedinfo
spec&=2
PRINT "g_boxtext> ";
CASE 29 !g_ftext tedinfo
spec&=2
PRINT "g_ftext> ";
CASE 30 !g_fboxtext tedinfo
spec&=2
PRINT "g_fboxtext> ";
'
CASE 26 !g_button address of the string
spec&=3
PRINT "g_button> ";
CASE 28 !g_string address of the string
spec&=3
PRINT "g_string> ";
CASE 32 !g_title address of the string
spec&=3
PRINT "g_title> ";
'
CASE 23 !g_image bitblk
spec&=4
PRINT "g_image> ";
'
CASE 24 !g_userdef userblk
spec&=5
PRINT "g_userdef> ";
'
CASE 31 !g_icon iconblk
spec&=6
PRINT "g_icon> ";
'
ENDSELECT
'
RETURN
'
> PROCEDURE spec
'
SELECT spec&
'
CASE 1 !g_box g_ibox g_boxchar boxinfo
PRINT "boxinfo ";
'
CASE 2 !g_text g_boxtext g_ftext g_fboxtext tedinfo
PRINT "tedinfo ";
'
CASE 3 !g_button g_string g_title address of the string
PRINT "address ";
'
CASE 4 !g_image bitblk
PRINT "bitblk ";
'
CASE 5 !g_userdef userblk
PRINT "userblk ";
'
CASE 6 !g_icon iconblk
PRINT "iconblk ";
'
ENDSELECT
'
PRINT
'
RETURN
'
> PROCEDURE flags
'
' PRINT o.flags%;" ";
'
IF BTST(o.flags%,0)
PRINT "selectable ";
ENDIF
IF BTST(o.flags%,1)
PRINT "default ";
ENDIF
IF BTST(o.flags%,2)
PRINT "exit ";
ENDIF
IF BTST(o.flags%,3)
PRINT "editable ";
ENDIF
IF BTST(o.flags%,4)
PRINT "radiobutton ";
ENDIF
IF BTST(o.flags%,5)
PRINT "lastobj ";
ENDIF
IF BTST(o.flags%,6)
PRINT "touchexit ";
ENDIF
IF BTST(o.flags%,7)
PRINT "hidetree ";
ENDIF
IF BTST(o.flags%,8)
PRINT "indirect ";
ENDIF
IF o.flags%=0
PRINT "!!no FLAGS!! ";
ENDIF
'
PRINT
'
RETURN
'
> PROCEDURE state
'
' PRINT o.state%;" "
'
IF BTST(o.state%,0)
PRINT "selected ";
ENDIF
IF BTST(o.state%,1)
PRINT "crossed ";
ENDIF
IF BTST(o.state%,2)
PRINT "checked ";
ENDIF
IF BTST(o.state%,3)
PRINT "disabled ";
ENDIF
IF BTST(o.state%,4)
PRINT "outlined ";
ENDIF
IF BTST(o.state%,5)
PRINT "shadowed ";
ENDIF
IF o.state%=0
PRINT "!!no STATE!! ";
ENDIF
'
PRINT
'
RETURN
'
> PROCEDURE x_axis
PRINT "X= ";o.x%;" ";
RETURN
'
> PROCEDURE y_axis
PRINT "Y= ";o.y%;" ";
RETURN
'
> PROCEDURE width
PRINT "W= ";o.w%;" ";
RETURN
'
> PROCEDURE height
PRINT "H= ";o.h%;" "
RETURN
'
'
> PROCEDURE boxinfo
'
PRINT "B O X I N F O ";BIN$(o.spec%)
'
' frame spec:
' 1-128 inside obj 1=1 in 2=2 in etc
' 129-255 outside 255=1 out 254=2 etc
' 0 no frame
PRINT "fram_spec ";SHR(o.spec%,16) AND &X11111111
'
' frame:0-15
PRINT "frame colour ";SHR(o.spec%,12) AND &X1111
'
' text colour:0-15
PRINT "text ";SHR(o.spec%,8) AND &X1111
'
' text mode:0-1
PRINT "textmode ";SHR(o.spec%,7) AND &X1
'
' fill pat:0-7
PRINT "fill pat ";SHR(o.spec%,4) AND &X111
'
' colour of insides of box:0-15
PRINT "color inside box ";o.spec% AND &X1111
'
PRINT "B O X I N F O E N D "
'
RETURN
'
> PROCEDURE tedinfo
'
BMOVE o.spec%,V:ted&(0),30
'
PRINT "text ";CHAR{{V:ted&(0)}}
PRINT "mask ";CHAR{{V:ted&(2)}}
PRINT "vald ";CHAR{{V:ted&(4)}}
PRINT "char set ";ted&(6)
PRINT "reserve1 ";ted&(7)
PRINT "text align ";ted&(8)
'
PRINT " ted box info"
o.spec%=ted&(9)
boxinfo
'
PRINT "reserve2 ";ted&(10)
PRINT "frame thick ";ted&(11)
PRINT "text length ";ted&(12)
PRINT "mask length ";ted&(13)
'
RETURN
'
> PROCEDURE address
PRINT "add:";o.spec%
RETURN
'
> PROCEDURE bitblk
PRINT "bit: ";o.spec%
RETURN
'
> PROCEDURE userblk
PRINT "user: ";o.spec%
RETURN
'
> PROCEDURE iconblk
PRINT "icon: ";o.spec%
RETURN
'
' eof