Timing patches

Here you can discuss the development of patches.

Timing patches

Postby h-a-l-9000 » 2007-1-01 @ 14:58

Fix start discrepancy (20sec) between DOS clock and RTC. ("beautification" ;))
You do not have the required permissions to view the files attached to this post.
h-a-l-9000
DOSBox Author
 
Posts: 4512
Joined: 2005-2-23 @ 00:14

Re: Misc. timing patches

Postby h-a-l-9000 » 2007-1-01 @ 15:06

Port I/O on the ISA-Bus is not arbitrarily fast. Each I/O-access takes about 1-2 microseconds. This fixes:

- timed joystick in Terminal Velocity: coordinates don't wrap at high cycles
- timed joystick in Descent 2: it doesn't go crazy at high cycles
- Checkit detects timed joystick even above something like 2000 cycles
- timed joystick calibration depends less on the cycles value in lot's of games
- Titus the Fox detects Adlib even at 50000 cycles
- Prince of Persia detects adlib reliable at 9000 cycles and sometimes (around every 10th try) at 50000
- In some situations (i.e. title screen) some games take less CPU
- This is the first of three patches needed to make Archon Ultra and The Horde run kind of bullet-proof in DOSBox.
You do not have the required permissions to view the files attached to this post.
h-a-l-9000
DOSBox Author
 
Posts: 4512
Joined: 2005-2-23 @ 00:14

Re: Misc. timing patches

Postby h-a-l-9000 » 2007-1-01 @ 15:09

Change the timer hack to stick to the correct time.
This is the second patch needed by Horde/Archon.
You do not have the required permissions to view the files attached to this post.
h-a-l-9000
DOSBox Author
 
Posts: 4512
Joined: 2005-2-23 @ 00:14

Re: Misc. timing patches

Postby h-a-l-9000 » 2007-1-01 @ 15:15

VGA blanking / retrace improvement

- It makes the second part of the panic demo run at correct speed.
- the workaround for tearline in Tyrian is not necessary any more.
- No tearline in a demo "show.exe" at the magic circle.
- Has a positive effect on Fury ingame with dynamic core.
- It is the 3rd needed for Archon/Horde.
You do not have the required permissions to view the files attached to this post.
h-a-l-9000
DOSBox Author
 
Posts: 4512
Joined: 2005-2-23 @ 00:14

Re: Misc. timing patches

Postby wd » 2007-1-01 @ 15:37

sounds nice
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Misc. timing patches

Postby Reckless » 2007-1-01 @ 17:04

Nice work... looks like someone has had a busy New Years day!
User avatar
Reckless
Oldbie
 
Posts: 557
Joined: 2003-8-07 @ 00:32

Re: Misc. timing patches

Postby h-a-l-9000 » 2007-1-01 @ 17:08

Nah, it was around christmas.
1+1=10
h-a-l-9000
DOSBox Author
 
Posts: 4512
Joined: 2005-2-23 @ 00:14

Re: Misc. timing patches

Postby vasyl » 2007-1-02 @ 03:20

Excellent job. I was wondering about that port i/o speed for quite a while -- it's great that it works. That was single most annoying issue in DOSBox. I will have to check if that also fixes Goblins 3 installer. BTW, do those VGA changes fix KQ6 intro? I would not be surprised. In that case my "vgaparts" patch can be declared obsolete. The SVGA patch may have to be updated but that should be fairly straightforward.
vasyl
Oldbie
 
Posts: 680
Joined: 2005-3-27 @ 04:53

Re: Misc. timing patches

Postby Qbix » 2007-1-02 @ 09:28

moved to the patches area.
Can somebody test kq6 intro ?
The vga changes are rather large and the lines are rather long. So I'm having a bit of trouble deciding the correctness of the changes.
I'll test tyrian at my pc as I 'm the one who is suffering from it the most.
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10522
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Misc. timing patches

Postby h-a-l-9000 » 2007-1-02 @ 12:52

A build with the patches:
http://home.arcor.de/h-a-l-9000/dosbox_ ... sbox_t.zip

I've attached a little piece of documentation of how the vga patch should work.
You do not have the required permissions to view the files attached to this post.
h-a-l-9000
DOSBox Author
 
Posts: 4512
Joined: 2005-2-23 @ 00:14

Re: Misc. timing patches

Postby rcblanke » 2007-1-02 @ 23:21

KQ6 intro looks fine in hal's build.

Happy new year everyone!
User avatar
rcblanke
Oldbie
 
Posts: 1308
Joined: 2005-4-01 @ 09:44
Location: Round 42

Re: Misc. timing patches

Postby vasyl » 2007-1-03 @ 08:42

KQ6 intro looks fine in hal's build.

Are you sure? I just checked -- I am seeing the same problem as before :sad: Running at 12K cycles normal core; KQ6 from Roberta Williams Anthology.
Checked Goblins 3 installer -- that's funny, it's been working for a while. Tried a few of ykhwong's builds: the installer did not work (error -7) in all builds before March 2006, crashed the DOSBox in April and May, and mysteriously started working reliably in June. Go figure.
vasyl
Oldbie
 
Posts: 680
Joined: 2005-3-27 @ 04:53

Re: Misc. timing patches

Postby Kippesoep » 2007-1-03 @ 20:14

I can confirm vasyl's findings about the KQ6 intro: no joy there.
It does however fix Turbo Outrun (which had the cars flickering in VGA mode while running fine in the seemingly identical MCGA mode -- even in 0.66b2).
My site: Ramblings on mostly tech stuff.
User avatar
Kippesoep
Oldbie
 
Posts: 1015
Joined: 2005-5-04 @ 22:36
Location: Netherlands

Re: Misc. timing patches

Postby rcblanke » 2007-1-03 @ 20:14

I was using 10.000 cycles normal core and for me using HAL's build the intro looks slightly better than when using plain CVS; movie hiccups only rarely occur. But you're entirely correct; your 'Changes to scheduled rendering' patch has a much better effect, resulting in almost fluent animation.
User avatar
rcblanke
Oldbie
 
Posts: 1308
Joined: 2005-4-01 @ 09:44
Location: Round 42

Re: Misc. timing patches

Postby Qbix » 2007-1-05 @ 16:12

do iowrites need the same delay as reads ?
I was thinking that a write could be a fire and forget operation.
instead of a reads needs to wait for the reply

Wouldn't these delays slow down certain graphics modi ? Like EGA ?
Futher I think that Delay should be after the exception check, but that is minor.
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10522
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Misc. timing patches

Postby h-a-l-9000 » 2007-1-05 @ 17:22

> do iowrites need the same delay as reads ?

This could depend on how smart the chipset is. I did a test on the 386sx which looped 4000 times ior and 4000 times iow. Both loops took about 8 milliseconds (loop code execution is included). Though with iow -> iow it just has to wait until the previous I/O operation completed.

> Wouldn't these delays slow down certain graphics modi ? Like EGA ?

As on a real computer (if the delay value is correct). So there are some EGA modes that use I/O a lot?

> Futher I think that Delay should be after the exception check, but that is minor.

Sounds good.


I've found the KQ6 thread and tried epic pinball - that one needs the "Tyrian workaround" or the ball gets invisible near the top of the screen.
h-a-l-9000
DOSBox Author
 
Posts: 4512
Joined: 2005-2-23 @ 00:14

Re: Misc. timing patches

Postby wd » 2007-1-05 @ 17:25

> I did a test on the 386sx which looped 4000 times ior and 4000 times iow.

What ports did you use?
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Misc. timing patches

Postby h-a-l-9000 » 2007-1-05 @ 18:32

Printer 0x378 (I connected the scope to it to see the 8 ms)
1+1=10
h-a-l-9000
DOSBox Author
 
Posts: 4512
Joined: 2005-2-23 @ 00:14

Re: Misc. timing patches

Postby wd » 2007-1-05 @ 18:41

Hm do you think the delay is just the port access itself (bus)?
I suppose external devices (joystick, printer, older soundblasters)
might cause much of the delay.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: Misc. timing patches

Postby h-a-l-9000 » 2007-1-05 @ 19:22

Joystick and printer have no connection to the ISA wait pin (IOCHRDY). I don't know about sound cards.
1+1=10
h-a-l-9000
DOSBox Author
 
Posts: 4512
Joined: 2005-2-23 @ 00:14

Next

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest