Revision | 150 (tree) |
---|---|
Time | 2008-08-29 14:55:20 |
Author | bird_may_nike |
vplを増やす
@@ -31,7 +31,7 @@ | ||
31 | 31 | extern RECT titleDstRectH; // pg.c |
32 | 32 | extern RECT titleDstRectV; // pg.c |
33 | 33 | |
34 | -char* ver = "0.8.2"; | |
34 | +char* ver = "0.8.3"; | |
35 | 35 | S_2CH s2ch; |
36 | 36 | char keyWords[128]; |
37 | 37 |
@@ -531,11 +531,13 @@ | ||
531 | 531 | return -1; |
532 | 532 | } |
533 | 533 | *q = '\0'; |
534 | + /* | |
534 | 535 | pgPrintMenuBar(line); |
535 | 536 | pgWaitVn(10); |
536 | 537 | pgCopyMenuBar(); |
537 | 538 | sceDisplayWaitVblankStart(); |
538 | 539 | framebuffer = sceGuSwapBuffers(); |
540 | + */ | |
539 | 541 | if (strstr(line, "Content-Length:")) |
540 | 542 | { |
541 | 543 | sscanf(line, "Content-Length: %d", &contentLength); |
@@ -16,7 +16,8 @@ | ||
16 | 16 | extern unsigned short winPixels[BUF_WIDTH*BUF_HEIGHT*2]; // pg.c |
17 | 17 | extern int preLine; // psp2chRes.c |
18 | 18 | |
19 | -#define MEM_SIZE 8*1024*1024 | |
19 | +#define MEM_SIZE 14*1024*1024 | |
20 | +#define EX_MEMORRY (0x0a000000) | |
20 | 21 | /***************************** |
21 | 22 | 矩形範囲を拡大縮小 |
22 | 23 | *****************************/ |
@@ -369,11 +370,6 @@ | ||
369 | 370 | unsigned char header[4]; |
370 | 371 | SceUID vpl; |
371 | 372 | |
372 | - vpl = sceKernelCreateVpl("ImageVpl", PSP_MEMORY_PARTITION_USER, 0, MEM_SIZE + 256, NULL); | |
373 | - if (vpl < 0) | |
374 | - { | |
375 | - return -1; | |
376 | - } | |
377 | 373 | infile = fopen(fname, "rb" ); |
378 | 374 | if (!infile) |
379 | 375 | { |
@@ -395,11 +391,16 @@ | ||
395 | 391 | // Gu転送のため1行を16バイト境界にそろえる |
396 | 392 | width = (cinfo.output_width + 15) & 0xFFFFFFF0; |
397 | 393 | height = cinfo.output_height; |
394 | + vpl = sceKernelCreateVpl("ImageVpl", PSP_MEMORY_PARTITION_USER, 0, MEM_SIZE + 256, NULL); | |
395 | + if (vpl < 0) | |
396 | + { | |
397 | + return -3; | |
398 | + } | |
398 | 399 | if (sceKernelAllocateVpl(vpl, sizeof(JSAMPROW) * height, &mem, NULL) < 0) |
399 | 400 | { |
400 | 401 | sceKernelDeleteVpl(vpl); |
401 | 402 | fclose(infile); |
402 | - return -3; | |
403 | + return -4; | |
403 | 404 | } |
404 | 405 | img = mem; |
405 | 406 | if (sceKernelAllocateVpl(vpl, sizeof(JSAMPLE) * 3 * width, &mem, NULL) < 0) |
@@ -406,7 +407,7 @@ | ||
406 | 407 | { |
407 | 408 | sceKernelDeleteVpl(vpl); |
408 | 409 | fclose(infile); |
409 | - return -4; | |
410 | + return -5; | |
410 | 411 | } |
411 | 412 | buf = mem; |
412 | 413 | if (sceKernelAllocateVpl(vpl, sizeof(JSAMPLE) * 4 * width * height + 16, &mem, NULL) < 0) |
@@ -413,7 +414,7 @@ | ||
413 | 414 | { |
414 | 415 | sceKernelDeleteVpl(vpl); |
415 | 416 | fclose(infile); |
416 | - return -5; | |
417 | + return -6; | |
417 | 418 | } |
418 | 419 | imgbuf = (JSAMPROW)(((int)mem + 15) & 0xFFFFFFF0); |
419 | 420 | tmp = imgbuf; |
@@ -456,7 +457,7 @@ | ||
456 | 457 | jpeg_destroy_decompress(&cinfo); |
457 | 458 | sceKernelDeleteVpl(vpl); |
458 | 459 | fclose(infile); |
459 | - return -6; | |
460 | + return -7; | |
460 | 461 | } |
461 | 462 | jpeg_finish_decompress(&cinfo); |
462 | 463 | jpeg_destroy_decompress(&cinfo); |
@@ -485,11 +486,6 @@ | ||
485 | 486 | unsigned char header[8]; |
486 | 487 | SceUID vpl; |
487 | 488 | |
488 | - vpl = sceKernelCreateVpl("ImageVpl", PSP_MEMORY_PARTITION_USER, 0, MEM_SIZE + 256, NULL); | |
489 | - if (vpl < 0) | |
490 | - { | |
491 | - return -1; | |
492 | - } | |
493 | 489 | infile = fopen(fname, "rb"); |
494 | 490 | if (!infile) |
495 | 491 | { |
@@ -540,6 +536,11 @@ | ||
540 | 536 | png_read_update_info(png_ptr, info_ptr); |
541 | 537 | // Gu転送のため1行を16バイト境界にそろえる |
542 | 538 | width2 = (width + 15) & 0xFFFFFFF0; |
539 | + vpl = sceKernelCreateVpl("ImageVpl", PSP_MEMORY_PARTITION_USER, 0, MEM_SIZE + 256, NULL); | |
540 | + if (vpl < 0) | |
541 | + { | |
542 | + return -2; | |
543 | + } | |
543 | 544 | if (sceKernelAllocateVpl(vpl, height * sizeof(png_bytep), &mem, NULL) < 0) |
544 | 545 | { |
545 | 546 | sceKernelDeleteVpl(vpl); |
@@ -581,11 +582,6 @@ | ||
581 | 582 | void* mem; |
582 | 583 | SceUID vpl; |
583 | 584 | |
584 | - vpl = sceKernelCreateVpl("ImageVpl", PSP_MEMORY_PARTITION_USER, 0, MEM_SIZE + 256, NULL); | |
585 | - if (vpl < 0) | |
586 | - { | |
587 | - return -1; | |
588 | - } | |
589 | 585 | infile = fopen(fname, "rb" ); |
590 | 586 | if (!infile) |
591 | 587 | { |
@@ -625,6 +621,11 @@ | ||
625 | 621 | width = (bi.biWidth + 15) & 0xFFFFFFF0; |
626 | 622 | len = bi.biWidth * bi.biBitCount / 8; |
627 | 623 | len += (4 - (len & 3)) & 3; |
624 | + vpl = sceKernelCreateVpl("ImageVpl", PSP_MEMORY_PARTITION_USER, 0, MEM_SIZE + 256, NULL); | |
625 | + if (vpl < 0) | |
626 | + { | |
627 | + return -2; | |
628 | + } | |
628 | 629 | if (sceKernelAllocateVpl(vpl, sizeof(unsigned char*) * height, &mem, NULL) < 0) |
629 | 630 | { |
630 | 631 | sceKernelDeleteVpl(vpl); |
@@ -730,11 +731,6 @@ | ||
730 | 731 | void* mem; |
731 | 732 | SceUID vpl; |
732 | 733 | |
733 | - vpl = sceKernelCreateVpl("ImageVpl", PSP_MEMORY_PARTITION_USER, 0, MEM_SIZE + 256, NULL); | |
734 | - if (vpl < 0) | |
735 | - { | |
736 | - return -1; | |
737 | - } | |
738 | 734 | if ((GifFile = DGifOpenFileName(fname)) == NULL) |
739 | 735 | { |
740 | 736 | return -1; |
@@ -742,6 +738,11 @@ | ||
742 | 738 | Size = GifFile->SWidth * sizeof(GifPixelType);/* Size in bytes one row.*/ |
743 | 739 | // Gu転送のため1行を16バイト境界にそろえる |
744 | 740 | width2 = (GifFile->SWidth + 15) & 0xFFFFFFF0; |
741 | + vpl = sceKernelCreateVpl("ImageVpl", PSP_MEMORY_PARTITION_USER, 0, MEM_SIZE + 256, NULL); | |
742 | + if (vpl < 0) | |
743 | + { | |
744 | + return -2; | |
745 | + } | |
745 | 746 | if (sceKernelAllocateVpl(vpl, GifFile->SHeight * sizeof(GifRowType *), &mem, NULL) < 0) |
746 | 747 | { |
747 | 748 | sceKernelDeleteVpl(vpl); |
@@ -5,7 +5,7 @@ | ||
5 | 5 | |
6 | 6 | extern S_2CH s2ch; |
7 | 7 | |
8 | -#define MEM_SIZE 8*1024*1024 | |
8 | +#define MEM_SIZE 14*1024*1024 | |
9 | 9 | void pspShowBrowser(char *url, char *dldir) |
10 | 10 | { |
11 | 11 | int done=0; |