mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
SCI: Changed K_FILEIO_FILE_EXISTS to check regular files too.
svn-id: r40724
This commit is contained in:
parent
42cd218400
commit
4d59f620f9
@ -836,17 +836,19 @@ reg_t kFileIO(EngineState *s, int funct_nr, int argc, reg_t *argv) {
|
||||
}
|
||||
case K_FILEIO_FILE_EXISTS : {
|
||||
char *name = kernel_dereference_char_pointer(s, argv[1], 0);
|
||||
// TODO: Transform the name given by the scripts to us, e.g. by
|
||||
// prepending TARGET-
|
||||
// TODO: We may have to also check for a regular file with the
|
||||
// given name, using File::exists(). Really depends on *how*
|
||||
// scripts use this opcode. Need more test data...
|
||||
Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
|
||||
bool exists = !saveFileMan->listSavefiles(name).empty();
|
||||
|
||||
s->r_acc = make_reg(0, exists);
|
||||
debug(3, "K_FILEIO_FILE_EXISTS(%s) -> %d", name, s->r_acc.offset);
|
||||
break;
|
||||
// Check for regular file
|
||||
bool exists = Common::File::exists(name);
|
||||
|
||||
if (!exists) {
|
||||
// TODO: Transform the name given by the scripts to us, e.g. by
|
||||
// prepending TARGET-
|
||||
Common::SaveFileManager *saveFileMan = g_engine->getSaveFileManager();
|
||||
exists = !saveFileMan->listSavefiles(name).empty();
|
||||
}
|
||||
|
||||
debug(3, "K_FILEIO_FILE_EXISTS(%s) -> %d", name, exists);
|
||||
return make_reg(0, exists);
|
||||
}
|
||||
default :
|
||||
error("Unknown FileIO() sub-command: %d\n", func_nr);
|
||||
|
@ -847,7 +847,7 @@ void ResourceManager::readResourcePatches(ResourceSource *source) {
|
||||
ResourceSource *psrcPatch;
|
||||
bool bAdd;
|
||||
|
||||
for (int i = kResourceTypeView; i < kResourceTypeInvalid; i ++) {
|
||||
for (int i = kResourceTypeView; i < kResourceTypeAudio36; i ++) {
|
||||
files.clear();
|
||||
szResType = getResourceTypeName((ResourceType)i);
|
||||
// SCI0 naming - type.nnn
|
||||
|
@ -285,7 +285,7 @@ static const char *sci1_default_knames[SCI1_KNAMES_DEFAULT_ENTRIES_NR] = {
|
||||
/*0x82*/ "TextFonts",
|
||||
/*0x83*/ "Record",
|
||||
/*0x84*/ "PlayBack",
|
||||
/*0x85*/ SCRIPT_UNKNOWN_FUNCTION_STRING,
|
||||
/*0x85*/ "ShowMovie",
|
||||
/*0x86*/ "SetVideoMode",
|
||||
/*0x87*/ "SetQuitStr",
|
||||
/*0x88*/ "DbugStr"
|
||||
|
Loading…
Reference in New Issue
Block a user