23 struct sockaddr_un sock;
27 memset(&sock, 0,
sizeof(sock));
28 sock.sun_family = AF_UNIX;
30 sd = socket(AF_UNIX, SOCK_DGRAM, 0);
33 fcntl(sd, F_SETFL, O_NONBLOCK);
34 if (bind(sd, (
struct sockaddr *)&sock,
sizeof(sock)) != 0) {
73#define CONSOLE_FRAME_BYTES 19
74#define CONSOLE_OFF_SWITCHES 12
75#define CONSOLE_OFF_BUTTONS 16
76#define CONSOLE_OFF_ROTARY 18
164 unsigned char buf[1024];
165 struct sockaddr_un dst;
167 socklen_t socket_size =
sizeof(
struct sockaddr_un);
177 (
struct sockaddr *)&dst, &socket_size);
182 unsigned char rotary;
194 "console: short frame (%zd bytes, want %d); ignoring input\n",
202 sizeof(
struct ge_console), 0, (
struct sockaddr *)&dst,
void ge_fill_console_data(struct ge *ge, struct ge_console *console)
void ge_set_console_switches(struct ge *ge, struct ge_console_switches *switches)
int ge_console_start(struct ge *ge)
void ge_set_console_rotary(struct ge *ge, enum ge_console_rotary rs)
static void console_press_buttons(struct ge *ge, uint16_t buttons)
static int console_socket_fd
#define CONSOLE_OFF_BUTTONS
static int console_socket_deinit(struct ge *ge, void *ctx)
#define CONSOLE_OFF_SWITCHES
static int console_socket_check(struct ge *ge, void *ctx)
#define CONSOLE_FRAME_BYTES
static const char socket_path[]
static uint16_t console_prev_buttons
static int console_socket_init(struct ge *ge, void *ctx)
#define CONSOLE_OFF_ROTARY
static struct ge_peri console_socket
int console_socket_register(struct ge *ge)
void ge_load_1(struct ge *ge)
Emulate the press of the "load 1" button in the console.
void ge_clear(struct ge *ge)
Emulate the press of the "clear" button in the console.
void ge_load_2(struct ge *ge)
Emulate the press of the "load 2" button in the console.
void ge_load(struct ge *ge)
Emulate the press of the "load" button in the console.
int ge_register_peri(struct ge *ge, struct ge_peri *p)
void ge_log(ge_log_type type, const char *format,...)
Log message.
@ LOG_CONSOLE
Console interactions.
int(* init)(struct ge *, void *)
The entire state of the emulated system, including registers, memory, peripherals and timings.
uint8_t ALOI
Load connector selection.
uint8_t JS2
Console jump condition 2.
uint8_t ALTO
Stops internal cycles.
uint8_t lamps_test
LAMPS CHECK held (CPU[4] ยง3.2).
uint8_t ASIN
STEP-BY-STEP, the OPERATOR panel switch (signal ASIN).
uint8_t JS1
Console jump condition 1.