GE-115 Emulator
An Emulator of the General Electrics GE-115 computer
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
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
}
console_socket_register
int console_socket_register(struct ge *ge)
Definition:
console_socket.c:73
console_socket.h
ge_deinit
int ge_deinit(struct ge *ge)
Deinitialize the emulator.
Definition:
ge.c:234
ge_clear
void ge_clear(struct ge *ge)
Emulate the press of the "clear" button in the console.
Definition:
ge.c:25
ge_init
void ge_init(struct ge *ge)
Initialize the emulator.
Definition:
ge.c:14
ge_run_pulse
int ge_run_pulse(struct ge *ge)
Run a single pulse (i.e. a single GE "mastri" clock periods)
Definition:
ge.c:177
ge_start
void ge_start(struct ge *ge)
Emulate the press of the "start" button in the console.
Definition:
ge.c:94
ge.h
CLOCK_PERIOD
#define CLOCK_PERIOD
Definition:
ge.h:9
log.h
main
int main(int argc, char *argv[])
Definition:
main.c:7
ge
The entire state of the emulated system, including registers, memory, peripherals and timings.
Definition:
ge.h:94
ge::halted
uint8_t halted
Definition:
ge.h:97
Generated by
1.9.1