home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 4: The Falcon Archive
/
nf_archive_four_v1.0.iso
/
ARCHIVE
/
WORK
/
UTILITY
/
XGRAB024.ZIP
/
GFX-_###.GFA
(
.txt
)
< prev
next >
Wrap
GFA-BASIC Atari
|
1994-05-08
|
2KB
|
66 lines
DIM regs%(15)
' ## INLINE:
' $0000: 53 80 72 0f 47 e8 00 10 76 00 e3 e3 d7 43 e3 e3
' $0010: d7 43 e3 e3 d7 43 e3 e3 d7 43 e3 e3 d7 43 e3 e3
' $0020: d7 43 e3 e3 d7 43 e3 e3 d7 43 34 f1 34 00 14 f1
' $0030: 34 03 51 c9 ff d0 41 e8 00 10 53 80 6a c4 4e 75
' 64 Bytes.
INLINE asm_rout%,64
DO
FILESELECT DIR$(0)+"\*.GFX","",fname$
EXIT IF fname$=""
RESERVE 50000
OPEN "i",#1,fname$
res$=INPUT$(38,#1)
pal256$=INPUT$(1024,#1)
pal16$=INPUT$(32,#1)
w#=(CVI(MID$(res$,39-6,2))+CVI(MID$(res$,39-4,2)))
h#=(CVI(MID$(res$,25,2))-CVI(MID$(res$,23,2)))/2
IF BTST(CVI(MID$(res$,31,2)),0)
h#=h#/2
ENDIF
IF BTST(CVI(MID$(res$,31,2)),1)
h#=h#*2
ENDIF
picsize%=LOF(#1)-38-1024-32
BGET #1,HIMEM,picsize%
IF BTST(CVI(MID$(res$,3,2)),4)
w#=w#*2
ziel%=HIMEM+picsize%
regs%(0)=w#*h#/16
regs%(8)=HIMEM
regs%(9)=V:pal256$
regs%(10)=ziel%
RCALL asm_rout%,regs%()
OPEN "o",#2,LEFT$(fname$,RINSTR(fname$,"."))+"RAW"
PRINT #2,w#;" ";h#;CHR$(10);
BPUT #2,ziel%,w#*h#*3
CLOSE #2
PRINT fname$," converted into RAW"
del
ELSE
IF BTST(CVI(MID$(res$,3,2)),8)
OPEN "o",#2,LEFT$(fname$,RINSTR(fname$,"."))+"TPI"
PRINT #2,"PNT"+CHR$(0)+MKI$(&H1000)+MKI$(0)+MKI$(w#)+MKI$(h#)+MKI$(&H10)+MKL$(&HE)+CHR$(&HA6);STRING$(109,CHR$(0));
BPUT #2,HIMEM,picsize%
CLOSE #2
PRINT fname$," converted into TPI"
del
ELSE
CLS
PRINT "Sorry!"
PRINT "I do only convert 256-color-pictures and"
PRINT "truecolor-pictures into RAW and TPI!"
~INP(2)
ENDIF
ENDIF
CLOSE #1
LOOP
PROCEDURE del
ALERT 2,"Delete GFX-File?",1,"No|Yes",a#
IF a#=2
KILL fname$
ENDIF
CLS
RETURN