Seite 339 von 340 ErsteErste ... 239 289 329 330 331 332 333 334 335 336 337 338 339 340 LetzteLetzte
Zeige Ergebnis 10.141 bis 10.170 von 10174

C/C++ Programming Help Thread

This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Nvm got it fixed...

  
  1. #10141
    QJ Gamer Green
    Points: 3.008, Level: 33
    Level completed: 72%, Points required for next Level: 42
    Overall activity: 0%

    Registriert seit
    May 2008
    Beiträge
    96
    Points
    3.008
    Level
    33
    Downloads
    0
    Uploads
    0

    Standard

    Nvm got it fixed


    Geändert von Predricted (07-26-2010 um 07:10 PM Uhr)

  2. #10142
    QJ Gamer Green
    Points: 2.521, Level: 30
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Mar 2009
    Beiträge
    48
    Points
    2.521
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard Zip-support

    Hi!

    I would like to add a zip-support for my homebrew. Would anyone be able to give me a clear tutorial how to do this. I know that xreader uses unzip.h file to provide the zip-support. I might be able to figure this out by studying the source, but your help would be much appreciated.

    First, I need to open a zip file from a specific folder. Then check whether an image file exist. If it does exist, I need to store the image using oslLoadImageFilePNG command. Finally, I am going to draw the image with oslDrawImage command.

    I know how to draw the image and store an image that has not been zipped. But how do I get to the point to store the image from the zip?

  3. #10143
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    batanen i would use the unzip lib i believe it comes with its own example code

  4. #10144
    QJ Gamer Green
    Points: 2.521, Level: 30
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Mar 2009
    Beiträge
    48
    Points
    2.521
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    Ok. Yes, Ruka had done some zip library. I quickly glanced it but I don't think it fits my purposes. I guess I will leave zip support out; it's not that necessary and I don't have much free time to do additional features. It will just take some time to move those 6000 images... Though, I know the kind of zip support I am looking for is possible (Wagic and Xreader has it integrated).

  5. #10145
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    What kind do you need? also i believe there is more then one unzip lib

  6. #10146
    QJ Gamer Green
    Points: 2.521, Level: 30
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Mar 2009
    Beiträge
    48
    Points
    2.521
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    Thanks for the help. I think I described the situation earlier, but here it's a little more clearly:
    - There exist a zip file that has 6000 images.
    - I need to open that zip file temporarily.
    - Then I want to locate a specific image (named like 4A35) from the zip-file.
    - If it does exist, I want to store that image using oslLoadImageFilePNG.
    - Then I'm going to close the zip file.
    (- Finally, I am going to draw the image with olsDrawImage.)

    I would have liked to have a working example code how to accomplish this.

    Yes, you're right. There exist more than one zip library. Xreader uses something different; and I am sure it would have fit my purposes. Unfortunately, I could not find a direct example for my purpose from the file nor internet; and I did not have enough time to study the sources and looking into library dependies. But that's ok. For now, I decided to drop that feature out. It will take 10-15 minutes to transfer all the files to PSP, but well...

  7. #10147
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    Zitat Zitat von batanen Beitrag anzeigen
    Thanks for the help. I think I described the situation earlier, but here it's a little more clearly:
    - There exist a zip file that has 6000 images.
    - I need to open that zip file temporarily.
    - Then I want to locate a specific image (named like 4A35) from the zip-file.
    - If it does exist, I want to store that image using oslLoadImageFilePNG.
    - Then I'm going to close the zip file.
    (- Finally, I am going to draw the image with olsDrawImage.)

    I would have liked to have a working example code how to accomplish this.

    Yes, you're right. There exist more than one zip library. Xreader uses something different; and I am sure it would have fit my purposes. Unfortunately, I could not find a direct example for my purpose from the file nor internet; and I did not have enough time to study the sources and looking into library dependies. But that's ok. For now, I decided to drop that feature out. It will take 10-15 minutes to transfer all the files to PSP, but well...
    if im not mistaken you have to take the file out of the zip file and save it to the mem stick before you can use it in osl cause its gonna read the image from the mem stick

    i get what your saying it doesnt seem that hard to do its just the zipped part that seems like its throwing you off why not just take the image out the zip on your comp and just putting it with your app?

  8. #10148
    QJ Gamer Green
    Points: 2.521, Level: 30
    Level completed: 48%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Mar 2009
    Beiträge
    48
    Points
    2.521
    Level
    30
    Downloads
    0
    Uploads
    0

    Standard

    It may be true that Oslib does not support the idea I had in mind. Probably I would have needed to use another method that is capable of showing an image from a buffer. That can be done somehow (just not with Oslib), I am sure of it.

    For simplicity, I decided to release PSPedict V0.6 without the zip support; all images are unzipped.

  9. #10149
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    Zitat Zitat von batanen Beitrag anzeigen
    It may be true that Oslib does not support the idea I had in mind. Probably I would have needed to use another method that is capable of showing an image from a buffer. That can be done somehow (just not with Oslib), I am sure of it.

    For simplicity, I decided to release PSPedict V0.6 without the zip support; all images are unzipped.
    osl can show an image from a buffer as shown in the homebrew sorter app. it uses this function

    Code:
    oslAddVirtualFileList
    then you should be able to use images from a buffer. but i would take a look at the homebrew sorter app's source as it show everything you need to do

  10. #10150
    QJ Gamer Green
    Points: 5.956, Level: 50
    Level completed: 3%, Points required for next Level: 194
    Overall activity: 0%

    Registriert seit
    Mar 2010
    Ort
    America
    Beiträge
    402
    Points
    5.956
    Level
    50
    My Mood
    Amused
    Downloads
    11
    Uploads
    3

    Standard

    Need help with a plugin.
    I am working on Andromida R5 and i want a function to show your WLAN is on.
    but it wont compile?

    I have everything typed right even have #include <pspwlan.h>?
    (ALSO - printf is defined as 'pspDebugScreenKprintf')

    EXAMPLE.

    printf("WLAN: ");
    if (sceWlanGetSwitchState() == 0)
    {
    printf("OFF");
    }else if (sceWlanGetSwitchState() == 1)
    {
    printf("ON");
    }
    Geändert von CODE_R3D (11-09-2010 um 04:56 AM Uhr)

  11. #10151
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    Code:
    printf("WLAN: %s", sceWlanGetSwitchState() == 0 ? "OFF" : "ON");
    Spoiler for the harsh truth:
    Learn proper C programming and stop wasting your time on a plugin that doesn't really do anything useful.
    Geändert von mootjeuh (09-29-2010 um 06:21 AM Uhr)
    That epic dude.

  12. #10152
    QJ Gamer Green
    Points: 5.956, Level: 50
    Level completed: 3%, Points required for next Level: 194
    Overall activity: 0%

    Registriert seit
    Mar 2010
    Ort
    America
    Beiträge
    402
    Points
    5.956
    Level
    50
    My Mood
    Amused
    Downloads
    11
    Uploads
    3

    Standard

    thanks for the help.

  13. #10153
    Developer
    Points: 5.359, Level: 47
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Norway
    Beiträge
    384
    Points
    5.359
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Hi,

    I'm trying to compile a program that uses the boost::shared_ptr class. I'm compiling using MINPSPW and include boost/shared_ptr.hpp.

    I get the following error:
    (.text+0xe80): undefined reference to `boost::throw_exception(s td::exception const&)'

    Does anyone have any idea how to fix this? I'm guessing I probably need to add a library to my makefile, but I can't figure out which.

    Any advice would be much appreciated.


  14. #10154
    QJ Gamer Green
    Points: 2.003, Level: 27
    Level completed: 2%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Jun 2009
    Beiträge
    61
    Points
    2.003
    Level
    27
    Downloads
    0
    Uploads
    0

    Standard

    Hi i was looking for some way to view the FW/CFW versio (not kernel version(like 6xx) but the real name like 5.00m33) Could someone help me please?

  15. #10155
    Points: 400, Level: 7
    Level completed: 50%, Points required for next Level: 50
    Overall activity: 0%

    Registriert seit
    May 2011
    Ort
    usa
    Beiträge
    3
    Points
    400
    Level
    7
    Downloads
    0
    Uploads
    0

    Standard

    I think I have this stupid problem , I've been searching for hours and hours to figure out the solution .. and finally I'm just gonna write it here .. with hope to find a solution :

    when I debug my psp program using Code::Blocks and Minimalist PSPSDK, the following error comes :
    Code:
    main.c|| undefined reference to `initGraphics'|
    main.c|| undefined reference to `loadImage'|
    main.c|| undefined reference to `blitAlphaImageToScreen'|
    main.c|| undefined reference to `flipScreen'|
    ||=== Build finished: 4 errors, 0 warnings ===|
    my source code is :

    Code:
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspcallbacks.h>
    #include "graphics.h"
    
    #define printf pspDebugScreenPrintf
    
    PSP_MODULE_INFO("Hello World", 0, 1, 1);
    
    int main()
    {
        SetupCallbacks();
    	initGraphics();
    	Image* background = loadImage("ourImage.png");
        blitAlphaImageToScreen(0,0,480,272,background,0,0);
        flipScreen();
    	sceKernelSleepThread();
    	return 0;
    }
    and my makefile is :

    Code:
    TARGET = image
    OBJS = main.o graphics.o framebuffer.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    BUILD_PRX=1
    
    LIBS = -lpspgu -lpng -lz -lm
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = Image Example
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    the graphics.h and the other files that comes with it (lesson04.zip) are in the right folder , and I think everything is right , but I don't know nothing about that problem and where it comes from .

    if there is no hope in solving this problem , is there a better graphics library
    than this one (graphics.h) ??

  16. #10156
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    if thats your whole code then you should also get an error for the "SetupCallbacks();" thats one problem
    another is you didnt follow the tut close enough (if you are talking about lesson 4 from the tuts on psp-programming.com)

    the main.c should look like this (from that tut):

    Code:
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include "graphics.h" 
    
    #define printf pspDebugScreenPrintf
    #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) 
    
    PSP_MODULE_INFO("Image Display Program", 0, 1, 1); 
    
    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
    
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
    
              sceKernelSleepThreadCB();
    
              return 0;
    }
    
    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
              int thid = 0;
    
              thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
              if(thid >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    } 
    
    int main() {
              char buffer[200];
              Image* ourImage; 
              pspDebugScreenInit();
              SetupCallbacks();
              initGraphics(); 
    
              sprintf(buffer, "ourImage.png");
              ourImage = loadImage(buffer); 
    
              if (!ourImage) {
                        //Image load failed
                        printf("Image load failed!\n");
              } else { 
                        int x = 0;
                        int y = 0;
                        sceDisplayWaitVblankStart(); 
                        while (x < 480) {
                                  while (y < 272) { 
                                            blitAlphaImageToScreen(0 ,0 ,32 , 32, ourImage, x, y);
                                            y += 32;
                                  } 
                                  x += 32;
                                  y = 0;
                        } 
                        flipScreen();
              } 
              sceKernelSleepThread();
              return 0;
    }
    and of course the Makefile:
    Code:
    TARGET = hello
    OBJS = main.o graphics.o framebuffer.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpng -lz -lm
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = Image Example
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    In the main.c you can see they are very different. but my question is do you have the graphics.c, .h, and the framebuffer.c, .h in the same folder as your source with the main.c? And what tut are you following?

  17. #10157
    Points: 400, Level: 7
    Level completed: 50%, Points required for next Level: 50
    Overall activity: 0%

    Registriert seit
    May 2011
    Ort
    usa
    Beiträge
    3
    Points
    400
    Level
    7
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von lilmnm Beitrag anzeigen
    In the main.c you can see they are very different. but my question is do you have the graphics.c, .h, and the framebuffer.c, .h in the same folder as your source with the main.c? And what tut are you following?
    yes I have them in the same folder .
    I'm following this one ( [TUT] Beginner C Programming Tutorials ) .
    also I have other question . is it ok to debug using code::blocks ??
    one more thing , since I'm using Minimalist PSPSDK I have no idea how to use subversion and download the zlib and pnglib
    but when I search in my include and lib folder I found them there .

    I just copied your code to my main.c and the same problem happened with the same error !!!!!
    Geändert von virus7 (05-29-2011 um 08:18 AM Uhr)

  18. #10158
    Points: 246, Level: 4
    Level completed: 92%, Points required for next Level: 4
    Overall activity: 0%

    Registriert seit
    Jul 2011
    Ort
    Pluto
    Beiträge
    11
    Points
    246
    Level
    4
    Downloads
    0
    Uploads
    0

    Standard

    Is there a comprehensive guide where to start about coding for PSP?

    I am a programmer and excellent on C but I need a guide how to start with coding for PSP

    If someone can shed a light what tools to use etc.

  19. #10159
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    Zitat Zitat von supercheater Beitrag anzeigen
    Is there a comprehensive guide where to start about coding for PSP?

    I am a programmer and excellent on C but I need a guide how to start with coding for PSP

    If someone can shed a light what tools to use etc.
    hey welcome to the community and this is the same place where i started and helped out a lot psp-programming.com

    also doing a search on google can also give you about 5-6 pages of help as well

  20. #10160
    Points: 133, Level: 2
    Level completed: 66%, Points required for next Level: 17
    Overall activity: 13,0%

    Registriert seit
    Apr 2012
    Ort
    Italy
    Beiträge
    8
    Points
    133
    Level
    2
    Downloads
    0
    Uploads
    0

    Standard

    i'm working on min sdk jetdrone and i have installed only OSLib.
    i'm trying to create a homebrew that extract the iso game file from the umd to the memory stick.
    when i start the homebrew it give me error.
    he doesn't finds the disc0: directory.
    Have anyone the correct code for extract an iso from umd and save it to the memory stick?

  21. #10161
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    Zitat Zitat von dsupermariob Beitrag anzeigen
    i'm working on min sdk jetdrone and i have installed only OSLib.
    i'm trying to create a homebrew that extract the iso game file from the umd to the memory stick.
    when i start the homebrew it give me error.
    he doesn't finds the disc0: directory.
    Have anyone the correct code for extract an iso from umd and save it to the memory stick?
    what does your code look like right now? also are you putting your brew in user mode or kernel mode?

    when you call to the umd it should look something like this
    Code:
    int fd;
    fd = sceIoOpen("disc0:/PSP_GAME", PSP_O_RDONLY, 0777);
    if (fd <= 0)
    {
          //return error
    }
    else
    {
         //make me a cheeseburger
    }
    sceClose(fd);

  22. #10162
    Points: 133, Level: 2
    Level completed: 66%, Points required for next Level: 17
    Overall activity: 13,0%

    Registriert seit
    Apr 2012
    Ort
    Italy
    Beiträge
    8
    Points
    133
    Level
    2
    Downloads
    0
    Uploads
    0

    Standard

    i don't know how to post code:
    he says "you must have 999 posts in order to post links"

  23. #10163
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    Zitat Zitat von dsupermariob Beitrag anzeigen
    i don't know how to post code:
    he says "you must have 999 posts in order to post links"
    use the code BBC [CODE]PUT THE CODE HERE[/CODE]

  24. #10164
    Points: 133, Level: 2
    Level completed: 66%, Points required for next Level: 17
    Overall activity: 13,0%

    Registriert seit
    Apr 2012
    Ort
    Italy
    Beiträge
    8
    Points
    133
    Level
    2
    Downloads
    0
    Uploads
    0

    Standard

    I have attached my actually code, because i couldn't use [ CODE ] [ / CODE ] because he gives me error of link.
    The homebrew should copy the iso game file from umd to memory stick.
    I don't know the difference between user mode or kernel mode.
    Angehängte Dateien Angehängte Dateien

  25. #10165
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    Zitat Zitat von dsupermariob Beitrag anzeigen
    I have attached my actually code, because i couldn't use [ CODE ] [ / CODE ] because he gives me error of link.
    The homebrew should copy the iso game file from umd to memory stick.
    I don't know the difference between user mode or kernel mode.
    you were close but it just seemed odd but here is your code with some adjustments i have highlighted in red

    Code:
    #include <pspkernel.h>
    #include <pspcallbacks.h>
    #include <pspumd.h>
    #include <stdlib.h>
    #include <string.h>
    #include <stdio.h>
    #include <pspdebug.h>
    #include <pspdisplay.h>
    #include <pspiofilemgr.h>
    
    #define printf pspDebugScreenPrintf
    
    PSP_MODULE_INFO("Save and Load Test", 0, 1, 1);
    
    //Global Vars
    int read, fd, umdsize, dir, umd, iso;
    char umdbuffer[1048576],isopath[25];
    
    /* Exit callback old fasion */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
    
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
    
              sceKernelSleepThreadCB();
    
              return 0;
    }
    
    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
              int thid = 0;
    
              thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
              if(thid >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    } 
    
    int main(){
    	pspDebugScreenInit();
    	int jew;
    	jew = sceumdCheckMedium();
    	if(jew == 0) {
    		printf("Insert umd!");
    		sceUmdWaitDriveStat(PSP_UMD_PRESENT);
    		sceKernelDelayThread(1000000); //wait one second please
    	}
    	else {
    		printf("Umd detected!");
    		sceUmdActivate(1, "disc0:");
    		sceUmdWaitDriveStat(PSP_UMD_READY);
    		sceKernelDelayThread(1000000); //wait one second please
    		printf("umd ready!");
            fd = sceIoOpen("umd0:", PSP_O_RDONLY, 0777);
    	     if(fd >= 0){
    		     umdsize=sceIoLseek(fd,0,SEEK_END);
       	         sceIoClose(fd);
             }
    		 printf("Size: %l",umdsize);
    		 umd = sceIoOpen("disc0:", PSP_O_RDONLY, 0777); 
             if(umd<0){
      	        printf("Impossible to open umd..");
    			sceKernelDelayThread(1000000); //wait one second please
             }
    		 dir = sceIoDopen("ms0:/ISO/");
     	     if(dir < 0){ 
     		  sceIoMkdir("ms0:/ISO",0777);	
     	    }
    		   sprintf(isopath, "ms0:/ISO/game.iso");				 		
            iso= sceIoOpen(isopath, PSP_O_WRONLY| PSP_O_CREAT | PSP_O_TRUNC, 0777);
    		if(iso<0){
      	           printf("Impossible to access the ms..");
            }
    		read=sceIoRead(umd, umdbuffer,512);
    		sceIoWrite(iso, umdbuffer, read * 2048);
    	}
    	sceKernelSleepThread();
    	return 0;
    }
    try that and then let me know but for a few explinations to what i changed and why. i put your vars in one nice bunch cause idk im ocd i guess. i noticed you didnt have your callbacks set up properly so i put them in for you. i put sceumdCheckMedium(); outside the if statment and had it referenced to by a var. i changed the first sceUmdWaitDriveStat(); value from "UMD_WAITFORDISC" to "PSP_UMD_PRESENT" because thats how its shown in the example in the pspumd.h file and the second one from "UMD_WAITFORINIT" to "PSP_UMD_READY" and the same reason as the first also it seems all the vars have the "PSP_" prefix so it just seemed right. i added one second delays (the sceKernelDelayThread(1000 000); //wait one second please) for where it cheacks your umd so it dosent go to fast and gives you time to put the umd in. i changed umd = sceIoOpen("umd0:", PSP_O_RDONLY, 0777); to umd = sceIoOpen("disc0:", PSP_O_RDONLY, 0777); cause the psp doesnt know what umd0 is its not allocated anywhere on the system. other then that it looks ok. i have added your new file please take a look and see what was changed
    Angehängte Dateien Angehängte Dateien

  26. #10166
    Points: 133, Level: 2
    Level completed: 66%, Points required for next Level: 17
    Overall activity: 13,0%

    Registriert seit
    Apr 2012
    Ort
    Italy
    Beiträge
    8
    Points
    133
    Level
    2
    Downloads
    0
    Uploads
    0

    Standard

    it doesn't works.
    the brew detected my umd, printed the text "umd detected" and nothing other.

    another question how can i get the current date in my brew?

  27. #10167
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    Zitat Zitat von dsupermariob Beitrag anzeigen
    it doesn't works.
    the brew detected my umd, printed the text "umd detected" and nothing other.

    another question how can i get the current date in my brew?
    oh i see where i myself messed up

    Code:
    #include <pspkernel.h>
    #include <pspcallbacks.h>
    #include <pspumd.h>
    #include <stdlib.h>
    #include <string.h>
    #include <stdio.h>
    #include <pspdebug.h>
    #include <pspdisplay.h>
    #include <pspiofilemgr.h>
    
    #define printf pspDebugScreenPrintf
    
    PSP_MODULE_INFO("Save and Load Test", 0, 1, 1);
    
    //Global Vars
    ]int read, fd, umdsize, dir, umd, iso;[/COLOR]
    char umdbuffer[1048576],isopath[25];
    
    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
    
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
    
              sceKernelSleepThreadCB();
    
              return 0;
    }
    
    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
              int thid = 0;
    
              thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
              if(thid >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    }
    
    int main(){
    	pspDebugScreenInit();
    	int jew;
    	jew = sceumdCheckMedium();
    	if(jew == 0) {
    		printf("Insert umd!");
    		sceUmdWaitDriveStat(PSP_UMD_PRESENT);
    		sceKernelDelayThread(1000000); //wait one second please
    	}
    	else {
    		printf("Umd detected!");
    		sceUmdActivate(1, "disc0:");
    		sceUmdWaitDriveStat(PSP_UMD_READY);
    		sceKernelDelayThread(1000000); //wait one second please
    		printf("umd ready!");
            fd = sceIoOpen("disc0:", PSP_O_RDONLY, 0777);
    	     if(fd >= 0){
    		     umdsize=sceIoLseek(fd,0,SEEK_END);
       	         sceIoClose(fd);
             }
    		 printf("Size: %l",umdsize);
    		 umd = sceIoOpen("disc0:", PSP_O_RDONLY, 0777); 
             if(umd<0){
      	        printf("Impossible to open umd..");
    			sceKernelDelayThread(1000000); //wait one second please
             }
    		 dir = sceIoDopen("ms0:/ISO/");
     	     if(dir < 0){ 
     		  sceIoMkdir("ms0:/ISO",0777);	
     	    }
    		   sprintf(isopath, "ms0:/ISO/game.iso");				 		
            iso= sceIoOpen(isopath, PSP_O_WRONLY| PSP_O_CREAT | PSP_O_TRUNC, 0777);
    		if(iso<0){
      	           printf("Impossible to access the ms..");
            }
    		read=sceIoRead(umd, umdbuffer,512);
    		sceIoWrite(iso, umdbuffer, read * 2048);
    	}
    	sceKernelSleepThread();
    	return 0;
    }
    sorry for the mess up and the late reply its been a busy couple of mornings lol.

    but as of right now idk how to show the time but im sure there is something in one of the sdk that can help you ill even look cause i my self wanna know lol
    i actually didnt cnhange where it tried to open umd0 instead of disc0 so the app was getting confused and most likely froze or crash. edits marked in red (the right one this time lol) and the new attachment is also updated

    try that
    Angehängte Dateien Angehängte Dateien

  28. #10168
    Points: 133, Level: 2
    Level completed: 66%, Points required for next Level: 17
    Overall activity: 13,0%

    Registriert seit
    Apr 2012
    Ort
    Italy
    Beiträge
    8
    Points
    133
    Level
    2
    Downloads
    0
    Uploads
    0

    Standard

    ok i tried the code.
    the psp stopped working on sceUmdActivate.
    i don't know why

  29. #10169
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    Zitat Zitat von dsupermariob Beitrag anzeigen
    ok i tried the code.
    the psp stopped working on sceUmdActivate.
    i don't know why
    does it crash or just hangs there?

  30. #10170
    Points: 133, Level: 2
    Level completed: 66%, Points required for next Level: 17
    Overall activity: 13,0%

    Registriert seit
    Apr 2012
    Ort
    Italy
    Beiträge
    8
    Points
    133
    Level
    2
    Downloads
    0
    Uploads
    0

    Standard

    just hangs there.


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:15 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .