]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
read_rom_name_guess() should also set rom path if rom is found.
authorToni Wilen <twilen@winuae.net>
Sun, 2 Dec 2018 14:26:42 +0000 (16:26 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 2 Dec 2018 14:26:42 +0000 (16:26 +0200)
include/rommgr.h
memory.cpp
rommgr.cpp

index e731547f4865b15ee5cd69eee9f57c725cc0fcb1..de240d3ae4f9094e3e14c087b7bbf7cdee15fb84 100644 (file)
@@ -258,7 +258,7 @@ extern void descramble_nordicpro (uae_u8*, int, int);
 extern int kickstart_checksum (uae_u8 *mem, int size);
 extern int decode_rom (uae_u8 *mem, int size, int mode, int real_size);
 extern struct zfile *rom_fopen (const TCHAR *name, const TCHAR *mode, int mask);
-extern struct zfile *read_rom_name_guess (const TCHAR *filename);
+extern struct zfile *read_rom_name_guess (const TCHAR *filename, TCHAR *out);
 extern void addkeydir (const TCHAR *path);
 extern void addkeyfile (const TCHAR *path);
 extern int romlist_count (void);
index cdb7259deef7f17b4082dedfcf4af764f63c61e5..ce6ca6f5fbb6de05c20e27a89450022998b0f4f2 100644 (file)
@@ -1689,8 +1689,9 @@ static struct zfile *get_kickstart_filehandle(struct uae_prefs *p)
                                        if (f == NULL) {
                                                _stprintf(tmprom2, _T("%s../System/rom/kick.rom"), start_path_data);
                                                f = rom_fopen(tmprom2, _T("rb"), ZFD_NORMAL);
-                                               if (f == NULL)
-                                                       f = read_rom_name_guess(tmprom);
+                                               if (f == NULL) {
+                                                       f = read_rom_name_guess(tmprom, tmprom2);
+                                               }
                                        }
                                }
                        }
index a6320646c7e3f35524b4e028a7d55a3223317642..c68853c6c17a141bfa19f3997f0efc04ccf52f65 100644 (file)
@@ -1999,7 +1999,7 @@ struct zfile *read_rom_name (const TCHAR *filename)
        return f;
 }
 
-struct zfile *read_rom_name_guess (const TCHAR *filename)
+struct zfile *read_rom_name_guess (const TCHAR *filename, TCHAR *out)
 {
        int i, j;
        struct zfile *f;
@@ -2026,6 +2026,7 @@ struct zfile *read_rom_name_guess (const TCHAR *filename)
                        f = read_rom (rd);
                        if (f) {
                                write_log (_T("ROM %s not found, using %s\n"), filename, rl[i].path);
+                               _tcscpy(out, rl[i].path);
                                return f;
                        }
                }