antoine-source/picnicparanoia/picnicsource/CARRY C.txt
Antoine Vignau 4d4fb6a665 Let's free the code!!
Some old (WIP) disassemblies and my own source code now available online.
2024-07-23 23:38:22 +02:00

653 lines
15 KiB
Plaintext

0010 .LI OFF
0020 TEMP1 .EQ $F0
0030 TEMP2 .EQ $F1
0040 TEMP3 .EQ $F2
0050 TEMP4 .EQ $FF
0060 SCRPNT1 .EQ $F5
0070 SCRPNT2 .EQ $F7
0080 POINTER1 .EQ $F9
0090 POINTER2 .EQ $FB
0100 POINTER3 .EQ $FD
0110 POINTER4 .EQ $EE
0120 HEIGHT .EQ $FE7
0130 PATINDEX .EQ $FEB
0140 AAMSBYT .EQ $10C0
0150 AALSBYT .EQ $10E0
0160 ANTBYT1 .EQ $1000
0170 ANTBYT2 .EQ $1020
0180 ANTBYT3 .EQ $1040
0190 ANTXOLD .EQ $110B
0200 ANTYOLD .EQ $110C
0210 ANTXXOLD .EQ $110D
0220 ANTX .EQ $1104
0230 ANTY .EQ $1105
0240 ANTXX .EQ $1106
0250 ANTNUM .EQ $1108
0260 DESTBYT1 .EQ $1080
0270 DESTBYT2 .EQ $10A0
0280 K8 .EQ $FB8
0290 INIT.K8 .EQ $FB9
0300 FOODNUM .EQ $FBB
0310 FOODX .EQ $FBC
0320 FOODY .EQ $FBD
0330 FOODBYT1 .EQ $6920
0340 FOODBYT2 .EQ $6928
0350 FOODBYT3 .EQ $6930
0360 ANTHOLD .EQ $6938
0370 BYTE3 .EQ $FBE
0380 WIDTH .EQ $FBF
0390 FOODHEIGHT .EQ $FC0
0400 SWAT .EQ $FE8
0410 MANDIR .EQ $FE3
0420 GRAB.FOOD .EQ $FB7
0430 BYFOOD .EQ $FB6
0440 MANSTATE .EQ $FE4
0450 MANXX .EQ $FE1
0460 MANY .EQ $FE2
0470 SPIDERBYT4 .EQ $4118
0480 ANTPOSITIONS .EQ $6940
0490 ANTPOS .EQ $FC1
0500 ORIENT .EQ $FC2
0510 ANT.ORIENTATIONS .EQ $6948
0520 ORIENT7 .EQ $FC7
0530 STING.MAN.Z .EQ $600F
0540 ERASE.ANT.Z .EQ $170F
0550 PLOT.ANT3.Z .EQ $1703
0560 PLOT.FOOD2.Z .EQ $6962
0570 UPDATE.HORIZ.DESTBYTS2.Z .EQ $6956
0580 UPDATE.VERT.DESTBYTS2.Z .EQ $7106
0590 VACATE.ANTS.BLOCKS.Z .EQ $4F06
0600 ERASE.WEB.Z .EQ $600C
0610 .OR $7500
0620 .TA $1500
0630 JMP CARRY.FOOD
0640 .BS $09
0650 CARRY.FOOD
0660 AND #$07
0670 TAX
0680 STA TEMP4
0690 LDA #$00
0700 STA SWAT
0710 LDA TABLE150,X
0720 CMP MANDIR
0730 BEQ .1
0740 LDA #$00
0750 STA GRAB.FOOD
0760 STA BYFOOD
0770 RTS
0780 .1 LDA TABLE151,X
0790 BPL .2
0800 CMP #$80
0810 BEQ .3
0820 LDA MANSTATE
0830 CMP #$06
0840 BNE .4
0850 LDA #$04
0860 STA MANSTATE
0870 .4 LDA MANXX
0880 CMP #$02
0890 BEQ .5
0900 CMP #$05
0910 BEQ .5
0920 .8 RTS
0930 .2 JMP CARRY.VERT
0940 .3 LDA MANSTATE
0950 CMP #$05
0960 BNE .4
0970 LDA #$02
0980 STA MANSTATE
0990 BNE .4
1000 .5 LDA TABLE152,X
1010 .7 STA HEIGHT
1020 LDA FOODBYT1,X
1030 STA FOODX
1040 CLC
1050 ADC TABLE155,X
1060 TAY
1070 LDA FOODBYT2,X
1080 STA FOODY
1090 TAX
1100 JSR CHECK.VERT.BLOCKS
1110 BNE .8
1120 LDX TEMP4
1130 LDA FOODX
1140 CMP TABLE156,X
1150 BEQ .6
1160 CLC
1170 ADC TABLE157,X
1180 STA FOODBYT1,X
1190 STA FOODX
1200 JSR PLOT.FOOD2.Z
1210 LDA FOODX
1220 CLC
1230 ADC TABLE153,X
1240 TAY
1250 LDA TABLE152,X
1260 STA HEIGHT
1270 LDX FOODY
1280 JSR VACATE.COLUMN
1290 LDX TEMP4
1300 LDA FOODX
1310 CLC
1320 ADC TABLE161,X
1330 TAY
1340 LDA TABLE152,X
1350 STA HEIGHT
1360 LDX FOODY
1370 JSR SET.COLUMN
1380 LDX TEMP4
1390 LDA FOODX
1400 CLC
1410 ADC TABLE153,X
1420 STA TEMP2
1430 LDA TABLE154,X
1440 STA HEIGHT
1450 LDA FOODY
1460 JSR ERASE.VERT.BLOCKS
1470 LDX TEMP4
1480 LDA FOODX
1490 ROR
1500 BCS .10
1510 LDA #$03
1520 .12 STA ANTPOS
1530 STA ANTPOSITIONS,X
1540 LDA TABLE167,X
1550 JMP UPDATE.HORIZ.DESTBYTS2.Z
1560 .10 LDA #$07
1570 BNE .12
1580 .6 TAY
1590 LDX TEMP4
1600 LDA TABLE152,X
1610 STA HEIGHT
1620 STA TEMP1
1630 LDX FOODY
1640 JSR VACATE.COLUMN
1650 INY
1660 LDX FOODY
1670 LDA TEMP1
1680 STA HEIGHT
1690 JSR VACATE.COLUMN
1700 LDA TEMP4
1710 EXT2
1720 BEQ .7
1730 CMP #$07
1740 BEQ .7
1750 INY
1760 LDX FOODY
1770 LDA #$03
1780 STA HEIGHT
1790 JSR VACATE.COLUMN
1800 .7 LDX TEMP4
1810 LDA TABLE154,X
1820 STA HEIGHT
1830 PHA
1840 LDA FOODX
1850 STA TEMP2
1860 LDA FOODY
1870 JSR ERASE.VERT.BLOCKS
1880 PLA
1890 STA HEIGHT
1900 PHA
1910 INC TEMP2
1920 LDA FOODY
1930 JSR ERASE.VERT.BLOCKS
1940 PLA
1950 BEQ .8
1960 CPX #$07
1970 BEQ .8
1980 STA HEIGHT
1990 INC TEMP2
2000 LDA FOODY
2010 JSR ERASE.VERT.BLOCKS
2020 .8 LDA TABLE158,X
2030 STA FOODX
2040 STA FOODBYT1,X
2050 TXA
2060 ORA #$50
2070 STA TEMP4
2080 LDA TABLE160,X
2090 STA WIDTH
2100 LDA TABLE152,X
2110 STA HEIGHT
2120 LDA FOODX
2130 PHA
2140 LDA WIDTH
2150 PHA
2160 JSR CHECK.ROW
2170 PLA
2180 STA WIDTH
2190 PLA
2200 STA FOODX
2210 PHA
2220 LDA WIDTH
2230 PHA
2240 DEC HEIGHT
2250 JSR CHECK.ROW
2260 PLA
2270 STA WIDTH
2280 PLA
2290 STA FOODX
2300 DEC HEIGHT
2310 BEQ .9
2320 PHA
2330 LDA WIDTH
2340 PHA
2350 JSR CHECK.ROW
2360 PLA
2370 STA WIDTH
2380 PLA
2390 STA FOODX
2400 DEC HEIGHT
2410 BEQ .9
2420 PHA
2430 JSR CHECK.ROW
2440 PLA
2450 STA FOODX
2460 .9 LDA TEMP4
2470 AND #$07
2480 STA TEMP4
2490 TAX
2500 LDA FOODBYT2,X
2510 STA FOODY
2520 JSR PLOT.FOOD2.Z
2530 LDA #$81
2540 STA FOODBYT3,X
2550 LDA TABLE152,X
2560 STA HEIGHT
2570 LDY TABLE164,X
2580 .13 LDA TABLE165,Y
2590 STA DESTBYT1,Y
2600 LDA TABLE166,Y
2610 STA DESTBYT2,Y
2620 INY
2630 DEC HEIGHT
2640 BNE .13
2650 LDA #$00
2660 STA GRAB.FOOD
2670 STA BYFOOD
2680 CPX #$03
2690 BNE .14
2700 STA ANTPOSITIONS,X
2710 RTS
2720 .14 LDA #$04
2730 STA ANTPOSITIONS,X
2740 RTS
2750 CHECK.ROW
2760 LDX FOODY
2770 LDY FOODX
2780 LDA AAMSBYT,X
2790 STA POINTER1+1
2800 LDA AALSBYT,X
2810 STA POINTER1
2820 LDA (POINTER1),Y
2830 AND #$3F
2840 STA TEMP1
2850 CMP #$20
2860 BCS .1
2870 CMP #$08
2880 BCS .2
2890 .3 LDA TEMP4
2900 LDY FOODX
2910 STA (POINTER1),Y
2920 INC FOODX
2930 DEC WIDTH
2940 BNE CHECK.ROW
2950 INC FOODY
2960 RTS
2970 .1 AND #$1F
2980 PHA
2990 TAY
3000 LDA ANTBYT1,Y
3010 AND #$3F
3020 STA ANTX
3030 STA ANTXOLD
3040 LDA ANTBYT2,Y
3050 STA ANTY
3060 STA ANTYOLD
3070 LDA ANTBYT3,Y
3080 STA ANTXX
3090 STA ANTXXOLD
3100 JSR ERASE.ANT.Z
3110 JSR VACATE.ANTS.BLOCKS.Z
3120 PLA
3130 TAY
3140 LDA #$00
3150 STA ANTBYT1,Y
3160 BEQ .3
3170 .2 AND #$07
3180 PHA
3190 JSR ERASE.WEB.Z
3200 PLA
3210 TAY
3220 LDA #$00
3230 STA SPIDERBYT4,Y
3240 BEQ .3
3250 CHECK.VERT.BLOCKS
3260 .2 LDA AAMSBYT,X
3270 STA POINTER1+1
3280 LDA AALSBYT,X
3290 STA POINTER1
3300 LDA (POINTER1),Y
3310 AND #$BF
3320 BNE .1
3330 INX
3340 DEC HEIGHT
3350 BNE .2
3360 .1 RTS
3370 VACATE.COLUMN
3380 .1 LDA AAMSBYT,X
3390 STA POINTER1+1
3400 LDA AALSBYT,X
3410 STA POINTER1
3420 LDA (POINTER1),Y
3430 AND #$C0
3440 STA (POINTER1),Y
3450 INX
3460 DEC HEIGHT
3470 BNE .1
3480 RTS
3490 SET.COLUMN
3500 LDA TEMP4
3510 ORA #$10
3520 STA TEMP1
3530 .1 LDA AAMSBYT,X
3540 STA POINTER1+1
3550 LDA AALSBYT,X
3560 STA POINTER1
3570 LDA (POINTER1),Y
3580 AND #$C0
3590 ORA TEMP1
3600 STA (POINTER1),Y
3610 INX
3620 DEC HEIGHT
3630 BNE .1
3640 RTS
3650 ERASE.VERT.BLOCKS
3660 LDY TEMP2
3670 CPY #$2C
3680 BCS .1
3690 CPY #$04
3700 BCC .1
3710 ASL
3720 ASL
3730 ASL
3740 STA TEMP3
3750 TYA
3760 LSR
3770 BCS .2
3780 LDA #$AA
3790 BNE .3
3800 .2 LDA #$D5
3810 .3 CPY #$05
3820 BCC .4
3830 CPY #$2B
3840 BEQ .4
3850 CPY #$0B
3860 BCC .5
3870 CPY #$25
3880 BCC .4
3890 .5 AND #$7F
3900 .4 STA TEMP1
3910 .6 LDY TEMP3
3920 LDA (SCRPNT1),Y
3930 STA POINTER1+1
3940 CLC
3950 ADC #$60
3960 STA POINTER4+1
3970 LDA (SCRPNT2),Y
3980 STA POINTER1
3990 STA POINTER4
4000 LDY TEMP2
4010 LDA TEMP1
4020 STA (POINTER1),Y
4030 STA (POINTER4),Y
4040 INC TEMP3
4050 DEC HEIGHT
4060 BNE .6
4070 .1 RTS
4080 TABLE150 .HS D0CCCCC9D0B9B9C9
4090 TABLE151 .HS 8000009080010190
4100 TABLE152 .HS 0404030303030404
4110 TABLE153 .HS FFFFFF03FF020202
4120 TABLE154 .HS 2010101818101020
4130 TABLE155 .HS 020202FF03FFFFFF
4140 TABLE156 .HS 0905052508161625
4150 TABLE157 .HS 010101FF01FFFFFF
4160 TABLE158 .HS 0C0808210C131322
4170 TABLE159 .HS 0000000300000002
4180 TABLE160 .HS 0204030303030402
4190 TABLE161 .HS 0101010002000000
4200 TABLE164 .HS 0004080B0E111418
4210 TABLE165 .HS 8E8E8E8E919293949B9C9DA0A0A08F8F8F9293949B9C9D9EA1A1A1A1
4220 TABLE166 .HS 444C545C505450545054504C545C88909894909490949094889098A0
4230 TABLE167 .HS 010808FF01F8F8FF
4240 CHECK.HORIZ.BLOCKS
4250 .2 LDA AAMSBYT,X
4260 STA POINTER1+1
4270 LDA AALSBYT,X
4280 STA POINTER1
4290 LDA (POINTER1),Y
4300 AND #$BF
4310 BNE .1
4320 INY
4330 DEC WIDTH
4340 BNE .2
4350 .1 RTS
4360 VACATE.ROW
4370 .1 LDA AAMSBYT,X
4380 STA POINTER1+1
4390 LDA AALSBYT,X
4400 STA POINTER1
4410 LDA (POINTER1),Y
4420 AND #$C0
4430 STA (POINTER1),Y
4440 INY
4450 DEC WIDTH
4460 BNE .1
4470 RTS
4480 SET.ROW
4490 LDA TEMP4
4500 ORA #$10
4510 STA TEMP1
4520 .1 LDA AAMSBYT,X
4530 STA POINTER1+1
4540 LDA AALSBYT,X
4550 STA POINTER1
4560 LDA (POINTER1),Y
4570 AND #$C0
4580 ORA TEMP1
4590 STA (POINTER1),Y
4600 INY
4610 DEC WIDTH
4620 BNE .1
4630 RTS
4640 ERASE.HORIZ.BLOCKS
4650 TAY
4660 ASL
4670 ASL
4680 ASL
4690 STA TEMP3
4700 LDA FOODX
4710 LSR
4720 BCS .2
4730 LDA #$AA
4740 BNE .3
4750 .2 LDA #$D5
4760 .3 CPY #$04
4770 BCC .4
4780 CPY #$19
4790 BCS .4
4800 CPY #$07
4810 BCC .5
4820 CPY #$16
4830 BCC .4
4840 .5 AND #$7F
4850 .4 STA TEMP1
4860 LDA #$08
4870 STA HEIGHT
4880 .1 LDY TEMP3
4890 LDA (SCRPNT1),Y
4900 STA POINTER1+1
4910 CLC
4920 ADC #$60
4930 STA POINTER4+1
4940 LDA (SCRPNT2),Y
4950 STA POINTER1
4960 STA POINTER4
4970 LDY FOODX
4980 LDA TEMP1
4990 STA (POINTER1),Y
5000 STA (POINTER4),Y
5010 INY
5020 EOR #$7F
5030 STA (POINTER1),Y
5040 STA (POINTER4),Y
5050 INY
5060 EOR #$7F
5070 STA (POINTER1),Y
5080 STA (POINTER4),Y
5090 LDX TEMP4
5100 CPX #$02
5110 BEQ .6
5120 CPX #$05
5130 BEQ .6
5140 INY
5150 EOR #$7F
5160 STA (POINTER1),Y
5170 STA (POINTER4),Y
5180 .6 INC TEMP3
5190 DEC HEIGHT
5200 BNE .1
5210 RTS
5220 CARRY.VERT
5230 BEQ .3
5240 LDA MANSTATE
5250 CMP #$0B
5260 BNE .4
5270 LDA #$02
5280 STA MANSTATE
5290 .4 LDA MANY
5300 AND #$07
5310 BEQ .5
5320 CMP #$04
5330 BEQ .5
5340 .8 RTS
5350 .3 LDA MANSTATE
5360 CMP #$0C
5370 BNE .4
5380 LDA #$04
5390 STA MANSTATE
5400 BNE .4
5410 .5 LDA TABLE152,X
5420 STA WIDTH
5430 LDA FOODBYT1,X
5440 STA FOODX
5450 TAY
5460 LDA FOODBYT2,X
5470 STA FOODY
5480 CLC
5490 ADC TABLE155,X
5500 TAX
5510 JSR CHECK.HORIZ.BLOCKS
5520 BNE .8
5530 LDX TEMP4
5540 LDA FOODY
5550 CMP TABLE156,X
5560 BEQ .6
5570 CLC
5580 ADC TABLE157,X
5590 STA FOODBYT2,X
5600 STA FOODY
5610 JSR PLOT.FOOD2.Z
5620 LDA TABLE152,X
5630 STA WIDTH
5640 LDA FOODY
5650 CLC
5660 ADC TABLE153,X
5670 TAX
5680 LDY FOODX
5690 JSR VACATE.ROW
5700 LDX TEMP4
5710 LDA TABLE152,X
5720 STA WIDTH
5730 LDY FOODX
5740 LDA FOODY
5750 CLC
5760 ADC TABLE161,X
5770 TAX
5780 JSR SET.ROW
5790 LDX TEMP4
5800 LDA FOODY
5810 CLC
5820 ADC TABLE153,X
5830 JSR ERASE.HORIZ.BLOCKS
5840 LDA TABLE167,X
5850 JMP UPDATE.VERT.DESTBYTS2.Z
5860 .6 LDA TABLE152,X
5870 EXT1
5880 STA WIDTH
5890 STA TEMP1
5900 LDX FOODY
5910 LDY FOODX
5920 JSR VACATE.ROW
5930 INX
5940 LDY FOODX
5950 LDA TEMP1
5960 STA WIDTH
5970 JSR VACATE.ROW
5980 LDA FOODY
5990 JSR ERASE.HORIZ.BLOCKS
6000 LDY FOODY
6010 INY
6020 TYA
6030 JSR ERASE.HORIZ.BLOCKS
6040 LDX TEMP4
6050 LDA TABLE158,X
6060 STA FOODY
6070 STA FOODBYT2,X
6080 LDA TABLE160,X
6090 STA WIDTH
6100 PHA
6110 LDA FOODX
6120 PHA
6130 LDA TEMP4
6140 ORA #$50
6150 STA TEMP4
6160 JSR CHECK.ROW
6170 PLA
6180 STA FOODX
6190 PLA
6200 STA WIDTH
6210 LDA FOODX
6220 PHA
6230 JSR CHECK.ROW
6240 PLA
6250 STA FOODX
6260 DEC FOODY
6270 LDA TEMP4
6280 AND #$07
6290 STA TEMP4
6300 TAX
6310 LDA TABLE158,X
6320 STA FOODY
6330 JSR PLOT.FOOD2.Z
6340 LDA #$81
6350 STA FOODBYT3,X
6360 LDA TABLE152,X
6370 STA WIDTH
6380 LDY TABLE164,X
6390 .13 LDA TABLE165,Y
6400 STA DESTBYT1,Y
6410 LDA TABLE166,Y
6420 STA DESTBYT2,Y
6430 INY
6440 DEC WIDTH
6450 BNE .13
6460 LDA #$00
6470 STA GRAB.FOOD
6480 STA BYFOOD
6490 STA ANTPOSITIONS,X
6500 .LI ON
6510 RTS
6520 .LI OFF