Previous 15994 Revisions Next

r15137 Thursday 10th May, 2012 at 22:33:13 UTC by R. Belmont
Copy ROM to RAM as a temporary hack to make the M20 boot properly. (nw)
[src/mess/drivers]m20.c

src/mess/drivers/m20.c
r15136r15137
4545public:
4646   m20_state(const machine_config &mconfig, device_type type, const char *tag)
4747      : driver_device(mconfig, type, tag) ,
48        m_maincpu(*this, "maincpu"),
4849      m_p_videoram(*this, "p_videoram"){ }
4950
51    required_device<device_t> m_maincpu;
5052   required_shared_ptr<UINT16> m_p_videoram;
53
54    virtual void machine_reset();
5155};
5256
5357
r15136r15137
9094
9195static ADDRESS_MAP_START(m20_mem, AS_PROGRAM, 16, m20_state)
9296   ADDRESS_MAP_UNMAP_HIGH
93   AM_RANGE( 0x00000, 0x01fff ) AM_ROM AM_MIRROR(0x40000) AM_REGION("maincpu", 0x10000)
97   AM_RANGE( 0x00000, 0x01fff ) AM_RAM AM_SHARE("mainram")
9498    AM_RANGE( 0x02000, 0x03fff ) AM_RAM
9599    AM_RANGE( 0x20000, 0x2ffff ) AM_RAM
96100   AM_RANGE( 0x30000, 0x33fff ) AM_RAM AM_SHARE("p_videoram")//base vram
101   AM_RANGE( 0x40000, 0x41fff ) AM_ROM AM_REGION("maincpu", 0x10000)
97102    AM_RANGE( 0x60000, 0x6ffff ) AM_RAM
98103    AM_RANGE( 0xa8000, 0xaffff ) AM_RAM
99104//  AM_RANGE( 0x34000, 0x37fff ) AM_RAM //extra vram for bitmap mode
r15136r15137
138143{
139144}
140145
141static MACHINE_RESET( m20 )
146void m20_state::machine_reset()
142147{
148   UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
149   UINT8 *RAM = (UINT8 *)machine().root_device().memshare("mainram")->ptr();
150
151    ROM += 0x10000; // don't know why they load at an offset, but let's go with it
152
153    memcpy(RAM, ROM, 256);  // should be more than sufficient to boot
154    m_maincpu->reset();     // reset the CPU to ensure it picks up the new vector
143155}
144156
145157static const mc6845_interface mc6845_intf =
r15136r15137
169181   MCFG_DEVICE_DISABLE()
170182#endif
171183
172   MCFG_MACHINE_RESET(m20)
173
174184   /* video hardware */
175185   MCFG_SCREEN_ADD("screen", RASTER)
176186   MCFG_SCREEN_REFRESH_RATE(60)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team