1000 ORG 49152
1010 ;
1020 MAP1 EQU 40960
1030 MAP2 EQU 57344
1040 COLMAP1 EQU 35840
1050 COLMAP2 EQU 52224
1060 HIMEM EQU 35834
1070 ;
1080 CLS EQU 160
1090 CKOM EQU $AEFD
1100 GETBYTX EQU $B79E
1110 ;
1120 XL EQU 20
1130 XH EQU 21
1140 ANZAHLBILDER EQU 78
1150 BILDZAEHLER EQU 79
1160 ANZAHLPUNKTE EQU 80
1170 PUNKTZAEHLER EQU 81
1180 DURCHLAEUFE EQU 82
1190 MAPSW EQU 83
1200 Y1 EQU 87
1210 XL2 EQU 88
1220 XH2 EQU 89
1230 Y2 EQU 255
1240 COLORPTR EQU 139
1250 CTABPTR EQU 141
1260 MAPMSB EQU 252
1270 MAPPTR EQU 253
1280 ;
1290 ;
1300 ;
1310 ;
1320 EINSPR JSR GETPAR
1330 ;
1340 MAINLOOP JSR BILDLOESCHEN
1350 JSR BILDZEICHNEN
1360 JSR SWITCHMAP
1370 DEC BILDZAEHLER
1380 BNE MAINLOOP
1390 JSR SETCTAB
1400 DEC DURCHLAEUFE
1410 BNE MAINLOOP
1420 ;
1430 LDA #55
1440 STA 1
1450 CLI
1460 LDA #0
1470 STA 198
1480 L2 LDA 198
1490 BEQ L2
1500 DEC 198
1510 ;
1520 LDA #27
1530 STA 53265
1540 LDA #21
1550 STA 53272
1560 LDA #3
1570 STA 56576
1580 RTS
1590 ;
1600 ;
1610 GETPAR JSR CKOM
1620 JSR GETBYTX
1630 STX ANZAHLBILDER
1640 JSR CKOM
1650 JSR GETBYTX
1660 STX ANZAHLPUNKTE
1670 JSR CKOM
1680 JSR GETBYTX
1690 STX DURCHLAEUFE
1700 ;
1710 LDA #59
1720 STA 53265
1730 LDA #56
1740 STA 53272
1750 LDA #0
1760 STA 56576
1770 JSR SETCOLOR
1780 SEI
1790 LDA #53
1800 STA 1
1810 LDX #11
1820 L3 LDA CLEAR,X
1830 STA CLS,X
1840 DEX
1850 BPL L3
1860 LDX #32
1870 LDA #0
1880 TAY
1890 JSR CLS ; CLEAR
1900 LDA #>MAP1
1910 STA MAPMSB
1920 LDA #0
1930 STA MAPSW
1940 ;
1950 SETCTAB LDA #>HIMEM
1960 STA CTABPTR+1
1970 LDA #<HIMEM
1980 STA CTABPTR
1990 LDA ANZAHLBILDER
2000 STA BILDZAEHLER
2010 RTS
2020 ;
2030 ;
2040 CLEAR STA MAP2,Y
2050 INY
2060 BNE CLEAR
2070 INC CLS+2
2080 DEX
2090 BNE CLEAR
2100 RTS
2110 ;
2120 ;
2130 BILDZEICHNEN LDA ANZAHLPUNKTE
2140 STA PUNKTZAEHLER
2150 L5 JSR LINE
2160 DEC PUNKTZAEHLER
2170 BNE L5
2180 RTS
2190 ;
2200 BILDLOESCHEN LDY #5
2210 LDA (CTABPTR),Y
2220 TAX
2230 DEY
2240 LDA (CTABPTR),Y
2250 ORA MAPMSB
2260 STA CLS+2
2270 SEC
2280 LDA CTABPTR
2290 SBC #2
2300 STA CTABPTR
2310 BCS L6
2320 DEC CTABPTR+1
2330 L6 LDA #0
2340 TAY
2350 JSR CLS
2360 RTS
2370 ;
2380 SETCOLOR LDA #16 ;FARBE
2390 LDY #>COLMAP2
2400 STY COLORPTR+1
2410 LDY #0
2420 STY COLORPTR
2430 JSR DOIT
2440 LDY #>COLMAP1
2450 STY COLORPTR+1
2460 LDY #0
2470 JSR DOIT
2480 RTS
2490 ;
2500 DOIT LDX #4
2510 L7 STA (COLORPTR),Y
2520 INY
2530 BNE L7
2540 INC COLORPTR+1
2550 DEX
2560 BNE L7
2570 RTS
2580 ;
2590 SWITCHMAP LDA MAPSW
2600 BNE L8
2610 INC MAPSW
2620 LDA #>MAP2
2630 L999 STA MAPMSB
2640 LDA MAPSW
2650 STA 56576
2660 RTS
2670 L8 DEC MAPSW
2680 LDA #>MAP1
2690 JMP L999
2700 ;
2710 SET TXA ;YCORD IN X
2720 LSR ;XCORD IN XL/XH
2730 LSR
2740 AND #254
2750 TAY
2760 LDA TAB,Y
2770 STA MAPPTR
2780 LDA TAB+1,Y
2790 STA MAPPTR+1
2800 TXA
2810 AND #7
2820 CLC
2830 ADC MAPPTR
2840 STA MAPPTR
2850 LDA XL
2860 AND #248
2870 ADC MAPPTR
2880 STA MAPPTR
2890 LDA MAPPTR+1
2900 ADC MAPMSB
2910 ADC XH
2920 STA MAPPTR+1
2930 LDA XL
2940 AND #7
2950 EOR #7
2960 TAX
2970 LDA ZWEIHOCH,X
2980 LDY #0
2990 ORA (MAPPTR),Y
3000 STA (MAPPTR),Y
3010 RTS
3020 ;
3030 TAB DFB 0, 0, 64,1
3040 DFB 128, 2,192,3
3050 DFB 0, 5, 64,6
3060 DFB 128, 7,192,8
3070 DFB 0,10, 64,11
3080 DFB 128,12,192,13
3090 DFB 0,15, 64,16
3100 DFB 128,17,192,18
3110 DFB 0,20, 64,21
3120 DFB 128,22,192,23
3130 DFB 0,25, 64,26
3140 DFB 128,27,192,28
3150 DFB 0,30
3160 ZWEIHOCH DFB 1,2,4,8,16,32,64,128
3170 LINE JSR GETLINEPAR
3180 LDY #1
3190 STY 98
3200 STY 95
3210 STY 93
3220 DEY
3230 STY 94
3240 STY 97
3250 STY 96
3260 DEY
3270 LDA XH2
3280 CMP XH
3290 BCC D1
3300 BNE D2
3310 LDA XL2
3320 CMP XL
3330 BCS D2
3340 D1 SEC
3350 LDA XL
3360 SBC XL2
3370 STA 91
3380 LDA XH
3390 SBC XH2
3400 STA 92
3410 STY 98
3420 JMP L998
3430 D2 SEC
3440 LDA XL2
3450 SBC XL
3460 STA 91
3470 LDA XH2
3480 SBC XH
3490 STA 92
3500 L998 LDA Y2
3510 CMP Y1
3520 BCS D3
3530 SEC
3540 LDA Y1
3550 SBC Y2
3560 STA 90
3570 STY 95
3580 JMP L997
3590 D3 SBC Y1
3600 STA 90
3610 L997 LDA 92
3620 BNE D4
3630 LDA 91
3640 CMP 90
3650 BCS D4
3660 LDX 90
3670 STA 90
3680 STX 91
3690 LDA 98
3700 STA 96
3710 LDA 95
3720 STA 97
3730 INY
3740 STY 98
3750 STY 95
3760 D4 LDA 92
3770 LSR
3780 STA 89 ; XH2
3790 LDA 91
3800 ROR ;
3810 STA 88
3820 JMP D11
3830 L800 LDA 98
3840 BMI D5
3850 CLC
3860 ADC XL
3870 STA XL
3880 BCC D6
3890 INC XH
3900 BNE D6
3910 D5 CLC
3920 ADC XL
3930 STA XL
3940 BCS D6
3950 DEC XH
3960 D6 CLC
3970 LDA Y1
3980 ADC 97
3990 STA Y1
4000 CLC
4010 LDA XL2
4020 ADC 90
4030 STA XL2
4040 LDA XH2
4050 ADC #0
4060 STA XH2
4070 INC 93
4080 BNE D7
4090 INC 94
4100 D7 LDA XH2
4110 CMP 92
4120 BCC D11
4130 BNE D8
4140 LDA 91
4150 CMP XL2
4160 BCS D11
4170 D8 SEC
4180 LDA XL2
4190 SBC 91
4200 STA XL2
4210 LDA XH2
4220 SBC 92
4230 STA XH2
4240 LDA 96
4250 BMI D9
4260 CLC
4270 ADC XL
4280 STA XL
4290 BCC D10
4300 INC XH
4310 BNE D10
4320 D9 CLC
4330 ADC XL
4340 STA XL
4350 BCS D10
4360 DEC XH
4370 D10 CLC
4380 LDA Y1
4390 ADC 95
4400 STA Y1
4410 D11 LDX Y1
4420 JSR SET
4430 LDA 94
4440 CMP 92
4450 BCC D12
4460 LDA 91
4470 CMP 93
4480 BCS D12
4490 RTS
4500 D12 JMP L800
4510 ;
4520 ;
4530 GETLINEPAR LDY #5
4540 LDA (CTABPTR),Y
4550 STA XL
4560 DEY
4570 LDA (CTABPTR),Y
4580 BPL A1
4590 PLA
4600 PLA
4610 JMP L700
4620 A1 STA XH
4630 DEY
4640 LDA (CTABPTR),Y
4650 STA Y1
4660 DEY
4670 LDA (CTABPTR),Y
4680 STA XL2
4690 DEY
4700 LDA (CTABPTR),Y
4710 STA XH2
4720 DEY
4730 LDA (CTABPTR),Y
4740 STA Y2
4750 ;
4760 L700 SEC
4770 LDA CTABPTR
4780 SBC #6
4790 STA CTABPTR
4800 BCS A2
4810 DEC CTABPTR+1
4820 A2 RTS
READY.