Switched load/save print to state length actually loaded/saved
This commit is contained in:
parent
f88df1a08d
commit
7132197ba5
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue