(MESS) msx.c: Added support for protection used by Baby Dinosaur Dooly (hopefully complete). (nw)

This commit is contained in:
Wilbert Pol 2014-06-04 19:13:06 +00:00
parent db5294cec3
commit 8d559f580c
6 changed files with 112 additions and 0 deletions

2
.gitattributes vendored
View File

@ -997,6 +997,8 @@ src/emu/bus/msx_cart/cartridge.c svneol=native#text/plain
src/emu/bus/msx_cart/cartridge.h svneol=native#text/plain
src/emu/bus/msx_cart/crossblaim.c svneol=native#text/plain
src/emu/bus/msx_cart/crossblaim.h svneol=native#text/plain
src/emu/bus/msx_cart/dooly.c svneol=native#text/plain
src/emu/bus/msx_cart/dooly.h svneol=native#text/plain
src/emu/bus/msx_cart/fmpac.c svneol=native#text/plain
src/emu/bus/msx_cart/fmpac.h svneol=native#text/plain
src/emu/bus/msx_cart/hfox.c svneol=native#text/plain

View File

@ -17101,6 +17101,17 @@ legacy FM implementations cannot find it.
<!-- SORT -->
<software name="dooly">
<description>Baby Dinosaur Dooly</description>
<year>1991</year>
<publisher>Daou</publisher>
<part name="cart" interface="msx_cart">
<feature name="slot" value="dooly" />
<dataarea name="rom" size="32768">
<rom name="dooly.rom" size="32768" crc="71a1b1ec" sha1="dbac346f03950fbef81a003b4a42b2898a4e54c1" offset="0" />
</dataarea>
</part>
</software>
</softwarelist>

View File

@ -410,6 +410,7 @@ OBJDIRS += $(BUSOBJ)/msx_cart
BUSOBJS += $(BUSOBJ)/msx_cart/ascii.o
BUSOBJS += $(BUSOBJ)/msx_cart/cartridge.o
BUSOBJS += $(BUSOBJ)/msx_cart/crossblaim.o
BUSOBJS += $(BUSOBJ)/msx_cart/dooly.o
BUSOBJS += $(BUSOBJ)/msx_cart/fmpac.o
BUSOBJS += $(BUSOBJ)/msx_cart/hfox.o
BUSOBJS += $(BUSOBJ)/msx_cart/holy_quran.o

View File

@ -3,6 +3,7 @@
#include "cartridge.h"
#include "ascii.h"
#include "crossblaim.h"
#include "dooly.h"
#include "fmpac.h"
#include "hfox.h"
#include "holy_quran.h"
@ -47,6 +48,7 @@ SLOT_INTERFACE_START(msx_cart)
SLOT_INTERFACE_INTERNAL("hfox", MSX_CART_HFOX)
SLOT_INTERFACE_INTERNAL("keyboard_master", MSX_CART_KEYBOARD_MASTER)
SLOT_INTERFACE_INTERNAL("holy_quran", MSX_CART_HOLY_QURAN)
SLOT_INTERFACE_INTERNAL("dooly", MSX_CART_DOOLY)
SLOT_INTERFACE_END

View File

@ -0,0 +1,66 @@
#include "emu.h"
#include "dooly.h"
const device_type MSX_CART_DOOLY = &device_creator<msx_cart_dooly>;
msx_cart_dooly::msx_cart_dooly(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MSX_CART_DOOLY, "MSX Cartridge - Dooly", tag, owner, clock, "msx_cart_dooly", __FILE__)
, msx_cart_interface(mconfig, *this)
, m_prot(0)
{
}
void msx_cart_dooly::device_start()
{
save_item(NAME(m_prot));
}
void msx_cart_dooly::device_reset()
{
m_prot = 0;
}
void msx_cart_dooly::initialize_cartridge()
{
if (get_rom_size() != 0x8000)
{
fatalerror("dooly: Invalid ROM size\n");
}
}
READ8_MEMBER(msx_cart_dooly::read_cart)
{
if (offset >= 0x4000 && offset < 0xc000)
{
UINT8 data = get_rom_base()[offset - 0x4000];
switch (m_prot)
{
case 0x04:
data = BITSWAP8(data, 7, 6, 5, 4, 3, 1, 0, 2);
break;
}
return data;
}
return 0xff;
}
WRITE8_MEMBER(msx_cart_dooly::write_cart)
{
if (offset >= 0x4000 && offset < 0xc000)
{
m_prot = data & 0x07;
if (m_prot != 0 && m_prot != 4)
{
logerror("msx_cart_dooly: unhandled write %02x to %04x\n", data, offset);
}
}
}

View File

@ -0,0 +1,30 @@
#ifndef __MSX_CART_DOOLY_H
#define __MSX_CART_DOOLY_H
#include "bus/msx_cart/cartridge.h"
extern const device_type MSX_CART_DOOLY;
class msx_cart_dooly : public device_t
, public msx_cart_interface
{
public:
msx_cart_dooly(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual void initialize_cartridge();
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
private:
UINT8 m_prot;
};
#endif