64kramsystem / 64kramsystem/ghidra-vice-connector
Autostart PRG in VICE via BMP (0xdd)
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Use the VICE BMP `Autostart` command (0xdd) to load and run a PRG file directly from Ghidra. Unlike the tracked issue #3 (raw memory injection), autostart uses VICE's native load mechanism which handles the BASIC header, SYS calls, and proper KERNAL initialization — matching how a real C64 would load the program.
---
## BMP protocol details
**Command:** `CMD_AUTOSTART = 0xDD`
**Request payload:**
```
run (1) — 1 = autostart and run, 0 = load only (LOAD equivalent)
file_index (2 LE) — index within a disk image (0 for first file, or for PRG files directly)
filename_len (2 LE)
filename (filename_len bytes, ASCII, path accessible to the VICE process)
```
**Response:** standard ACK. VICE will reset and load the file; a `RESP_STOPPED` event will follow when the program breaks or reaches the autostart entry point.
---
## Relationship to issue #3
Issue #3 ("Auto-load PRG files into VICE memory") likely refers to injecting raw bytes via `CMD_MEMORY_SET`. That bypasses BASIC/KERNAL setup and is better for already-running programs. This issue is for the workflow entry point: "I have a PRG, start VICE running it cleanly."
---
## Implementation plan
### 1. `util.py`
```python
CMD_AUTOSTART = 0xDD
def autostart(self, path: str, run: bool = True, file_index: int = 0):
"""
Load (and optionally run) a PRG or disk image file via VICE's autostart.
`path` must be accessible to the VICE process filesystem.
"""
enc = path.encode('ascii')
payload = struct.pack('
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.