Previous 199869 Revisions Next

r26075 Saturday 9th November, 2013 at 17:22:06 UTC by Jürgen Buchmüller
There's a bug in the definitions of address_space_config and the resolved address_space*, because the m_const address_space contains all zeroes instead of the const_prom values.
[/branches/alto2/src/emu/cpu/alto2]alto2.c alto2.h
[/branches/alto2/src/mess/drivers]alto2.c
[/branches/alto2/src/mess/includes]alto2.h

branches/alto2/src/emu/cpu/alto2/alto2.c
r26074r26075
3232   m_log_level(9),
3333   m_log_newline(false),
3434#endif
35   m_ucode_config("program", ENDIANNESS_BIG, 32, 14, -2),
35   m_ucode_config("maincpu", ENDIANNESS_BIG, 32, 14, -2),
3636   m_const_config("constants", ENDIANNESS_BIG, 16, 8, -1),
3737   m_ram_config("memory", ENDIANNESS_BIG, 16, 17, -1),
3838   m_ucode(0),
branches/alto2/src/emu/cpu/alto2/alto2.h
r26074r26075
223223   //! device_memory_interface overrides
224224   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const
225225   {
226      if (AS_PROGRAM == spacenum)
226      switch (spacenum) {
227      case AS_PROGRAM:
227228         return &m_ucode_config;
228      if (AS_DATA == spacenum)
229      case AS_DATA:
229230         return &m_const_config;
230      if (AS_IO == spacenum)
231      case AS_IO:
231232         return &m_ram_config;
232      return NULL;
233      default:
234         return NULL;
235      }
233236   }
234237
235238   //! device (P)ROMs
branches/alto2/src/mess/drivers/alto2.c
r26074r26075
1212#include "cpu/alto2/alto2.h"
1313#include "cpu/alto2/a2roms.h"
1414
15
16// FIXME: Is this required? How to access the address space dwords?
17READ32_MEMBER( alto2_state::alto2_ucode_r )
18{
19   return 0;
20}
21
22// FIXME: Is this required? How to access the address space dwords?
23WRITE32_MEMBER( alto2_state::alto2_ucode_w )
24{
25
26}
27
2815// FIXME: Is this required? How to access the address space words?
2916// This has to somehow be mapped to the a2mem half DWORD accesses
3017// and (optionally) Hamming code and parity flag updating
r26074r26075
5744
5845/* micro code from ALTO2_UCODE_ROM_PAGES times PROMs and ALTO2_UCODE_RAM_PAGES times RAMs of ALTO2_UCODE_PAGE_SIZE 32-bit words each */
5946static ADDRESS_MAP_START( alto2_ucode_map, AS_PROGRAM, 32, alto2_state )
60   AM_RANGE(0, ALTO2_UCODE_RAM_BASE-1) AM_ROM
61   AM_RANGE(ALTO2_UCODE_RAM_BASE, ALTO2_UCODE_SIZE-1) AM_READWRITE(alto2_ucode_r, alto2_ucode_w)
47   AM_RANGE(0,                    ALTO2_UCODE_RAM_BASE-1) AM_ROM
48   AM_RANGE(ALTO2_UCODE_RAM_BASE, ALTO2_UCODE_SIZE-1)     AM_RAM
6249ADDRESS_MAP_END
6350
6451/* constant PROM with 256 16-bit words */
6552static ADDRESS_MAP_START( alto2_const_map, AS_DATA, 16, alto2_state )
66   AM_RANGE(0, ALTO2_CONST_SIZE-1) AM_ROM
53   AM_RANGE(0,                    ALTO2_CONST_SIZE-1)    AM_ROM
6754ADDRESS_MAP_END
6855
6956/* main memory and memory mapped i/o in range ALTO2_IO_PAGE_BASE ... ALTO2_IO_PAGE_BASE + ALTO2_IO_PAGE_SIZE - 1 */
7057static ADDRESS_MAP_START( alto2_ram_map, AS_IO, 16, alto2_state )
71   AM_RANGE(0, ALTO2_IO_PAGE_BASE - 1) AM_READWRITE(alto2_ram_r, alto2_ram_w)
72   AM_RANGE(ALTO2_IO_PAGE_BASE, 0177777) AM_READWRITE(alto2_mmio_r, alto2_mmio_w)
58   AM_RANGE(0,                    ALTO2_IO_PAGE_BASE - 1) AM_READWRITE(alto2_ram_r,  alto2_ram_w)
59   AM_RANGE(ALTO2_IO_PAGE_BASE,   0177777)                AM_READWRITE(alto2_mmio_r, alto2_mmio_w)
7360ADDRESS_MAP_END
7461
7562
r26074r26075
302289ROM_START( alto2 )
303290   // FIXME: how to allocate initally empty regions for AS_PROGRAM, AS_DATA and AS_IO?
304291   ROM_REGION( 4*ALTO2_UCODE_SIZE, "maincpu", 0)
305   ROM_REGION( 2*ALTO2_CONST_SIZE, "data", 0)
306   ROM_REGION( ALTO2_RAM_SIZE, "ram", 0 )
292   ROM_REGION( 2*ALTO2_CONST_SIZE, "constants", 0)
293   ROM_REGION( ALTO2_RAM_SIZE, "memory", 0 )
307294
308295   // Alto-II micro code PROMs, 8 x 4bit
309296   ROM_REGION( 16 * 02000, "ucode", 0 )
r26074r26075
671658   memcpy(memregion("maincpu")->base(), ucode_prom, sizeof(UINT32)*ALTO2_UCODE_RAM_BASE);
672659
673660   UINT8* const_prom = prom_load(this, const_prom_list, memregion("const")->base(), 1, 4);
674   memcpy(memregion("data")->base(), const_prom, sizeof(UINT16)*ALTO2_CONST_SIZE);
661   memcpy(memregion("constants")->base(), const_prom, sizeof(UINT16)*ALTO2_CONST_SIZE);
675662}
676663
677664/* Game Drivers */
branches/alto2/src/mess/includes/alto2.h
r26074r26075
1818      : driver_device(mconfig, type, tag),
1919      m_maincpu(*this, "maincpu"),
2020      m_region_ucode(*this, "maincpu"),
21      m_region_const(*this, "data"),
22      m_region_ram(*this, "ram"),
21      m_region_const(*this, "constants"),
22      m_region_ram(*this, "memory"),
2323      m_io_row0(*this, "ROW0"),
2424      m_io_row1(*this, "ROW1"),
2525      m_io_row2(*this, "ROW2"),
r26074r26075
3939
4040   bitmap_ind16 m_bitmap;
4141
42   DECLARE_READ32_MEMBER(alto2_ucode_r);
43   DECLARE_WRITE32_MEMBER(alto2_ucode_w);
4442   DECLARE_READ16_MEMBER(alto2_ram_r);
4543   DECLARE_WRITE16_MEMBER(alto2_ram_w);
4644   DECLARE_READ16_MEMBER(alto2_mmio_r);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team