Changes in emu/main.c [1efc42c:0edef06] in buchla-emu
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/main.c
r1efc42c r0edef06 25 25 static verb_flag_t verb_flags[] = { 26 26 { "sdl", &sdl_verbose }, 27 { "gdb", &gdb_verbose }, 27 28 { "cpu", &cpu_verbose }, 28 29 { "fpu", &fpu_verbose }, … … 40 41 const char *bios = "bios.abs"; 41 42 const char *disk = "buchla.disk"; 43 const char *font = "ttf/vera-sans-mono.ttf"; 44 45 SDL_atomic_t run; 42 46 43 47 static void usage(FILE *fh) 44 48 { 45 fprintf(fh, "usage: buchla [-h] [-v comp [-v comp [...]]] [-b bios] [-d disk] \n");49 fprintf(fh, "usage: buchla [-h] [-v comp [-v comp [...]]] [-b bios] [-d disk] [-f font]\n"); 46 50 fprintf(fh, "where comp is one of: "); 47 51 … … 83 87 } 84 88 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 85 100 if (strcmp(argv[i], "-v") == 0) { 86 101 if (++i == argc) { … … 118 133 } 119 134 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 120 151 int32_t main(int32_t argc, char *argv[]) 121 152 { 122 153 parse_args(argc, argv); 123 154 sdl_init(); 155 gdb_init(); 156 cpu_init(); 124 157 125 cpu_loop(); 158 SDL_AtomicSet(&run, 1); 159 SDL_Thread *thr_cpu = SDL_CreateThread(cpu_thread, "cpu", NULL); 126 160 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(); 127 178 sdl_quit(); 128 179 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.