(original) (raw)

Updates

03 Jun 2023

Added .DSK image of original (and long sought after) MSX CP/M 2.2 boot disk (<MSXCPM.DSK> 720K)


MSX Network


This project's main goal was to have my diskless MSX2 (Yamaha YIS-503/IIIR) hooked to a PC that would emulate (well, actually simulate) another MSX2 machine, and with quite a bit of reverse engineering, programming, hacking and soldering to be able to download games using YIS-503/IIIR's built-in networking capabilities.

This simple circut allows any MSX equipped with Network Module to be connected to any RS-232 port. Full opto-coupling (both TX and RX), no additional power supply (necessary voltages taken from MSX and RS-232).Schematics (JPG, 68K)PCB design (PostScript, 51K)Components layout (PostScript, 83K)Communicate using speed 38400, 8 bits and 2 (!) stopbits. At least it works for me this way.

Packet formats

Typical packet has a header, a payload, sometimes a checksum and terminator (0x97 if there will be more packets, 83 if this is the last packet in a sequence).

HEADER PAYLOAD CHECKSUM TERMINATOR
F0 00 Destination address Packet type Source address Command (2 bytes - see Encoding) Optional parameters (encoded) Optional data byte(s) (encoded) 16-bit checksum (encoded) 97 (intermediate packet) 83 (last packet)

Source and destination address can be 00 (Teacher), 01..0F (Student), and 7F (Broadcast).

Command - see Packet 0x01 description.

Payload

Maximum data bytes (without optional parameters) - 58 bytes.

Checksum

Checksum is a 16-bit sum of all bytes in payload. Packets with wrong checksum are silently discarded.

Encoding

Each 8-bit byte is sent as a pair of 7-bit octets, with the first octet carrying only bit 7 of original byte, and the second carries bits 6..0. This allows for sending packets across MIDI-like network (and through YM3802 chip in particular) in accordance with MIDI standards.

Example: byte 21 is sent as 00 21; byte FF is sent as 01 7F.

There are four types of packets used in MSX network.

Packet 0x01

This is the Base type of packet. Each Base packet should be acknowledged with ACK (0x06) packet, except for specific ones (see table).

00 01 02 03 04 05 06 07 08 09 0A 0B 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a
F0 00 ADR2 01 ADR1 00 CMND
CP/M
20 NET-CLOSE-FILE LNGTH H F A FCB (37 bytes) CHKSUM 83
21 NET-SEARCH-FIRST LNGTH H F A FCB (37 bytes) CHKSUM 83
22 NET-SEARCH-NEXT LNGTH H F A FCB (37 bytes) CHKSUM 83
23 NET-DELETE-FILE LNGTH H F A FCB (37 bytes) CHKSUM 83
24 NET-READ-FILE LNGTH H F A FCB (37 bytes) CHKSUM 83
25 NET-WRITE-FILE LNGTH H F A FCB (37 bytes) CHKSUM 83
26 NET-CREATE-FILE LNGTH H F A FCB (37 bytes) CHKSUM 83
27 NET-RENAME-FILE LNGTH H F A FCB (37 bytes) CHKSUM 83
2c Master Data (first packet)
2d Master Data (subsequent packets)
2e NET-SEARCH-END LNGTH H F A FCB (37 bytes) CHKSUM 83
2f NET-OPEN-FILE LNGTH H F A FCB (37 bytes) CHKSUM 83
30 re: NET-CLOSE-FILE
31 re: NET-SEARCH-FIRST
32 re: NET-SEARCH-NEXT
33 re: NET-DELETE-FILE
34 re: NET-READ-FILE
35 re: NET-WRITE-FILE
36 re: NET-CREATE-FILE
37 re: NET-RENAME-FILE
3c Slave Data (first packet)
3d Slave Data (subsequent packets)
3e re: NET-SEARCH-END
3f re: NET-OPEN-FILE
General
40 SEND LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
41 SEND LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
42 SHEX (data packets)
43 SHEXS (data packets)
44 SEND-VRAM-DATA
45 SHEXS (file data packets) LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
46 MESS, TALK LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
47
48 SNDCMD LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
49 SNDM (first packet) LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
4a SNDM (subsequent packets) LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
4b re:RECV LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
4c re:RHEX LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
4d re:RHEXS data
4e re:RHEXS (file) LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
4f re:63
50
51 re:RCVM LNGTH byte 1 byte 2 bytes NN CHKSUM 97/83
52 SHEX/SHEXS START END 83
53 SEND-VRAM-REG START END V_REGDAT (40 bytes) 83
54 re:RHEXS header START END V_REGDAT (40 bytes) 83
55 SHEXS (file) START END 83
56 re:RECEIVE-VRAM-REG START END V_REGDAT (40 bytes) 83
57 RHEX START END 83 Respond with 4c
58 RHEXS (mem) START END 83 Respond with 54, then send 4d(s)
59 RECEIVE-VRAM-REG START END 83 Respond with 56
5a RECEIVE-VRAM-DATA START END 83 Respond with 4e
5b RHEXS (file) START END 83 Respond with 4e
5c POKE ADDR byte 1 83
5d POKE (NetRAM) ADDR byte 1 83
5e RUN ADDR 83
5f PEEK ADDR 83 Respond with 61
60 PEEK (NetRAM) ADDR 83 Respond with 61
61 re:PEEK byte 1 83
62 RECV 01 7F 01 7F 01 7F 01 7F 83 Respond with 4b
63 83 Respond with 4f
64 RCVM 83 Respond with 51
65 STOP 83

Packet 0x15 (PING)

Ping packet type. Every workstation upon receiving of this packet should respond with 0x05 (PONG) packet.

00 01 02 03 04 05 06
F0 00 ADR2 15 ADR1 O_STATUS 83

Master workstation sends PING to all Slave workstations in turn (01..0F) when idle, to keep list of active Slaves up to date.


Packet 0x06 (ACK)

This packet is used to acknowledge the reception of most Base packets.

00 01 02 03 04 05 06 07 08 09 0a 0b
F0 00 ADR2 06 ADR1 U_STATUS 83

Packet 0x05 (PONG)

Response to PING (0x15) packet.

00 01 02 03 04 05
F0 00 ADR2 05 ADR1 83

Sending files from PC

MS-DOS executable: <msx-link.exe> (500K)

Source: https://github.com/mr-GreyWolf/MSX-Network


© 2005-2023 tnt23