home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_26_1988_Transactor_Publishing.d64
/
v.src
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
2KB
|
64 lines
10 rem save"v.src",8
20 sys700
30 *=49152
40 .opt oo
50 getin = $ffe4
60 random = $d41b
70 ;
80 ; ----------
90 jsr gmode; turn on graphics mode
100 jsr initvote; initialize voters
110 jsr campaign; randomly change votes
120 jsr gmode; back to text mode
130 rts
140 ;
150 ; ----------
160 gmode = *
170 lda $d011; scroly
180 eor #%00100000; flip bit 5
190 sta $d011; toggle graphics mode on/off
200 lda $d018; vmcsb
210 eor #%00001100; toggle bits
220 sta $d018; toggle base addresses
230 rts
240 ;
250 ; ----------
260 initvote = *
270 jsr rndinit; crank up the noisy sid voice
280 jsr fill; fill the color bytes
290 jsr choose; the voters randomly choose a color
300 rts
310 ;
320 rndinit = *
330 lda #$ff:sta $d40f; max hi frequency
340 lda #$80:sta $d412; noise waveform
350 sta $d418; volume off and no output for voice 3
360 rts
370 ;
380 fill = *
390 lda #$61; foreground 6 (blue) and background 1 (white)
400 ldy #250
410 col0 = 1024
420 col1 = col0 + 250
430 col2 = col1 + 250
440 col3 = col2 + 250
450 lpfill dey; note that this sets the zero flag
460 sta col0,y:sta col1,y:sta col2,y:sta col3,y
470 bne lpfill:rts
480 ;
490 choose = *
500 bitmap = $2000
510 ldx #32; 32 pages of 256 bytes = 8192
520 ldy #0
530 lda #<bitmap:sta selfmod+1:lda #>bitmap:sta selfmod+2; set up the address
540 lpchoose lda random
550 selfmod sta $ffff,y; this isn't the real address
560 iny; count forward
570 bne lpchoose; until .y wraps
580 inc selfmod+2:dex:bne lpchoose; and repeat a total of 32 times
590 rts; and that's all
600 ;
610 ; ----------
620 campaign jsr getin:beq campaign
630 rts