2 * STed: exclu.c (selecter)
7 static char uxcc[5][3]={"gt","ve","ch","cs","ss"};
8 static char dotp[4][3]={"・","・","・","・"};
10 static unsigned char dotpat[32][32];
11 /***************************/
12 void user_exc_as(int no)
14 int gy,ke,kc,sh,i,x=0,y=no*2,yy,nn,mm,a,cc;
18 fill(0,512+32,767,1023,0);
19 box(47,47+512,688+24,458+512,14,65535);
20 fill(47,63+512,73,458+512,14);
21 sdis(6,48+512," USER DEFINE EXCLUSIVE",80+3,15,14);
22 home2(512);fnc_dis(4+3);
24 [F1] gt : SEND GATE POSITION DATA [F4] cs : CLEAR CHECK SUM
25 [F2] ve : SEND VELO POSITION DATA [F5] ss : SEND CHECK SUM
26 [F3] ch : SEND CHANNLE No. [F6] F7 : END OF EXCLUSIVE
29 for(i=0;i<7;i++){line(47,520+7*16+i*48,688+24,520+7*16+i*48,14,65535);}
32 B_LOCATE(6,5+i*3);B_PRINT(fstr(i,2));
33 B_PRINT(" MEMO:");B_PRINT(user_exc_memo[i]);
34 B_LOCATE(39,5+i*3);B_PRINT("|");
39 nn=y>>1;mm=y&1;yy=nn*3+mm+5;cc=3;
45 a=user_exc_data[nn][x];
46 if(a>0x7f){cc=1;B_PRINT("---");}else{B_PRINT(fstr(a,3));}
50 /*while(B_KEYSNS()==0){}*/ /* Jun.28.1998 Daisuke Nagano */
52 ke=B_KEYINP();kc=ke & 0xff;ke=ke>>8;sh=B_SFTSNS();
53 if(kc>='a' && kc<='z'){kc-=32;}
54 if(mm==0){tcur(15,yy,24,3);}else{tcur(13+x*3,yy,4,cc);}
57 if( (ke>=0x40 && ke<=0x51) && (sh&4)!=0 ){
60 static char tk[18]={13,14,15,7,8,9,16,4,5,6,17,1,2,3,18,10,11,12};
63 if( j>0 && j<=7){y=j*2;kc=0;ke=0;}
69 msg(_("Init all exclusive data"));
70 if(yn_sel()>0){msg_clr();user_exc_init();C_CLS_AL();goto redis;}
73 user_exc_init2(nn);C_CLS_AL();goto redis;
78 excins(user_exc_data[nn],23,x);
79 user_exc_data[nn][x]=0;
84 B_LOCATE(15,yy);sinput(user_exc_memo[nn],24);
90 if(es==0 && c>=0 && c<128){
91 excins(user_exc_data[nn],23,x);
92 user_exc_data[nn][x]=c;
94 user_exc_dis(nn);ke=0x3d;kc=0;
100 if((kc>='0'&& kc<='9')||(kc>='A'&& kc<='F')){
103 if(kc<'A'){cc=kc-'0';}else{cc=kc-'A'+10;}
106 if(es==0 && c>=0 && c<128){
107 if( (B_SFTSNS()&4096)!=0 || user_exc_data[nn][x]==0xf7){
108 excins(user_exc_data[nn],23,x);
110 user_exc_data[nn][x]=c;
115 if((kc=='+' || kc=='.' || kc=='>') && a<128){
116 if( kc=='>' ){a+=16;}else{a++;}
117 user_exc_data[nn][x]=a&127;
118 user_exc_dis(nn);ke=0;kc=0;
120 if((kc=='-' || kc==',' || kc=='<') && a<128 ){
121 if( kc=='<' ){a+=112;}else{a+=127;}
122 user_exc_data[nn][x]=a&127;
123 user_exc_dis(nn);ke=0;kc=0;
126 if( ke==0x37 || kc==7 ){
127 excdel(user_exc_data[nn],23,x);
128 user_exc_data[nn][23]=0xf7;
131 if( x>0 &&(ke==0x0f ||kc==8)){
133 excdel(user_exc_data[nn],23,x);
134 user_exc_data[nn][23]=0xf7;
137 if( ke>=0x63 && ke<=0x67){
138 excins(user_exc_data[nn],23,x);
139 user_exc_data[nn][x]=ke-0x63+0x80;
143 user_exc_data[nn][x]=0xf7;
147 if( ke==0x6a && x>5){
148 excins(user_exc_data[nn],23,x);
149 excsum(user_exc_data[nn],x);
153 if( ke==0x10 /*|| ke==0x35*/ ){
154 unsigned char c=user_exc_data[nn][x];
155 excins(user_exc_data[nn],23,x);
156 user_exc_data[nn][x]=c;
162 if( kc=='U' || kc=='u' ){
164 msg("User Exc. No.=");
165 c=vinput(0,0x803);msg_clr();
166 if(es==0 && c>=0 && c<8){
168 user_exc_data[nn][i]=user_exc_data[c][i];
169 user_exc_memo[nn][i]=user_exc_memo[c][i];
176 char tmp0[256],tmp1[256],path2[256];
180 strcpy(path2,prt_path);tmp1[0]=0;
181 fsel(tmp1,path2,0x009+(sh&1));
182 if( es==0 && tmp1[0]!=0){
184 strcpy(tmp0,path2);strcat(tmp0,tmp1);
186 msg(_("Loading Usr.Exc. file."));
188 ec=rex_load(tmp0,-1);
190 ec=rex_load(tmp0,nn);
192 if(ec==0 ){msg_clr();
193 if(!(cnfflag&0x0008)){strcpy(prt_path,path2);}
199 char tmp0[256],tmp1[256],path2[256];
203 strcpy(path2,prt_path);tmp1[0]=0;
204 fsel(tmp1,path2,0x109+(sh&1));
205 if( es==0 && tmp1[0]!=0){
207 strcpy(tmp0,path2);strcat(tmp0,tmp1);
209 msg(_("Saving Usr.Exc. file."));
211 ec=rex_save(tmp0,-1);
213 ec=rex_save(tmp0,nn);
215 if(ec==0 ){msg_clr();
216 if(!(cnfflag&0x0008)){strcpy(prt_path,path2);}
222 if( kc==0x13 || ke==0x3b){x--;if(x<0){x=23;}}
223 if( kc==0x04 || ke==0x3d){x++;if(x>23){x=0;}}
224 if( kc==0x05 || ke==0x3c){y--;if(y<0){y=15;}}
225 if( kc==0x18 || ke==0x3e){y++;if(y>15){y=0;}}
228 fnc_dis(-1);C_CLS_AL();home2(gy);
231 /***************************/
232 void user_exc_dis(int no)
237 B_COLOR(9);B_PRINT("F0");B_COLOR(3);
240 while(i<24 && user_exc_data[no][i]!=0xf7){
242 a=user_exc_data[no][i++];
244 if(a>=0x80 && a<=0x84){
245 B_COLOR(1);B_PRINT(uxcc[a-0x80]);
247 B_COLOR(3);B_PRINT(hex_s(a,2));
251 B_PRINT(" ");B_COLOR(9);B_PRINT("F7");B_COLOR(1);
252 while(i<24 ){user_exc_data[no][i++]=0xf7;B_PRINT(" ..");}
256 /***************************/
257 void exc_edit(int ad,int cy,int sw)
259 int ke,sh,kc,i,x=0,y=0,cx,gx,a,cc,co,po,nn;
261 unsigned char *buf;buf=dat+(16*1024);
263 trk_dis(cy+6,ad,24-cy);
265 if(edit_scr==0){cx=41;gx=328;}else{cx=1;gx=8;}
266 cons_md(0);noed_cls();edit_scr=0;
269 for(i=0;i<32*1024;i++){dat[i]=0xf7;}
272 while(trk[track][po+4]==0xf7){po+=4;
273 dat[co]=trk[track][po+2];if(dat[co]==0xf7){break;}
275 dat[co]=trk[track][po+3];if(dat[co]==0xf7){break;}
280 box(gx-1,624-48,gx+417+16,997,14,65535);
281 fill(gx,639-32,gx+15,996,8);
282 fill(gx,639-40,gx+416+16,639-16-8,8);
283 sdis(cx,624-48," TRACK EXCLUSIVE EDIT",54,15,14);
284 for(i=0;i<22;i++){tdis(cx,7+i,hex_s(i,2),2,3);}
285 for(i=0;i<16;i++){sdis(cx+i*3+7,512+6*16-8,hex_s(i,1),1,3,8);}
288 if(sw&6){co=dot_ed(cx,co);ke=0;goto ext;}
296 B_LOCATE(cx+29,4);if(a>0x7f){cc=1;B_PRINT("---");}else{B_PRINT(fstr(a,3));}
298 tcur(cx+5+x*3,y+7,4,cc);
299 /*while(B_KEYSNS()==0){}*/ /* Jun.28.1998 Daisuke Nagano */
301 ke=B_KEYINP();kc=ke & 0xff;ke=ke>>8;sh=B_SFTSNS();
302 if(kc>='a' && kc<='z'){kc-=32;}
303 tcur(cx+5+x*3,y+7,4,cc);
311 exc_dis(y,cx,co,1);ke=0x3d;kc=0;
313 if( co<256+96 && nn<=co ){
315 B_LOCATE(cx+5+x*3,y+7);
317 if(es==0 && c>=0 && c<128){
321 exc_dis(y,cx,co,1);ke=0x3d;kc=0;
326 if(((kc>='0'&& kc<='9')||(kc>='A'&& kc<='F'))&& co<256+96 && nn<=co){
328 B_LOCATE(cx+5+x*3,y+7);
329 if(kc<'A'){cc=kc-'0';}else{cc=kc-'A'+10;}
332 if(es==0 && c>=0 && c<128){
333 if( (B_SFTSNS()&4096)!=0 || dat[nn]==0xf7){
334 excins(dat,co,nn);co++;
342 if((kc=='+' || kc=='.' || kc=='>') && a<128){
343 if( kc=='>' ){a+=10;}else{a++;}
345 exc_dis(y,cx,co,2);ke=0;kc=0;
347 if((kc=='-' || kc==',' || kc=='<') && a<128){
348 if( kc=='<' ){a+=118;}else{a+=127;}
350 exc_dis(y,cx,co,2);ke=0;kc=0;
353 if( ke==0x37 || kc==7 ){
355 if(nn<co){co--;dat[co]=0xf7;}
358 if( nn>0 && (ke==0x0f || kc==8)){
361 if(nn<co){co--;dat[co]=0xf7;}
362 exc_dis(y,cx,co,1);ke=0x3b;
364 if( ke>=0x63 && ke<=0x67 && co<256+96){
366 dat[nn]=ke-0x63+0x80;
372 dat[y*16+x]=0xf7;exc_dis(y,cx,co,0);
374 if( ke==0x6a && co<256+96 && nn>5){
381 if( ke==0x10 && co<256+96){
382 unsigned char c=dat[nn];
389 if( kc=='$' && co<256+96){
394 msg("strings:");sinput(tmp0,0x8000+32);
395 if( es==0 && tmp0[0]!=0){
396 while(tmp0[i]!=0 && co<256+96){
398 if(tmp0[i]<32){dat[nn]=32;}else{dat[nn]=tmp0[i];}
405 if(x>15){if(y<21){x=0;y++;}else{x=15;}}
411 if( kc=='^' || ke==0x34 ){co=dot_ed(cx,co);x=0;y=0;goto top;}
413 if( kc=='U' || kc=='u' ){
415 msg("User Exc. No.=");
416 c=vinput(0,0x803);msg_clr();
417 if(es==0 && c>=0 && c<8){
419 dat[i]=user_exc_data[c][i];
424 while( dat[co] != 0xf7 && co<24) {co++;}
432 char tmp0[256],tmp1[256],path2[256];
434 txerase(cx*8,4*16,53*8,26*16);
436 strcpy(path2,prt_path);tmp1[0]=0;
437 fsel(tmp1,path2,0x008+e*0x200);
438 if( es==0 && tmp1[0]!=0){
440 strcpy(tmp0,path2);strcat(tmp0,tmp1);
442 msg(_("Loading Exclusive file."));
444 if(ec>=0 ){msg_clr();
445 if(!(cnfflag&0x0008)){strcpy(prt_path,path2);}
446 co=ec;ke=0xff;break;}
451 char tmp0[256],tmp1[256],path2[256];
453 txerase(cx*8,4*16,53*8,26*16);
455 strcpy(path2,prt_path);tmp1[0]=0;
456 fsel(tmp1,path2,0x108+e*0x200);
457 if( es==0 && tmp1[0]!=0){
459 strcpy(tmp0,path2);strcat(tmp0,tmp1);
461 msg(_("Saving Exclusive."));
462 ec=exc_save(tmp0,co);
463 if(ec>=0 ){msg_clr();
464 if(!(cnfflag&0x0008)){strcpy(prt_path,path2);}
470 if( kc=='R' || kc=='r' ){
473 msg("MIDI IN Exclusive INPUT");
476 if(ec>=0 ){msg_clr();
477 co=ec;ke=0xff;break;}
483 if( ke==0x3a && co>0){break;}
485 if( ke==0x36){x=0;y=0;}
491 0x10 0x01~5 0x00 / 0x10 0x01~5 0x40
493 if( dat[0]==0x41 && dat[1]==0x10 && dat[2]==0x45 && dat[3]==0x12 &&
494 dat[4]==0x83 && dat[5]==0x10 ){
497 prn_gspanel(cx);scpanel_dsp(cx+13,18,&dat[8]);
499 prn_gspanel(cx);scinst_dsp(cx+13,16,&dat[8]);
509 if( kc==0x13 || ke==0x3b){x--;
510 if(x<0){if(y>0){x=15;ke=0x3c;}else{x=0;}}
512 if( kc==0x04 || ke==0x3d){x++;
513 if(x>15){if(y<21){x=0;ke=0x3e;}else{x=15;}}
515 if( kc==0x05 || ke==0x3c){y--;if(y<0){y=21;}}
516 if( kc==0x18 || ke==0x3e){y++;if(y>21){y=0;}}
520 dat[co]=0xf7;co++;if(co&1){dat[co]=0xf7;co++;}
521 if(dat[0]==0xf7){co=0;}
522 po=ad;cc=0;while(trk[track][po+4]==0xf7){po+=4;cc+=4;}
529 c1=dat[i];c2=dat[i+1];
530 buf[bc]=0xf7;buf[bc+1]=0;buf[bc+2]=c1;buf[bc+3]=c2;
532 if(c1==0xf7){buf[bc+3]=0xf7;}
534 if(c1==0xf0 || c2==0xf0){
536 buf[bc+2]=0xf7;buf[bc+3]=0xf7;
542 buf[bc]=0x98;buf[bc+1]=0;
543 buf[bc+2]=0;buf[bc+3]=0;
548 if(bc<=cc || trk_check(bc-cc)==0){
551 trk_delete(po,cc);trk_shift(po,bc);
552 for(i=0;i<bc;i++){trk[track][po+i]=buf[i];}
554 if( ke==0x3a ){poplay(ad,8);
557 if( rcd->flg_gsinfo || rcd->flg_gsinst || rcd->flg_gspanel ) {
559 if( rcd->flg_gsinfo) {
561 scinst_dsp(cx+13,16,(uint8 *)rcd->gs_info);
563 if( rcd->flg_gsinst) {
565 scinst_dsp(cx+13,16,(uint8 *)rcd->gs_inst);
567 if( rcd->flg_gspanel ) {
569 scpanel_dsp(cx+13,18,(uint8 *)rcd->gs_panel);
578 if( ke==0x3a || ke==0xff ){goto top0;}
581 fnc_dis(0);/*txerase(cx*8,4*16,53*8,26*16);*/
589 void excsum(unsigned char *da,int nn)
593 if(da[0]==0x43){top--;}
594 for(i=top;i<nn;i++){sum+=da[i];}
595 da[nn]=(128-(sum & 0x7f))&0x7f;
598 void excins(unsigned char *da,int co,int nn)
602 for(i=co;i>nn;i--){da[i]=da[i-1];}
605 void excdel(unsigned char *da,int co,int nn)
609 for(i=nn;i<co;i++){da[i]=da[i+1];}
612 /************************** RCM2 MAX=263 +9+1 272*/
613 void exc_dis(int no,int cx,int co,int m)
617 B_LOCATE(cx+3,7);B_COLOR(9);B_PRINT("F0");B_COLOR(3);
624 if(m!=0 && nn!=co+1 && a==0xf7){break;}
629 while(i<16 && nn<=co){
633 if(a>=0x80 && a<=0x84){
634 B_COLOR(1);B_PRINT(uxcc[a-0x80]);
636 if(a<0x80){B_COLOR(3);}else{B_COLOR(9);}
637 B_PRINT(hex_s(a,2));if(a>=0x80){B_COLOR(3);}
643 while(i<16 && nn<=256+96){dat[nn++]=0xf7;B_PRINT(" ..");i++;}
650 /**************************19971028/29/30*/
654 unsigned char buf[8*1024];
655 int ad,ln,pp,cc,a,bpo,i,fl;
657 all_note_off(1);hedset(36);bpo=rcp_buf_put(hed,0,1414);
658 for(i=0;i<36;i++){thedset(i,48);hed[44]=0xfe;bpo=rcp_buf_put(hed,bpo,48);}}
659 rcd->fmt=2;rcd->totalcount=bpo;
660 rcd->data_valid=1;rcd->word_valid=0;rcd->tone_valid=0;rcd->gsd_valid=0;
662 (*rcd->init)();midi_clr();
669 if( INPOUT(0xfe)!=0 ){if(INPOUT(0xff)==27){break;}}
675 if(ln>=32*1024+512){msg("バッファが一杯になりました");break;}
682 while( buf[pp]==0xf0 && pp<ln) {
684 while( buf[pp] != 0xf7 && pp<ln) {dat[cc++]=buf[pp++];}
692 /***************************/
693 int exc_load(char *fna)
695 char tmp0[2048],li[1024];
696 unsigned char buf[8*1024];
702 if(!(fp= fopen2(fna,"rb"))){msg(_("File not found."));return(-1);}
703 ln=fread(dat,1,32*1024,fp);fclose(fp);
710 if(ad>=ln){ln=fread(dat,1,32*1024,fp);ad=0;if(ln==0){break;}}
720 if(dat[ad]==0x0a){ad++;
721 if(ad>=ln){ln=fread(dat,1,32*1024,fp);ad=0;}
729 strcpy(tmp0,li);jstrupr(tmp0);
732 while(i<strlen(tmp0)){
734 if(tmp0[i]==32){i++;}else{
735 strcpy(tmp9,&tmp0[i]);
737 tmp9[1]='H';tmp9[2]=0;
739 tmp9[2]='H';tmp9[3]=0;
743 if(strcmp(tmp9,"GT")==0){a=0x80;}
744 if(strcmp(tmp9,"VE")==0){a=0x81;}
745 if(strcmp(tmp9,"CH")==0){a=0x82;}
746 if(strcmp(tmp9,"CS")==0){a=0x83;}
747 if(strcmp(tmp9,"SS")==0){a=0x84;}
749 buf[j++]=a;if(j>=8*1024){goto skip;}
760 while( buf[pp]==0xf0 && pp<j) {
762 while( buf[pp] != 0xf7 && pp<j) {dat[cc++]=buf[pp++];}
770 /***************************/
771 int exc_save(char *fna,int co)
774 unsigned char buf[4096];
777 if(!(fp= fopen2(fna,"wb"))){msg(_("Cannot open file."));return(-1);}
779 strcpy((char *)buf,"F0 ");
783 unsigned char a=dat[i];
785 if(a>=0x80 && a!=0xf7){
786 if(a>=0x80 && a<=0x84){strcat((char *)buf,uxcc[a-0x80]);strcat((char *)buf," ");}
789 strcat((char *)buf,"F7\r\n\r\n");
790 fwrite(buf,1,strlen((char *)buf),fp);
792 strcat((char *)buf,"F0 ");
795 strcat((char *)buf,hex_s(dat[i],2));
796 strcat((char *)buf," ");
799 sz=strlen((char *)buf);
801 buf[sz-1]=0;strcat((char *)buf,"\r\n");
802 fwrite(buf,1,sz+1,fp);
806 strcat((char *)buf,"\r\n");
807 fwrite(buf,1,strlen((char *)buf),fp);
813 /***************************/
814 void prn_gspanel( int cx )
816 struct X68_TXFILLPTR *t,buf;
820 t->x = (cx+11)*8 ;t->y = 15*16+8;t->x1 = 36*8;t->y1 = 9*16;
821 t->vram_page = 0;t->fill_patn = 0xffff;TXFILL( t );
822 t->vram_page = 1;t->fill_patn = 0x0000;TXFILL( t );
824 t->x = (cx+11)*8+2;t->y = 15*16+8+2;t->x1 = 36*8-4;t->y1 = 9*16-4;
825 t->vram_page = 0;t->fill_patn = 0x0000;TXBOX( t );
827 t->x = (cx+13)*8 ;t->y = 18*16;t->x1 = 32*8;t->y1 = 6*16;
828 t->vram_page = 0;t->fill_patn = 0x0;TXFILL( t );
829 t->vram_page = 1;t->fill_patn = 0xffff;TXFILL( t );
831 /*t->x = (cx+13)*8*/ ;t->y = 16*16;t->x1 = 32*8;t->y1 = 16;
832 t->vram_page = 0;t->fill_patn = 0x0;TXFILL( t );
833 t->vram_page = 1;t->fill_patn = 0xffff;TXFILL( t );
837 /***************************/
839 /***************************/
840 /*970112 bar display edit*/
841 int dot_ed(int dx,int co)
843 int ke,kc,sh,cx,cy,i,j,gx,pmode=1;
846 for(i=0;i<16;i++){for(j=0;j<16;j++){dotpat[i][j]=0;}}
848 /* 0x10 0x01~5 0x00 / 0x10 0x01~5 0x40 */
850 if( dat[0]==0x41 && dat[1]==0x10 && dat[2]==0x45 && dat[3]==0x12 &&
851 dat[4]==0x83 && dat[5]==0x10 && dat[6]>0 && dat[7]==0x00){
855 dat[0]=0x41;dat[1]=0x10;dat[2]=0x45;dat[3]=0x12;
856 dat[4]=0x83;dat[5]=0x10;dat[6]=1;dat[7]=0x00;
858 msg(_("Not a GS BAR DISPLAY DATA."));return co;
865 txerase(dx*8,15*16,53*8,15*16);
866 fill(gx+31-8,512+240,gx+360+32,995,0);
868 box(gx+31-8,512+240+8,gx+360+64,995-6,14,65535);
869 sdis(dx+4-1,512+240+8," GS BAR DISPLAY EDIT",48+2,15,14);
872 fill(gx+64-16,512+288-16,gx+63+16*16+16,512+287+8*16+16,14);
873 fill(gx+64 ,512+288 ,gx+63+16*16 ,512+287+8*16 ,0);
876 line(gx+64,512+287+i*8, gx+63+16*16,512+287+i*8, 4,65535);
877 line(gx+63+i*16,512+288, gx+63+i*16,512+287+8*16, 4,65535);
887 fill(gx+64-16,512+288-16,gx+63+16*16+16,512+287+8*16+16,14-12);
888 fill(gx+64 ,512+288 ,gx+63+16*16 ,512+287+8*16 ,0);
891 line(gx+64,512+287+i*8, gx+63+16*16,512+287+i*8, 4-2,65535);
892 line(gx+63+i*16,512+288, gx+63+i*16,512+287+8*16, 4-2,65535);
900 if((cmdflag&0x200)==0){
901 MS_INIT();MS_LIMIT(gx,80,gx+432,511-16-8);MS_CURON();
907 box(gx+cx*16+63,cy*8+287+512,gx+63+cx*16+16,cy*8+287+512+8,6,65535);
909 B_LOCATE(dx+8,26);B_PRINT("X=");B_PRINT(fstr(cx,2));
910 B_LOCATE(dx+8,27);B_PRINT("Y=");B_PRINT(fstr(cy,2));
912 while(B_KEYSNS()==0){
913 /*ma=MS_GETDT()&0xff00;mx=MS_CURGT();my=mx&0xffff;mx=mx>>16;*/
914 ma=MS_GETDT()&0xff00;mspos(&mx,&my);
916 if(ma /*&& msf!=0*/){break;}
917 if(BITSNS(14)&12){break;}
920 ke=0;kc=0;sh=B_SFTSNS();
922 ke=B_KEYINP();kc=ke & 0xff;ke=ke>>8;
926 box(gx+cx*16+63,cy*8+287+512,gx+63+cx*16+16,cy*8+287+512+8,4,65535);
928 box(gx+cx*16+63,cy*8+287+512,gx+63+cx*16+16,cy*8+287+512+8,4-2,65535);
932 ke=0;kc=0;msf=0;mx-=gx;
933 if(mx>=8*8 && mx<8*8+16*16 && my>=18*16 && my<18*16+8*16 ){
934 cx=(mx-8*8)>>4;cy=(my-18*16)>>3;
935 pmode=1-dotpat[cx][cy];goto skip;
940 ke=0;kc=0;msf=0;mx-=gx;
941 if(mx>=8*8 && mx<8*8+16*16 && my>=18*16 && my<18*16+8*16 ){
942 cx=(mx-8*8)>>4;cy=(my-18*16)>>3;
944 dotpat[cx][cy]=pmode;
945 B_LOCATE(dx+8+cx*2,(cy>>1)+18);
946 /* B_PRINT(dotp[dotpat[cx][cy&14]+dotpat[cx][(cy&14)+1]*2]);*/
947 a=dotpat[cx][cy&14]+dotpat[cx][(cy&14)+1]*2;
948 if(cnfflag&0x8000){a=3-a;}
954 if( ke==1 || ke==0x34 ){
965 for(i=0;i<4;i++){buf[i+1]=dat[i];}
966 for(i=5;i<72;i++){buf[i]=dat[i];sum=sum+dat[i];}
967 buf[72]=(128-(sum&0x7f))&0x7f;
968 buf[73]=0xf7;buf[74]=0xff;
970 (*rcd->mix_out)(buf);
973 if( kc==0x13||ke==0x3b ||ke==0x43||ke==0x47||ke==0x4B ){cx--;if(cx<0){cx=15;}}
974 if( kc==0x04||ke==0x3d ||ke==0x45||ke==0x49||ke==0x4D ){cx++;if(cx>15){cx=0;}}
975 if( kc==0x05||ke==0x3c ||ke==0x43||ke==0x44||ke==0x45 ){cy--;if(cy<0){cy=15;}}
976 if( kc==0x18||ke==0x3e ||ke==0x4B||ke==0x4C||ke==0x4D ){cy++;if(cy>15){cy=0;}}
978 if( ke==0x36 ){cx=0;cy=0;}
983 B_LOCATE(dx+8+cx*2,(cy>>1)+18);
984 /*B_PRINT(dotp[dotpat[cx][cy&14]+dotpat[cx][(cy&14)+1]*2]);*/
985 a=dotpat[cx][cy&14]+dotpat[cx][(cy&14)+1]*2;
986 if(cnfflag&0x8000){a=3-a;}
992 B_LOCATE(dx+8+cx*2,(cy>>1)+18);
993 /*B_PRINT(dotp[dotpat[cx][cy&14]+dotpat[cx][(cy&14)+1]*2]);*/
994 a=dotpat[cx][cy&14]+dotpat[cx][(cy&14)+1]*2;
995 if(cnfflag&0x8000){a=3-a;}
1001 dotpat[cx][cy]=1-dotpat[cx][cy];
1002 B_LOCATE(dx+8+cx*2,(cy>>1)+18);
1003 /*B_PRINT(dotp[dotpat[cx][cy&14]+dotpat[cx][(cy&14)+1]*2]);*/
1004 a=dotpat[cx][cy&14]+dotpat[cx][(cy&14)+1]*2;
1005 if(cnfflag&0x8000){a=3-a;}
1009 if( kc=='G' || kc=='g' ){
1010 dattopat(0);dot_dis(dx);
1014 for(i=0;i<16;i++){for(j=0;j<16;j++){dotpat[i][j]=0;}}
1018 if( kc=='R' || kc=='r'){
1019 for(i=0;i<16;i++){for(j=0;j<16;j++){dotpat[i][j]=1-dotpat[i][j];}}
1028 for(i=0;i<15;i++){dotpat[i][j]=dotpat[i+1][j];}
1035 int a=dotpat[15][j];
1036 for(i=15;i>0;i--){dotpat[i][j]=dotpat[i-1][j];}
1044 for(i=0;i<15;i++){dotpat[j][i]=dotpat[j][i+1];}
1051 int a=dotpat[j][15];
1052 for(i=15;i>0;i--){dotpat[j][i]=dotpat[j][i-1];}
1060 if( ke>=0x63 && ke<=0x67 ){
1068 txerase(dx*8+8,15*16,42*8,15*16);
1069 fill(gx+31-8,512+240,gx+360+64,995,0);
1074 if((cmdflag&0x200)==0){
1075 MS_LIMIT(0,0,767,511);MS_CUROF();
1080 /***************************/
1081 void dot_ctrl(int m)
1091 dotpat[j][i]=dotpat[j][15-i];
1101 dotpat[i][j]=dotpat[15-i][j];
1110 dot2[j][i]=dotpat[15-i][j];
1115 dotpat[j][i]=dot2[j][i];
1123 dot2[j][i]=dotpat[i][15-j];
1128 dotpat[j][i]=dot2[j][i];
1134 /***************************/
1135 void dot_dis(int cx)
1140 B_LOCATE(cx+8,(i>>1)+18);
1142 /* B_PRINT(dotp[dotpat[j][i]+dotpat[j][i+1]*2]);*/
1143 a=dotpat[j][i]+dotpat[j][i+1]*2;
1144 if(cnfflag&0x8000){a=3-a;}
1150 /***************************/
1151 void dattopat(int me)
1156 /* a=dat[ad]&31;a=a*32+(dat[ad+16]&31);
1157 a=a*32+(dat[ad+32]&31);a=a*32+(dat[ad+48]&31);*/
1159 a=((((((dat[ad]*32)|dat[ad+16])*32)|dat[ad+32])*32)|dat[ad+48]);
1164 for(i=0;i<16;i++){dotpat[15-i][j]=a&1;a=a>>1;}
1168 /***************************/
1169 void pattodat(int me)
1175 for(i=0;i<16;i++){a=a<<1;if(dotpat[i][j]==1){a|=1;}}
1178 dat[ad ]=(a>>15)&31;dat[ad+16]=(a>>10)&31;
1179 dat[ad+32]=(a>>5 )&31;dat[ad+48]=(a )&31;
1182 dat[72]=0x84;dat[73]=0xf7;
1185 /***************************/
1187 /***************************/
1188 /* 0x10 0x01~5 0x00 / 0x10 0x01~5 0x40*/
1189 void exc_view(int ad)
1191 int i,cx,gx,co,po,excmd=0;
1194 unsigned char *buf;buf=dat+(16*1024);
1196 if(edit_scr==0){cx=41;gx=328;}else{cx=1;gx=8;}
1197 cons_md(0);/*noed_cls();*/edit_scr=0;
1199 if(trk[track][ad]<0x90 || trk[track][ad]>0x98){goto ext;}
1202 if(trk[track][ad]==0x98){
1204 while(trk[track][po+4]==0xf7){po+=4;
1205 dat[co]=trk[track][po+2];if(dat[co]==0xf7){break;}
1207 dat[co]=trk[track][po+3];if(dat[co]==0xf7){break;}
1211 excmd=trk[track][ad]-0x90+1;po=0;co=0;
1212 while(user_exc_data[excmd-1][po]!=0xf7 && po<24){
1213 dat[co++]=user_exc_data[excmd-1][po++];
1218 box(gx-1,624-48,gx+417+16,997,14,65535);
1219 fill(gx,639-32,gx+15,996,8);
1220 fill(gx,639-40,gx+416+16,639-16-8,8);
1222 if(excmd==0){strcpy(tmp0," Track");}else{strcpy(tmp0," User");}
1223 strcat(tmp0," Exclusive View");
1225 if(excmd){strcat(tmp0," [ ] ");tmp0[22]=excmd+'0'-1;
1226 strcat(tmp0,user_exc_memo[excmd-1]);}
1228 sdis(cx,624-48,tmp0,54,15,14);
1231 strcpy(tmp0," Tr:");strcat(tmp0,fstr(track+1,2));
1232 strcat(tmp0," Meas:");strcat(tmp0,fstr(meas_no(ad),4));
1234 sdis(cx,624-48+16,tmp0,54,15,14);
1237 for(i=0;i<22;i++){tdis(cx,7+i,hex_s(i,2),2,3);}
1238 /* for(i=0;i<22;i++){sdis(cx,512+(7+i)*16,hex_s(i,2),2,3,8);}*/
1239 for(i=0;i<16;i++){sdis(cx+i*3+7,512+6*16-8,hex_s(i,1),1,3,8);}
1243 if( dat[0]==0x41 && dat[1]==0x10 && dat[2]==0x45 && dat[3]==0x12 &&
1244 dat[4]==0x83 && dat[5]==0x10 ){
1247 prn_gspanel(cx);scpanel_dsp(cx+13,18,&dat[8]);
1249 prn_gspanel(cx);scinst_dsp(cx+13,16,&dat[8]);
1255 /* txerase(cx*8,4*16,53*8,26*16);*/
1263 void exc_dis2(int cx,int co)
1267 B_LOCATE(cx+3,7);B_COLOR(9);B_PRINT("F0");B_COLOR(3);
1272 B_LOCATE(cx+5,7+no);
1275 while(i<16 && nn<=co){
1279 if(a>=0x80 && a<=0x84){
1280 B_COLOR(1);B_PRINT(uxcc[a-0x80]);
1282 if(a<0x80){B_COLOR(3);}else{B_COLOR(9);}
1283 B_PRINT(hex_s(a,2));if(a>=0x80){B_COLOR(3);}
1292 B_COLOR(3);snsclr();