Author Topic: GDI Vertical blank and vertical retrace test  (Read 32139 times)

FORTRANS

  • Member
  • *****
  • Posts: 1238
Re: GDI Vertical blank and vertical retrace test
« Reply #75 on: April 27, 2018, 11:11:39 PM »
Hi,

   Tested engine5, and it works on Win XP.  No retrace signal,
test value 480.  (Yesterday, engine3 failed, by that time you had
put out engine4.)

Regards,

Steve N.

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
Re: GDI Vertical blank and vertical retrace test
« Reply #76 on: April 28, 2018, 12:12:20 AM »
Congrats. Now it closes fine (v6). Nevertheless I'd say that I can observe some stumbles in the scrolling.
The logic of the error is hidden among the most unexpected lines of the program

Siekmanski

  • Member
  • *****
  • Posts: 2725
Re: GDI Vertical blank and vertical retrace test
« Reply #77 on: April 28, 2018, 01:00:02 AM »
Thanks guys for testing and the reports.  :t

Here a demo with Caballeros scrolling floor routine.
I could not apply the jitter correction factor on this routine because this routine takes integer steps for drawing the floor.
So, some stutters can be there.

One thing I noticed!

When running another GDI program that does blitting or drawing to the screen, my program starts to stutter else it is very smooth.
This stuttering doesn't take place when running at the same time with a DirectX program only with another GDI program.

I think because my program does not use BeginPaint and EndPaint, the screen BitBlt gets invoked by the GDI pipeline when other programs also using the GDI pipeline????
Creative coders use backward thinking techniques as a strategy.

daydreamer

  • Member
  • *****
  • Posts: 2399
  • my kind of REAL10 Blonde
Re: GDI Vertical blank and vertical retrace test
« Reply #78 on: April 28, 2018, 03:15:00 AM »
tested on a extreme monitor,where I could test up to 200 mhz,234.370 fps
it ran smooth and very fast,but I guess that maybe not good for a fast game become 3 times faster

my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Siekmanski

  • Member
  • *****
  • Posts: 2725
Re: GDI Vertical blank and vertical retrace test
« Reply #79 on: April 28, 2018, 04:19:11 AM »
Then I have to implement a presentation interval, will be done.  :t
Creative coders use backward thinking techniques as a strategy.

daydreamer

  • Member
  • *****
  • Posts: 2399
  • my kind of REAL10 Blonde
Re: GDI Vertical blank and vertical retrace test
« Reply #80 on: April 28, 2018, 08:42:57 PM »
Then I have to implement a presentation interval, will be done.  :t
I dont think its necessary as it can run on 60hz and many faster hz,I just remembered it was capable of upto 200hz, so I tested it
it shows your code is good enough to work even with so fast hardware :t
my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Siekmanski

  • Member
  • *****
  • Posts: 2725
Re: GDI Vertical blank and vertical retrace test
« Reply #81 on: April 28, 2018, 10:17:19 PM »
Cool.  8)

Presentation intervals can help for heavy games, to let it run at a steady 30 FPS for example.
Creative coders use backward thinking techniques as a strategy.

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: GDI Vertical blank and vertical retrace test
« Reply #82 on: April 28, 2018, 10:40:27 PM »
I wonder if it would make sense to have a thread waiting for the vertical interrupt, and then just did an InvalidateRect.

Siekmanski

  • Member
  • *****
  • Posts: 2725
Re: GDI Vertical blank and vertical retrace test
« Reply #83 on: April 28, 2018, 11:17:13 PM »
That was my first thought also, but GDI does not draw at a certain interval and it uses a sort of an event queue. I like to do the drawing whenever I want and at an even interval so the workload is evenly divided.
InvalidateRect, no need to use it, we own the window.
Direct3d9 offers all of this, I was curious if it would be possible with GDI.
And with using a timer thread we have the possibility to execute our routines while the thread takes care of the buffer switch, clearing the background and other things simultaneous

I'm not going to abandon Direct3d9 it's much cooler and faster than GDI.
Creative coders use backward thinking techniques as a strategy.

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
Re: GDI Vertical blank and vertical retrace test
« Reply #84 on: April 29, 2018, 12:49:14 AM »
Hello.

- FloorWM01. Demo with GetMessage, so very little system resources needed.
- FloorWM02. Same demo with PeekMessage, FPS stabilizer and no WM_PAINT using. Much more system resources needed.

I wonder if PeekMessage worths the pity. Any one see any difference? Thank you
The logic of the error is hidden among the most unexpected lines of the program

Siekmanski

  • Member
  • *****
  • Posts: 2725
Re: GDI Vertical blank and vertical retrace test
« Reply #85 on: April 29, 2018, 01:29:01 AM »
FloorWM01.exe GetMessage 0 %
FloorWM02.exe PeekMessage 7-8 %

My proggy with your Floor Routine uses 0.5 % with PeekMessage + vertical blank.

This is my Message Pump:
Code: [Select]
    .while msg.message != WM_QUIT
        invoke PeekMessage,addr msg,NULL,0,0, PM_REMOVE
        .if (eax)
            invoke  TranslateMessage,addr msg
            invoke  DispatchMessage,addr msg
        .endif
        invoke RenderGDI    ; do the rendering stuff
    .endw
Creative coders use backward thinking techniques as a strategy.

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: GDI Vertical blank and vertical retrace test
« Reply #86 on: April 29, 2018, 01:35:55 AM »
GetMessage 0, PeekMessage 20% (and both flicker a little bit)

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
Re: GDI Vertical blank and vertical retrace test
« Reply #87 on: April 29, 2018, 01:53:57 AM »
This is my Message Pump:
Code: [Select]
    .while msg.message != WM_QUIT
        invoke PeekMessage,addr msg,NULL,0,0, PM_REMOVE
        .if (eax)
            invoke  TranslateMessage,addr msg
            invoke  DispatchMessage,addr msg
        .endif
        invoke RenderGDI    ; do the rendering stuff
    .endw
I checked this out, but I've got an error on exit, so I have to use this one:
Code: [Select]
    .WHILE    TRUE
      MessageLoop:
      invoke PeekMessage, ADDR msg, 0, 0, 0, PM_NOREMOVE
      .if eax != 0
          invoke GetMessage, ADDR msg, 0, 0, 0
          or eax, eax
          jz L_Fin
          invoke TranslateMessage, ADDR msg
          invoke DispatchMessage, ADDR msg
          jmp MessageLoop
      .endif
      [... My tasks here... ]
    .ENDW
Your program uses much less system resources but at least in my system also with flickering
The logic of the error is hidden among the most unexpected lines of the program

Siekmanski

  • Member
  • *****
  • Posts: 2725
Re: GDI Vertical blank and vertical retrace test
« Reply #88 on: April 29, 2018, 01:59:47 AM »
Quote
Your program uses much less system resources but at least in my system also with flickering.

I couldn't run it with the jitter correction factor because how your motion value is imbedded in the routine itself.
When I run mine together with other GDI programs on the background it stutters.
But when I run it without other running GDI programs it is smooth.

Timing in Windows Sucks.  :icon13:
Creative coders use backward thinking techniques as a strategy.

caballero

  • Member
  • *****
  • Posts: 2160
  • Matrix - Noah
    • abre ojos ensamblador
Re: GDI Vertical blank and vertical retrace test
« Reply #89 on: April 29, 2018, 02:23:29 AM »
> When I run mine together with other GDI programs on the background it stutters.
> But when I run it without other running GDI programs it is smooth.

ah, it's possible :t. Not everything was going to be simple...
The logic of the error is hidden among the most unexpected lines of the program