-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
funtech/supracan.cpp: move lockout chip to umc6650_device
- Loading branch information
Showing
5 changed files
with
125 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:Angelo Salese | ||
/************************************************************************************************* | ||
[Super A'Can] UMC 6650 lockout chip | ||
TODO: | ||
- signal to cart B26 & B27 (from register $09?). | ||
- Does the effective lockout resolution input merges with $1c signal from UMC6619 host space? | ||
- /WR for optional cart save RAM | ||
**************************************************************************************************/ | ||
|
||
#include "emu.h" | ||
#include "umc6650.h" | ||
|
||
#define VERBOSE (1) | ||
#include "logmacro.h" | ||
|
||
DEFINE_DEVICE_TYPE(UMC6650, umc6650_device, "umc6650", "UMC 6650 lockout chip") | ||
|
||
umc6650_device::umc6650_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) | ||
: device_t(mconfig, UMC6650, tag, owner, clock) | ||
, device_memory_interface(mconfig, *this) | ||
, m_romkey(*this, "romkey") | ||
, m_space_io_config("io", ENDIANNESS_LITTLE, 8, 7, 0, address_map_constructor(FUNC(umc6650_device::internal_map), this)) | ||
{ | ||
} | ||
|
||
ROM_START( umc6650 ) | ||
ROM_REGION(0x10, "romkey", ROMREGION_ERASEFF) | ||
// 68k internal ROM (security related) | ||
ROM_LOAD( "umc6650.bin", 0x00, 0x10, CRC(0ba78597) SHA1(f94805457976d60b91e8df18f9f49cccec77be78) ) | ||
ROM_END | ||
|
||
const tiny_rom_entry *umc6650_device::device_rom_region() const | ||
{ | ||
return ROM_NAME( umc6650 ); | ||
} | ||
|
||
device_memory_interface::space_config_vector umc6650_device::memory_space_config() const | ||
{ | ||
return space_config_vector{ | ||
std::make_pair(AS_IO, &m_space_io_config) | ||
}; | ||
} | ||
|
||
void umc6650_device::device_start() | ||
{ | ||
m_space_io = &space(AS_IO); | ||
save_item(NAME(m_address)); | ||
} | ||
|
||
void umc6650_device::device_reset() | ||
{ | ||
m_address = 0x7f; | ||
} | ||
|
||
u8 umc6650_device::read(offs_t offset) | ||
{ | ||
return offset == 1 ? m_address : m_space_io->read_byte(m_address); | ||
} | ||
|
||
void umc6650_device::write(offs_t offset, u8 data) | ||
{ | ||
if (offset == 1) | ||
m_address = data & 0x7f; | ||
else | ||
m_space_io->write_byte(m_address, data); | ||
} | ||
|
||
void umc6650_device::internal_map(address_map &map) | ||
{ | ||
// map(0x09, 0x09) | ||
// map(0x0c, 0x0c) | ||
map(0x20, 0x2f).rom().region(m_romkey, 0); | ||
map(0x40, 0x5f).ram(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:Angelo Salese | ||
|
||
#ifndef MAME_FUNTECH_UMC6650_H | ||
#define MAME_FUNTECH_UMC6650_H | ||
|
||
#pragma once | ||
|
||
class umc6650_device : public device_t, public device_memory_interface | ||
{ | ||
public: | ||
umc6650_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); | ||
|
||
u8 read(offs_t offset); | ||
void write(offs_t offset, u8 data); | ||
|
||
private: | ||
virtual void device_start() override; | ||
virtual void device_reset() override; | ||
virtual space_config_vector memory_space_config() const override; | ||
virtual const tiny_rom_entry *device_rom_region() const override; | ||
|
||
required_memory_region m_romkey; | ||
address_space_config m_space_io_config; | ||
|
||
void internal_map(address_map &map); | ||
address_space *m_space_io; | ||
u8 m_address; | ||
}; | ||
|
||
DECLARE_DEVICE_TYPE(UMC6650, umc6650_device) | ||
|
||
#endif // MAME_FUNTECH_UMC6650_H |