gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > gba __attribute__((section (".ewram"),long_call))

#177118 - blessingta@hotmail.co.uk - Tue Dec 13, 2011 2:47 pm

My gba project crashes when I use my game_save function. Is starts to play a really horrible sound/noise when I press anything after I have loaded it into my game.

Is this the issue of this function in headerfiles (it works when in test project):
__attribute__((section (".ewram"),long_call));


Code:
#ifndef  GAMESAVES_FFF_H
#define GAMESAVES_FFF_H
 //VRAM = video ram
#include <gba_console.h>
#include <gba_interrupt.h>
#include <gba_systemcalls.h>
#include <gba_video.h>
#include <gba_input.h>
#include <stdio.h>

 extern __attribute__((section (".ewram"),long_call));
 extern void bytecpy(void *  in_dst, const void * in_src, unsigned int length) ;


typedef struct SaveData
{ short shigh_score;
} SaveData;

extern SaveData data;

#endif

#177119 - blessingta@hotmail.co.uk - Tue Dec 13, 2011 3:02 pm

could it be that its visual boy advance since the game randomly load properly and then goes crazy the next