head 1.1; access; symbols netbsd-11-0-RC5:1.1 netbsd-11-0-RC4:1.1 netbsd-11-0-RC3:1.1 netbsd-11-0-RC2:1.1 netbsd-11-0-RC1:1.1 perseant-exfatfs-base-20250801:1.1 netbsd-11:1.1.0.12 netbsd-11-base:1.1 netbsd-10-1-RELEASE:1.1 perseant-exfatfs-base-20240630:1.1 perseant-exfatfs:1.1.0.10 perseant-exfatfs-base:1.1 netbsd-10-0-RELEASE:1.1 netbsd-10-0-RC6:1.1 netbsd-10-0-RC5:1.1 netbsd-10-0-RC4:1.1 netbsd-10-0-RC3:1.1 netbsd-10-0-RC2:1.1 thorpej-ifq:1.1.0.8 thorpej-ifq-base:1.1 thorpej-altq-separation:1.1.0.6 thorpej-altq-separation-base:1.1 netbsd-10-0-RC1:1.1 netbsd-10:1.1.0.4 netbsd-10-base:1.1 bouyer-sunxi-drm:1.1.0.2 bouyer-sunxi-drm-base:1.1; locks; strict; comment @# @; 1.1 date 2022.06.10.21.42.24; author tsutsui; state Exp; branches; next ; commitid 3RhWl9CpTnKLyxHD; desc @@ 1.1 log @luna68k: add psgpam(4) audio for LUNA, using YM2149 PSG/SSG sound chip. "PSG PAM" is a audio driver using "Pulse Amplitude Modulation" with the YM2149 PSG/SSG chip connected to the I/O processor HD647180X on LUNA. The driver plays up to 30 kHz PCM audio by manipulating PSG channel volumes at extremely high speed with 6.144 MHz HD647180X, a Z80 compatible sub CPU. https://www.youtube.com/watch?v=fR7PqaLpijQ https://www.youtube.com/watch?v=kCDZCgkwgBA Compatibilities with the existing XPIOCDOWNLD ioctl(2) to download and exec user programs (PSG sound driver player ported from PC-6001 etc.) on the HD647180X is still provided. https://twitter.com/tsutsuii/status/1533247362965315584 This psgpam(4) driver for NetBSD/luna68k was written by @@moveccr during isaki-audio2 branch developments, and it was also demonstrated at Open Source Conference 2018 Kyoto: https://github.com/isaki68k/netbsd-src/tree/audio2 https://mail-index.netbsd.org/netbsd-advocacy/2018/08/07/msg000781.html https://twitter.com/tsutsuii/status/1025504875625365505 Note specifications of interrupts from the HD647180X to the host LUNA was confirmed by Kenji Aoyama on his LUNA-88K2 running OpenBSD/luna88k. I would like to thank all people still working on ancient LUNA machines! @ text @# # Copyright (c) 2018 Tetsuya Isaki. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. BEGIN { print "/* generated by mkdefs.awk */" print "#ifndef XPLX_DEFINE" print "#define XPLX_DEFINE" } # hex to decimal function h2d(s, i,c,n,rv) { rv = 0 for (i = 1; i <= length(s); i++) { c = toupper(substr(s, i, 1)) n = index("0123456789ABCDEF", c) if (n == 0) { error = 1 exit error } rv = rv * 16 + n - 1 } return rv } # Global label /::/ { print "/* " $0 " */" for (i = 1; i <= NF; i++) { f = $(i) if (f ~ /::/) { break; } } sub(/::/, "", f) sub(/:/, "", $1) printf("#define %s 0x%s\n", f, $1); k = "GLOBAL_" keys[""] = k v = h2d($1) while (values["", v] != "") v++; values["", v] = f counts[""]++ } $2 ~ /#define/ { printf("%s %s %s\n", $2, $3, $4); # multiple if statements # because match() returns index/length by global variables if (match($3, /^XPLX_R_/)) { k = substr($3, RSTART, RLENGTH) } else if (match($3, /^DEVID_/)) { k = substr($3, RSTART, RLENGTH) } else if (match($3, /^[^_]+_(CMD|ENC)_/)) { k = substr($3, RSTART, RLENGTH) } else { next } sub(k, "", $3) keys[k] = k values[k, $4] = $3 counts[k]++ } END { print "#endif /* !XPLX_DEFINE */" } @