Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
sakya_tg committed Apr 22, 2008
1 parent 80ed610 commit 6717529
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 47 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Version MOD 1.0.1
-----------------
-Added: Support for UTF-8 with intraFont (many thanks to nextos!!!)
Use INTRAFONT_STRING_UTF8 to init intraFont
-Fixed: corrupted graphic using intraFont
-Fixed: MP3/ATRAC3+ playback under kernel 3.xx (sorry, I didn't test it before)
-Fixed: crash in MP3 playback after some seconds
-Fixed: crash in MP3 playback after some seconds (many thanks to Drakon for reporting and testing)
-Fixed: message boxes work now.


Expand Down
2 changes: 1 addition & 1 deletion README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ THANKS
------
InsertWittyName for all the sdk's dialog samples
Brunni for OSLib
Ben Hur for intraFont
BenHur for intraFont
8 changes: 4 additions & 4 deletions dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ void oslDrawDialog()
{
if (dialogType == OSL_DIALOG_MESSAGE || dialogType == OSL_DIALOG_ERROR){
switch(sceUtilityMsgDialogGetStatus()) {
case PSP_UTILITY_DIALOG_INIT:
case PSP_UTILITY_DIALOG_VISIBLE:
sceGuFinish();
sceGuSync(0,0);
Expand All @@ -107,8 +108,7 @@ void oslDrawDialog()
}
}else if (dialogType == OSL_DIALOG_NETCONF){
switch(sceUtilityNetconfGetStatus()){
case PSP_UTILITY_DIALOG_NONE:
break;
case PSP_UTILITY_DIALOG_INIT:
case PSP_UTILITY_DIALOG_VISIBLE:
sceGuFinish();
sceGuSync(0,0);
Expand All @@ -118,11 +118,11 @@ void oslDrawDialog()
break;
case PSP_UTILITY_DIALOG_QUIT:
sceUtilityNetconfShutdownStart();
//dialogType = OSL_DIALOG_NONE;
break;
case PSP_UTILITY_DIALOG_NONE:
case PSP_UTILITY_DIALOG_FINISHED:
break;
}
}
}
}

Expand Down
Binary file modified libosl.a
Binary file not shown.
13 changes: 5 additions & 8 deletions osk.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ void oslInitOsk(char *descStr, char *initialStr, int textLimit, int linesNumber)
void oslDrawOsk()
{
switch(sceUtilityOskGetStatus()){
case PSP_UTILITY_DIALOG_INIT :
break;
case PSP_UTILITY_DIALOG_INIT:
case PSP_UTILITY_DIALOG_VISIBLE :
sceDisplayWaitVblankStart();
sceDisplayWaitVblankStart();
Expand All @@ -74,14 +73,12 @@ void oslDrawOsk()
sceGuStart(GU_DIRECT, osl_list);
oslSetAlpha(OSL_FX_RGBA, 0xff);
break;
case PSP_UTILITY_DIALOG_QUIT :
case PSP_UTILITY_DIALOG_QUIT:
sceUtilityOskShutdownStart();
break;
case PSP_UTILITY_DIALOG_FINISHED :
break;
case PSP_UTILITY_DIALOG_NONE :
default :
break;
case PSP_UTILITY_DIALOG_FINISHED:
case PSP_UTILITY_DIALOG_NONE:
break;
}
}

Expand Down
3 changes: 2 additions & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ echo
echo "-------------------"
echo "OSLib release maker"
echo "-------------------"
echo "Deleting target directory...."
rm -rf $TARGET

echo "Creating directories...."
echo "Creating target directories...."
mkdir -p $TARGET
mkdir -p $TARGET/Install
mkdir -p $TARGET/Install/oslib
Expand Down
2 changes: 1 addition & 1 deletion samples/intraFont/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int main(){
oslDrawString(470, y, "right");
oslIntraFontSetStyle(ltn[8], 1.0f,WHITE,BLACK,0);

y += 50;
y += 40;
oslIntraFontSetStyle(ltn[4], 1.0f,BLACK,WHITE,INTRAFONT_ALIGN_CENTER);
oslSetFont(ltn[4]);
oslDrawString(240, y, "Press X to quit");
Expand Down
7 changes: 4 additions & 3 deletions samples/saveAndLoad/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ int main(){
oslSetFont(font);

while(runningFlag && !osl_quit){
if (!skip){
type = oslGetSaveLoadType();

if (!skip){
oslStartDrawing();
oslDrawImageXY(bkg, 0, 0);

Expand All @@ -109,10 +111,9 @@ int main(){
oslDrawString(30, 150, "Press /\\ to quit.");
oslDrawString(30, 200, message);

type = oslGetSaveLoadType();
if (type != OSL_DIALOG_NONE){
oslDrawSaveLoad();
if (oslGetLoadSaveStatus() == OSL_DIALOG_NONE){
if (oslGetLoadSaveStatus() == PSP_UTILITY_DIALOG_NONE){
if (oslSaveLoadGetResult() == OSL_SAVELOAD_CANCEL)
sprintf(message, "Cancel");
else if (type == OSL_DIALOG_LOAD)
Expand Down
21 changes: 12 additions & 9 deletions saveload.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ int saveLoadType = OSL_DIALOG_NONE;

void oslInitSaveDialog(struct oslSaveLoad *saveData){
memset(&savedata, 0, sizeof(SceUtilitySavedataParam));
memset(&newData, 0, sizeof(PspUtilitySavedataListSaveNewData));

savedata.base.size = sizeof(SceUtilitySavedataParam);

sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, &savedata.base.language);
Expand All @@ -28,8 +30,9 @@ void oslInitSaveDialog(struct oslSaveLoad *saveData){
savedata.overwrite = 1;
savedata.focus = PSP_UTILITY_SAVEDATA_FOCUS_LATEST; // Set initial focus to the newest file (for loading)

//strncpy(savedata.key, key, 16);

#if _PSP_FW_VERSION >= 200
strncpy(savedata.key, key, 16);
#endif
strcpy(savedata.gameName, saveData->gameID); // First part of the save name, game identifier name
strcpy(savedata.saveName, saveData->saveName); // Second part of the save name, save identifier name

Expand Down Expand Up @@ -96,8 +99,9 @@ void oslInitLoadDialog(struct oslSaveLoad *loadData){
savedata.overwrite = 1;
savedata.focus = PSP_UTILITY_SAVEDATA_FOCUS_LATEST; // Set initial focus to the newest file (for loading)

//strncpy(savedata.key, key, 16);

#if _PSP_FW_VERSION >= 200
strncpy(savedata.key, key, 16);
#endif
strcpy(savedata.gameName, loadData->gameID); // First part of the save name, game identifier name
strcpy(savedata.saveName, loadData->saveName); // Second part of the save name, save identifier name

Expand All @@ -107,7 +111,6 @@ void oslInitLoadDialog(struct oslSaveLoad *loadData){
strcpy(savedata.fileName, "DATA.BIN"); // name of the data file

savedata.dataBuf = loadData->data;
//savedata.dataBuf = malloc(sizeof(*data));
savedata.dataBufSize = loadData->dataSize;
savedata.dataSize = loadData->dataSize;

Expand All @@ -118,7 +121,8 @@ void oslInitLoadDialog(struct oslSaveLoad *loadData){

void oslDrawSaveLoad(){
switch(sceUtilitySavedataGetStatus()) {
case PSP_UTILITY_DIALOG_VISIBLE:
case PSP_UTILITY_DIALOG_INIT:
case PSP_UTILITY_DIALOG_VISIBLE:
sceGuFinish();
sceGuSync(0,0);
sceUtilitySavedataUpdate(1);
Expand All @@ -128,10 +132,9 @@ void oslDrawSaveLoad(){
case PSP_UTILITY_DIALOG_QUIT:
sceUtilitySavedataShutdownStart();
break;
case PSP_UTILITY_DIALOG_FINISHED:
break;
case PSP_UTILITY_DIALOG_FINISHED:
case PSP_UTILITY_DIALOG_NONE:
return;
break;
}
}

Expand Down
40 changes: 21 additions & 19 deletions text.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,25 +167,27 @@ The same options will be applied to all intraFonts
INTRAFONT_XXX flags as defined above including flags related to CACHE (ored together)
\code
INTRAFONT_ADVANCE_H default: advance horizontaly from one char to the next
INTRAFONT_ADVANCE_V
INTRAFONT_ALIGN_LEFT default: left-align the text
INTRAFONT_ALIGN_CENTER
INTRAFONT_ALIGN_RIGHT
INTRAFONT_WIDTH_VAR default: variable-width
INTRAFONT_WIDTH_FIX set your custom fixed witdh to 24 pixels: INTRAFONT_WIDTH_FIX | 24
(max is 255, set to 0 to use default fixed width, this width will be scaled by size)
INTRAFONT_ACTIVE assumes the font-texture resides inside sceGuTex already, prevents unecessary reloading -> very small speed-gain
INTRAFONT_STRING_ASCII default: interpret strings as ascii text
INTRAFONT_STRING_SJIS interpret strings as shifted-jis (japanese)
INTRAFONT_CACHE_MED default: 256x256 texture (enough to cache about 100 chars)
INTRAFONT_CACHE_LARGE 512x512 texture(enough to cache all chars of ltn0.pgf or ... or ltn15.pgf or kr0.pgf)
INTRAFONT_CACHE_ASCII try to cache all ASCII chars during fontload (uses less memory and is faster to draw text, but slower to load font)
if it fails: (because the cache is too small) it will automatically switch to chache on-the-fly with a medium texture
if it succeeds: (all chars and shadows fit into chache) it will free some now unneeded memory
INTRAFONT_CACHE_ALL try to cache all chars during fontload (uses less memory and is faster to draw text, but slower to load font)
if it fails: (because the cache is too small) it will automatically switch to chache on-the-fly with a large texture
if it succeeds: (all chars and shadows fit into chache) it will free some now unneeded memory
#define INTRAFONT_ADVANCE_H 0x00000000 //default: advance horizontaly from one char to the next
#define INTRAFONT_ADVANCE_V 0x00000100
#define INTRAFONT_ALIGN_LEFT 0x00000000 //default: left-align the text
#define INTRAFONT_ALIGN_CENTER 0x00000200
#define INTRAFONT_ALIGN_RIGHT 0x00000400
#define INTRAFONT_WIDTH_VAR 0x00000000 //default: variable-width
#define INTRAFONT_WIDTH_FIX 0x00000800 //set your custom fixed witdh to 24 pixels: INTRAFONT_WIDTH_FIX | 24
//(max is 255, set to 0 to use default fixed width, this width will be scaled by size)
#define INTRAFONT_ACTIVE 0x00001000 //assumes the font-texture resides inside sceGuTex already, prevents unecessary reloading -> very small speed-gain
#define INTRAFONT_STRING_ASCII 0x00000000 //default: interpret strings as ascii text
#define INTRAFONT_STRING_SJIS 0x00002000 //interpret strings as shifted-jis (japanese)
#define INTRAFONT_STRING_UTF8 0x00010000 //interpret strings as UTF-8
#define INTRAFONT_CACHE_MED 0x00000000 //default: 256x256 texture (enough to cache about 100 chars)
#define INTRAFONT_CACHE_LARGE 0x00004000 //512x512 texture(enough to cache all chars of ltn0.pgf or ... or ltn15.pgf or kr0.pgf)
#define INTRAFONT_CACHE_ASCII 0x00008000 //try to cache all ASCII chars during fontload (uses less memory and is faster to draw text, but slower to load font)
//if it fails: (because the cache is too small) it will automatically switch to chache on-the-fly with a medium texture
//if it succeeds: (all chars and shadows fit into chache) it will free some now unneeded memory
#define INTRAFONT_CACHE_ALL 0x0000C000 //try to cache all chars during fontload (uses less memory and is faster to draw text, but slower to load font)
//if it fails: (because the cache is too small) it will automatically switch to chache on-the-fly with a large texture
//if it succeeds: (all chars and shadows fit into chache) it will free some now unneeded memory
\endcode
*/
extern int oslIntraFontInit(unsigned short options);
Expand Down

0 comments on commit 6717529

Please sign in to comment.