mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
Added pdir register
This commit is contained in:
parent
5a257583f5
commit
210bbc90f2
@ -6,6 +6,12 @@
|
||||
3 timers, address decoder, wait generator, interrupt controller,
|
||||
all integrated in a single chip.
|
||||
|
||||
TODO:
|
||||
- Interrupt generation: handle pending / in-service mechanisms
|
||||
- Parallel port: handle timing latency
|
||||
- Serial port: not done at all
|
||||
- (and many other things)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
@ -19,6 +25,7 @@ static ADDRESS_MAP_START( tmp68301_regs, AS_0, 16, tmp68301_device )
|
||||
AM_RANGE(0x098,0x099) AM_READWRITE(iisr_r,iisr_w)
|
||||
|
||||
/* Parallel Port */
|
||||
AM_RANGE(0x100,0x101) AM_READWRITE(pdir_r,pdir_w)
|
||||
AM_RANGE(0x10a,0x10b) AM_READWRITE(pdr_r,pdr_w)
|
||||
|
||||
/* Serial Port */
|
||||
@ -65,15 +72,25 @@ WRITE16_MEMBER(tmp68301_device::scr_w)
|
||||
m_scr &= 0xa1;
|
||||
}
|
||||
|
||||
/* TODO: bit direction */
|
||||
/* Parallel direction: 1 = output, 0 = input */
|
||||
READ16_MEMBER(tmp68301_device::pdir_r)
|
||||
{
|
||||
return m_pdir;
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(tmp68301_device::pdir_w)
|
||||
{
|
||||
m_pdir = data;
|
||||
}
|
||||
|
||||
READ16_MEMBER(tmp68301_device::pdr_r)
|
||||
{
|
||||
return m_in_parallel_func(0);
|
||||
return m_in_parallel_func(0) & ~m_pdir;
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(tmp68301_device::pdr_w)
|
||||
{
|
||||
m_out_parallel_func(0,data);
|
||||
m_out_parallel_func(0,data & m_pdir);
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,6 +57,8 @@ public:
|
||||
DECLARE_WRITE16_MEMBER(scr_w);
|
||||
DECLARE_READ16_MEMBER(pdr_r);
|
||||
DECLARE_WRITE16_MEMBER(pdr_w);
|
||||
DECLARE_READ16_MEMBER(pdir_r);
|
||||
DECLARE_WRITE16_MEMBER(pdir_w);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
@ -84,6 +86,7 @@ private:
|
||||
UINT16 m_imr;
|
||||
UINT16 m_iisr;
|
||||
UINT16 m_scr;
|
||||
UINT16 m_pdir;
|
||||
|
||||
inline UINT16 read_word(offs_t address);
|
||||
inline void write_word(offs_t address, UINT16 data);
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
|
||||
|
||||
|
||||
#define USE_H8 1
|
||||
#define USE_H8 0
|
||||
|
||||
// from MSX2 driver, may be not accurate for this HW
|
||||
#define MSX2_XBORDER_PIXELS 16
|
||||
|
@ -314,7 +314,7 @@ WRITE16_MEMBER(niyanpai_state::tmp68301_parallel_port_w)
|
||||
|
||||
m_motor_on = data & 4;
|
||||
coin_counter_w(machine(),0,data & 1);
|
||||
coin_lockout_w(machine(), 0,data & 0x08);
|
||||
coin_lockout_w(machine(),0,data & 0x08);
|
||||
}
|
||||
|
||||
CUSTOM_INPUT_MEMBER(niyanpai_state::musobana_outcoin_flag_r)
|
||||
|
Loading…
Reference in New Issue
Block a user