I see you're still pretty active on these forums, so I thought I'd post here about a problem I have.
I'm not sure if you remember me, but I was active here about 3 years ago... Then I got sucked into something else, and now after all those years I'm finally back trying to make a come back hehe... Just trying to figure out the stuff I've done back then. I was the guy who helped you find a bug in v7.5.3 with BmpInfo() pointers.
Anyway, I looked over all the posts/threads I've made here and more or less successfully restored all my work on the PDA I had. It's a Sony one with a high res screen and Palm OS 4.1.
The one thing I can't seem to figure out is how to get the high res to work along with buffer operation. In your latest documentation, I see the following warning under the Sony() function:
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">WARNING: A number of PToolbox drawing features will behave strangely in pre-OS5 Sony high resolution mode (320x320), though many will draw as if in 160x160 mode. The functions which behave oddly or badly in high-resolution mode are:
All the screen buffer functions, with the exception of ClearBuf(). Full sized scratch buffers actually work in low screen depths, but any graphics drawn in them using the standard drawing functions will use a 320x320 coordinate scheme. Higher screen depths will likely cause the heap to overflow, especially when more than one buffer is in play.
...<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
So it seems like that's nothing unusual - the buffer operations (like drawing to an offscreen buffer, and then copying its contents to the display buffer) will reset the high resolution back to low res with 160x160 coordinates. However, I'm pretty certain this used to work fine before. At least judging by my 2nd reply (3rd post from top) at http://www.orbworks.com/forum2/viewtopic.php?t=2691 - I had high res graphics and buffers working together properly.
This code, doesn't work in the 320x320 res anymore with the latest version of PToolboxLib (v7.6.1) and PocketC (v7.1.3). If I comment out the offscreen buffer lines (ie. SetDrawBuffer(1) and CopyBuf(0, 1)), the sony high res mode works fine now. But not with the offscreen buffer code still in there.
- Code: Select all
// Balls
library "PToolboxLib"
main()
{
int nEvent = 0;
int nPenX = 0;
int nPenY = 0;
int nX = 160;
int nY = 160;
int bRunning = true;
Fctl(105, 1);
Fctl(106, 1);
Fctl(108, 1);
Fctl(100, &nPenX);
Fctl(101, &nPenY);
Sony(1, 1);
Sony(2, 1);
SetDepth(4);
graph_on();
ClearBuf();
SetDrawBuf(1);
while(bRunning)
{
do {
nEvent = Fevent(0);
switch (nEvent) {
case 2:
case 3:
case 4:
nX = 2 * nPenX;
nY = 2 * nPenY;
break;
case 12: // home
bRunning = false;
break;
case 7: // up
nY = nY - 5;
break;
case 8: // down
nY = nY + 5;
break;
case 9: // left
nX = nX - 5;
break;
case 10: // right
nX = nX + 5;
break;
case 254:
alert("!!");
break;
default:
break;
}
} while (nEvent);
SetDrawBuf(1);
ClearBuf();
textbox(115, 0, 160, 12, 0, "`f00shurcooL is more mature now lol");
Line(1, 0, 0, nX, nY);
ellipse(1, nX, nY, 10, 10);
CopyBuf(0,1);
}
exit();
}
So basically all you can see is the top left quarter of the screen with all the pixels doubled (ie. 160x160 res). I'm pretty sure it used to work properly before. Of course all this was 3 years ago, so I might be wrong... =/ But I do have a lot of code snippets and a part of my game written that uses code along the lines of what I posted above, so I'm assuming it did work back then...
My guess is it used to work with an older version of PToolBoxLib... I've tried searching for where I could get one, but without any success ( you've sent me an older version by email when you fixed that BmpInfo() pointer bug, but I don't have that email anymore =[ ). Do you have any older versions that I could try to see if it fixes the problem... I'm thinking version 7.5.3 or maybe v7.5.2 was the one I used back then. Thanks a lot. You can send it to my username at hotmail dot com if you don't mind please.
Thanks in advance for your help. I know using a Sony PDA with a high res screen and Palm OS 4.1 is pretty outdated these days, but I'd really like it for my game (or at least the part of it I've finished back then) to display correctly on my PDA hehe, if it's not too much trouble.
thanks,
shurcooL