Skip to content

Instantly share code, notes, and snippets.

@rhargreaves
Last active May 2, 2024 17:40
Show Gist options
  • Save rhargreaves/7fc232cf6db1899e05f7305eade2f8c6 to your computer and use it in GitHub Desktop.
Save rhargreaves/7fc232cf6db1899e05f7305eade2f8c6 to your computer and use it in GitHub Desktop.
Sending data to the Mega Drive over USB using the Mega EverDrive PRO

Mega EverDrive PRO Overview

The Mega EverDrive PRO has a USB port (much like the EverDrive X7) which allows you to send arbitary data to the Mega Drive over USB. With the X7 you could simply send data to the USB serial device and pick it up at a specific memory mapped location on the Mega Drive. With the PRO, however, you need to wrap the data in a "command" and send it over the USB serial device, so that it will be available to the Mega Drive.

The following information was obtained by reading the source contained in the MEGA-PRO repo.

Command Message Format

Field Bytes Value (hex) Description
Preamble 0 2B A plus (+) symbol
Preamble Inverted 1 D4 Previous byte with bits inverted
Command Type 2 1A CMD_MEM_RW
Command Type Inverted 3 E5 Previous byte with bits inverted
Memory Location 4-7 01 81 00 00 ADDR_FIFO
Data Length 8-11 00 00 00 05 Length of data (for example, 5)
Padding 12 00 Padding
Data 13+ 65 65 65 65 65 The data itself (for example, eeeee)

Usage Example

  1. Load up the megaio-app ROM on the Mega Drive.
  2. Select usb read.
  3. On a Unix machine with the ED PRO connected via USB, create a binary file (message.txt) with the bytes described above.
  4. Run cat message.txt > /dev/cu.usbmodem00000000001A1 (or to whatever the USB serial device is called)
  5. The message eeeee should appear on the Mega Drive screen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment