Videopac / Odyssey2 forum
September 27, 2021, 08:47:46 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: If you have some news and you want it to be shown here, pm Janzl!
   Home   Help Login Register links  
Pages: [1]   Go Down
Author Topic: 2 soundeffects needed  (Read 187 times)
dr beep
Played Munchkin once...
Posts: 65

« on: July 03, 2021, 09:11:14 PM »

I have been searching but I can't find anything usefull to make some sound.

I need 2 soundeffects.

1 short beep to signal an item is correctly selected
1 longer beep (or higher beep) to signal any illegal move done.

Who can help with a small routine I can use in both cases?

I take the Videopac and leave the Canoli!
Posts: 2728

« Reply #1 on: July 03, 2021, 11:21:53 PM »

Not sure if is it you needing, but here´s a routine by SOeren Gust:

start   section main
   ; wait silently until key pressed
   call   waitvsync
   call   readkey
   jb7   start
   ; play tune
   mov   a,#076h
   call   playsound
   ; repeat
   jmp   start
   endsection main

   org   0700h

   ; check if BIOS sound or custom sound
   mov   a,r4
   add   a,#08ah      ; >= 076h
   jc   .custom
   jmp   soundirq   ; BIOS tune

.custom   ; custom sound handler, read sound opcodes from current page
   mov   a,r4
   movp   a,@a
   mov   r1,a      ; command byte
   inc   r4
   xrl   a,#0fh
   jz   .op0f      ; test for new opcode
   mov   a,r4
   movp   a,@a
   mov   r2,a      ; parameter byte
   jmp   parsesnd   ; let BIOS sound IRQ handle opcode

   ; opcode 0F: sound off, copy next 3 bytes into A7/8/9
.op0f   mov   r0,#vdc_soundctrl
   clr   a
   movx   @r0,a      ; old sound off
   mov   r0,#vdc_sound0
   mov   r1,#3      ; number of bytes to copy
.loop   mov   a,r4
   movp   a,@a
   movx   @r0,a
   inc   r0
   inc   r4
   djnz   r1,.loop
   jmp   mysoundirq   ; restart sound handler

   org   0776h

; tune for level win on KTAA
   db   081h, 000h
   db   082h, 004h
   db   083h, 008h
   db   084h, 00ch
   db   085h, 010h
   db   086h, 014h
   db   087h, 018h
   db   088h, 01ch
   db   089h, 020h
   db   08ah, 024h
   db   021h, 0

Give this man a Jopac!
Posts: 1232

« Reply #2 on: July 11, 2021, 12:54:28 AM »

How about the buzz sound effect for an incorrect answer and the keypress sound effect for the other one.

All my Odyssey2 projects, now in one place!
Pages: [1]   Go Up
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!