64kramsystem / 64kramsystem/ghidra-vice-connector

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

Abierto
#24 0 comentarios 0 reacciones 0 asignados Ver en GitHub
priority: medium
Lenguaje dominante
Python
Estrellas
1
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## 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('

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.