home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er
/
64ER_CD.iso
/
sh3x
/
sh34b.d64
/
spg.txt
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
20KB
|
481 lines
1000 SYS9*4096:.OPT OO
1010 *= $C000
1020 SCRBASE = $CC00
1989 ; ================================
1990 ; INITIALISIERUNGSROUTINE
1992 ; SETZT - INTERPRETERVEKTOR
1994 ; - SYSTEMVEKTOREN
1996 ; - VIDEOCONTROLLER
1997 ; & GIBT EINSCHALTMELDUNG AUS,
1998 ; FALLS AUFRUF IM DIREKTMODUS
1999 ; ================================
2000 LDA #<DECODE:LDY #>DECODE
2010 STA $308:STY $309:JSR MOVESCR
2020 JSR SYSVEC:LDA $9D:BPL NOMESS
2030 LDA #<MESSAGE:LDY #>MESSAGE:JSR $AB1E
2040 NOMESS LDX #5:SVEC LDA IRNTAB,X:STA $FFFA,X:DEX:BPL SVEC:RTS
2045 IRNTAB .WOR NEWNMI1,0,RAMIRQ
2050 ;
2060 MESSAGE .BYT 13
2061 .ASC "[154][142][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162]":.BYT 13
2065 .ASC " *** SPRITE-GRAPHICS *** ":.BYT 13
2070 .ASC " (C) 1988 V. SIEBERT ":.BYT 13
2075 .ASC "[162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162]":.BYT 13,0
2989 ; ================================
2990 ; TABELLE DER NEUEN BEFEHLE
2992 ; IN ALPHABETISCHER REIHENFOLGE
2999 ; ================================
3000 COMS .ASC "BBBBBDDDDDDEFFFFFGGGGGGGGGGGG"
3001 .ASC "JMMMMMMMMMMPPRRTTTTTTT":.BYT 0
3005 COM2 .ASC "BCMPVBDLMRSXBDLOSCEIKLNPRSWXY"
3006 .ASC "SBCDGLMOPXYGTGTCFNPRTX"
3010 COMTAB .WOR DSPBYTE,DSPCHARS,DSPMVBAR
3012 .WOR DSPMBYTE,DSPVBAR,BLOCK,DOT
3015 .WOR LINE,MODE,RECT,SETMUST,QUIT,FOBYTE
3020 .WOR FONT,FOLOAD,NORMAL,FOSAVE
3025 .WOR COLOR,ERASE,INVERT
3030 .WOR KOMBINE,LOAD,SCREEN,PRIORITY
3035 .WOR GRAPH,SAVE,WIDTH,XTOP
3040 .WOR YTOP,JOYREQ,MOBYTE,MOCOL
3045 .WOR MODSGN,MOGRAB,MOLOOK,MOMCOL
3050 .WOR MOBON,MOPAR,MOBX,MOBY
3055 .WOR PUTSCREEN,PUTTEXT,RCLSCREEN
3057 .WOR RCLTEXT
3060 .WOR TCOLOR,TFILL,TNORM
3065 .WOR PRTAT,TREV,TTURN,TXCHG
3089 ; ================================
3090 ; NEUE INTERPRETER-ROUTINE
3099 ; ================================
3100 DECODE JSR $0073:CMP #"!":BEQ FOUND:JSR $0079:JMP $A7E7
3110 FOUND JSR $73:PHA:JSR $73:STA $FB:PLA:LDX #0
3120 DLOOP CMP COMS,X:BEQ MAYBE:BCC NOTFOUND:NOTJUST INX:BNE DLOOP
3130 NOTFOUND JMP $AF08
3135 MAYBE TAY:LDA $FB:CMP COM2,X:BEQ DOK:BCC NOTFOUND:TYA:BNE NOTJUST
3140 DOK TXA:ASL A:TAX:LDA COMTAB,X:STA $334:LDA COMTAB+1,X:STA $335
3150 JSR EXEC:JSR CHKSEMI:BEQ FOUND:JMP $A7AE:EXEC JMP ($334)
3160 ; ================================
3162 ; NEUE INTERRUPTROUTINEN
3163 ; RAMCASE - BEI AUSGESCHALTETEM
3164 ; ROM, AKTIVER GRAFIK
3165 ; RAMIRQ - BEI AUSGESCH. ROM
3166 ; SPRIRQ - BEI EINGESCHALTETEM
3167 ; ROM, AKTIVER GRAFIK
3169 ; ================================
3170 RAMCASE PHA:TXA:PHA:TYA:PHA:TSX:LDA $0104,X:AND #16:BEQ SPRIRQ
3180 LDA #$37:STA 1:JMP ($0316)
3190 ;
3200 RAMIRQ PHA:LDA 1:PHA:LDA #$37:STA 1:LDA $DC0D:PLA:STA 1:PLA:RTI
3210 IRQBACK PLA:TAY:PLA:TAX:PLA:RTI
3220 SPRIRQ LDA 1:PHA:ORA #7:STA 1:LDX NDELAY:BEQ NOD:WAIT DEX:BNE WAIT
3230 NOD LDY NBASE:LDA NLINE:STY $CFF8:STA $D001:DEY:STY $CFF9
3240 STA $D003:STA $D005:DEY:STY $CFFA:STA $D007
3250 DEY:STY $CFFB:LDX COUNTER:DEX:BPL SPIM2:LDX #7:SPIM2 STX COUNTER
3255 LDA LINES,X:STA NLINE:SEC:SBC #3:STA $D012
3257 LDA SPBASE,X:STA NBASE:LDA DELAYS,X:STA NDELAY
3260 LDA $D011:AND #$7F:STA $D011:LDA #1:STA $D019:PLA:STA 1:CPX #7:BNE IRQBACK
3265 AND #7:CMP #7:BNE IRQBACK:JMP $EA31
3270 LINES .BYT 197,176,155,134,113,92,71,50
3280 SPBASE .BYT 159,155,151,147,143,139,135,131
3285 DELAYS .BYT 12,19,12,12,19,12,19,12
3290 COUNTER .BYT 7:BASEADDR .BYT $E0
3300 NBASE .BYT 131:NLINE .BYT 50:NDELAY .BYT 0
3389 ; ================================
3390 ; MOVESCR - BILDSCHIRM NACH $CC00
3391 ; - ZEICHENSATZ INS RAM
3392 ; - VIC INITIALISIEREN
3399 ; ================================
3400 MOVESCR SEI:LDY #0:STY $FE:LDA #$D0:STA $FF:LDX #16
3410 TRLOOP LDA #$33:STA 1:LDA ($FE),Y:PHA:LDA #$30:STA 1:PLA:STA ($FE),Y:INY
3420 BNE TRLOOP:INC $FF:DEX:BNE TRLOOP:JSR FDBACK
3430 VICINIT JSR $E518:LDA #$34:STA $D018:LDA $DD00:AND #$FC:STA $DD00
3440 LDA #$CC:STA $288:JMP $E544
3489 ; ================================
3490 ; GADDR - ADRESSE UND BITMUSTER
3491 ; DES GRAFIKCURSORS
3492 ; BERECHNEN
3499 ; ================================
3500 GADDR LDA ACTX:CMP #96:BCS ILLQUAN
3510 LDX #0:STX $FF:GAL1 CMP #24:BCC GAM2:SBC #24:INC $FF:BCS GAL1
3520 GAM2 PHA:AND #7:JSR CHKMSK:PLA:LSR A:LSR $FF:ROR A:LSR $FF:ROR A:STA $FE
3530 LDA ACTY:CMP #168:BCS ILLQUAN
3540 GAL3 CMP #21:BCC GAM4:SBC #21:INC $FF:BCS GAL3
3550 GAM4 STA $2:ASL A:ADC $2:ADC $FE:STA $FE:LDA BASEADDR:ADC $FF:STA $FF
3560 RTS:ACTX .BYT 0:ACTY .BYT 0:ACTBIT .BYT 0:ACTMODE .BYT 0
3570 CHKMSK TAX:LDA TWOEXP,X:STA ACTBIT:RTS
3580 TWOEXP .BYT 128,64,32,16,8,4,2,1
3585 ILLQUAN JMP $B248
3589 ; ================================
3590 ; GRAFIKCURSOR JEWEILS UM EINEN
3591 ; PUNKT BEWEGEN
3599 ; ================================
3600 GCUP DEC ACTY:LDA $FE:PHA:SEC:SBC #3:STA $FE:PLA:EOR $FE:AND #64
3602 BNE GCORR:RTS
3605 GCVER LDA VFLAG:BEQ GCUP
3610 GCDOWN INC ACTY:LDA $FE:PHA:CLC:ADC #3:STA $FE:AND #63:CMP #63:BEQ GCP
3612 PLA:EOR $FE:AND #64:BNE GCORR:RTS
3615 GCHOR LDA HFLAG:BNE GCRIGHT
3620 GCLEFT DEC ACTX:ASL ACTBIT:BCS GCORR:RTS
3630 GCRIGHT INC ACTX:LSR ACTBIT:BCS GCORR:RTS
3640 HFLAG .BYT 0:VFLAG .BYT 0
3650 GCP PLA:GCORR JMP GADDR
3689 ; ================================
3690 ; PROZESSOR-INTERRUPTVEKTOR BEI
3691 ; $FFFE/FF SETZEN
3699 ; ================================
3710 SYSVON LDA #<RAMCASE:LDY #>RAMCASE:BNE STOSYS
3720 SYSVOFF LDA #<RAMIRQ:LDY #>RAMIRQ
3730 STOSYS STA $FFFE:STY $FFFF:RTS
3789 ; ================================
3790 ; NEUE NMI-ROUTINEN
3791 ; NEWNMI1 - FALLS RAM AKTIV
3792 ; NEWNMI2 - FALLS ROM AKTIV
3793 ; NEUE LOAD- & SAVE-ROUTINEN,
3794 ; GRAFIK WIRD VORHER DEAKTIVIERT
3799 ; ================================
3800 NEWNMI1 SEI
3810 NEWNMI2 PHA:TXA:PHA:TYA:PHA:LDA 1:PHA:LDA #$7F:STA $DD0D:LDY $DD0D
3820 BPL NORS232:PLA:JMP $FE72
3830 NORS232 LDA #$37:STA 1:JSR $FD02:BNE NOMODULE:PLA:JMP ($8002)
3840 NOMODULE JSR SYSVEC
3850 JSR $FDA3:JSR VICINIT:JMP ($A002)
3900 SYSVEC LDX #<VECTAB:LDY #>VECTAB:JMP $FD19
3910 VECTAB .WOR $EA31,$FE66,NEWNMI2,$F34A
3920 .WOR $F291,$F20E,$F250,$F333,$F157
3930 .WOR $F1CA,$F6ED,$F13E,$F32F,$FE66
3940 .WOR NEWLOAD,NEWSAVE
3950 NEWLOAD PHA:JSR IRQOFF:PLA:JMP $F4A5
3960 NEWSAVE JSR IRQOFF:JMP $F5ED
3989 ; ================================
3990 ; GC- (GRAPHIC-COLOUR-) BEFEHL
3999 ; ================================
4000 COLOR JSR $B79B:TXA:LDX #3
4010 COLLOOP STA $D027,X:DEX:BPL COLLOOP:RTS
4989 ; ================================
4990 ; DD- (DRAW-DOT-) BEFEHL
4999 ; ================================
5000 DOT JSR $B79B:STX ACTX:JSR $B7F1:STX ACTY:JSR GADDR
5002 DOTOUT LDA #$30:STA 1:LDA ACTY:AND #7:TAY:LDA MUSTER,Y:AND ACTBIT
5003 LDY #0:LDX ACTMODE:BEQ CLRPKT:DEX:BEQ ORAPKT:DEX:BNE SETPKT
5005 INVPKT EOR ($FE),Y:JMP DBACK
5010 CLRPKT EOR #255:AND ($FE),Y
5020 DBACK STA ($FE),Y:JMP FDBACK
5030 ORAPKT ORA ($FE),Y:JMP DBACK
5040 SETPKT STA $400:LDA ACTBIT:EOR #255:AND ($FE),Y:ORA $400:JMP DBACK
5089 ; ================================
5090 ; DS- (DRAW-STYLE-) BEFEHL
5099 ; ================================
5100 SETMUST JSR $B79B:STX MUSTER:LDA #1:STA $FB:MUSTLOOP JSR $B7F1:TXA
5110 LDY $FB:STA MUSTER,Y:INC $FB:CPY #7:BCC MUSTLOOP:RTS
5120 MUSTER .BYT 255,255,255,255,255,255,255,255
5989 ; ================================
5990 ; GE- (GRAPHIC-ERASE-) BEFEHL
5999 ; =========OROROR=OR==================
6000 ERASE LDA BASEADDR:STA $FF:LDY #0:STY $FE
6010 LDA #0:LDX #8:ERALOOP STA ($FE),Y:INY:BNE ERALOOP
6020 INC $FF:DEX:BNE ERALOOP:JMP $0073
6989 ; ================================
6990 ; GR- (GRAPHIC ON/OFF-) BEFEHL
6999 ; ================================
7000 GRAPH JSR $B79B:TXA:BNE IRQON
7010 IRQOFF SEI:LDA $D015:AND #240:STA $D015:LDA #0:STA $D01A:LDA #$81
7015 STA $DC0D:JSR SYSVOFF:LDA #$31:LDY #$EA:VECT STA $314:STY $315:CLI:GX RTS
7020 IRQON LDA $315:CMP #>SPRIRQ:BEQ GX
7025 LDA $D015:ORA #15:STA $D015
7027 LDA $D017:AND #15:STA $D017:LDA $D01C:AND #240:STA $D01C:LDA $D01D
7028 ORA #15:STA $D01D
7030 SEI:LDX #7:STX COUNTER:LDA LINES+7:STA $D012:LDA #$7F:STA $DC0D
7040 LDA #1:STA $D01A:JSR SYSVON:LDA #<SPRIRQ:LDY #>SPRIRQ:BNE VECT
7189 ; ================================
7190 ; GP- (GRAPHIC PRIORITY-) BEFEHL
7199 ; ================================
7200 PRIORITY JSR $B79B:TXA:BNE PRIYES
7210 LDA $D01B:ORA #15:STA $D01B:RTS
7220 PRIYES LDA $D01B:AND #240:STA $D01B:RTS
7989 ; ================================
7990 ; DL- (DRAW-LINE-) BEFEHL
7999 ; ================================
8000 LINE JSR DOT:JSR $B7F1:TXA:SEC:SBC ACTX:STA $FC:STA $402
8005 LDA #0:ROL A:STA HFLAG
8010 BNE HOK:LDA #0:SEC:SBC $FC:STA $FC:STA $402
8020 HOK JSR $B7F1:TXA:SEC:SBC ACTY:STA $FD:STA $403:LDA #0:ROL A:STA VFLAG
8030 BNE VOK:LDA #0:SEC:SBC $FD:STA $FD:STA $403
8040 VOK LDA $FD:CLC:ADC $FC:BEQ LDONE
8060 LDA $FC:STA $400:LDA $FD:STA $401
8070 LINELOOP LDA #0:STA 2:LDA $402:BEQ NOHMOVE:LDA $FC:CLC
8075 ADC $400:STA $400:BCC NOHMOVE:JSR GCHOR
8080 DEC $402:INC 2:NOHMOVE LDA $403:BEQ NOVMOVE:LDA $FD:CLC
8085 ADC $401:STA $401:BCC NOVMOVE:JSR GCVER
8090 DEC $403:INC 2:NOVMOVE LDA 2:BEQ NODOT
8100 JSR DOTOUT:NODOT LDA $402:ORA $403:BNE LINELOOP:LDONE RTS
8989 ; ================================
8990 ; QUIT - SCHALTET NEUEN INTERPR.AB
8991 ; - LAESST BILDSCHRIM ($CC00)
8992 ; - LAESST ZEICHENSATZ
8993 ; - LAESST NMI-ROUTINE
8999 ; ================================
9000 QUIT JSR IRQOFF:JSR $E453:JSR SYSVEC:JMP $73
9989 ; ================================
9990 ; DR- (DRAW-RECTANGLE-) BEFEHL
9999 ; ================================
10000 RECT JSR SQPREP
10010 LDA $FB:BEQ REC2:H1LOOP JSR GCRIGHT:JSR DOTOUT:DEC $FB:BNE H1LOOP
10020 REC2 LDA $FD:BEQ REC3:STA $FB:V1LOOP JSR GCDOWN:JSR DOTOUT:DEC $FB
10030 BNE V1LOOP:REC3 LDA $FC:BEQ REC4:H2LOOP JSR GCLEFT:JSR DOTOUT:DEC $FC
10040 BNE H2LOOP
10050 REC4 LDA $FD:BEQ RECX:DEC $FD:BEQ RECX:V2LOOP JSR GCUP
10060 JSR DOTOUT:DEC $FD:BNE V2LOOP:RECX RTS
10070 SQPREP JSR DOT:JSR $B7F1:STX $FC:STX $FB:JSR $B7F1:STX $FD:RTS
10089 ; ===============================
10090 ; DB- (DRAW-BLOCK-) BEFEHL
10099 ; ===============================
10100 BLOCK JSR SQPREP
10110 LDA $FD:BEQ RECX:BLKLOOP JSR DOTOUT:LDA $FC:STA $FB:JSR RLINE:DEC $FD
10120 BEQ RECX:JSR GCDOWN:JSR DOTOUT:LDA $FC:STA $FB:JSR LLINE:DEC $FD
10130 BEQ RECX:JSR GCDOWN:JMP BLKLOOP
10140 RLINE LDA $FB:BEQ RLX:RLL JSR GCRIGHT:JSR DOTOUT:DEC $FB:BNE RLL:RLX RTS
10150 LLINE LDA $FB:BEQ LLX:LLL JSR GCLEFT:JSR DOTOUT:DEC $FB:BNE LLL:LLX RTS
10989 ; ===============================
10990 ; GN- (GRAPHIC-NUMBER-) BEFEHL
10999 ; ===============================
11000 SCREEN JSR $B79B:TXA:AND #3:TAX:LDA BASES,X:STA BASEADDR
11010 LDA SCRTAB,X:LDY #7:SCRLOOP STA SPBASE,Y:CLC:ADC #4:DEY:BPL SCRLOOP
11020 RTS
11030 BASES .BYT $E0,$E8,$F0,$E8
11040 SCRTAB .BYT 131,163,195,163
11189 ; ===============================
11190 ; GX- (GRAPHIC-XTOP-) BEFEHL
11199 ; ===============================
12000 XTOP JSR $B79B:WIDTHIN STX $FE:LDA #0:STA $FF:LDA $D010:AND #240:STA $D010
12010 LDA #8:STA $FD:LDX #6:XLOOP LDA $FE:STA $D000,X
12020 LDA $FF:BEQ XNC:LDA $FD:ORA $D010:STA $D010
12030 XNC LDA $FE:CLC:ADC XWIDTH:STA $FE:BCC XNC2:INC $FF
12040 XNC2 LSR $FD:DEX:DEX:BPL XLOOP:RTS
12050 XWIDTH .BYT 48
12060 WIDTH JSR $B79B:TXA:BNE WIDE
12070 LDA #24:STA XWIDTH:LDA $D01D:AND #240
12075 WIDTHX STA $D01D:LDX $D00E:JMP WIDTHIN
12080 WIDE LDA #48:STA XWIDTH:LDA $D01D:ORA #15:BNE WIDTHX
12989 ; ===============================
12990 ; GY- (GRAPHIC-YTOP-) BEFEHL
12999 ; ===============================
13000 YTOP JSR $B79B:TIMEIN TXA:STA $400:LDX #7
13010 YLOOP STA LINES,X:CLC:ADC #21:DEX:BPL YLOOP
13020 LDA $400:ASL A:CLC:ADC $400:AND #7:ORA #8:TAY
13030 LDX #7:DELYLOOP LDA DELYTAB-1,Y:STA DELAYS,X
13040 DEY:DEX:BPL DELYLOOP:RTS
13050 DELYTAB .BYT 12,12,19,12,19,19,12,19,12,12,19,12,19,19,12
13989 ; ===============================
13990 ; FD- (FONT-DESIGN-) BEFEHL
13999 ; ===============================
14000 FONT JSR FDPREP
14020 MDIN LDA #0:STA $FB:CHRLOOP JSR $B7F1:TXA:LDX $FB:STA $0400,X:INC $FB
14030 CPX #7:BCC CHRLOOP:SEI:LDA #$30:STA 1
14040 LDY #7:STOLOOP LDA $400,Y:STA ($FE),Y:DEY:BPL STOLOOP
14050 FDBACK LDA #$37:STA 1:CLI:RTS
14089 ; ===============================
14090 ; FB- (FONT-BYTE-) BEFEHL
14099 ; ===============================
14100 FDPREP JSR $B79B:TXA:AND #1:ORA #26:PHA:JSR $B7F1
14110 STX $FE:PLA:ASL $FE:ROL A:ASL $FE:ROL A:ASL $FE:ROL A:STA $FF:RTS
14200 FOBYTE JSR FDPREP:JSR $B7F1:TXA:AND #7:MBIN STA $FB:JSR $B7F1
14210 LDA #$30:STA 1:TXA:LDY $FB:STA ($FE),Y:JMP FDBACK
14989 ; ===============================
14990 ; GS- (GRAPHIC-SAVE-) BEFEHL
14999 ; ===============================
15000 SAVE JSR $B79B:TXA:AND #3:TAX:LDA BASES,X:FSVIN PHA:JSR $AEFD:JSR $E1D4
15010 PLA:STA $FF:LDY #0:STY $FE:STY $FB:LDA #$B8:STA $FC:STA $FD:SEI:LDA #$30
15020 STA 1:LDX #8:SVLOOP LDA ($FE),Y:STA ($FB),Y:INY:BNE SVLOOP
15030 INC $FC:INC $FF:DEX:BNE SVLOOP
15040 LDA #$36:STA 1:CLI:LDX #0:STX $FC:LDA #$FC:DEX:LDY #$BF:JSR $F5DD
15050 JMP FDBACK
15989 ; ===============================
15990 ; GL- (GRAPHIC-LOAD-) BEFEHL
15999 ; ===============================
16000 LOAD JSR $B79B:TXA:AND #3:TAX:LDA BASES,X:FLIN PHA:JSR $AEFD:JSR $E1D4
16010 PLA:TAY:LDA #0:STA $0A:TAX:JSR $FFD5
16020 LDX $2D:LDY $2E:JMP LOADAFT
16989 ; ===============================
16990 ; TP- (TEXTSCREEN-PRINT-) BEFEHL
16999 ; ===============================
17000 PRTAT JSR CRSRXY
17010 JSR CHKCOM:BNE PAX
17020 PRINT JSR $0073:JMP $AAA0
17100 CRSRXY JSR $B79B:STX $D3:JSR $B7F1:STX $D6:JMP $E56C
17989 ; ===============================
17990 ; GI- (GRAPHIC-INVERT-) BEFEHL
17999 ; ===============================
18000 INVERT LDA BASEADDR:STA $FF:LDY #0:STY $FE
18010 LDA #$30:STA 1
18020 LDX #8:INVLOOP LDA ($FE),Y:EOR #255:STA ($FE),Y:INY:BNE INVLOOP
18030 INC $FF:DEX:BNE INVLOOP:LDA #$37:STA 1:JMP $0073
18989 ; ===============================
18990 ; DM- (DRAW-MODE-) BEFEHL
18999 ; ===============================
19000 MODE JSR $B79B:STX ACTMODE:PAX RTS
19989 ; ===============================
19990 ; FO- (FONT-ORIGINAL-) BEFEHL
19999 ; ===============================
20000 NORMAL JSR IRQOFF:JSR MOVESCR:JMP $73
20989 ; ===============================
20990 ; GK (GRAPHIC-COMBINATE-) BEFEHL
20999 ; ===============================
21000 KOMBINE JSR KPREP
21010 JSR $B7F1:TXA:AND #3:TAX:LDA BASES,X:STA $FF:JSR $B7F1
21020 FLBK LDY #0:STY $FC:STY $FE:LDA #$30:STA 1:.BYT $2C:COPYSCR LDX #3
21030 TXA:AND #3:ASL A:TAX:LDA KOTAB,X:STA $334:LDA KOTAB+1,X:STA $335
21040 LDX #8:KCL LDA ($FC),Y:JSR EXEC:STA ($FE),Y:INY:BNE KCL
21050 INC $FD:INC $FF:DEX:BNE KCL:JMP FDBACK
21060 KORA ORA ($FE),Y:KCOPY RTS
21070 KAND AND ($FE),Y:RTS
21080 KEOR EOR ($FE),Y:RTS
21090 KOTAB .WOR KAND,KORA,KEOR,KCOPY
21189 ; ===============================
21190 ; KPREP - COMBINATE-VORBEREITG.
21191 ; GETADDR - POS. INTEGERZ. HOLEN
21199 ; ===============================
21200 KPREP JSR $B79B:TXA:AND #3:TAX:LDA BASES,X:STA $FD:RTS
21210 GETADDR JSR $AEFD:GET16B JSR $AD8A:JMP $B7F7
21289 ; ===============================
21290 ; PG- (PUT-GRAPHIC-) BEFEHL
21291 ; RG- (RECALL-GRAPHIC-) BEFEHL
21299 ; ===============================
21300 PUTSCREEN JSR KPREP:LDA #0:STA $FC:JSR GETADDR:STY $FE:STA $FF
21310 PRX LDA #$30:STA 1:BNE COPYSCR
21320 RCLSCREEN JSR KPREP:STA $FF:LDA #0:STA $FE:JSR GETADDR:STY $FC:STA $FD
21330 JMP PRX
21900 ; ===============================
21910 ; TEXTSCREEN-BEFEHLE
21911 ; TC - TEXTSCREEN-COLOUR-FILL
21912 ; TF - '' -CHAR-FILL
21913 ; TT - '' -ATTR.-TURN
21914 ; TR - '' -REVERS
21915 ; TN - '' -NORMAL
21916 ; TX - '' -CHAR-EXCHANGE
21999 ; ===============================
22000 TPREP JSR $B79B:CPX #40:BCS ILLQUAN2:STX $FE:STX $FC
22010 JSR $B7F1:CPX #25:BCS ILLQUAN2:STX $FD:TXA:ASL A:ASL A:ASL A:STA $FB
22020 LDX #0:STX $FF:ASL A:ROL $FF:ASL A:ROL $FF:ADC $FB:BCC TOK:INC $FF:CLC
22030 TOK ADC $FE:STA $FE:BCC TOK2:INC $FF:TOK2 JSR $B7F1
22040 TXA:BEQ ILLQUAN2:CLC:ADC $FC:CMP #41:BCS ILLQUAN2:DEX:STX $FC
22050 JSR $B7F1:TXA:BEQ ILLQUAN2:CLC:ADC $FD:CMP #26:BCS ILLQUAN2:STX $FD:RTS
22060 ILLQUAN2 JMP $B248
22100 TDOT LDX #$CC:TDO STA $334:STY $335:TXA:CLC:ADC $FF:STA $FF
22105 TDL1 LDY $FC:TDL2 JSR EXEC:STA ($FE),Y:TYA
22110 BEQ TDM3:DEY:JMP TDL2:TDM3 LDA $FE:CLC:ADC #40:STA $FE:BCC TOK3:INC $FF
22120 TOK3 DEC $FD:BNE TDL1:RTS
22200 TSCONST LDA $FB:RTS
22210 TSTURN LDA ($FE),Y:EOR #128:RTS
22220 TSPLUS LDA ($FE),Y:AND #127:RTS
22230 TSMINUS LDA ($FE),Y:ORA #128:RTS
22240 TSXCHG LDA ($FE),Y:CMP $FB:BNE TSXX:LDA $400:TSXX RTS
22300 TCOLOR JSR TPREP:JSR $B7F1:STX $FB:LDX #$D8
22310 TCF LDA #<TSCONST:LDY #>TSCONST:JMP TDO
22320 TFILL JSR TPREP:JSR $B7F1:STX $FB:LDX #$CC:BNE TCF
22330 TTURN JSR TPREP:LDA #<TSTURN:LDY #>TSTURN:BNE TDOT
22340 TREV JSR TPREP:LDA #<TSMINUS:LDY #>TSMINUS:BNE TDOT
22350 TNORM JSR TPREP:LDA #<TSPLUS:LDY #>TSPLUS:JMP TDOT
22360 TXCHG JSR TPREP:JSR $B7F1:STX $FB:JSR $B7F1:STX $400
22370 LDA #<TSXCHG:LDY #>TSXCHG:JMP TDOT
22989 ; ===============================
22990 ; FS- (FONT-SAVE-) BEFEHL
22991 ; FL- (FONT-LOAD-) BEFEHL
22999 ; ===============================
23000 FOSAVE JSR FOPREP:JMP FSVIN
23010 FOTAB .BYT $D0,$D8
23100 FOLOAD JSR FOPREP:STA $FF:LDA #$B8:STA $FD:JSR FLIN:LDX #3:JMP FLBK
23200 FOPREP JSR $B79B:TXA:AND #1:TAX:LDA FOTAB,X:RTS
23900 ; ===============================
23910 ; SPRITE ('MOB')- BEFEHLE
23911 ; MG - SPRITE ('MOB')-GRAB
23912 ; MO - '' -ON/OFF
23913 ; MP - '' -PARAMETER
23914 ; MC - '' -COLOUR
23915 ; ML - '' -LOOK
23916 ; MD - '' -DESIGN
23917 ; MB - '' -BYTE-DES.
23918 ; MX - '' -X-POS.
23919 ; MY - '' -Y-POS.
23999 ; ===============================
24000 MOPREP1 JSR $B7F1:JMP MOP11:MOP1 JSR $B79B:MOP11 TXA:AND #127:CMP #127
24010 ADC #0:AND #127:ORA #$80:PHA
24012 STA $FF:LDA #0:SEC:ROR $FF:ROR A:SEC:ROR $FF:ROR A:STA $FE:PLA:RTS
24020 MOPREP2 JSR $B79B:TXA:AND #7:TAX:ASL A:TAY:LDA MOBEXP,X:RTS
24030 MOBEXP .BYT 1,2,4,8,16,32,64,128
24100 MOGRAB JSR MOP1:LDA $FE:STA $FC:LDA $FF:STA $FD:JSR MOPREP1
24120 LDA #$30:STA 1:LDY #63:MOCOPY LDA ($FE),Y:STA $340,Y:STA ($FC),Y:DEY
24130 BPL MOCOPY:JMP FDBACK
24200 MOBON JSR MOPREP2:PHA:JSR $B7F1:PLA:LDY #21:MOSWI CPX #0:BEQ MOBOFF
24210 ORA $D000,Y:BNE MOOX
24220 MOBOFF EOR #255:AND $D000,Y:MOOX STA $D000,Y:RTS
24300 MOPAR JSR MOPREP2:STA $FB:LDY #27:JSR MO1PAR:INY:JSR MO1PAR
24310 INY:JSR MO1PAR:LDY #23
24350 MO1PAR STY $FC:JSR $B7F1:LDY $FC:LDA $FB:BNE MOSWI
24400 MOCOL JSR MOPREP2:STX $FB:JSR $B7F1:TXA:LDX $FB:STA $D027,X:RTS
24410 MOMCOL JSR $B79B:STX $D025:JSR $B7F1:STX $D026:RTS
24500 MOLOOK JSR MOPREP2:STX $FB:JSR MOPREP1:LDX $FB:STA $CFF8,X:RTS
24600 MODSGN JSR MOP1:JSR $B7F1:TXA:AND #7:ASL A:ASL A:ASL A:ADC $FE:STA $FE
24610 JMP MDIN
24700 MOBYTE JSR MOP1:JSR $B7F1:TXA:AND #63:JMP MBIN
24800 MOBX JSR MOPREP2:PHA:STY $FB:JSR GETADDR:LDY $FB:LDA $14:STA $D000,Y
24810 PLA:LDY #16:LDX $15:JSR MOSWI
24820 JSR CHKCOM:BEQ MOBYIN:RTS
24900 MOBY JSR MOPREP2:STY $FB:MOBYIN JSR $B7F1:TXA:LDY $FB:STA $D001,Y:RTS
24939 ; ===============================
24940 ; CHKCOM - PRUEFT AUF KOMMA
24941 ; CHKSEMI - PRUEFT AUF SEMIKOLON
24949 ; ===============================
24950 CHKCOM LDA #",":.BYT $2C:CHKSEMI LDA #";":LDY #0:CMP ($7A),Y:RTS
24989 ; ===============================
24990 ; PT- (PUT-TEXTSCREEN-) BEFEHL
24991 ; RT- (RECALL-TEXTSCREEN-) BEFEHL
24999 ; ===============================
25000 PUTTEXT JSR $73:JSR GET16B:STY $FE:STA $FF:LDA #$CC:JSR PTSUB
25010 LDA #$D8:JMP PTSUB
25020 RCLTEXT JSR $73:JSR GET16B:STY $FC:STA $FD:LDA #$CC:JSR GTSUB
25030 LDA #$D8:JMP GTSUB
25100 PTSUB LDY #$37:STY $FB:LDY #0:STY $FC:STA $FD:BEQ TTLMAIN
25110 GTSUB LDY #$30:STY $FB:LDY #0:STY $FE:STA $FF
25210 TTLMAIN LDX #3:LDY #255:JSR TTLSUB:INX:LDY #248
25300 TTLSUB LDA $FB:STA 1:LDA ($FC),Y:PHA:LDA #$37:STA 1:PLA:STA ($FE),Y
25310 DEY:CPY #$FF:BNE TTLSUB:INC $FF:INC $FD:DEX:BNE TTLSUB:RTS
25389 ; ===============================
25390 ; BYTE-DISPLAY-BEFEHLE
25391 ; BB - BINARY-DISPLAY
25392 ; BC - BINARY-DISPLAY-CHARS
25393 ; BM - BAR-MEMORY-DISPLAY
25394 ; BP - BINARY-MEMORY-DISPLAY
25395 ; BV - VERTICAL-BAR-DISPLAY
25399 ; ===============================
25400 DSPBYTE JSR DISPREP:DBIN STX $400:LDX #8:DIBLOOP LDY #0:ASL $FB
25410 BCC DBM2:INY:DBM2 LDA DSPCODE,Y:JSR $FFD2:DEX:BNE DIBLOOP:RTS
25420 DSPCODE .ASC ".*"
25430 DSPMBYTE JSR DISPREP2:JMP DBIN
25440 DSPMVBAR JSR DISPREP2:JMP DVIN
25500 DSPCHARS JSR $B79B:STX DSPCODE:JSR $B7F1:STX DSPCODE+1:RTS
25600 DSPVBAR JSR DISPREP:DVIN TXA:LSR A:LSR A:LSR A:TAX:BEQ NODSB:STX $FC
25610 DSBLOOP JSR REVBLK:DEC $FC:BNE DSBLOOP:NODSB LDA $FB
25620 AND #7:TAX:LDA BHCODE,X:BMI NOREV:TAY:JSR REVOUT:TYA:NOREV ORA #128
25625 JMP $FFD2
25630 BHCODE .BYT 160,164,175,185,162,56,55,35
25640 REVOUT LDA #"":JMP $FFD2
25650 REVBLK LDA #<RVBCHRS:LDY #>RVBCHRS:JMP $AB1E
25660 RVBCHRS .ASC " [146][145][157]":.BYT 0
25700 DISPREP JSR CRSRXY:JSR $B7F1:STX $FB:RTS
25710 DISPREP2 JSR CRSRXY:JSR GETADDR:LDY #$30:STY 1:LDY #0:LDA ($14),Y:TAX
25720 STX $FB:LDY #$37:STY 1:RTS
25989 ; ===============================
25990 ; JS- (JOYSTICK-) BEFEHL
25999 ; ===============================
26000 JOYREQ LDA $DC00:STA $FB:LDY #4:JSLOOP LSR $FB:BCS JSNEXT
26010 LDA JSTAB,Y:SEI:JSR $EB35:CLI:JSNEXT DEY:BPL JSLOOP:JMP $73
26020 JSTAB .BYT 13:.ASC "[157][145]"
26089 ; ===============================
26090 ; OAD UND WEITER IM PROGRAMM
26099 ; ===============================
26100 LOADAFT BCC NOERR:JMP $E0F9
26110 NOERR JSR $FFB7:AND #16:BEQ NOERR2:JMP $E19C:NOERR2 RTS
49990 .END:END
60000 OPEN15,8,15
60010 GET#15,I$:PRINTI$;:IFI$<>CHR$(13)THEN60010
60020 CLOSE15