home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_26_1988_Transactor_Publishing.d64 / v.src (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  2KB  |  64 lines

  1. 10 rem save"v.src",8
  2. 20 sys700
  3. 30 *=49152
  4. 40 .opt oo
  5. 50 getin = $ffe4
  6. 60 random = $d41b
  7. 70 ;
  8. 80 ; ----------
  9. 90 jsr gmode; turn on graphics mode
  10. 100 jsr initvote; initialize voters
  11. 110 jsr campaign; randomly change votes
  12. 120 jsr gmode; back to text mode
  13. 130 rts
  14. 140 ;
  15. 150 ; ----------
  16. 160 gmode = *
  17. 170 lda $d011; scroly
  18. 180 eor #%00100000; flip bit 5
  19. 190 sta $d011; toggle graphics mode on/off
  20. 200 lda $d018; vmcsb
  21. 210 eor #%00001100; toggle bits
  22. 220 sta $d018; toggle base addresses
  23. 230 rts
  24. 240 ;
  25. 250 ; ----------
  26. 260 initvote = *
  27. 270 jsr rndinit; crank up the noisy sid voice
  28. 280 jsr fill; fill the color bytes
  29. 290 jsr choose; the voters randomly choose a color
  30. 300 rts
  31. 310 ;
  32. 320 rndinit = *
  33. 330 lda #$ff:sta $d40f; max hi frequency
  34. 340 lda #$80:sta $d412; noise waveform
  35. 350 sta $d418; volume off and no output for voice 3
  36. 360 rts
  37. 370 ;
  38. 380 fill = *
  39. 390 lda #$61; foreground 6 (blue) and background 1 (white)
  40. 400 ldy #250
  41. 410 col0 = 1024
  42. 420 col1 = col0 + 250
  43. 430 col2 = col1 + 250
  44. 440 col3 = col2 + 250
  45. 450 lpfill dey; note that this sets the zero flag
  46. 460 sta col0,y:sta col1,y:sta col2,y:sta col3,y
  47. 470 bne lpfill:rts
  48. 480 ;
  49. 490 choose = *
  50. 500 bitmap = $2000
  51. 510 ldx #32; 32 pages of 256 bytes = 8192
  52. 520 ldy #0
  53. 530 lda #<bitmap:sta selfmod+1:lda #>bitmap:sta selfmod+2; set up the address
  54. 540 lpchoose lda random
  55. 550 selfmod sta $ffff,y; this isn't the real address
  56. 560 iny; count forward
  57. 570 bne lpchoose; until .y wraps
  58. 580 inc selfmod+2:dex:bne lpchoose; and repeat a total of 32 times
  59. 590 rts; and that's all
  60. 600 ;
  61. 610 ; ----------
  62. 620 campaign jsr getin:beq campaign
  63. 630 rts
  64.