Made the program-chaining exec() handle the X16 emulator's file-system.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
** Program-chaining function for Commodore platforms.
|
** Program-chaining function for Commodore platforms.
|
||||||
**
|
**
|
||||||
** 2019-11-08, Greg King
|
** 2019-12-25, Greg King
|
||||||
**
|
**
|
||||||
** This function exploits the program-chaining feature in Commander X16 BASIC's ROM.
|
** This function exploits the program-chaining feature in Commander X16 BASIC's ROM.
|
||||||
**
|
**
|
||||||
@@ -82,12 +82,15 @@ int __fastcall__ exec (const char* progname, const char* cmdline)
|
|||||||
}
|
}
|
||||||
utoa (dv, basic.unit, 10);
|
utoa (dv, basic.unit, 10);
|
||||||
|
|
||||||
/* Don't try to run a program that doesn't exist. */
|
/* The emulator supports only loading and saving on its file-system. */
|
||||||
fd = open (progname, O_RDONLY);
|
if (dv != 1) {
|
||||||
if (fd < 0) {
|
/* Don't try to run a program that doesn't exist. */
|
||||||
return _mappederrno (4); /* file not found */
|
fd = open (progname, O_RDONLY);
|
||||||
|
if (fd < 0) {
|
||||||
|
return _mappederrno (4); /* file not found */
|
||||||
|
}
|
||||||
|
close (fd);
|
||||||
}
|
}
|
||||||
close (fd);
|
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
do {
|
do {
|
||||||
|
|||||||
Reference in New Issue
Block a user