示例#1
0
文件: fs.c 项目: ArthurJam/loadiine
/* *****************************************************************************
 * Searching for RPL to load
 * ****************************************************************************/
static int CheckAndLoadRPL(const char *rpl) {
    // If we are in Smash Bros app
    if (GAME_LAUNCHED == 0)
        return 0;

    // Look for rpl name in our table
    s_rpx_rpl *rpl_entry = (s_rpx_rpl*)(RPX_RPL_ARRAY);

    do
    {
        if(rpl_entry->is_rpx)
            continue;

        int len = strlen(rpl);
        int len2 = strlen(rpl_entry->name);
        if ((len != len2) && (len != (len2 - 4))) {
            continue;
        }

        // compare name string case insensitive and without ".rpl" extension
        if (strncasecmp(rpl_entry->name, rpl, len) == 0)
            return LoadRPLToMemory(rpl_entry);
    }
    while((rpl_entry = rpl_entry->next) != 0);

    return 0;
}
示例#2
0
文件: fs.c 项目: Joonie86/loadiine
/* *****************************************************************************
 * Searching for RPL to load
 * ****************************************************************************/
static int CheckAndLoadRPL(const char *rpl) {
    // If we are in Smash Bros app
    if (GAME_LAUNCHED == 0)
        return 0;

    // Look for rpl name in our table
    s_rpx_rpl *rpl_entry = (s_rpx_rpl*)(RPX_RPL_ARRAY);

    do
    {
        if(rpl_entry->is_rpx)
            continue;

        int len = strlen(rpl);
        int len2 = strlen(rpl_entry->name);
        if ((len != len2) && (len != (len2 - 4))) {
            continue;
        }

        // compare name string case insensitive and without ".rpl" extension
        int found = 1;
        for (int x = 0; x < len; x++)
        {
            if (toupper(rpl_entry->name[x]) != toupper(rpl[x]))
            {
                found = 0;
                break;
            }
        }

        if (found)
            return LoadRPLToMemory(rpl_entry);
    }
    while((rpl_entry = rpl_entry->next) != 0);

    return 0;
}