Family Computer Network Adapter: Difference between revisions
(Adds controller report and corrects information about standard controller (in)compatibility.) |
(Adds information about kanji ROM and tile order. Credit to Sour for help debugging and making sense of the mapping.) |
||
Line 24: | Line 24: | ||
===Kanji graphics=== | ===Kanji graphics=== | ||
The adapter provides 4096 16x16 1-bit-per-pixel characters, presumed to be mostly kanji. The console writes a 12-bit index to the adapter and then reads the corresponding 32-byte character back. | The adapter provides 4096 16x16 1-bit-per-pixel characters, presumed to be mostly kanji. The console writes a 12-bit index to the adapter and then reads the corresponding 32-byte character back. The tile order of the returned graphics is top left, bottom left, top right, bottom right. | ||
To write the kanji index: | To write the kanji index: | ||
Line 40: | Line 40: | ||
# Set bit 2. | # Set bit 2. | ||
# Repeat from step 3 until 32-byte data is read. | # Repeat from step 3 until 32-byte data is read. | ||
Available software converts Shift-JIS characters in the ranges $8000-9FFF and $E000-EBFF to adapter indices. Based on the resulting mapping, it appears the first half (128 KB) of the [[Famicom_Network_System#LH5323M1_Kanji_Graphic_ROM|Network System's kanji ROM]] is compatible. | |||
===Controller=== | ===Controller=== |
Revision as of 05:10, 17 March 2022
The Family Computer Network Adapter (HVC-035) is an unreleased Famicom modem used with the Family Computer Disk System via the RAM adapter's expansion port. A controller similar to the Famicom Network Controller attaches directly to the adapter, and like the later-released Famicom Network System, the adapter provides kanji graphics for use by software. A speaker is also believed to be built in to the unit.
Interface
The adapter uses the FDS expansion port, which is mapped to the low 7 bits of $4026 for writes and $4033 for reads. These bits are bidirectional and each side can pull them low. As such, to be able to receive data on a bit, the console must have first set that bit.
6 bit 0 --- ---- PDC ARWK ||| |||| ||| |||+- Kanji/controller data ||| ||+-- Kanji index write clock, and ||| || Kanji/controller read selector (0 = kanji, 1 = controller) ||| |+--- Kanji/controller read clock ||| +---- Adapter ready for packet transfer (0 = ready), and ||| Adapter packet transfer clock ||+------ Console ready for packet transfer (0 = ready), and || Console packet transfer clock |+------- Packet data +-------- Packet available (0 = available)
Note below that all bits modified in the same step should be written in a single write.
Kanji graphics
The adapter provides 4096 16x16 1-bit-per-pixel characters, presumed to be mostly kanji. The console writes a 12-bit index to the adapter and then reads the corresponding 32-byte character back. The tile order of the returned graphics is top left, bottom left, top right, bottom right.
To write the kanji index:
- Set bit 2 and clear bit 1.
- Write index bit (low bit first) to bit 0.
- Set bit 1.
- Clear bit 1.
- Repeat from step 2 until 12-bit index is written.
To read the kanji data:
- (Bit 2 should be set and bit 1 should be clear from writing the index.)
- Set bit 0.
- Clear bit 2.
- Read data bit (low bit first) from bit 0.
- Set bit 2.
- Repeat from step 3 until 32-byte data is read.
Available software converts Shift-JIS characters in the ranges $8000-9FFF and $E000-EBFF to adapter indices. Based on the resulting mapping, it appears the first half (128 KB) of the Network System's kanji ROM is compatible.
Controller
The adapter uses a 23-button controller that extends the standard controller with a 15-button keypad. This controller connects directly to the adapter.
To read the controller:
- Set bit 2, clear bit 1, and set bit 0.
- Set bit 1.
- Clear bit 2.
- Read data bit from bit 0.
- Set bit 2.
- Repeat from step 3 until 24-bit report is read.
Report
0 - 前ページ (Previous page) 1 - 次ページ (Next page) 2 - 1 3 - 2 4 - 3 5 - * 6 - C 7 - 通信終了 (End communication) 8 - (D-pad axis 1) 9 - (D-pad axis 2) 10 - 4 11 - 5 12 - 6 13 - # 14 - . 15 - 目次 (Table of contents) 16 - (D-pad axis 2) 17 - (D-pad axis 1) 18 - 7 19 - 8 20 - 9 21 - 0 22 - 実行 (Execute) 23 - (Always 0)
The bit order appears to reflect the physical layout of the controller and is not compatible with the standard controller. The D-pad directions have not yet been identified. Available software nullifies the input if 2 or more buttons are down unless just D-pad directions are down.
Packets
A bidirectional interface is used to transfer packets between the console and adapter. These packets are terminated when byte value $1F is seen. The console software transfers in batches of up to 20 bytes at a time and picks up where it left off the next frame, as necessary. The format and functionality of these packets is not understood.
Send
To send a packet to the adapter:
- Verify bit 6 and bit 3 are set. If not, receive the pending packet, instead.
- Clear bit 4.
- Verify bit 6 and bit 3 are set. If not, set bit 4 and receive the pending packet, instead.
- Clear bit 6.
- Wait for bit 3 to toggle.
- If toggle does not occur soon enough, fail.
- Toggle bit 4 and write data bit (low bit first) to bit 5.
- Repeat from step 5 until the last byte sent had value $1F.
- Wait for bit 3 to become clear.
- If clear does not occur soon enough, fail.
- Set bit 6, set bit 5, and set bit 4.
- Wait for bit 3 to become set.
- If set does not occur soon enough, fail.
If the send fails:
- Set bit 6, set bit 5, and set bit 4.
Receive
If bit 6 and bit 4 are both 0, the adapter is ready to send a packet. To receive a packet from the adapter:
- Clear bit 4.
- Wait for bit 3 to toggle.
- If bit 6 becomes set while waiting, fail.
- If toggle does not occur soon enough, fail.
- Read data bit (low bit first) from bit 5.
- Toggle bit 4.
- Repeat from step 2 until the last byte received had value $1F.
- Wait for bit 6 and bit 3 to be set.
- If both bits do not set soon enough, fail.
- Set bit 4.
If the receive fails:
- Set bit 4.