Confirmation of blt bug in 2.04
Can anyone verify that the blt bug actually exists in 2.04? Johan stated that on iPaq 36xx and 38xx's a blt call should crash... This means the simple GD sample should crap out. Can anyone verify this?
I ask because I think a number of games have been released using 2.04 now and I don't think there's been any major uproar about bugs in those games, and I'm wondering if this bug either doesn't really exists or is perhaps not as big a problem as was stated.
Thanks!
The bug occurs with Blt and AlphaBlt in GapiDraw 2.04. It is visible if you blit a rectangular surface where the width and height is not identical to another surface, in a display orientation that is not the same as the native alignment.
For example, the following will crash:
1. Full-screen Blt or AlphaBlt to the backbuffer on a stationary PC where the display is rotated 90 degrees using SetDisplayMode()
2. Full-screen Blt or AlphaBlt to the backbuffer on a 3600 or 3800 in "normal" mode (since the display is internally rotated 90 degrees).
I'm not sure I fully understand... "It is visible if you blit a rectangular surface where the width and height is not identical to another surface, in a display orientation that is not the same as the native alignment."
What do you mean exactly by "a rectangular surface where the width and height is not identical to another surface"? Could you explain that further? I could write here how I interpret it, but it would probably be better to just ask you to explain it in a different way.
When you say a full-screen blt would fail, do you mean if I use backbuffer.blt() to display a 240x320 image? And just to be 100% sure, this would NOT occur using bltfast, correct?
Are these the only two situations where it would occur?
Lastly, is 2.04 the only version that exhibits this bug? In other words, is 2.03 immune from this bug?
Thanks Johan!
Hi,
Basically the issue is like this:
If the display is rotated 90 degrees to either direction, GapiDraw 2.04 forgets to swap the scale values for width and height when doing a stretched Blt or AlphaBlt. If the width and height of the source surface are not identical the issue is visible when calling Blt or AlphaBlt in a display mode that is rotated 90 degrees from the native display orientation...
Frank: gd2.03 and previous versions may be "immune" to this bug but it doesn't have the latest features that 2.04 has. So you should assess if the trade-off will be more beneficial to you before you decide to "downgrade".
Also, I reckon BltFast is faster than Blt right? Why not use BltFast instead? Are there any performance/technical issues on your end?
Oh.. Missed a few bits.. GapiDraw 2.03 is immune from this bug (but have some other issues unfortunately)...
Yes, BltFast or AlphaBltFast is not affected by this.. Only Blt and AlphaBlt.
Johan: Thanks for the clarification... Do you know if any of the PPC emulators are rotated like this? What I'm getting at is if there is a way I can test my code without having one of the devices that this would occur on. My current project is not doing a display rotation, it's standard portrait mode, so my only concern would be devices like the 36xx with the internally rotated display. However, I'm for the most part not using blt very often, and the times I am are not full-screen blts, so from what you've wrote here it doesn't sound like I would have any issues. I want to be 100% sure before I release the game using 2.04 though, or at least know what subset of devices it won't work on.
egarayblas: I took a look at the release history for 2.03 and 2.04, and the only issue that I think would effect me is ironically the one I pointed out regarding rotations not being pixel-perfect. This was fixed in 2.04. However, if that's my only concern I can simply include pre-rotated images as resources and not do it real-time. It would probably add less than 50k to the executable's size, so it's certainly an option. I guess I could also have a blank right column to the images since that's where the rotations seemed to fail. I *think* that would solve the problem as well.
In anycase, 95% of my blts are in fact bltfast's, and as I said above, the instances where I use blt it seems like it wouldn't be an issue. I need a way to test my code first though before release, something that doesn't require me to buy a bunch of PocketPC's.
I'm thinking, if the emulators won't do, that I may in the next few days compile a test version of my game as it stands and enlist some people in the testers thread here to check it out. The game is still a long way away from being done, and I'd need to do this test probably a couple more times going forward, but if it doesn't crash now I can be about 90% sure that it's never going to since most of the code will not look very different than what is done now.
fzammetti: Please feel free to send me a version and I'll test it on any device (I have SH3, MIPS, 3600, 3800, and most newer devices available)
fzammetti: I'm just wondering why don't you to apply to use GapiDraw 2.05 by the way? I have it compiled and ready on the server. It will only take an email to Shahab and if you want to pay $0 for it then that's still fine.... If you after a year found out that you actually earned some money out of GapiDraw - then please do feel free to pay then whatever you want.. You could have the full 2.05 installed by tomorrow.
I may very well send you a version to test, thank you for the offer.
I am growing even more confused by the licensing terms in light of your statement above. You make it sound like it is my choice what I pay and when, but the licensing terms psoted on your web site seem in direct stark contradiction to this.
If what you say here is correct, then all my complaints melt away because I don't mind paying you something down the road IF my game sells, ESPECIALLY if *I* get to decide how much. However, the licensing terms as stated are so ambiguous in general, but in fact seem to flat out state that what your saying here is in fact NOT the case.
Really Johan, I appreciate you trying to help, but this situation is intolerable. The licensing terms need to be clarified a million times over before I'm going to even consider touching 2.05. Shahab, as the licensing contact at VI, needs to get in this forum and give us all some serious answers. Also, just as an offer of advice, I suggest you not make comments as you made here. I understand that you are trying to help, but frankly it's making matters worse. In previous threads you've stated that you cannot comment on licensing, but that's exactly what your doing here, and what you are saying is in direct opposition to the stated terms (seemingly so anyway).
Um. I was simply retyping what Shahab wrote in the topic :
http://www.pocketmatrix.com/forums/view ... hp?t=12920
I just want everyone to use the new version since I put so much work into it...
Frank: I have an ipaq 3700 series and I can help you test your game if you need to. Although I'm not sure if it's actually affected by that "Blt" bug.

Johan, I've moved my comments (well, the same basic theme anyway) over to the thread you referenced. Your right, that is the place for such discussions.
Johan, I didn't catch two things before, so I have to ask you for a little further clarification...
In one of the above posts, you say that the issue effects "stretch blt" and "alphablt". Does this mean that if you are not doing a strecth with blt then the bug doesn't occur?
Also, you mentioned, in the same post I think, that the cause of the problem is the width and height not being swapped. You also mentioned that it doesn't occur if the width and height match another surface.
Did you actually mean that if the surface you are blt'ing has a width and height that are equal, then the problem won't occur? That seems to make sense, since obviously if the width and height are equal it wouldn't matter if they got swapped. Am I correct in this understanding?
If that's the case, I think this bug isn't quite as severe as I (and maybe others) had thought, since it's relatively easy to work around.
But please do verify if my statement above is correct or not. Thank you!
In one of the above posts, you say that the issue effects "stretch blt" and "alphablt". Does this mean that if you are not doing a strecth with blt then the bug doesn't occur?
Unfortunately no.

As long as width and height of the source surface differs it will show (when the display is rotated 90 degrees from it's native alignment).
Did you actually mean that if the surface you are blt'ing has a width and height that are equal, then the problem won't occur? That seems to make sense, since obviously if the width and height are equal it wouldn't matter if they got swapped. Am I correct in this understanding?
Yes! If the width and height of the source rectangle are identical this issue will not show.. Unfortunately if you use clipping, the source rectangle may be adjusted to be as small as possible and can change in size.
Ah, ok, that bug isn't *quite* as bad as I thought then...
As long as I make sure my surfaces have equal width and height, AND I make sure they will never be clipped, then the bug should never occur on any device.
(Excuse me for repeating the same basic thing over and over... it's just that this is an extremely important thing for me to understand properly, as it really makes the decision for me about what the future of my current project is).
Fortunately, those are conditions I can work around in my current project, so I can actually go ahead with 2.04. Thank you Johan
fzammetti wrote:Fortunately, those are conditions I can work around in my current project, so I can actually go ahead with 2.04.
Seems you're in luck! I need tons of blt() and the surfaces are almost never square...
--Eric
fzammetti: I just wanted to confirm..
As long as I make sure my surfaces have equal width and height, AND I make sure they will never be clipped, then the bug should never occur on any device.
Correct.
efortier: Have you sent an email to Shahab? If not, please do so and check out what's needed for you to get access to 2.05...
Yes, in my case it is lucky. That's not to say that I won't have a fair amount of work to do to make sure these conditions are always met, but I think they are met already most of the time, and I think that extra work might be my best option overall.
However, I think I may have to go back to using my own clipping, since there are a few cases I can think of off the top of my head where I will require clipping and the problem may still arise. At least in those instances I may have to. Shouldn't be a big deal.
My other good choice at this point, relatively speaking, is to go back to 2.03. I think the only issue I face doing that, ironically, is the one that I pointed out that Johan took care of in 2.04, which is the pixel-perfect rotation issue. I can work around that as well, now I just have to decide which work-around is going to cost me less time and not have other negative side-effects.
Johan, the release history on your web site... is EVERYTHING that changed from version to version listed, or just the major points? If just the major points, would it be possible to get a list of everything that changed from 2.03 to 2.04?
Johan wrote:efortier: Have you sent an email to Shahab? If not, please do so and check out what's needed for you to get access to 2.05...
Hello Johan,
Yes I did but I haven't heard from him yet.
Thanks!
--Eric
fzammetti: Everything is listed on the web. So you can choose whatever version you want!
I also do not want you to stop using GapiDraw because of all the licensing mess. Hopefully the license agreement (available very soon) will clear things up so that you can download and use the 2.05 version (Blt is much faster in that version as well).
I hope that is the case Johan, I hope that things get cleared up very much.
I have never had any complaints about GapiDraw the product, and I would love to continue using it, most definitely to complete my current project with.
I look forward to hearing what Shahab does, and in reading the license agreement. Until I have a comfort level with the licensing of 2.05 though, I am going to continue under 2.04, keeping in mind what you've explained in this thread.
Johan: I have also applied for 2.05 and have still not heard back from Shahab.
I think he will email back to all of you as soon as the real license agreement is ready.. As I mentioned in another thread, this will be quite soon.