Qbasicnews.com

Full Version: bLOAD Silliness
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Lillo, this one's for you Smile

I was tinkering around after the last little problem I had (you know, with the pointers and PUT, which by the way, your suggestion worked, but it's not as pretty as @variable) Anyway, I was playing with bload, since it's a nice way of doing a background image.

I had a loop of code, which basically exits on ESC

Quote:''This is to load the file into a sprite array.
BLOAD "image.raw", spritearray

DO

''Do stuff

BLOAD "image.raw", 0 ''This is essential a call to load a background onto the screen. Works properly if called only once.

''Do more stuff, like sprite placement

''Check the keyboard for ESC

LOOP UNTIL keyboard = chr$(27)

Anyway, I compile this. No problems here.
However, when I run it, I get a nasty little error. I couldn't tell you what it is, because WinXP doesn't just come out and say "tried to write to 0x0000" or whatever.

I included the thing just before the DO loop starts because I wonder if that has to do with the problem, but it might not. Anyway, try to ignore the syntax if I screwed up (I just typed it from memory)

In short, it seems like repeatedly using BLOAD to load the same image file at the screen's address causes a runtime error.
Uhm... bloading to memlocation 0?
Z!re: RTFM!!! Wink

Bloading to 0 bloads to the screen surface. The code is correct, so far.
Hehe, i dont use the builtin commands a lot... Got hooked on SDL Big Grin


But if it only dies when you bload to 0 many times over and over...
Well, mem-leak somewhere in that routine sounds likely...



Ohh... a manual... *wanders off rambling about flying manuals and bathtubs*
"manuals"... "bathtubs"... yummy

You have a dirty mind! GO SAY A PRAYER RIGHT NOW, save your soul!! :lol:
Ok, found and solved the problem. BLOAD/BSAVE were hanging up the programs when called more than 256 times... Now this doesn't happen anymore.