64kramsystem / 64kramsystem/ghidra-vice-connector

Save and restore VICE machine state snapshots (BMP 0x41/0x42)

オープン
#24 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
priority: medium
主要言語
Python
スター
1
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

## Summary

Save the full VICE machine state (RAM, registers, chip state, drive state) to a `.vsf` snapshot file from Ghidra, and restore it later. This enables fast iteration: save state at a specific game screen, freely experiment with breakpoints and memory edits, then restore to retry.

Source: RetroDebugger Timeline Save/Load; VICE BMP `Dump` (0x41) and `Undump` (0x42).

---

## BMP protocol details

**`CMD_DUMP = 0x41`** — save snapshot

Request payload:
```
save_roms (1) — 1 = include ROM contents in snapshot
save_disks (1) — 1 = include disk image contents
filename_len (2 LE)
filename (filename_len bytes, ASCII path accessible to VICE process)
```

Response: standard ACK (error byte = 0 on success).

**`CMD_UNDUMP = 0x42`** — restore snapshot

Request payload:
```
filename_len (2 LE)
filename (filename_len bytes)
```

Response body:
```
pc (2 LE) — PC value after restore
```

After `undump`, the trace state is stale — call `populate_initial_state()` or at minimum `on_stop()` to resync registers and memory.

---

## Implementation plan

### 1. `util.py`

```python
CMD_DUMP = 0x41
CMD_UNDUMP = 0x42

def dump(self, path: str, save_roms: bool = False, save_disks: bool = False):
enc = path.encode('ascii')
payload = struct.pack(' int:
enc = path.encode('ascii')
payload = struct.pack('

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。