Switched load/save print to state length actually loaded/saved

This commit is contained in:
Andrew Alderwick 2021-05-16 11:00:53 +01:00
parent f88df1a08d
commit 7132197ba5
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w)
FILE *f = fopen(name, read ? "r" : (offset ? "a" : "w")); FILE *f = fopen(name, read ? "r" : (offset ? "a" : "w"));
if(f) { if(f) {
if(fseek(f, offset, SEEK_SET) != -1 && (result = read ? fread(&d->mem[addr], 1, length, f) : fwrite(&d->mem[addr], 1, length, f))) if(fseek(f, offset, SEEK_SET) != -1 && (result = read ? fread(&d->mem[addr], 1, length, f) : fwrite(&d->mem[addr], 1, length, f)))
printf("%s %d bytes, at %04x from %s\n", read ? "Loaded" : "Saved", length, addr, name); printf("%s %d bytes, at %04x from %s\n", read ? "Loaded" : "Saved", result, addr, name);
fclose(f); fclose(f);
} }
mempoke16(d->dat, 0x2, result); mempoke16(d->dat, 0x2, result);

View File

@ -247,7 +247,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w)
FILE *f = fopen(name, read ? "r" : (offset ? "a" : "w")); FILE *f = fopen(name, read ? "r" : (offset ? "a" : "w"));
if(f) { if(f) {
if(fseek(f, offset, SEEK_SET) != -1 && (result = read ? fread(&d->mem[addr], 1, length, f) : fwrite(&d->mem[addr], 1, length, f))) if(fseek(f, offset, SEEK_SET) != -1 && (result = read ? fread(&d->mem[addr], 1, length, f) : fwrite(&d->mem[addr], 1, length, f)))
printf("%s %d bytes, at %04x from %s\n", read ? "Loaded" : "Saved", length, addr, name); printf("%s %d bytes, at %04x from %s\n", read ? "Loaded" : "Saved", result, addr, name);
fclose(f); fclose(f);
} }
mempoke16(d->dat, 0x2, result); mempoke16(d->dat, 0x2, result);