-set up cover size limit to 1090 pixel instead of 1024

This commit is contained in:
fix94.1 2012-05-05 10:46:01 +00:00
parent d896cb7436
commit 60e103b1bf
4 changed files with 160 additions and 118 deletions

View File

@ -8,6 +8,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/iosupport.h>
#include <stdarg.h>
#include "wifi_gecko.h"
@ -18,7 +19,7 @@ bool textVideoInit = false;
bool bufferMessages = true;
bool WriteToSD = false;
#include <stdarg.h>
char *tmpfilebuffer = NULL;
static ssize_t __out_write(struct _reent *r __attribute__((unused)), int fd __attribute__((unused)), const char *ptr, size_t len)
{
@ -29,7 +30,6 @@ static ssize_t __out_write(struct _reent *r __attribute__((unused)), int fd __at
usb_sendbuffer(1, ptr, len);
IRQ_Restore(level);
}
return len;
}
@ -67,8 +67,6 @@ static void USBGeckoOutput()
devoptab_list[STD_ERR] = &gecko_out;
}
char *tmpfilebuffer = NULL;
void WriteToFile(char* tmp)
{
if(bufferMessages)
@ -116,13 +114,17 @@ void gprintf( const char *format, ... )
SAFE_FREE(tmp);
}
char ascii(char s) {
if(s < 0x20) return '.';
if(s > 0x7E) return '.';
char ascii(char s)
{
if(s < 0x20)
return '.';
if(s > 0x7E)
return '.';
return s;
}
void ghexdump(void *d, int len) {
void ghexdump(void *d, int len)
{
u8 *data;
int i, off;
data = (u8*)d;
@ -134,20 +136,28 @@ void ghexdump(void *d, int len) {
{
gprintf("%04x ",off);
for(i = 0; i < 16; i++)
if((i+off)>=len) gprintf(" ");
else gprintf("%02x ",data[off+i]);
{
if((i+off)>=len)
gprintf(" ");
else
gprintf("%02x ",data[off+i]);
}
gprintf(" ");
for(i = 0; i < 16; i++)
if((i+off)>=len) gprintf(" ");
else gprintf("%c",ascii(data[off+i]));
{
if((i+off)>=len)
gprintf(" ");
else
gprintf("%c",ascii(data[off+i]));
}
gprintf("\n");
}
}
bool InitGecko()
{
if (geckoinit) return geckoinit;
if (geckoinit)
return geckoinit;
USBGeckoOutput();
@ -163,5 +173,6 @@ bool InitGecko()
usb_flush(EXI_CHANNEL_1);
return true;
}
else return false;
else
return false;
}

View File

@ -2506,7 +2506,7 @@ bool CCoverFlow::fullCoverCached(const char *id)
found = fread(&header, 1, sizeof header, file) == sizeof header
&& header.full != 0 && m_compressTextures == (header.cmpr != 0)
&& header.getWidth() >= 8 && header.getHeight() >= 8
&& header.getWidth() <= 1024 && header.getHeight() <= 1024;
&& header.getWidth() <= 1090 && header.getHeight() <= 1090;
SAFE_CLOSE(file);
}
return found;

View File

@ -10,7 +10,7 @@ using namespace std;
static u32 upperPower(u32 width)
{
u32 i = 8;
u32 maxWidth = 1024;
u32 maxWidth = 1090;
while (i < width && i < maxWidth)
i <<= 1;
return i;
@ -280,7 +280,7 @@ STexture::TexErr STexture::fromPNG(const u8 *buffer, u8 f, Alloc alloc, u32 minM
PNGU_ReleaseImageContext(ctx);
return STexture::TE_ERROR;
}
if (imgProp.imgWidth > 1024 || imgProp.imgHeight > 1024)
if (imgProp.imgWidth > 1090 || imgProp.imgHeight > 1090)
{
PNGU_ReleaseImageContext(ctx);
return STexture::TE_ERROR;

View File

@ -16,7 +16,10 @@ void CMenu::_hideCategorySettings(bool instant)
m_btnMgr.hide(m_categoryBtnPageM, instant);
m_btnMgr.hide(m_categoryBtnPageP, instant);
for(u32 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i)
if (m_categoryLblUser[i] != -1u) m_btnMgr.hide(m_categoryLblUser[i], instant);
{
if(m_categoryLblUser[i] != -1u)
m_btnMgr.hide(m_categoryLblUser[i], instant);
}
for(int i = 0; i < 21; ++i)
{
@ -28,7 +31,11 @@ void CMenu::_hideCategorySettings(bool instant)
void CMenu::_showCategorySettings(void)
{
_setBg(m_categoryBg, m_categoryBg);
for (u32 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i) if (m_categoryLblUser[i] != -1u) m_btnMgr.show(m_categoryLblUser[i]);
for(u32 i = 0; i < ARRAY_SIZE(m_categoryLblUser); ++i)
{
if(m_categoryLblUser[i] != -1u)
m_btnMgr.show(m_categoryLblUser[i]);
}
m_btnMgr.show(m_categoryLblTitle);
m_btnMgr.show(m_categoryBtnBack);
_updateCheckboxes();
@ -49,7 +56,8 @@ void CMenu::_updateCheckboxes(void)
m_btnMgr.hide(m_categoryLblCat[i]);
}
string id;
if (m_current_view != COVERFLOW_EMU) id = m_cf.getId();
if(m_current_view != COVERFLOW_EMU)
id = m_cf.getId();
else
{
dir_discHdr *hdr = m_cf.getHdr();
@ -62,21 +70,28 @@ void CMenu::_updateCheckboxes(void)
id = dirName+tempname;
}
const char *catflags;
if (gameSet) catflags = m_cat.getString("CATEGORIES", id, "").c_str();
else catflags = m_cat.getString(_domainFromView(), "categories", "100000000000000000000").c_str();
if(gameSet)
catflags = m_cat.getString("CATEGORIES", id, "").c_str();
else
catflags = m_cat.getString(_domainFromView(), "categories", "100000000000000000000").c_str();
memset(&m_categories, '0', sizeof(m_categories));
if (strlen(catflags) == sizeof(m_categories)) memcpy(&m_categories, catflags, sizeof(m_categories));
if(strlen(catflags) == sizeof(m_categories))
memcpy(&m_categories, catflags, sizeof(m_categories));
if(C_curPage == 1)
{
int j = 11;
if (m_max_categories < 11) j = m_max_categories;
if(m_max_categories < 11)
j = m_max_categories;
for(int i = 0; i < j; ++i)
{
if (i == 0 && gameSet) continue;
if(i == 0 && gameSet)
continue;
m_btnMgr.show(m_categoryLblCat[i]);
if (catflags[i] == '1') m_categoryBtn[i] = m_categoryBtnCats[i];
else m_categoryBtn[i] = m_categoryBtnCat[i];
if(catflags[i] == '1')
m_categoryBtn[i] = m_categoryBtnCats[i];
else
m_categoryBtn[i] = m_categoryBtnCat[i];
m_btnMgr.show(m_categoryBtn[i]);
}
}
@ -85,8 +100,10 @@ void CMenu::_updateCheckboxes(void)
for(int i = 11; i < m_max_categories; ++i)
{
m_btnMgr.show(m_categoryLblCat[i]);
if (catflags[i] == '1') m_categoryBtn[i] = m_categoryBtnCats[i];
else m_categoryBtn[i] = m_categoryBtnCat[i];
if(catflags[i] == '1')
m_categoryBtn[i] = m_categoryBtnCats[i];
else
m_categoryBtn[i] = m_categoryBtnCat[i];
m_btnMgr.show(m_categoryBtn[i]);
}
}
@ -101,7 +118,8 @@ void CMenu::_CategorySettings(bool fromGameSet)
while(true)
{
_mainLoopCommon();
if (!m_btnMgr.selected(lastBtn)) m_btnMgr.noHover(false);
if(!m_btnMgr.selected(lastBtn))
m_btnMgr.noHover(false);
if(BTN_HOME_PRESSED || BTN_B_PRESSED)
{
m_cat.save();
@ -116,7 +134,8 @@ void CMenu::_CategorySettings(bool fromGameSet)
lastBtn = m_categoryBtnPageM;
m_btnMgr.noHover(true);
C_curPage = C_curPage == 1 ? 2 : 1;
if (BTN_LEFT_PRESSED || BTN_MINUS_PRESSED) m_btnMgr.click(m_categoryBtnPageM);
if(BTN_LEFT_PRESSED || BTN_MINUS_PRESSED)
m_btnMgr.click(m_categoryBtnPageM);
_updateCheckboxes();
}
else if(((BTN_PLUS_PRESSED || BTN_RIGHT_PRESSED) && m_max_categories>11) || (BTN_A_PRESSED && m_btnMgr.selected(m_categoryBtnPageP)))
@ -124,7 +143,8 @@ void CMenu::_CategorySettings(bool fromGameSet)
lastBtn = m_categoryBtnPageP;
m_btnMgr.noHover(true);
C_curPage = C_curPage == 1 ? 2 : 1;
if(BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED) m_btnMgr.click(m_categoryBtnPageP);
if(BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED)
m_btnMgr.click(m_categoryBtnPageP);
_updateCheckboxes();
}
if(BTN_A_PRESSED)
@ -141,13 +161,19 @@ void CMenu::_CategorySettings(bool fromGameSet)
lastBtn = m_categoryBtn[i];
m_btnMgr.noHover(true);
m_categories[i] = m_categories[i] == '1' ? '0' : '1';
if (i == 0 && m_categories[i] == '1') for (int j=1; j<21; ++j) m_categories[j] = '0';
else m_categories[0] = '0';
if(i == 0 && m_categories[i] == '1')
{
for(int j = 1; j < 21; ++j)
m_categories[j] = '0';
}
else
m_categories[0] = '0';
char catflags[22];
memset(&catflags, 0, sizeof(catflags));
memcpy(&catflags, &m_categories, sizeof(m_categories));
string id;
if (m_current_view != COVERFLOW_EMU) id = m_cf.getId();
if(m_current_view != COVERFLOW_EMU)
id = m_cf.getId();
else
{
dir_discHdr *hdr = m_cf.getHdr();
@ -159,9 +185,12 @@ void CMenu::_CategorySettings(bool fromGameSet)
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
id = dirName+tempname;
}
if (string (catflags) == "000000000000000000000") catflags[0] = '1';
if (gameSet) m_cat.setString("CATEGORIES", id, catflags);
else m_cat.setString(_domainFromView(), "categories", catflags);
if(string (catflags) == "000000000000000000000")
catflags[0] = '1';
if(gameSet)
m_cat.setString("CATEGORIES", id, catflags);
else
m_cat.setString(_domainFromView(), "categories", catflags);
_updateCheckboxes();
break;
}
@ -206,7 +235,8 @@ void CMenu::_initCategorySettingsMenu(CMenu::SThemeData &theme)
_setHideAnim(m_categoryBtnPageM, "CATEGORY/PAGE_MINUS", 0, 200, 1.f, 0.f);
_setHideAnim(m_categoryBtnPageP, "CATEGORY/PAGE_PLUS", 0, 200, 1.f, 0.f);
_setHideAnim(m_categoryBtnBack, "CATEGORY/BACK_BTN", 0, 200, 1.f, 0.f);
for (int i = 0; i < 21; ++i) {
for(int i = 0; i < 21; ++i)
{
_setHideAnim(m_categoryBtnCat[i], fmt("CATEGORY/CAT_%i_BTN", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_categoryBtnCats[i], fmt("CATEGORY/CAT_%i_BTNS", i), 0, 0, 1.f, 0.f);
_setHideAnim(m_categoryLblCat[i], fmt("CATEGORY/CAT_%i", i), 0, 0, 1.f, 0.f);
@ -222,8 +252,9 @@ void CMenu::_textCategorySettings(void)
m_btnMgr.setText(m_categoryBtnBack, _t("cd1", L"Back"));
for(int i = 0; i < 21; ++i)
{
if (i == 0) m_btnMgr.setText(m_categoryLblCat[i], _t("dl3", L"All"));
else m_btnMgr.setText(m_categoryLblCat[i], m_cat.getWString("GENERAL", fmt("cat%d",i), wfmt(L"Category %i",i).c_str()));
if(i == 0)
m_btnMgr.setText(m_categoryLblCat[i], _t("dl3", L"All"));
else
m_btnMgr.setText(m_categoryLblCat[i], m_cat.getWString("GENERAL", fmt("cat%d",i), wfmt(L"Category %i",i).c_str()));
}
}