EDASS-128-LETS-MAKE-IT-INTERRUPT-KEYEFFECTS! -------------------------------------------------------------------------------------------------- TOOL: EDASS-128 {Commodore C128 EDITOR & ASSEMBLER} Language: Assembler Extra: - Author: Misel Zivanovic Note: (C) 15th JULY 2026 - www.lived.ch, mzretro.ch -------------------------------------------------------------------------------------------------- This will make some noise when you press keys on the keyboard. You need to find the frequency you like in case you want to use this program. I can only guess that my sound taste isn't the same as yours! Just experiment until you have what you need! Further below, you'll find a ML-Code to try it directly in case you don't want to do any changes in source code! keysfx00.asm -a:0011-a: -e: ;--------------------------------------- ; ; my 2nd sound effects ever ; written in assembler! ; i like when there is a click ; when typing! ; i know that was existing for ; the commodore c64, but i never ; saw it for the commodore c128 ; ; let's change that! ; ; 15.07.2026 ; *= $1300 .obj m .bank 15 ; ;--------------------------------------- ; sei lda #work sta $0315 cli rts ; work lda $d4 cmp #$58 beq end bne hit ; hit lda #$08 ;volume sta $d418 lda #1*16+1 sta $d405 lda #2*16+1 ;hold & fade out sta $d406 ;16*16+16 = max! lda #$08 sta $d403 lda #$00 sta $d402 lda #55 ;check the c128 sta $d401 ;book for this! lda #65 ;that are notes, sta $d400 ;not rnd numbers! ; lda #17 ;opt.:129,65,33 sta $d404 ;waveform ; ; ;small loop ldy #$00 loop2 ldx #$00 loop1 inx cpx #$10 bne loop1 iny cpy #$30 bne loop2 ; ;loop end lda #$00 sta $d404 ;waveform off lda #$00 sta $d0 end jmp $fa65 --------------------------------------------------------------------------------------------------- In case you want to try this directly without having to assembly the code above first, copy and past this code to ML-Monitor of Commodore C128 and start with SYS 4864 Note that it is using an interrupt. When you don't want the keyboard clicks any longer, just hit RUN/STOP RESTORE keys! >01300 78 a9 0d 8d 14 03 a9 13:XI....I. >01308 8d 15 03 58 60 a5 d4 c9:...x?ETI >01310 58 f0 41 d0 00 a9 08 8d:xPaP.I.. >01318 18 d4 a9 11 8d 05 d4 a9:.TI...TI >01320 21 8d 06 d4 a9 08 8d 03:!..TI... >01328 d4 a9 00 8d 02 d4 a9 37:TI...TI7 >01330 8d 01 d4 a9 41 8d 00 d4:..TIa..T >01338 a9 11 8d 04 d4 a0 00 a2:I...T?.B >01340 00 e8 e0 10 d0 fb c8 c0:.H?.P?H? >01348 30 d0 f4 a9 00 8d 04 d4:0PTI...T >01350 a9 00 85 d0 4c 65 fa d0:I..PlEZP