(MESS) ti99: Proper initialization of 32K mem (nw)

This commit is contained in:
Michael Zapf 2013-06-21 20:15:56 +00:00
parent 0c65adce9b
commit 3563690821
2 changed files with 19 additions and 4 deletions

View File

@ -249,7 +249,11 @@ void ti99_datamux_device::device_reset(void)
m_use32k = (ioport("RAM")->read()==1); m_use32k = (ioport("RAM")->read()==1);
// better use a region? // better use a region?
if (m_ram16b==NULL) m_ram16b = (UINT16*)malloc(32768); if (m_ram16b==NULL)
{
m_ram16b = (UINT16*)malloc(32768);
memset(m_ram16b, 0, 32768);
}
// Now building the list of active devices at this databus multiplex. // Now building the list of active devices at this databus multiplex.
// We allow for turning off devices according to configuration switch settings. // We allow for turning off devices according to configuration switch settings.

View File

@ -58,15 +58,20 @@ READ8Z_MEMBER(ti_32k_expcard_device::readz)
} }
if (access) if (access)
{ {
if ((offset&1)!=1) *value = ~val; // There is no evidence for an inverted write on the even addresses;
else *value = val; // we assume that the FF00 byte sequence in this memory is a power-on
// artifact.
/* if ((offset&1)!=1) *value = ~val;
else */
*value = val;
} }
} }
WRITE8_MEMBER(ti_32k_expcard_device::write) WRITE8_MEMBER(ti_32k_expcard_device::write)
{ {
UINT8 data1 = data; UINT8 data1 = data;
if ((offset&1)!=1) data1 = ~data; // if ((offset&1)!=1) data1 = ~data;
switch((offset & 0xe000)>>13) switch((offset & 0xe000)>>13)
{ {
case 1: case 1:
@ -103,6 +108,12 @@ void ti_32k_expcard_device::device_start(void)
{ {
m_ram_ptr = memregion(RAMREGION)->base(); m_ram_ptr = memregion(RAMREGION)->base();
m_cru_base = 0; m_cru_base = 0;
// See above. Preset the memory with FF00
// ROM_FILL does not seem to allow filling with an alternating pattern
for (int i=0; i < 0x8000; i+=2)
{
m_ram_ptr[i] = (UINT8)0xff;
}
} }
ROM_START( ti_exp_32k ) ROM_START( ti_exp_32k )