buildtest.c (539B)
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 #include "util.h" 5 #include "wavetable.h" 6 #include "machine.h" 7 #include "build.h" 8 9 int 10 main(void) 11 { 12 int i; 13 int16_t *prog; 14 wt_init(); 15 prog = malloc(VM_MEM_END * sizeof(int16_t)); 16 buildfile(stdin, prog); 17 prog[VM_ACTIVE] = 1; 18 prog[VM_KEY] = 100; 19 vm_run(prog); 20 printf("---\n"); 21 for (i = 0; i < VM_KEY_ON+1; i++) { 22 printf("%04hx ", prog[i]); 23 }; 24 printf("\n%hx: ", prog[VM_SP]); 25 for (i = VM_STACK; i < VM_STACK+prog[VM_SP]; i++) { 26 printf("%04hx ", prog[i]); 27 }; 28 printf("\n"); 29 return 0; 30 }