Don't call Dosvm functions when Dosvm isn't initialized.
This commit is contained in:
parent
fb96436931
commit
23fbf4a904
|
@ -98,6 +98,7 @@ static void set_timer_maxval(unsigned timer, unsigned maxval)
|
|||
{
|
||||
switch (timer) {
|
||||
case 0: /* System timer counter divisor */
|
||||
if (Dosvm.Current())
|
||||
Dosvm.SetTimer(maxval);
|
||||
break;
|
||||
case 1: /* RAM refresh */
|
||||
|
@ -307,7 +308,10 @@ DWORD IO_inport( int port, int size )
|
|||
if (chan == 0) /* System timer counter divisor */
|
||||
{
|
||||
/* FIXME: Dosvm.GetTimer() returns quite rigid values */
|
||||
if (Dosvm.Current())
|
||||
tempval = dummy_ctr + (WORD)Dosvm.GetTimer();
|
||||
else
|
||||
tempval = dummy_ctr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -415,6 +419,7 @@ void IO_outport( int port, int size, DWORD value )
|
|||
switch (port)
|
||||
{
|
||||
case 0x20:
|
||||
if (Dosvm.Current())
|
||||
Dosvm.OutPIC( port, (BYTE)value );
|
||||
break;
|
||||
case 0x40:
|
||||
|
@ -472,7 +477,10 @@ void IO_outport( int port, int size, DWORD value )
|
|||
tmr_8253[chan].latched = TRUE;
|
||||
dummy_ctr -= 1 + (int)(10.0 * rand() / (RAND_MAX + 1.0));
|
||||
if (chan == 0) /* System timer divisor */
|
||||
if (Dosvm.Current())
|
||||
tmr_8253[chan].latch = dummy_ctr + (WORD)Dosvm.GetTimer();
|
||||
else
|
||||
tmr_8253[chan].latch = dummy_ctr;
|
||||
else
|
||||
{
|
||||
/* FIXME: intelligent hardware timer emulation needed */
|
||||
|
|
Loading…
Reference in New Issue