diff --git a/.gitattributes b/.gitattributes index 40f7939fb7b..f1b77edebf0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/hash/msx1_cart.xml b/hash/msx1_cart.xml index c651ad8f89e..937b2bc3391 100644 --- a/hash/msx1_cart.xml +++ b/hash/msx1_cart.xml @@ -17101,6 +17101,17 @@ legacy FM implementations cannot find it. + + Baby Dinosaur Dooly + 1991 + Daou + + + + + + + diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak index f78f71be838..ef4b77f7722 100644 --- a/src/emu/bus/bus.mak +++ b/src/emu/bus/bus.mak @@ -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 diff --git a/src/emu/bus/msx_cart/cartridge.c b/src/emu/bus/msx_cart/cartridge.c index b9361f9cc2f..974d3313b00 100644 --- a/src/emu/bus/msx_cart/cartridge.c +++ b/src/emu/bus/msx_cart/cartridge.c @@ -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 diff --git a/src/emu/bus/msx_cart/dooly.c b/src/emu/bus/msx_cart/dooly.c new file mode 100644 index 00000000000..d3e9e113aa7 --- /dev/null +++ b/src/emu/bus/msx_cart/dooly.c @@ -0,0 +1,66 @@ +#include "emu.h" +#include "dooly.h" + + +const device_type MSX_CART_DOOLY = &device_creator; + + +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); + } + } +} + diff --git a/src/emu/bus/msx_cart/dooly.h b/src/emu/bus/msx_cart/dooly.h new file mode 100644 index 00000000000..b0e4ab749cb --- /dev/null +++ b/src/emu/bus/msx_cart/dooly.h @@ -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