VOGONS


Smart screen update patch

Topic actions

First post, by jusid

User metadata
Rank Newbie
Rank
Newbie

Hi all,

Here is a patch which adds an option to update dosbox screen only if its contents was changed. This is very useful for old computers/video cards. But modern systems can benefit from this patch too.

To enable smart screen update add the following line to dosbox.conf:

[render]
smartupdate=true

To enable auto cycles adjustment add the following line to dosbox.conf:

[cpu]
timesynched=true
showcycles=true
Last edited by jusid on 2005-07-15, 15:31. Edited 2 times in total.

Reply 1 of 30, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

You can upload it to "patches" section on dosbox's sourceforge.

To apply your patch to cvs source, I modified some parts in your patch file.

Reply 2 of 30, by jusid

User metadata
Rank Newbie
Rank
Newbie

I uploaded modified patch to sourceforge. I hope it will be useful.

Reply 3 of 30, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

I haven't looked at it yet, but does it do partial updates as well? Or rather, can it be extended to do that? If dosbox used SDL_UpdateRects, video drivers could optimize their output if only parts of a screen have changed.

Reply 4 of 30, by jusid

User metadata
Rank Newbie
Rank
Newbie

The patch does not do partial screen updates. It can be implemented too, but requires much more work.

By the way, it is recommended to use tymesync patch from Gulikoza to get dosbox running at maximum possible speed.

Reply 5 of 30, by jusid

User metadata
Rank Newbie
Rank
Newbie

I attached dosbox 0.63 binary with smart screen update and coreswitch patches.

Add the following lines to your dosbox.conf

[render]
smartupdate=true

[cpu]
cycles=100000
timesynched=true
showcycles=true
Last edited by jusid on 2005-06-18, 11:26. Edited 1 time in total.

Reply 6 of 30, by user222

User metadata
Rank Member
Rank
Member
jusid wrote:

I attached dosbox 0.63 binary with smart screen update and coreswitch patches.

There's a serious problem with the "smart screen update" patch. When any application uses graphics, the screen doesn't update at all.

Reply 7 of 30, by jusid

User metadata
Rank Newbie
Rank
Newbie

It works fine for me. Maybe some orther setting in dosbox.conf affects the patch. Try to use default dosbox.conf and add needed entries to activete patches.

Reply 8 of 30, by user222

User metadata
Rank Member
Rank
Member
jusid wrote:

It works fine for me. Maybe some orther setting in dosbox.conf affects the patch. Try to use default dosbox.conf and add needed entries to activete patches.

Text mode and certain graphic modes work, but it breaks so many games and applications, like Windows 3.11.

Reply 9 of 30, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

Can you provide some specific examples?

Reply 10 of 30, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

AMD K63-400

At command line

Ordinary CVS
90+% processor usage unless I use ALOT of frameskip

With patch
0% processor usage....just like on my XP 2800.

Wow, I can actually switch between DosBox and the host system at default dosbox cycles/frameksip now. (Before I'd have to use maximum frameskip otherwise I couldn't Alt-tab)

This is using dosbox.conf generated by this build.

DO NOT WORK
Doom
Hugo's House of Horrors
Virtual Pool

WORKS

4D Prince of Persia

Last edited by DosFreak on 2005-06-17, 17:09. Edited 2 times in total.

Reply 12 of 30, by jusid

User metadata
Rank Newbie
Rank
Newbie

Number of cycles are automatically adjusted depending of CPU load.

Reply 13 of 30, by jusid

User metadata
Rank Newbie
Rank
Newbie

set timesynched=false

Reply 15 of 30, by jusid

User metadata
Rank Newbie
Rank
Newbie

GVFM works fine with my latest version.

Reply 16 of 30, by CraigG

User metadata
Rank Member
Rank
Member

I don't like that.

Tough, How about you do everybody a favour and just sod off.

To jusid,
Excellent build, many thanks.
It's always nice to see people contribute in such a way. This runs well on my older Athlon XP, and I like the sort of 'Dynamic' CPU load, nice 😀

Keep up the good work,

Athlon 64 3000+ stock
MSI NForce 4 K8N Neo Platinum
2Gb RAM
nVidia Geforce 6800GT stock clocks
SBLive! Platinum + Audigy ZS2 Drivers
WinXP Pro SP2

Reply 17 of 30, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Please include the updated patches as well. Also your new timesync seems to selfdestroy itself in doom - the number of cycles keeps dropping until it's about 500 and everything comes to a standstill 😀

Reply 18 of 30, by jusid

User metadata
Rank Newbie
Rank
Newbie

To Gulikoza: My modifications to your timesync need to be improved. I am trying to get dosbox running at max without bothering with cycles.
In your timesync patch it is needed to set cycles to high value. But if cycles value is very high dosbox becomes overloaded and slow. Therefore manual cycles adjustment is needed and I am trying to avoid this.
Also host CPU load must be not 100% because if it is 100% the keys start to stick at my old K6-2.
Currently I dynamically set cycles to 4/3 of the last actual cycles executed. But it doesnt work well in all cases...

Here is my current code:

static Bitu Normal_Loop(void) {
Bits ret,NewTicks;
while (1) {
if (PIC_RunQueue()) {
// code start
if((CPU_TimeSynched) || (showcycles)) {
NewTicks=GetTicks();
if ((CPU_TimeSynched) && (NewTicks!=LastTicks))
CPU_Cycles=0;
if (NewTicks >= Ticks) {
Ticks=NewTicks + 512; // next update in 512ms
CPU_CyclesCur=(cycle_count-CPU_CyclesCur) >> 9;
if (CPU_TimeSynched && CPU_CyclesCur > 500)
CPU_CycleMax=CPU_CyclesCur*4/3;
if (showcycles) {
frames*=1.95; // compensate for 512ms interval
GFX_SetTitle(CPU_CycleMax,-1,false);
frames=0;
}
CPU_CyclesCur=cycle_count;
}
}
// code end
ret=(*cpudecoder)();

Any suggestions?

Reply 19 of 30, by user222

User metadata
Rank Member
Rank
Member
jusid wrote:

GVFM works fine with my latest version.

I get an unhandled exception.