(MESS) a7800.c - Support for >128k cart formats and banked RAM and added bit 4 & bit 5 notes while standardizing 'super' description listing. [Mike Saarna]
This commit is contained in:
parent
d00673890d
commit
31a8567dfd
@ -1095,7 +1095,7 @@ MACHINE_CONFIG_END
|
||||
***************************************************************************/
|
||||
|
||||
ROM_START( a7800 )
|
||||
ROM_REGION(0x40000, "maincpu", 0)
|
||||
ROM_REGION(0x100000, "maincpu", 0)
|
||||
ROM_FILL(0x0000, 0x40000, 0xff)
|
||||
ROM_SYSTEM_BIOS( 0, "a7800", "Atari 7800" )
|
||||
ROMX_LOAD("7800.u7", 0xf000, 0x1000, CRC(5d13730c) SHA1(d9d134bb6b36907c615a594cc7688f7bfcef5b43), ROM_BIOS(1))
|
||||
@ -1104,7 +1104,7 @@ ROM_START( a7800 )
|
||||
ROM_END
|
||||
|
||||
ROM_START( a7800p )
|
||||
ROM_REGION(0x40000, "maincpu", 0)
|
||||
ROM_REGION(0x100000, "maincpu", 0)
|
||||
ROM_FILL(0x0000, 0x40000, 0xff)
|
||||
ROM_LOAD("7800pal.rom", 0xc000, 0x4000, CRC(d5b61170) SHA1(5a140136a16d1d83e4ff32a19409ca376a8df874))
|
||||
ROM_END
|
||||
|
@ -128,6 +128,9 @@ void a7800_state::machine_reset()
|
||||
|
||||
/* set banks to default states */
|
||||
memory = m_region_maincpu->base();
|
||||
if(m_cart_type & 0x20) //supercart bankram
|
||||
m_bank1->set_base(memory + 0xf0000 );
|
||||
else
|
||||
m_bank1->set_base(memory + 0x4000 );
|
||||
m_bank2->set_base(memory + 0x8000 );
|
||||
m_bank3->set_base(memory + 0xA000 );
|
||||
@ -159,6 +162,8 @@ void a7800_state::machine_reset()
|
||||
bit 1 0x02 - supercart bank switched
|
||||
bit 2 0x04 - supercart RAM at $4000
|
||||
bit 3 0x08 - additional state->m_ROM at $4000
|
||||
bit 4 0x10 - bank 6 at $4000
|
||||
bit 5 0x20 - supercart banked RAM
|
||||
|
||||
bit 8-15 - Special
|
||||
0 = Normal cart
|
||||
@ -395,6 +400,13 @@ WRITE8_MEMBER(a7800_state::a7800_cart_w)
|
||||
{
|
||||
if(m_cart_type & 0x04)
|
||||
{
|
||||
//adjust write location if supercart bankram is in use
|
||||
if(m_cart_type & 0x20)
|
||||
{
|
||||
UINT8 *currentbank1 = (UINT8 *)m_bank1->base();
|
||||
currentbank1[offset] = data;
|
||||
}
|
||||
else
|
||||
m_ROM[0x4000 + offset] = data;
|
||||
}
|
||||
else if(m_cart_type & 0x01)
|
||||
@ -409,10 +421,23 @@ WRITE8_MEMBER(a7800_state::a7800_cart_w)
|
||||
|
||||
if(( m_cart_type & 0x02 ) &&( offset >= 0x4000 ) )
|
||||
{
|
||||
/* check if bankram is used */
|
||||
if( m_cart_type & 0x20 )
|
||||
{
|
||||
m_bank1->set_base(memory + 0xf0000+((data & 0x20)<<9));
|
||||
}
|
||||
/* fix for 64kb supercart */
|
||||
if( m_cart_size == 0x10000 )
|
||||
{
|
||||
data &= 0x03;
|
||||
}
|
||||
else if( m_cart_size == 0x40000 )
|
||||
{
|
||||
data &= 0x0f;
|
||||
}
|
||||
else if( m_cart_size == 0x80000 )
|
||||
{
|
||||
data &= 0x1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user