Classic Software
Adapted from Software.
Classic Spectranet software falls into three broad groups:
- library code, including the socket library and hardware support functions
- utility code, such as configuration, DHCP, and ROM management tools
- application code, including software that can be stored in flash ROM modules
Network code tutorials
The original wiki introduced Spectranet programming through a sequence of tutorials:
- Tutorial 1: high-level networking and Spectranet architecture
- Tutorial 2: a simple TCP server
- Tutorial 3: a simple TCP client
- Tutorial 4: UDP
- Tutorial 5: polling and handling multiple sockets
- Tutorial 6: extending ZX BASIC
- Tutorial 7: writing ROM modules
Programmer guide topics
The programmer notes cover hardware features that are useful beyond the socket library:
- general guidance for assembly and C programmers
- using paged RAM
- using flash memory
- using the programmable execution trap
Library reference overview
The socket library follows the shape of the BSD socket API so that programs can be written in familiar terms and are not tightly bound to the W5100 implementation. Public entry points are exposed through the Spectranet jump table, with assembler callers using symbols from spectranet.inc and C callers using z88dk headers.
Common socket functions include:
socketbindlistenacceptconnectrecvsendrecvfromsendtopollpollfdpollallclosegethostbyname
Configuration functions handle MAC address, IP address, netmask, gateway, and deconfiguration. Filesystem functions provide access to filesystem modules such as TNFS, including mounting filesystems and opening, reading, writing, and closing files.
Utility code
The utility ROM contains programs such as network configuration, DHCP setup, filesystem configuration, and ROM module management. Some utilities are run during reset; others are available from the NMI menu or BASIC commands.