Smart screen update patch

Here you can discuss the development of patches.

Smart screen update patch

Postby jusid » 2005-6-15 @ 14:44

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:

Code: Select all
[render]
smartupdate=true


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

Code: Select all
[cpu]
timesynched=true
showcycles=true
You do not have the required permissions to view the files attached to this post.
Last edited by jusid on 2005-7-15 @ 15:31, edited 2 times in total.
jusid
Newbie
 
Posts: 14
Joined: 2004-12-04 @ 09:56

Re: Smart screen update patch

Postby ykhwong » 2005-6-15 @ 15:18

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.
You do not have the required permissions to view the files attached to this post.
ykhwong
Oldbie
 
Posts: 627
Joined: 2004-3-17 @ 15:35

Re: Smart screen update patch

Postby jusid » 2005-6-15 @ 16:08

I uploaded modified patch to sourceforge. I hope it will be useful.
jusid
Newbie
 
Posts: 14
Joined: 2004-12-04 @ 09:56

Re: Smart screen update patch

Postby `Moe` » 2005-6-15 @ 18:40

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.
User avatar
`Moe`
Oldbie
 
Posts: 1169
Joined: 2004-4-29 @ 01:06
Location: Oldenburg, Germany

Re: Smart screen update patch

Postby jusid » 2005-6-16 @ 06:14

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.
jusid
Newbie
 
Posts: 14
Joined: 2004-12-04 @ 09:56

Re: Smart screen update patch

Postby jusid » 2005-6-17 @ 10:04

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

Add the following lines to your dosbox.conf

Code: Select all
[render]
smartupdate=true

[cpu]
cycles=100000
timesynched=true
showcycles=true
Last edited by jusid on 2005-6-18 @ 11:26, edited 1 time in total.
jusid
Newbie
 
Posts: 14
Joined: 2004-12-04 @ 09:56

Re: Smart screen update patch

Postby user222 » 2005-6-17 @ 12:01

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.
user222
Member
 
Posts: 107
Joined: 2005-1-20 @ 12:47

Re: Smart screen update patch

Postby jusid » 2005-6-17 @ 13:04

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.
jusid
Newbie
 
Posts: 14
Joined: 2004-12-04 @ 09:56

Re: Smart screen update patch

Postby user222 » 2005-6-17 @ 13:39

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.
user222
Member
 
Posts: 107
Joined: 2005-1-20 @ 12:47

Re: Smart screen update patch

Postby HunterZ » 2005-6-17 @ 15:16

Can you provide some specific examples?
You're perfect, yes it's true...but without me, you're only you.
User avatar
HunterZ
l33t++
 
Posts: 6074
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: Smart screen update patch

Postby DosFreak » 2005-6-17 @ 16:08

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-6-17 @ 17:09, edited 2 times in total.
User avatar
DosFreak
l33t++
 
Posts: 9759
Joined: 2002-6-30 @ 16:35
Location: Your Head

Re: Smart screen update patch

Postby user222 » 2005-6-17 @ 17:20

The Microwindows test binaries don't work.

ftp://microwindows.censoft.com/pub/micr ... sExamples/
user222
Member
 
Posts: 107
Joined: 2005-1-20 @ 12:47

Re: Smart screen update patch

Postby jusid » 2005-6-18 @ 12:06

Number of cycles are automatically adjusted depending of CPU load.
jusid
Newbie
 
Posts: 14
Joined: 2004-12-04 @ 09:56

Re: Smart screen update patch

Postby jusid » 2005-6-18 @ 12:21

set timesynched=false
jusid
Newbie
 
Posts: 14
Joined: 2004-12-04 @ 09:56

Re: Smart screen update patch

Postby user222 » 2005-6-18 @ 13:11

user222
Member
 
Posts: 107
Joined: 2005-1-20 @ 12:47

Re: Smart screen update patch

Postby jusid » 2005-6-18 @ 13:37

GVFM works fine with my latest version.
jusid
Newbie
 
Posts: 14
Joined: 2004-12-04 @ 09:56

Re: Smart screen update patch

Postby CraigG » 2005-6-18 @ 13:46

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 :happy:

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
User avatar
CraigG
Member
 
Posts: 207
Joined: 2002-9-01 @ 16:13

Re: Smart screen update patch

Postby gulikoza » 2005-6-18 @ 14:48

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 :)
User avatar
gulikoza
Oldbie
 
Posts: 1704
Joined: 2004-6-25 @ 14:53

Re: Smart screen update patch

Postby jusid » 2005-6-18 @ 15:30

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:

Code: Select all
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?
jusid
Newbie
 
Posts: 14
Joined: 2004-12-04 @ 09:56

Re: Smart screen update patch

Postby user222 » 2005-6-18 @ 16:06

jusid wrote:GVFM works fine with my latest version.

I get an unhandled exception.
user222
Member
 
Posts: 107
Joined: 2005-1-20 @ 12:47

Next

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest