home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1989 July / 64er_Magazin_89-07_1989_Markt__Technik_de_Side_A.d64 / plot.src (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  4KB  |  118 lines

  1. 4 open1,8,2,"plot.obj,p,w"
  2. 10 sys9*4096:.opt o1:*=$c000
  3. 15 .asc "program:"
  4. 20 zp1 = 251:zp2 = 252:zp3 = 253:zp4 = 254
  5. 22 lo = 167:hi = 168
  6. 24 cl0 = 53281:cl1 = 53282
  7. 25 cl2 = 53283:cl3 = 53284
  8. 30 frmnum = $ad8a:ckcom = $aefd
  9. 700 jmp plot; plot-command
  10. 702 jmp l960; punkt setzen aus line etc
  11. 704 jmp adr2; byte setzen
  12. 800 ; *** eingaben ***
  13. 810 plot jsr frmnum:jsr $bc9b:lda $65:sta xl:lda $64:sta xh
  14. 830 jsr $e200:stx yb:jsr $e200:stx modus:jmp l968
  15. 952 ; *** einsprung aus line etc **
  16. 954 ; *** daten in a,x,y,stack **
  17. 960 l960 sta xl:stx xh:sty yb:pla:sta modus
  18. 964 ; *** hgr oder multi-plot ***
  19. 968 l968 lda 53270:and #16:beq l1412:jmp mcplot
  20. 970 l1412 jmp hgrplot
  21. 1000 ; adresse berechnen
  22. 1001 ;
  23. 1003 adr2 sta xl:stx xh:sty yb:pla:sta modus:pla:sta byte:jsr adresse
  24. 1005 lda 53270:and #16:beq l1006:jmp mcpoint
  25. 1006 l1006 jmp hgrpoint
  26. 1009 ; aus plot-command
  27. 1010 adresse lda 53270:and #16:beq l336
  28. 1015 asl xl:rol xh
  29. 1020 l336 lda yb:and #248:lsr a:lsr a:tay
  30. 1025 lda xl:and #248:clc:adc tab320,y:sta zp1:lda yb:and #7:ora zp1:sta zp1
  31. 1030 php:lda 56576:and #3:eor #3:clc:ror:ror:ror:ora #32:plp
  32. 1035 adc xh:adc tab320+1,y:sta zp2
  33. 1040 lda 53270:and #16:beq l1350:lsr xh:ror xl
  34. 1045 l1350 rts
  35. 1100 ; *** byte aus ram holen ***
  36. 1102 ; **************************
  37. 1110 getpeek sei:lda #$34:sta 1:ldy #0:lda (zp1),y:ldx #$37:stx 1:cli:rts
  38. 1300 ; ****************
  39. 1302 ; *** hgr-plot ***
  40. 1310 hgrplot jsr adresse:lda xl:and #7:tax
  41. 1320 ldy #0:lda werttab,x:sta byte
  42. 1370 ; ************
  43. 1380 ; punkt setzen
  44. 1390 hgrpoint jsr colour
  45. 1400 l356 jsr getpeek:ldy modus:beq mod0:dey:beq mod1:dey:beq mod2:rts
  46. 1410 mod0 sta peek:lda byte:eor #255:and peek:sta (zp1),y:rts
  47. 1420 mod1 ora byte:sta (zp1),y:rts
  48. 1430 mod2 eor byte:sta (zp1),y:rts
  49. 1440 ; farbram zu punkt setzen
  50. 1450 ; ***********************
  51. 1460 colour lda zp2:and #31:sta zp4:lda zp1
  52. 1470 lsr zp4:ror a:lsr zp4:ror a:lsr zp4:ror a:sta zp3
  53. 1480 lda 56576:and #3:eor #3:clc:ror:ror:ror:ora #8:clc:adc zp4:sta zp4
  54. 1490 ldy #0:lda modus:bne l1495
  55. 1492 lda cl0:and #15:sta var:lda (zp3),y:and #240:ora var:sta (zp3),y:rts
  56. 1495 l1495 lda cl1:asl a:asl a:asl a:asl a:sta var
  57. 1496 lda (zp3),y:and #15:ora var:sta (zp3),y:rts
  58. 1600 ; ******************
  59. 1605 ; *** multi plot ***
  60. 1610 mcplot jsr adresse:lda xl:and #3:tay:lda werttab+4,y:sta byte
  61. 1615 ; *** multicolor point setzen ***
  62. 1620 mcpoint lda byte:tay:lda mtab,y:sta byte
  63. 1625 sei:ldx #$35:stx 1:ldy modus:bne l432:;farbe0
  64. 1630 eor #$ff:and (zp1),y:sta (zp1),y:jmp l444
  65. 1635 l432 dey:bne l436;farbe1
  66. 1640 eor #$ff:and (zp1),y:sta peek
  67. 1645 lda byte:and #$55:ora peek:sta (zp1),y:jmp l444
  68. 1650 l436 dey:bne l440;farbe2
  69. 1655 eor #$ff:and (zp1),y:sta peek
  70. 1660 lda byte:and #$aa:ora peek:sta (zp1),y:jmp l444
  71. 1665 l440 dey:bne l452;farbe3
  72. 1670 ora (zp1),y:sta (zp1),y:jmp l444
  73. 1685 ; *** inverse mc ***
  74. 1690 l452 ldx #4
  75. 1695 l458 lda byte:and invtab,x:beq l460:jsr l480
  76. 1700 l460 dex:bne l458:jmp l491
  77. 1705 l480 ldy #0:eor #$ff:and (zp1),y:sta peek
  78. 1710 lda (zp1),y:and invtab,x:clc:adc #$55:and invtab,x:sta modus
  79. 1715 ora peek:sta peek
  80. 1720 lda modus:lsr a:lsr a:ora modus:lsr a:lsr a:ora modus:lsr a:lsr a
  81. 1725 ora modus:and #3:sta modus:jsr mcfarbe:l487 lda #4:sta modus
  82. 1730 lda peek:sta (zp1),y:rts
  83. 1740 ; *** mcplot verlassen ***
  84. 1745 l444 jsr mcfarbe
  85. 1750 l491 lda #$37:sta 1:cli:rts
  86. 1755 ; *************************
  87. 1760 ; *** mc farbram setzen ***
  88. 1765 ; *************************
  89. 1770 mcfarbe ldy modus:beq l1722:lda zp2:and #31:sta zp3+1:lda zp1
  90. 1775 lsr zp3+1:ror a:lsr zp3+1:ror a:lsr zp3+1:ror a:sta zp3
  91. 1780 lda 56576:and #3:eor #3:clc:ror:ror:ror:ora #8:ora zp3+1:sta zp3+1
  92. 1785 ldy modus:dey:beq c1:dey:beq c2:dey:beq c3:ldy #0:rts
  93. 1790 c1 lda (zp3),y:and #15:sta var:lda cl1:asl a:asl a:asl a:asl a
  94. 1795 ora var:sta (zp3),y:rts
  95. 1800 c2 lda cl2:and #15:sta var:lda (zp3),y:and #240:ora var:sta (zp3),y:rts
  96. 1805 c3 lda zp3+1:and #3:ora #$d8:sta zp3+1:lda cl3:sta (zp3),y
  97. 1810 l1722 rts
  98. 1814 ; ****************
  99. 1815 ; *** tabellen ***
  100. 1819 .byte $ff
  101. 1820 tab320 .word 0,320,640,960,1280,1600,1920
  102. 1822 .word 2240,2560,2880,3200,3520,3840,4160
  103. 1823 .word 4480,4800,5120,5440,5760,6080
  104. 1824 .word 6400,6720,7040,7360,7680
  105. 1830 werttab .byte 128,64,32,16,8,4,2,1
  106. 1840 mtab .byte 0,3,12,15,48,51,60
  107. 1842 .byte 63,192,195,204,207,240,243,252,255
  108. 1850 invtab .byte 0,192,48,12,3
  109. 2000 ; local variable
  110. 2002 byte .byte 0
  111. 2003 peek .byte 0
  112. 2005 modus .byte 0
  113. 2006 xl .byte 0
  114. 2007 xh .byte 0
  115. 2008 yb .byte 0
  116. 2009 var .byte 0
  117. 2100 .end:close1
  118.