64kramsystem / 64kramsystem/ghidra-vice-connector

Keyboard input injection via BMP (0x72)

Offen Anfängerfreundlich
#30 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
priority: low
Vorherrschende Sprache
Python
Sterne
1
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Summary

Inject PETSCII text into the C64 keyboard buffer from Ghidra. Useful for typing BASIC commands, entering game passwords, or triggering text-based input handlers during a debugging session without switching focus to VICE.

Source: VICE BMP `Keyboard Feed` (0x72); confirmed in VICE source `src/monitor/monitor_binary.c`.

---

## BMP protocol details

**Command:** `CMD_KEYBOARD_FEED = 0x72`

Request payload:
```
text_len (2 LE)
text (text_len bytes, PETSCII encoding)
```

Response: standard ACK. VICE inserts the bytes into the keyboard buffer as if typed.

**PETSCII encoding notes:**
- Uppercase letters: same as ASCII (`A`=0x41)
- Lowercase letters in PETSCII graphics mode: offset; in text mode same as ASCII
- Common control chars: `RETURN`=0x0D, `SPACE`=0x20, `HOME`=0x13, `CLR`=0x93, `RUN`=0x83
- For plain ASCII text injected as BASIC input, standard ASCII bytes work for printable chars

---

## Implementation plan

### 1. `util.py`

```python
CMD_KEYBOARD_FEED = 0x72

def keyboard_feed(self, text: str):
"""
Inject text into the VICE keyboard buffer.
`text` should be ASCII; for RETURN append '\\r'.
"""
enc = text.encode('ascii')
payload = struct.pack('

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Das Issue sieht das Hinzufügen eines Tastatur-Feed-Befehls zum Ghidra VICE-Connector vor. Die zu ändernden Dateien sind `src/main/py/src/vice/util.py` und `src/main/py/src/vice/methods.py`. Untersuche zunächst die vorhandene Befehlsstruktur in `util.py` und die Methodenregistrierung in `methods.py`. Implementiere anschließend die Konstante `CMD_KEYBOARD_FEED` und die Funktion `keyboard_feed` wie beschrieben, und füge dann die Methode `keyboard_type` hinzu. Teste dies, indem du eine Verbindung zu einer VICE-Instanz herstellst und die Texteinspeisung in den C64-Tastaturpuffer überprüfst.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Bereich
cli, tooling
Issue-Typ
Feature
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
75/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.