FPS to 50% in Win98

Discussion of development and patch submission.
Post Reply
MASH
Posts: 10
Joined: Sun 22 Nov, 2015 10:50 am
Location: Germany
Contact:

FPS to 50% in Win98

Post by MASH » Mon 30 Jan, 2017 3:55 pm

Hi,

i have a problem since the removing of the cache 'emulation' in rev 595.

rev 595 (13th December 2016): Removed dire cache 'emulation'
see https://bitbucket.org/pcem_emulator/pce ... 4d753e3b96)


PCem did now limited the FPS to 50% in Win98. I tested it with WindowsXP and Windows 10.
With DOS and WIN311 in PCem i have no problems. The framerate is here 100%.


As a replacement for the "Removed cache emulation" i have added to
src\mem.c line 908
cycles-=64 * cpu_multi;
and to line 940
cycles-=64 * cpu_multi;


This works for me! The FPS are back to 100%. But i don't know why this happend.
Is it the frame limiter in PCem?


My Config:
Intel Advanced/EV
S3 ViRGE/DX
IDT
WinChip 200
Fast VLB/PCI
Sound Blaster 16
128 MB
Voodoo 2

-

szadycbr
Posts: 243
Joined: Mon 21 Nov, 2016 6:23 pm

Re: FPS to 50% in Win98

Post by szadycbr » Mon 30 Jan, 2017 4:17 pm

Framerate? m i missing something? where did you check the "Framerate"?

MASH
Posts: 10
Joined: Sun 22 Nov, 2015 10:50 am
Location: Germany
Contact:

Re: FPS to 50% in Win98

Post by MASH » Mon 30 Jan, 2017 4:28 pm

> where did you check the "Framerate"?
In the program head next "PCem v11" you can find FPS/Framerate

PCem v11 - 100% - Intel Advanced/EV - WinChip 200

User avatar
omarsis81
Posts: 636
Joined: Thu 17 Dec, 2015 6:20 pm

Re: FPS to 50% in Win98

Post by omarsis81 » Mon 30 Jan, 2017 5:14 pm

MASH wrote:> where did you check the "Framerate"?
In the program head next "PCem v11" you can find FPS/Framerate

PCem v11 - 100% - Intel Advanced/EV - WinChip 200
I believe you are talking about the CPU emulation percentage, but, by no means that's framerate

MASH
Posts: 10
Joined: Sun 22 Nov, 2015 10:50 am
Location: Germany
Contact:

Re: FPS to 50% in Win98

Post by MASH » Mon 30 Jan, 2017 5:19 pm

The source says FPS. See src\pc.c line 503

sprintf(s, "PCem v11 - %i%% - %s - %s - %s", fps, model_getname(), models[model].cpu[cpu_manufacturer].cpus[cpu].name, (!mousecapture) ? "Click to capture mouse" : ((mouse_get_type(mouse_type) & MOUSE_TYPE_3BUTTON) ? "Press CTRL-END to release mouse" : "Press CTRL-END or middle button to release mouse"));

User avatar
SarahWalker
Site Admin
Posts: 1598
Joined: Thu 24 Apr, 2014 4:18 pm

Re: FPS to 50% in Win98

Post by SarahWalker » Mon 30 Jan, 2017 6:17 pm

That's a holdover from older versions. It's actually CPU emulation percentage.

The drop in performance is that your host machine isn't fast enough to emulate your chosen guest machine. The terrible cache 'emulation' compensated for this somewhat, but in a weird and inconsistent way which had no relationship to actual CPU performance, so I removed it.

MASH
Posts: 10
Joined: Sun 22 Nov, 2015 10:50 am
Location: Germany
Contact:

Re: FPS to 50% in Win98

Post by MASH » Mon 30 Jan, 2017 6:38 pm

Ah! Ok!
Damn it... i must update my system :(

User avatar
leilei
Posts: 606
Joined: Fri 25 Apr, 2014 4:47 pm

Re: FPS to 50% in Win98

Post by leilei » Mon 30 Jan, 2017 10:49 pm

If it's idle performance you want, you can try installing Rain.

MASH
Posts: 10
Joined: Sun 22 Nov, 2015 10:50 am
Location: Germany
Contact:

Re: FPS to 50% in Win98

Post by MASH » Tue 31 Jan, 2017 1:42 am

A CPU cooler program... No. I need to figure out why the compiler make a PCem.exe which only use 50% of the host CPU. My MAME compiles
for example use up to 100%.

User avatar
dreamer
Posts: 32
Joined: Wed 28 Dec, 2016 11:56 am

Re: FPS to 50% in Win98

Post by dreamer » Tue 31 Jan, 2017 11:29 am

Percent in the titlebar represent how much of the intended speed of the emulated processor Your actual PC is able to reach. 50% means that a Pentium 133 MHz is actually running at something like 66,5 MHz jsut because Your PC is unable to make it run faster. What are Your actual PC specs? If You managed to compile it and didn't set any special compiler flags (I don't even think there are any for artificially limiting performance), then the compiled application and the one downloaded from the official homepage should run about the same bar some fixes, some new bugs or some logic changes in the new build.

I don't think PCem will ever use up a 100% percent of physical CPU just because its only threading is in Voodoo emulation, otherwise everything runs single thread, so it can only use 25% in quad-core or 12,5% in octa-core setup.

MASH
Posts: 10
Joined: Sun 22 Nov, 2015 10:50 am
Location: Germany
Contact:

Re: FPS to 50% in Win98

Post by MASH » Tue 31 Jan, 2017 12:14 pm

My specs:
CPU: Pentium E5200/2.5GHz
GFX: GeForce 9500GT
Board: ASUS P5QL
MEM: 2GB Dual-Channel
OS: Windows XP / Windows 10

I've managed to compile PCem with MAME's compile tools and it has the same 50% limit.

szadycbr
Posts: 243
Joined: Mon 21 Nov, 2016 6:23 pm

Re: FPS to 50% in Win98

Post by szadycbr » Tue 31 Jan, 2017 2:35 pm

Mash, Your host CPU have 2 threads to use, PCem using only 1 thread so u got 50% of cpu usage, when you run anything on voodoo u will get up to 100% .
My i5 2140m works on turbo 2.7 non stop, when i do test on win98 p120mmx running quake 2 time demo 640x480 with voodoo, PCem performance is about 100%, and win10 task manager shows used CPU power on all threads up to 75% on that quake test with PCem b cos. i m using 3 threads on that test , luckly Voodoo use 2 separate threads and PCem use 1 so i utilize only up to 75% of cpu power , cos i use only 3 from 4 threads. When i switch to software mode in quake, PCem use only one thread and Utilize only 25% of cpu power. i noticed that when i do test on voodoo and 4 threads, fine, then i used only 3 threads , no difference, cos truly only 3 are used, then when i switch of to 2 threads , performance drops immidiately, means Voodoo can run on two separate threads, and PCem itself can use yet other one. very nice. You on your single threded 2 core cpu while not using voodoo as i said you will use 50% of your Host CPU power, if u use voodoo you will have up to 100%. But you must actually run voodoo aplication and voodoo must be running and rendering, just install it on system wont show any difference. now You know. You welcome.

szadycbr
Posts: 243
Joined: Mon 21 Nov, 2016 6:23 pm

Re: FPS to 50% in Win98

Post by szadycbr » Tue 31 Jan, 2017 2:49 pm

I really said what Dreamer have said but, longer.
Last edited by szadycbr on Tue 31 Jan, 2017 4:28 pm, edited 1 time in total.

User avatar
dreamer
Posts: 32
Joined: Wed 28 Dec, 2016 11:56 am

Re: FPS to 50% in Win98

Post by dreamer » Tue 31 Jan, 2017 3:03 pm

Szadycbr - You're wrong. The PCem title bar will show 100% when You run something like IBM 5150 - Voodoo wasn't even a baby back then. Looking at the physical CPU usage PCem doesn't max out a single core if the processor is performing well and when it does max out a core then the performance in PCem drops.

Looking at MASH's specs it looks like the processor might be a big problem - it's kinda slow and only has two threads. You also only have two GB problem which might bring RAM caching into the equation. The result is that PCem doesn't pull off the quite demanding task. Try to run a legacy system (IBM XT or AT) and You will see that it reaches 100% :)

szadycbr
Posts: 243
Joined: Mon 21 Nov, 2016 6:23 pm

Re: FPS to 50% in Win98

Post by szadycbr » Tue 31 Jan, 2017 4:02 pm

Dear Dreamer, where did i say something about PCem title bar? all i spoke i my essay was about host CPU utilization, and it appears that MASH is talking about same thing and my cpu does maxed out running p120mmx on voodoo quake2 timedemo 1, it is only 2.7 ghz , you forgot? and i know that emulating IBM 5150 wont use much of a power, probably no more than 10 percent from single core, depend on cpu. Dear dreamer i can emulate c64 on ericsson 310i and even that wont utilize full cpu power of this old phone, IBM 5150 with 4.7 mhz will fly on pII 300 MHZ or even on 233mmx , what are you talking about?
I was refering to "I need to figure out why the compiler make a PCem.exe which only use 50% of the host CPU" wroted by MASH.
When i said that i said all what you said but longer, i mean two last lines from your post, we did misunderstood each other, sorry.

MASH
Posts: 10
Joined: Sun 22 Nov, 2015 10:50 am
Location: Germany
Contact:

Re: FPS to 50% in Win98

Post by MASH » Tue 31 Jan, 2017 5:35 pm

Szadycbr
> Mash, Your host CPU have 2 threads to use, PCem using only 1 thread so u got 50% of cpu usage, when you run anything on voodoo u will get up to 100%.

Correct! With a Voodoo game i get a host cpu usage from 90%-100%. It's a source problem and not a compiler or host OS settings problem.
In the future, a few good optimizations will surely come and with my small "cache emulation" replacement i got good results.

szadycbr
Posts: 243
Joined: Mon 21 Nov, 2016 6:23 pm

Re: FPS to 50% in Win98

Post by szadycbr » Tue 31 Jan, 2017 6:11 pm

Glad to hear that, MASH, but it is not really a problem, it is PCem design and it should be like that. In the future , maybe graphics cards could be emulated on second thread, that would also bring up performance but only while using primary display, would help if riva TNT will be emulated or some other heavyier cards . Any way PCem is great fast Emulator, and there is no other which have that capabilities or it is remotely as fast with voodoo emulation as PCem. Whatever You run on MAME , most likely cpu emulation also running on single thread, depend on what you emulating, MAME may use other threads for other components, Mame is designed to be multithreaded. Hopefully in future PCem could be reDesigned to spread workload over few threads, but cpu emulation will probably stay on single thread cos apparentely you cant do it in multi.

User avatar
SarahWalker
Site Admin
Posts: 1598
Joined: Thu 24 Apr, 2014 4:18 pm

Re: FPS to 50% in Win98

Post by SarahWalker » Tue 31 Jan, 2017 10:10 pm

PCem is already spreading graphic card emulation over multiple threads. Voodoo emulation uses up to 3 threads.

Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: FPS to 50% in Win98

Post by Battler » Sat 18 Feb, 2017 2:26 am

I think Windows 98 is simply using some instructions that are not dynamically recompiled yet, or at least some process in Windows 98 is. The fact that on the same emulated CPU (Pentium 75) and board (Award 430VX PCI), LBA 2 DOS version runs at solid 100%, while the Windows version, run in Windows 98, doesn't go above 70%, shows the host OS is doing something the emulator doesn't like. The game code does not differ that much between the DOS (DOS/4GW, so still 32-bit) and Win32 executables, and I think it gets a higher % in Windows 95, so the problem is definitely in the OS.

User avatar
SarahWalker
Site Admin
Posts: 1598
Joined: Thu 24 Apr, 2014 4:18 pm

Re: FPS to 50% in Win98

Post by SarahWalker » Sat 18 Feb, 2017 7:36 am

That was true to an extent in v11, less so in v12. The main problem now is that Windows 9x when idling is constantly bouncing between protected mode and v86 mode, causing vast numbers of flushes in the process. In addition there's a moderate chunk of self modifying code, plus a lot of very short code blocks. Hence poor performance.

User avatar
Fusion
Posts: 11
Joined: Sun 05 Feb, 2017 10:14 pm
Location: Ontario, Canada

Re: FPS to 50% in Win98

Post by Fusion » Tue 21 Feb, 2017 10:45 pm

So in your opinion Sarah, what OS would you recommend? Win95 or Win98? I've been using 95 OSR2 with no issues, I'm just curious if I'm maybe missing out on something?

User avatar
SarahWalker
Site Admin
Posts: 1598
Joined: Thu 24 Apr, 2014 4:18 pm

Re: FPS to 50% in Win98

Post by SarahWalker » Wed 22 Feb, 2017 6:57 pm

95 OSR2 is fine - it's what I mostly use.

Post Reply