mame/src/emu/bus/a800/oss.c
Fabio Priuli 991bcbd1e5 (MESS) atari400.c progress: [Fabio Priuli]
- Rewritten cart emulation to use slot devices (many 
  "mappers" do not fully work) and unified cart handling 
  among 8bit home computers, XEGS and Atari 5200
- Added support for loading carts with bankswitch to all XL/XE 
  models
- Added support for loading XEGS carts in Atari 8bits home
  computers (XEGS instead will only load XEGS games until
  support for the keyboard add-on is included)
- Big clean up of the driver, simplifying memory map, removing
  writes to ROM, etc.
- Changed NOT_WORKING flag to IMPERFECT_GRAPHICS
  in 600XL, 65XE, 800XE and XEGS since they should now be 
  working to the same extent of the 800XL, and bugs shall be 
  reported.


as a consequence of the above changes, the new softlists a800.xml, a5200.xml
and xegs.xml are not compatible anymore with 0.154: keep the old xmls until
0.155 if you don't compile your own exe
2014-09-02 05:02:02 +00:00

201 lines
4.0 KiB
C

/***********************************************************************************************************
A800 ROM cart emulation
***********************************************************************************************************/
#include "emu.h"
#include "oss.h"
//-------------------------------------------------
// constructor
//-------------------------------------------------
const device_type A800_ROM_OSS34 = &device_creator<a800_rom_oss34_device>;
const device_type A800_ROM_OSS43 = &device_creator<a800_rom_oss43_device>;
const device_type A800_ROM_OSS91 = &device_creator<a800_rom_oss91_device>;
a800_rom_oss34_device::a800_rom_oss34_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: a800_rom_device(mconfig, A800_ROM_OSS34, "Atari 800 ROM Carts OSS-034M", tag, owner, clock, "a800_034m", __FILE__)
{
}
a800_rom_oss43_device::a800_rom_oss43_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: a800_rom_device(mconfig, A800_ROM_OSS43, "Atari 800 ROM Carts OSS-043M", tag, owner, clock, "a800_043m", __FILE__)
{
}
a800_rom_oss91_device::a800_rom_oss91_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: a800_rom_device(mconfig, A800_ROM_OSS91, "Atari 800 ROM Carts OSS-M091", tag, owner, clock, "a800_m091", __FILE__)
{
}
void a800_rom_oss34_device::device_start()
{
save_item(NAME(m_bank));
}
void a800_rom_oss34_device::device_reset()
{
m_bank = 1;
}
void a800_rom_oss43_device::device_start()
{
save_item(NAME(m_bank));
}
void a800_rom_oss43_device::device_reset()
{
m_bank = 0;
}
void a800_rom_oss91_device::device_start()
{
save_item(NAME(m_bank));
}
void a800_rom_oss91_device::device_reset()
{
m_bank = 0;
}
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
/*-------------------------------------------------
OSS 034M
This apparently comes from a dump with the wrong bank order...
investigate whether we should remove it!
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss34_device::read_80xx)
{
if (offset >= 0x1000)
return m_rom[(offset & 0xfff) + 0x3000];
else if (m_bank == 3)
return 0xff;
else
return m_rom[(offset & 0xfff) + (m_bank * 0x1000)];
}
WRITE8_MEMBER(a800_rom_oss34_device::write_d5xx)
{
switch (offset & 0x0f)
{
case 0:
case 1:
m_bank = 0;
break;
case 2:
case 6:
m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
break;
case 3:
case 7:
m_bank = 1;
break;
case 4:
case 5:
m_bank = 2;
break;
default:
break;
}
}
/*-------------------------------------------------
OSS 043M
Same as above but with correct bank order
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss43_device::read_80xx)
{
if (offset >= 0x1000)
return m_rom[(offset & 0xfff) + 0x3000];
else if (m_bank == 3)
return 0xff;
else
return m_rom[(offset & 0xfff) + (m_bank * 0x1000)];
}
WRITE8_MEMBER(a800_rom_oss43_device::write_d5xx)
{
switch (offset & 0x0f)
{
case 0:
case 1:
m_bank = 0;
break;
case 2:
case 6:
m_bank = 3; // in this case the ROM gets disabled and 0xff is returned in 0xa000-0xafff
break;
case 3:
case 7:
m_bank = 2;
break;
case 4:
case 5:
m_bank = 1;
break;
default:
break;
}
}
/*-------------------------------------------------
OSS M091
Simplified banking system which only uses two
address lines (A0 & A3)
-------------------------------------------------*/
READ8_MEMBER(a800_rom_oss91_device::read_80xx)
{
if (offset >= 0x1000)
return m_rom[offset & 0xfff];
else
return m_rom[(offset & 0xfff) + (m_bank * 0x1000)];
}
WRITE8_MEMBER(a800_rom_oss91_device::write_d5xx)
{
switch (offset & 0x09)
{
case 0:
m_bank = 1;
break;
case 1:
m_bank = 3;
break;
case 9:
m_bank = 2;
break;
default:
break;
}
}