Fix saveSnapshot: add missing SR and SD body bytes for VICE Dump command
This commit is contained in:
parent
1bea1deba9
commit
c6abc564ff
1 changed files with 6 additions and 3 deletions
|
|
@ -693,9 +693,12 @@ export class ViceClient {
|
||||||
// Snapshot methods
|
// Snapshot methods
|
||||||
async saveSnapshot(filename: string): Promise<void> {
|
async saveSnapshot(filename: string): Promise<void> {
|
||||||
const filenameBuffer = Buffer.from(filename, "utf8");
|
const filenameBuffer = Buffer.from(filename, "utf8");
|
||||||
const body = Buffer.alloc(1 + filenameBuffer.length);
|
// VICE Dump expects: saveROMs(1) + saveDisks(1) + filenameLen(1) + filename
|
||||||
body[0] = filenameBuffer.length;
|
const body = Buffer.alloc(3 + filenameBuffer.length);
|
||||||
filenameBuffer.copy(body, 1);
|
body[0] = 1; // SR: save ROMs = true
|
||||||
|
body[1] = 0; // SD: save disks = false
|
||||||
|
body[2] = filenameBuffer.length;
|
||||||
|
filenameBuffer.copy(body, 3);
|
||||||
await this.sendCommand(Command.Dump, body);
|
await this.sendCommand(Command.Dump, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue