Beispiel #1
0
int gb_load_sram(VIRTUAL_FILE *fd, byte *buf, int bufsize)
{
	memset(buf, 0, bufsize);
	
	int ramsize = VirtualFileRead(buf, 1, bufsize, fd);
	if(ramsize & 4)
		renderer_set_timer_state(*(int*)(buf+ramsize-4));

	return ramsize;
}
Beispiel #2
0
int load_sram(char * path)
{
	jfile fd = jfopen(env_game_thread, path, JF_MODE_READ, NULL, 0);
	
	/*if(!fd){
		strcat(SavePath, ".gz");
		fd = gzopen(SavePath, "rb");
	}*/
	
	if(!fd)
	{
		return 0;
	}
	
	int ramsize = jfread(env_game_thread, fd, sram_space, 16*0x2000+4);
	jfclose(env_game_thread, fd);
	
	if(ramsize & 4)
	{
		renderer_set_timer_state(*(int*)(sram_space+ramsize-4));
	}
	return ramsize;
}