mirror of
https://github.com/holub/mame
synced 2025-07-03 09:06:08 +03:00
bus/nes_ctrl: Added Sharp Cassette Interface AN-300SL device. (#10318)
Clones promoted to working -------------------------- Sharp My Computer Terebi C1 [kmg]
This commit is contained in:
parent
b6234ed1f1
commit
1e85658dd3
@ -3134,6 +3134,8 @@ if (BUSES["NES_CTRL"]~=null) then
|
|||||||
MAME_DIR .. "src/devices/bus/nes_ctrl/powerpad.h",
|
MAME_DIR .. "src/devices/bus/nes_ctrl/powerpad.h",
|
||||||
MAME_DIR .. "src/devices/bus/nes_ctrl/rob.cpp",
|
MAME_DIR .. "src/devices/bus/nes_ctrl/rob.cpp",
|
||||||
MAME_DIR .. "src/devices/bus/nes_ctrl/rob.h",
|
MAME_DIR .. "src/devices/bus/nes_ctrl/rob.h",
|
||||||
|
MAME_DIR .. "src/devices/bus/nes_ctrl/sharpcass.cpp",
|
||||||
|
MAME_DIR .. "src/devices/bus/nes_ctrl/sharpcass.h",
|
||||||
MAME_DIR .. "src/devices/bus/nes_ctrl/snesadapter.cpp",
|
MAME_DIR .. "src/devices/bus/nes_ctrl/snesadapter.cpp",
|
||||||
MAME_DIR .. "src/devices/bus/nes_ctrl/snesadapter.h",
|
MAME_DIR .. "src/devices/bus/nes_ctrl/snesadapter.h",
|
||||||
MAME_DIR .. "src/devices/bus/nes_ctrl/suborkey.cpp",
|
MAME_DIR .. "src/devices/bus/nes_ctrl/suborkey.cpp",
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
#include "partytap.h"
|
#include "partytap.h"
|
||||||
#include "powerpad.h"
|
#include "powerpad.h"
|
||||||
#include "rob.h"
|
#include "rob.h"
|
||||||
|
#include "sharpcass.h"
|
||||||
#include "snesadapter.h"
|
#include "snesadapter.h"
|
||||||
#include "suborkey.h"
|
#include "suborkey.h"
|
||||||
#include "turbofile.h"
|
#include "turbofile.h"
|
||||||
@ -223,6 +224,7 @@ void fc_expansion_devices(device_slot_interface &device)
|
|||||||
device.option_add("joypad", NES_FCPAD_EXP);
|
device.option_add("joypad", NES_FCPAD_EXP);
|
||||||
device.option_add("arcstick", NES_ARCSTICK);
|
device.option_add("arcstick", NES_ARCSTICK);
|
||||||
device.option_add("fc_keyboard", NES_FCKEYBOARD);
|
device.option_add("fc_keyboard", NES_FCKEYBOARD);
|
||||||
|
device.option_add("sharp_cassette", NES_SHARPCASS);
|
||||||
device.option_add("zapper", NES_ZAPPER);
|
device.option_add("zapper", NES_ZAPPER);
|
||||||
device.option_add("bandaihs", NES_BANDAIHS);
|
device.option_add("bandaihs", NES_BANDAIHS);
|
||||||
device.option_add("vaus", NES_ARKPADDLE_FC);
|
device.option_add("vaus", NES_ARKPADDLE_FC);
|
||||||
|
89
src/devices/bus/nes_ctrl/sharpcass.cpp
Normal file
89
src/devices/bus/nes_ctrl/sharpcass.cpp
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:kmg
|
||||||
|
/**********************************************************************
|
||||||
|
|
||||||
|
Nintendo Family Computer Sharp Cassette Interface AN-300SL
|
||||||
|
|
||||||
|
An alternative to the Nintendo released Data Recorder. Unlike the
|
||||||
|
Data Recorder, which plugs into the Famicom Keyboard via audio jacks,
|
||||||
|
this Sharp Cassette Interface plugs directly into the expansion port
|
||||||
|
and connects to any cassette deck via two audio jacks. The Sharp and
|
||||||
|
Nintendo cassette interfaces are software incompatible.
|
||||||
|
|
||||||
|
This device is used by the built-in Graphics/Note program of the
|
||||||
|
Sharp My Computer Terebi C1 for saving/loading. Is there any other
|
||||||
|
use for this device?
|
||||||
|
|
||||||
|
TODO: The menu option of "play" when verifying saved data suggests
|
||||||
|
that the unit autodetects when the play button is pressed on a
|
||||||
|
cassette deck and signals this somehow to the Graphics/Note program.
|
||||||
|
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
#include "emu.h"
|
||||||
|
#include "sharpcass.h"
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// DEVICE DEFINITIONS
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
DEFINE_DEVICE_TYPE(NES_SHARPCASS, nes_sharpcass_device, "nes_sharpcass", "Sharp Cassette Interface AN-300SL")
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// device_add_mconfig - add device configuration
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
void nes_sharpcass_device::device_add_mconfig(machine_config &config)
|
||||||
|
{
|
||||||
|
CASSETTE(config, m_cassette);
|
||||||
|
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
|
||||||
|
m_cassette->set_interface("fc_cass");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// LIVE DEVICE
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// nes_sharpcass_device - constructor
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
nes_sharpcass_device::nes_sharpcass_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||||
|
: device_t(mconfig, NES_SHARPCASS, tag, owner, clock)
|
||||||
|
, device_nes_control_port_interface(mconfig, *this)
|
||||||
|
, m_cassette(*this, "tape")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// read
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
u8 nes_sharpcass_device::read_exp(offs_t offset)
|
||||||
|
{
|
||||||
|
u8 ret = 0;
|
||||||
|
|
||||||
|
if (offset == 1) // $4017
|
||||||
|
{
|
||||||
|
if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY)
|
||||||
|
{
|
||||||
|
if (m_cassette->input() < 0)
|
||||||
|
ret |= 0x04;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// write
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
void nes_sharpcass_device::write(u8 data)
|
||||||
|
{
|
||||||
|
if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_RECORD)
|
||||||
|
m_cassette->output(BIT(data, 2) ? +1.0 : -1.0);
|
||||||
|
}
|
48
src/devices/bus/nes_ctrl/sharpcass.h
Normal file
48
src/devices/bus/nes_ctrl/sharpcass.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:kmg
|
||||||
|
/**********************************************************************
|
||||||
|
|
||||||
|
Nintendo Family Computer Sharp Cassette Interface AN-300SL
|
||||||
|
|
||||||
|
**********************************************************************/
|
||||||
|
|
||||||
|
#ifndef MAME_BUS_NES_CTRL_SHARPCASS_H
|
||||||
|
#define MAME_BUS_NES_CTRL_SHARPCASS_H
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "ctrl.h"
|
||||||
|
#include "imagedev/cassette.h"
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// TYPE DEFINITIONS
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
// ======================> nes_sharpcass_device
|
||||||
|
|
||||||
|
class nes_sharpcass_device : public device_t,
|
||||||
|
public device_nes_control_port_interface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// construction/destruction
|
||||||
|
nes_sharpcass_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||||
|
|
||||||
|
virtual u8 read_exp(offs_t offset) override;
|
||||||
|
virtual void write(u8 data) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// device-level overrides
|
||||||
|
virtual void device_start() override { }
|
||||||
|
|
||||||
|
virtual void device_add_mconfig(machine_config &config) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
required_device<cassette_image_device> m_cassette;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// device type definition
|
||||||
|
DECLARE_DEVICE_TYPE(NES_SHARPCASS, nes_sharpcass_device)
|
||||||
|
|
||||||
|
#endif // MAME_BUS_NES_CTRL_SHARPCASS_H
|
@ -414,7 +414,7 @@ CONS( 198?, m82p, nes, 0, nespal, nes, nes_state, empty_init,
|
|||||||
// Famicom hardware
|
// Famicom hardware
|
||||||
CONS( 1983, famicom, 0, nes, famicom, famicom, nes_state, init_famicom, "Nintendo", "Famicom", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
|
CONS( 1983, famicom, 0, nes, famicom, famicom, nes_state, init_famicom, "Nintendo", "Famicom", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
|
||||||
CONS( 1983, famicomo, famicom, 0, famicomo, famicom, nes_state, init_famicom, "Nintendo", "Famicom (earlier, with RP2A03)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
|
CONS( 1983, famicomo, famicom, 0, famicomo, famicom, nes_state, init_famicom, "Nintendo", "Famicom (earlier, with RP2A03)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
|
||||||
CONS( 1983, famitvc1, famicom, 0, famitvc1, famicom, nes_state, init_famicom, "Sharp", "My Computer Terebi C1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // working but for unimplemented save/load in builtin cartridge, which causes system to hang
|
CONS( 1983, famitvc1, famicom, 0, famitvc1, famicom, nes_state, init_famicom, "Sharp", "My Computer Terebi C1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
|
||||||
CONS( 1986, fds, famicom, 0, fds, famicom, nes_state, init_famicom, "Nintendo", "Famicom (w/ Disk System add-on)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
|
CONS( 1986, fds, famicom, 0, fds, famicom, nes_state, init_famicom, "Nintendo", "Famicom (w/ Disk System add-on)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
|
||||||
CONS( 1986, famitwin, famicom, 0, famitwin, famicom, nes_state, init_famicom, "Sharp", "Famicom Twin", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
|
CONS( 1986, famitwin, famicom, 0, famitwin, famicom, nes_state, init_famicom, "Sharp", "Famicom Twin", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user