VOGONS


First post, by JENKS

User metadata
Rank Newbie
Rank
Newbie

Hello All,

I've have been trying for along time to get QQP's Perfect General 1 (not 2) to work in DOSBox. The same problem happens no matter how I configure the settings in the DOSBox conf file.

The game loads fine. You can choose your options, scenario etc. but anytime you attempt to scroll up the screen will become corrupted. Just happens when you scroll up with the keyboard or mouse doesn't matter which. I have tried all the different settings like changing video( S3, vesa, ega, ETC) and memory (ems and xms) and loadfix etc.. no dice.

If anyone has gotten this game to run correctly in DoSBox could you do me a favor and post your DOSBox conf file for Perfect General I.

I'm Using DOSBox 0.74 with Windows 7 (and Debian Linux). 4 gigs memory AMD Dual core x2 Nvidia Graphics on my desktop and Intel icore3 with intel graphics on my laptop. The same thing happens on both of these computers.

I have used multiple different copies of Perfect General and they all do the same thing that my original floppy install disk does even with the patch update.

Please Help!

Last edited by JENKS on 2015-01-15, 10:32. Edited 1 time in total.

Reply 1 of 5, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It's a known CPU emulation issue. A rare case of a game that checks the sign flag after a multiply instruction. I can work around it in the official 0.74 build on 32-bit Windows with the core=dynamic setting, but this workaround is reportedly not effective for dynrec on 64-bit Windows.

Reply 2 of 5, by JENKS

User metadata
Rank Newbie
Rank
Newbie

Perfect General 1 now works on my Debian Linux DOSBox setup. Setting core=dynamic was the solution. Hopefully it will also work on my Windows 7 computer as well. Thanks ripshaw8080, I get to enjoy my old favorite once again!

Reply 3 of 5, by JENKS

User metadata
Rank Newbie
Rank
Newbie

ripsaw8080 you are right.

core=dynamic

does not work for Perfect General I on my Windows 7 64-bit computer, But it does work on my Debian 7 Linux computer and DOSBox.

Reply 4 of 5, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It's an interesting issue. If you search online references for the x86 IMUL instruction, much of it states that only the carry and overflow flags have definite meaning, and that the sign, zero, adjust, and parity flags are left in an "undefined" state. The DOSBox CPU cores generally adhere to the documented flag behavior, but the dynx86 core exhibits actual flag behavior due to its nature of natively executing instructions. Only the sign flag is relevant to the issue in Perfect General, but my testing suggests that the zero flag also has definite meaning after an IMUL instruction.

BTW, in addition to the map scrolling, you can also see the issue in the "About The Perfect General" option off the main menu when scrolling the text up and down.

If anyone is interested, the IMUL and JNS instructions that are pivotal to the issue can be found in GENERAL.EXE at offset 0x1389D.

For those that are not able to use the dynx86 core as a workaround, I made a fix program that prevents the glitched scrolling. Place the program where Perfect General is installed and run it in DOSBox to start the game.

Attachments

  • Filename
    pgfix.zip
    File size
    244 Bytes
    Downloads
    144 downloads
    File license
    Fair use/fair dealing exception

Reply 5 of 5, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

The "undefined" flags are of course well defined in the CPU, it's just that Intel for whatever reason did not wish to document them.
The Pentium and later CPUs don't touch those undefined flags.
As far as I remember, the flags are set according to the low half of the result (e.g. the low 8 bits for a 16-bit product).