1
0
Fork 0

fixed some fcb errors: fcb-open and fcb-create created.

fixed return values.
fixed wildcmp


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@492
This commit is contained in:
Peter Veenstra 2002-11-11 18:40:43 +00:00
parent 055e02bb41
commit 764dc5c543
6 changed files with 18 additions and 7 deletions

View file

@ -142,7 +142,8 @@ void DOS_FreeProcessMemory(Bit16u pspseg);
Bit16u DOS_GetMemory(Bit16u pages);
/* FCB stuff */
bool DOS_FCBOpenCreate(Bit16u seg,Bit16u offset);
bool DOS_FCBOpen(Bit16u seg,Bit16u offset);
bool DOS_FCBCreate(Bit16u seg,Bit16u offset);
bool DOS_FCBClose(Bit16u seg,Bit16u offset);
bool DOS_FCBFindFirst(Bit16u seg,Bit16u offset);
bool DOS_FCBFindNext(Bit16u seg,Bit16u offset);

View file

@ -164,7 +164,7 @@ static Bitu DOS_21Handler(void) {
reg_al=26;
break;
case 0x0f: /* Open File using FCB */
if(DOS_FCBOpenCreate(SegValue(ds),reg_dx)){
if(DOS_FCBOpen(SegValue(ds),reg_dx)){
reg_al=0;
}else{
reg_al=0xff;
@ -208,8 +208,8 @@ static Bitu DOS_21Handler(void) {
LOG_DEBUG("DOS:0x15 FCB-Write used, result:al=%d",reg_al);
break;
case 0x16: /* Create or truncate file using FCB */
if (DOS_FCBOpenCreate(SegValue(ds),reg_dx)) reg_al = 0x00;
else reg_al = 0x01;
if (DOS_FCBCreate(SegValue(ds),reg_dx)) reg_al = 0x00;
else reg_al = 0xFF;
LOG_DEBUG("DOS:0x16 FCB-Create used, result:al=%d",reg_al);
break;
case 0x17: /* Rename file using FCB */

View file

@ -318,7 +318,7 @@ void DOS_FCB::SetRandom(Bit32u _random) {
}
void DOS_FCB::FileOpen(Bit8u _fhandle) {
sSave(sFCB,drive,GetDrive());
sSave(sFCB,drive,GetDrive()+1);
sSave(sFCB,file_handle,_fhandle);
sSave(sFCB,cur_block,0);
sSave(sFCB,rec_size,128);

View file

@ -635,7 +635,16 @@ static void SaveFindResult(DOS_FCB & find_fcb) {
fcb.SetSizeDateTime(size,date,time);
}
bool DOS_FCBOpenCreate(Bit16u seg,Bit16u offset) {
bool DOS_FCBCreate(Bit16u seg,Bit16u offset) {
DOS_FCB fcb(seg,offset);
char shortname[DOS_FCBNAME];Bit16u handle;
fcb.GetName(shortname);
if (!DOS_CreateFile(shortname,2,&handle)) return false;
fcb.FileOpen((Bit8u)handle);
return true;
}
bool DOS_FCBOpen(Bit16u seg,Bit16u offset) {
DOS_FCB fcb(seg,offset);
char shortname[DOS_FCBNAME];Bit16u handle;
fcb.GetName(shortname);

View file

@ -43,7 +43,7 @@ private:
};
bool localDrive:: FileCreate(DOS_File * * file,char * name,Bit16u attributes) {
bool localDrive::FileCreate(DOS_File * * file,char * name,Bit16u attributes) {
//TODO Maybe care for attributes but not likely
char newname[CROSS_LEN];
strcpy(newname,basedir);

View file

@ -63,6 +63,7 @@ bool WildFileCmp(const char * file, const char * wild)
r++;
}
checkext:
r=0;
while (r<3) {
if (wild_ext[r]=='*') return true;
if (wild_ext[r]!='?' && wild_ext[r]!=file_ext[r]) return false;