Changeset 9ddbf3e in buchla-emu for emu/main.c
- Timestamp:
- 02/24/2018 06:51:40 PM (6 years ago)
- Branches:
- master
- Children:
- 2cd18e3
- Parents:
- 77d8df8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/main.c
r77d8df8 r9ddbf3e 43 43 const char *font = "ttf/vera-sans-mono.ttf"; 44 44 45 int32_t mid_port = -1; 46 45 47 SDL_atomic_t run; 46 48 47 uint32_t mid_port = 0;48 49 49 static void usage(FILE *fh) 50 50 { 51 fprintf(fh, "usage: buchla [-h] [-v comp [-v comp [...]]] [-b bios] [-d disk] [-f font] [-m midiport] \n"); 52 fprintf(fh, "where comp is one of: "); 51 fprintf(fh, "usage: buchla [-h] [-v comp [-v comp [...]]] [-b bios] [-d disk] [-f font] [-m port]\n"); 52 fprintf(fh, "with\n"); 53 fprintf(fh, " comp - one of: "); 53 54 54 55 for (int32_t i = 0; i < ARRAY_COUNT(verb_flags); ++i) { … … 57 58 58 59 fprintf(fh, "all\n"); 59 fprintf(fh, "and midiport is the number of the desired MIDI port\n"); 60 fprintf(fh, "list all available MIDI ports with: buchla [-m list]\n"); 60 fprintf(fh, " bios - BIOS ROM file (default: bios.abs)\n"); 61 fprintf(fh, " disk - disk image file (default: buchla.disk)\n"); 62 fprintf(fh, " font - console and LCD font (default: ttf/vera-sans-mono.ttf)\n"); 63 fprintf(fh, " port - number of the desired MIDI port (default: 0)\n"); 64 fprintf(fh, " \"list\" instead of a port number lists available ports\n"); 61 65 } 62 66 … … 145 149 mid_list(); 146 150 exit(0); 147 continue; 148 } 149 150 // TODO: Assign midi port number 151 mid_port = (uint32_t) atoi(argv[i]); 151 } 152 153 char *end; 154 int64_t tmp = strtol(argv[i], &end, 10); 155 156 if (*end != 0 || tmp < 0 || tmp > 15) { 157 usage(stderr); 158 fprintf(stderr, "invalid argument to -m: %s\n", argv[i]); 159 exit(1); 160 } 161 162 mid_port = (int32_t)tmp; 152 163 continue; 153 164 }
Note:
See TracChangeset
for help on using the changeset viewer.