From: Jon Langseth Date: Mon, 23 Jan 2017 18:15:27 +0000 (+0100) Subject: Sounds! X-Git-Url: https://git.defcon.no/?a=commitdiff_plain;h=2112f4e99ca8166a75b7e1594af89d4b69265d97;p=z80cpm Sounds! --- diff --git a/soundtest1.asm b/soundtest1.asm new file mode 100644 index 0000000..85875b9 --- /dev/null +++ b/soundtest1.asm @@ -0,0 +1,73 @@ +; soundtest1.asm +; Requires an AY-3-891x or YM2149, with address decoding making +; a write/read to $50 a data write/read, a write to $51 an address write, +; and any other combination being an AY Idle condition. +; Supernaive bruteforce approach, with random delay values. +; Produces a frequency sweep by counting down 0..255 + +CPU Z80 +OUTPUT HEX + +* = $100 +START LD A, 7 + OUT ($51), A + LD A, $FF + OUT ($50), A + + LD A, 8 + OUT ($51), A + LD A, 9 + OUT ($50), A + + LD A, 9 + OUT ($51), A + LD A, 0 + OUT ($50), A + + LD A, $A + OUT ($51), A + LD A, 0 + OUT ($50), A + + LD A, 7 + OUT ($51), A + LD A, $FE + OUT ($50), A + + LD A, 1 + OUT ($51), A + LD A, 1 + OUT ($50), A + + LD A, 0 + OUT ($51), A + + LD A, $FF +LOOP1 OUT ($50), A + PUSH AF + LD A, 8 + CALL DELAY + POP AF + DEC A + JR NZ, LOOP1 + + LD A, 7 + OUT ($51), A + LD A, $FF + OUT ($50), A + + RET + +; End of main code. + +;Start of delay routine.. +DELAY PUSH BC +DLY_START LD C, 10 +DLY_LOOPO LD B, 0 +DLY_LOOPI DJNZ DLY_LOOPI + DEC C + JR NZ, DLY_LOOPO + DEC A + JR NZ, DLY_START + POP BC + RET