msx: add magic key dongle

This commit is contained in:
hap 2024-04-08 15:51:19 +02:00
parent cd2aa4c138
commit 4071f307fd
11 changed files with 84 additions and 13 deletions

View File

@ -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",

View File

@ -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);

View File

@ -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);

View File

@ -2,7 +2,7 @@
// copyright-holders:Wilbert Pol
/**********************************************************************
MSX Digital Joystick emulation
MSX Digital Joystick emulation
**********************************************************************/

View 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")

View 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

View File

@ -2,7 +2,7 @@
// copyright-holders:Wilbert Pol
/**********************************************************************
MSX Mouse emulation
MSX Mouse emulation
**********************************************************************/

View File

@ -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)")

View File

@ -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()

View File

@ -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 )

View File

@ -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