- Timestamp:
- 07/30/2017 06:18:21 PM (7 years ago)
- Branches:
- master
- Children:
- c5b6c90
- Parents:
- caff491
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.