Classic Computer Magazine Archive PROGRAM LISTING: 83-07/TALK.ASM


20  *= $600
30  PLA PULL OFF DUMMY ARG COUNT
40  LDA #$08
50  STA $D01F INIT SWITCHES
60 M1 LDA $D01F GET VALUE
70  AND #$01 ?START PRESSED
80  BNE M1 NOT YES
90  LDY #$FF DELAY
0100 M2 LDX #$FF SOME
0110  JSR DEL GO LOOP
0120  DEY
0130  BNE M2
0140  LDA #$08  RESET
0150  STA $D01F START SWITCH
0160  LDX 208   GET PARM
0170  CPX #0 ?PLAYBACK
0180  BNE NP NO
0190  JMP PB GO PLAY BACK SOUND
0200 NP LDA #0
0210  STA $D400 KILL DMA
0220  STA $D40E KILL VBI
0230 MD STA $D40A WSYNC
0240  STA $D40A WSYNC
0250 DONE LDX 207
0260  JSR DEL GO WAIT IF NEED BE
0270  LDA $D204 GET INPUT BYTE
0280 GO LDX #$13
0290  STX $D20F TURN OFF FAST SCAN
0300  LDX #$17
0310  STX $D40A WSYNC
0320  STX $D20F SAY FAST POT SCAN
0330  STX $D20B START SCAN
0340  LDX FLAG
0350  CPX #0 ?LEFT HALF OF BYTE
0360  BNE RT NO
0370  AND #$F0
0380  STA BYTE SAVE IT
0390  ROR A
0400  ROR A
0410  ROR A
0420  ROR A
0430  AND #$0F
0440  ORA #$10 SAY USE 4 BIT D/A
0450  STA $D201 ECHO TO SPEAKER
0460  INC FLAG SAY RIGHT NEXT
0470  JMP MD
0480 RT ROR A
0490  ROR A
0500  ROR A
0510  ROR A
0520  AND #$0F
0530  ORA #$10 SAY USE 4 BIT D/A
0540  STA $D201 SAY SOMETHING
0550  AND #$0F REMOVE TOP 4 BITS
0560  ORA BYTE ADD IN LEFT NIBBLE
0570  DEC FLAG SAY LEFT NEXT
0580  LDY #0
0590  STA (205),Y SAVE TO BYTE
0600  LDA $D01F
0610  AND #$01 ?START KEY
0620  BEQ FINI YES
0630 D3 INC 205 INCREMENT
0640  BNE MD BUFFER
0650  INC 206 AREA
0660  LDX 206 POINTER
0670  CPX 209 ?END OF MEMORY
0680  BNE MD  NO CONTINUE
0690  JMP FINI GO FINISH THINGS
0700 DEL DEX
0710  BNE DEL
0720  RTS
0730 FINI LDA 208 ?TALK A LOT
0740  CMP #2 ?HUH
0750  BNE FINI1 NO, JUST RETURN
0760  LDA #0 RESET
0770  STA 205 BUFFER
0780  LDA #64 START
0790  STA 206 POINTERS
0800  JMP NP AND DO IT AGAIN
0810 FINI1 LDA #$40
0820  STA $D40E RESTART VBI'S
0830  LDA #$22 AND SCREEN DMA
0840  STA $D400
0850  RTS
0860 PB LDA #0
0870  STA $D40E KILL VBI
0880  STA $D400 KILL DMA
0890 PB1 LDX 207 GET DELAY COUNT
0900  JSR DEL
0910  LDY #0
0920  LDA (203),Y GET SOME DATA
0930  TAX
0940  ROR A
0950  ROR A
0960  ROR A
0970  ROR A
0980  AND #$0F GET LEFT NIBBLE
0990  ORA #$10 SAY USE D/A
1000  STA $D201 STORE THE VALUE
1010  TXA
1020  AND #$0F
1030  ORA #$10
1040  CLC
1050  CLC
1060  CLC
1070  CLC
1080  LDX 207 GET DELAY VALUE
1090  JSR DEL
1100  STA $D201 MAKE SOME NOISE
1110 D4 INC 203 INCREMENT
1120  BNE PB
1130  INC 204 BUFFER
1140  LDX 204
1150  CPX 206 POINTERA
1160  BNE PB1
1170  JMP FINI
1180 BYTE .BYTE 0
1190 FLAG .BYTE 0


Back to previous page