peanut_gb.h
const char* gb_get_rom_name(struct gb_s* gb, char *title_str)
{
	uint_fast16_t title_loc = 0x134;
	/* End of title may be 0x13E for newer games. */
	const uint_fast16_t title_end = 0x143;
	const char* title_start = title_str;

	for(; title_loc <= title_end; title_loc++)
	{
		const char title_char = gb->gb_rom_read(gb, title_loc);

		if(title_char >= ' ' && title_char <= '_')
		{
			*title_str = title_char;
			title_str++;
		}
		else
			break;
	}

	*title_str = '\0';
	return title_start;
}
/**
 * Returns the title of ROM.
 *
 * \param gb		Initialised context.
 * \param title_str	Allocated string at least 16 characters.
 * \returns		Pointer to start of string, null terminated.
 */
Returns the title of ROM.
\param gb            Initialised context.
\param title_str     Allocated string at least 16 characters.
\returns             Pointer to start of string, null terminated.
Returns the title of ROM . \ param gb Initialised context . \ param title_str Allocated string at least 16 characters . \ returns Pointer to start of string null terminated .
const char* gb_get_rom_name(struct gb_s* gb, char *title_str)
{
	uint_fast16_t title_loc = 0x134;
	const uint_fast16_t title_end = 0x143;
	const char* title_start = title_str;
	for(; title_loc <= title_end; title_loc++)
	{
		const char title_char = gb->gb_rom_read(gb, title_loc);
		if(title_char >= ' ' && title_char <= '_')
		{
			*title_str = title_char;
			title_str++;
		}
		else
			break;
	}
	*title_str = '\0';
	return title_start;
}
const char * gb_get_rom_name ( struct gb_s * gb , char * title_str ) { uint_fast16_t title_loc = 0x134 ; const uint_fast16_t title_end = 0x143 ; const char * title_start = title_str ; for ( ; title_loc <= title_end ; title_loc ++ ) { const char title_char = gb -> gb_rom_read ( gb , title_loc ) ; if ( title_char >= ' ' && title_char <= ' ' ) { * title_str = title_char ; title_str ++ ; } else break ; } * title_str = ' \0 ' ; return title_start ; }
Returns the title of ROM.
Returns the title of ROM .
/* End of title may be 0x13E for newer games. */