Changes in emu/main.c [0edef06:1efc42c] in buchla-emu
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/main.c
r0edef06 r1efc42c 25 25 static verb_flag_t verb_flags[] = { 26 26 { "sdl", &sdl_verbose }, 27 { "gdb", &gdb_verbose },28 27 { "cpu", &cpu_verbose }, 29 28 { "fpu", &fpu_verbose }, … … 41 40 const char *bios = "bios.abs"; 42 41 const char *disk = "buchla.disk"; 43 const char *font = "ttf/vera-sans-mono.ttf";44 45 SDL_atomic_t run;46 42 47 43 static void usage(FILE *fh) 48 44 { 49 fprintf(fh, "usage: buchla [-h] [-v comp [-v comp [...]]] [-b bios] [-d disk] [-f font]\n");45 fprintf(fh, "usage: buchla [-h] [-v comp [-v comp [...]]] [-b bios] [-d disk]\n"); 50 46 fprintf(fh, "where comp is one of: "); 51 47 … … 87 83 } 88 84 89 if (strcmp(argv[i], "-f") == 0) {90 if (++i == argc) {91 usage(stderr);92 fprintf(stderr, "missing argument to -f\n");93 exit(1);94 }95 96 font = argv[i];97 continue;98 }99 100 85 if (strcmp(argv[i], "-v") == 0) { 101 86 if (++i == argc) { … … 133 118 } 134 119 135 static int32_t cpu_thread(void *data)136 {137 (void)data;138 139 cpu_loop();140 return 0;141 }142 143 static int32_t gdb_thread(void *data)144 {145 (void)data;146 147 gdb_loop();148 return 0;149 }150 151 120 int32_t main(int32_t argc, char *argv[]) 152 121 { 153 122 parse_args(argc, argv); 154 123 sdl_init(); 155 gdb_init();156 cpu_init();157 124 158 SDL_AtomicSet(&run, 1); 159 SDL_Thread *thr_cpu = SDL_CreateThread(cpu_thread, "cpu", NULL); 125 cpu_loop(); 160 126 161 if (thr_cpu == NULL) {162 fail("SDL_CreateThread() failed: %s", SDL_GetError());163 }164 165 SDL_Thread *thr_gdb = SDL_CreateThread(gdb_thread, "gdb", NULL);166 167 if (thr_gdb == NULL) {168 fail("SDL_CreateThread() failed: %s", SDL_GetError());169 }170 171 sdl_loop();172 173 SDL_WaitThread(thr_cpu, NULL);174 SDL_WaitThread(thr_gdb, NULL);175 176 cpu_quit();177 gdb_quit();178 127 sdl_quit(); 179 128 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.