[Coco] VEF specification
Roger Taylor
rtaylor at bayou.com
Wed Aug 11 13:44:14 EDT 2004
At 08:22 PM 8/10/2004, you wrote:
>I'm looking for the specification on VEF, the CoCo 3 VDG Extended File
>format. Instead of trying to construct it from looking at source, and
>possibly missing a detail, does there exist a document which explicitly
>defines the format of a VEF file?
Boisy, here's my source code to the VEF "driver/codec" for Projector-3.
* 320-16 AND 640-4 VALID ONLY (0 AND 1)
fcn "PF:VEF0***0***0***0:OS9 VDG Extended Format"
include global
ORG 241
IMGTOP RMB 2
BLOCK RMB 1
VIDRES RMB 1
COMPR RMB 1
PAKLEN RMB 1
ASPEED RMB 1
DATUM RMB 1
BYTES RMB 2
ORG codect
FDB DECODE
FDB ENCODE
FDB -1 INFO
BIN EQU 540 read byte from file
PUT EQU 534 put byte to file
SLDBLK EQU 554
CODERR LDX #CODER9
JMP [gerror]
CODER9 fcn "Bad Picture Code"
NOTSUP LDX #NOTSU9
JMP [gerror]
NOTSU9 fcn "Type Not Supported"
DECODE JSR [BIN]
ANDA #128
STA <COMPR
JSR [BIN]
CMPA #4
BHI CODERR
STA <VIDRES
ADDA #'0
LDX #TYPSTR
STA ,X
JSR [542] SET PIC TYPE STRING IN SHELL
LDB #4
STB <ASPEED
LDX 602 CC3RGBPAL16
LDB #16
LOAD10 JSR [BIN]
STA ,X+
DECB
BNE LOAD10
LDX #RESTAB
LDB <VIDRES
LDA #10
MUL
LEAX D,X
LDD ,X++
STD <WIDTH
LDD ,X++
STD <HEIGHT
LDD ,X++
STD <COLORS
LDD ,X++
STD <BYTES
LDD ,X++
STD DMPSUB+1
LDX 602
LDA ,X
STA <BCOLOR
JSR [704] COCO16 TO R,G,B GLOMAP
JSR [setarr] SETARR request graphics mode to be
used
CLR <COLOR
JSR [pcls] PCLS
JSR [grinit] GRINIT invoke graphics mode
LDD plot
STD DMPJSR+1
LDX <BYTES
TST <COMPR
BMI LOD090
LOAD20 JSR [BIN] NONCOMPRESSED IMAGE
JSR DMPSUB
LEAX -1,X
BNE LOAD20
BRA EXIT
LOD090 LDY #400 packets (rowsx2)
LOD100 JSR [BIN]
STA <PAKLEN half-line packet length
LDU #BUFF
LOD110 JSR [BIN] LOOP 2
DEC <PAKLEN
TFR A,B
TSTB
BMI LOD150
LOD120 JSR [BIN]
DEC <PAKLEN
STA ,U+
DECB
BNE LOD120
BRA LOD200
LOD150 ANDB #127
JSR [BIN]
DEC <PAKLEN
LOD160 STA ,U+
DECB
BNE LOD160
LOD200 TST <PAKLEN
BNE LOD110
LDU #BUFF
LDB #80
LOD210 LDA ,U+
JSR DMPSUB
DECB
BNE LOD210
LEAX -80,X
BNE LOD100
EXIT CLRB
RTS
DMPSUB JMP $FFFF DUMMY ADDRESS
DUMPA PSHS B,X,Y
STA <DATUM
TFR A,B
LSRB
LSRB
LSRB
LSRB
BSR DMP500
LDB <DATUM
ANDB #15
BSR DMP500
PULS B,X,Y,PC
DUMPB PSHS B,X,Y
STA <DATUM
TFR A,B
LSRB
LSRB
LSRB
LSRB
LSRB
LSRB
BSR DMP500
LDB <DATUM
ANDB #%00110000
LSRB
LSRB
LSRB
LSRB
BSR DMP500
LDB <DATUM
ANDB #%00001100
LSRB
LSRB
BSR DMP500
LDB <DATUM
ANDB #%00000011
BSR DMP500
PULS B,X,Y,PC
DMP500 LDX 600
STB <COLOR
ABX
ABX
ABX
LDD ,X
STD <RED
LDB 2,X
STB <BLUE
DMPJSR JSR $FFFF SAME AS JSR [plot]
LDD <PX
INCD
STD <PX
CMPD <WIDTH
BLO DMP999
CLRD
STD <PX
LDD <PY
INCD
STD <PY
DMP999 RTS
* CREATES 320-16 AND 640-4 TYPES ONLY
ENCODE LDD <WINDOW
MULD #8
STW <IMGTOP
JSR [SLDBLK]
STB <BLOCK
CLRA
JSR [PUT]
LDA <SCRRES 0=320-16 1=640-4
ANDA #1
JSR [PUT] PICTURE TYPE 0 OR 1
LDX 602 CC3RGB PALETTE
LDB #16
ENC010 LDA ,X+
JSR [PUT]
DECB
BNE ENC010
LDX #0
ENC020 TFR X,D
ADDD <IMGTOP
LSRA
LSRA
LSRA
LSRA
LSRA
ADDA <BLOCK
STA 65446
TFR X,D
ADDD <IMGTOP
ANDA #31
ADDA #192
TFR D,U
LDA ,U
JSR [PUT]
LEAX 1,X
CMPX #32000
BLO ENC020
RTS
RESTAB FDB 320 320 X 200 X16
FDB 200
FDB 16
FDB 32000
FDB DUMPA
FDB 640 640 X 200 X4
FDB 200
FDB 4
FDB 32000
FDB DUMPB
FDB 160 160 X 200 X16
FDB 200
FDB 16
FDB 16000
FDB DUMPA
FDB 320 320 X 200 X4
FDB 200
FDB 4
FDB 16000
FDB DUMPB
FDB 640 640 X 200 X2
FDB 200
FDB 2
FDB 16000
FDB DUMPB
TYPSTR FCC "0"
FCB 0
BUFF RMB 160
END
----------
Roger Taylor
More information about the Coco
mailing list