antoine-source/picnicparanoia/source copie/ANT@@ F.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

431 lines
9.7 KiB
Plaintext

0010 .LI OFF
0020 ANTBYT1 .EQ $1000
0030 ANTBYT2 .EQ $1020
0040 ANTBYT3 .EQ $1040
0050 ANTBYT4 .EQ $1060
0060 DESTBYT1 .EQ $1080
0070 DESTBYT2 .EQ $10A0
0080 AAMSBYT .EQ $10C0
0090 AALSBYT .EQ $10E0
0100 ANTDIR .EQ $E0
0110 ANTMOV1 .EQ $DF
0120 ANTMOV3 .EQ $DE
0130 ANTDEST .EQ $DD
0140 ANTX .EQ $DC
0150 ANTY .EQ $DB
0160 ANTXX .EQ $DA
0170 ANTYY .EQ $D9
0180 ANTNUM .EQ $D8
0190 ANTCOUNT .EQ $D7
0200 ANTORIENT .EQ $D6
0210 ANTXOLD .EQ $D5
0220 ANTYOLD .EQ $D4
0230 ANTXXOLD .EQ $D3
0240 ANTYYOLD .EQ $D2
0250 TEMP1 .EQ $F0
0260 TEMP2 .EQ $F1
0270 TEMP3 .EQ $F2
0280 TEMP5 .EQ $94
0290 TEMPRND .EQ $8B
0300 RNDBYTE1 .EQ $F3
0310 RNDBYTE2 .EQ $F4
0320 SCRPNT1 .EQ $F5
0330 SCRPNT2 .EQ $F7
0340 POINTER1 .EQ $F9
0350 POINTER2 .EQ $FB
0360 POINTER3 .EQ $FD
0370 POINTER4 .EQ $EE
0380 HEIGHT .EQ $ED
0390 PATINDEX .EQ $EC
0400 K1 .EQ $D1
0410 INIT.K1 .EQ $D0
0420 K2 .EQ $CF
0430 INIT.K2 .EQ $CE
0440 COUNT4ANTS .EQ $CD
0450 ANTMOV4 .EQ $CC
0460 MAN.INITIALIZE.Z .EQ $4603
0470 WASP.INITIALIZE.Z .EQ $5803
0480 MOVE.4.ANTS.Z .EQ $10E3
0490 SPIDER.INITIALIZE.Z .EQ $6000
0500 FOOD.INITIALIZE.Z .EQ $6950
0510 .OR $1700
0520 JMP SET.BLOCK.VACANT
0530 JMP PLOT.ANT.4
0540 JMP RANDOM1
0550 JMP RANDOM2
0560 JMP PLOT.ANT.2
0570 JMP ERASE.ANT
0580 JMP PLOT.ANT
0590 JMP GET.BLOCK
0600 JMP SET.BLOCK.ANT
0610 JMP PICK.DEST
0620 JMP CREATE.ANT
0630 GET.BLOCK
0640 LDY ANTX
0650 LDA ANTY
0660 LSR
0670 LSR
0680 LSR
0690 TAX
0700 LDA AALSBYT,X
0710 STA POINTER3
0720 LDA AAMSBYT,X
0730 STA POINTER3+1
0740 LDA (POINTER3),Y
0750 RTS
0760 SET.BLOCK.VACANT
0770 JSR GET.BLOCK
0780 AND #$C0
0790 STA (POINTER3),Y
0800 RTS
0810 SET.BLOCK.ANT
0820 JSR GET.BLOCK
0830 AND #$C0
0840 ORA #$20
0850 ORA ANTNUM
0860 STA (POINTER3),Y
0870 RTS
0880 PLOT.ANT
0890 LDA ANTDIR
0900 BEQ PLOT.ANT.2
0910 BPL .2
0920 ROL
0930 BMI .3
0940 LDA #$20
0950 BNE PLOT.ANT.2
0960 .2 LDA #$60
0970 BNE PLOT.ANT.2
0980 .3 LDA #$40
0990 PLOT.ANT.2
1000 LDY #$08
1010 STY POINTER1+1
1020 LDY ANTORIENT
1030 BPL PLOT.ANT.3
1040 CLC
1050 ADC #$10
1060 PLOT.ANT.3
1070 STA POINTER1
1080 PLOT.ANT.4
1090 LDX ANTXX
1100 LDA #$08
1110 STA HEIGHT
1120 LDA #$00
1130 STA PATINDEX
1140 .11 LDY ANTY
1150 LDA (SCRPNT1),Y
1160 STA POINTER2+1
1170 LDA (SCRPNT2),Y
1180 STA POINTER2
1190 LDY ANTX
1200 CPY #$2C
1210 BCS .7
1220 CPY #$04
1230 BCC .7
1240 LDA (POINTER2),Y
1250 STA TEMP1
1260 LDY PATINDEX
1270 LDA (POINTER1),Y
1280 STA TEMP2
1290 INY
1300 LDA (POINTER1),Y
1310 LDY TABLE2,X
1320 BEQ .6
1330 .5 SEC
1340 ROL
1350 ASL TEMP2
1360 DEY
1370 BNE .5
1380 .6 ORA #$80
1390 AND TEMP1
1400 STA TEMP1
1410 LDA TEMP2
1420 AND #$7F
1430 ORA TEMP1
1440 LDY ANTX
1450 STA (POINTER2),Y
1460 .7 INY
1470 CPY #$2C
1480 BCS .10
1490 CPY #$04
1500 BCC .10
1510 LDA (POINTER2),Y
1520 STA TEMP1
1530 LDY PATINDEX
1540 LDA (POINTER1),Y
1550 STA TEMP2
1560 INY
1570 LDA (POINTER1),Y
1580 LDY TABLE4,X
1590 .8 SEC
1600 ROR
1610 LSR TEMP2
1620 DEY
1630 BNE .8
1640 AND TEMP1
1650 STA TEMP1
1660 LDA TEMP2
1670 AND #$7F
1680 ORA TEMP1
1690 LDY ANTX
1700 INY
1710 STA (POINTER2),Y
1720 .10 INC ANTY
1730 INC PATINDEX
1740 INC PATINDEX
1750 DEC HEIGHT
1760 BNE .11
1770 LDA ANTY
1780 SEC
1790 SBC #$08
1800 STA ANTY
1810 RTS
1820 ERASE.ANT
1830 LDA #$08
1840 STA HEIGHT
1850 LDX ANTXXOLD
1860 .3 LDY ANTYOLD
1870 LDA (SCRPNT1),Y
1880 STA POINTER3+1
1890 CLC
1900 ADC #$60
1910 STA POINTER4+1
1920 LDA (SCRPNT2),Y
1930 STA POINTER3
1940 STA POINTER4
1950 LDY ANTXOLD
1960 CPY #$2C
1970 BCS .1
1980 CPY #$04
1990 BCC .1
2000 LDA (POINTER3),Y
2010 AND TABLE1,X
2020 STA TEMP5
2030 LDA TABLE1,X
2040 EOR #$FF
2050 AND (POINTER4),Y
2060 ORA TEMP5
2070 STA (POINTER3),Y
2080 .1 INY
2090 CPY #$2C
2100 BCS .2
2110 CPY #$04
2120 BCC .2
2130 LDA (POINTER3),Y
2140 AND TABLE3,X
2150 STA TEMP5
2160 LDA TABLE3,X
2170 EOR #$FF
2180 AND (POINTER4),Y
2190 ORA TEMP5
2200 STA (POINTER3),Y
2210 .2 INC ANTYOLD
2220 DEC HEIGHT
2230 BNE .3
2240 RTS
2250 CREATE.ANT
2260 DEC K2
2270 BEQ .1
2280 .3 RTS
2290 .1 LDA INIT.K2
2300 STA K2
2310 LDA #$01
2320 STA TEMP3
2330 LDY #$20
2340 .2 DEY
2350 BMI .3
2360 LDA ANTBYT1,Y
2370 BNE .2
2380 JSR PICK.DEST
2390 JSR RANDOM2
2400 CMP #$C0
2410 BCS .9
2420 CMP #$80
2430 BCS .10
2440 CMP #$40
2450 BCS .11
2460 LDA #$03
2470 STA ANTBYT3,Y
2480 LDA #$EB
2490 STA ANTBYT1,Y
2500 LDA #$2B
2510 STA TEMP2
2520 BNE .12
2530 .9 LDA #$01
2540 STA ANTBYT3,Y
2550 LDA #$43
2560 STA ANTBYT1,Y
2570 LDA #$04
2580 STA TEMP2
2590 BNE .12
2600 .10 LDA #$D0
2610 STA ANTBYT2,Y
2620 JSR PICKX
2630 STA TEMP2
2640 STA ANTBYT1,Y
2650 ROR
2660 LDA #$00
2670 BCS .15
2680 LDA #$04
2690 .15 STA ANTBYT3,Y
2700 LDA #$1A
2710 BNE .16
2720 .11 LDA #$10
2730 STA ANTBYT2,Y
2740 JSR PICKX
2750 STA TEMP2
2760 ORA #$80
2770 STA ANTBYT1,Y
2780 ROR
2790 LDA #$00
2800 BCS .17
2810 LDA #$04
2820 .17 STA ANTBYT3,Y
2830 LDA #$02
2840 BNE .16
2850 .12 JSR RANDOM2
2860 CMP #$C0
2870 BCS .18
2880 CMP #$20
2890 BCS .13
2900 .18 JSR RANDOM1
2910 CMP #$C0
2920 BCS .12
2930 CMP #$20
2940 BCC .12
2950 .13 AND #$F8
2960 STA ANTBYT2,Y
2970 LSR
2980 LSR
2990 LSR
3000 .16 TAX
3010 LDA AAMSBYT,X
3020 STA POINTER1+1
3030 LDA AALSBYT,X
3040 STA POINTER1
3050 STY TEMP1
3060 LDY TEMP2
3070 LDA (POINTER1),Y
3080 AND #$BF
3090 BEQ .14
3100 LDY TEMP1
3110 LDA #$00
3120 STA ANTBYT1,Y
3130 RTS
3140 .14 LDA TEMP1
3150 ORA #$20
3160 ORA (POINTER1),Y
3170 STA (POINTER1),Y
3180 RTS
3190 PICKX
3200 JSR RANDOM2
3210 AND #$3F
3220 CLC
3230 ADC #$05
3240 CMP #$2B
3250 BCC .1
3260 JSR RANDOM1
3270 AND #$3F
3280 CLC
3290 ADC #$05
3300 CMP #$2B
3310 BCS PICKX
3320 .1 RTS
3330 RANDOM1
3340 STX TEMPRND
3350 LDA #$20
3360 TAX
3370 BIT RNDBYTE1
3380 BVC .1
3390 BEQ .5
3400 INX
3410 .1 BEQ .2
3420 .5 INX
3430 .2 LDA #$08
3440 BIT RNDBYTE1
3450 BEQ .3
3460 INX
3470 .3 LDA #$01
3480 BIT RNDBYTE1
3490 BEQ .4
3500 INX
3510 .4 TXA
3520 ROR
3530 ROR RNDBYTE1
3540 LDX TEMPRND
3550 LDA RNDBYTE1
3560 RTS
3570 PICK.DEST
3580 JSR RANDOM1
3590 AND #$1F
3600 CMP #$1C
3610 BCC .4
3620 .6 JSR RANDOM2
3630 AND #$1F
3640 CMP #$1C
3650 BCS PICK.DEST
3660 .4 TAX
3670 .8 LDA DESTBYT1,X
3680 BMI .7
3690 .20 INX
3700 INX
3710 INX
3720 CPX #$1C
3730 BCC .8
3740 JSR RANDOM1
3750 AND #$03
3760 BPL .4
3770 .7 AND #$40
3780 BEQ .19
3790 DEC TEMP3
3800 BPL .20
3810 .19 TXA
3820 ORA #$20
3830 STA ANTBYT4,Y
3840 RTS
3850 TABLEDEST1 .HS 8E8E8E8E919293949B9C9DA0A0A08F8F8F9293949B9C9D9EA1A1A1A1
3860 TABLEDEST2 .HS 444C545C505450545054504C545C88909894909490949094889098A0
3870 TABLE1 .HS 80838FBF81879F
3880 TABLE2 .HS 00020406010305
3890 TABLE3 .HS FEF8E080FCF0C0
3900 TABLE4 .HS 07050301060402
3910 TABLE8 .HS 2020202000000000000000B0B0B0A0A0A01010101010101030303030
3920 .LI ON
3930 TABLE9 .HS 01010101000100010001000000000000000100010001000100000000
3940 .LI OFF
3950 .OR $1080
3960 .HS 8E8E8E8E919293949B9C9DA0A0A08F8F8F9293949B9C9D9EA1A1A1A1
3970 .OR $10A0
3980 .HS 444C545C505450545054504C545C88909894909490949094889098A0
3990 .OR $10C0
4000 .HS 1A1A1A1B1B1B1B1B1C1C1C1C1C1D1D1D1D1D1D1E1E1E1E1E1F1F1F1F1F
4010 .OR $10E0
4020 .HS 90C0F0205080B0E0104070A0D000306090C0F0205080B0E0104070A0D0
4030 .OR $5E8A
4040 .TA $1E8A
4050 RANDOM2
4060 STX TEMPRND
4070 LDA #$20
4080 TAX
4090 BIT RNDBYTE2
4100 BVC .1
4110 BEQ .5
4120 INX
4130 .1 BEQ .2
4140 .5 INX
4150 .2 LDA #$08
4160 BIT RNDBYTE2
4170 BEQ .3
4180 INX
4190 .3 LDA #$01
4200 BIT RNDBYTE2
4210 BEQ .4
4220 INX
4230 .4 TXA
4240 ROR
4250 ROR RNDBYTE2
4260 LDX TEMPRND
4270 LDA RNDBYTE2
4280 .LI ON
4290 RTS
4300 .LI OFF