trunk/src/mess/drivers/a7800.c
| r244974 | r244975 | |
| 117 | 117 | m_maria(*this, "maria"), |
| 118 | 118 | m_io_joysticks(*this, "joysticks"), |
| 119 | 119 | m_io_buttons(*this, "buttons"), |
| 120 | | m_io_vblank(*this, "vblank"), |
| 121 | 120 | m_io_console_buttons(*this, "console_buttons"), |
| 122 | 121 | m_cart(*this, "cartslot"), |
| 123 | | m_screen(*this, "screen") { } |
| 122 | m_screen(*this, "screen"), |
| 123 | m_bios(*this, "maincpu") { } |
| 124 | 124 | |
| 125 | 125 | int m_lines; |
| 126 | 126 | int m_ispal; |
| r244974 | r244975 | |
| 132 | 132 | int m_p2_one_button; |
| 133 | 133 | int m_bios_enabled; |
| 134 | 134 | |
| 135 | | UINT8 *m_bios; |
| 136 | | |
| 137 | 135 | DECLARE_READ8_MEMBER(bios_or_cart_r); |
| 138 | 136 | DECLARE_WRITE8_MEMBER(ram0_w); |
| 139 | 137 | DECLARE_READ8_MEMBER(tia_r); |
| r244974 | r244975 | |
| 158 | 156 | required_device<atari_maria_device> m_maria; |
| 159 | 157 | required_ioport m_io_joysticks; |
| 160 | 158 | required_ioport m_io_buttons; |
| 161 | | required_ioport m_io_vblank; |
| 162 | 159 | required_ioport m_io_console_buttons; |
| 163 | 160 | required_device<a78_cart_slot_device> m_cart; |
| 164 | 161 | required_device<screen_device> m_screen; |
| 162 | required_region_ptr<UINT8> m_bios; |
| 165 | 163 | }; |
| 166 | 164 | |
| 167 | 165 | |
| r244974 | r244975 | |
| 282 | 280 | static ADDRESS_MAP_START( a7800_mem, AS_PROGRAM, 8, a7800_state ) |
| 283 | 281 | AM_RANGE(0x0000, 0x001f) AM_MIRROR(0x300) AM_READWRITE(tia_r, tia_w) |
| 284 | 282 | AM_RANGE(0x0020, 0x003f) AM_MIRROR(0x300) AM_DEVREADWRITE("maria", atari_maria_device, read, write) |
| 285 | | AM_RANGE(0x0040, 0x00ff) AM_RAMBANK("ram0") // RAM (6116 block 0) |
| 286 | | AM_RANGE(0x0140, 0x01ff) AM_RAMBANK("ram1") // RAM (6116 block 1) |
| 283 | AM_RANGE(0x0040, 0x00ff) AM_RAMBANK("zpmirror") // mirror of 0x2040-0x20ff, for zero page |
| 284 | AM_RANGE(0x0140, 0x01ff) AM_RAMBANK("spmirror") // mirror of 0x2140-0x21ff, for stack page |
| 287 | 285 | AM_RANGE(0x0280, 0x02ff) AM_DEVREADWRITE("riot", riot6532_device, read, write) |
| 288 | | AM_RANGE(0x0480, 0x04ff) AM_MIRROR(0x100) AM_RAMBANK("riot_ram") |
| 289 | | AM_RANGE(0x1800, 0x27ff) AM_RAMBANK("main_ram") |
| 290 | | |
| 291 | | AM_RANGE(0x2040, 0x20ff) AM_RAMBANK("ram0") // mirror (6116 block 0) |
| 292 | | AM_RANGE(0x2140, 0x21ff) AM_RAMBANK("ram1") // mirror (6116 block 1) |
| 293 | | |
| 294 | | AM_RANGE(0x2800, 0x2fff) AM_RAMBANK("mirror") // these should mirror "main_ram" (according to docs) |
| 295 | | AM_RANGE(0x3000, 0x37ff) AM_RAMBANK("mirror") // but system have issues in such case... |
| 296 | | AM_RANGE(0x3800, 0x3fff) AM_RAMBANK("mirror") |
| 286 | AM_RANGE(0x0480, 0x04ff) AM_RAM AM_SHARE("riot_ram") AM_MIRROR(0x100) |
| 287 | AM_RANGE(0x1800, 0x1fff) AM_RAM AM_SHARE("6116_1") |
| 288 | AM_RANGE(0x2000, 0x27ff) AM_RAM AM_SHARE("6116_2") AM_MIRROR(0x0800) |
| 289 | // According to the official Software Guide, the RAM at 0x2000 is |
| 290 | // repeatedly mirrored up to 0x3fff, but this is evidently incorrect |
| 291 | // because the High Score Cartridge maps ROM at 0x3000-0x3fff |
| 292 | // Hardware tests show that only the mirror at 0x2800-0x2fff actually |
| 293 | // exists, and only on some hardware (MARIA? motherboard?) revisions |
| 297 | 294 | AM_RANGE(0x4000, 0xffff) AM_DEVWRITE("cartslot", a78_cart_slot_device, write_40xx) |
| 298 | 295 | AM_RANGE(0x4000, 0xbfff) AM_DEVREAD("cartslot", a78_cart_slot_device, read_40xx) |
| 299 | 296 | AM_RANGE(0xc000, 0xffff) AM_READ(bios_or_cart_r) // here also the BIOS can be accessed |
| r244974 | r244975 | |
| 322 | 319 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) |
| 323 | 320 | PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED) |
| 324 | 321 | |
| 325 | | PORT_START("vblank") |
| 326 | | PORT_BIT(0x7F, IP_ACTIVE_LOW, IPT_UNUSED) |
| 327 | | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen") |
| 328 | | |
| 329 | 322 | PORT_START("console_buttons") |
| 330 | 323 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Reset") PORT_CODE(KEYCODE_R) |
| 331 | 324 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Select") PORT_CODE(KEYCODE_S) |
| r244974 | r244975 | |
| 1306 | 1299 | |
| 1307 | 1300 | void a7800_state::machine_start() |
| 1308 | 1301 | { |
| 1309 | | m_bios = machine().root_device().memregion("maincpu")->base() + 0xc000; |
| 1310 | 1302 | save_item(NAME(m_p1_one_button)); |
| 1311 | 1303 | save_item(NAME(m_p2_one_button)); |
| 1312 | 1304 | save_item(NAME(m_bios_enabled)); |
| r244974 | r244975 | |
| 1314 | 1306 | save_item(NAME(m_ctrl_reg)); |
| 1315 | 1307 | save_item(NAME(m_maria_flag)); |
| 1316 | 1308 | |
| 1309 | // set up RAM mirrors |
| 1310 | UINT8 *ram = reinterpret_cast<UINT8 *>(memshare("6116_2")->ptr()); |
| 1311 | membank("zpmirror")->set_base(ram + 0x0040); |
| 1312 | membank("spmirror")->set_base(ram + 0x0140); |
| 1313 | |
| 1317 | 1314 | // install additional handlers, if needed |
| 1318 | 1315 | if (m_cart->exists()) |
| 1319 | 1316 | { |
| r244974 | r244975 | |
| 1420 | 1417 | ***************************************************************************/ |
| 1421 | 1418 | |
| 1422 | 1419 | ROM_START( a7800 ) |
| 1423 | | ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) |
| 1420 | ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) |
| 1424 | 1421 | ROM_SYSTEM_BIOS( 0, "a7800", "Atari 7800" ) |
| 1425 | | ROMX_LOAD("7800.u7", 0xf000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1)) |
| 1422 | ROMX_LOAD("7800.u7", 0x3000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1)) |
| 1426 | 1423 | ROM_SYSTEM_BIOS( 1, "a7800pr", "Atari 7800 (prototype with Asteroids)" ) |
| 1427 | | ROMX_LOAD("c300558-001a.u7", 0xc000, 0x4000, CRC(a0e10edf) SHA1(14584b1eafe9721804782d4b1ac3a4a7313e455f), ROM_BIOS(2)) |
| 1424 | ROMX_LOAD("c300558-001a.u7", 0x0000, 0x4000, CRC(a0e10edf) SHA1(14584b1eafe9721804782d4b1ac3a4a7313e455f), ROM_BIOS(2)) |
| 1428 | 1425 | ROM_END |
| 1429 | 1426 | |
| 1430 | 1427 | ROM_START( a7800p ) |
| 1431 | | ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) |
| 1432 | | ROM_LOAD("7800pal.rom", 0xc000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874)) |
| 1428 | ROM_REGION(0x4000, "maincpu", ROMREGION_ERASEFF) |
| 1429 | ROM_LOAD("7800pal.rom", 0x0000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874)) |
| 1433 | 1430 | ROM_END |
| 1434 | 1431 | |
| 1435 | 1432 | |