src/mess/drivers/mbee.c
| r1882 | r1883 | |
| 33 | 33 | |
| 34 | 34 | ***************************************************************************/ |
| 35 | 35 | |
| 36 | | #include <math.h> |
| 37 | 36 | #include "driver.h" |
| 38 | | #include "machine/z80ctc.h" |
| 39 | 37 | #include "machine/z80pio.h" |
| 40 | | #include "machine/z80sio.h" |
| 38 | #include "cpu/z80/z80daisy.h" |
| 41 | 39 | #include "machine/wd17xx.h" |
| 42 | 40 | #include "includes/mbee.h" |
| 41 | #include "devices/snapquik.h" |
| 43 | 42 | #include "devices/basicdsk.h" |
| 44 | 43 | #include "devices/cartslot.h" |
| 45 | 44 | #include "devices/cassette.h" |
| 46 | 45 | #include "devices/z80bin.h" |
| 47 | | #include "mslegacy.h" |
| 48 | | #include "cpu/z80/z80daisy.h" |
| 49 | 46 | |
| 50 | 47 | static ADDRESS_MAP_START(mbee_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 51 | 48 | AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1) |
| r1882 | r1883 | |
| 165 | 162 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(Right)") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 166 | 163 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(Insert)") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) |
| 167 | 164 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 165 | |
| 166 | /* Enhanced options not available on real hardware */ |
| 167 | PORT_START_TAG("CONFIG") |
| 168 | PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload") |
| 169 | PORT_CONFSETTING( 0x00, DEF_STR(No)) |
| 170 | PORT_CONFSETTING( 0x01, DEF_STR(Yes)) |
| 171 | PORT_BIT( 0x6, 0x6, IPT_UNUSED ) |
| 172 | // PORT_CONFNAME( 0x08, 0x08, "Cassette Speaker") |
| 173 | // PORT_CONFSETTING( 0x08, DEF_STR(On)) |
| 174 | // PORT_CONFSETTING( 0x00, DEF_STR(Off)) |
| 175 | // PORT_CONFNAME( 0x10, 0x10, "Auto-Resize?") |
| 176 | // PORT_CONFSETTING( 0x00, DEF_STR(No)) |
| 177 | // PORT_CONFSETTING( 0x10, DEF_STR(Yes)) |
| 168 | 178 | INPUT_PORTS_END |
| 169 | 179 | |
| 170 | 180 | static const gfx_layout mbee_charlayout = |
| r1882 | r1883 | |
| 342 | 352 | |
| 343 | 353 | ***************************************************************************/ |
| 344 | 354 | |
| 355 | static QUICKLOAD_LOAD( mbee ) |
| 356 | { |
| 357 | UINT8 sw = readinputportbytag("CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 358 | UINT16 exec_addr; |
| 359 | UINT64 return_info = z80bin_load_file( image, file_type ); /* load file */ |
| 360 | |
| 361 | if (return_info == INIT_FAIL) return INIT_FAIL; /* failure */ |
| 362 | |
| 363 | exec_addr = (return_info & 0xffff0000) >> 16; /* get program run address */ |
| 364 | |
| 365 | if (exec_addr == 0xffff) return INIT_PASS; /* data file */ |
| 366 | |
| 367 | program_write_word_16le(0xa6,exec_addr); /* fix the EXEC command */ |
| 368 | |
| 369 | if (sw) |
| 370 | { |
| 371 | program_write_word_16le(0xa2,exec_addr); /* fix warm-start vector to get around some copy-protections */ |
| 372 | cpunum_set_reg(0, REG_PC, exec_addr); |
| 373 | } |
| 374 | else |
| 375 | program_write_word_16le(0xa2,0x8517); |
| 376 | |
| 377 | return INIT_PASS; |
| 378 | } |
| 379 | |
| 380 | static void mbee_quickload_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 381 | { |
| 382 | /* quickload */ |
| 383 | switch(state) |
| 384 | { |
| 385 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 386 | case MESS_DEVINFO_STR_DEV_FILE: strcpy(info->s = device_temp_str(), __FILE__); break; |
| 387 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "bin"); break; |
| 388 | |
| 389 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 390 | case MESS_DEVINFO_PTR_QUICKLOAD_LOAD: info->f = (genf *) quickload_load_mbee; break; |
| 391 | |
| 392 | default: quickload_device_getinfo(devclass, state, info); break; |
| 393 | } |
| 394 | } |
| 395 | |
| 345 | 396 | static void mbee_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |
| 346 | 397 | { |
| 347 | 398 | /* cassette */ |
| r1882 | r1883 | |
| 391 | 442 | } |
| 392 | 443 | |
| 393 | 444 | |
| 394 | | |
| 395 | 445 | SYSTEM_CONFIG_START(mbee) |
| 396 | 446 | CONFIG_DEVICE(mbee_cassette_getinfo) |
| 397 | 447 | CONFIG_DEVICE(mbee_cartslot_getinfo) |
| 398 | 448 | CONFIG_DEVICE(mbee_floppy_getinfo) |
| 399 | | CONFIG_DEVICE(z80bin_quickload_getinfo) |
| 449 | CONFIG_DEVICE(mbee_quickload_getinfo) |
| 400 | 450 | SYSTEM_CONFIG_END |
| 401 | 451 | |
| 402 | 452 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |