Qbasicnews.com

Full Version: Loading all of my most-used GFX at startup....
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
... Is going to be very difficult, apparently. I'm planning to load all the unit graphics at startup (284 KB), but I don't seem to have enough memory (32KB < 284KB. oops.). I KNOW that there are games with more than 284 KB in graphics. How do I load them into EMS?

And I might as well ask this, as long as I've started a thread...

Arrakis won't work on my comp. Sad The window just opens and closes immediatly, EMS and XMS are enabled. What's wrong?
Are you using a specific library? Without one, it's impossible to do (unless you create your own XMS/EMS functions with ASM *shudder*). Anyways, I'm using CosmoX, and EMS was pretty easy to get a grasp of (except the fact that I'm having difficulties with EMS pages).
DQB, but I put things in subs so that I could switch at any time.
but figure out how to compile first. *sigh* I haven't figured out how to load extra video pages so I am putting stuff to a blank DC (array) and then copying that DC to video. Works very fast..
Then in that case, when you start the lib up, do it like this:

Code:
DQBinit layernum%, sounds%

... where sounds% is unimportant (since I don't use them yet) and layernum% is the number of layers you plan on using. I'm using 3 currently.

1 = background layer
2 = items layer (I'm making a Mario-like game)
3 = mixer, for throwing shit together flickerlessly

Then I throw it all onto the VIDEO layer Smile
Load qb.exe with the /ah option and '$dynamic, and see if that helps. that allows qb to go beyond and use the entire 640k memory space. It might be enough if you only have 240k graphics, though the program itself and dos is going to take up quite a bit of mem itself. You'll definately have to compile first.

UGL has beautiful memory management if you're looking for something besides the old address/segment format.
Quote:Then in that case, when you start the lib up, do it like this:

Code:
DQBinit layernum%, sounds%

... where sounds% is unimportant (since I don't use them yet) and layernum% is the number of layers you plan on using. I'm using 3 currently.

1 = background layer
2 = items layer (I'm making a Mario-like game)
3 = mixer, for throwing s**t together flickerlessly

Then I throw it all onto the VIDEO layer Smile
I know how to do that.. the problem is the amount of memory I have availible to store images. /ah didn't work Sad I tried UGL, couldn't figure it out...

what I want to do is load the arrays into EMS and pull them out when I need to...?
Use XMS


ie:

Allocate as much KB
Read from File
put file in array
get arraysize(maxelem*2)
movtoXms handle,ArraySize

then anytime you want

BasetoXMS Handle,arraysize,array()
You know, I just had another idea...

Couldn't I load all the images i need onto a background layer, use the libraries "get" function to grab them into a temporary array when I need them, and then "put" them on the other layers?
Why do you want to load everything on startup? You can load the tiles and sprites you need before beginning each level. That's what I do, and I have way more than 284 Kb of gfx Smile
Pages: 1 2 3