Hello,

I am developping a simcity clone for a graphic calculator (casio fx9860g) and i am using a sort of C for it. I have the game running and all but i would like to save a game. Therefor i need to write a map to a file. it is a char array of 50x50 characters so i made this code, but it does not work, what am i doing wrong? I hope someone can and wants to help me because i am getting really sad with this :|

the posted code writes something to a file, but it is not readable, it is like gibberish

Code:
#include "fxlib.h"
#include "stdio.h"
FONTCHARACTER PathName[] = {'\\', '\\', 'f', 'l', 's', '0', '\\', 'C', 'A', 'L', 'C', 'C', 'T', 'Y', '.', 'd', 'a', 't', 0};
extern map_1[50][50];
extern k,l;
int aa;
int bb;
int cc;
char buf[21];
unsigned int key;
int file_size;

int save(){

        char save_data[3000];
        
        Bfile_DeleteFile(PathName);
        Bfile_CreateFile(PathName, 3000);
        
        for(k=0;k<=49;k++){
            for(l=0;l<=49;l++){
                sprintf(save_data, "%c",map_1[l][k]);

            }
        }
        
        
        aa = Bfile_OpenFile(PathName, _OPENMODE_WRITE);
            if (aa < 0){
                PopUpWin(2);
                PrintMini(12, 14, (unsigned char *)"Cannot Save Game", MINI_OVER);
                PrintMini(12, 21, (unsigned char *)"Probably Not Enough STOR MEM", MINI_OVER);
                Bdisp_PutDisp_DD();
                Sleep(2000);
                Bfile_CloseFile(aa);
            }
            if (aa >= 0){
                Bfile_WriteFile(aa, &save_data, 3000);
                PopUpWin(1);
                PrintMini(44, 25, (unsigned char *)"GAME SAVED", MINI_OVER);
                Bdisp_PutDisp_DD();
                Sleep(2000);
                Bfile_CloseFile(aa);
            }
}



int load(){
char game_data[3000];
            
                bb = Bfile_OpenFile(PathName, _OPENMODE_READ);
                if (bb < 0)
                {
                    PopUpWin(2);
                    PrintMini(12, 14, (unsigned char *)"ERROR: Cannot open file", MINI_OVER);
                    PrintMini(12, 21, (unsigned char *)"No data loaded", MINI_OVER);
                    Bdisp_PutDisp_DD();
                    Sleep(1000);
                    return 0;
                }
                file_size = Bfile_GetFileSize(bb);
                memset(game_data, 0, file_size);
                cc = Bfile_ReadFile(bb, &game_data, file_size, 0);
                if (cc >= 0)
                {
                    
                    PopUpWin(2);
                    PrintMini(24, 14, (unsigned char *)"Saved Game Loaded", MINI_OVER);
                    sprintf(buf, "%d bytes read", MINI_OVER);
                    PrintMini(35, 21, (unsigned char *)buf, MINI_OVER);
                    for(k=0;k<=49;k++){
                        for(l=0;l<=49;l++){
                            sscanf(game_data, "%s",&map_1[l][k]);
            
                        }
                    }


                    Bdisp_PutDisp_DD();
                    Sleep(2000);
                    Bfile_CloseFile(bb);
                }
                if (cc < 0)
                {
                    Bdisp_AllClr_VRAM();
                    PopUpWin(2);
                    PrintMini(12, 14, (unsigned char *)"File Is Corrupted", MINI_OVER);
                    PrintMini(12, 21, (unsigned char *)".", MINI_OVER);
                    Bdisp_PutDisp_DD();
                    Sleep(2000);
                    Bfile_CloseFile(bb);
                    return 0;
                    
                }
}