Skip to content

Commit

Permalink
v0.964, 2019/01/11
Browse files Browse the repository at this point in the history
  • Loading branch information
sp193 authored and AKuHAK committed Feb 8, 2022
1 parent 18619ad commit 6157354
Show file tree
Hide file tree
Showing 9 changed files with 321 additions and 123 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ LOG_MESSAGES ?= 1

EE_HDDCHECKER_BIN = HDDChecker.elf
EE_FSCK_BIN = fsck.elf
EE_IOP_OBJS = SIO2MAN_irx.o PADMAN_irx.o DEV9_irx.o ATAD_irx.o IOMANX_irx.o FILEXIO_irx.o HDD_irx.o PFS_irx.o FSCK_irx.o
EE_IOP_OBJS = SIO2MAN_irx.o PADMAN_irx.o POWEROFF_irx.o DEV9_irx.o ATAD_irx.o IOMANX_irx.o FILEXIO_irx.o HDD_irx.o PFS_irx.o FSCK_irx.o
EE_RES_OBJS = background.o buttons.o
EE_OBJS = main.o iop.o pad.o UI.o menu.o system.o graphics.o font.o $(EE_IOP_OBJS) $(EE_RES_OBJS)

EE_INCS := -I$(PS2SDK)/ports/include -I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include -I.
EE_LDFLAGS := -L$(PS2SDK)/ports/lib -L$(PS2SDK)/ee/lib -s
EE_LIBS := -lpng -lz -lm -lfreetype -lhdd -lpatches -lfileXio -lpadx -lgs -lc -lkernel
EE_LIBS := -lpng -lz -lm -lfreetype -lhdd -lpatches -lpoweroff -lfileXio -lpadx -lgs -lc -lkernel
EE_GPVAL = -G8192
EE_CFLAGS += -mgpopt $(EE_GPVAL)

Expand Down Expand Up @@ -86,6 +86,9 @@ IOMANX_irx.c: $(PS2SDK)/iop/irx/iomanX.irx
FILEXIO_irx.c: $(PS2SDK)/iop/irx/fileXio.irx
bin2c $(PS2SDK)/iop/irx/fileXio.irx FILEXIO_irx.c FILEXIO_irx

POWEROFF_irx.c: $(PS2SDK)/iop/irx/poweroff.irx
bin2c $(PS2SDK)/iop/irx/poweroff.irx POWEROFF_irx.c POWEROFF_irx

DEV9_irx.c: $(PS2SDK)/iop/irx/ps2dev9.irx
bin2c $(PS2SDK)/iop/irx/ps2dev9.irx DEV9_irx.c DEV9_irx

Expand Down
23 changes: 16 additions & 7 deletions UI.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static void BreakLongLanguageString(char *str)

if (wchar != '\n')
{
width = FontGetGlyphWidth(wchar);
width = FontGetGlyphWidth(&UIDrawGlobal, wchar);

// To wrap long lines, replace the last whitespace with a newline character
if(ScreenLineLenPx + width >= LineMaxPx)
Expand Down Expand Up @@ -487,7 +487,7 @@ static int LoadFontIntoBuffer(struct UIDrawGlobal *gsGlobal, const char *path)
size = ftell(file);
rewind(file);

if((buffer = malloc(size)) != NULL)
if((buffer = memalign(64, size)) != NULL)
{
if(fread(buffer, 1, size, file) == size)
{
Expand Down Expand Up @@ -566,16 +566,25 @@ static int InitFontWithBuffer(void)
if(result != 0)
printf("InitFont(%s) error: %d\n", pFontFilePath, result);
free(pFontFilePath);
} else
result = 0;
} else {
result = FontInitWithBuffer(&UIDrawGlobal, gFontBuffer, gFontBufferSize);
}

return result;
}

int ReinitializeUI(void)
{
FontDeinit();
return((gFontBuffer == NULL) ? InitFont() : InitFontWithBuffer());
if(gFontBuffer == NULL)
{
FontDeinit();
return InitFont();
}
else
{
//No need to reinitialize font when it is loaded into memory.
return 0;
}
}

int InitializeUI(int BufferFont)
Expand Down Expand Up @@ -1403,7 +1412,7 @@ int UIExecMenu(struct UIMenu *FirstMenu, short int SelectedItem, struct UIMenu *
if(item->enumeration.selectedIndex > 0)
item->enumeration.selectedIndex--;
else
item->enumeration.selectedIndex = item->enumeration.count;
item->enumeration.selectedIndex = item->enumeration.count - 1;
break;
}
}
Expand Down
Loading

0 comments on commit 6157354

Please sign in to comment.