static void get_gym_info( Gym_Emu::header_t const& h, int length, track_info_t* out ) { if ( 0 != memcmp( h.tag, "GYMX", 4 ) ) return; length = length * 50 / 3; // 1000 / 60 int loop = get_le32( h.loop_start ); if ( loop ) { out->intro_length = loop * 50 / 3; out->loop_length = length - out->intro_length; } else { out->length = length; out->intro_length = length; // make it clear that track is no longer than length out->loop_length = 0; } // more stupidity where the field should have been left blank if ( strcmp( h.song, "Unknown Song" ) ) GME_COPY_FIELD( h, out, song ); if ( strcmp( h.game, "Unknown Game" ) ) GME_COPY_FIELD( h, out, game ); if ( strcmp( h.copyright, "Unknown Publisher" ) ) GME_COPY_FIELD( h, out, copyright ); if ( strcmp( h.dumper, "Unknown Person" ) ) GME_COPY_FIELD( h, out, dumper ); if ( strcmp( h.comment, "Header added by YMAMP" ) ) GME_COPY_FIELD( h, out, comment ); }
static void get_spc_info( Spc_Emu::header_t const& h, byte const* xid6, long xid6_size, track_info_t* out ) { // decode length (can be in text or binary format, sometimes ambiguous ugh) long len_secs = 0; for ( int i = 0; i < 3; i++ ) { unsigned n = h.len_secs [i] - '0'; if ( n > 9 ) { // ignore single-digit text lengths // (except if author field is present and begins at offset 1, ugh) if ( i == 1 && (h.author [0] || !h.author [1]) ) len_secs = 0; break; } len_secs *= 10; len_secs += n; } if ( !len_secs || len_secs > 0x1FFF ) len_secs = get_le16( h.len_secs ); if ( len_secs < 0x1FFF ) out->length = len_secs * 1000; int offset = (h.author [0] < ' ' || unsigned (h.author [0] - '0') <= 9); Gme_File::copy_field_( out->author, &h.author [offset], sizeof h.author - offset ); GME_COPY_FIELD( h, out, song ); GME_COPY_FIELD( h, out, game ); GME_COPY_FIELD( h, out, dumper ); GME_COPY_FIELD( h, out, comment ); if ( xid6_size ) get_spc_xid6( xid6, xid6_size, out ); }
static void copy_nsf_fields( Nsf_Emu::header_t const& h, track_info_t* out ) { GME_COPY_FIELD( h, out, game ); GME_COPY_FIELD( h, out, author ); GME_COPY_FIELD( h, out, copyright ); if ( h.chip_flags ) Gme_File::copy_field_( out->system, "Famicom" ); }
static void copy_gbs_fields( Gbs_Emu::header_t const& h, track_info_t* out ) { GME_COPY_FIELD( h, out, game ); GME_COPY_FIELD( h, out, author ); GME_COPY_FIELD( h, out, copyright ); }