Example #1
0
blargg_err_t Gme_File::load_file( const char* path )
{
	pre_load();
	GME_FILE_READER in;
	RETURN_ERR( in.open( path ) );
	return post_load( load_( in ) );
}
Example #2
0
static void
load_segment64(unsigned long *file_addr, struct phdr64 *phdr, signed long offset,
               int (*pre_load)(void*, long),
               void (*post_load)(void*, long))
{
	unsigned long src = phdr->p_offset + (unsigned long) file_addr;
	unsigned long destaddr;

	destaddr = phdr->p_paddr + offset;

	/* check if we're allowed to copy */
	if (pre_load != NULL) {
		if (pre_load((void*)destaddr, phdr->p_memsz) != 0)
			return;
	}

	/* copy into storage */
	memmove((void*)destaddr, (void*)src, phdr->p_filesz);

	/* clear bss */
	memset((void*)(destaddr + phdr->p_filesz), 0,
	       phdr->p_memsz - phdr->p_filesz);

	if (phdr->p_memsz && post_load != NULL) {
		post_load((void*)destaddr, phdr->p_memsz);
	}
}
Example #3
0
blargg_err_t Gme_Loader::post_load_( blargg_err_t err )
{
	if ( err )
	{
		unload();
		return err;
	}
	
	return post_load();
}
Example #4
0
void startup_load()
{
    load_file();
    if (in_startup_mode == false)
    {
        end_startup();
        post_load();
    }
    else
    {
        menu_activate(0);
        draw_startup(0);
    }
}
Example #5
0
void set_up_apple_events(int argc, char* argv[]) {
	if(argc > 1) {
		if(!load_party(argv[1], univ))
			return;

		if(!finished_init) {
			ae_loading = true;
			overall_mode = MODE_STARTUP;
		} else finish_load_party();
		if(overall_mode != MODE_STARTUP && startup_loaded)
			end_startup();
		if(overall_mode != MODE_STARTUP)
			post_load();
	}
}
Example #6
0
int main(int argc, char* argv[]) {
#if 0
	void debug_oldstructs();
	debug_oldstructs();
#endif
	try{
		init_boe(argc, argv);
		
		if(!get_bool_pref("GameRunBefore"))
			cChoiceDlog("welcome").show();
		else if(get_bool_pref("GiveIntroHint", true))
			tip_of_day();
		set_pref("GameRunBefore", true);
		finished_init = true;
		
		if(ae_loading) {
			finish_load_party();
			post_load();
		}
		
		menu_activate();
		restore_cursor();
		while(!All_Done)
			Handle_One_Event();
		
		close_program();
		return 0;
	} catch(std::exception& x) {
		showFatalError(x.what());
		throw;
	} catch(std::string& x) {
		showFatalError(x);
		throw;
	} catch(...) {
		showFatalError("An unknown error occurred!");
		throw;
	}
}
Example #7
0
blargg_err_t Gme_File::load( Data_Reader& in )
{
	pre_load();
	return post_load( load_( in ) );
}
Example #8
0
blargg_err_t Gme_File::load_mem( void const* in, long size )
{
	pre_load();
	return post_load( load_mem_( (byte const*) in, size ) );
}