-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
48 changed files
with
1,641 additions
and
1,118 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
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:Juergen Buchmueller | ||
/* | ||
National Semiconductor NSC800 | ||
*/ | ||
|
||
#include "emu.h" | ||
#include "nsc800.h" | ||
|
||
#include "z80.inc" | ||
|
||
#define LOG_INT (1U << 1) // z80.lst | ||
|
||
//#define VERBOSE (LOG_INT) | ||
#include "logmacro.h" | ||
|
||
#define LOGINT(...) LOGMASKED(LOG_INT, __VA_ARGS__) | ||
|
||
|
||
// device type definition | ||
DEFINE_DEVICE_TYPE(NSC800, nsc800_device, "nsc800", "National Semiconductor NSC800") | ||
|
||
nsc800_device::nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) | ||
: z80_device(mconfig, NSC800, tag, owner, clock) | ||
{ | ||
} | ||
|
||
|
||
//------------------------------------------------- | ||
// initialization | ||
//------------------------------------------------- | ||
|
||
void nsc800_device::device_start() | ||
{ | ||
z80_device::device_start(); | ||
|
||
save_item(NAME(m_nsc800_irq_state)); | ||
} | ||
|
||
void nsc800_device::device_reset() | ||
{ | ||
z80_device::device_reset(); | ||
memset(m_nsc800_irq_state, 0, sizeof(m_nsc800_irq_state)); | ||
} | ||
|
||
|
||
//------------------------------------------------- | ||
// execute | ||
//------------------------------------------------- | ||
|
||
void nsc800_device::do_op() | ||
{ | ||
#include "cpu/z80/ncs800.hxx" | ||
} | ||
|
||
void nsc800_device::execute_set_input(int inputnum, int state) | ||
{ | ||
switch (inputnum) | ||
{ | ||
case NSC800_RSTA: | ||
m_nsc800_irq_state[0] = state; | ||
break; | ||
|
||
case NSC800_RSTB: | ||
m_nsc800_irq_state[1] = state; | ||
break; | ||
|
||
case NSC800_RSTC: | ||
m_nsc800_irq_state[2] = state; | ||
break; | ||
|
||
default: | ||
z80_device::execute_set_input(inputnum, state); | ||
break; | ||
} | ||
} |
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,39 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:Juergen Buchmueller | ||
#ifndef MAME_CPU_Z80_NSC800_H | ||
#define MAME_CPU_Z80_NSC800_H | ||
|
||
#pragma once | ||
|
||
#include "z80.h" | ||
|
||
enum | ||
{ | ||
NSC800_RSTA = Z80_INPUT_LINE_MAX, | ||
NSC800_RSTB, | ||
NSC800_RSTC | ||
}; | ||
|
||
|
||
class nsc800_device : public z80_device | ||
{ | ||
public: | ||
nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); | ||
|
||
protected: | ||
// device_t implementation | ||
virtual void device_start() override ATTR_COLD; | ||
virtual void device_reset() override ATTR_COLD; | ||
|
||
// device_execute_interface implementation | ||
virtual u32 execute_input_lines() const noexcept override { return 7; } | ||
virtual void execute_set_input(int inputnum, int state) override; | ||
|
||
virtual void do_op() override; | ||
u8 m_nsc800_irq_state[3]; // state of NSC800 restart interrupts A, B, C | ||
}; | ||
|
||
DECLARE_DEVICE_TYPE(NSC800, nsc800_device) | ||
|
||
|
||
#endif // MAME_CPU_Z80_NSC800_H |
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
Oops, something went wrong.