PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Forum Special - GapiDraw 3.01 RC1!

Hi all,

If you have time, please help us out by testing the release candidate of 3.01. We have added a resource manager (check the misc/ResEdit folder) for a virtual file system that is completely crossplatform and resolves the 64kb palm resource limitation.

Give it your best shot!

http://www.develant.com/files/GapiDraw301RC1.exe

//Johan
Got it.

Where do we find documentation for this resource manager?
Where do we find documentation for this resource manager?


It will be available as soon as I have written it, which means the beginning of next week.

Until then, you can have a look at the simple and TileDemo examples for Palm, they now use the resource manager.
I just wanted to say that we will change the names of the classes / operations for resource manager. This will unfortunately delay the final 3.01 a week or so. But it will be worth it.

The new classes will be :
CGapiVFS (only two methods - CreateVFS / FreeVFS)
CGapiFile (abstract superclass)
CGapiStreamFile (to stream data from the virtual file system - can stream and decompress data simultaneously)
CGapiBufferedFile (to copy / expand data from the virtual file system)

But you can begin to use it right now, and then simply change the calls in the next version...

//Johan
It is my understanding that we can use the new VFS system as an alternative solution for image loading, instead of the current situation of loading bitmaps from resources. Of course it will remove the size constraints inherent with Palm resources.

My question is, will it be faster, or slower, or roughly the same performance as loading (e.g. 8bpp) bitmaps from resources?
According to Mikael the performance difference should be minimal. But please give it a go and report back on your experience!
Are those VFS docs just about ready?

I took a look at the CGapiResourceFile APIs in RC1. They would be more useful if they more closely modeled the full set of C file APIs. For example, a built-in fgetc-like function would be pretty useful.

I tried Simple sample from RC1 on my Tungsten E, it still got about 8fps, same as BETA2, and loaded fairly quickly.

However, I edited the VFS resource using misc ResEdit and simply added a 95KB data file, rebuilt the Simple sample, and ran it. It runs, but exits right after the GD splash screen. I didn't change the code at all, just edited the resource file, and everything in the generated and split resource file looks good. So I'm not sure what the problem is there.

OK, I guess it's a size issue. I changed the file to be one of the icons (3KB) instead and it worked fine. Why is this an issue even though I'm not using the resource in question? Is the entire resource archive loaded even if only portions are used? (I don't know what m_resource.Open(5000) really does.) This could be an issue.
I have a tangential question.

The RC1 gd301.lib is 146KB in size. The static library lives in segment 2 of the sample, but is greater than the 64KB size limit. How did you do this?

I'm guessing the library is itself segmented, either via the segments tab or via pragmas (which?) And there's also a build option to put everything in one segment that must be disabled.

Yet I still get warnings about exceeding the size limit when I try to include my own static library that is just over 64KB. I split it into two segments when I built it, and unchecked that one-segment option... is there something else I need to do?
mlepage wrote:I took a look at the CGapiResourceFile APIs in RC1. They would be more useful if they more closely modeled the full set of C file APIs. For example, a built-in fgetc-like function would be pretty useful.


At the very least, we need feof.
Hi Marc,

You could check the number of bytes read by Read(). If it has read less than the number of bytes you expected you have reached the end of the file. The function is failsafe and will return 0 bytes read if you attempt to call it when you are at the end of the file. I'll add IsEOF() to the next 3.02 release if it's ok with you - we really need to get this release out of the door...

We have changed the interface slightly. If you have time I can send you the RC2 later today so you can verify that it works correctly for you before we release final (without banner for registered users) tomorrow!

Sincerely
Johan

Yet I still get warnings about exceeding the size limit when I try to include my own static library that is just over 64KB.


Do you get this in the app that uses the lib? In this case it is probably because you call all the functions in the lib somewhere, this will cause CodeWarrior to link in everything into the segment you put the lib in wich will be more than 64K. The size that CodeWarrior reports is simply the maximum size the code can take, wich means that GapiDraw will take 146K if you use all functions available. This is usually not the case, wich is why GapiDraw works. The code for the functions called from the samples will not be >64K. Actually I have not thought about this before, so the thing we will do is to split the final release of GapiDraw into 3 libs instead. This way you can put each lib in it's own segment, making sure that you can allways call all the functions in GapiDraw.

I do not beleive that there is a way to split a lib file into segments, a lib file is just a bunch of compiled code, the segmenting is done at link time.
Mikael, I understand what you are saying, in fact I wondered if that was what was happening.

I am going to split my library, at least for the time being.

I think it might be possible to segment a lib. The segmenting isn't done, but it's like "hints" of where to put the code when it is finally linked. I've seen vague mentions of it on the web, but I haven't found out how.
Johan, just be careful at the boundary condition. If a file is size 1000 and you've read exactly 1000, feof does NOT return true.

It's possible for users to implement the C-like interface themselves, but better if Develant does it.

I can test versions if you wish.
mlepage wrote:
OK, I guess it's a size issue. I changed the file to be one of the icons (3KB) instead and it worked fine. Why is this an issue even though I'm not using the resource in question? Is the entire resource archive loaded even if only portions are used? (I don't know what m_resource.Open(5000) really does.) This could be an issue.


Any news at all on this? You can verify on your end: adding a large file (e.g. 95KB) to the resource archive, no other changes, makes Simple sample fail to draw anything, on my Tungsten E. A 10KB file works fine. I'm guessing it can't load its images because memory is being consumed, but I'd like to hear your take on the issue.
We'll look into all these issues during the weekend.. We will delay the 3.01 release until these issues are addressed.
feof isn't critical, I implemented my own on top of GapiVHS.

It's only the large file in the resource archive that is currently giving me trouble.
Is RC2 available anywhere? Or should I just wait until final release?
It's only the large file in the resource archive that is currently giving me trouble.


Did you add all parts of the vfs (resource archive) to your CodeWarrior resource file (in the minimal sample, this would be the Minimal_Rsc.rcp file)? The resourceeditor will create a rcp file when you split the file, this file will contain a row like this

DATA "data" ID 5000 "GDRC0000.dat"

for each part of the resource. You must make sure that all rows in this file is present somewhere in your projects rcp file.
Mikael wrote:
It's only the large file in the resource archive that is currently giving me trouble.


Did you add all parts of the vfs (resource archive) to your CodeWarrior resource file (in the minimal sample, this would be the Minimal_Rsc.rcp file)? The resourceeditor will create a rcp file when you split the file, this file will contain a row like this

DATA "data" ID 5000 "GDRC0000.dat"

for each part of the resource. You must make sure that all rows in this file is present somewhere in your projects rcp file.


I think that's it. I was careful to overwrite the existing resource.rcp, but I see now that isn't the one included in the CodeWarrior project.
I have some questions about how Palm GapiDraw applications integrate with the Palm environment.

On models with a virtual graffiti area, I assume it is invisible and disabled? I've had reports that by tapping in that area, it can reappear and be partially (not fully) functional.

On models with a silkscreened graffiti area, it cannot be invisible, and appears to be disabled. Is it possible to re-enable it? At the very least, is it possible to use the home button to exit the application?

Is it possible to treat the hardware buttons the same way, if they're not needed for a game? Have them disable the application, and go to the appropriate application? Palm users expect their buttons to work this way.
mlepage wrote:I have some questions about how Palm GapiDraw applications integrate with the Palm environment.

On models with a silkscreened graffiti area, it cannot be invisible, and appears to be disabled. Is it possible to re-enable it? At the very least, is it possible to use the home button to exit the application?

Is it possible to treat the hardware buttons the same way, if they're not needed for a game? Have them disable the application, and go to the appropriate application? Palm users expect their buttons to work this way.


I would still appreciate answers to these questions.

In particular, is it possible to enable the silkscreen home button? (I believe this is actually required for some Palm certifications.)

UPDATE: I'd also like to know about the HotSync button.
How's that vacation coming along? Has there been any investigation to the questions I asked above? It's been several months now.
It's on top of our priority list. We'll try to add it to 3.01 as well.
Did this make it into 3.5? How about 3.01? Progress update?