set "boardout.txt" to "fwrite_open" set "board_y" to -1 : "incy" if "board_y" > 23 "fin" set "board_x" to -1 inc "board_y" by 1 : "incx" if "board_x" > 78 "incy" inc "board_x" by 1 set "fwrite" to "board_color" set "fwrite" to "board_char" put cff Solid p?? at "board_x" "board_y" .This above line is just to ensure that every tile is read goto "incx" : "fin" set "" to "fwrite_open"
And I read the results in, after I was sure the file was closed, with this C++ code (yes, the matrix is properly declared to 80x25 and the file opened already):
struct colorchar{//just contains ch (the character represented) and col (the color of that character)
char ch;
char col;
};
apmatrix<colorchar> getFile(ifstream &fil, apmatrix<colorchar> &mat){
//reads in a frame from file with pretty simple nested loops:
for (int x=0;x<mat.numrows(); x++)
for (int y=0; y<mat.numcols(); y++)
{
fil>>mat[x][y].col;
fil>>mat[x][y].ch;
}
return mat;
}When I printed it out, though, the spacing was off and lines were shifted all over the place. I suspect this has something to do with C++ interpreting the chars '32' and possibly '0' in the file as whitespace. So, I tried adding to the MZX code:
.These lines replace the block of two "set 'fwrite'" lines in the original code. if "board_color" = 0 "writebig" if "board_color" = 32 "writebig" set "fwrite" to "board_color" if "board_char" = 32 "writezero" set "fwrite" to "board_char" : "conb" .And these lines go at the bottom: end : "writebig" set "fwrite" to 77 .254, the boulder char, is fine for test purposes: set "fwrite" to 254 goto "conb" : "writezero" set "fwrite" to 254 goto "conb"
The output still looks similarly skewed. Anyone know of some way to properly fix this?
Thanks...
EDIT: Whoops... left in a potentially confusing line.

Help







