- Timestamp:
- 07/30/2017 06:18:21 PM (7 years ago)
- Branches:
- master
- Children:
- c5b6c90
- Parents:
- caff491
- Location:
- emu
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/all.h
rcaff491 r1efc42c 62 62 extern int32_t kbd_verbose; 63 63 64 extern const char *bios; 65 extern const char *disk; 66 64 67 extern void sdl_init(void); 65 68 extern void sdl_quit(void); 66 69 67 extern void cpu_loop( const char *bios);70 extern void cpu_loop(void); 68 71 69 72 extern void fpu_init(void); -
emu/cpu.c
rcaff491 r1efc42c 131 131 } 132 132 133 static void bios_init( const char *bios)133 static void bios_init(void) 134 134 { 135 135 inf("loading BIOS file %s", bios); … … 611 611 } 612 612 613 void cpu_loop( const char *bios)613 void cpu_loop(void) 614 614 { 615 615 hw_init(); 616 bios_init( bios);616 bios_init(); 617 617 618 618 inf("entering CPU loop"); -
emu/fdd.c
rcaff491 r1efc42c 24 24 int32_t fdd_verbose = 0; 25 25 26 #define N_CYL 80 27 #define N_SID 2 28 #define N_SEC 18 29 #define SZ_SEC 512 30 31 #define SZ_DISK (N_CYL * N_SID * N_SEC * SZ_SEC) 32 33 static uint8_t image[SZ_DISK]; 34 26 35 void fdd_init(void) 27 36 { 28 37 ver("fdd init"); 38 inf("loading disk image file %s", disk); 39 40 SDL_RWops *ops = SDL_RWFromFile(disk, "rb"); 41 42 if (ops == NULL) { 43 fail("error while opening disk image file %s", disk); 44 } 45 46 size_t loaded = 0; 47 48 while (loaded < SZ_DISK) { 49 size_t n_rd = SDL_RWread(ops, image + loaded, 1, SZ_DISK - loaded); 50 51 if (n_rd == 0) { 52 fail("error while reading disk image file %s", disk); 53 } 54 55 loaded += n_rd; 56 } 57 58 SDL_RWclose(ops); 29 59 } 30 60 -
emu/main.c
rcaff491 r1efc42c 38 38 }; 39 39 40 static const char *bios = "bios.abs"; 40 const char *bios = "bios.abs"; 41 const char *disk = "buchla.disk"; 41 42 42 43 static void usage(FILE *fh) 43 44 { 44 fprintf(fh, "usage: buchla [-h] [-v comp [-v comp [...]]] [-b bios] \n");45 fprintf(fh, "usage: buchla [-h] [-v comp [-v comp [...]]] [-b bios] [-d disk]\n"); 45 46 fprintf(fh, "where comp is one of: "); 46 47 … … 68 69 69 70 bios = argv[i]; 71 continue; 72 } 73 74 if (strcmp(argv[i], "-d") == 0) { 75 if (++i == argc) { 76 usage(stderr); 77 fprintf(stderr, "missing argument to -d\n"); 78 exit(1); 79 } 80 81 disk = argv[i]; 70 82 continue; 71 83 } … … 111 123 sdl_init(); 112 124 113 cpu_loop( bios);125 cpu_loop(); 114 126 115 127 sdl_quit();
Note:
See TracChangeset
for help on using the changeset viewer.