src/mess/video/enterp.c
| r4170 | r4171 | |
| 1 | | /*************************************************************************** |
| 2 | | |
| 3 | | Functions to emulate the video hardware of the Enterprise. |
| 4 | | |
| 5 | | ***************************************************************************/ |
| 6 | | |
| 7 | | #include "driver.h" |
| 8 | | #include "video/epnick.h" |
| 9 | | #include "includes/enterp.h" |
| 10 | | |
| 11 | | /*************************************************************************** |
| 12 | | Start the video hardware emulation. |
| 13 | | ***************************************************************************/ |
| 14 | | VIDEO_START( enterprise ) |
| 15 | | { |
| 16 | | Nick_vh_start(); |
| 17 | | VIDEO_START_CALL(generic_bitmapped); |
| 18 | | } |
| 19 | | |
| 20 | | /*************************************************************************** |
| 21 | | Draw the game screen in the given bitmap_t. |
| 22 | | Do NOT call osd_update_display() from this function, |
| 23 | | it will be called by the main emulation engine. |
| 24 | | ***************************************************************************/ |
| 25 | | VIDEO_UPDATE( enterprise ) |
| 26 | | { |
| 27 | | Nick_DoScreen(tmpbitmap); |
| 28 | | return VIDEO_UPDATE_CALL(generic_bitmapped); |
| 29 | | } |
| 30 | | |
src/mess/drivers/enterp.c
| r4170 | r4171 | |
| 18 | 18 | #include "driver.h" |
| 19 | 19 | #include "cpu/z80/z80.h" |
| 20 | 20 | #include "audio/dave.h" |
| 21 | | #include "includes/enterp.h" |
| 22 | 21 | #include "video/epnick.h" |
| 23 | 22 | #include "machine/wd17xx.h" |
| 24 | 23 | #include "devices/basicdsk.h" |
| 25 | | /* for CPCEMU style disk images */ |
| 26 | | #include "devices/dsk.h" |
| 27 | 24 | |
| 28 | 25 | |
| 29 | 26 | #define ENTERPRISE_XTAL_X1 XTAL_8MHz |
| r4170 | r4171 | |
| 42 | 39 | /* index of keyboard line to read */ |
| 43 | 40 | static int Enterprise_KeyboardLine = 0; |
| 44 | 41 | |
| 45 | | /* set read/write pointers for CPU page */ |
| 42 | |
| 43 | /*************************************************************************** |
| 44 | MEMORY / I/O |
| 45 | ***************************************************************************/ |
| 46 | |
| 46 | 47 | static void enterprise_update_memory_page(const address_space *space, offs_t page, int index) |
| 47 | 48 | { |
| 48 | 49 | int start = (page - 1) * 0x4000; |
| r4170 | r4171 | |
| 94 | 95 | case 0xff: |
| 95 | 96 | /* basic 64k ram */ |
| 96 | 97 | memory_install_readwrite8_handler(space, start, end, 0, 0, SMH_BANK((FPTR)page), SMH_BANK((FPTR)page)); |
| 97 | | memory_set_bankptr(space->machine, page, mess_ram + (index - 0xfc) * 0x4000); |
| 98 | memory_set_bankptr(space->machine, page, mess_ram + (index - 0xfc) * 0x4000); |
| 98 | 99 | break; |
| 99 | 100 | |
| 100 | 101 | default: |
| r4170 | r4171 | |
| 121 | 122 | } |
| 122 | 123 | } |
| 123 | 124 | |
| 125 | |
| 124 | 126 | static void enterprise_dave_reg_read(running_machine *machine, offs_t RegIndex) |
| 125 | 127 | { |
| 126 | 128 | static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", |
| r4170 | r4171 | |
| 157 | 159 | } |
| 158 | 160 | } |
| 159 | 161 | |
| 162 | |
| 160 | 163 | static void enterprise_dave_interrupt(running_machine *machine, int state) |
| 161 | 164 | { |
| 162 | 165 | if (state) |
| r4170 | r4171 | |
| 195 | 198 | } |
| 196 | 199 | |
| 197 | 200 | |
| 201 | /*************************************************************************** |
| 202 | VIDEO |
| 203 | ***************************************************************************/ |
| 198 | 204 | |
| 205 | static VIDEO_START( enterprise ) |
| 206 | { |
| 207 | Nick_vh_start(); |
| 208 | VIDEO_START_CALL(generic_bitmapped); |
| 209 | } |
| 210 | |
| 211 | |
| 212 | static VIDEO_UPDATE( enterprise ) |
| 213 | { |
| 214 | Nick_DoScreen(tmpbitmap); |
| 215 | return VIDEO_UPDATE_CALL(generic_bitmapped); |
| 216 | } |
| 217 | |
| 218 | |
| 199 | 219 | /*************************************************************************** |
| 200 | 220 | FLOPPY/EXDOS |
| 201 | 221 | ***************************************************************************/ |
| r4170 | r4171 | |
| 251 | 271 | } |
| 252 | 272 | |
| 253 | 273 | |
| 274 | DEVICE_IMAGE_LOAD( enterprise_floppy ) |
| 275 | { |
| 276 | const device_config *fdc = devtag_get_device(image->machine, WD1770, "wd1770"); |
| 277 | |
| 278 | wd17xx_set_density(fdc, DEN_FM_HI); |
| 279 | |
| 280 | if (device_load_basicdsk_floppy(image) != INIT_PASS) |
| 281 | return INIT_FAIL; |
| 282 | |
| 283 | basicdsk_set_geometry(image, 80, 2, 9, 512, 1, 0, FALSE); |
| 284 | return INIT_PASS; |
| 285 | } |
| 286 | |
| 287 | |
| 254 | 288 | /*************************************************************************** |
| 255 | 289 | ADDRESS MAPS |
| 256 | 290 | ***************************************************************************/ |
| r4170 | r4171 | |
| 522 | 556 | SYSTEM CONFIG |
| 523 | 557 | ***************************************************************************/ |
| 524 | 558 | |
| 525 | | static void ep128_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 559 | static void enterprise_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 526 | 560 | { |
| 527 | 561 | /* floppy */ |
| 528 | 562 | switch(state) |
| 529 | 563 | { |
| 530 | 564 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 531 | | case MESS_DEVINFO_INT_COUNT: info->i = 4; break; |
| 565 | case MESS_DEVINFO_INT_COUNT: info->i = 4; break; |
| 532 | 566 | |
| 533 | | default: legacydsk_device_getinfo(devclass, state, info); break; |
| 534 | | } |
| 535 | | } |
| 536 | | |
| 537 | | #if 0 |
| 538 | | static void ep128_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 539 | | { |
| 540 | | /* floppy */ |
| 541 | | switch(state) |
| 542 | | { |
| 543 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 544 | | case MESS_DEVINFO_INT_COUNT: info->i = 4; break; |
| 545 | | |
| 546 | 567 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 547 | | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(enterprise_floppy); break; |
| 568 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(enterprise_floppy); break; |
| 548 | 569 | |
| 549 | 570 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 550 | | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "dsk"); break; |
| 571 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "dsk,img"); break; |
| 551 | 572 | |
| 552 | | default: legacybasicdsk_device_getinfo(devclass, state, info); break; |
| 573 | default: legacybasicdsk_device_getinfo(devclass, state, info); break; |
| 553 | 574 | } |
| 554 | 575 | } |
| 555 | | #endif |
| 556 | 576 | |
| 577 | |
| 557 | 578 | static SYSTEM_CONFIG_START(ep64) |
| 558 | 579 | CONFIG_RAM_DEFAULT(64*1024) |
| 559 | | CONFIG_DEVICE(ep128_floppy_getinfo) |
| 580 | CONFIG_DEVICE(enterprise_floppy_getinfo) |
| 560 | 581 | SYSTEM_CONFIG_END |
| 561 | 582 | |
| 562 | 583 | static SYSTEM_CONFIG_START(ep128) |
| 563 | 584 | CONFIG_RAM_DEFAULT(128*1024) |
| 564 | | CONFIG_DEVICE(ep128_floppy_getinfo) |
| 585 | CONFIG_DEVICE(enterprise_floppy_getinfo) |
| 565 | 586 | SYSTEM_CONFIG_END |
| 566 | 587 | |
| 567 | 588 | |