src/mess/machine/apple2gs.c
| r11072 | r11073 | |
| 1685 | 1685 | } |
| 1686 | 1686 | } |
| 1687 | 1687 | |
| 1688 | // Because the bank address multiplexes on the 65816 data bus, reading a memory area |
| 1689 | // which doesn't drive the bus results in reading back the bank number. |
| 1690 | static READ8_HANDLER(apple2gs_bank_echo_r) |
| 1691 | { |
| 1692 | apple2gs_state *state = space->machine().driver_data<apple2gs_state>(); |
| 1688 | 1693 | |
| 1694 | return state->m_echo_bank + (offset>>16); |
| 1695 | } |
| 1696 | |
| 1689 | 1697 | static void apple2gs_setup_memory(running_machine &machine) |
| 1690 | 1698 | { |
| 1691 | 1699 | apple2gs_state *state = machine.driver_data<apple2gs_state>(); |
| r11072 | r11073 | |
| 1697 | 1705 | state->m_slowmem = auto_alloc_array_clear(machine, UINT8, 128*1024); |
| 1698 | 1706 | state_save_register_item_pointer(machine, "APPLE2GS_SLOWMEM", NULL, 0, state->m_slowmem, 128*1024); |
| 1699 | 1707 | |
| 1700 | | /* install expanded memory */ |
| 1701 | | if (ram_get_size(machine.device(RAM_TAG))> 0x010000) { |
| 1702 | | space->install_readwrite_bank(0x010000, ram_get_size(machine.device(RAM_TAG)) - 1, "bank1"); |
| 1708 | // install expanded memory |
| 1709 | // fair warning: other code assumes banks 0 and 1 are the first 128k of the RAM device, so you must install bank 1 at 0x10000 |
| 1710 | // otherwise nothing works :) |
| 1711 | if (state->m_is_rom3) |
| 1712 | { |
| 1713 | int ramsize = ram_get_size(machine.device(RAM_TAG)); |
| 1714 | |
| 1715 | // ROM 03 hardware: the quoted "1 MB" for a base machine doesn't include banks e0/e1, so map accordingly |
| 1716 | space->install_readwrite_bank(0x010000, ramsize - 1, "bank1"); |
| 1703 | 1717 | memory_set_bankptr(machine,"bank1", ram_get_ptr(machine.device(RAM_TAG)) + 0x010000); |
| 1718 | |
| 1719 | space->install_legacy_read_handler( ramsize, 0x7fffff, FUNC(apple2gs_bank_echo_r)); |
| 1720 | state->m_echo_bank = (ramsize >> 16); |
| 1704 | 1721 | } |
| 1722 | else |
| 1723 | { |
| 1724 | int ramsize = ram_get_size(machine.device(RAM_TAG))-0x30000; |
| 1705 | 1725 | |
| 1726 | // ROM 00/01 hardware: the quoted "256K" for a base machine *does* include banks e0/e1. |
| 1727 | space->install_readwrite_bank(0x010000, ramsize - 1 + 0x10000, "bank1"); |
| 1728 | memory_set_bankptr(machine,"bank1", ram_get_ptr(machine.device(RAM_TAG)) + 0x010000); |
| 1729 | |
| 1730 | space->install_legacy_read_handler( ramsize + 0x10000, 0x7fffff, FUNC(apple2gs_bank_echo_r)); |
| 1731 | state->m_echo_bank = (ramsize+0x10000) >> 16; |
| 1732 | } |
| 1733 | |
| 1706 | 1734 | /* install hi memory */ |
| 1707 | 1735 | space->install_read_bank(0xe00000, 0xe1ffff, "bank2"); |
| 1708 | 1736 | space->install_legacy_write_handler(0xe00000, 0xe1ffff, FUNC(apple2gs_slowmem_w)); |
| r11072 | r11073 | |
| 1761 | 1789 | When F3 pressed, the video mode changes and the machine goes into Basic */ |
| 1762 | 1790 | } |
| 1763 | 1791 | |
| 1764 | | MACHINE_START( apple2gs ) |
| 1792 | MACHINE_START( apple2gscommon ) |
| 1765 | 1793 | { |
| 1766 | 1794 | apple2gs_state *state = machine.driver_data<apple2gs_state>(); |
| 1767 | 1795 | apple2_init_common(machine); |
| r11072 | r11073 | |
| 1812 | 1840 | state->m_sndglu_addr = 0; |
| 1813 | 1841 | state->m_sndglu_dummy_read = 0; |
| 1814 | 1842 | |
| 1815 | | /* init the various subsystems */ |
| 1816 | | apple2gs_setup_memory(machine); |
| 1843 | state->m_is_rom3 = true; |
| 1817 | 1844 | |
| 1818 | 1845 | /* save state stuff. note that the driver takes care of docram. */ |
| 1819 | 1846 | UINT8* ram = ram_get_ptr(machine.device(RAM_TAG)); |
| r11072 | r11073 | |
| 1874 | 1901 | // fire on scanline zero |
| 1875 | 1902 | state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(0, 0)); |
| 1876 | 1903 | } |
| 1904 | |
| 1905 | MACHINE_START( apple2gs ) |
| 1906 | { |
| 1907 | MACHINE_START_NAME(apple2gscommon)(machine); |
| 1908 | apple2gs_setup_memory(machine); |
| 1909 | } |
| 1910 | |
| 1911 | MACHINE_START( apple2gsr1 ) |
| 1912 | { |
| 1913 | MACHINE_START_NAME(apple2gscommon)(machine); |
| 1914 | |
| 1915 | apple2gs_state *state = machine.driver_data<apple2gs_state>(); |
| 1916 | state->m_is_rom3 = false; |
| 1917 | apple2gs_setup_memory(machine); |
| 1918 | } |
src/mess/drivers/apple2gs.c
| r11072 | r11073 | |
| 300 | 300 | |
| 301 | 301 | /* internal ram */ |
| 302 | 302 | MCFG_RAM_ADD(RAM_TAG) |
| 303 | | MCFG_RAM_DEFAULT_SIZE("2M") |
| 304 | | MCFG_RAM_EXTRA_OPTIONS("64K") |
| 303 | MCFG_RAM_DEFAULT_SIZE("2M") // 1M on board + 1M in the expansion slot was common for ROM 03 |
| 304 | MCFG_RAM_EXTRA_OPTIONS("1M,3M,4M,5M,6M,7M,8M") |
| 305 | 305 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 306 | 306 | MACHINE_CONFIG_END |
| 307 | 307 | |
| 308 | static MACHINE_CONFIG_DERIVED( apple2gsr1, apple2gs ) |
| 309 | MCFG_MACHINE_START( apple2gsr1 ) |
| 308 | 310 | |
| 311 | MCFG_RAM_MODIFY(RAM_TAG) |
| 312 | MCFG_RAM_DEFAULT_SIZE("1280K") // 256K on board + 1M in the expansion slot was common for ROM 01 |
| 313 | MCFG_RAM_EXTRA_OPTIONS("256K,512K,768K,1M,2M,3M,4M,5M,6M,7M,8M") |
| 314 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 315 | MACHINE_CONFIG_END |
| 309 | 316 | |
| 310 | 317 | /*************************************************************************** |
| 311 | 318 | |
| r11072 | r11073 | |
| 386 | 393 | COMP( 1989, apple2gs, 0, apple2, apple2gs, apple2gs, apple2gs, "Apple Computer", "Apple IIgs (ROM03)", 0 ) |
| 387 | 394 | COMP( 198?, apple2gsr3p, apple2gs, 0, apple2gs, apple2gs, apple2gs, "Apple Computer", "Apple IIgs (ROM03 prototype)", GAME_NOT_WORKING ) |
| 388 | 395 | COMP( 1989, apple2gsr3lp, apple2gs, 0, apple2gs, apple2gs, apple2gs, "Apple Computer", "Apple IIgs (ROM03 late prototype?)", GAME_NOT_WORKING ) |
| 389 | | COMP( 1987, apple2gsr1, apple2gs, 0, apple2gs, apple2gs, apple2gs, "Apple Computer", "Apple IIgs (ROM01)", 0 ) |
| 390 | | COMP( 1986, apple2gsr0, apple2gs, 0, apple2gs, apple2gs, apple2gs, "Apple Computer", "Apple IIgs (ROM00)", 0 ) |
| 396 | COMP( 1987, apple2gsr1, apple2gs, 0, apple2gsr1, apple2gs, apple2gs, "Apple Computer", "Apple IIgs (ROM01)", 0 ) |
| 397 | COMP( 1986, apple2gsr0, apple2gs, 0, apple2gsr1, apple2gs, apple2gs, "Apple Computer", "Apple IIgs (ROM00)", 0 ) |