trunk/src/mess/drivers/force68k.c
| r249041 | r249042 | |
| 59 | 59 | * Slot 1 Controller Board ASCU 7 31 0xb02000 |
| 60 | 60 | * ---------------------------------------------------------- |
| 61 | 61 | * |
| 62 | | * 10. The VMEbus |
| 63 | | * --------------- |
| 64 | | * The implemented VMEbus Interface includes 24 address, 16 data, |
| 65 | | * 6 address modifier and the asynchronous control signals. |
| 66 | | * A single level bus arbiter is provided to build multi master |
| 67 | | * systems. In addition to the bus arbiter, a separate slave bus |
| 68 | | * arbitration allows selection of the arbitration level (0-3). |
| 69 | | * |
| 70 | | * The address modifier range .,Short 110 Access« can be selected |
| 71 | | * via a jumper for variable system generation. The 7 interrupt |
| 72 | | * request levels of the VMEbus are fully supported from the |
| 73 | | * SYS68K1CPU-1 B/D. For multi-processing, each IRQ signal can be |
| 74 | | * enabled/disabled via a jumper field. |
| 75 | | * |
| 76 | | * Additionally, the SYS68K1CPU-1 B/D supports the ACFAIL, SYSRESET, |
| 77 | | * SYSFAIL and SYSCLK signal (16 MHz). |
| 78 | | * |
| 79 | 62 | * TODO: |
| 80 | 63 | * - Finish 3 x ACIA6850, host and remote interface left, terminal works |
| 81 | 64 | * - Finish 1 x 68230 Motorola, Parallel Interface / Timer as required by ROM |
| r249041 | r249042 | |
| 100 | 83 | #include "machine/6850acia.h" |
| 101 | 84 | #include "machine/clock.h" |
| 102 | 85 | #include "bus/centronics/ctronics.h" |
| 86 | #include "bus/generic/slot.h" |
| 87 | #include "bus/generic/carts.h" |
| 103 | 88 | |
| 104 | | #define LOG(x) /* x */ |
| 89 | #define LOG(x) x |
| 105 | 90 | |
| 106 | 91 | #define BAUDGEN_CLOCK XTAL_1_8432MHz |
| 107 | 92 | /* |
| r249041 | r249042 | |
| 152 | 137 | , m_centronics_busy (0) |
| 153 | 138 | , m_centronics_perror (0) |
| 154 | 139 | , m_centronics_select (0) |
| 140 | ,m_cart(*this, "exp_rom1") |
| 155 | 141 | { |
| 156 | 142 | } |
| 157 | 143 | |
| 158 | 144 | DECLARE_READ16_MEMBER (bootvect_r); |
| 145 | DECLARE_READ16_MEMBER (vme_a24_r); |
| 146 | DECLARE_WRITE16_MEMBER (vme_a24_w); |
| 147 | DECLARE_READ16_MEMBER (vme_a16_r); |
| 148 | DECLARE_WRITE16_MEMBER (vme_a16_w); |
| 159 | 149 | virtual void machine_start (); |
| 160 | 150 | // clocks |
| 161 | 151 | DECLARE_WRITE_LINE_MEMBER (write_aciahost_clock); |
| r249041 | r249042 | |
| 166 | 156 | DECLARE_WRITE_LINE_MEMBER (centronics_busy_w); |
| 167 | 157 | DECLARE_WRITE_LINE_MEMBER (centronics_perror_w); |
| 168 | 158 | DECLARE_WRITE_LINE_MEMBER (centronics_select_w); |
| 159 | // User EPROM/SRAM slot(s) |
| 160 | //int force68k_load_cart(device_image_interface &image, generic_slot_device *slot); |
| 161 | //DECLARE_DEVICE_IMAGE_LOAD_MEMBER (exp1_load) { return force68k_load_cart(image, m_cart); } |
| 169 | 162 | |
| 170 | 163 | protected: |
| 171 | 164 | |
| r249041 | r249042 | |
| 185 | 178 | |
| 186 | 179 | // Pointer to System ROMs needed by bootvect_r |
| 187 | 180 | UINT16 *m_sysrom; |
| 181 | |
| 182 | required_device<generic_slot_device> m_cart; |
| 183 | |
| 188 | 184 | }; |
| 189 | 185 | |
| 190 | 186 | static ADDRESS_MAP_START (force68k_mem, AS_PROGRAM, 16, force68k_state) |
| 191 | 187 | ADDRESS_MAP_UNMAP_HIGH |
| 192 | 188 | AM_RANGE (0x000000, 0x000007) AM_ROM AM_READ (bootvect_r) /* Vectors mapped from System EPROM */ |
| 193 | | AM_RANGE (0x000008, 0x01ffff) AM_RAM /* DRAM */ |
| 194 | | AM_RANGE (0x080000, 0x09ffff) AM_ROM /* System EPROM Area */ |
| 195 | | // AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area */ |
| 189 | AM_RANGE (0x000008, 0x01ffff) AM_RAM /* DRAM */ |
| 190 | AM_RANGE (0x080000, 0x09ffff) AM_ROM /* System EPROM Area */ |
| 191 | //AM_RANGE (0x0a0000, 0x0bffff) AM_ROM /* User EPROM/SRAM Area, mapped by a cartslot */ |
| 196 | 192 | AM_RANGE (0x0c0040, 0x0c0041) AM_DEVREADWRITE8 ("aciahost", acia6850_device, status_r, control_w, 0x00ff) |
| 197 | 193 | AM_RANGE (0x0c0042, 0x0c0043) AM_DEVREADWRITE8 ("aciahost", acia6850_device, data_r, data_w, 0x00ff) |
| 198 | 194 | AM_RANGE (0x0c0080, 0x0c0081) AM_DEVREADWRITE8 ("aciaterm", acia6850_device, status_r, control_w, 0xff00) |
| r249041 | r249042 | |
| 202 | 198 | AM_RANGE (0x0c0400, 0x0c042f) AM_DEVREADWRITE8 ("rtc", mm58167_device, read, write, 0x00ff) |
| 203 | 199 | AM_RANGE (0x0e0000, 0x0e0035) AM_DEVREADWRITE8 ("pit", pit68230_device, read, write, 0x00ff) |
| 204 | 200 | // AM_RANGE(0x0e0200, 0x0e0380) AM_READWRITE(fpu_r, fpu_w) /* optional FPCP 68881 FPU interface */ |
| 205 | | // AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ |
| 206 | | // AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */ |
| 201 | AM_RANGE(0x100000, 0xfeffff) AM_READWRITE(vme_a24_r, vme_a24_w) /* VMEbus Rev B addresses (24 bits) */ |
| 202 | AM_RANGE(0xff0000, 0xffffff) AM_READWRITE(vme_a16_r, vme_a16_w) /* VMEbus Rev B addresses (16 bits) */ |
| 207 | 203 | ADDRESS_MAP_END |
| 208 | 204 | |
| 209 | 205 | /* Input ports */ |
| r249041 | r249042 | |
| 294 | 290 | |
| 295 | 291 | /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */ |
| 296 | 292 | m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0x080000); |
| 293 | |
| 294 | /* Map user ROM/RAM socket(s) */ |
| 295 | if (m_cart->exists()) |
| 296 | { |
| 297 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xa0000, |
| 298 | 0xaffff, |
| 299 | read16_delegate(FUNC(generic_slot_device::read16_rom), |
| 300 | (generic_slot_device*)m_cart)); |
| 301 | } |
| 297 | 302 | } |
| 298 | 303 | |
| 299 | 304 | /* Boot vector handler, the PCB hardwires the first 8 bytes from 0x80000 to 0x0 */ |
| r249041 | r249042 | |
| 301 | 306 | return m_sysrom [offset]; |
| 302 | 307 | } |
| 303 | 308 | |
| 309 | /* 10. The VMEbus (text from board documentation) |
| 310 | * --------------- |
| 311 | * The implemented VMEbus Interface includes 24 address, 16 data, |
| 312 | * 6 address modifier and the asynchronous control signals. |
| 313 | * A single level bus arbiter is provided to build multi master |
| 314 | * systems. In addition to the bus arbiter, a separate slave bus |
| 315 | * arbitration allows selection of the arbitration level (0-3). |
| 316 | * |
| 317 | * The address modifier range .,Short 110 Access« can be selected |
| 318 | * via a jumper for variable system generation. The 7 interrupt |
| 319 | * request levels of the VMEbus are fully supported from the |
| 320 | * SYS68K1CPU-1 B/D. For multi-processing, each IRQ signal can be |
| 321 | * enabled/disabled via a jumper field. |
| 322 | * |
| 323 | * Additionally, the SYS68K1CPU-1 B/D supports the ACFAIL, SYSRESET, |
| 324 | * SYSFAIL and SYSCLK signal (16 MHz). |
| 325 | */ |
| 326 | |
| 327 | /* Dummy VME access methods until the VME bus device is ready for use */ |
| 328 | READ16_MEMBER (force68k_state::vme_a24_r){ |
| 329 | LOG (logerror ("vme_a24_r\n")); |
| 330 | return (UINT16) 0; |
| 331 | } |
| 332 | |
| 333 | WRITE16_MEMBER (force68k_state::vme_a24_w){ |
| 334 | LOG (logerror ("vme_a24_w\n")); |
| 335 | } |
| 336 | |
| 337 | READ16_MEMBER (force68k_state::vme_a16_r){ |
| 338 | LOG (logerror ("vme_16_r\n")); |
| 339 | return (UINT16) 0; |
| 340 | } |
| 341 | |
| 342 | WRITE16_MEMBER (force68k_state::vme_a16_w){ |
| 343 | LOG (logerror ("vme_a16_w\n")); |
| 344 | } |
| 345 | |
| 304 | 346 | /* |
| 305 | 347 | * Serial port clock sources can all be driven by different outputs of the 14411 |
| 306 | 348 | */ |
| r249041 | r249042 | |
| 320 | 362 | } |
| 321 | 363 | |
| 322 | 364 | /* |
| 365 | * 4. The USER Area (Text from the board manual) |
| 366 | The USER area contains two 28 pin sockets with JEDEC compatible pin out. |
| 367 | To allow the usage of static RAM's, the access to the USER area is byte |
| 368 | oriented. Table 3. lists the usable device types. |
| 369 | |
| 370 | Bits Bytes EPROM SRAM |
| 371 | -------------------------- |
| 372 | 2Kx16 4 Kbyte 2716 6116 |
| 373 | 4Kx16 8 Kbyte 2732 |
| 374 | 8Kx16 16 Kbyte 2764 6264 |
| 375 | 16Kx16 32 Kbyte 27128 |
| 376 | 32Kx16 64 Kbyte 27256 |
| 377 | -------------------------- |
| 378 | */ |
| 379 | // Implementation of static 64K EPROM in sockets J10/J11 as 16 bit wide cartridge for easier |
| 380 | // software handling. TODO: make configurable according to table above. |
| 381 | static MACHINE_CONFIG_FRAGMENT( fccpu1_eprom_sockets ) |
| 382 | MCFG_GENERIC_CARTSLOT_ADD("exp_rom1", generic_linear_slot, "fccpu1_cart") |
| 383 | MCFG_GENERIC_EXTENSIONS("bin,rom") |
| 384 | MCFG_GENERIC_WIDTH(GENERIC_ROM16_WIDTH) |
| 385 | MCFG_GENERIC_ENDIAN(ENDIANNESS_LITTLE) // In generic call_load() len 12152, width 2 endianess 0 |
| 386 | // MCFG_GENERIC_ENDIAN(ENDIANNESS_BIG) // In generic call_load() len 12152, width 2 endianess 1 |
| 387 | // MCFG_GENERIC_LOAD(force68k_state, exp1_load) |
| 388 | // MCFG_SOFTWARE_LIST_ADD("cart_list", "fccpu1_cart") |
| 389 | MACHINE_CONFIG_END |
| 390 | |
| 391 | /*************************** |
| 392 | Rom loading functions |
| 393 | ****************************/ |
| 394 | int force68k_state::force68k_load_cart(device_image_interface &image, generic_slot_device *slot) |
| 395 | { |
| 396 | UINT32 size = slot->common_get_size("rom"); |
| 397 | |
| 398 | printf("force68k_load_cart() loading rom at slot %s for image \n", (char *) image.device_typename); |
| 399 | if (size > 0x10000) // Max 64Kb |
| 400 | { |
| 401 | LOG( printf("Cartridge size exceeding max size (64Kb): %d\n", size) ); |
| 402 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Cartridge size exceeding max size (64Kb)"); |
| 403 | return IMAGE_INIT_FAIL; |
| 404 | } |
| 405 | |
| 406 | slot->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_BIG); |
| 407 | slot->common_load_rom(slot->get_rom_base(), size, "rom"); |
| 408 | |
| 409 | return IMAGE_INIT_PASS; |
| 410 | } |
| 411 | |
| 412 | /* |
| 323 | 413 | * Machine configuration |
| 324 | 414 | */ |
| 325 | 415 | static MACHINE_CONFIG_START (fccpu1, force68k_state) |
| r249041 | r249042 | |
| 327 | 417 | MCFG_CPU_ADD ("maincpu", M68000, XTAL_16MHz / 2) |
| 328 | 418 | MCFG_CPU_PROGRAM_MAP (force68k_mem) |
| 329 | 419 | |
| 330 | | /* P3/Host Port config */ |
| 420 | /* P3/Host Port config |
| 421 | * LO command causes ROM monitor to expect S-records on HOST port by default |
| 422 | * Implementation through nullmodem currently does not support handshakes so |
| 423 | * the ROM momitor is over-run while checking for checksums etc if used with |
| 424 | * UI mount <file> feature. |
| 425 | */ |
| 331 | 426 | MCFG_DEVICE_ADD ("aciahost", ACIA6850, 0) |
| 332 | 427 | |
| 333 | 428 | MCFG_ACIA6850_TXD_HANDLER (DEVWRITELINE ("rs232host", rs232_port_device, write_txd)) |
| r249041 | r249042 | |
| 374 | 469 | MCFG_CENTRONICS_PERROR_HANDLER (WRITELINE (force68k_state, centronics_perror_w)) |
| 375 | 470 | MCFG_CENTRONICS_SELECT_HANDLER (WRITELINE (force68k_state, centronics_select_w)) |
| 376 | 471 | MCFG_CENTRONICS_OUTPUT_LATCH_ADD ("cent_data_out", "centronics") |
| 472 | |
| 473 | // EPROM sockets |
| 474 | MCFG_FRAGMENT_ADD(fccpu1_eprom_sockets) |
| 377 | 475 | MACHINE_CONFIG_END |
| 378 | 476 | |
| 379 | 477 | #if 0 /* |