Skip to content

SweMonkey/smdt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMD Terminal emulator, Telnet and IRC client v0.29+

A terminal emulator, telnet and IRC client for the Sega Mega Drive/Genesis with support for PS/2 keyboards and RS-232 communication.
Screenshot of the telnet client Screenshot of the IRC client Screenshot of the terminal emulator showing nano Screenshot of a debugging utility to inspect streams Screenshot of the telnet client in 80 column + 8 colour mode Screenshot of the terminal emulator

Extra hardware:
A PS/2 keyboard or a Sega Saturn keyboard (not required but preferred).
A "voltage translator" to translate between the MD +5v and remote RS232 device logic levels,
I personally recommend the max3232 (https://www.ti.com/lit/ds/symlink/max3232.pdf)

xPico/RetroLink support as an alternative to the above is being worked on.

Disclaimer

Warning

Do note that the MD is a 5 volt system! That means you should take care to not connect any random serial device directly to the MD (Such as a PC).
Use a "voltage translator" such as the max3232 between your MD and remote device to translate the voltage levels.
Make sure you understand my ramble down under the "Device" section to hook up external devices correctly!
I (smds) will not take any responsibilities for any failure to read and understand the above warning.


Thanks to

b1tsh1ft3r - Testing, improvement ideas and RetroLink/xPico support
RKT - For creating a 4x8 extended ASCII font tileset
Stef - For creating SGDK

Building SMDTC from source

This part needs to be expanded, for now it assumes you are familiar with SGDK and how to use it.

To build SMDTC from source you will need SGDK version 1.80 (newer versions untested but will probably work as SMDTC mostly only uses macros and basic functions from SGDK)
The SGDK library must be rebuilt with the flags HALT_Z80_ON_IO and HALT_Z80_ON_DMA set to 0 in config.h to make sure the z80 CPU is never getting its bus back.

Devices

SMDTC has a device manager which can autodetect if a device is present and where it is plugged in.
Device detection is only done on bootup, no plug & play support (yet).

A total of 2 PS/2 devices and 1 UART device can potentially be connected to a single MD controller port. However, beware the power draw may exceed what the MD can supply!

When a keyboard is connected and detected a 'K' icon will be visible in the status bar.
A fallback joypad device will be activated if SMDTC fails to find a keyboard or when a keyboard is plugged into PORT 2, allowing the use of a regular joypad.

All detected devices can be viewed in the "Connected devices" list (Quick menu -> Mega Drive settings -> Connected devices)

Note

SMDTC is limited when it comes to detecting the presence of a serial connection on the built in UART (Only an xPico module can be autodetected)
By default SMDTC will listen for incoming connections on PORT 2 UART.
This setting can be changed in the "Select serial port" menu (Quick menu -> Mega Drive settings -> Select serial port)
Do not forget to save your changes! (Quick menu -> Reset -> Save config to sram)


List of autodetected devices that require no configuration

PS/2 Keyboard.
Sega Saturn keyboard.
Sega 3/6 button joypad.
xPico module connected to built in UART (Currently being worked on, support may be iffy)
RetroLink network adapter cartridge (Currently being worked on, support may be iffy)

How to wire up a PS/2 keyboard

For PS/2 devices (a keyboard or mouse) SMDTC has two ways to connect one:

Example keyboard wiring (1):
MD port pin 1 = PS/2 clock pin 5
MD port pin 2 = PS/2 data pin 1
MD port pin 5 = PS/2 VCC pin 4
MD port pin 8 = PS/2 GND pin 3

Example keyboard wiring (2):
MD port pin 3 = PS/2 clock pin 5
MD port pin 4 = PS/2 data pin 1
MD port pin 5 = PS/2 VCC pin 4
MD port pin 8 = PS/2 GND pin 3

See the pin configuration lists below for pinouts of the MD controller ports and PS/2 keyboard.

Pin configuration of the MD controller ports:

MD port pin 1 = PS/2 device 1 clock (CLK1)
MD port pin 2 = PS/2 device 1 data (DATA1)
MD port pin 3 = PS/2 device 2 clock (CLK2)
MD port pin 4 = PS/2 device 2 data (DATA2)
MD port pin 5 = VCC (+5V)
MD port pin 6 = Serial TX
MD port pin 7 = Reserved (CP3)
MD port pin 8 = GND
MD port pin 9 = Serial RX

PS/2 pin reference:

PS/2 pin 1 = Data
PS/2 pin 3 = GND
PS/2 pin 4 = VCC
PS/2 pin 5 = Clock

MD UART pin reference:

MD port pin 5 = VCC
MD port pin 6 = TX
MD port pin 8 = GND
MD port pin 9 = RX

Connected device list:

P1:0 = Port 1 @ pin 1+2
P1:1 = Port 1 @ pin 3+4
P1:S = Port 1 UART
P1:D = Port 1 Parallel+UART Mode
P2:0 = Port 2 @ pin 1+2
P2:1 = Port 2 @ pin 3+4
P2:S = Port 2 UART
P2:D = Port 2 Parallel+UART Mode
P3:0 = Port 3 @ pin 1+2
P3:1 = Port 3 @ pin 3+4
P3:S = Port 3 UART
P3:D = Port 3 Parallel+UART Mode

Keyboard shortcuts

Right windows key OR F8 = Open the Quick menu
Enter = Enter submenu and activate a choice
Escape = Back out of current menu
Up cursor = Move selector up
Down cursor = Move selector down

IRC Client shortcuts

F1 = Channel 1 tab
F2 = Channel 2 tab
F3 = Channel 3 tab
F5 = Toggle channel user list

Terminal emulator

Type help for a list of all available built in commands.
Up arrow = Retype last entered string
Down arrow = Clear current typed string