From 9371d34007825b1fc7e8416777778bfddc646094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valt=C3=BDr=20=C3=96rn=20Kjartansson?= Date: Wed, 16 Jun 2021 23:17:32 +0000 Subject: [PATCH] Start adding basic Soundblaster 16 support --- bios-graphics/popcorn.pcm16 | Bin 0 -> 61240 bytes commands.fish | 4 +- src/impl/kernel/io.c | 6 ++ src/impl/kernel/main.c | 7 ++ src/impl/kernel/sb16.c | 121 ++++++++++++++++++++++++++++++++++ src/impl/x86_64/boot/main.asm | 9 ++- src/intf/io.h | 4 +- src/intf/sb16.h | 8 +++ 8 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 bios-graphics/popcorn.pcm16 create mode 100644 src/impl/kernel/sb16.c create mode 100644 src/intf/sb16.h diff --git a/bios-graphics/popcorn.pcm16 b/bios-graphics/popcorn.pcm16 new file mode 100644 index 0000000000000000000000000000000000000000..4cf7c631573b4ba990b494dc0fa7b3c1c3e6adf6 GIT binary patch literal 61240 zcma&O1$Y!!_c%N=>n_=iyFnm8AV2~M4uJ%Bm*NyD&;q5%+u{{kT#LKAyChf=5<)`U z-Fd143sS{$howjfN`d9LrKXJ%q?x6)*$R!V&tf+KmPUpk z5E~2ChR4PU+m?lI;|VFYVYP9AWvnz14ogcD@PYKPQp8f^o8=R0v-vHsSy{Kp=<9MD zkJygo11V;4el0zg4wMy384C^RLHssruyN1kvHE6pVx!7NAIr_xc4p(?pAv7;3@d9J z1+1QIGDq4OkT@$Bgo@ButNOQ1*d+XKy<%;Y07@72_HSLV@K~F&abwG4?`>FFZ6Fmk z8^m&(7XO`QwS#Th`t(@lP6UkZiQFy^^(V8zn8Y zVq3O7+e@(D*lZdhVHrvadpE05yl3qT%dj?WwNI8_8$WCf)pZPYqvDV*m z_caWb3e+r15$chp7@^x}V{H#1psf(Z*Y?87!-n4`3ERC*+ARDQO4)vb@KF~3Yc%+` zoNfBB*(R3Tc=}&sZ zwJp$E>bA(fB@eN)*w{Q4zxluPqMq3N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