branches/alto2/src/emu/cpu/alto2/alto2.c
| r26091 | r26092 | |
| 64 | 64 | m_log_level(9), |
| 65 | 65 | m_log_newline(true), |
| 66 | 66 | #endif |
| 67 | | m_ucode_config("ucode", ENDIANNESS_BIG, 32, 14, -2), |
| 67 | m_ucode_config("maincpu", ENDIANNESS_BIG, 32, 14, -2), |
| 68 | 68 | m_const_config("const", ENDIANNESS_BIG, 16, 8, -1), |
| 69 | 69 | m_ucode(0), |
| 70 | 70 | m_const(0), |
| 71 | | m_ucode_map(*this, "ucode"), |
| 72 | | m_const_map(*this, "const"), |
| 71 | m_ucode_map(*this, "^maincpu"), |
| 72 | m_const_map(*this, "^const"), |
| 73 | 73 | m_icount(0), |
| 74 | 74 | m_task_mpc(), |
| 75 | 75 | m_task_next2(), |
| r26091 | r26092 | |
| 152 | 152 | //------------------------------------------------- |
| 153 | 153 | |
| 154 | 154 | ROM_START( alto2_cpu ) |
| 155 | | // decoded micro code region |
| 156 | | ROM_REGION( 16 * 02000, "ucode", 0 ) |
| 157 | | |
| 158 | | // decoded constant PROMs region |
| 159 | | ROM_REGION( 4 * 00400, "const", 0 ) |
| 160 | | |
| 161 | | // 2 x 64K x 39 bit memory |
| 162 | | ROM_REGION( 2*ALTO2_RAM_SIZE, "memory", 0 ) |
| 163 | | |
| 164 | 155 | ROM_REGION( 16 * 02000, "ucode_proms", 0 ) |
| 165 | 156 | ROM_LOAD( "55x.3", 0*02000, 0x400, CRC(de870d75) SHA1(2b98cc769d8302cb39948711424d987d94e4159b) ) //!< 00000-01777 RSEL(0)',RSEL(1)',RSEL(2)',RSEL(3)' |
| 166 | 157 | ROM_LOAD( "64x.3", 1*02000, 0x400, CRC(51b444c0) SHA1(8756e51f7f3253a55d75886465beb7ee1be6e1c4) ) //!< 00000-01777 RSEL(4)',ALUF(0)',ALUF(1)',ALUF(2)' |
| r26091 | r26092 | |
| 254 | 245 | return ROM_NAME( alto2_cpu ); |
| 255 | 246 | } |
| 256 | 247 | |
| 248 | //------------------------------------------------- |
| 249 | // device_memory_interface overrides |
| 250 | //------------------------------------------------- |
| 251 | |
| 252 | bool alto2_cpu_device::memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value) |
| 253 | { |
| 254 | // printf("%s: spacenum=%d offset=%#x size=%d\n", __FUNCTION__, int(spacenum), unsigned(offset), size); |
| 255 | switch (spacenum) { |
| 256 | case AS_0: |
| 257 | switch (size) { |
| 258 | case 1: |
| 259 | value = m_ucode_proms[offset]; |
| 260 | return true; |
| 261 | case 2: |
| 262 | value = m_ucode_proms[offset+0] | (m_ucode_proms[offset+1] << 8); |
| 263 | return true; |
| 264 | case 4: |
| 265 | value = m_ucode_proms[offset+0] | |
| 266 | (m_ucode_proms[offset+1] << 8) | |
| 267 | (m_ucode_proms[offset+2] << 16) | |
| 268 | (m_ucode_proms[offset+3] << 24); |
| 269 | return true; |
| 270 | } |
| 271 | return false; |
| 272 | case AS_1: |
| 273 | switch (size) { |
| 274 | case 1: |
| 275 | value = m_const_proms[offset]; |
| 276 | return true; |
| 277 | case 2: |
| 278 | value = m_const_proms[offset+0] | (m_ucode_proms[offset+1] << 8); |
| 279 | return true; |
| 280 | } |
| 281 | return false; |
| 282 | default: |
| 283 | return false; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | bool alto2_cpu_device::memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value) |
| 288 | { |
| 289 | // printf("%s: spacenum=%d offset=%#x size=%d\n", __FUNCTION__, int(spacenum), unsigned(offset), size); |
| 290 | switch (spacenum) { |
| 291 | case AS_0: |
| 292 | switch (size) { |
| 293 | case 1: |
| 294 | m_ucode_proms[offset] = value; |
| 295 | return true; |
| 296 | case 2: |
| 297 | m_ucode_proms[offset+0] = value; |
| 298 | m_ucode_proms[offset+1] = value >> 8; |
| 299 | return true; |
| 300 | case 4: |
| 301 | m_ucode_proms[offset+0] = value; |
| 302 | m_ucode_proms[offset+1] = value >> 8; |
| 303 | m_ucode_proms[offset+2] = value >> 16; |
| 304 | m_ucode_proms[offset+3] = value >> 24; |
| 305 | return true; |
| 306 | } |
| 307 | return false; |
| 308 | case AS_1: |
| 309 | switch (size) { |
| 310 | case 1: |
| 311 | m_const_proms[offset] = value; |
| 312 | return true; |
| 313 | case 2: |
| 314 | m_const_proms[offset+0] = value; |
| 315 | m_ucode_proms[offset+1] = value >> 8; |
| 316 | return true; |
| 317 | } |
| 318 | return false; |
| 319 | default: |
| 320 | return false; |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | |
| 257 | 325 | /** |
| 258 | 326 | * @brief list of microcode PROM loading options |
| 259 | 327 | */ |
| r26091 | r26092 | |
| 861 | 929 | |
| 862 | 930 | m_ucode_proms = prom_load(ucode_prom_list, memregion("ucode_proms")->base(), ALTO2_UCODE_ROM_PAGES, 8); |
| 863 | 931 | m_const_proms = prom_load(const_prom_list, memregion("const_proms")->base(), 1, 4); |
| 864 | | |
| 865 | | for (offs_t offs = 0; offs < ALTO2_UCODE_RAM_BASE; offs++) { |
| 866 | | UINT32 data = (m_ucode_proms[4*offs+0] << 0) | (m_ucode_proms[4*offs+1] << 8) | |
| 867 | | (m_ucode_proms[4*offs+2] << 16) | (m_ucode_proms[4*offs+3] << 24); |
| 868 | | if (0 == offs % 8) |
| 869 | | printf("%04x:", offs); |
| 870 | | printf(" %08x", data); |
| 871 | | if (7 == offs % 8) |
| 872 | | printf("\n"); |
| 873 | | m_ucode->write_dword(offs, data); |
| 874 | | } |
| 875 | | for (offs_t offs = 0; offs < ALTO2_CONST_SIZE; offs++) { |
| 876 | | UINT32 data = (m_const_proms[2*offs+0] << 0) | (m_const_proms[2*offs+1] << 8); |
| 877 | | if (0 == offs % 8) |
| 878 | | printf("%04x:", offs); |
| 879 | | printf(" %04x", data); |
| 880 | | if (7 == offs % 8) |
| 881 | | printf("\n"); |
| 882 | | m_const->write_word(offs, data); |
| 883 | | } |
| 884 | | |
| 885 | 932 | m_disp_a38 = prom_load(&pl_displ_a38, memregion("displ_a38")->base()); |
| 886 | 933 | m_disp_a63 = prom_load(&pl_displ_a63, memregion("displ_a63")->base()); |
| 887 | 934 | m_disp_a66 = prom_load(&pl_displ_a66, memregion("displ_a66")->base()); |
| r26091 | r26092 | |
| 1112 | 1159 | // FIXME |
| 1113 | 1160 | void alto2_cpu_device::device_reset() |
| 1114 | 1161 | { |
| 1162 | for (offs_t offs = 0; offs < ALTO2_UCODE_RAM_BASE; offs++) { |
| 1163 | UINT32 data = (m_ucode_proms[4*offs+0] << 0) | (m_ucode_proms[4*offs+1] << 8) | |
| 1164 | (m_ucode_proms[4*offs+2] << 16) | (m_ucode_proms[4*offs+3] << 24); |
| 1165 | if (0 == offs % 8) |
| 1166 | printf("%04x:", offs); |
| 1167 | printf(" %08x", data); |
| 1168 | if (7 == offs % 8) |
| 1169 | printf("\n"); |
| 1170 | } |
| 1171 | for (offs_t offs = 0; offs < ALTO2_CONST_SIZE; offs++) { |
| 1172 | UINT32 data = (m_const_proms[2*offs+0] << 0) | (m_const_proms[2*offs+1] << 8); |
| 1173 | if (0 == offs % 8) |
| 1174 | printf("%04x:", offs); |
| 1175 | printf(" %04x", data); |
| 1176 | if (7 == offs % 8) |
| 1177 | printf("\n"); |
| 1178 | } |
| 1179 | |
| 1115 | 1180 | soft_reset(); |
| 1116 | 1181 | } |
| 1117 | 1182 | |
branches/alto2/src/mess/drivers/alto2.c
| r26091 | r26092 | |
| 43 | 43 | /* Memory Maps */ |
| 44 | 44 | |
| 45 | 45 | static ADDRESS_MAP_START( alto2_ucode_map, AS_PROGRAM, 32, alto2_state ) |
| 46 | ADDRESS_MAP_UNMAP_HIGH |
| 46 | 47 | AM_RANGE(0, ALTO2_UCODE_RAM_BASE-1) AM_ROM |
| 47 | 48 | AM_RANGE(ALTO2_UCODE_RAM_BASE, ALTO2_UCODE_SIZE-1) AM_RAM |
| 48 | 49 | ADDRESS_MAP_END |
| 49 | 50 | |
| 50 | 51 | static ADDRESS_MAP_START( alto2_const_map, AS_DATA, 16, alto2_state ) |
| 52 | ADDRESS_MAP_UNMAP_HIGH |
| 51 | 53 | AM_RANGE(0, ALTO2_CONST_SIZE-1) AM_ROM |
| 52 | 54 | ADDRESS_MAP_END |
| 53 | 55 | |
| 54 | 56 | /* main memory and memory mapped i/o in range ALTO2_IO_PAGE_BASE ... ALTO2_IO_PAGE_BASE + ALTO2_IO_PAGE_SIZE - 1 */ |
| 55 | 57 | static ADDRESS_MAP_START( alto2_ram_map, AS_IO, 16, alto2_state ) |
| 58 | ADDRESS_MAP_UNMAP_HIGH |
| 56 | 59 | AM_RANGE(0, ALTO2_IO_PAGE_BASE - 1) AM_READWRITE(alto2_ram_r, alto2_ram_w) |
| 57 | 60 | AM_RANGE(ALTO2_IO_PAGE_BASE, 0177777) AM_READWRITE(alto2_mmio_r, alto2_mmio_w) |
| 58 | 61 | ADDRESS_MAP_END |
| r26091 | r26092 | |
| 260 | 263 | /* ROM */ |
| 261 | 264 | ROM_START( alto2 ) |
| 262 | 265 | // decoded micro code region |
| 263 | | ROM_REGION( ALTO2_RAM_SIZE, "maincpu", 0 ) |
| 264 | | // 2 x 64K x 39 bit memory |
| 265 | | ROM_REGION( 2*ALTO2_RAM_SIZE, "memory", 0 ) |
| 266 | ROM_REGION( sizeof(UINT32)*ALTO2_UCODE_SIZE, "maincpu", 0 ) |
| 267 | // decoded constant PROMs region |
| 268 | ROM_REGION( sizeof(UINT16)*ALTO2_CONST_SIZE, "const", 0 ) |
| 266 | 269 | ROM_END |
| 267 | 270 | |
| 268 | 271 | /* Palette Initialization */ |