GCR mode for all cores using D64 and G64 disk images.
This commit is contained in:
@@ -41,6 +41,7 @@ static char core_path[1024] = {};
|
||||
static char rbf_path[1024] = {};
|
||||
|
||||
static fileTYPE sd_image[16] = {};
|
||||
static int sd_type[16] = {};
|
||||
static int sd_image_cangrow[16] = {};
|
||||
static uint64_t buffer_lba[16] = { ULLONG_MAX,ULLONG_MAX,ULLONG_MAX,ULLONG_MAX,
|
||||
ULLONG_MAX,ULLONG_MAX,ULLONG_MAX,ULLONG_MAX,
|
||||
@@ -1503,6 +1504,7 @@ int user_io_file_mount(const char *name, unsigned char index, char pre)
|
||||
int len = strlen(name);
|
||||
|
||||
sd_image_cangrow[index] = (pre != 0);
|
||||
sd_type[index] = 0;
|
||||
|
||||
if (len)
|
||||
{
|
||||
@@ -1517,7 +1519,7 @@ int user_io_file_mount(const char *name, unsigned char index, char pre)
|
||||
{
|
||||
ret = x2trd(name, sd_image + index);
|
||||
}
|
||||
else if (is_c64() && len > 4 && !strcasecmp(name + len - 4, ".t64"))
|
||||
else if (len > 4 && !strcasecmp(name + len - 4, ".t64"))
|
||||
{
|
||||
writable = 0;
|
||||
ret = c64_openT64(name, sd_image + index);
|
||||
@@ -1527,9 +1529,10 @@ int user_io_file_mount(const char *name, unsigned char index, char pre)
|
||||
{
|
||||
writable = FileCanWrite(name);
|
||||
ret = FileOpenEx(&sd_image[index], name, writable ? (O_RDWR | O_SYNC) : O_RDONLY);
|
||||
if (ret && is_c64() && len > 4 && (!strcasecmp(name + len - 4, ".d64") || !strcasecmp(name + len - 4, ".g64")))
|
||||
if (ret && len > 4 && (!strcasecmp(name + len - 4, ".d64") || !strcasecmp(name + len - 4, ".g64")))
|
||||
{
|
||||
ret = c64_openGCR(name, sd_image + index, index);
|
||||
sd_type[index] = 1;
|
||||
if(!ret) FileClose(&sd_image[index]);
|
||||
}
|
||||
}
|
||||
@@ -2700,7 +2703,7 @@ void user_io_poll()
|
||||
}
|
||||
DisableIO();
|
||||
|
||||
if ((blksz == 32) && is_c64())
|
||||
if ((blksz == 32) && sd_type[disk])
|
||||
{
|
||||
if (op == 2) c64_writeGCR(disk, lba);
|
||||
else if (op & 1) c64_readGCR(disk, lba);
|
||||
|
||||
Reference in New Issue
Block a user