home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1991 November & December
/
rerun-1991-11-12b.d64
/
lacegeopic
(
.txt
)
< prev
next >
Wrap
GEOS ConVerT
|
2022-09-20
|
7KB
|
337 lines
lACEgEOpIC
prg FORMATTED geos FILE v1.0
pAINT pages
'lACEgEOpIC.REL
blaster's converter v2.1
wRITE iMAGE v2.1
GEOwRITE v2.1
.NOEQIN
.NOGLBL
.IFpASS1;oNLY NEED TO INCLUDE THESE FILES
.INCLUDElACEsYM;GET geos DEFINITIONS
.INCLUDElACEmAC;GET geos MACRO DEFINITIONS
.ENDIF
.GLBL
.EQIN
.RAMSECT
iNPUT:.BLOCK640*2+8+80*2;INPUT BUFFER FOR 1 COMPACTED RECORD
oUTpUT1:.BLOCK640*2+8+80*2;OUTPUT BUFFER FOR 2 CARD ROWS WITH COLOR
.PSECT
;ON ENTRY gEOpIANT PIC FILE NAME IS IN "nAME"
;AND DISK IS OPENED AND READY TO USE
gETpIC:lOADwR0,nAME
JSRoPENrECORDfILE
BNE999$;oN eRROR ABORT
lOADwA5,0+80;vdc ADDRESS FOR FOREGROUND SCREEN
lOADwA4,$5000-3*80;vdc ADDRESS FOR BACKGROUND SCREEN
lOADwA6,$C4A0;vdc ADDRESS FOR FORECOLOR MEMORY
lOADwA7,$D800+80;vdc ADDRESS FOR BACKCOLOR MEMORY
lOADbA9l,25;NUMBER OF RECORDS TO DISPLAY (50 CARD ROWS)
LDAsTARTrEC
JSRpOINTrECORD
BNE99$
10$lOADwR2,640*2+8+80*2;mAXIMUM NUMBER OF BYTES THAT CAN BE READ
lOADwR7,iNPUT
JSRrEADrECORD
TAY;SAVE REC STATUS FLAG
TXA;cHECK FOR DISK ERROR
BNE99$;IF X<>0 THEN DISK ERROR, ABORT
TYA;cHECK REC STATUS FLAG
BEQ20$;IF STATUS=0 THEN RECORD IS EMPTY, dO EMPTY REC
;uNPACK RECORD AND DISPLAY
JSRuNpACK
JSRpUTvDC
BRA30$
;FILL OUTPUT BUFFER WITH eMPTY DATA, (bLANK SCREEN, WITH DEFAULT GEOS COLORS)
20$SEI
JSReMPTYrEC
JSRpUTvDC
30$DECA9l;eXIT IF NO MORE
BEQ99$; RECORDS TO DISPLAY
JSRnEXTrECORD
BEQ10$;IF NO ERROR DO AGAIN
99$RTS;EXIT dISPLAY
999$PLA;iF THERE IS AN ERROR WHILE TRYING TO
PLA;OPEN A FILE THEN ABORT BACK TO
JMPcLICK;THE FILE BOX
pROCtABLE:.WORDkEYpROC
.WORD1
kEYpROC:JSRtEMPhIDEmOUSE
LDAKEYdATA
LDX#0
STXKEYdATA
CMP#key_f1
BEQ10$
CMP#key_f3
BEQ20$
CMP#key_f5
BEQ30$
00$RTS
10$LDA#0
pROCtABLE:.WORDkEYpROC
.WORD1
kEYpROC:JSRtEMPhIDEmOUSE
LDAKEYdATA
LDX#0
STXKEYdATA
CMP#key_f1
BEQ10$
CMP#key_f3
BEQ20$
CMP#key_f5
BEQ30$
00$RTS
10$LDA#0
CMPsTARTrEC
BEQ00$
STAsTARTrEC;f1=tOP OF PAGE
JSRcLEARvdc
JMPgETpIC
20$LDA#10
CMPsTARTrEC
BEQ00$
STAsTARTrEC;f3=mIDDLE OF PAGE
JSRcLEARvdc
JMPgETpIC
30$LDA#20
CMPsTARTrEC
BEQ00$
STAsTARTrEC;f4=bOTTOM OF PAGE
JSRcLEARvdc
JMPgETpIC
uNpACK:lOADwA0,iNPUT
lOADwA1,oUTpUT1
uNl:LDY#0
LDA(A0),Y
BEQueXIT;zERO = END OF RECORD
CMP#$40
BCS10$
JSRup1;cOMPACTION COMMAND 1
BRAuNl
10$BEQueXIT;INVALID COMMAND, ABORT RECORD
CMP#$80
BCS20$
JSRup2;cOMPACTION COMMAND 2
BRAuNl
20$BEQueXIT;INVALID COMMAND, ABORT RECORD
JSRup3;cOMPACTION COMMAND 3
BRAuNl
ueXIT:RTS
eMPTYrEC:;FILL OUTPUT BUFFER
JSRI_fILLrAM
.WORD640*2
.WORDoUTpUT1
.BYTE0
JSRI_fILLrAM
.WORD80*2
.WORDoUTpUT1+640*2+8
.BYTE$0F
up1:PHA
aDDvw1,A0
10$LDA(A0),Y
STA(A1),Y
BPL10$
ADCA0l
STAA0l
LDA#0
ADCA0h
STAA0h
ADCA1l
STAA1l
LDA#0
ADCA1h
STAA1h
up1:PHA
aDDvw1,A0
10$LDA(A0),Y
STA(A1),Y
BPL10$
ADCA0l
STAA0l
LDA#0
ADCA0h
STAA0h
ADCA1l
STAA1l
LDA#0
ADCA1h
STAA1h
up2:SEC
SBC#$40
aDDvw1,A0
5$LDY#7
10$LDA(A0),Y
STA(A1),Y
BPL10$
LDA#8
ADCA1l
STAA1l
LDA#0
ADCA1h
STAA1h
BNE5$
30$aDDvw8,A0
99$RTS
up3:S
up3:SEC
SBC#$80
STAA3l
LDY#1
LDA(A0),Y
LDYA3l
10$STA(A1),Y
BPL10$
LDAA3l
ADCA1l
STAA1l
LDA#0
ADCA1h
STAA1h
aDDvw2,A0
pUTvDC:JSRcONVcOL;
pUTvDC:JSRcONVcOL;40 COL COLORS MUST BE CONVERTED TO vdc COLORS
JSRpUTeVcO;pUT EVEN SCAN LINES TO FORESCREEN
JSRpUToDcO;PUT ODD SCAN LINES TO BACKSCREEN
JSRpUTeVsC;PUT COLORS TO FRONT COLOR RAM
JSRpUToDsC;PUT COLORS TO BACK COLOR RAM
cONVcOL:lOADwA0,oUTpUT1+640*2+8
LDY#0
10$LDA(A0),Y
JSRcVT
STA(A0),Y
CPY#160
BNE10$
cVT:PHA
AND#%00001111
LDAcOLtABLE,X
ROLA
ROLA
ROLA
ROLA
STAtEMP
AND#%11110000
LSRA
LSRA
LSRA
LSRA
LDAcOLtABLE,X
ORAtEMP
cOLtABLE:.BYTE0,15,8,6,11,4,2,13,12,10,9,0,1,5,3,14
tEMP:.BYTE0
;40 COL COLOR80COL CONVERSION
;0=bLACK0=BLACK
;1=wHITE15=WHITE
;2=rED8=DARK RED
;3=cYAN6=DARK CYAN
;4=pURPLE11=LIGHT PURPLE
;5=gREEN4=DARK GREEN
;6=BLUE2=DARK BLUE
;7=YELLOW13=LIGHT YELLOW
;8=ORANGE12=DARK YELLOW
;9=BROWN10=dARK PURPLE
;10=LIGHT RED9=LIGHT RED
;11=DARK GREY0=BLACK
;12=MEDIUM GREY1=DARK GREY
;13=LIGHT GREEN5=LIGHT GREEN
;14=LIGHT BLUE3=LIGHT BLUE
;15=LIGHT GREY14=LIGHT GREY
pUTeVsC:lOADwA0,oUTpUT1
lOADwA1,oUTpUT1
LDX#18
LDAA4h
JSRwRvdc
LDAA4l
JSRwRvdc
LDX#31
LDY#0
3$lOADbA3l,2;2 CARD ROWS
4$lOAD
pUTeVsC:lOADwA0,oUTpUT1
lOADwA1,oUTpUT1
LDX#18
LDAA4h
JSRwRvdc
LDAA4l
JSRwRvdc
LDX#31
LDY#0
3$lOADbA3l,2;2 CARD ROWS
4$lOADbA2h,4;4 TIMES PER CARD ROW (eVERY OTHER ROW)
5$lOADbA2l,80;dO 80 BYTES ACCROSS
10$LDA(A1),Y
JSRwRvdc
aDDvw8,A1
aDDvw1,A4
DECA2l
BNE10$
DECA2h
BEQ20$
aDDvw2,A0
mOVEwA0,A1
BRA5$
20$DECA3l
BEQ30$
lOADwA0,oUTpUT1
aDDvw640,A0
mOVEwA0,A1
BRA4$
30$RTS
pUToD
pUToDsC:lOADwA0,oUTpUT1+1
lOADwA1,oUTpUT1+1
LDX#18
LDAA5h
JSRwRvdc
LDAA5l
JSRwRvdc
LDX#31
LDY#0
3$lOADbA3l,2;2 CARD ROWS
4$lOADbA2h,4;4 TIMES PER CARD ROW (eVERY OTHER ROW)
5$lOADbA2l,80;dO 80 BYTES ACCROSS
10$LDA(A1),Y
JSRwRvdc
aDDvw8,A1
aDDvw1,A5
DECA2l
BNE10$
DECA2h
BEQ20$
aDDvw2,A0
mOVEwA0,A1
BRA5$
20$DECA3l
BEQ30$
lOADwA0,oUTpUT1+1
aDDvw640,A0
mOVEwA0,A1
BRA4$
30$RTS
pUTeVcO:lOADwA0,oUTpUT1+640*2+8
LDX#18
LDAA6h
JSRwRvdc
LDAA6l
JSRwRvdc
LDY#0
LDX#31
10$LDA(A0),Y
JSRwRvdc
aDDvw1,A6
CPY#160
BNE10$
pUToDcO:lOADw
pUToDcO:lOADwA0,oUTpUT1+640*2+8
LDX#18
LDAA7h
JSRwRvdc
LDAA7l
JSRwRvdc
LDY#0
LDX#31
10$LDA(A0),Y
JSRwRvdc
aDDvw1,A7
CPY#160
BNE10$