home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_26_1988_Transactor_Publishing.d64 / box.pal (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  1KB  |  73 lines

  1. 100 sys 700 ;pal 64
  2. 110 .opt oo
  3. 120 ; "box"
  4. 130 ; draws a box given left edge,
  5. 140 ; top edge, width and height
  6. 150 ; in "xd", "yd", "lx", "hi".
  7. 160 ; character in "boxchr".
  8. 170 ;
  9. 180 box =*
  10. 190 lda #"[147]"
  11. 200 jsr $ffd2 ;optional clear
  12. 210 box1l =*
  13. 220 ldx yd
  14. 230 ldy xd
  15. 240 clc
  16. 250 jsr $fff0 ;position cursor
  17. 260 ldx #0
  18. 270 box3l =*
  19. 280 lda boxchr
  20. 290 jsr $ffd2 ;print char
  21. 300 inx
  22. 310 cpx lx
  23. 320 bne box3l
  24. 330 ldx #1
  25. 340 box4l =*
  26. 350 lda #"[157]"
  27. 360 jsr $ffd2
  28. 370 lda #""
  29. 380 jsr $ffd2
  30. 390 lda boxchr
  31. 400 jsr $ffd2
  32. 410 inx
  33. 420 cpx hi
  34. 430 bne box4l
  35. 440 ldx #1
  36. 450 box5l =*
  37. 460 lda #"[157]"
  38. 470 jsr $ffd2
  39. 480 inx
  40. 490 cpx lx
  41. 500 bne box5l
  42. 510 ldx #1
  43. 520 box6l =*
  44. 530 lda #"[145]"
  45. 540 jsr $ffd2
  46. 550 inx
  47. 560 cpx hi
  48. 570 bne box6l
  49. 580 ldx #1
  50. 590 box7l =*
  51. 600 lda #"[157]"
  52. 610 jsr $ffd2
  53. 620 lda #""
  54. 630 jsr $ffd2
  55. 640 lda boxchr
  56. 650 jsr $ffd2
  57. 660 inx
  58. 670 cpx hi
  59. 680 bne box7l
  60. 690 ldx #1
  61. 700 box8l =*
  62. 710 lda boxchr
  63. 720 jsr $ffd2
  64. 730 inx
  65. 740 cpx lx
  66. 750 bne box8l
  67. 760 rts
  68. 770 lx .byte 15 ;width
  69. 790 hi .byte 10 ;height
  70. 800 xd .byte 0  ;distance x from side
  71. 810 yd .byte 0  ;distance y from top
  72. 820 boxchr .asc "*";char used
  73.