branches/alto2/src/mess/drivers/alto2.c
| r26098 | r26099 | |
| 10 | 10 | #include "cpu/alto2/alto2.h" |
| 11 | 11 | #include "cpu/alto2/a2roms.h" |
| 12 | 12 | |
| 13 | | // FIXME: Is this required? How to access the address space words? |
| 14 | | // This has to somehow be mapped to the a2mem half DWORD accesses |
| 15 | | // and (optionally) Hamming code and parity flag updating |
| 13 | // FIXME: Is this required? The driver does not have/need access to RAM |
| 16 | 14 | READ16_MEMBER( alto2_state::alto2_ram_r ) |
| 17 | 15 | { |
| 18 | 16 | return downcast<alto2_cpu_device *>(m_maincpu.target())->read_ram(offset); |
| 19 | 17 | } |
| 20 | 18 | |
| 21 | | // FIXME: Is this required? How to access the address space words? |
| 22 | | // This has to somehow be mapped to the a2mem half DWORD accesses |
| 23 | | // and (optionally) Hamming code and parity flag updating |
| 19 | // FIXME: Is this required? The driver does not have/need access to RAM |
| 24 | 20 | WRITE16_MEMBER( alto2_state::alto2_ram_w ) |
| 25 | 21 | { |
| 26 | 22 | downcast<alto2_cpu_device *>(m_maincpu.target())->write_ram(offset, data); |
| r26098 | r26099 | |
| 28 | 24 | |
| 29 | 25 | /* Memory Maps */ |
| 30 | 26 | |
| 27 | ADDRESS_MAP_EXTERN( alto2_ucode_map, 32 ); |
| 28 | |
| 31 | 29 | /* main memory and memory mapped i/o in range ALTO2_IO_PAGE_BASE ... ALTO2_IO_PAGE_BASE + ALTO2_IO_PAGE_SIZE - 1 */ |
| 32 | 30 | ADDRESS_MAP_START( alto2_ram_map, AS_2, 16, alto2_state ) |
| 33 | 31 | ADDRESS_MAP_UNMAP_HIGH |
| r26098 | r26099 | |
| 234 | 232 | PORT_CONFSETTING( 0x40, "PAL") |
| 235 | 233 | INPUT_PORTS_END |
| 236 | 234 | |
| 235 | /* ROM */ |
| 236 | ROM_START( alto2 ) |
| 237 | // decoded micro code region - driver side view on the memory |
| 238 | ROM_REGION32_BE( sizeof(UINT32)*ALTO2_UCODE_SIZE, "maincpu", 0 ) |
| 239 | ROM_FILL(0, sizeof(UINT32)*ALTO2_UCODE_SIZE, ALTO2_UCODE_INVERTED) |
| 240 | ROM_END |
| 241 | |
| 237 | 242 | /* Palette Initialization */ |
| 238 | 243 | |
| 239 | 244 | void alto2_state::palette_init() |
| r26098 | r26099 | |
| 245 | 250 | static MACHINE_CONFIG_START( alto2, alto2_state ) |
| 246 | 251 | /* basic machine hardware */ |
| 247 | 252 | MCFG_CPU_ADD("maincpu", ALTO2, XTAL_20_16MHz) |
| 253 | MCFG_CPU_PROGRAM_MAP(alto2_ucode_map) |
| 248 | 254 | MCFG_CPU_IO_MAP(alto2_ram_map) |
| 249 | 255 | |
| 250 | 256 | /* video hardware */ |
| r26098 | r26099 | |
| 256 | 262 | MCFG_PALETTE_LENGTH(2) |
| 257 | 263 | MACHINE_CONFIG_END |
| 258 | 264 | |
| 259 | | /* ROM */ |
| 260 | | ROM_START( alto2 ) |
| 261 | | ROM_END |
| 262 | | |
| 263 | 265 | /* Driver Init */ |
| 264 | 266 | |
| 265 | 267 | DRIVER_INIT_MEMBER( alto2_state, alto2 ) |
| 266 | 268 | { |
| 269 | // make a copy for the front end, i.e. the driver view on the micro code |
| 270 | memcpy(memregion("maincpu"), memregion("maincpu:ucode"), sizeof(UINT32)*ALTO2_UCODE_SIZE); |
| 267 | 271 | } |
| 268 | 272 | |
| 269 | 273 | /* Game Drivers */ |
branches/alto2/src/emu/cpu/alto2/alto2.c
| r26098 | r26099 | |
| 10 | 10 | #include "alto2.h" |
| 11 | 11 | #include "a2roms.h" |
| 12 | 12 | |
| 13 | #define DEBUG_UCODE_CONST_DATA 0 //!< define to 1 to dump decoded micro code and constants |
| 14 | |
| 13 | 15 | //************************************************************************** |
| 14 | 16 | // DEVICE DEFINITIONS |
| 15 | 17 | //************************************************************************** |
| r26098 | r26099 | |
| 36 | 38 | m_log_level(9), |
| 37 | 39 | m_log_newline(true), |
| 38 | 40 | #endif |
| 39 | | m_ucode_config("maincpu", ENDIANNESS_BIG, 32, 14, -2, ADDRESS_MAP_NAME(alto2_ucode_map)), |
| 40 | | m_ucode_map(*this, "maincpu"), |
| 41 | m_ucode_config("alto2", ENDIANNESS_BIG, 32, 14, -2, ADDRESS_MAP_NAME(alto2_ucode_map)), |
| 42 | m_ucode_map(*this, ":maincpu:ucode"), |
| 41 | 43 | m_ucode(0), |
| 42 | 44 | m_ucode_proms(0), |
| 43 | 45 | m_const_proms(0), |
| r26098 | r26099 | |
| 124 | 126 | |
| 125 | 127 | ROM_START( alto2_cpu ) |
| 126 | 128 | // decoded micro code region |
| 127 | | ROM_REGION32_BE( sizeof(UINT32)*ALTO2_UCODE_SIZE, "maincpu", 0 ) |
| 129 | ROM_REGION32_BE( sizeof(UINT32)*ALTO2_UCODE_SIZE, "ucode", 0 ) |
| 128 | 130 | ROM_FILL(0, sizeof(UINT32)*ALTO2_UCODE_SIZE, ALTO2_UCODE_INVERTED) |
| 129 | 131 | |
| 130 | 132 | ROM_REGION( 16 * 02000, "ucode_proms", 0 ) |
| r26098 | r26099 | |
| 156 | 158 | ROM_LOAD( "madr.a3", 3*00400, 00400, CRC(e0992757) SHA1(5c45ea824970663cb9ee672dc50861539c860249) ) //!< 0000-0377 C(12)',C(13)',C(14)',C(15)' |
| 157 | 159 | |
| 158 | 160 | // extended memory Mesa 4.1 (?) micro code PROMs, 8 x 4bit (unused) |
| 159 | | ROM_REGION32_BE( 8 * 02000, "xm_mesa_4.1", ROMREGION_INVERT ) |
| 161 | ROM_REGION( 8 * 02000, "xm_mesa_4.1", 0 ) |
| 160 | 162 | ROM_LOAD( "xm654.41", 0*02000, 02000, CRC(beace302) SHA1(0002fea03a0261f57365095c4b87385d833f7063) ) //!< 00000-01777 RSEL(0)',RSEL(1)',RSEL(2)',RSEL(3)' |
| 161 | 163 | ROM_LOAD( "xm674.41", 1*02000, 02000, CRC(7db5c097) SHA1(364bc41951baa3ad274031bd49abec1cf5b7a980) ) //!< 00000-01777 RSEL(4)',ALUF(0)',ALUF(1)',ALUF(2)' |
| 162 | 164 | ROM_LOAD( "xm675.41", 2*02000, 02000, CRC(26eac1e7) SHA1(9220a1386afae8de96bdb2cf084afbadeeb61d42) ) //!< 00000-01777 ALUF(3)',BS(0)',BS(1)',BS(2)' |
| r26098 | r26099 | |
| 845 | 847 | { |
| 846 | 848 | m_ucode = &space(AS_0); |
| 847 | 849 | m_ucode_proms = prom_load(pl_ucode, memregion("ucode_proms")->base(), ALTO2_UCODE_ROM_PAGES, 8); |
| 848 | | UINT32* p_ucode = reinterpret_cast<UINT32 *>(memregion("maincpu")->base()); |
| 850 | UINT32* p_ucode = reinterpret_cast<UINT32 *>(memregion(":maincpu:ucode")->base()); |
| 849 | 851 | for (offs_t offs = 0; offs < ALTO2_UCODE_RAM_BASE; offs++) { |
| 850 | 852 | UINT32 data = (m_ucode_proms[4*offs+0] << 0) | (m_ucode_proms[4*offs+1] << 8) | |
| 851 | 853 | (m_ucode_proms[4*offs+2] << 16) | (m_ucode_proms[4*offs+3] << 24); |
| 854 | #if DEBUG_UCODE_CONST_DATA |
| 852 | 855 | if (0 == offs % 8) |
| 853 | 856 | printf("%04x:", offs); |
| 854 | 857 | printf(" %08x", data); |
| 855 | 858 | if (7 == offs % 8) |
| 856 | 859 | printf("\n"); |
| 860 | #endif |
| 857 | 861 | p_ucode[offs] = data; |
| 858 | 862 | } |
| 863 | for (offs_t offs = ALTO2_UCODE_RAM_BASE; offs < ALTO2_UCODE_SIZE; offs++) { |
| 864 | p_ucode[offs] = ALTO2_UCODE_INVERTED; |
| 865 | } |
| 859 | 866 | |
| 860 | 867 | m_const_proms = prom_load(pl_const, memregion("const_proms")->base(), 1, 4); |
| 861 | 868 | m_const = reinterpret_cast<UINT16 *>(global_alloc_array(UINT16, ALTO2_CONST_SIZE)); |
| 862 | 869 | for (offs_t offs = 0; offs < ALTO2_CONST_SIZE; offs++) { |
| 863 | 870 | UINT16 data = (m_const_proms[2*offs+0] << 0) | (m_const_proms[2*offs+1] << 8); |
| 871 | #if DEBUG_UCODE_CONST_DATA |
| 864 | 872 | if (0 == offs % 8) |
| 865 | 873 | printf("%04x:", offs); |
| 866 | 874 | printf(" %04x", data); |
| 867 | 875 | if (7 == offs % 8) |
| 868 | 876 | printf("\n"); |
| 877 | #endif |
| 869 | 878 | m_const[offs] = data; |
| 870 | 879 | } |
| 871 | 880 | |