1 #ifndef DRIVE_H_INCLUDED 2 #define DRIVE_H_INCLUDED 3 4 #include <stdio.h> 5 #include "file-op.h" 6 7 #include "initval.h" 8 /* �ɥ饤�֤ο� NR_DRIVE �ϡ�initval.h ������� */ 9 /* ������ο� NR_IMAGE �ϡ�initval.h ������� */ 10 11 12 13 14 /**** �ɥ饤�������� ****/ 15 16 typedef struct{ 17 18 OSD_FILE *fp; /* FILE �ݥ��� */ 19 20 char read_only; /* ��ɥ����ǥե���������鿿 */ 21 char over_image; /* ���������¿�����˿� */ 22 char detect_broken_image; /* ���줿����������Ĥ��ä��鿿 */ 23 char empty; /* �ɥ饤�֤˶�����ꤷ�Ƥ���ʤ鿿 */ 24 25 int selected_image; /* ���Ƥ��륤����ֹ� (0��) */ 26 int image_nr; /* �ե�������Υ������ (1��) */ 27 28 struct{ /* �ե����������������ξ��� */ 29 char name[17]; /* �����̾ */ 30 char protect; /* �ץ�ƥ��� */ 31 char type; /* �ǥ����������� */ 32 long size; /* ������ */ 33 }image[ MAX_NR_IMAGE ]; 34 35 /* �������顢�����楤����Υ�� */ 36 37 int track; /* ���ߤΥȥ�å��ֹ� */ 38 int sec_nr; /* �ȥ�å���Υ������� */ 39 int sec; /* ���ߤΥ������ֹ� */ 40 41 long sec_pos; /* ������ �θ��߰��� */ 42 long track_top; /* �ȥ�å�����Ƭ���� */ 43 long disk_top; /* �ǥ���������Ƭ���� */ 44 long disk_end; /* ������ν�ü���� */ 45 46 char protect; /* �饤�ȥץ�ƥ��� */ 47 char type; /* �ǥ����������� */ 48 49 /* �ե�����̾ */ 50 51 /* char filename[ QUASI88_MAX_FILENAME ];*/ 52 53 } PC88_DRIVE_T; 54 55 56 57 extern PC88_DRIVE_T drive[ NR_DRIVE ]; 58 59 60 61 62 /**** �ǥ��������� ���ե��å� ****/ 63 #define DISK_FILENAME (0) /* char x [17] */ 64 #define DISK_PROTECT (26) /* char */ 65 #define DISK_TYPE (27) /* char */ 66 #define DISK_SIZE (28) /* long */ 67 #define DISK_TRACK (32) /* long x [164] */ 68 69 /**** ID���� ���ե��å� ****/ 70 #define DISK_C (0) /* char */ 71 #define DISK_H (1) /* char */ 72 #define DISK_R (2) /* char */ 73 #define DISK_N (3) /* char */ 74 #define DISK_SEC_NR (4) /* short */ 75 #define DISK_DENSITY (6) /* char */ 76 #define DISK_DELETED (7) /* char */ 77 #define DISK_STATUS (8) /* char */ 78 #define DISK_RESERVED (9) /* char x [5] */ 79 #define DISK_SEC_SZ (14) /* char x [???] */ 80 81 #define SZ_DISK_ID (16) /* ID���� 16Byte*/ 82 83 84 /**** �ǥ�����/ID���� ��� ****/ 85 #define DISK_PROTECT_TRUE (0x10) 86 #define DISK_PROTECT_FALSE (0x00) 87 88 #define DISK_TYPE_2D (0x00) 89 #define DISK_TYPE_2DD (0x10) 90 #define DISK_TYPE_2HD (0x20) 91 92 #define DISK_DENSITY_DOUBLE (0x00) 93 #define DISK_DENSITY_SINGLE (0x40) 94 95 #define DISK_DELETED_TRUE (0x10) 96 #define DISK_DELETED_FALSE (0x00) 97 98 99 100 /**** �ؿ� ****/ 101 102 103 void drive_init( void ); 104 void drive_reset( void ); 105 int disk_insert( int drv, const char *filename, int img, int readonly ); 106 int disk_change_image( int drv, int img ); 107 void disk_eject( int drv ); 108 int disk_insert_A_to_B( int src, int dst, int img ); 109 110 void drive_set_empty( int drv ); 111 void drive_unset_empty( int drv ); 112 void drive_change_empty( int drv ); 113 int drive_check_empty( int drv ); 114 115 int get_drive_ready( int drv ); 116 117 118 119 120 #define disk_same_file() (drive[ 0 ].fp == drive[ 1 ].fp) 121 #define disk_image_exist( drv ) (drive[ drv ].fp) 122 #define disk_image_num( drv ) (drive[ drv ].image_nr) 123 #define disk_image_selected( drv ) (drive[ drv ].selected_image) 124 125 126 #endif /* DRIVE_H_INCLUDED */ 127