Fixed the PIT gate and improved the PIT printing options.

This commit is contained in:
Gregory Alexander 2002-02-21 19:22:42 +00:00
parent b1738bed08
commit eca4aa0720
2 changed files with 21 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: pit82c54.cc,v 1.16 2001-10-03 13:10:38 bdenney Exp $
// $Id: pit82c54.cc,v 1.17 2002-02-21 19:22:42 yakovlev Exp $
/////////////////////////////////////////////////////////////////////////
//
/*
@ -35,15 +35,25 @@
void pit_82C54::print_counter(counter_type & thisctr) {
#if 0
#if 1
BX_INFO(("Printing Counter"));
BX_INFO(("count: %x",thisctr.count));
BX_INFO(("count: %d",thisctr.count));
BX_INFO(("count_binary: %x",thisctr.count_binary));
BX_INFO(("next_change_time: %x",thisctr.next_change_time));
BX_INFO(("counter gate: %x",thisctr.GATE));
BX_INFO(("counter OUT: %x",thisctr.OUTpin));
BX_INFO(("next_change_time: %d",thisctr.next_change_time));
BX_INFO(("End Counter Printout"));
#endif
}
void pit_82C54::print_cnum(Bit8u cnum) {
if((cnum>MAX_COUNTER) || (cnum<0)) {
BX_ERROR(("Bad counter index to print_cnum"));
} else {
print_counter(counter[cnum]);
}
}
void pit_82C54::latch_counter(counter_type & thisctr) {
if(thisctr.count_LSB_latched || thisctr.count_MSB_latched) {
//Do nothing because previous latch has not been read.;
@ -257,7 +267,9 @@ void pit_82C54::clock_multiple(Bit8u cnum, Bit32u cycles) {
}
}
}
#if 0
print_counter(thisctr);
#endif
}
}
@ -712,7 +724,8 @@ void pit_82C54::clock_multiple(Bit8u cnum, Bit32u cycles) {
BX_ERROR(("Counter number incorrect in 82C54 set_GATE"));
} else {
counter_type & thisctr = counter[cnum];
if( (thisctr.GATE&&data) || (!(thisctr.GATE||data)) ) {
if(!( (thisctr.GATE&&data) || (!(thisctr.GATE||data)) )) {
BX_INFO(("Changing GATE %d to: %d",cnum,data));
thisctr.GATE=data;
if(thisctr.GATE) {
thisctr.triggerGATE=1;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: pit82c54.h,v 1.9 2001-10-03 13:10:38 bdenney Exp $
// $Id: pit82c54.h,v 1.10 2002-02-21 19:22:42 yakovlev Exp $
/////////////////////////////////////////////////////////////////////////
//
/*
@ -126,6 +126,8 @@ public:
Bit32u get_clock_event_time(Bit8u cnum);
Bit32u get_next_event_time(void);
void print_cnum(Bit8u cnum);
};
#endif