GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
main.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <unistd.h>
3 #include "ge.h"
4 #include "console_socket.h"
5 #include "log.h"
6 
7 int main(int argc, char *argv[])
8 {
9  uint8_t test_program = 0;
10  struct ge ge130;
11  int ret;
12 
13  ge_init(&ge130);
14 
15  ret = console_socket_register(&ge130);
16  if (ret != 0)
17  return ret;
18 
19  while(1) {
20  /* load with memory / and or setup peripherics */
21  ge_clear(&ge130);
22  ge_start(&ge130);
23 
24  while (!ge130.halted || ret != 0) {
25  /* Delay */
26  usleep(CLOCK_PERIOD);
27  ret = ge_run_pulse(&ge130);
28  }
29 
30  printf(" *** RESTART *** ");
31  sleep(1);
32  }
33 
34  ge_deinit(&ge130);
35  return ret;
36 }
int console_socket_register(struct ge *ge)
int ge_deinit(struct ge *ge)
Deinitialize the emulator.
Definition: ge.c:234
void ge_clear(struct ge *ge)
Emulate the press of the "clear" button in the console.
Definition: ge.c:25
void ge_init(struct ge *ge)
Initialize the emulator.
Definition: ge.c:14
int ge_run_pulse(struct ge *ge)
Run a single pulse (i.e. a single GE "mastri" clock periods)
Definition: ge.c:177
void ge_start(struct ge *ge)
Emulate the press of the "start" button in the console.
Definition: ge.c:94
#define CLOCK_PERIOD
Definition: ge.h:9
int main(int argc, char *argv[])
Definition: main.c:7
The entire state of the emulated system, including registers, memory, peripherals and timings.
Definition: ge.h:94
uint8_t halted
Definition: ge.h:97