NovicePgmr
Programmer
I am trying to save a series of tiles for a game in one or more Bsave files so that my main program can use Bload to grab the tiles without having to clutter up the program with excessive DATA statements.
I can draw place the tiles easily enough using DATA, READ, GET, and PUT but when I try to save a tile with one program and load it with another a get the "String Space Corrupt" error.
Here's the code I'm using:
_____________
screen 9
dim GxfTile(400)
data 0,0,0,... 'a DATA block 20x20 characters big to produce
tile graphic
for y 1 to 20: for x 1 to 20
read NextPixel
pset (x,y), NextPixel
next x: next y
get (1,1)-(20,20), GfxTile
def seg = varseg(GfxTile)
Bsave "tile1.gfx", varptr(GfxTile),400
----------------
This much works, at least to the Get statement, the tile is drawn and I can redraw the tile with Put as I please. Is there something wrong with the Def Seg and Bsave portion?
Maybe the Dim, or do I need $Static or $Dynamic? Or is it in how I'm loading it here:
----------------------
'Second, seperate program ment to Bload and Put the tile on screen
screen 9
dim GfxTile(400)
def seg = varseg(GfxTile)
Bload "tile.gfx", varptr(GfxTile)
'<<-- It breaks here (or the line above I suppose) with String Space Corrupt.
Put(1,1), GfxTile
____________________
Is it something simple I'm missing? Any help would be greatly appreacted.
I made a game years ago with dozens of tiles like the 20x20 block above and I'm fairly sure I used Bload to load them into the main program.
Thanks in advance,
CJ
I can draw place the tiles easily enough using DATA, READ, GET, and PUT but when I try to save a tile with one program and load it with another a get the "String Space Corrupt" error.
Here's the code I'm using:
_____________
screen 9
dim GxfTile(400)
data 0,0,0,... 'a DATA block 20x20 characters big to produce
tile graphic
for y 1 to 20: for x 1 to 20
read NextPixel
pset (x,y), NextPixel
next x: next y
get (1,1)-(20,20), GfxTile
def seg = varseg(GfxTile)
Bsave "tile1.gfx", varptr(GfxTile),400
----------------
This much works, at least to the Get statement, the tile is drawn and I can redraw the tile with Put as I please. Is there something wrong with the Def Seg and Bsave portion?
Maybe the Dim, or do I need $Static or $Dynamic? Or is it in how I'm loading it here:
----------------------
'Second, seperate program ment to Bload and Put the tile on screen
screen 9
dim GfxTile(400)
def seg = varseg(GfxTile)
Bload "tile.gfx", varptr(GfxTile)
'<<-- It breaks here (or the line above I suppose) with String Space Corrupt.
Put(1,1), GfxTile
____________________
Is it something simple I'm missing? Any help would be greatly appreacted.
I made a game years ago with dozens of tiles like the 20x20 block above and I'm fairly sure I used Bload to load them into the main program.
Thanks in advance,
CJ