Re: Can this loop be made faster ?

From: '\\\\o//'annabee ('\\o//'annabee)
Date: 02/26/05


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


Relevant Pages

  • Re: xbox 3 + ps4
    ... and MS especially probably still feel a bit burnt over the HDDVD hardware add-on. ... The only thing I would like is a better graphics chip in it -not to improve the graphics really other than to add resolution. ... Games like GTA4 especially would benefit from allowing the 'camera' to be placed a little further back, reducing the main character size and expanding the viewable area. ... I've just upgraded my graphics card and I spent last night checking how stuff ran, basically anything I throw at it seems fine in 1680x1050 and looks stunning and sharper than anything I've played on 360, I don't know how it works with 360 vs. PC resolution wise, but I do know that a lot of scaling goes on with the 360 to the actual resolution the game is running at often isn't /that/ high. ...
    (uk.games.video.misc)
  • Re: Firaxis blunder: a rant
    ... Intel aren't kidding when they say that most games will ... A high end laptop, capable of say running CAD programs, also can handle ... hardware to know if their graphics can handle a 3D game in T&L. ...
    (comp.sys.ibm.pc.games.strategic)
  • Re: Can this loop be made faster ?
    ... | copied by a hardware blitter to the screen. ... As far as I know you can do this in DirectX. ... | made otherwise smooth graphics become yerky. ... | looking at the really amazing games. ...
    (alt.lang.asm)
  • Re: c++ games programming
    ... I have experience with graphics programming but not with games design. ... Graphics (i.e. OpenGL or DirectX ...
    (comp.programming)
  • Re: Why I chose High Level Assembly (HLA)
    ... |> All these directX windoze stuff is awesome slow related to ... |> or at least got some minor hardware detection/drive capability. ... | Maybe DirectX is slow, but the Hardware it allows you to *direct*, ... and that's why good games come together with a large ...
    (alt.lang.asm)