home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Software Contest 2 / SOFTCONTEST2.BIN / exp / zokusei / d1.exe / ZOKU.C < prev    next >
Text File  |  1991-09-29  |  29KB  |  1,462 lines

  1. #include    <stdlib.h>
  2. #include        <stdio.h>
  3. #include    <cdr.h>
  4. #include        <time.h>
  5. #include        <egb.h>
  6. #include       <mos.h>
  7. #include       <snd.h>
  8. #include        <ctype.h>
  9. #include        <strings.h>
  10. #include    <string.h>
  11. #include    <fmc.h>
  12. #include        <dos.h>
  13. #include        <msdos.cf>
  14.  
  15. extern void chk_drv();
  16. extern void e_msgq();
  17. extern void e_msgz();
  18.  
  19. int    col;
  20. char    *ya1="▼";
  21. char    *ya2="▲";
  22. char    *cd[20]={" 1"," 2"," 3"," 4"," 5"," 6"," 7"," 8"," 9","10","11","12","13","14","15","16","17","18","19","20"};
  23. char *mdrv[]={"A","B","D","E","F","G","H","I","J","K","L","M","N","O","P","Q"};
  24.  
  25. char    *msg1="CD演奏";
  26. char    *msg2="STOP";
  27. char    *msg3="全曲";
  28. char    *msg4="DRV";
  29. char    *msg5="CHDIR";
  30. char    *msg6="ファイル属性";
  31. char    *msg7="属性変更";
  32. char    *msg8="終 了";
  33. char    *msg9= "COPYします";
  34. char    *msg10="ドライブA:へ";
  35. char    *msg11="ドライブB:へ";
  36. char    *msg12="読込側にエラー発生";
  37. char    *msg13="書込側にエラー発生";
  38. char    *msg14="属性変更出来ません!";
  39. char    *msg15="ディレクトリ属性を解除!";
  40. char    *msg16="確 認";
  41. char    *msg17="取  消";
  42. char    *msg18="了 解";
  43.  
  44. char    *zoku0="読 み 込 み 専 用";
  45. char    *zoku1="隠 し フ ァ イ ル";
  46. char    *zoku2="システムファィル";
  47. char    *zoku3="サブディレクトリ";
  48. char    *zoku4="アーカイブファイル";
  49.  
  50. char    *maru1="○";
  51. char    *maru2="●";
  52.  
  53.  
  54.  
  55. char    work[1024*5];
  56. char    mwork[1024*5];
  57. char    para[300];
  58. char    bpara[12];
  59. char    path[64];
  60. char    fname[300][14];
  61. char    fname2[15];    /*  フクシャ サレル ファィルメイ  */
  62. char    fzoku[300];
  63. char    *arg="*.*";
  64. char    init_d;
  65. int    fno;
  66. int    hno;
  67. int    lno=0;
  68. int    gno;        /* ゲンザイ ノ No (0-9 ノ カウンター )  */
  69. int    kakutei=0;    /* 0-300 ノ FAIL ノ ハイレツ デ チュウオウニ エランダ ハイレツ  */
  70. int    no_chek=0;
  71. int    dchek=1;
  72. int    cd_chek=0;
  73. int    i,ii=0;
  74. int    ff=0;
  75. int    mode=0x36;
  76. int    mode2=0x00;
  77. int    c=0;
  78. int    sw,x,y;        /*  マウス ノ ヘンスウ  */
  79. int    yyy=0;        /* Y ザヒョウ ノ カクノウ  */
  80. int    nono=0;        /* no ノ カクノウ    */
  81. int    msg_x=22;
  82. int    msg_y=359;
  83. int    left1=-1,left2=-1,left3=-1,left4=-1,left5=-1;    /* ヒダリ ノ chek  */
  84. int    righ1=-1 ,righ2=1 ,righ3=1 ,righ4=1 ,righ5=1;    /* ミギ ノ  chek   */
  85.  
  86.  
  87.  
  88. void wait()
  89. {
  90. int    i;
  91. for(i=0;i<=100000;i++);
  92. }
  93.  
  94.  
  95.  
  96. #define SHORT   short int
  97. #define LONG    long int
  98. #define ULONG   unsigned long int
  99. #define BOOL    short int
  100. #define ERR     (-1)
  101. #define SIZE (1024*10)
  102.  
  103.  
  104.  
  105.  
  106. int     type=0,strt=0,endt=0;
  107. int     vol=120,sts=0,no=0,acv=0,mos=ERR;
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. void gamen()
  115. {
  116. MOS_start(mwork,4096);
  117. MOS_resolution(0,3);
  118. MOS_setpos(320,240);
  119. EGB_init(work,4096);
  120. EGB_resolution(work,0,3);
  121. EGB_resolution(work,1,3);
  122. EGB_displayPage(work,0,1);
  123. EGB_displayStart(work,0,0,0);
  124. EGB_displayStart(work,3,640,480);
  125. EGB_color(work,0,13);
  126. EGB_color(work,1,0);
  127. EGB_writePage(work,0);
  128. EGB_writeMode(work,0);
  129. EGB_clearScreen(work);
  130. }
  131.  
  132.  
  133. typedef struct {
  134.     char    min;
  135.     char    sec;
  136.     char    frame;
  137. } CDTIME;
  138.  
  139.  
  140. CDTIME  st,ed;
  141. CDTIME  *track=NULL;
  142.  
  143.  
  144.  
  145. int     CD_open(void)
  146. {
  147.     int     i;
  148.     CDTIME  disc;
  149.  
  150.     if ( track != NULL && acv != 0 )
  151.         return 0;
  152.  
  153.     if ( track == NULL && 
  154.         (track = (CDTIME *)malloc(sizeof(CDTIME)*99)) == NULL )
  155.         return 1;
  156.  
  157.     do {
  158.         i = cdr_cdinfo(0,&type,&strt,&endt,(char *)track,(char *)&disc);
  159.     } while ( i == CDERR7 );
  160.  
  161.     if ( disc.frame-- <= 0 ) {
  162.         disc.frame = 74;
  163.  
  164.     if ( disc.sec-- <= 0 ) {
  165.         disc.sec = 59;
  166.         if ( disc.min-- <= 0 )
  167.         return 1;
  168.     }
  169.     }
  170.  
  171.     track[endt].min = disc.min;
  172.     track[endt].sec = disc.sec;
  173.     track[endt].frame = disc.frame;
  174.  
  175.     if ( i == 0 ) acv = 1;
  176.     return i;
  177. }
  178.  
  179.  
  180.  
  181.  
  182. void    CD_play(cdno)
  183. int    cdno;
  184. {
  185.     if ( cdr_mphase(0,&sts,&no,(char *)&st,(char *)&ed) != 0 )
  186.         return;
  187.     if ( sts != 0 )
  188.         return;
  189.     if ( CD_open() != 0 ) return;
  190.     if ( endt > 0 ) {
  191.     if ((track[cdno].min & 0x80) == 0 )
  192.     no = cdr_mtplay(0,(char *)&(track[cdno-1]),(char *)&(track[cdno] ));
  193.     }
  194. }
  195.  
  196.  
  197.  
  198. void    CD_play2()
  199. {
  200. int    i;
  201.     if ( cdr_mphase(0,&sts,&no,(char *)&st,(char *)&ed) != 0 )
  202.         return;
  203.     if ( sts != 0 )
  204.         return;
  205.     if ( CD_open() != 0 ) return;
  206.     if ( endt > 0 ) {
  207.         for ( i=0 ; i < endt && (track[i].min & 0x80) != 0 ; i++ );
  208.         no = cdr_mtplay(0,(char *)&(track[i]),(char *)&(track[endt]));
  209.     }
  210. }
  211.  
  212.  
  213.  
  214.  
  215.  
  216. static struct {
  217.     char    dd_dmy[21];
  218.     char    dd_z;
  219.     SHORT   dd_time,dd_date;
  220.     LONG    dd_size;
  221.     char    dd_name[13];
  222.     } dma;
  223.  
  224.  
  225.  
  226.  
  227. void symbol(int a1,int a2,int k1,int k2)
  228. {
  229. EGB_textZoom(work,0,a1,a2);
  230. EGB_textZoom(work,1,k1,k2);
  231. }
  232.  
  233.  
  234.  
  235.  
  236. void set_drive(char drv)
  237. {
  238. if(cd_chek==1 && drv==15)    e_msgq();
  239. if(drv>1)    drv++;
  240. Registers.AX.LH.H = 0x0e;
  241. Registers.DX.LH.L = drv;
  242. calldos();
  243. }
  244.  
  245.  
  246.  
  247.  
  248. char drive()
  249. {
  250. Registers.AX.LH.H = 0x19;
  251. calldos();
  252. return Registers.AX.LH.L;
  253. }
  254.  
  255.  
  256. int set_path()
  257. {
  258. char    drv;
  259. drv=drive();
  260. Registers.AX.LH.H = 0x47;
  261. Registers.DX.LH.L = drv+1;
  262. Registers.SI.R = (int)&path[0];
  263. Registers.DS.R = getds();
  264. calldos();
  265. return(drv);
  266. }
  267.  
  268.  
  269.  
  270. void set_dir()
  271. {
  272. if(no_chek!=0)
  273.     {
  274.     Registers.AX.R = 0x3b00;
  275.     Registers.DX.R = (int)&fname[kakutei];
  276.     Registers.DS.R = getds();
  277.     calldos(); 
  278.     }
  279. }
  280.  
  281.  
  282.  
  283. void set_disk()
  284. {
  285. Registers.AX.R = 0x1A00;
  286. Registers.DX.R = (int)&dma;
  287. Registers.DS.R = getds();
  288. calldos(); 
  289. }
  290.  
  291.  
  292.  
  293.  
  294. void zhen()
  295. {
  296. char    error,qq;
  297. Registers.AX.LH.H = 0x43;
  298. Registers.AX.LH.L = 0x01;
  299. Registers.CX.R = mode2;
  300. Registers.DX.R = (int)&fname[kakutei];
  301. Registers.DS.R = getds();
  302. calldos(); 
  303. error=Registers.AX.LH.L;
  304. qq=error&0x05;
  305. if(qq==0x05)
  306.     {    e_msgz();    return;    }
  307. }
  308.  
  309.  
  310.  
  311.  
  312. void box(s,x1,y1,x2,y2)
  313. int    s,x1,y1,x2,y2;
  314. {
  315.         if(s!=0)    s=0x22;
  316.         else        s=2;
  317.         EGB_paintMode(work,s);
  318.             WORD(bpara + 0)=x1;
  319.             WORD(bpara + 2)=y1;
  320.             WORD(bpara + 4)=x2;
  321.             WORD(bpara + 6)=y2;
  322.         EGB_rectangle(work,bpara);
  323. }
  324.  
  325.  
  326.  
  327. void path_print()
  328. {
  329. int    x=123,y=448,z=6;
  330. int    i;
  331. char    drv;
  332. drv=set_path();
  333. WORD(para + 0)=x;
  334. WORD(para + 2)=y;
  335. EGB_color(work,0,0);
  336. EGB_color(work,2,0);
  337. box(1,122,432,518,448);
  338. WORD(para + 6)=drv+0x41;
  339. WORD(para + 7)=':';
  340. WORD(para + 8)='\\';
  341. WORD(para + 4)=3;
  342. EGB_textSpace(work,1);
  343. EGB_textZoom(work,0,8,16);
  344. EGB_textZoom(work,1,16,16);
  345. EGB_color(work,0,14);
  346. EGB_sjisString(work,para);
  347.  
  348. WORD(para + 0)=x+27;
  349. WORD(para + 2)=y;
  350. for(i=0;i<59;i++)
  351.     {
  352.     WORD(para + z)=path[i];
  353.     if(path[i]=='\0') break;
  354.     z++;
  355.     }
  356. WORD(para + 4)=i;
  357. EGB_sjisString(work,para);
  358. }
  359.  
  360.  
  361.  
  362.  
  363. void print(int x,int y,int col,char *moji)
  364. {
  365. int    z=6;
  366. int    i;
  367.  
  368. WORD(para + 0)=x;
  369. WORD(para + 2)=y;
  370. for(i=0;i<200;i++)
  371.     {
  372.     WORD(para + z)=*(moji+i);
  373.     if(*(moji+i)=='\0') break;
  374.     z++;
  375.     }
  376. WORD(para + 4)=i;
  377. EGB_color(work,0,col);
  378. EGB_sjisString(work,para);
  379. }
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386. void f_print()
  387. {
  388. int    ch;
  389. int    col;
  390. int    x,y,z;
  391. x=482; y=142;
  392. ch=9;    
  393. MOS_disp(0);
  394. EGB_color(work,0,0);
  395. EGB_color(work,2,0);
  396. box(1,473,124,595,317);
  397. symbol(8,16,16,16);
  398. EGB_textSpace(work,1);
  399. col=14;
  400. if(ff-1<ch)    ch=ff-1;
  401. for(fno=0;fno<=ch;fno++)
  402.     {    
  403.     z=0x10&fzoku[fno];
  404.     if(z==0x10)    col=8;
  405.     EGB_fontStyle(work,0);
  406.     z=0x02&fzoku[fno];
  407.     if(z==0x02)        EGB_fontStyle(work,64);
  408.     print(x,y,col,fname[fno]);
  409.     y=y+19;    col=14;
  410.     EGB_fontStyle(work,0);
  411.     }
  412. EGB_color(work,0,0);
  413. EGB_color(work,2,0);
  414. box(1,204,243,436,278);
  415. MOS_disp(1);
  416. no_chek=0;
  417. hno=0;    lno=ch;
  418. }
  419.  
  420.  
  421.  
  422.  
  423.  
  424. int dir()
  425. {
  426. int    count;
  427. int    z;
  428. for(count=0;count<300;count++)
  429. {
  430. for(c=0;c<=13;c++)    fname[count][c]='\0';
  431. fzoku[count]=0;
  432. }
  433.  
  434. Registers.AX.R = 0x4E00;
  435. Registers.CX.R = mode;
  436. Registers.DX.R = (int)arg;
  437. Registers.DS.R = getds();
  438. calldos();
  439. ff=0;
  440. if ( (Registers.Flags & 0x0001) != 0 )      return(1);
  441. z=dma.dd_z&mode;
  442. if( z!=0 )
  443. {
  444. for(c=0;c<=13;c++)    fname[ff][c]=dma.dd_name[c];
  445. fzoku[ff]=dma.dd_z;
  446. ff++;
  447. }
  448. else if(righ1==-1)
  449.     {
  450.     if(dma.dd_z==0x00)
  451.         {
  452.         for(c=0;c<=13;c++)    fname[ff][c]=dma.dd_name[c];
  453.         fzoku[ff]=dma.dd_z;
  454.         ff++;
  455.         }
  456.     }
  457.  
  458.  
  459. while(ff<300)
  460.     {
  461.     Registers.AX.R = 0x4F00;
  462.     calldos();
  463.     if ( (Registers.Flags & 0x0001) != 0 )      return(0);
  464.     else 
  465.     z=dma.dd_z&mode;
  466.     if( z!=0 )
  467.         {
  468.         for(c=0;c<=13;c++)    fname[ff][c]=dma.dd_name[c];
  469.         fzoku[ff]=dma.dd_z;
  470.         ff++;
  471.         }
  472.     else if(righ1==-1)
  473.         {
  474.         if(dma.dd_z==0x00)
  475.             {
  476.             for(c=0;c<=13;c++)    fname[ff][c]=dma.dd_name[c];
  477.             fzoku[ff]=dma.dd_z;
  478.             ff++;
  479.             }
  480.         }
  481.  
  482.     }
  483.  
  484. }
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494. void line(int x1, int y1, int x2, int y2)
  495. {
  496. WORD(para + 0)=2;
  497. WORD(para + 2)=x1;
  498. WORD(para + 4)=y1;
  499. WORD(para + 6)=x2;
  500. WORD(para + 8)=y2;
  501. EGB_unConnect(work,para);
  502. }
  503.  
  504.  
  505. void maru(int s, int x, int y)
  506. {
  507. if(s==1)
  508.     {
  509.     EGB_color(work,0,0);
  510.     EGB_color(work,2,0);
  511.     box(1,x,y-16,x+16,y);
  512.     print(x,y,10,maru2);
  513.     print(x,y,1,maru1);
  514.     }
  515. else    {
  516.     EGB_color(work,0,0);
  517.     EGB_color(work,2,0);
  518.     box(1,x,y-16,x+16,y);
  519.     print(x,y,1,maru1);
  520.     }
  521. }
  522.  
  523.  
  524. void waku()
  525. {
  526. MOS_disp(0);
  527. EGB_penSize(work,2);    
  528. EGB_color(work,0,4);
  529. box(1,20,320,200,410);
  530. line(20,340,200,340);
  531. EGB_color(work,0,3);
  532. print(36,338,4,"HELPメッセージ");
  533. MOS_horizon(20,200);
  534. MOS_vertical(320,410);
  535. }
  536.  
  537.  
  538.  
  539. void help()
  540. {
  541. int    ugx=25;
  542. int    ugy=30;
  543. EGB_displayPage(work,0,1);
  544. EGB_writePage(work,1);
  545. EGB_clearScreen(work);
  546. symbol(12,24,24,24);
  547. print(75,ugy,14,"ファイル属性変更プログラム HELP画面");
  548. symbol(8,16,16,16);
  549. ugy=ugy+30;
  550. print(ugx,ugy,15," ○  読 み 込 み 専 用  ○←  この属性の条件に従いファィルセレクタへ");
  551. ugy=ugy+20;
  552. print(ugx,ugy,15," ○  隠 し フ ァ イ ル  ○←  ファイル名が表示されます。");
  553. ugy=ugy+20;
  554. print(ugx,ugy,15," ↑         :");
  555. ugy=ugy+20;
  556. print(ugx,ugy,15,"この条件はファィルセレクタからファィル名をクリックし選択した時のファィル");
  557. ugy=ugy+20;
  558. print(ugx,ugy,15,"属性が表示されますが、属性を変更する場合にも利用します。");
  559. ugy=ugy+35;
  560. print(ugx,ugy,15,"ディレクトリ属性のファィルをクリックしCHDIRをクリックすると");
  561. ugy=ugy+20;
  562. print(ugx,ugy,15,"ディレクトリの移動が出来ます");
  563. ugy=ugy+35;
  564. print(ugx,ugy,15,"ドライブ切り換えとCD演奏は直接、希望の番号をクリックして下さい");
  565. ugy=ugy+35;
  566. print(ugx,ugy,15,"通常ファイル←→サブディレクトリの属性は変更できませんので注意して下さい。");
  567. ugy=ugy+35;
  568. print(ugx,ugy,15,"サブディレクトリ属性のファィルを隠しファィルなどに変更したい場合には");
  569. ugy=ugy+20;
  570. print(ugx,ugy,15,"サブディレクトリ左側の○を白丸にして、希望の属性の左側の○を赤丸に変更後");
  571. ugy=ugy+20;
  572. print(ugx,ugy,15,"に属性変更をクリックして下さい。");
  573. ugy=ugy+35;
  574. print(ugx,ugy,15,"COPYと属性変更は誤操作防止の為、マウスの左右のボタンを同時にクリック");
  575. ugy=ugy+20;
  576. print(ugx,ugy,15,"しなければ動かないようにプログラムしてあります。");
  577. ugy=ugy+20;
  578. print(ugx,ugy,15,"この場合、先に右ボタンをクリックしておいて、そのままの状態で左ボタンを");
  579. ugy=ugy+20;
  580. print(ugx,ugy,15,"クリックすると上手に実行できます。");
  581. ugy=ugy+30;
  582. print(ugx+30,ugy,10,"マウスの左右のボタンを同時にクリックすると元の画面に戻ります!!");
  583.  
  584. wait();
  585. EGB_displayPage(work,0,1);
  586. EGB_writePage(work,0);
  587. }
  588.  
  589.  
  590.  
  591.  
  592. void ura_gamen()
  593. {
  594. EGB_displayPage(work,0,2);
  595. EGB_writePage(work,1);
  596. MOS_horizon(20,200);
  597. MOS_vertical(340,410);
  598.  
  599. do
  600. {
  601. MOS_rdpos(&sw,&x,&y);
  602. } while ( sw!=3 );
  603.  
  604. EGB_displayPage(work,0,1);
  605. EGB_writePage(work,0);
  606. MOS_horizon(20,200);
  607. MOS_vertical(320,410);
  608. }
  609.  
  610.  
  611.  
  612. void kaku()
  613. {
  614. int    flag=0;
  615. EGB_color(work,0,3);
  616. EGB_color(work,2,0);
  617. box(1,80,384,140,404);
  618. print(84,401,4,msg16);
  619. MOS_disp(1);
  620. do
  621. {
  622. MOS_rdpos(&sw,&x,&y);
  623. if(((x>80)&&(x<140))&&((y>384)&&(y<404))&&(sw==1))    flag=1;
  624. if(((x>20)&&(x<200))&&((y>320)&&(y<340))&&(sw==1))    ura_gamen();
  625.  
  626. } while ( flag!=1 );
  627. EGB_color(work,0,0);
  628. EGB_color(work,2,0);
  629. MOS_disp(0);
  630. box(1,20,320,200,410);
  631. MOS_disp(1);
  632. MOS_horizon(0,630);
  633. MOS_vertical(0,470);
  634. }
  635.  
  636.  
  637. int kaku2()
  638. {
  639. int    flag=0;
  640. int    ret;
  641. EGB_color(work,0,3);
  642. EGB_color(work,2,0);
  643. box(1,40,384,100,405);
  644. box(1,120,384,180,405);
  645. print(45,402,4,msg17);
  646. print(125,402,4,msg18);
  647. MOS_disp(1);
  648. do
  649. {
  650. MOS_rdpos(&sw,&x,&y);
  651. if(((x>40)&&(x<100))&&((y>384)&&(y<404))&&(sw==1))    {flag=1; ret=1;}
  652. if(((x>120)&&(x<180))&&((y>384)&&(y<404))&&(sw==1))    {flag=1; ret=0;}
  653. if(((x>20)&&(x<200))&&((y>320)&&(y<340))&&(sw==1))    ura_gamen();
  654. } while ( flag!=1 );
  655. EGB_color(work,0,0);
  656. EGB_color(work,2,0);
  657. MOS_disp(0);
  658. box(1,20,320,200,410);
  659. MOS_disp(1);
  660. MOS_horizon(0,630);
  661. MOS_vertical(0,470);
  662. return(ret);
  663. }
  664.  
  665.  
  666. int drv_msg1()
  667. {
  668. int    ret;
  669. waku();
  670. symbol(8,16,16,16);
  671. print(msg_x+40,msg_y,9,msg11);
  672. print(msg_x+40,msg_y+20,9,msg9);
  673. ret=kaku2();
  674. return(ret);
  675. }
  676.  
  677. int drv_msg2()
  678. {
  679. int    ret;
  680. waku();
  681. symbol(8,16,16,16);
  682. print(msg_x+40,msg_y,9,msg10);
  683. print(msg_x+40,msg_y+20,9,msg9);
  684. ret=kaku2();
  685. return(ret);
  686. }
  687.  
  688.  
  689. void e_msg1()
  690. {
  691. waku();
  692. symbol(8,16,16,16);
  693. print(msg_x+14,msg_y,9,msg12);
  694. print(msg_x+14,msg_y+20,9,"サブディレクトリを選択?");
  695. kaku();
  696. }
  697.  
  698. void e_msg2()
  699. {
  700. waku();
  701. symbol(8,16,16,16);
  702. print(msg_x+14,msg_y,9,msg13);
  703. print(msg_x+14,msg_y+20,9,"ライトプロテクト?");
  704. kaku();
  705. }
  706.  
  707. void e_msgf()
  708. {
  709. waku();
  710. symbol(8,16,16,16);
  711. print(msg_x+5,msg_y+10,9,"ファイルを選んで下さい");
  712. kaku();
  713. }
  714.  
  715. void e_msgw()
  716. {
  717. waku();
  718. symbol(8,16,16,16);
  719. print(msg_x+10,msg_y,9,"書き込みエラー発生");
  720. print(msg_x+10,msg_y+19,9,"ディスク容量不足?");
  721. kaku();
  722. }
  723.  
  724. void e_msgq()
  725. {
  726. waku();
  727. symbol(8,16,16,16);
  728. print(msg_x+5,msg_y,9,"CD演奏中はQ:ドライブ");
  729. print(msg_x+40,msg_y+19,9,"は使えません");
  730. kaku();
  731. }
  732.  
  733. void e_msgz()
  734. {
  735. waku();
  736. symbol(8,16,16,16);
  737. print(msg_x+6,msg_y,9,msg14);
  738. print(msg_x+8,msg_y+19,9,msg15);
  739. kaku();
  740. }
  741.  
  742.  
  743.  
  744.  
  745. void e_msgm()
  746. {
  747. waku();
  748. symbol(8,16,16,16);
  749. print(msg_x+2,msg_y,9,"マウスを右・左の順に両方");
  750. print(msg_x+2,msg_y+19,9,"をクリックすると実行!!");
  751. kaku();
  752. }
  753.  
  754.  
  755.  
  756.  
  757. void menu()
  758. {
  759. int    i;
  760. symbol(12,24,24,24);
  761. print(160,45,13,"ファイル属性変更プログラム");
  762. symbol(8,16,16,16);
  763. EGB_penSize(work,5);    
  764. EGB_color(work,0,13);
  765. box(0,40,56,600,80);        /* CD */
  766. box(0,60,100,120,282);        /* DRV */
  767. box(0,470,100,600,344);        /* chdir */
  768. box(0,200,100,440,220);        /* メッセージ  */
  769. box(0,200,240,440,304);        /* fail */
  770. box(0,340,320,420,350);        /* ゾクセイ */
  771. box(0,260,370,380,400);        /* end */
  772. box(0,120,430,520,450);        /* path */
  773. box(0,220,320,300,350);        /* copy */
  774.  
  775. EGB_penSize(work,2);    
  776. line(60,120,120,120);
  777. line(470,120,600,120);
  778. line(470,320,600,320);
  779. line(200,280,440,280);
  780. line(320,280,320,300);
  781. line(536,320,536,340);
  782. EGB_penSize(work,1);    
  783. int    x1=100,y1=56,y2=80,x2;
  784. for(x1=120;x1<=520;x1=x1+20)  line(x1,y1,x1,y2);
  785. x1=x1+20;
  786. line(x1,y1,x1,y2);
  787. line(90,120,90,280);
  788. x1=60;y1=140;x2=120;
  789. for(y1=120;y1<=260;y1=y1+20) line(x1,y1,x2,y1);
  790. symbol(8,16,16,16);
  791. i=0;
  792. col=1;
  793. for(x1=123;x1<=503;x1=x1+20)    { print(x1,76,col,cd[i]);      i++;    }
  794. i=0;
  795. for(y1=139;y1<=279;y1=y1+20)    { print(70,y1,col,mdrv[i]);    i++;    }
  796. for(y1=139;y1<=279;y1=y1+20)    { print(98,y1,col,mdrv[i]);    i++;    }
  797. print(50,76,col,msg1);        /*  cd エン  */
  798. print(525,76,col,msg2);        /*  stop   */
  799. print(564,76,col,msg3);        /*  レンゾク  */
  800. print(66,119,col,msg4);        /*  drv   */
  801. print(495,119,col,msg5);        /*  chdir    */
  802. print(347,342,col,msg7);        /*  ゾクヘンコウ     */
  803. print(227,342,col,"COPY");        /*  copy     */
  804.  
  805. symbol(10,20,20,20);
  806. print(295,394,col,msg8);        /*  end        */
  807. symbol(8,16,16,16);
  808.  
  809. print(245,125,col,zoku0);
  810. print(245,146,col,zoku1);
  811. print(245,167,col,zoku2);
  812. print(245,188,col,zoku3);
  813. print(245,209,col,zoku4);
  814.  
  815. maru(0,215,125);
  816. maru(0,215,146);
  817. maru(0,215,167);
  818. maru(0,215,188);
  819. maru(0,215,209);
  820.  
  821. maru(0,410,125);
  822. maru(1,410,146);
  823. maru(1,410,167);
  824. maru(1,410,188);
  825. maru(1,410,209);
  826.  
  827. print(250,299,col,ya2);
  828. print(375,299,col,ya1);
  829.  
  830. print(500,339,col,ya2);
  831. print(560,339,col,ya1);
  832.  
  833. }
  834.  
  835.  
  836.  
  837. void uproll()
  838. {
  839. int    col,z;
  840. if(lno<ff-1)
  841. {
  842.     MOS_disp(0);    col=10;    print(560,339,col,ya1);
  843.     hno++;    lno++;    fno=lno;  nono--;    yyy=yyy-19;
  844.     if(nono<0)    { nono=0;    no_chek=0;    yyy=yyy+19;    }
  845.  
  846.     WORD(para+0)=473;
  847.     WORD(para+2)=124;
  848.     WORD(para+4)=597;
  849.     WORD(para+6)=313;
  850.     EGB_partScroll(work,1,0,-19,para);
  851.     z=0x10&fzoku[fno];
  852.     col=14;
  853.     if(z==0x10)    col=8;
  854.     EGB_fontStyle(work,0);
  855.     z=0x02&fzoku[fno];
  856.     if(z==0x02)        EGB_fontStyle(work,64);
  857.     EGB_textSpace(work,1);
  858.     print(482,313,col,fname[fno]);
  859.     EGB_fontStyle(work,0);
  860.     col=1;    print(560,339,col,ya1);
  861.     MOS_disp(1);
  862.  
  863. }
  864. return;
  865. }
  866.  
  867.  
  868.  
  869.  
  870. void dwroll()
  871. {
  872. int    col,z;
  873. if(hno>0)    
  874. {
  875.     MOS_disp(0);    col=10;    print(500,339,col,ya2);
  876.     hno--;    lno--;    fno=hno;  nono++;      yyy=yyy+19;
  877.     if(nono>9)    { nono=9;    no_chek=0;    yyy=yyy-19;    }
  878.       WORD(para+0)=473;
  879.     WORD(para+2)=124;
  880.     WORD(para+4)=597;
  881.     WORD(para+6)=313;
  882.     EGB_partScroll(work,1,0,19,para);
  883.     z=0x10&fzoku[fno];
  884.     col=14;
  885.     if(z==0x10)    col=8;
  886.     EGB_fontStyle(work,0);
  887.     z=0x02&fzoku[fno];
  888.     if(z==0x02)        EGB_fontStyle(work,64);
  889.     EGB_textSpace(work,1);
  890.     print(482,142,col,fname[fno]);
  891.     EGB_fontStyle(work,0);
  892.     col=1;    print(500,339,col,ya2);
  893.     MOS_disp(1);
  894.  
  895. }
  896. return;
  897. }
  898.  
  899.  
  900.  
  901. void palette(int col,int b,int r,int g)
  902. {
  903. char    bul,red,grn;
  904. bul=(char)b;
  905. red=(char)r;
  906. grn=(char)g;
  907. DWORD(para+0)=1;
  908. DWORD(para+4)=col;
  909. BYTE(para+8)=bul;
  910. BYTE(para+9)=red;
  911. BYTE(para+10)=grn;
  912. BYTE(para+11)=0;
  913. EGB_palette(work,1,para);
  914. }
  915.  
  916.  
  917. void pal_init()
  918. {
  919. palette(1,255,0,175);    /* アオ */
  920. palette(2,0,255,100);    /* アカ */
  921. palette(3,255,255,0);    /* ムラサキ */
  922. palette(4,0,0,255);    /* ミドリ */
  923. palette(8,170,255,255);    /* キイロ */
  924. palette(9,0,255,147);    /* オレンジ  */
  925. palette(10,80,255,80);    /* ピンク  */
  926. }
  927.  
  928.  
  929.  
  930.  
  931. void zoku_chek()
  932. {
  933. char    z;
  934. z=0x01&fzoku[kakutei];
  935. if(z==0x01)    {left1=1;    maru(1,215,125);    }
  936.     else    {left1=-1;    maru(0,215,125);    }
  937.  
  938. z=0x02&fzoku[kakutei];
  939. if(z==0x02)    {left2=1;    maru(1,215,146);    }
  940.     else    {left2=-1;    maru(0,215,146);    }
  941.  
  942. z=0x04&fzoku[kakutei];
  943. if(z==0x04)    {left3=1;    maru(1,215,167);    }
  944.     else    {left3=-1;    maru(0,215,167);    }
  945.  
  946. z=0x10&fzoku[kakutei];
  947. if(z==0x10)    {left4=1;    maru(1,215,188);    }
  948.     else    {left4=-1;    maru(0,215,188);    }
  949.  
  950. z=0x20&fzoku[kakutei];
  951. if(z==0x20)    {left5=1;    maru(1,215,209);    }
  952.     else    {left5=-1;    maru(0,215,209);    }
  953.  
  954. }
  955.  
  956.  
  957.  
  958. void read_f(int no,int y)
  959. {
  960. if(ff>no)
  961. {
  962. int    x,z,col;
  963. x=480;
  964. MOS_disp(0);
  965. if(no_chek==1)
  966.     {
  967.     EGB_color(work,0,0);        /*ゲンザイ エラバレテイレバ ハンテン ヲ ケス  */
  968.     EGB_color(work,2,0);
  969.     MOS_disp(0);
  970.     box(1,480,yyy-16,591,yyy-1);
  971.     z=0x10&fzoku[hno+nono];
  972.     col=14;
  973.     if(z==0x10)    col=8;
  974.     EGB_fontStyle(work,0);
  975.     z=0x02&fzoku[hno+nono];
  976.     if(z==0x02)        EGB_fontStyle(work,64);
  977.     EGB_textSpace(work,1);
  978.     print(482,yyy,col,fname[hno+nono]);
  979.     EGB_fontStyle(work,0);
  980.     }
  981. no_chek=1;
  982. EGB_color(work,0,1);
  983. EGB_color(work,2,1);
  984. yyy=y;    nono=no;
  985. box(1,480,y-16,591,y-1);
  986. z=0x10&fzoku[hno+no];
  987. col=14;
  988. if(z==0x10)    col=8;
  989. z=0x02&fzoku[hno+nono];
  990. if(z==0x02)        EGB_fontStyle(work,64);
  991. EGB_textSpace(work,1);
  992. print(482,y,col,fname[hno+no]);
  993. EGB_fontStyle(work,0);
  994. EGB_color(work,0,0);
  995. EGB_color(work,2,0);
  996. box(1,204,243,436,278);
  997. symbol(16,32,32,32);
  998. EGB_textSpace(work,1);
  999. col=14;
  1000. print(220,277,col,fname[hno+no]);
  1001. symbol(8,16,16,16);
  1002. kakutei=hno+no;
  1003. zoku_chek();
  1004. MOS_disp(1);
  1005. }
  1006. }
  1007.  
  1008.  
  1009.  
  1010.  
  1011. void fail(int y)
  1012. {
  1013. if(y<=142)    {    gno=0;    read_f(gno,142);    return;}
  1014. if(y<=142+19)    {    gno=1;    read_f(gno,142+19);    return;}
  1015. if(y<=142+19*2)    {    gno=2;    read_f(gno,142+19*2);    return;}
  1016. if(y<=142+19*3)    {    gno=3;    read_f(gno,142+19*3);    return;}
  1017. if(y<=142+19*4)    {    gno=4;    read_f(gno,142+19*4);    return;}
  1018. if(y<=142+19*5)    {    gno=5;    read_f(gno,142+19*5);    return;}
  1019. if(y<=142+19*6)    {    gno=6;    read_f(gno,142+19*6);    return;}
  1020. if(y<=142+19*7)    {    gno=7;    read_f(gno,142+19*7);    return;}
  1021. if(y<=142+19*8)    {    gno=8;    read_f(gno,142+19*8);    return;}
  1022. if(y<=144+19*9)    {    gno=9;    read_f(gno,142+19*9);    return;}
  1023.  
  1024. }
  1025.  
  1026.  
  1027. void mdwroll()
  1028. {
  1029. int dy;
  1030. if(kakutei<ff-1)
  1031. {
  1032. MOS_disp(0);
  1033. print(375,299,10,ya1);
  1034. dy=yyy+19;
  1035. if(dy>=144+19*9)    { uproll();    dy=dy-19;    fail(dy);    }
  1036.     else    fail(dy);
  1037. MOS_disp(0);
  1038. print(375,299,1,ya1);
  1039. MOS_disp(1);
  1040. }
  1041. }
  1042.  
  1043.  
  1044.  
  1045. void muproll()
  1046. {
  1047. int dy;
  1048. if(kakutei>0)
  1049. {
  1050. MOS_disp(0);
  1051. print(250,299,10,ya2);
  1052. dy=yyy-19;
  1053. if(dy<=123)    { dwroll();    dy=dy+19;        fail(dy);    }
  1054.     else    fail(dy);
  1055.  
  1056. MOS_disp(0);
  1057. print(250,299,1,ya2);
  1058. MOS_disp(1);
  1059. }
  1060. }
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066. void set_zoku(int z)
  1067. {
  1068. MOS_disp(0);
  1069. switch(z)
  1070.     {
  1071.     case    1:    righ1=righ1*-1;
  1072.         if(righ1==1)    maru(1,410,125);
  1073.             else    maru(0,410,125);
  1074.         break;    
  1075.     case    2:    righ2=righ2*-1;
  1076.         if(righ2==1)    maru(1,410,146);
  1077.             else    maru(0,410,146);
  1078.         break;    
  1079.  
  1080.     case    3:    righ3=righ3*-1;
  1081.         if(righ3==1)    maru(1,410,167);
  1082.             else    maru(0,410,167);
  1083.         break;    
  1084.  
  1085.     case    4:    righ4=righ4*-1;
  1086.         if(righ4==1)    maru(1,410,188);
  1087.             else    maru(0,410,188);
  1088.         break;    
  1089.  
  1090.     case    5:    righ5=righ5*-1;
  1091.         if(righ5==1)    maru(1,410,209);
  1092.             else    maru(0,410,209);
  1093.         break;
  1094.     }
  1095.  
  1096. mode=0;
  1097. if(righ1==1)    mode=mode+0x01;
  1098. if(righ2==1)    mode=mode+0x02;
  1099. if(righ3==1)    mode=mode+0x04;
  1100. if(righ4==1)    mode=mode+0x10;
  1101. if(righ5==1)    mode=mode+0x20;
  1102. dir();
  1103. f_print();
  1104. path_print();
  1105. MOS_disp(1);
  1106. }
  1107.  
  1108.  
  1109. void set_zoku2(int z)
  1110. {
  1111. MOS_disp(0);
  1112. switch(z)
  1113.     {
  1114.     case    1:    left1=left1*-1;
  1115.         if(left1==1)    maru(1,215,125);
  1116.             else    maru(0,215,125);
  1117.         break;    
  1118.     case    2:    left2=left2*-1;
  1119.         if(left2==1)    maru(1,215,146);
  1120.             else    maru(0,215,146);
  1121.         break;    
  1122.  
  1123.     case    3:    left3=left3*-1;
  1124.         if(left3==1)    maru(1,215,167);
  1125.             else    maru(0,215,167);
  1126.         break;    
  1127.  
  1128.     case    4:    left4=left4*-1;
  1129.         if(left4==1)    maru(1,215,188);
  1130.             else    maru(0,215,188);
  1131.         break;    
  1132.  
  1133.     case    5:    left5=left5*-1;
  1134.         if(left5==1)    maru(1,215,209);
  1135.             else    maru(0,215,209);
  1136.         break;
  1137.     }
  1138.  
  1139. mode2=0;
  1140. if(left1==1)    mode2=mode2+0x01;
  1141. if(left2==1)    mode2=mode2+0x02;
  1142. if(left3==1)    mode2=mode2+0x04;
  1143. if(left4==1)    mode2=mode2+0x10;
  1144. if(left5==1)    mode2=mode2+0x20;
  1145. MOS_disp(1);
  1146. wait();
  1147. }
  1148.  
  1149.  
  1150.  
  1151.  
  1152. void chdir()
  1153. {
  1154. MOS_disp(0);
  1155. EGB_textSpace(work,0);
  1156. print(495,119,10,msg5);
  1157. EGB_textSpace(work,1);
  1158. set_dir();
  1159. dir();
  1160. f_print();
  1161. path_print();
  1162. MOS_disp(0);
  1163. EGB_textSpace(work,0);
  1164. print(495,119,1,msg5);
  1165. EGB_textSpace(work,1);
  1166. MOS_disp(1);
  1167. kakutei=0;    yyy=0;    nono=0;
  1168. }
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178. void chdrv(int x, int y)
  1179. {
  1180. char    co=0;
  1181. if(x>90)    co=8;
  1182. if(y<140)    {    co=co+0;    set_drive(co);    return;}
  1183. if(y<160)    {    co=co+1;    set_drive(co);    return;}
  1184. if(y<180)    {    co=co+2;    set_drive(co);    return;}
  1185. if(y<200)    {    co=co+3;    set_drive(co);    return;}
  1186. if(y<220)    {    co=co+4;    set_drive(co);    return;}
  1187. if(y<240)    {    co=co+5;    set_drive(co);    return;}
  1188. if(y<260)    {    co=co+6;    set_drive(co);    return;}
  1189. if(y<280)    {    co=co+7;    set_drive(co);    return;}
  1190. yyy=0;    nono=0;    kakutei=0;    no_chek=0;
  1191. }
  1192.  
  1193.  
  1194. void chk_drv()
  1195. {
  1196. char    no;
  1197. int    col,y1,i=0;
  1198. no=drive();
  1199. col=1;
  1200. MOS_disp(0);
  1201. EGB_color(work,0,0);        /* メインファィルを消す */
  1202. EGB_color(work,2,0);
  1203. box(1,204,243,436,278);
  1204. for(y1=139;y1<=279;y1=y1+20)    { print(70,y1,col,mdrv[i]);    i++;    }
  1205. for(y1=139;y1<=279;y1=y1+20)    { print(98,y1,col,mdrv[i]);    i++;    }
  1206. if(no>1)    no--;
  1207. col=10;
  1208. switch(no)
  1209.     {
  1210.     case    0:    print(70,139,col,mdrv[0]);    break;
  1211.     case    1:    print(70,139+20,col,mdrv[1]);    break;
  1212.     case    2:    print(70,139+20*2,col,mdrv[2]);    break;
  1213.     case    3:    print(70,139+20*3,col,mdrv[3]);    break;
  1214.     case    4:    print(70,139+20*4,col,mdrv[4]);    break;
  1215.     case    5:    print(70,139+20*5,col,mdrv[5]);    break;
  1216.     case    6:    print(70,139+20*6,col,mdrv[6]);    break;
  1217.     case    7:    print(70,139+20*7,col,mdrv[7]);    break;
  1218.     case    8:    print(98,139,col,mdrv[8]);    break;
  1219.     case    9:    print(98,139+20,col,mdrv[9]);    break;
  1220.     case    10:    print(98,139+20*2,col,mdrv[10]);    break;
  1221.     case    11:    print(98,139+20*3,col,mdrv[11]);    break;
  1222.     case    12:    print(98,139+20*4,col,mdrv[12]);    break;
  1223.     case    13:    print(98,139+20*5,col,mdrv[13]);    break;
  1224.     case    14:    print(98,139+20*6,col,mdrv[14]);    break;
  1225.     case    15:    print(98,139+20*7,col,mdrv[15]);    break;
  1226.     }
  1227.  
  1228. dchek=no;
  1229. MOS_disp(1);
  1230. dir();
  1231. f_print();
  1232. path_print();
  1233. }
  1234.  
  1235.  
  1236.  
  1237. void t_fname(int dchek)
  1238. {
  1239. int    i=2,ii;
  1240. if(dchek==0)    {fname2[0]='B';    fname2[1]=':';    }
  1241.     else    {fname2[0]='A';    fname2[1]=':';    }
  1242. for(ii=0;ii<14;ii++)
  1243.     {
  1244.     fname2[i]=fname[kakutei][ii];
  1245.     if(fname[kakutei][ii]=='\0')    break;
  1246.     i++;
  1247.     }
  1248. }
  1249.  
  1250.  
  1251. void cdplay(int xx)
  1252. {
  1253. int    no=0;
  1254. if(cd_chek==1)    return;        /* エンソウ チュウ ハ ナニモシナイ  */
  1255. EGB_textSpace(work,0);
  1256. cd_chek=1;
  1257. MOS_disp(0);
  1258. if(xx<140){print(123,76,10,cd[0]);      CD_play(1); return;}
  1259. if(xx<160){print(123+20,76,10,cd[1]);   CD_play(2); return;}
  1260. if(xx<180){print(123+20*2,76,10,cd[2]); CD_play(3); return;}
  1261. if(xx<200){print(123+20*3,76,10,cd[3]); CD_play(4); return;}
  1262. if(xx<220){print(123+20*4,76,10,cd[4]); CD_play(5); return;}
  1263. if(xx<240){print(123+20*5,76,10,cd[5]); CD_play(6); return;}
  1264. if(xx<260){print(123+20*6,76,10,cd[6]); CD_play(7); return;}
  1265. if(xx<280){print(123+20*7,76,10,cd[7]); CD_play(8); return;}
  1266. if(xx<300){print(123+20*8,76,10,cd[8]); CD_play(9); return;}
  1267. if(xx<320){print(123+20*9,76,10,cd[9]); CD_play(10);return;}
  1268. if(xx<340){print(123+20*10,76,10,cd[10]);CD_play(11);return;}
  1269. if(xx<360){print(123+20*11,76,10,cd[11]);CD_play(12);return;}
  1270. if(xx<380){print(123+20*12,76,10,cd[12]);CD_play(13);return;}
  1271. if(xx<400){print(123+20*13,76,10,cd[13]);CD_play(14);return;}
  1272. if(xx<420){print(123+20*14,76,10,cd[14]);CD_play(15);return;}
  1273. if(xx<440){print(123+20*15,76,10,cd[15]);CD_play(16);return;}
  1274. if(xx<460){print(123+20*16,76,10,cd[16]);CD_play(17);return;}
  1275. if(xx<480){print(123+20*17,76,10,cd[17]);CD_play(18);return;}
  1276. if(xx<500){print(123+20*18,76,10,cd[18]);CD_play(19);return;}
  1277. if(xx<520){print(123+20*19,76,10,cd[19]);CD_play(20);return;}
  1278. if(xx<560){print(525,76,10,msg2); cdr_mstop(0);      return;}
  1279. if(xx>560 && xx<597)  {  print(564,76,10,msg3);    CD_play2();      return;}
  1280. }
  1281.  
  1282.  
  1283. void cdstop()
  1284. {
  1285. EGB_textSpace(work,0);
  1286. MOS_disp(0);
  1287. print(525,76,10,msg2);
  1288. cdr_mstop(0);
  1289. MOS_disp(1);
  1290. EGB_textSpace(work,1);
  1291. }
  1292.  
  1293.  
  1294.  
  1295. void zhen2()
  1296. {
  1297. MOS_disp(0);
  1298. EGB_textSpace(work,0);
  1299. print(347,342,10,msg7);        /*  ゾクヘンコウ     */
  1300. EGB_textSpace(work,1);
  1301.     if(no_chek!=0)    zhen();        /*  ファィル ヲ エランデイレバ  コピー   */
  1302.     else         e_msgf();
  1303. EGB_textSpace(work,0);
  1304. print(347,342,1,msg7);        /*  ゾクヘンコウ     */
  1305. EGB_textSpace(work,1);
  1306. MOS_disp(1);
  1307. }
  1308.  
  1309.  
  1310.  
  1311.  
  1312. void main()
  1313. {
  1314. char    swork[17000];
  1315. int    flag=0,x1;
  1316. int    chopen1,chopen2;
  1317. int    ret;
  1318. int    e_write=0;
  1319.  
  1320. SND_init(swork);
  1321. SND_elevol_init();
  1322. SND_pcm_mode_set(8);
  1323. SND_elevol_all_mute(-1);
  1324. SND_elevol_mute(0xff);
  1325. SND_elevol_set(1,127,127);
  1326.  
  1327. FILE *fp1,*fp2 ;
  1328. char buf[SIZE];
  1329.  
  1330.  
  1331. init_d=drive();
  1332. gamen();
  1333. help();
  1334. MOS_horizon(0,630);
  1335. MOS_vertical(0,470);
  1336. pal_init();
  1337. menu();
  1338. MOS_disp(1);
  1339. set_disk();
  1340. chk_drv();    /*   dir();f_print();path_print(); ヲ フクム   */
  1341.  
  1342. do
  1343. {
  1344.     MOS_rdpos(&sw,&x,&y);
  1345.     /* FAIL ノ ウエ ノ ボタン */
  1346.     if(((x>473)&&(x<534))&&((y>322)&&(y<341))&&(sw==1))     dwroll();
  1347.     /* FAIL ノ シタ ノ ボタン */
  1348.     if(((x>538)&&(x<598))&&((y>322)&&(y<341))&&(sw==1))     uproll();
  1349.     /*  FAILヲエラブ */
  1350.     if(((x>473)&&(x<595))&&((y>124)&&(y<315))&&(sw==1))     fail(y);
  1351.  
  1352.     if(((x>203)&&(x<320))&&((y>282)&&(y<301))&&(sw==1))     muproll();
  1353.     if(((x>322)&&(x<437))&&((y>282)&&(y<301))&&(sw==1))     mdwroll();
  1354.     /*   ミギ ノ ゾクセイ  */
  1355.     if(((x>400)&&(x<435))&&((y>109)&&(y<125))&&(sw==1))     set_zoku(1);
  1356.     if(((x>400)&&(x<435))&&((y>130)&&(y<146))&&(sw==1))     set_zoku(2);
  1357.     if(((x>400)&&(x<435))&&((y>151)&&(y<167))&&(sw==1))     set_zoku(3);
  1358.     if(((x>400)&&(x<435))&&((y>172)&&(y<188))&&(sw==1))     set_zoku(4);
  1359.     if(((x>400)&&(x<435))&&((y>193)&&(y<209))&&(sw==1))     set_zoku(5);
  1360.     /*  ヒダリ ノ ゾクセイ  */
  1361.     if(((x>206)&&(x<237))&&((y>109)&&(y<125))&&(sw==1))     set_zoku2(1);
  1362.     if(((x>206)&&(x<237))&&((y>130)&&(y<146))&&(sw==1))     set_zoku2(2);
  1363.     if(((x>206)&&(x<237))&&((y>151)&&(y<167))&&(sw==1))     set_zoku2(3);
  1364.     if(((x>206)&&(x<237))&&((y>172)&&(y<188))&&(sw==1))     set_zoku2(4);
  1365.     if(((x>206)&&(x<237))&&((y>193)&&(y<209))&&(sw==1))     set_zoku2(5);
  1366.     /*   chdir  */
  1367.     if(((x>474)&&(x<596))&&((y>103)&&(y<118))&&(sw==1))     chdir();
  1368.     /*  drive  */
  1369.     if(((x>63)&&(x<118))&&((y>121)&&(y<279))&&(sw==1)) 
  1370.                 {    chdrv(x,y);    chk_drv();    }
  1371.     /*  ゾクセイ ヘンコウ  */
  1372.     if(((x>340)&&(x<420))&&((y>323)&&(y<347))&&(sw==1))    e_msgm();
  1373.     if(((x>340)&&(x<420))&&((y>323)&&(y<347))&&(sw==3))
  1374.         {  zhen2();    dir();    f_print();    path_print(); }
  1375.  
  1376.  
  1377.     /*        copy    */
  1378. if(((x>223)&&(x<303))&&((y>323)&&(y<347))&&(sw==1))    e_msgm();
  1379. if(((x>223)&&(x<303))&&((y>323)&&(y<347))&&(sw==3))
  1380. {
  1381. MOS_disp(0);
  1382. EGB_textSpace(work,0);
  1383. print(227,342,10,"COPY");        /*  copy     */
  1384. EGB_textSpace(work,1);
  1385.  
  1386.     if(no_chek!=0)    /*  ファィル ヲ エランデイレバ  コピー   */
  1387.     {
  1388.     
  1389.     if(dchek==0)    ret=drv_msg1();
  1390.         else    ret=drv_msg2();
  1391.  
  1392.     if(ret==0)    /*    トリケシ ヲ クリック シテイナケレバ ジッコウ   */
  1393.         {
  1394.         t_fname(dchek);        /* カキコミ ガワ ノ ファイルメイ ヲ ツクル   */
  1395.         chopen1=0;    chopen2=0;
  1396.         if ((fp1=fopen(fname[kakutei],"rb"))==NULL)    chopen1=1;
  1397.         if(chopen1==0)
  1398.         {
  1399.         if ((fp2=fopen(fname2,"wb"))==NULL)        chopen2=1;
  1400.             if(chopen2==0)
  1401.             {
  1402.             while((i=fread(buf,1,SIZE,fp1))!=0)
  1403.                 {
  1404.                 e_write=fwrite(buf,1,i,fp2);
  1405.                 if(e_write!=i) {e_msgw();    break;}
  1406.                 }
  1407.             }else e_msg2();
  1408.         }else    e_msg1();
  1409.         }
  1410.     }else    e_msgf();
  1411. EGB_textSpace(work,0);
  1412. print(227,342,1,"COPY");
  1413. EGB_textSpace(work,1);
  1414. MOS_disp(1);
  1415. }        /*    copy end  */
  1416.  
  1417.  
  1418.  
  1419.     /*   CD ストップ   */
  1420.     if(((x>520)&&(x<560))&&((y>59)&&(y<77))&&(sw==1))    cdstop();
  1421.  
  1422.     /*        CD  エンソウ    */
  1423.     if(((x>121)&&(x<597))&&((y>59)&&(y<77))&&(sw==1))
  1424.         {
  1425.         cdplay(x);
  1426.         EGB_textSpace(work,1);
  1427.         MOS_disp(1);
  1428.         }
  1429.  
  1430.     /* cd エンソウ ヲ シテイナケレバ イロ ヲ モドス */
  1431.     if(cd_chek==1)
  1432.     {
  1433.     cdr_mphase(0,&sts,&no,(char *)&st,(char *)&ed);    /*  CD ノ check    */
  1434.         if ( sts == 0 )    
  1435.         {
  1436.         cd_chek=0;    i=0;
  1437.         MOS_disp(0);
  1438.         EGB_textSpace(work,0);
  1439.         for(x1=123;x1<=503;x1=x1+20) { print(x1,76,1,cd[i]);  i++;}
  1440.         print(525,76,1,msg2);        /*  stop   */
  1441.         print(564,76,1,msg3);        /*  レンゾク  */
  1442.         EGB_textSpace(work,1);
  1443.         MOS_disp(1);
  1444.         }
  1445.     }
  1446.  
  1447.  
  1448.  
  1449.     if(((x>260)&&(x<380))&&((y>370)&&(y<400))&&(sw==1))    flag=1;
  1450. } while ( flag!=1 );
  1451.  
  1452.  
  1453. cdr_mphase(0,&sts,&no,(char *)&st,(char *)&ed);
  1454. if ( sts != 0 )        cdr_mstop(0);
  1455. set_drive(init_d-1);
  1456. MOS_end();
  1457. SND_elevol_init();
  1458. SND_end();
  1459. EGB_init(work,4096);
  1460.  
  1461. }
  1462.