home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 2
/
FreeSoftwareCollection2pd199x-jp.img
/
diskf
/
diskf.c
next >
Wrap
Text File
|
1990-06-14
|
6KB
|
229 lines
/* DISKF.C PROGRAMMED BY MSどす 1989.08.27 */
/* last update 1989.08.27 */
#include <msdos.cf>
#include <stdlib.h>
#include <stdio.h>
#include <egb.h>
#include <mos.h>
#include <fmc.h>
#include <ctype.h>
#include <jctype.h>
#include <string.h>
#include <jstring.h>
#include <mmi.h>
#include <math.h>
/* マクロ定義 */
#define D_MODE 4 /* 画面モード */
#define D_XMAX 639 /* 画面最大Y座標 */
#define D_YMAX 399 /* 画面最大X座標 */
#define C_HWHITE 15
#define C_HYELLOW 14
#define C_HLIGHTBLUE 13
#define C_HGREEN 12
#define C_HPURPLE 11
#define C_HRED 10
#define C_HBLUE 9
#define C_HBLACK 8
#define C_WHITE 7
#define C_YELLOW 6
#define C_LIGHTBLUE 5
#define C_GREEN 4
#define C_PURPLE 3
#define C_RED 2
#define C_BLUE 1
#define C_BLACK 0
/* グローバル変数 */
char work[2048];
char mwork[4096];
char para[258];
char outbuf[258];
int ypos=0;
/* table */
short int dsp_tbl[]={ 0,16,32,48,64,80,96,112,128,144,160,176,192,208,224,240,
256,272,288,304,320,336,352,368,384,400,416,432,448,464,480,496};
short int scr_tbl[]={ 128,144,160,176,192,208,224,240,256,272,288,304,320,336,
352,368,384,400,416,432,448,464,480,496,0,16,32,48,64,80,96,112};
short int scr_wrk[]={ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0, 0,16,32,48,64,80,96,112};
extern void initegb();
extern void endegb();
extern void wait_mouse();
extern void dsp_text();
main(){
int drv,c_size,endflg;
initegb();
ypos=0;
strcpy(outbuf,"DISKF V1.0 L10 by MSどす");
dsp_text();
/* strcpy(outbuf," 表示が停止した際は 'i'キーを押下してください");
dsp_text();*/
outbuf[0] = 0;
dsp_text();
strcpy (outbuf,"ドライブ 空き容量 全ディスク容量 クラスタサイズ");
dsp_text();
for(drv=1;drv<3;drv++){ /* A: - B: */
Registers.AX.LH.H = 0x36;
Registers.DX.LH.L = drv;
calldos();
if((Registers.AX.R == 0xffff) || (Registers.Flags%2 == 1)){
sprintf(outbuf," %c: (ドライブの準備が出来ていません)"
,'A'+drv-1);
}
else{
c_size = Registers.AX.R * Registers.CX.R / 1024;
sprintf(outbuf," %c: %6dKB %6dKB (%2dKB)"
,'A'+drv-1,c_size * Registers.BX.R,
c_size * Registers.DX.R,c_size);
}
dsp_text();
}
outbuf[0] = 0;
dsp_text();
endflg = 0;
for(drv=4;drv<17 && !endflg;drv++){ /* D: - P: */
Registers.AX.LH.H = 0x36;
Registers.DX.LH.L = drv;
calldos();
if((Registers.AX.R == 0xffff) || (Registers.Flags%2 == 1)){
/* sprintf(outbuf," %c: (ドライブの準備が出来ていません)"
,'A'+drv-1);*/
endflg = 1;
}
else{
c_size = Registers.AX.R * Registers.CX.R / 1024;
sprintf(outbuf," %c: %6dKB %6dKB (%2dKB)"
,'A'+drv-1,c_size * Registers.BX.R,
c_size * Registers.DX.R,c_size);
dsp_text();
}
}
outbuf[0] = 0;
dsp_text();
strcpy(outbuf,"終了しました。マウスのボタンを押して下さい。");
dsp_text();
outbuf[0] = 0;
dsp_text();
wait_mouse();
endegb();
return 0;
}
void wait_mouse(){
int flg,mosbtn,moscnt,mosx,mosy;
MOS_rdon(1,&mosbtn,&moscnt,&mosx,&mosy);
flg = 0;
while(! flg){
MOS_rdon(0,&mosbtn,&moscnt,&mosx,&mosy);
if(moscnt) flg = 1;
MOS_rdon(1,&mosbtn,&moscnt,&mosx,&mosy);
if(moscnt) flg = 2;
}
if(flg == 2){
endegb();
exit(0);
}
}
void dsp_text(){
int ret;
WORD(para + 0) = 0;
WORD(para + 2) = dsp_tbl[ypos];
WORD(para + 4) = 639;
WORD(para + 6) = dsp_tbl[ypos] +16;
EGB_viewport(work,para);
EGB_partClearScreen(work);
WORD(para + 0) = 0;
WORD(para + 2) = 0;
WORD(para + 4) = 639;
WORD(para + 6) = 511;
EGB_viewport(work,para);
strcpy(¶[6],outbuf);
WORD(para + 0) = 0;
WORD(para + 2) = dsp_tbl[ypos] +15;
WORD(para + 4) = strlen(¶[6]); /* 文字列出力 */
ret=EGB_sjisString(work,para);
EGB_displayStart(work,1,0,scr_wrk[ypos]); /* 仮想画面中の移動 */
/* スクロール */
scr_wrk[ypos] = scr_tbl[ypos];
ypos=(ypos+1)%32;
}
void initegb()
{
EGB_init(work, 2048); /* 初期化 */
EGB_resolution(work, 0, D_MODE); /* 仮想画面の設定(PAGE=0) */
EGB_resolution(work, 1, D_MODE); /* 同(PAGE=1) 1024*512 4bit/pixel */
EGB_displayStart(work,0,0,0); /* 表示開始位置 *** */
WORD(para + 0) = 0;
WORD(para + 2) = 0;
WORD(para + 4) = 639;
WORD(para + 6) = 511;
EGB_viewport(work,para);
/* EGB_palette(work,1,para);*/
EGB_writePage(work, 1); /* PAGE 1 write */
EGB_displayPage(work, 1, 2); /* PAGE 1 display */
EGB_color(work, 0, C_WHITE); /* 前景色 */
EGB_color(work, 1, C_BLACK); /* 背景色 */
EGB_color(work, 2, C_BLACK); /* 面塗色 */
EGB_color(work, 3, C_BLACK); /* 透過色 */
/* EGB_colorIGRB(work, 0, 0xffffffff);*/ /* 描画色設定1 */
/* EGB_pastel(work, 1, 128);*/ /* 混色比率の設定 */
EGB_writeMode(work, 0); /* 描画MODE=pset */
EGB_pen(work, 0); /* ペン設定 丸 */
EGB_penSize(work, 1); /* ペンサイズ=1 */
EGB_paintMode(work, 0x22); /* 面塗モード */
EGB_textDirection(work,0); /* 右 */
EGB_textDisplayDirection(work,0); /* 右方向へ */
EGB_textSpace(work,0); /* 文字間0 */
EGB_textZoom(work,0,8,16); /* ANK 8*16dot */
EGB_textZoom(work,1,16,16); /* 漢字 16*16dot */
EGB_fontStyle(work,0); /* 字体標準 */
EGB_superImpose(work,0); /* スーパーインポーズOFF(ON=128or129) */
EGB_dezitize(work,0); /* デジタイズOFF(ON=1) */
MOS_start(mwork,4096);
MOS_resolution(0,4);
MOS_disp(0);
EGB_clearScreen(work);
}
void endegb()
{
MOS_end(); /* mouse end */
EGB_resolution(work, 0, 1); /* 仮想画面の設定(PAGE=0) */
EGB_resolution(work, 1, 1); /* 同(PAGE=1) 1024*512 4bit/pixel */
EGB_displayStart(work,0,0,0); /* 表示開始位置 *** */
EGB_displayPage(work, 1, 3); /* PAGE 0&1 display */
EGB_clearScreen(work);
}