Re: Can this loop be made faster ?
From: '\\\\o//'annabee ('\\o//'annabee)
Date: 02/26/05
- Next message: Sevag Krikorian: "Re: HAY HERBERT, yet another win89ddk"
- Previous message: hutch--: "Re: HAY HERBERT, yet another win89ddk"
- In reply to: wolfgang kern: "Re: Can this loop be made faster ?"
- Next in thread: '\\\\o//'annabee: "Re: Can this loop be made faster ?"
- Reply: '\\\\o//'annabee: "Re: Can this loop be made faster ?"
- Reply: wolfgang kern: "Re: Can this loop be made faster ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 26 Feb 2005 04:12:22 +0100
På Fri, 25 Feb 2005 14:59:52 +0100, skrev wolfgang kern
<nowhere@nevernet.at>:
> The first value will actually better represent the real timing during
> code execution.
:-(
> If you run it twice or more often then more and more
> parts of the code under test become 'recently frequent used' and get a
> higher cache priority than the surrounding code (including debugger).
Ok. Good to time gameloops this way then ?
> | But isnt it true that all the noise doesnt much matter ?
> If your code is fast enough to complete before any hardware-IRQ is fired
> then you wont see any timing-'noise'.
ok.
> I don't know if/where windoze supports 'timer/event-information' usefull
> for timer-synchron operations.
Me neither. In general If its good, not, if its bad, then yes :))
> IRQ-handlers often also invoke the event-handlers (a bad habit anyway),
> and here many cycles pass the scene before your code can continue.
ok.
> Yes, but as the screen/page-start address also have to be added by any
> draw and the clipping-check also check against absolute positions,
> I use something like:
>
> SETfirstDOT: ; x,y,Ox,Oy (ebx,ecx,esi,edi)
> lea ebx D$ebx+esi+0_0000_0000 ;calc X
> '-- X-frame-offset (rare used)
> '-- Xpos (Object relative)
> '-- X ObjectPosition
> lea ecx D$ecx+edi+0_0000_0000 ;calc Y
> '-- Y-frame-offset (rare used)
> '-- Ypos (Object relative)
> '-- Y ObjectPosition
>
> cmp ebx 0_0000_0000 ... ;clip limits (modified by Vmode,Vpage)
>
> imul edx ecx 0_0000_0000 ;calc Y (on screen position)
> '-- line offset (modified by Vmode)
> cmp edx 0_0000_0000 ... ;clip limits (modified by Vmode,Vpage)
>
> mov D$edx+ebx+0_0000_0000 eax ;THE DRAW
> '-- pixel colour (four px if 8bit-mode)
> '-- page-start address (modified by Vmode,Vpage)
> '-- calculated X
> '-- calculated Y
> ; edx ebx can be used for following draws with less calculations.
>
> but I'm afraid you have to use the windozeAPI or DirectDraw,
> not sure if you can use code like above there.
One can use such code, but only in a backbuffer, which would then be
copied (blittet) by a hardware blitter to the screen. But one would
probably prefer to use the hardware blitters even to work on the
backbuffer, as the full operation of locking the the memory, reading it
from the hardware, changing it, and copy it back to the hardware would be
slow. As far as I know you can do this in DirectX. I did this once, and it
made otherwise smooth graphics become yerky.
But its been almost two years since I did any DirectX programming, and
that was for DirectX7, so much may have changed by now.
Of course, now theres is pixelshaders, that can do this instead, I
_suppose_, but I have not tinkered with those yet, allthough I have
several megas of unread docus about it. Time permits....well....(looking
blank into the screen for a moment...feeling the strains of insomnia...)
As far as I have understood, the hardware pixel shaders allow for us to
upload some small pixel shading code to the hardware, and so the code will
be called, by the hardware for each pixel that is rendered, after the
texture has been applied. Its supposed to create possibilities for unreal
graphics effects. but I am really blank to the details yet. But from
looking at the really amazing games. (just played HL2) theres really been
an awsome revolution in game graphics. It now looks so wonderful, that it
allmost ready to take *away* the magic. :)) Oki thats just my sour
shoulders, and broken ego speaking.... No, actually the new graphics and
physics engines are really amazing. They make moch, of just about anything
else. Soon we will simply be able to be part of the movie. I see an
amazing industry growing up, giving us interactive movies, and awsomes
games. New ways to tell stories. We should try to keep track of them, but
sooner or later they may deside to look us out.
> For most games this are just basic attributes.
> Have you ever tried "TIM" ?
No. do you have a link to this game. I think you may have mentioned it
some time in the past, but I couldnt find it sofar.
> SeeYa
På gjensyn.
>
> __
> wolfgang
>
>
>
>
-- http://TheWannabee.org
- Next message: Sevag Krikorian: "Re: HAY HERBERT, yet another win89ddk"
- Previous message: hutch--: "Re: HAY HERBERT, yet another win89ddk"
- In reply to: wolfgang kern: "Re: Can this loop be made faster ?"
- Next in thread: '\\\\o//'annabee: "Re: Can this loop be made faster ?"
- Reply: '\\\\o//'annabee: "Re: Can this loop be made faster ?"
- Reply: wolfgang kern: "Re: Can this loop be made faster ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|