Read only non-zero sized files

This commit is contained in:
simon.kagstrom 2009-01-20 17:21:17 +00:00
parent 74ff49961c
commit 6656508cd0
2 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,8 @@
version 6:
TODO: Multiple frodo versions, switch between
TODO: load games where the first file is not a .prg
* Don't load files with zero-size (allows .d64 files where the first file
is not a PRG to load correctly)
-- Simon Kagstrom <simon.kagstrom@gmail.com>,

View File

@ -2,7 +2,7 @@
* 1541d64.cpp - 1541 emulation in disk image files (.d64/.x64/zipcode)
*
* Frodo (C) 1994-1997,2002-2005 Christian Bauer
* zipcode decoding routines (C) 1993-1997 Marko Mäkelä, Paul David Doherty
* zipcode decoding routines (C) 1993-1997 Marko Mäkelä, Paul David Doherty
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -988,7 +988,8 @@ bool ImageDrive::find_file(const uint8 *pattern, int pattern_len, int &dir_track
}
// Does entry match pattern?
if (de[DE_TYPE] && match(pattern, pattern_len, de + DE_NAME))
if (de[DE_TYPE] && match(pattern, pattern_len, de + DE_NAME) &&
(de[DE_NUM_BLOCKS_L] | (de[DE_NUM_BLOCKS_H] << 8)) > 0)
return true;
}
return false;