mirror of
https://github.com/holub/mame
synced 2025-04-25 01:40:16 +03:00
Fixed typo and removed uneeded counter in exchange for a more clear TIN pin clock update interface
This commit is contained in:
parent
6845eabdf1
commit
9b84f0bd72
@ -20,7 +20,7 @@
|
||||
* - Complete support for clock and timers
|
||||
* - Add interrupt support
|
||||
* - Add DMA support
|
||||
* - Add apropriate buffering for each submode
|
||||
* - Add appropriate buffering for each submode
|
||||
**********************************************************************/
|
||||
|
||||
#include "68230pit.h"
|
||||
@ -240,18 +240,15 @@ void pit68230_device::pa_update_bit(uint8_t bit, uint8_t state){ if (state) m_pa
|
||||
void pit68230_device::pb_update_bit(uint8_t bit, uint8_t state){ if (state) m_pbdr |= (1 << bit); else m_pbdr &= ~(1 << bit); }
|
||||
void pit68230_device::pc_update_bit(uint8_t bit, uint8_t state){ if (state) m_pcdr |= (1 << bit); else m_pcdr &= ~(1 << bit); }
|
||||
|
||||
void pit68230_device::update_tin()
|
||||
void pit68230_device::update_tin(uint8_t state)
|
||||
{
|
||||
static uint32_t counter = 0;
|
||||
|
||||
// Tick clock on falling edge. TODO: check what flank is correct
|
||||
if (((counter & 1) != 0))
|
||||
if (state == CLEAR_LINE)
|
||||
{
|
||||
tick_clock();
|
||||
}
|
||||
|
||||
pc_update_bit(REG_PCDR_TIN_BIT, counter & 1);
|
||||
counter++;
|
||||
pc_update_bit(REG_PCDR_TIN_BIT, state == ASSERT_LINE ? 0 : 1);
|
||||
}
|
||||
|
||||
#if VERBOSE > 2
|
||||
|
@ -131,7 +131,7 @@ class pit68230_device : public device_t//, public device_execute_interface
|
||||
void pa_update_bit(uint8_t bit, uint8_t state);
|
||||
void pb_update_bit(uint8_t bit, uint8_t state);
|
||||
void pc_update_bit(uint8_t bit, uint8_t state);
|
||||
void update_tin();
|
||||
void update_tin(uint8_t);
|
||||
|
||||
void wr_pitreg_pgcr(uint8_t data);
|
||||
void wr_pitreg_psrr(uint8_t data);
|
||||
@ -289,11 +289,11 @@ protected:
|
||||
uint8_t m_pbdr; // Port B Data register
|
||||
uint8_t m_pcdr; // Port C Data register
|
||||
uint8_t m_psr; // Port Status Register
|
||||
uint8_t m_tcr; // Timer Control Register
|
||||
uint8_t m_tivr; // Timer Interrupt Vector register
|
||||
int m_cpr; // Counter Preload Registers (3 x 8 = 24 bits)
|
||||
int m_cntr; // - The 24 bit Counter
|
||||
uint8_t m_tsr; // Timer Status Register
|
||||
uint8_t m_tcr; // Timer Control Register
|
||||
uint8_t m_tivr; // Timer Interrupt Vector register
|
||||
int m_cpr; // Counter Preload Registers (3 x 8 = 24 bits)
|
||||
int m_cntr; // - The 24 bit Counter
|
||||
uint8_t m_tsr; // Timer Status Register
|
||||
|
||||
// Timers
|
||||
emu_timer *pit_timer;
|
||||
|
Loading…
Reference in New Issue
Block a user