mirror of
https://github.com/holub/mame
synced 2025-05-21 21:29:15 +03:00
From: Phill Harvey-Smith [mailto:afra@aurigae.demon.co.uk]
Sent: Saturday, October 11, 2008 12:01 PM To: submit@mamedev.org Subject: 6821 PIA changes Hi, Can this change be added to the 6821 pia code, it adds a function that allows the client code to get the status of CA2, taking account of the internal pull up resistor. This code only adds a function and does not change any existing code so should not have any impact on existing drivers. This change is needed for a couple of the mess drivers. Thanks. Phill. -- Phill Harvey-Smith, Programmer, Hardware hacker, and general eccentric !
This commit is contained in:
parent
8769bea92e
commit
5bcb95dff7
@ -981,6 +981,19 @@ int pia_get_output_ca2(int which)
|
||||
return p->out_ca2;
|
||||
}
|
||||
|
||||
// Version of pia_get_output_ca2, which takes account of internal
|
||||
// pullup resistor
|
||||
int pia_get_output_ca2_z(int which)
|
||||
{
|
||||
pia6821 *p = &pias[which];
|
||||
|
||||
p->out_ca2_needs_pulled = FALSE;
|
||||
|
||||
// If it's an output, output the bit, if it's an input, it's
|
||||
// pulled up
|
||||
return p->out_ca2 |
|
||||
C2_INPUT(p->ctl_a);
|
||||
}
|
||||
|
||||
|
||||
/*************************************
|
||||
|
@ -94,6 +94,7 @@ void pia_set_input_ca1(int which, int data);
|
||||
int pia_get_input_ca2(int which);
|
||||
void pia_set_input_ca2(int which, int data);
|
||||
int pia_get_output_ca2(int which);
|
||||
int pia_get_output_ca2_z(int which);
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user