home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er
/
64ER_CD.iso
/
89xx
/
8907a.d64
/
line.src
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
3KB
|
67 lines
80 OPEN1,8,2,"LINE.OBJ,P,W"
85 SYS9*4096:.OPT O1:*=$C000
86 .ASC "USING PLOT,3:PROGRAM:"
90 CKCOM = $AEFD:FRMNUM = $AD8A
100 JSR FRMNUM:JSR $BC9B:LDA $65:STA XL0:LDA $64:STA XH0:JSR $E200:STX Y0
110 JSR CKCOM:JSR FRMNUM:JSR $BC9B:LDA $65:STA XL1:LDA $64:STA XH1
114 JSR $E200:STX Y1:JSR $E200:STX MODUS
140 LDA XL1:CMP XL0:BNE L200
142 LDA XH1:CMP XH0:BNE L200
144 LDA Y1:CMP Y0:BNE L200
150 ; X1/Y1 = X0/Y0
160 LDA MODUS:PHA:LDA XL0:LDX XH0:LDY Y0:JMP PLOT2
190 ; *** LINIE ***
200 L200 LDA #0:STA DYH:LDA Y1:SEC:SBC Y0:STA DYL:STA ABSDY:BCS L210
204 EOR #255:STA ABSDY:INC ABSDY:LDA #255:STA DYH; ZWEIERKOMPLEMENT
210 L210 LDA XL1:SEC:SBC XL0:STA DXL:STA ABSDXL
211 LDA XH1:SBC XH0:STA DXH:STA ABSDXH:BCS L220
212 LDA DXL:EOR #255:CLC:ADC #1:STA ABSDXL
214 LDA DXH:EOR #255:ADC #0:STA ABSDXH
218 ; *** MAX (ABSDX,ABSDY) ***
220 L220 LDA #$80:STA MID:LDA #0:STA LOW
222 LDA ABSDXH:BNE XGROESSER:LDA ABSDXL:CMP ABSDY:BCS XGROESSER
224 JMP YGROESSER
230 ; *** DX > DY ***
232 XGROESSER LDA DYH:LDY DYL:JSR $B395:LDX ABL+1:LDY ABL+2:JSR $BBD4
234 LDA DXH:LDY DXL:JSR $B395
235 LDA ABL+1:LDY ABL+2:JSR $BB0F
236 LDA $61:CLC:ADC #16:STA $61:JSR $BC9B
240 LDA DXH:BPL LINX:JSR TAUSCHEN
250 ; *** LINIE ZIEHEN ***
252 LINX LDA XL0:STA XL:LDA XH0:STA XH:LDA Y0:STA YB
254 L254 JSR PLOT:INC XL:BNE L256:INC XH
256 L256 LDA LOW:CLC:ADC $65:STA LOW:LDA MID:ADC $64:STA MID
257 LDA YB:ADC $63:STA YB
258 SEC:LDA XL1:SBC XL:LDA XH1:SBC XH:BCS L254:RTS
270 ; *** DY > DX ***
272 YGROESSER LDA DXH:LDY DXL:JSR $B395:LDX ABL+1:LDY ABL+2:JSR $BBD4
274 LDA DYH:LDY DYL:JSR $B395
275 LDA ABL+1:LDY ABL+2:JSR $BB0F
276 LDA $61:CLC:ADC #16:STA $61:JSR $BC9B
280 LDA DYH:BPL LINY:JSR TAUSCHEN
290 ; *** LINIE ZIEHEN ***
292 LINY LDA XL0:STA XL:LDA XH0:STA XH:LDA Y0:STA YB
294 L294 JSR PLOT
296 LDA LOW:CLC:ADC $65:STA LOW:LDA MID:ADC $64:STA MID
297 LDA XL:ADC $63:STA XL:LDA XH:ADC $62:STA XH
298 L298 INC YB:LDA YB:CMP Y1:BCC L294:RTS
320 ; *** X0/Y0 UND X1/Y1 TAUSCHEN ***
322 TAUSCHEN LDA XL1:PHA:LDA XL0:STA XL1:PLA:STA XL0
323 LDA XH1:PHA:LDA XH0:STA XH1:PLA:STA XH0
324 LDA Y0:PHA:LDA Y1:STA Y0:PLA:STA Y1::RTS
350 ; PLOTROUTINE ANSPRINGEN
352 PLOT LDA MODUS:PHA:LDA XL:LDX XH:LDY YB:PLOT2 JMP $FFFF
480 ABL LDA ABL2
500 ; *** LOCAL VARIABLE ***
502 ABL2 .BYTE $FF,0,0,0,0
504 LOW .BYTE 00:MID .BYTE 00
506 XL .BYTE 00:XH .BYTE 00
508 XL0 .BYTE 00:XL1 .BYTE 00
510 XH0 .BYTE 00:XH1 .BYTE 00
512 Y0 .BYTE 00:Y1 .BYTE 00:YB .BYTE 00
514 DYL .BYTE 00:DYH .BYTE 00
516 DXL .BYTE 00:DXH .BYTE 00
518 ABSDXL .BYTE 00:ABSDXH .BYTE 00:ABSDY .BYTE 00
520 MODUS .BYTE 00
610 .END:CLOSE1