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
|
||||
async saveSnapshot(filename: string): Promise<void> {
|
||||
const filenameBuffer = Buffer.from(filename, "utf8");
|
||||
const body = Buffer.alloc(1 + filenameBuffer.length);
|
||||
body[0] = filenameBuffer.length;
|
||||
filenameBuffer.copy(body, 1);
|
||||
// VICE Dump expects: saveROMs(1) + saveDisks(1) + filenameLen(1) + filename
|
||||
const body = Buffer.alloc(3 + filenameBuffer.length);
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue