branches/alto2/src/emu/cpu/alto2/alto2.c
| r26089 | r26090 | |
| 49 | 49 | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | | static ADDRESS_MAP_START( alto2_ucode, AS_PROGRAM, 32, alto2_cpu_device ) |
| 53 | | AM_RANGE(0, ALTO2_UCODE_RAM_BASE-1) AM_ROM |
| 54 | | AM_RANGE(ALTO2_UCODE_RAM_BASE, ALTO2_UCODE_SIZE-1) AM_RAM |
| 55 | | ADDRESS_MAP_END |
| 56 | | |
| 57 | | static ADDRESS_MAP_START( alto2_constants, AS_DATA, 16, alto2_cpu_device ) |
| 58 | | AM_RANGE(0, ALTO2_CONST_SIZE-1) AM_ROM |
| 59 | | ADDRESS_MAP_END |
| 60 | | |
| 61 | 52 | //************************************************************************** |
| 62 | 53 | // LIVE DEVICE |
| 63 | 54 | //************************************************************************** |
| r26089 | r26090 | |
| 73 | 64 | m_log_level(9), |
| 74 | 65 | m_log_newline(true), |
| 75 | 66 | #endif |
| 76 | | m_ucode_config("ucode", ENDIANNESS_BIG, 32, 14, -2, ADDRESS_MAP_NAME(alto2_ucode)), |
| 77 | | m_const_config("constants", ENDIANNESS_BIG, 16, 8, -1, ADDRESS_MAP_NAME(alto2_constants)), |
| 67 | m_ucode_config("ucode", ENDIANNESS_BIG, 32, 14, -2), |
| 68 | m_const_config("const", ENDIANNESS_BIG, 16, 8, -1), |
| 78 | 69 | m_ucode(0), |
| 79 | 70 | m_const(0), |
| 80 | 71 | m_ucode_map(*this, "ucode"), |
| 81 | | m_const_map(*this, "constants"), |
| 72 | m_const_map(*this, "const"), |
| 82 | 73 | m_icount(0), |
| 83 | 74 | m_task_mpc(), |
| 84 | 75 | m_task_next2(), |
| r26089 | r26090 | |
| 161 | 152 | //------------------------------------------------- |
| 162 | 153 | |
| 163 | 154 | ROM_START( alto2_cpu ) |
| 164 | | ROM_REGION( sizeof(UINT32)*ALTO2_UCODE_SIZE, "ucode", 0 ) |
| 165 | | ROM_REGION( sizeof(UINT16)*ALTO2_CONST_SIZE, "constants", 0 ) |
| 155 | // decoded micro code region |
| 156 | ROM_REGION( 16 * 02000, "ucode", 0 ) |
| 166 | 157 | |
| 167 | | // Alto-II micro code PROMs, 8 x 4bit |
| 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 | |
| 168 | 164 | ROM_REGION( 16 * 02000, "ucode_proms", 0 ) |
| 169 | 165 | ROM_LOAD( "55x.3", 0*02000, 0x400, CRC(de870d75) SHA1(2b98cc769d8302cb39948711424d987d94e4159b) ) //!< 00000-01777 RSEL(0)',RSEL(1)',RSEL(2)',RSEL(3)' |
| 170 | 166 | ROM_LOAD( "64x.3", 1*02000, 0x400, CRC(51b444c0) SHA1(8756e51f7f3253a55d75886465beb7ee1be6e1c4) ) //!< 00000-01777 RSEL(4)',ALUF(0)',ALUF(1)',ALUF(2)' |
| r26089 | r26090 | |
| 866 | 862 | m_ucode_proms = prom_load(ucode_prom_list, memregion("ucode_proms")->base(), ALTO2_UCODE_ROM_PAGES, 8); |
| 867 | 863 | m_const_proms = prom_load(const_prom_list, memregion("const_proms")->base(), 1, 4); |
| 868 | 864 | |
| 869 | | for (offs_t offs = 0; offs < sizeof(UINT32)*ALTO2_UCODE_RAM_BASE; offs++) |
| 870 | | memory_write(AS_0, offs, 1, m_ucode_proms[offs]); |
| 871 | | for (offs_t offs = 0; offs < sizeof(UINT16)*ALTO2_CONST_SIZE; offs++) |
| 872 | | memory_write(AS_1, offs, 1, m_const_proms[offs]); |
| 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 | } |
| 873 | 884 | |
| 874 | 885 | m_disp_a38 = prom_load(&pl_displ_a38, memregion("displ_a38")->base()); |
| 875 | 886 | m_disp_a63 = prom_load(&pl_displ_a63, memregion("displ_a63")->base()); |
| r26089 | r26090 | |
| 882 | 893 | m_madr_a32 = prom_load(&pl_madr_a32, memregion("madr_a32")->base()); |
| 883 | 894 | m_madr_a64 = prom_load(&pl_madr_a64, memregion("madr_a64")->base()); |
| 884 | 895 | m_madr_a65 = prom_load(&pl_madr_a65, memregion("madr_a65")->base()); |
| 885 | | m_madr_a90 = prom_load(&pl_madr_a90, memregion("madr_a90")->base(), 1 ,1); |
| 896 | m_madr_a90 = prom_load(&pl_madr_a90, memregion("madr_a90")->base()); |
| 886 | 897 | m_madr_a91 = prom_load(&pl_madr_a91, memregion("madr_a91")->base()); |
| 887 | 898 | m_ether_a41 = prom_load(&pl_enet_a41, memregion("ether_a41")->base()); |
| 888 | 899 | m_ether_a42 = prom_load(&pl_enet_a42, memregion("ether_a42")->base()); |
branches/alto2/src/mess/includes/alto2.h
| r26089 | r26090 | |
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/alto2/alto2.h" |
| 12 | | //#include "machine/ram.h" |
| 12 | #include "machine/ram.h" |
| 13 | 13 | |
| 14 | 14 | class alto2_state : public driver_device |
| 15 | 15 | { |
| r26089 | r26090 | |
| 17 | 17 | alto2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 18 | 18 | : driver_device(mconfig, type, tag), |
| 19 | 19 | m_maincpu(*this, "maincpu"), |
| 20 | | m_region_memory(*this, "memory"), |
| 21 | 20 | m_io_row0(*this, "ROW0"), |
| 22 | 21 | m_io_row1(*this, "ROW1"), |
| 23 | 22 | m_io_row2(*this, "ROW2"), |
| r26089 | r26090 | |
| 42 | 41 | DECLARE_READ16_MEMBER(alto2_mmio_r); |
| 43 | 42 | DECLARE_WRITE16_MEMBER(alto2_mmio_w); |
| 44 | 43 | DECLARE_DRIVER_INIT(alto2); |
| 44 | |
| 45 | 45 | virtual void palette_init(); |
| 46 | 46 | DECLARE_MACHINE_RESET(alto2); |
| 47 | 47 | void screen_eof_alto2(screen_device &screen, bool state); |
| 48 | 48 | |
| 49 | 49 | protected: |
| 50 | 50 | required_device<cpu_device> m_maincpu; |
| 51 | | required_memory_region m_region_memory; |
| 52 | 51 | required_ioport m_io_row0; |
| 53 | 52 | required_ioport m_io_row1; |
| 54 | 53 | required_ioport m_io_row2; |
branches/alto2/src/mess/drivers/alto2.c
| r26089 | r26090 | |
| 42 | 42 | |
| 43 | 43 | /* Memory Maps */ |
| 44 | 44 | |
| 45 | static ADDRESS_MAP_START( alto2_ucode_map, AS_PROGRAM, 32, alto2_state ) |
| 46 | AM_RANGE(0, ALTO2_UCODE_RAM_BASE-1) AM_ROM |
| 47 | AM_RANGE(ALTO2_UCODE_RAM_BASE, ALTO2_UCODE_SIZE-1) AM_RAM |
| 48 | ADDRESS_MAP_END |
| 49 | |
| 50 | static ADDRESS_MAP_START( alto2_const_map, AS_DATA, 16, alto2_state ) |
| 51 | AM_RANGE(0, ALTO2_CONST_SIZE-1) AM_ROM |
| 52 | ADDRESS_MAP_END |
| 53 | |
| 45 | 54 | /* main memory and memory mapped i/o in range ALTO2_IO_PAGE_BASE ... ALTO2_IO_PAGE_BASE + ALTO2_IO_PAGE_SIZE - 1 */ |
| 46 | 55 | static ADDRESS_MAP_START( alto2_ram_map, AS_IO, 16, alto2_state ) |
| 47 | 56 | AM_RANGE(0, ALTO2_IO_PAGE_BASE - 1) AM_READWRITE(alto2_ram_r, alto2_ram_w) |
| r26089 | r26090 | |
| 248 | 257 | PORT_CONFSETTING( 0x40, "PAL") |
| 249 | 258 | INPUT_PORTS_END |
| 250 | 259 | |
| 260 | /* ROM */ |
| 261 | ROM_START( alto2 ) |
| 262 | // 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_END |
| 251 | 267 | |
| 252 | 268 | /* Palette Initialization */ |
| 253 | 269 | |
| r26089 | r26090 | |
| 260 | 276 | static MACHINE_CONFIG_START( alto2, alto2_state ) |
| 261 | 277 | /* basic machine hardware */ |
| 262 | 278 | MCFG_CPU_ADD("maincpu", ALTO2, XTAL_20_16MHz) |
| 279 | MCFG_CPU_PROGRAM_MAP(alto2_ucode_map) |
| 280 | MCFG_CPU_DATA_MAP(alto2_const_map) |
| 263 | 281 | MCFG_CPU_IO_MAP(alto2_ram_map) |
| 264 | 282 | |
| 265 | 283 | /* video hardware */ |
| r26089 | r26090 | |
| 269 | 287 | MCFG_SCREEN_VBLANK_DRIVER(alto2_state, screen_eof_alto2) |
| 270 | 288 | |
| 271 | 289 | MCFG_PALETTE_LENGTH(2) |
| 290 | |
| 291 | // internal ram |
| 292 | MCFG_RAM_ADD(RAM_TAG) |
| 293 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 272 | 294 | MACHINE_CONFIG_END |
| 273 | 295 | |
| 274 | | /* ROMs */ |
| 275 | | |
| 276 | | ROM_START( alto2 ) |
| 277 | | ROM_REGION( 2*ALTO2_RAM_SIZE, "memory", 0 ) |
| 278 | | ROM_END |
| 279 | | |
| 280 | 296 | /* Driver Init */ |
| 281 | 297 | |
| 282 | 298 | DRIVER_INIT_MEMBER( alto2_state, alto2 ) |