#include #include #include #include #include #include #define ERROR -1 #define STATPT 0xe0d2 #define DATAPT 0xe0d0 #define DRR 0x0040 #define DSR 0x0080 #define PUT 8888 #define GET 9999 #define entry_table 0x0080 #define vector_offset_user_com 10 FILE *fds,*fdo; static union REGS inregs,outregs; static struct SREGS segregs; int msb_mode,para[16][8],moux,mouy,right,left,sts[16],debug,xpt,ypt,stp; int xx,xxx,yy,yyy,high,old_l,old_r,old_x,old_y,disp,old_disp,solo,win; int mbuff_x,mbuff_y,w_x,w_y,back,front,b_ctr; char buff[16]; double myu,chaos,_1st,_2nd,_3rd,beep,b_myu; unsigned get_entry(x) int x; { unsigned ent,z; z=(unsigned)x; ent=msb_data_get(entry_table)+msb_data_get(entry_table+1)*256; return(msb_data_get(ent+2*z)+msb_data_get(ent+2*z+1)*256); } msb_data_put(add,data) unsigned add; int data; { set_command(0xe3); put_data(add/256); set_command(0xe5); put_data(add%256); set_command(0xeb); put_data(data); } msb_data_get(add) unsigned add; { set_command(0xe3); put_data(add/256); set_command(0xe5); put_data(add%256); set_command(0xae); return(get_data()); } put_command(x) int x; { while((inp(STATPT)&DRR)!=0){} outp(STATPT,x); } put_data(x) int x; { while((inp(STATPT)&DRR)!=0){} outp(DATAPT,x); } get_data(){ while((inp(STATPT)&DSR)!=0){} return(inp(DATAPT)); } set_command(x) int x; { put_command(x); while(get_data()!=0xfe){} } mouseini(){ inregs.x.ax=0; int86(51,&inregs,&outregs); if(outregs.x.ax==0){ printf("mouse.sys missing\n"); exit(0); } } mouse(flag) int flag; { if(flag==0){inregs.x.ax=2;} else if(flag==1){inregs.x.ax=1;} int86(51,&inregs,&outregs); } getmouse(right,left,x,y) int *right,*left,*x,*y; { inregs.x.ax=3; int86(51,&inregs,&outregs); *right=outregs.x.bx; *left=outregs.x.ax; *x=outregs.x.cx; *y=outregs.x.dx; } setmouse(x,y) int x,y; { inregs.x.ax=4; inregs.x.cx=x; inregs.x.dx=y; int86(51,&inregs,&outregs); } m_style(x,y,buf) int x,y; char *buf; { inregs.x.ax=9; inregs.x.bx=x; inregs.x.cx=y; segread(&segregs); segregs.es=segregs.ds; inregs.x.dx=(int)buf; int86x(51,&inregs,&outregs,&segregs); } m_view(xmin,ymin,xmax,ymax) int xmin,ymin,xmax,ymax; { inregs.x.ax=16; inregs.x.cx=xmin; inregs.x.dx=xmax; int86(51,&inregs,&outregs); inregs.x.ax=17; inregs.x.cx=ymin; inregs.x.dx=ymax; int86(51,&inregs,&outregs); } m_color(color) int color; { inregs.x.ax=18; inregs.x.bx=color; int86(51,&inregs,&outregs); } symbol(x,y,color,str,skip) int x,y,color,skip; unsigned char str[80]; { int i=0; _setcolor(color); while(str[i]!=0){ _gputchar(x,y,str[i++],_GXOR); x += skip; } } unsigned char patch[1009] = { 0x1C,0x66,0x29,0xEB,0xE1,0xFE,0x37,0x00,0xEB,0xE3,0xFE,0x37, 0x00,0xEB,0xE2,0xFE,0x37,0x00,0xEB,0xE4,0xFE,0x37,0x00,0xEB, 0xEF,0xFE,0x37,0x00,0xEB,0xE0,0xFE,0x37,0x55,0x33,0x00,0x23, 0x3A,0x60,0x6F,0xF7,0x37,0x00,0x3A,0x00,0x6F,0xF7,0x37,0x00, 0x1C,0x37,0x44,0x83,0xFB,0x6F,0x10,0xCE,0xEA,0x33,0x00,0x30, 0xFA,0xFB,0x31,0xF9,0x6E,0x90,0xE8,0x37,0x00,0x83,0xFB,0x6F, 0x10,0xCE,0xF2,0x1C,0xDB,0x41,0x1C,0x57,0x41,0x1C,0x3D,0x43, 0xC8,0xF5,0x47,0x7F,0x77,0x7D,0xFE,0xD6,0x39,0x00,0x70,0xF9, 0x70,0xE2,0x28,0xEF,0x76,0x20,0x97,0x7F,0xAC,0x80,0xC6,0x04, 0x3F,0x7F,0x00,0x00,0xF8,0xAF,0xC6,0x1F,0xF8,0x6F,0xF0,0xC7, 0x0B,0xF8,0x6F,0xF8,0xFE,0xD6,0xFE,0xDF,0x37,0x78,0x00,0x1E, 0x20,0xF8,0x6C,0xF0,0xE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xFB,0x31,0xF9,0x6E,0xD0,0xE8,0x37,0x1F, 0x1E }; static int style[]={ 0,0,0,0,0,0,0,0,0x0070,0x0e88,0x1184,0x2142,0x2221,0x9210, 0xe107,0x1108,0x1108,0xe107,0x1108,0x1108,0xe107,0x4108, 0x4208,0xfc07,0,0,0,0,0,0,0,0 }; msb98_check(){ int i,j; for(i=0;i<100;i++) inp(DATAPT); j=0; for(i=0;i<10000;i++){ if((inp(STATPT)&DRR)==0) j=1; } if(j==0) return(ERROR); outp(STATPT,0xff); j=0; for(i=0;i<32000;i++){ if((inp(STATPT)&DSR)==0) j=1; } if(j==0) return(ERROR); if(inp(DATAPT)!=0xfe) return(ERROR); set_command(0xff); set_command(0xac); i=get_data(); if(i!=0x15) return(ERROR); set_command(0xf0); set_command(0xac); i=get_data(); if(i!=0x28) return(ERROR); set_command(0xff); return(0); } diaplay_setting(x) int x; { if(x==0){ _setvideomode(_98RESS16COLOR); _displaycursor(_GCURSOROFF); _clearscreen(_GCLEARTEXT); _clearscreen(_GCLEARSCREEN); } else if(x==1){ _clearscreen(_GCLEARSCREEN); _displaycursor(_GCURSORON); mouse(0); if(msb_mode==1) set_command(0xfe); outp(0x37,7); _setvideomode (_DEFAULTMODE); } } parameter_file_write(){ int i,j; if(debug!=0) return(0); fds=fopen("chaos_dt.msb","wb"); for(i=0;i<16;i++){ for(j=0;j<8;j++) fputc(para[i][j],fds); } fputc(moux/256,fds); fputc(moux%256,fds); fputc(mouy/256,fds); fputc(mouy%256,fds); fputc(stp,fds); fclose(fds); } parameter_init(){ int i; mbuff_x=320; mbuff_y=200; stp=3; for(i=0;i<16;i++){ para[i][0]=i; /* Channel : 0 - 15 */ para[i][1]=0; /* [0]Off [1]Mute [2]On [3]Solo */ para[i][2]=230-10*i; /* Step : 0 - 250 */ para[i][3]=6; /* Range : 0 - 11 */ para[i][4]=254-i; /* High */ para[i][5]=255; /* Middle */ para[i][6]=255; /* Low */ para[i][7]=20; /* Volume : 0 - 31 */ } } parameter_file_read(){ int i,j; if((fds=fopen("chaos_dt.msb","rb"))!=NULL){ for(i=0;i<16;i++){ for(j=0;j<8;j++) para[i][j]=fgetc(fds); } mbuff_x=256*fgetc(fds); mbuff_x=mbuff_x+fgetc(fds); mbuff_y=256*fgetc(fds); mbuff_y=mbuff_y+fgetc(fds); stp=fgetc(fds); fclose(fds); } else parameter_init(); if(debug!=0){ mbuff_x=20; mbuff_y=110; } for(i=0;i<16;i++) { sts[i]=0; if(para[i][1]==3) solo=1; } } volume_hit(i) int i; { old_l=left; old_x=moux; old_y=mouy; while(1){ getmouse(&right,&left,&moux,&mouy); if(left==0) break; else if(old_y!=mouy){ old_y=mouy; _setcolor(back); if(mouy<309) para[i][7]=31; else if(mouy>367) para[i][7]=1; else para[i][7]=(370-mouy)/2; _rectangle(_GFILLINTERIOR,xx+8,yy+4,xx+28,yy-64); _setcolor(front); yyy=yy-2*para[i][7]+2; _rectangle(_GBORDER,xx+9,yyy+3,xx+27,yyy-3); _rectangle(_GBORDER,xx+10,yyy+2,xx+26,yyy-2); _moveto(xx+12,yyy); _lineto(xx+24,yyy); parameter_display(i,7); send_para(i); } } } send_para(x) int x; { int i; if(msb_mode==0){ if(para[x][1]>1){ outp(0x37,6); return(0); } else{ outp(0x37,7); return(0); } } set_command(0xa9); put_data(x); if((para[x][1]==2)&&(sts[x]==0)){ put_data(1); sts[x]=1; } else if((para[x][1]==2)&&(sts[x]==1)){ put_data(0); sts[x]=1; } else if((para[x][1]==3)&&(sts[x]==0)){ put_data(1); sts[x]=1; } else if((para[x][1]==3)&&(sts[x]==1)){ put_data(0); sts[x]=1; } else{ put_data(2); sts[x]=0; } for(i=2;i<8;i++) put_data(para[x][i]); } parameter_display(i,j) int i,j; { int d,e,sk=4,yt,y_pt; if(j==50){ _setcolor(back); for(d=0;d<8;d++){ _rectangle(_GFILLINTERIOR,419,23+8*d,425,27+8*d); } _setcolor(front); _rectangle(_GBORDER,419,23+8*(stp-2),425,27+8*(stp-2)); _rectangle(_GBORDER,420,24+8*(stp-2),424,26+8*(stp-2)); } else if(j==3){ for(e=0;e<12;e++){ yt=245+e*3; _setcolor(back); if(para[i][j]==e) _setcolor(front); _moveto(xx+2*e+4,yt+1); _lineto(xx+2*e+10,yt+1); _moveto(xx+2*e+4,yt+2); _lineto(xx+2*e+10,yt+2); } _setcolor(front); return(0); } else if(j==999){ if(msb_mode==0) beep_chaos(1); myu=(double)para[disp][4]*_1st; myu=myu+(double)para[disp][5]*_2nd; myu=myu+(double)para[disp][6]*_3rd; chaos=myu; ypt=94-(int)(80.9*chaos); return(0); } else if(j==100){ _setcolor(front); if(xpt>339) d=(xpt-340)/10; else d=(xpt-10)/10+8; if(d==0) _rectangle(_GFILLINTERIOR,13,13,20,94); else if(d==40) _rectangle(_GFILLINTERIOR,410,13,415,94); else _rectangle(_GFILLINTERIOR,10+10*d,13,20+10*d,94); if(xpt>win-3-stp){ xpt=14; _rectangle(_GFILLINTERIOR,90,13,100,94); } chaos=4.0*myu*chaos*(1.0-chaos); y_pt=94-(int)(80.9*chaos); _setcolor(back); _moveto(xpt,ypt); _lineto(xpt+stp,y_pt); ypt=y_pt; xpt=xpt+stp; return(0); } sprintf(buff,"%d",para[i][j]); if(para[i][j]>99) d=0; else if(para[i][j]>9) d=1; else d=2; if((j==4)||(j==5)||(j==6)){ yt=(j-4)*32+150; _setcolor(front); _rectangle(_GFILLINTERIOR,xx+4,yt-1,xx+32,yt+17); if(disp!=i){ _setcolor(back); _rectangle(_GFILLINTERIOR,xx+5,yt,xx+31,yt+16); } symbol(xx+6+d*sk,yt,7,buff,sk*2); _setcolor(front); } else if(j==7){ _setcolor(back); _rectangle(_GFILLINTERIOR,xx+6,289,xx+30,303); sk=5; symbol(xx+4+d*sk,288,7,buff,sk*2); _setcolor(front); } else if(j==2){ if(para[i][1]==3) _setcolor(front); else _setcolor(back); _rectangle(_GFILLINTERIOR,xx+3,high+5,xx+33,high+35); _setcolor(front); if(para[i][1]==2){ _rectangle(_GBORDER,xx+3,high+5,xx+33,high+35); _rectangle(_GBORDER,xx+4,high+6,xx+32,high+34); } else if(para[i][1]==1){ _setlinestyle(0x5555); _rectangle(_GBORDER,xx+4,high+6,xx+32,high+34); _setlinestyle(0xffff); } symbol(xx+6+d*sk,high+12,7,buff,sk*2); _setcolor(front); } } screen_display(m) int m; { int i,j,yt; mouse(0); _setcolor(back); _setlinestyle(0xffff); _rectangle(_GFILLINTERIOR,0,0,639,399); _setcolor(front); _moveto(629,0); _lineto(639,10); _lineto(639,399); _lineto(10,399); _lineto(0,389); _lineto(629,389); _lineto(629,0); _lineto(0,0); _lineto(0,389); _moveto(629,389); _lineto(639,399); if(front==0){ _moveto(630,0); _lineto(639,0); _moveto(631,1); _lineto(639,1); _moveto(632,2); _lineto(639,2); _moveto(633,3); _lineto(639,3); _moveto(634,4); _lineto(639,4); _moveto(635,5); _lineto(639,5); _moveto(636,6); _lineto(639,6); _moveto(637,7); _lineto(639,7); _moveto(638,8); _lineto(639,8); _moveto(639,9); _lineto(639,9); _moveto(0,390); _lineto(0,390); _moveto(0,391); _lineto(1,391); _moveto(0,392); _lineto(2,392); _moveto(0,393); _lineto(3,393); _moveto(0,394); _lineto(4,394); _moveto(0,395); _lineto(5,395); _moveto(0,396); _lineto(6,396); _moveto(0,397); _lineto(7,397); _moveto(0,398); _lineto(8,398); _moveto(0,399); _lineto(9,399); } for(i=1;i<389;i=i+3){ _moveto(629,i); _lineto(639,10+i); } for(i=1;i<629;i=i+3){ _moveto(i,389); _lineto(10+i,399); } _rectangle(_GBORDER,1,1,628,388); _rectangle(_GBORDER,2,2,627,387); _rectangle(_GBORDER,5,5,623,383); _rectangle(_GBORDER,6,6,622,382); _rectangle(_GBORDER,11,11,win,96); _rectangle(_GFILLINTERIOR,13,13,win-2,94); _rectangle(_GBORDER,win,11,win+10,21); _moveto(win+1,21); _lineto(win+5,12); _lineto(win+9,21); for(i=0;i<8;i++){ _rectangle(_GBORDER,win,21+8*i,win+10,29+8*i); } _rectangle(_GBORDER,win,85,win+10,96); _moveto(win+1,85); _lineto(win+5,95); _lineto(win+9,85); parameter_display(stp,50); _rectangle(_GBORDER,430,11,617,96); _rectangle(_GBORDER,432,13,615,51); _rectangle(_GBORDER,433,14,614,50); if(back!=0) printf("\x1b[30m"); else printf("\x1b[37m"); _settextposition(1,56); printf("カオス・シンセサイザ"); if(debug==0){ _settextposition(2,57); printf("([MSB-98] Version)"); } else{ _settextposition(2,60); printf("(解説デモ版)"); } _setcolor(front); _moveto(430,53); _lineto(617,53); symbol(434,59,7,"KAWA",8); symbol(465,59,7,"I",8); symbol(474,59,7,"Computer",7); symbol(532,59,7,"Music",7); symbol(570,59,7,"System",7); _setcolor(front); _moveto(430,80); _lineto(617,80); _rectangle(_GFILLINTERIOR,558,80,616,95); symbol(569,80,7,"init",10); for(i=0;i Graphic / Beep Only...\n\n"); while(1){ if(kbhit()!=0) break; } getch(); msb_mode=0; debug=1; _clearscreen(_GCLEARSCREEN); } else{ for(i=0;i-1;i--){ set_command(0xa9); put_data(i); put_data(1); for(j=2;j<8;j++) put_data(para[i][j]); set_command(0xa9); put_data(i); put_data(0); for(j=2;j<8;j++) put_data(para[i][j]); send_para(i); } } if(debug!=0){ demo_limit=49; m=1; } parameter_file_read(); diaplay_setting(0); setmouse(mbuff_x,mbuff_y); screen_display(m); if(msb_mode==0) beep_chaos(1); while(1){ if((kbhit()!=0)&&(getch()==0x1b)) break; if(msb_mode==0) beep_chaos(0); getmouse(&right,&left,&moux,&mouy); disp=255; mouse(0); parameter_display(0,100); mouse(1); if(back!=0) printf("\x1b[30m"); else printf("\x1b[37m"); _settextposition(5,55); printf("St=%d (%03d,%03d)",stp-1,moux,mouy); if(((moux+26)%38<35)&&(mouy>high)&&(mouy<377)){ if((moux>10)&&(moux10)&&(moux18){ j=(moux-1)/38; yyy=370-2*para[j][7]+2; if((mouy>yyy-4)&&(mouy242)&&(mouy<256)){ j=(moux+3)/38-1; xx=11+38*j; if(para[j][3]!=0) para[j][3]--; mouse(0); parameter_display(j,3); send_para(j); mouse(1); } if(((moux+23)%38<9)&&(mouy>270)&&(mouy<284)){ j=(moux+23)/38-1; xx=11+38*j; if(para[j][3]!=11){ para[j][3]++; mouse(0); parameter_display(j,3); send_para(j); mouse(1); } } if(((moux+23)%38<12)&&((mouy+24)%32<8)&&(mouy<240)){ j=(moux+23)/38-1; xx=11+38*j; k=(mouy+24)/32-2; if(((para[j][k]!=65)||(k!=4))&&(mouy>140)){ para[j][k]=0xff&(para[j][k]-1); mouse(0); parameter_display(j,k); parameter_display(disp,999); send_para(j); mouse(1); } } if(((moux+6)%38<12)&&((mouy+19)%32<8)&&(mouy<240)){ j=(moux+6)/38-1; xx=11+38*j; k=(mouy+19)/32-1; if(((para[j][k]!=255)||(k!=4))&&(mouy>140)){ para[j][k]=0xff&(para[j][k]+1); mouse(0); parameter_display(j,k); parameter_display(disp,999); send_para(j); mouse(1); } } if((mouyhigh+4)){ if((moux-14)%38<15){ j=(moux-14)/38; xx=11+38*j; k=0; mouse(0); if(para[j][1]==0){ if(solo==0) para[j][1]=2; else para[j][1]=1; } else if(para[j][1]==1){ para[j][1]=0; } else if(para[j][1]==2){ para[j][1]=0; } else if(para[j][1]==3){ para[j][1]=0; solo=0; k=1; } parameter_display(j,2); send_para(j); if(k==1){ for(l=0;l<16;l++){ if(l==j){} else if(para[l][1]==1){ para[l][1]=2; xx=11+38*l; parameter_display(l,2); send_para(l); } } } mouse(1); } if((moux+8)%38<15){ j=(moux+8)/38-1; xx=11+38*j; if(para[j][2]<250){ para[j][2]++; mouse(0); parameter_display(j,2); send_para(j); mouse(1); } } } if((mouy>high+20)&&(mouy1){ para[j][2]--; mouse(0); parameter_display(j,2); send_para(j); mouse(1); } } } } if((old_l==0)&&(left!=0)&&(mouy<99)){ if((moux>417)&&(moux<427)&&(mouy>11)&&(mouy<21)){ if(stp>2){ stp--; mouse(0); parameter_display(0,50); mouse(1); } } if((moux>417)&&(moux<427)&&(mouy>85)&&(mouy<96)){ if(stp<9){ stp++; mouse(0); parameter_display(0,50); mouse(1); } } if((moux>558)&&(moux<617)&&(mouy>80)&&(mouy<96)){ parameter_init(); break; } if((moux>431)&&(moux<557)&&(mouy>81)&&(mouy<95)){ if(back==0){ back=7; front=0; } else{ back=0; front=7; } screen_display(m); } } old_l=left; old_x=moux; old_y=mouy; } if(debug==0) parameter_file_write(); diaplay_setting(1); } beep_chaos(x) int x; { unsigned int bbx; int sh,itb; if(x==1){ b_myu=(double)para[0][4]*_1st; b_myu=b_myu+(double)para[0][5]*_2nd; b_myu=b_myu+(double)para[0][6]*_3rd; beep=b_myu; } else{ itb=1+(250-para[0][2])/8; if((b_ctr++)