mirror of
https://github.com/holub/mame
synced 2025-04-20 23:42:22 +03:00
msx: add matra ink cartridge (nw)
This commit is contained in:
parent
ca83ae11fe
commit
7bff87f979
@ -1608,6 +1608,8 @@ if (BUSES["MSX_SLOT"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/msx_cart/hfox.h",
|
||||
MAME_DIR .. "src/devices/bus/msx_cart/holy_quran.cpp",
|
||||
MAME_DIR .. "src/devices/bus/msx_cart/holy_quran.h",
|
||||
MAME_DIR .. "src/devices/bus/msx_cart/ink.cpp",
|
||||
MAME_DIR .. "src/devices/bus/msx_cart/ink.h",
|
||||
MAME_DIR .. "src/devices/bus/msx_cart/konami.cpp",
|
||||
MAME_DIR .. "src/devices/bus/msx_cart/konami.h",
|
||||
MAME_DIR .. "src/devices/bus/msx_cart/korean.cpp",
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "halnote.h"
|
||||
#include "hfox.h"
|
||||
#include "holy_quran.h"
|
||||
#include "ink.h"
|
||||
#include "konami.h"
|
||||
#include "korean.h"
|
||||
#include "majutsushi.h"
|
||||
@ -58,6 +59,7 @@ void msx_cart(device_slot_interface &device)
|
||||
device.option_add_internal("msxaud_nms1205", MSX_CART_MSX_AUDIO_NMS1205);
|
||||
device.option_add_internal("super_swangi", MSX_CART_SUPER_SWANGI);
|
||||
device.option_add_internal("hfox", MSX_CART_HFOX);
|
||||
device.option_add_internal("ink", MSX_CART_INK);
|
||||
device.option_add_internal("keyboard_master", MSX_CART_KEYBOARD_MASTER);
|
||||
device.option_add_internal("holy_quran", MSX_CART_HOLY_QURAN);
|
||||
device.option_add_internal("dooly", MSX_CART_DOOLY);
|
||||
|
55
src/devices/bus/msx_cart/ink.cpp
Normal file
55
src/devices/bus/msx_cart/ink.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:hap
|
||||
/******************************************************************************
|
||||
|
||||
Ink cartridge (Matra, 2006)
|
||||
|
||||
48KB ROM data on an AMD Am29F040B(label scratched off), the game uses it
|
||||
for protection.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "ink.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(MSX_CART_INK, msx_cart_ink_device, "msx_cart_ink", "MSX Cartridge - Ink")
|
||||
|
||||
|
||||
msx_cart_ink_device::msx_cart_ink_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, MSX_CART_INK, tag, owner, clock)
|
||||
, msx_cart_interface(mconfig, *this)
|
||||
, m_flash(*this, "flash")
|
||||
{
|
||||
}
|
||||
|
||||
ROM_START( msx_cart_ink )
|
||||
ROM_REGION(0x80000, "flash", ROMREGION_ERASEFF)
|
||||
ROM_END
|
||||
|
||||
const tiny_rom_entry *msx_cart_ink_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( msx_cart_ink );
|
||||
}
|
||||
|
||||
void msx_cart_ink_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
AMD_29F040(config, m_flash);
|
||||
}
|
||||
|
||||
void msx_cart_ink_device::initialize_cartridge()
|
||||
{
|
||||
size_t size = get_rom_size() > 0x80000 ? 0x80000 : get_rom_size();
|
||||
memcpy(memregion("flash")->base(), get_rom_base(), size);
|
||||
}
|
||||
|
||||
|
||||
uint8_t msx_cart_ink_device::read_cart(offs_t offset)
|
||||
{
|
||||
return m_flash->read(offset);
|
||||
}
|
||||
|
||||
void msx_cart_ink_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
// /RD connects to flashrom A16-A18
|
||||
m_flash->write(offset | 0x70000, data);
|
||||
}
|
36
src/devices/bus/msx_cart/ink.h
Normal file
36
src/devices/bus/msx_cart/ink.h
Normal file
@ -0,0 +1,36 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:hap
|
||||
#ifndef MAME_BUS_MSX_CART_INK_H
|
||||
#define MAME_BUS_MSX_CART_INK_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "bus/msx_cart/cartridge.h"
|
||||
#include "machine/intelfsh.h"
|
||||
|
||||
|
||||
DECLARE_DEVICE_TYPE(MSX_CART_INK, msx_cart_ink_device)
|
||||
|
||||
|
||||
class msx_cart_ink_device : public device_t, public msx_cart_interface
|
||||
{
|
||||
public:
|
||||
msx_cart_ink_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual void initialize_cartridge() override;
|
||||
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override { ; }
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
|
||||
private:
|
||||
required_device<amd_29f040_device> m_flash;
|
||||
};
|
||||
|
||||
|
||||
#endif // MAME_BUS_MSX_CART_INK_H
|
@ -623,7 +623,7 @@ uint32_t intelfsh_device::read_full(uint32_t address)
|
||||
{
|
||||
// used in Fujitsu 29DL16X 8bits mode
|
||||
// used in AMD 29LV200 8bits mode
|
||||
switch (address)
|
||||
switch (address & 0xff)
|
||||
{
|
||||
case 0: data = m_maker_id; break;
|
||||
case 2: data = m_device_id; break;
|
||||
@ -632,7 +632,7 @@ uint32_t intelfsh_device::read_full(uint32_t address)
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (address)
|
||||
switch (address & 0xff)
|
||||
{
|
||||
case 0: data = m_maker_id; break;
|
||||
case 1: data = m_device_id; break;
|
||||
@ -643,7 +643,7 @@ uint32_t intelfsh_device::read_full(uint32_t address)
|
||||
case FM_READID:
|
||||
if (m_maker_id == MFG_INTEL && m_device_id == 0x16)
|
||||
{
|
||||
switch (address)
|
||||
switch (address & 0xff)
|
||||
{
|
||||
case 0: data = m_maker_id; break;
|
||||
case 2: data = m_device_id; break;
|
||||
@ -652,7 +652,7 @@ uint32_t intelfsh_device::read_full(uint32_t address)
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (address)
|
||||
switch (address & 0xff)
|
||||
{
|
||||
case 0: // maker ID
|
||||
data = m_maker_id;
|
||||
|
Loading…
Reference in New Issue
Block a user