I refuse to use eclipse as my IDE in ubuntu. Yeah, psplinkusb works on it, but it really can’t compensate the uber slowness of it(Sorry, I don’t have enough dough to buy a faster pc). The best IDE for me is Source Insigh but its for windows, so I often have it to run on wine but some of its outstanding factors doesn’t come out when on wine.So I use Code::Blocks when I’m on ubuntu, simply because it’s the only IDE that works for me and the one that gives me the greatest satisfaction but not as great as SI in windows. So I insisted in making the psplinkusb work on it, and after long hours of trial and errors, I managed it got to work. BWAHAHAHAHA. What bliss, but enough introduction and here’s how I made it work.

1st Part: Compiling on IDE.(Thanks to J.F.’s post on how to build using Code::Blocks from ps2dev.org forum)

  1. Create a new empty project.
  2. Enter a project title.
  3. For the “Folder to create project in”, use the button to browse for desired folder location. To compile properly, the Makefile should be here.
  4. Enter a “Project Filename”.
  5. Edit the “Resulting filename” so that the *.cbp file is also located to where the Makefile is. Click “Next”, then “Finish”.
  6. The project is done. On the Management panel, right click the project and select “Properties”.
  7. In the “Project Settings” tab, edit the “Makefile” so that it is the name of your makefile, and check the “This is a custom Makefile”. click the “OK” button.
  8. On the “Management” panel, right click the project and select “Build Options”. Select the project on the left panel.
  9. Go to the “Make” command tab, there will be four fields. on these fields remove the “$target” from all the fields.
  10. Paste the following before the “$make” on all fields:
  11. export PSPDEV="/usr/local/pspdev" && export PSPSDK="$PSPDEV/psp/sdk" && export PSPPATH="$PSPDEV/bin:$PSPDEV/psp/bin:$PSPSDK/bin" && export PATH="$PATH:$PSPPATH" && export PKG_CONFIG_PATH="$PSPDEV/psp/lib/pkgconfig" &&

  12. Just to make sure, click the Release on the left panel, then repeat step 9. then Click OK.
  13. Add your files by “Add files..” or “Add files recursively”. You can now build your projects.

2nd Part. Debugging.

  1. Wait a sec. Just before you build, edit your makefile first.
  2. on the CFLAGS, append -g.
  3. After the ASFLAGS, insert BUILD_PRX=1. Save it and build your eboot.
  4. On the menu click “Settings”, then “Compiler and Debugger”.
  5. On the “Global Compiler Settings”, On the “Toolchain Executables” tab, set the “Compiler’s installation directory” to “/usr/local/pspdev”.
  6. On the 5 fields below, append “psp-” on all these fields.
  7. On the “Debugger Settings” section, “Debugger Initialization commands”, enter “file XX.elf” where XX is the name of elf file on your current project. You need to change these every time you change projects/eboots depending on the elf file.
  8. Click OK.
  9. Open up again your project’s “Properties”.
  10. Move to the Debugger’s tab, select target, which is “Release”.
  11. Set “Connection Type” to TCP/IP.
  12. Set IP address to 127.0.0.1 and port to 1001.
  13. This assumes that you had psplink already setup. If not google it.
  14. Run psplink on your psp, usbhostfs_pc and pspsh on your terminal.
  15. On pspsh, enter debug ./XX.prx, where XX is your file.
  16. Set your breakpoints and start debugging.

Happy Coding and debugging. =D


1 Response to “Compiling and Debugging on Code::Blocks with psplink”


  1. 2009/07/31 at 11:50 pm

    What’s does the Step 2 and 3 meant for the 2nd part?


Leave a Reply




twitter updates

Quote for the week

Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.

 

November 2009
S M T W T F S
« Jun    
1234567
891011121314
15161718192021
22232425262728
2930