working dos vga writes!

This commit is contained in:
veclavtlica committed 2026-10-29 22:12:47 +03:00
1 parent 5789cafd4e
commit 55ac075e4d
25 files changed
+454 -149

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
/*
Tracker program to create awesome music!
Is supposed to only work on Linux, as it's where the development happens.
*/
#include "../../Common/Snd/oscs.h"
#include "../../Common/Std/libc.c"
#include "../../Common/Timer/posix.c"
#include "../../Common/fix.c"
#include <stdint.h>
#include <stdio.h>
int main(int argc, char **argv) {
struct com_snd_swave swave = com_snd_swave_init(COM_CFG_A4FIX, 0, UINT16_MAX);
FILE *f = fopen("test.raw", "w");
if (!f) {
printf("Can't open file %s\n", "test.raw");
return -1;
}
/* Generate 5 seconds of sinwave. */
int16_t frames[COM_CFG_SNDFRMRATE * 5];
for (int i = 0; i < COM_CFG_SNDFRMRATE * 5; ++i)
frames[i] = com_snd_swave_pump(&swave);
fwrite(frames, 2, COM_CFG_SNDFRMRATE * 5, f);
return 0;
}