Changes in emu/main.c [0edef06:1efc42c] in buchla-emu


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • emu/main.c

    r0edef06 r1efc42c  
    2525static verb_flag_t verb_flags[] = {
    2626        { "sdl", &sdl_verbose },
    27         { "gdb", &gdb_verbose },
    2827        { "cpu", &cpu_verbose },
    2928        { "fpu", &fpu_verbose },
     
    4140const char *bios = "bios.abs";
    4241const char *disk = "buchla.disk";
    43 const char *font = "ttf/vera-sans-mono.ttf";
    44 
    45 SDL_atomic_t run;
    4642
    4743static void usage(FILE *fh)
    4844{
    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");
    5046        fprintf(fh, "where comp is one of: ");
    5147
     
    8783                }
    8884
    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 
    10085                if (strcmp(argv[i], "-v") == 0) {
    10186                        if (++i == argc) {
     
    133118}
    134119
    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 
    151120int32_t main(int32_t argc, char *argv[])
    152121{
    153122        parse_args(argc, argv);
    154123        sdl_init();
    155         gdb_init();
    156         cpu_init();
    157124
    158         SDL_AtomicSet(&run, 1);
    159         SDL_Thread *thr_cpu = SDL_CreateThread(cpu_thread, "cpu", NULL);
     125        cpu_loop();
    160126
    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();
    178127        sdl_quit();
    179128        return 0;
Note: See TracChangeset for help on using the changeset viewer.