Welcome, Guest. Please login or register.

Author Topic: Double buffering of WB?  (Read 2980 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline MinuousTopic starter

Double buffering of WB?
« on: January 10, 2006, 10:36:03 PM »
I'm writing an emulator and am planning to have it be able to run in full-screen mode and as a window on the Workbench screen. The problem is that currently the graphics are much too slow and flickery. I'm running OS3.9 under WinUAE.

Is it possible and allowed to do double-buffering on the Workbench screen? Are there restrictions on what screenmodes it would work with (ECS/AGA/RTG)? I notice there are some programs that seem to do fast smooth animation in a WB window, eg. Heretic 2, Frogger, etc. so it must be possible...? Many thanks.
 

Offline MinuousTopic starter

Re: Double buffering of WB?
« Reply #1 on: January 12, 2006, 09:33:42 PM »
I found Piru's AWin package on Aminet. It seems to be almost perfect except that you have to use custom replacements for OpenWindowTags() etc. which makes it unusable because I want a ReAction window (ie. NewObject() to open the window). Any way around this?
 

Offline MinuousTopic starter

Re: Double buffering of WB?
« Reply #2 on: January 12, 2006, 10:49:50 PM »
OK, just the window is all I need to buffer, phew...

Thanks.

On a similar topic...When the emulator is in full-screen mode, I'm writing directly to bits in the bitmap on my custom screen. This is extremely slow if I have UAE set up to do cycle-exact blitting, but quite quick if I have it set up to do immediate blits.

Just wondering what the reason for that is? Because I'm using the CPU, not the blitter, to write the bits. So I wouldn't think the blitter had anything to do with it? And the copper should still be redrawing the screen at the usual intervals? So I can't see why there would be a speed difference...I must be missing something obvious...?
 

Offline MinuousTopic starter

Re: Double buffering of WB?
« Reply #3 on: January 17, 2006, 04:38:09 AM »
OK, I've done as suggested.

However although it is smoother, it is just as slow as it was before. Even though the Amiga shouldn't be having to redraw the display every time I change a pixel (since I'm now using an offscreen bitmap).

The draws are taking about 5 seconds per frame in 16-colour OCS 320x256 mode (in cycle-exact mode). I'm not using scrolling or anything. It needs to be fast in cycle-exact mode so it is fast on real Amigas, and so UAE users don't have to fool around with their settings just to run my emulator.

Obviously it must be possible to do fast smooth graphics under OCS, as all the vintage Amiga games (eg. Hybris, Shadow of the Beast, etc.) do it, but I'm mystified as to how they can run perfectly under UAE at A500 speed but my emulator is crawling at fastest possible speed!?

Code sample from the emulator can be posted on request.
 

Offline MinuousTopic starter

Re: Double buffering of WB?
« Reply #4 on: January 17, 2006, 08:16:05 AM »
OK, thanks for enlightening me Piru.

Final question, I promise... :-)

Is there an easy way to use your rather impressive AWin routines without using your custom functions for opening windows and handling input? As I want to use a algorithmically laid-out ReAction window, but it seems AWin is not designed for this? ie. I use NewObject() instead of OpenWindowTags(). If I handled the window opening and input processing myself, but used your blitting functions, I presume that wouldn't work (your functions initialize some things that the normal functions don't?), otherwise you wouldn't have needed to write enhanced replacements for those functions, am I right?