OXYGENHUB
◆ main x16-emulator / src / netcard.h
981 B · Objective-C · last changed chore(): initial commit 15 days ago source blame history raw
1
// Commander X16 Emulator — a virtual serial/network card.
2
//
3
// A 16450-compatible UART at an expansion base with a Zimodem-enough modem
4
// behind it: Hayes AT commands in command mode, and a dial that opens a real
5
// TCP socket from the emulator process, after which bytes flow both ways.
6
// Enough for a program written against the TexElec serial/ESP32 card to be
7
// tested here, dialling a service on the developer's machine, without the
8
// card. It is not a model of the card's timing; a byte written is on the
9
// wire at once and a byte from the wire is readable at once.
10
//
11
// Only the card's network half (the eight registers at the base) exists.
12
// The DE-9 serial half, eight bytes above it, reads as open bus.
13
14
#pragma once
15
16
#include <stdbool.h>
17
#include <stdint.h>
18
19
extern bool has_netcard;
20
extern uint16_t netcard_addr;
21
22
void netcard_init(void);
23
void netcard_step(void);
24
uint8_t netcard_read(uint8_t reg, bool debugOn);
25
void netcard_write(uint8_t reg, uint8_t val);