> C64 emulator able to run schwert and magie on a pebble using a companion app as emulator and a watch app as display output and input provider

That is an incredibly specific, beautifully nostalgic, and deeply chaotic engineering idea. Running Schwert und Magie (the classic German 8-part text RPG series by German Design Group) on a Pebble smartwatch via a Commodore 64 emulator companion-app setup is technically feasible, but it comes with distinct hurdles.

Because Schwert und Magie relies heavily on custom text characters and user choices, the architecture you outlined (Companion App doing the heavy lifting → Pebble Watch App handling the presentation and buttons) is actually the only realistic way to do this.

Here is a breakdown of how this architecture would function, the technical bottlenecks you'll face, and how to actually implement it.

The System Architecture
Because a Pebble smartwatch (even the Pebble Time) lacks the CPU juice and RAM to natively emulate a MOS 6510 processor and a VIC-II graphics chip, you have to split the workload.

[ Android/iOS Phone ]                          [ Pebble Smartwatch ]
+----------------------------+                 +---------------------------+
|  C64 Emulator Instance     |                 |  Pebble C Watch App       |
|  (Running Schwert & Magie) |                 |                           |
|                            |  Bluetooth BLE  |                           |
|  Frame Buffer Downsampler  | --------------->|  Draws 144x168 Bitmap     |
|                            |                 |                           |
|  Input Mapper Matrix       | <---------------|  Sends Button Click Events|
+----------------------------+                 +---------------------------+
1. The Phone Companion App (The Engine)
The Emulator: You need a lightweight, headless C64 emulator core (like Libretro's VICE core or a stripped-down Frodo instance) running inside your Android/iOS companion app.

The Content: You boot the .d64 or .t64 image of Schwert und Magie.

The Video Downscaler: The native C64 screen resolution is 320×200 pixels. A Pebble Classic/Time screen is 144×168 pixels. The companion app must capture the emulator's raw video buffer, convert it to 1-bit black and white (for Pebble Classic) or 64-color palette (for Pebble Time), downscale it, and pack it into a compressed byte array.

The Bridge: It listens for Pebble app messages via Bluetooth Low Energy (BLE) and translates them into C64 keyboard matrix presses.

2. The Pebble App (The Monitor & Keyboard)
The Display: It acts as a dumb terminal. It initializes a GBitmap, receives chunks of frame data via AppMessage, decompresses them, and calls layer_mark_dirty() to draw the game screen.

The Input Provider: Schwert und Magie is primarily a text adventure where you make menu choices via the C64 keyboard (e.g., pressing numbers or select letters). Since the Pebble only has Up, Select, and Down buttons on the right side, the Watch App needs a custom UI overlay—like a scrolling virtual keyboard or a quick-select wheel—to pass keycodes back to the phone.  
C64-Wiki

Technical Bottlenecks & Fixes
1. The Screen Scaling / Text Legibility Problem
Schwert und Magie uses custom font chipsets to render its German text descriptions. Shrinking a 320×200 layout down to 144×168 means standard bilinear downscaling will turn the text into an unreadable slurry of pixels.

The Fix: Do not stream the video border. Crop the C64 frame strictly to the internal 320×200 text area. Even better, scale the image using a nearest-neighbor integer drop or create a custom parser in the companion app that reads the C64's RAM memory addresses directly to extract the ASCII text strings, transmitting pure text to the Pebble to let the watch render it natively in a readable system font.

2. Bluetooth Bandwidth (FPS Limits)
Pebble's AppMessage protocol over BLE maxes out at a practical limit of roughly 5 to 10 kilobytes per second depending on conditions. A raw 144×168 8-bit image is roughly 24 KB. You cannot stream 30 FPS video over a Pebble connection.

The Fix: Schwert und Magie is a static text RPG. The screen only updates when you make a move. The companion app should implement frame-differencing (interlacing or dirty-rectangles)—only sending packets when pixels actually change. When a text block finishes printing, bandwidth consumption drops to zero.  
C64-Wiki

3. Input Mapping
How do you press "E" to enter a room or "1" to choose an option with only 3 buttons?

The Fix: Build a contextual menu overlay into the Pebble app. Pressing the 'Select' button pauses the video stream and opens a native Pebble menu loop (1, 2, 3, 4, Y, N, Inventory). Selecting an item fires that specific keypress back to the phone's emulator.

How to Build It (Getting Started)
If you are going to hack this together using the modern modern Rebble development ecosystem:

Pebble Watch App (C language): Use the Pebble SDK to set up an AppMessage inbox handler. Use gbitmap_create_with_data() to draw incoming byte buffers directly to the screen.

Companion App (Java/Kotlin for Android or Swift for iOS): Take an open-source Android C64 emulator frontend. Hook into the emulation loop's "Frame Ready" callback.

Data Compression: Use a lightweight compression algorithm like Run-Length Encoding (RLE) on the phone before sending the frame data. The Pebble CPU can easily decompress RLE on the fly to draw the bitmap.
