/* all roms start at f000:6000 and end at f000:ffff */ #include #include #include #include #include #include /* starting address of xt rom f000:6000 */ /* add 100h for data, 300h for address */ unsigned int seg=0xF000; unsigned int offst=0x6000; void senddt(); void ch0(); void ch1(); void ch2(); void ch0v(); void ch1v(); void ch2v(); void chkbd(); void silence(); int ct0,ct1,ct2; /* tone values for registers */ int cv1,cv2; /* volume values for registers */ int cth,ctl; int reg,data,ofst,gch,gchs,gch2; /* variables for functions */ int n=0,c,ct02,delta=10; float cv0c=.08,cv0; main() { do{ printf("\nWhat is the offset for your synthesizer (hex)? "); scanf("%4x",&offst); } while(offst<=0); clrscr(); printf("Keyboard -- Ver 1.10b by Larry Battraw (c) 1989"); reg=7; data=254; /* initialize for channel zero tone only */ senddt(); silence(); /* initialize channels for zero volume */ printf("\n\n\n\nPress for more slurring"); printf("\nPress for less"); do { if(ct02>ct0) {++ct0;} if(ct020) {cv0=cv0-cv0c; ch0v(); } gch=bioskey(1); if(gch!=0) {chkbd();} } while(gchs!=0x1b); silence(); } /* ------functions on registers -------------------- */ void chkbd() { gch2=bioskey(1); gch=getch(); if(gch2==0x4800) {++delta; gotoxy(30,15); printf("Slurring: %d ",delta);} if(gch2==0x5000) {if(delta!=0) --delta; gotoxy(30,15); printf("Slurring: %d ",delta);} if(gch=='a') {ct02=855; cv0=15;} if(gch=='w') {ct02=807; cv0=15;} if(gch=='s') {ct02=762; cv0=15;} if(gch=='e') {ct02=719; cv0=15;} if(gch=='d') {ct02=679; cv0=15;} if(gch=='f') {ct02=641; cv0=15;} if(gch=='t') {ct02=605; cv0=15;} if(gch=='g') {ct02=571; cv0=15;} if(gch=='y') {ct02=539; cv0=15;} if(gch=='h') {ct02=508; cv0=15;} if(gch=='u') {ct02=480; cv0=15;} /*b flat*/ if(gch=='j') {ct02=453; cv0=15;} /* b */ if(gch=='k') {ct02=428; cv0=15;} /* c */ if(gch=='o') {ct02=404; cv0=15;} /* c# */ if(gch=='l') {ct02=381; cv0=15;} /* d */ if(gch=='p') {ct02=360; cv0=15;} /* d# */ if(gch==';') {ct02=339; cv0=15;} /* e */ if(gch==39) {ct02=320; cv0=15;} /* f */ if(gch==']') {ct02=302; cv0=15;} /* f# */ if(gch==13) {ct02=285; cv0=15;} /* g */ ch0(); if(ct02>ct0 && cv0==15) {ct0=ct02-delta;} if(ct02