src/mess/machine/mbee.c
| r1854 | r1855 | |
| 32 | 32 | static UINT8 fdc_status = 0; |
| 33 | 33 | static void pio_interrupt(int state); |
| 34 | 34 | static void mbee_fdc_callback(wd17xx_state_t event, void *param); |
| 35 | | static UINT8 mbee_busnop = 0; |
| 36 | 35 | |
| 37 | 36 | UINT8 *mbee_workram; |
| 38 | 37 | |
| r1854 | r1855 | |
| 49 | 48 | } |
| 50 | 49 | |
| 51 | 50 | /* |
| 52 | | NOTE: the original hardware has a "busnop" circuit which is enabled on reset/poweron. |
| 53 | | It causes all reads to return 0x00 until A15 is asserted (e.g. a read at or above 0x8000). |
| 54 | | The following stuff emulates that functionality. |
| 51 | On reset or power on, a circuit forces rom 8000-8FFF to appear at 0000-0FFF, while ram is disabled. |
| 52 | It gets set back to normal on the first attempt to write to memory. (/WR line goes active). |
| 53 | The previous code caused the debugger to show $FF always in RAM, soft reset to hang, and many games to not work. |
| 55 | 54 | */ |
| 56 | 55 | |
| 57 | | READ8_HANDLER( mbee_lowram_r ) |
| 58 | | { |
| 59 | | if (mbee_busnop) |
| 60 | | { |
| 61 | | return 0; |
| 62 | | } |
| 63 | 56 | |
| 64 | | return mbee_workram[offset]; |
| 65 | | } |
| 66 | | |
| 67 | | static OPBASE_HANDLER( mbee_opbase_handler ) |
| 57 | /* after the first 4 bytes have been read from ROM, switch the ram back in */ |
| 58 | static TIMER_CALLBACK( mbee_reset ) |
| 68 | 59 | { |
| 69 | | if (address > 0x7fff) |
| 70 | | { |
| 71 | | mbee_busnop = 0; |
| 72 | | } |
| 73 | | |
| 74 | | return address; |
| 60 | memory_set_bank(1, 0); |
| 75 | 61 | } |
| 76 | 62 | |
| 77 | | static OPBASE_HANDLER( mbee56_opbase_handler ) |
| 78 | | { |
| 79 | | if (address > 0xdfff) |
| 80 | | { |
| 81 | | mbee_busnop = 0; |
| 82 | | } |
| 83 | | |
| 84 | | return address; |
| 85 | | } |
| 86 | | |
| 87 | 63 | MACHINE_RESET( mbee ) |
| 88 | 64 | { |
| 89 | | mbee_busnop = 1; |
| 90 | | } |
| 91 | | |
| 92 | | static void mbee_machine_start(opbase_handler handler) |
| 93 | | { |
| 94 | 65 | z80pio_init(0, &pio_intf); |
| 95 | | wd17xx_init(WD_TYPE_179X,mbee_fdc_callback, NULL); |
| 96 | | memory_set_opbase_handler(0, handler); |
| 66 | timer_set(ATTOTIME_IN_USEC(4), NULL, 0, mbee_reset); |
| 67 | memory_set_bank(1, 1); |
| 97 | 68 | } |
| 98 | 69 | |
| 99 | 70 | MACHINE_START( mbee ) |
| 100 | 71 | { |
| 101 | | mbee_machine_start(mbee_opbase_handler); |
| 72 | wd17xx_init(WD_TYPE_179X,mbee_fdc_callback, NULL); |
| 102 | 73 | } |
| 103 | 74 | |
| 104 | | MACHINE_START( mbee56 ) |
| 105 | | { |
| 106 | | mbee_machine_start(mbee56_opbase_handler); |
| 107 | | } |
| 108 | | |
| 109 | 75 | static mess_image *cassette_device_image(void) |
| 110 | 76 | { |
| 111 | 77 | return image_from_devtype_and_index(IO_CASSETTE, 0); |
src/mess/drivers/mbee.c
| r1854 | r1855 | |
| 48 | 48 | #include "cpu/z80/z80daisy.h" |
| 49 | 49 | |
| 50 | 50 | static ADDRESS_MAP_START(mbee_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 51 | | AM_RANGE(0x0000, 0x7fff) AM_RAM AM_READ( mbee_lowram_r ) AM_BASE( &mbee_workram ) |
| 51 | AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1) |
| 52 | AM_RANGE(0x1000, 0x7fff) AM_RAM |
| 52 | 53 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 53 | 54 | AM_RANGE(0xc000, 0xdfff) AM_ROM |
| 54 | 55 | AM_RANGE(0xe000, 0xefff) AM_ROM |
| r1854 | r1855 | |
| 58 | 59 | |
| 59 | 60 | |
| 60 | 61 | static ADDRESS_MAP_START(mbee56_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 61 | | AM_RANGE(0x0000, 0xdfff) AM_RAM |
| 62 | AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1) |
| 63 | AM_RANGE(0x1000, 0xdfff) AM_RAM |
| 62 | 64 | AM_RANGE(0xe000, 0xefff) AM_ROM |
| 63 | 65 | AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(mbee_videoram_r, mbee_videoram_w) AM_BASE(&pcgram) AM_SIZE(&videoram_size) |
| 64 | 66 | AM_RANGE(0xf800, 0xffff) AM_READWRITE(mbee_pcg_color_r, mbee_pcg_color_w) |
| r1854 | r1855 | |
| 252 | 254 | MDRV_CPU_ADD_TAG("main", Z80, 3375000) /* 3.37500 Mhz */ |
| 253 | 255 | MDRV_CPU_PROGRAM_MAP(mbee_mem, 0) |
| 254 | 256 | MDRV_CPU_IO_MAP(mbee_ports, 0) |
| 255 | | /* MDRV_CPU_CONFIG(mbee_daisy_chain) */ |
| 257 | MDRV_CPU_CONFIG(mbee_daisy_chain) |
| 256 | 258 | MDRV_CPU_VBLANK_INT(mbee_interrupt,1) |
| 257 | 259 | MDRV_INTERLEAVE(1) |
| 258 | 260 | |
| r1854 | r1855 | |
| 285 | 287 | MDRV_IMPORT_FROM( mbee ) |
| 286 | 288 | MDRV_CPU_MODIFY( "main" ) |
| 287 | 289 | MDRV_CPU_PROGRAM_MAP(mbee56_mem, 0) |
| 288 | | MDRV_MACHINE_START( mbee56 ) |
| 289 | 290 | MACHINE_DRIVER_END |
| 290 | 291 | |
| 292 | static DRIVER_INIT( mbee ) |
| 293 | { |
| 294 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 295 | memory_configure_bank(1, 0, 2, &RAM[0x0000], 0x8000); |
| 296 | } |
| 291 | 297 | |
| 298 | static DRIVER_INIT( mbee56 ) |
| 299 | { |
| 300 | UINT8 *RAM = memory_region(REGION_CPU1); |
| 301 | memory_configure_bank(1, 0, 2, &RAM[0x0000], 0xe000); |
| 302 | } |
| 303 | |
| 292 | 304 | ROM_START( mbee ) |
| 293 | 305 | ROM_REGION(0x10000,REGION_CPU1,0) |
| 294 | 306 | ROM_LOAD("bas522a.rom", 0x8000, 0x2000, CRC(7896a696) SHA1(a158f7803296766160e1f258dfc46134735a9477)) |
| r1854 | r1855 | |
| 383 | 395 | SYSTEM_CONFIG_END |
| 384 | 396 | |
| 385 | 397 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 386 | | COMP( 1982, mbee, 0, 0, mbee, mbee, 0, mbee, "Applied Technology", "Microbee 32 IC" , 0) |
| 387 | | COMP( 1982, mbeepc, mbee, 0, mbee, mbee, 0, mbee, "Applied Technology", "Microbee 32 PC" , 0) |
| 388 | | COMP( 1985?,mbeepc85, mbee, 0, mbee, mbee, 0, mbee, "Applied Technology", "Microbee 32 PC85" , 0) |
| 389 | | COMP( 1983, mbee56, mbee, 0, mbee56, mbee, 0, mbee, "Applied Technology", "Microbee 56" , 0) |
| 398 | COMP( 1982, mbee, 0, 0, mbee, mbee, mbee, mbee, "Applied Technology", "Microbee 32 IC" , 0) |
| 399 | COMP( 1982, mbeepc, mbee, 0, mbee, mbee, mbee, mbee, "Applied Technology", "Microbee 32 PC" , 0) |
| 400 | COMP( 1985?,mbeepc85, mbee, 0, mbee, mbee, mbee, mbee, "Applied Technology", "Microbee 32 PC85" , 0) |
| 401 | COMP( 1983, mbee56, mbee, 0, mbee56, mbee, mbee56, mbee, "Applied Technology", "Microbee 56" , 0) |
| 390 | 402 | |