src/mess/drivers/mikromik.c
| r5407 | r5408 | |
| 1 | 1 | #include "driver.h" |
| 2 | 2 | #include "includes/mikromik.h" |
| 3 | #include "formats/basicdsk.h" |
| 3 | 4 | #include "devices/basicdsk.h" |
| 5 | #include "devices/mflopimg.h" |
| 4 | 6 | #include "cpu/i8085/i8085.h" |
| 5 | 7 | #include "machine/8237dma.h" |
| 6 | 8 | #include "machine/nec765.h" |
| r5407 | r5408 | |
| 17 | 19 | - pixel display |
| 18 | 20 | - system disks |
| 19 | 21 | - hook up DMA channels |
| 20 | | - UPD uPD7220 emulation |
| 22 | - NEC uPD7220 emulation (Intel 82720 GDC) |
| 21 | 23 | |
| 22 | 24 | */ |
| 23 | 25 | |
| r5407 | r5408 | |
| 249 | 251 | |
| 250 | 252 | /* System Configuration */ |
| 251 | 253 | |
| 252 | | static DEVICE_IMAGE_LOAD( mm1_floppy ) |
| 253 | | { |
| 254 | | if (image_has_been_created(image)) |
| 255 | | return INIT_FAIL; |
| 254 | static FLOPPY_OPTIONS_START( mm1 ) |
| 255 | FLOPPY_OPTION( mm1, "dsk", "Nokia MikroMikko 1 disk image", basicdsk_identify_default, basicdsk_construct_default, |
| 256 | HEADS([2]) |
| 257 | TRACKS([80]) |
| 258 | SECTORS([8]) |
| 259 | SECTOR_LENGTH([512]) |
| 260 | FIRST_SECTOR_ID([1])) |
| 261 | FLOPPY_OPTIONS_END |
| 256 | 262 | |
| 257 | | if (device_load_basicdsk_floppy(image) == INIT_PASS) |
| 258 | | { |
| 259 | | int size = image_length(image); |
| 260 | | |
| 261 | | if (size == 80*2*16*256) // 640KB |
| 262 | | { |
| 263 | | /* image, tracks, heads, sectors per track, sector length, first sector id, offset track zero, track skipping */ |
| 264 | | basicdsk_set_geometry(image, 80, 2, 16, 256, 1, 0, FALSE); |
| 265 | | |
| 266 | | return INIT_PASS; |
| 267 | | } |
| 268 | | } |
| 269 | | |
| 270 | | return INIT_FAIL; |
| 271 | | } |
| 272 | | |
| 273 | 263 | #ifdef UNUSED_CODE |
| 274 | 264 | static DEVICE_IMAGE_LOAD( mm2_floppy ) |
| 275 | 265 | { |
| r5407 | r5408 | |
| 308 | 298 | switch(state) |
| 309 | 299 | { |
| 310 | 300 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 311 | | case MESS_DEVINFO_INT_COUNT: info->i = 2; break; |
| 301 | case MESS_DEVINFO_INT_COUNT: info->i = 2; break; |
| 312 | 302 | |
| 313 | 303 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 314 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(mm1_floppy); break; |
| 304 | case MESS_DEVINFO_PTR_FLOPPY_OPTIONS: info->p = (void *) floppyoptions_mm1; break; |
| 315 | 305 | |
| 316 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 317 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "img"); break; |
| 318 | | |
| 319 | | default: legacybasicdsk_device_getinfo(devclass, state, info); break; |
| 306 | default: floppy_device_getinfo(devclass, state, info); break; |
| 320 | 307 | } |
| 321 | 308 | } |
| 322 | 309 | |