src/mess/drivers/amiga.c
| r878 | r879 | |
| 46 | 46 | AM_RANGE(0xbfd000, 0xbfefff) AM_READWRITE(amiga_cia_r, amiga_cia_w) |
| 47 | 47 | AM_RANGE(0xc00000, 0xc7ffff) AM_RAM /* slow-mem */ |
| 48 | 48 | AM_RANGE(0xc80000, 0xcfffff) AM_READWRITE(amiga_custom_r, amiga_custom_w) /* see Note 1 above */ |
| 49 | | AM_RANGE(0xdc0000, 0xdc003f) AM_READWRITE(amiga_clock_r, amiga_clock_w); |
| 50 | 49 | AM_RANGE(0xdf0000, 0xdfffff) AM_READWRITE(amiga_custom_r, amiga_custom_w) AM_BASE(&amiga_custom_regs) /* Custom Chips */ |
| 51 | 50 | AM_RANGE(0xe80000, 0xe8ffff) AM_READWRITE(amiga_autoconfig_r, amiga_autoconfig_w) |
| 52 | 51 | #if AMIGA_ACTION_REPLAY_1 |
| r878 | r879 | |
| 97 | 96 | AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0xc0000) AM_RAMBANK(1) AM_BASE(&amiga_chip_ram) AM_SIZE(&amiga_chip_ram_size) |
| 98 | 97 | AM_RANGE(0xbfd000, 0xbfefff) AM_READWRITE(amiga_cia_r, amiga_cia_w) |
| 99 | 98 | AM_RANGE(0xc00000, 0xc3ffff) AM_READWRITE(amiga_custom_r, amiga_custom_w) /* See Note 1 above */ |
| 100 | | AM_RANGE(0xdc0000, 0xdc003f) AM_READWRITE(amiga_clock_r, amiga_clock_w); |
| 101 | 99 | AM_RANGE(0xdf0000, 0xdfffff) AM_READWRITE(amiga_custom_r, amiga_custom_w) AM_BASE(&amiga_custom_regs) /* Custom Chips */ |
| 102 | 100 | AM_RANGE(0xe80000, 0xe8ffff) AM_READWRITE(amiga_autoconfig_r, amiga_autoconfig_w) |
| 103 | 101 | AM_RANGE(0xf80000, 0xfbffff) AM_ROM AM_REGION(REGION_USER1, 0) /* Bootstrap ROM */ |
| 104 | 102 | AM_RANGE(0xfc0000, 0xffffff) AM_RAMBANK(2) /* Writable Control Store RAM */ |
| 105 | 103 | ADDRESS_MAP_END |
| 106 | 104 | |
| 105 | |
| 107 | 106 | /*************************************************************************** |
| 108 | 107 | Inputs |
| 109 | 108 | ***************************************************************************/ |
| 110 | 109 | |
| 111 | | INPUT_PORTS_START( amiga ) |
| 112 | | PORT_START_TAG("config") |
| 110 | |
| 111 | INPUT_PORTS_START( amiga_common ) |
| 112 | PORT_START_TAG("input") |
| 113 | 113 | PORT_CONFNAME( 0x20, 0x00, "Input Port 0 Device") |
| 114 | 114 | PORT_CONFSETTING( 0x00, "Mouse" ) |
| 115 | 115 | PORT_CONFSETTING( 0x20, DEF_STR(Joystick) ) |
| 116 | 116 | PORT_CONFNAME( 0x10, 0x10, "Input Port 1 Device") |
| 117 | 117 | PORT_CONFSETTING( 0x00, "Mouse" ) |
| 118 | 118 | PORT_CONFSETTING( 0x10, DEF_STR(Joystick) ) |
| 119 | | |
| 119 | |
| 120 | 120 | PORT_START_TAG("CIA0PORTA") |
| 121 | 121 | PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_SPECIAL ) |
| 122 | 122 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| r878 | r879 | |
| 165 | 165 | |
| 166 | 166 | INPUT_PORTS_END |
| 167 | 167 | |
| 168 | |
| 169 | INPUT_PORTS_START( amiga ) |
| 170 | PORT_START_TAG("hardware") |
| 171 | PORT_CONFNAME( 0x08, 0x08, "Battery backed-up RTC") |
| 172 | PORT_CONFSETTING( 0x00, "Not Installed" ) |
| 173 | PORT_CONFSETTING( 0x08, "Installed" ) |
| 174 | |
| 175 | PORT_INCLUDE( amiga_common ) |
| 176 | INPUT_PORTS_END |
| 177 | |
| 178 | |
| 179 | /* TODO: Support for the CDTV remote control */ |
| 180 | INPUT_PORTS_START( cdtv ) |
| 181 | PORT_INCLUDE( amiga_common ) |
| 182 | INPUT_PORTS_END |
| 183 | |
| 184 | |
| 185 | |
| 168 | 186 | /*************************************************************************** |
| 169 | 187 | Machine drivers |
| 170 | 188 | ***************************************************************************/ |
| r878 | r879 | |
| 282 | 300 | |
| 283 | 301 | static UINT16 amiga_read_joy0dat(void) |
| 284 | 302 | { |
| 285 | | if ( readinputportbytag("config") & 0x20 ) { |
| 303 | if ( readinputportbytag("input") & 0x20 ) { |
| 286 | 304 | /* Joystick */ |
| 287 | 305 | return readinputportbytag_safe("JOY0DAT", 0xffff); |
| 288 | 306 | } else { |
| r878 | r879 | |
| 296 | 314 | |
| 297 | 315 | static UINT16 amiga_read_joy1dat(void) |
| 298 | 316 | { |
| 299 | | if ( readinputportbytag("config") & 0x10 ) { |
| 317 | if ( readinputportbytag("input") & 0x10 ) { |
| 300 | 318 | /* Joystick */ |
| 301 | 319 | return readinputportbytag_safe("JOY1DAT", 0xffff); |
| 302 | 320 | } else { |
| r878 | r879 | |
| 321 | 339 | } |
| 322 | 340 | } |
| 323 | 341 | |
| 342 | static void amiga_reset(void) |
| 343 | { |
| 344 | if (readinputportbytag("hardware") & 0x08) |
| 345 | { |
| 346 | /* Install RTC */ |
| 347 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xdc0000, 0xdc003f, 0, 0, amiga_clock_r, amiga_clock_w); |
| 348 | } |
| 349 | else |
| 350 | { |
| 351 | /* No RTC support */ |
| 352 | memory_install_readwrite16_handler(0, ADDRESS_SPACE_PROGRAM, 0xdc0000, 0xdc003f, 0, 0, MRA16_UNMAP, MWA16_UNMAP); |
| 353 | } |
| 354 | } |
| 355 | |
| 324 | 356 | static DRIVER_INIT( amiga ) |
| 325 | 357 | { |
| 326 | 358 | static const amiga_machine_interface amiga_intf = |
| r878 | r879 | |
| 335 | 367 | amiga_read_dskbytr, amiga_write_dsklen, /* dskbytr_r & dsklen_w */ |
| 336 | 368 | NULL, /* serdat_w */ |
| 337 | 369 | NULL, /* scanline0_callback */ |
| 338 | | NULL /* reset_callback */ |
| 370 | amiga_reset /* reset_callback */ |
| 339 | 371 | }; |
| 340 | 372 | |
| 341 | 373 | amiga_machine_config(&amiga_intf); |
| r878 | r879 | |
| 451 | 483 | COMP( 1985, a1000p, a1000n, 0, a1000p, amiga, amiga, amiga, "Commodore Business Machines Co.", "Commodore Amiga 1000 (PAL-OCS)", GAME_COMPUTER | GAME_IMPERFECT_GRAPHICS ) |
| 452 | 484 | COMPB( 1987, a500n, 0, amiga, 0, ntsc, amiga, amiga, amiga, "Commodore Business Machines Co.", "Commodore Amiga 500 (NTSC-OCS)", GAME_COMPUTER | GAME_IMPERFECT_GRAPHICS ) |
| 453 | 485 | COMPB( 1987, a500p, a500n, amiga, 0, pal, amiga, amiga, amiga, "Commodore Business Machines Co.", "Commodore Amiga 500 (PAL-OCS)", GAME_COMPUTER | GAME_IMPERFECT_GRAPHICS ) |
| 454 | | COMP( 1991, cdtv, 0, 0, cdtv, amiga, cdtv, cdtv, "Commodore Business Machines Co.", "Commodore Amiga CDTV 1.0 (NTSC)", GAME_COMPUTER | GAME_IMPERFECT_GRAPHICS ) |
| 486 | COMP( 1991, cdtv, 0, 0, cdtv, cdtv, cdtv, cdtv, "Commodore Business Machines Co.", "Commodore Amiga CDTV 1.0 (NTSC)", GAME_COMPUTER | GAME_IMPERFECT_GRAPHICS ) |