VOGONS


First post, by Vess

User metadata
Rank Newbie
Rank
Newbie

...and perhaps find out why, although it runs correctly, it refuses to react to *any* keypresses in Dosbox once the main menu appears?

http://www.the-underdogs.org/game.php?id=2115

(Yes, I know. But I never completed this piece of garbage in 1994, although I was at the final level. Now that I've seen this game again, the fact that I didn't complete it still annoys me...)

Reply 1 of 5, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The problem with this game is that they have a very high
timer frequency so irq0 will be active almost always (at
least when runIRQs is called), and irq1 (keyboard) doesn't
get served. Game works fine otherwise.

Maybe runIRQs should be called after an IRET.

wd

Reply 3 of 5, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well generally it gets technically if i do NOT have
any working patch 😀

Removing the #if 0 in write_data (pic.cpp)
seems to render the keyboard to work correctly.
Qbix/harekiet recommended this one too, but
i don't know if it has any side-effects.

wd

Reply 4 of 5, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

What exactly is that code doing? How does it change the behavior of the emulated PIC? It's so hard to understand the DOSBox code due to lack of comments/documentation 🙁

Here's the code I'm talking about:

#if 0
if (PIC_IRQCheck) {
CPU_CycleLeft+=CPU_Cycles;
CPU_Cycles=0;
}
#endif

Reply 5 of 5, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

PIC_IRQCHECK is a variable that contains the lists of irqs that should be handled. (say their irq line is up)

so if there are irqs that have their irq line up : add the current (yet to do) amount of cpu instructions to the big value
and set the counter to zero.

this results in stopping the dosbox cpu emulation and letting it check it's irq's.

That code is and off now and then. It's a relative expensive operation.(that stopping the machine/checking ints/restarting machine)

Water flows down the stream
How to ask questions the smart way!