Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Fast drawing

  1. #1
    EmuTalk Member
    Join Date
    Jan 2006
    Posts
    4

    Fast drawing

    'm the coder of the WinArcadia emulator, which is now feature-complete. I want to optimize it as it is extremely slow, it only achieves 1-2 FPS in most modes, this is with the CPU emulation turned off! The Amiga port of WinArcadia runs faster than this, even through WinUAE!

    I'm using SetPixel()/ClipBlit() to do the drawing. Apparently it is much quicker to use SetBitmapBits(), but there doesn't seem to be any reasonable documentation about it.

    If I may say so the entire Windoze display subsystem is a joke, it seems convoluted and poorly designed, things are much easier to do on an Amiga. The documentation over at MSDN is absolute crap and there doesn't seem to be any tutorials about it.

    I don't want to use DirectX as I know for a fact that it is not necessary to gain adequate performance, there are other emulators of more complex machines which achieve good performance with GDI.

    All I need to do is plot pixels one at a time to a bitmap, it only needs to be 8 colours (3 bitplanes), and refresh the window after each frame has been drawn. It already does this of course but much too slowly.

    Aaarrrggh....



    • Advertising

      advertising
      EmuTalk.net
      has no influence
      on the ads that
      are displayed
        
       

  2. #2
    ????????????????????????? Doomulation's Avatar
    Join Date
    Nov 2001
    Location
    ????????????????
    Posts
    8,780
    It's called Windows, btw and DirectX was created to make graphics rendering easy while fast.
    Atashi wa juu-yon-sai no onna no ko! Atashi no namae wa Miizuki. Yurushiku ne!
    Nani? Atashi o shinjirimasen desu ka? Baka!
    "You're all doomed! Doomed, I say! Hehe... are we approaching the end of the world?"

    shikata ga kaite aru - "the instructions are written above"
    Need to download GoodN64 or instructions to use it? Need to check if it's a good or bad rom?
    Download: Glide64 | Hacktarux's wrapper

  3. #3
    Gekko Developer ShizZy's Avatar
    Join Date
    Feb 2005
    Location
    RI, USA
    Posts
    760
    Try SDL?
    ~ShizZy

    6Bit.net Emulation & Gaming | Forums
    Gekko GameCube Emulator

  4. #4
    EmuTalk Member Poobah's Avatar
    Join Date
    Feb 2004
    Posts
    475
    Does GDI give you direct access to the screen's location in video memory? SetPixel() functions in just about any API are slow, because they usually do all sorts of checking and other things.

    I do agree with you on the Windows display thing. Programming graphics stuff in DOS was easy, but in Windows we are pretty-much forced to learn a bloated API.
    My Site
    Batch-extract and re-archive individual ROMs from GoodMerged 7z archives into individual ZIP or JMA files. (Now a Windows GUI program!)

    Drug Free For Life: 98% of the teenage population has
    tried drugs at least once. If you are one of the 2%
    who hasn't, copy and paste this into your signature.

  5. #5
    EmuTalk Member
    Join Date
    Mar 2006
    Posts
    13
    http://www.gaffer.scene.org/tinyptc/. If you must do it yourself, the bitblt API is extremely well documented and pretty darn easy to use as well. The function you want to use is called BitBlt (or a variant thereof). Check out http://www.winprog.org/tutorial/bitmaps.html and then take a look at SetDIBits to get a device indepdent bitmap (which will give you byte r,g,b format easily).

  6. #6
    EmuTalk Member hap's Avatar
    Join Date
    Jan 2005
    Posts
    188
    If you want to stick to GDI, I advise you to use CreateDIBSection, to get a pointer to the bitmap pixel bits, which you can write to directly instead of a slow SetPixel or similar function, and just use BitBlt to blit it to the screen.

    *edit* didn't read gladius' post, he basically said the same thing.
    Last edited by hap; July 2nd, 2006 at 09:41.

  7. #7
    EmuTalk Member
    Join Date
    Jan 2006
    Posts
    4
    Thanks all, I had a look at http://www.gaffer.scene.org/tinyptc/ and based it on that code. It's dozens of times faster now :-)

    @Doomulation: There was no need to use DirectX, why force the users to download and install yet more bloatware? Windoze is bloated enough :-)

  8. #8
    EmuTalk Member
    Join Date
    Jan 2006
    Posts
    4
    Thanks all, I had a look at http://www.gaffer.scene.org/tinyptc/ and based it on that code. It's dozens of times faster now :-)

    @Doomulation: There was no need to use DirectX, why force the users to download and install yet more bloatware? Windoze is bloated enough :-)

  9. #9
    ????????????????????????? Doomulation's Avatar
    Join Date
    Nov 2001
    Location
    ????????????????
    Posts
    8,780
    Quote Originally Posted by Minuous
    Thanks all, I had a look at http://www.gaffer.scene.org/tinyptc/ and based it on that code. It's dozens of times faster now :-)

    @Doomulation: There was no need to use DirectX, why force the users to download and install yet more bloatware? Windoze is bloated enough :-)
    Windoze = Windows.
    Anyway, although I haven't tryied GDI, try 3D using it. I'm sure you'll get a headache. Besides that, DirectX isn't bloated, but pretty useful. DirectInput for example. Catches keys and much more flexible than Windows standard input mechanism. DirectShow, which is now part of the Windows SDK, can be used for a lot of things using a filter system. Easily integrated into media players for easy playback.

    I consider DirectX to be something good. And for a reason.
    Atashi wa juu-yon-sai no onna no ko! Atashi no namae wa Miizuki. Yurushiku ne!
    Nani? Atashi o shinjirimasen desu ka? Baka!
    "You're all doomed! Doomed, I say! Hehe... are we approaching the end of the world?"

    shikata ga kaite aru - "the instructions are written above"
    Need to download GoodN64 or instructions to use it? Need to check if it's a good or bad rom?
    Download: Glide64 | Hacktarux's wrapper

  10. #10
    EmuTalk Member
    Join Date
    Jul 2004
    Location
    Someplace where I don't know where I am.
    Posts
    618
    Quote Originally Posted by Doomulation
    Windoze = Windows.
    Um, I can't tell if you're being serious or not. It's a joke .

Page 1 of 2 12 LastLast

Similar Threads

  1. game is fast...too fast
    By kunthum123 in forum Chankast
    Replies: 8
    Last Post: January 24th, 2005, 12:11
  2. FPS limit problem on fast PC..!
    By Outside_Eagl in forum Project64
    Replies: 4
    Last Post: August 20th, 2003, 22:41
  3. PJ64, 1964 and NEMU... TOO FAST?
    By gamerk2 in forum Plugins
    Replies: 5
    Last Post: May 29th, 2003, 23:12
  4. UltraHLE too fast! (Zelda)
    By straight in forum UltraHLE 2064
    Replies: 5
    Last Post: November 9th, 2002, 02:33
  5. Preview edition going too fast
    By Gamer123 in forum 1964
    Replies: 3
    Last Post: April 28th, 2002, 01:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •