mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
msx: add magic key dongle
This commit is contained in:
parent
cd2aa4c138
commit
4071f307fd
@ -1898,6 +1898,8 @@ if (BUSES["MSX_CTRL"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/msx/ctrl/joystick.h",
|
||||
MAME_DIR .. "src/devices/bus/msx/ctrl/libbler.cpp",
|
||||
MAME_DIR .. "src/devices/bus/msx/ctrl/libbler.h",
|
||||
MAME_DIR .. "src/devices/bus/msx/ctrl/magickey.cpp",
|
||||
MAME_DIR .. "src/devices/bus/msx/ctrl/magickey.h",
|
||||
MAME_DIR .. "src/devices/bus/msx/ctrl/mouse.cpp",
|
||||
MAME_DIR .. "src/devices/bus/msx/ctrl/mouse.h",
|
||||
MAME_DIR .. "src/devices/bus/msx/ctrl/sgadapt.cpp",
|
||||
|
@ -68,14 +68,10 @@ std::error_condition msx_cart_holy_quran_device::initialize_cartridge(std::strin
|
||||
|
||||
m_decrypted.resize(size);
|
||||
|
||||
u8 lookup_prot[256];
|
||||
// protection uses a simple rotation on databus, some lines inverted
|
||||
for (int i = 0; i < 0x100; i++)
|
||||
lookup_prot[i] = bitswap<8>(i,6,2,4,0,1,5,7,3) ^ 0x4d;
|
||||
|
||||
u8 *rom = cart_rom_region()->base();
|
||||
for (u32 i = 0; i < size; i++)
|
||||
m_decrypted[i] = lookup_prot[rom[i]];
|
||||
m_decrypted[i] = bitswap<8>(rom[i],6,2,4,0,1,5,7,3) ^ 0x4d;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
m_rombank[i]->configure_entries(0, banks, m_decrypted.data(), BANK_SIZE);
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "hypershot.h"
|
||||
#include "joystick.h"
|
||||
#include "libbler.h"
|
||||
#include "magickey.h"
|
||||
#include "mouse.h"
|
||||
#include "sgadapt.h"
|
||||
#include "towns6b.h"
|
||||
@ -49,6 +50,7 @@ void msx_general_purpose_port_devices(device_slot_interface &device)
|
||||
device.option_add("hypershot", MSX_HYPERSHOT);
|
||||
device.option_add("joystick", MSX_JOYSTICK);
|
||||
device.option_add("libbler", MSX_LIBBLERPAD);
|
||||
device.option_add("magickey", MSX_MAGICKEY);
|
||||
device.option_add("martypad", MSX_MARTYPAD);
|
||||
device.option_add("mouse", MSX_MOUSE);
|
||||
device.option_add("sega", MSX_SEGACTRL);
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Wilbert Pol
|
||||
/**********************************************************************
|
||||
|
||||
MSX Digital Joystick emulation
|
||||
MSX Digital Joystick emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
53
src/devices/bus/msx/ctrl/magickey.cpp
Normal file
53
src/devices/bus/msx/ctrl/magickey.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:hap
|
||||
/**********************************************************************
|
||||
|
||||
Sony Magic Key emulation
|
||||
|
||||
It's a dongle that enables a cheat menu on some games published by Sony
|
||||
when inserted into port B. It was a lottery prize from a Japanese MSX
|
||||
magazine, not sold separately.
|
||||
|
||||
The dongle ties pin 1/2 (up/down) to pin 8 (strobe).
|
||||
|
||||
Note that this cheat menu can also be accessed with an FM Towns pad.
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "magickey.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class msx_magickey_device : public device_t, public device_msx_general_purpose_port_interface
|
||||
{
|
||||
public:
|
||||
msx_magickey_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
virtual u8 read() override { return m_pin8_state ? 0xff : 0xfc; }
|
||||
virtual void pin_8_w(int state) override { m_pin8_state = state; }
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
u8 m_pin8_state = 0;
|
||||
};
|
||||
|
||||
|
||||
msx_magickey_device::msx_magickey_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, MSX_MAGICKEY, tag, owner, clock)
|
||||
, device_msx_general_purpose_port_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
void msx_magickey_device::device_start()
|
||||
{
|
||||
save_item(NAME(m_pin8_state));
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(MSX_MAGICKEY, device_msx_general_purpose_port_interface, msx_magickey_device, "msx_magickey", "Sony Magic Key Dongle")
|
19
src/devices/bus/msx/ctrl/magickey.h
Normal file
19
src/devices/bus/msx/ctrl/magickey.h
Normal file
@ -0,0 +1,19 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:hap
|
||||
/**********************************************************************
|
||||
|
||||
Sony Magic Key emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef MAME_BUS_MSX_CTRL_MAGICKEY_H
|
||||
#define MAME_BUS_MSX_CTRL_MAGICKEY_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ctrl.h"
|
||||
|
||||
|
||||
DECLARE_DEVICE_TYPE(MSX_MAGICKEY, device_msx_general_purpose_port_interface)
|
||||
|
||||
#endif // MAME_BUS_MSX_CTRL_MAGICKEY_H
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Wilbert Pol
|
||||
/**********************************************************************
|
||||
|
||||
MSX Mouse emulation
|
||||
MSX Mouse emulation
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
@ -112,4 +112,4 @@ TIMER_CALLBACK_MEMBER(msx_vaus_device::copy_counter)
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(MSX_VAUS, device_msx_general_purpose_port_interface, msx_vaus_device, "msx_vaus", "MSX Arkanoid Vaus")
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(MSX_VAUS, device_msx_general_purpose_port_interface, msx_vaus_device, "msx_vaus", "Taito Arkanoid Vaus Controller (MSX)")
|
||||
|
@ -640,8 +640,7 @@ u8 msx_slot_disk4_tc8566_device::media_change_r()
|
||||
{
|
||||
return (m_floppy[0] && m_floppy[0]->get_device()->dskchg_r() ? 0x10 : 0x00) |
|
||||
(m_floppy[1] && m_floppy[1]->get_device()->dskchg_r() ? 0x20 : 0x00) |
|
||||
0x03
|
||||
;
|
||||
0x03;
|
||||
}
|
||||
|
||||
u8 msx_slot_disk4_tc8566_device::unk_7ffc_r()
|
||||
|
@ -33,8 +33,8 @@
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(NES_ARKPADDLE, nes_vaus_device, "nes_vaus", "NES Arkanoid Vaus Controller")
|
||||
DEFINE_DEVICE_TYPE(NES_ARKPADDLE_FC, nes_vausfc_device, "nes_vausfc", "FC Arkanoid Vaus Controller")
|
||||
DEFINE_DEVICE_TYPE(NES_ARKPADDLE, nes_vaus_device, "nes_vaus", "Taito Arkanoid Vaus Controller (NES)")
|
||||
DEFINE_DEVICE_TYPE(NES_ARKPADDLE_FC, nes_vausfc_device, "nes_vausfc", "Taito Arkanoid Vaus Controller (FC)")
|
||||
|
||||
|
||||
static INPUT_PORTS_START( arkanoid_paddle )
|
||||
|
@ -25,7 +25,7 @@ This computer is both a Z80 trainer, and a chess computer. The keyboard
|
||||
|
||||
Hardware:
|
||||
4 Kbytes ROM in the address range 0000-0FFF
|
||||
1 Kbyte RAM in the address range 5000-53ff (user area starts at 5100)
|
||||
1 Kbyte RAM in the address range 5000-53FF (user area starts at 5100)
|
||||
6-digit 7-segment display
|
||||
Busy LED
|
||||
Keyboard with 12 keys
|
||||
|
Loading…
Reference in New Issue
Block a user