Re: [hatari-devel] Recent Hatari change problems |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi,
On 04/16/2018 01:53 AM, Eero Tamminen wrote:
On 04/15/2018 12:33 PM, Thomas Huth wrote:
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
[...]
Giving a program to Hatari enables automatically GEMDOS HD
emulation for the directory where that program is (Hatari
autostarting would be pretty stupid feature without that).
Not sure, but I think this automatic enablement is bypassed in "--tos
none" mode since the program is not loaded by TOS, but by Hatari here.
Enabling is done in options.c, not TOS handling code.
(And I tested it, -d is not needed.)
Sorry, my mistake, I was confused by my own GEMDOS tracing
(I forgot that it enables GEMDOS emulation partially now).
Is there some particular reason why your commit disabled
GEMDOS HD enabling in options.c when giving program name
after --tos none option:
https://hg.tuxfamily.org/mercurialroot/hatari/hatari/rev/0db1fad64cf3
?
Attached patch would fix that.
- Eero
diff -r 251a2fd0cb91 src/options.c
--- a/src/options.c Mon Apr 16 23:40:00 2018 +0300
+++ b/src/options.c Tue Apr 17 00:16:09 2018 +0300
@@ -948,21 +948,14 @@
* Filename can be a disk image or Atari program.
* Return false if it's none of these.
*/
-static bool Opt_HandleArgument(const char *path)
+static bool Opt_HandleArgument(const char *origpath)
{
+ const char *prgname = NULL, *path = origpath;
char *dir = NULL;
/* Atari program? */
if (Opt_IsAtariProgram(path))
{
- const char *prgname;
-
- if (!bUseTos)
- {
- TOS_SetTestPrgName(path);
- return true;
- }
-
prgname = strrchr(path, PATHSEP);
if (prgname)
{
@@ -975,13 +968,21 @@
dir = strdup(Paths_GetWorkingDir());
prgname = path;
}
- Log_Printf(LOG_INFO, "ARG = autostart program: %s\n", prgname);
+ if (bUseTos)
+ {
+ Log_Printf(LOG_INFO, "ARG = autostart program: %s\n", prgname);
- /* after above, dir should point to valid dir,
- * then make sure that given program from that
- * dir will be started.
- */
- INF_SetAutoStart(prgname, OPT_AUTOSTART);
+ /* after above, dir should point to valid dir,
+ * then make sure that given program from that
+ * dir will be started.
+ */
+ INF_SetAutoStart(prgname, OPT_AUTOSTART);
+ }
+ }
+ if (!bUseTos && !prgname)
+ {
+ Log_Printf(LOG_ERROR, "No program to run instead of TOS!\n");
+ exit(1);
}
if (dir)
{
@@ -1004,6 +1005,10 @@
{
free(dir);
}
+ if (!bUseTos)
+ {
+ TOS_SetTestPrgName(origpath);
+ }
return true;
}
else