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; Check my post, specifically the 2 code boxes. Notice whats different about them. Yeah, it helps to get the function ...
-
01-13-2009, 10:16 AM #9511I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Check my post, specifically the 2 code boxes. Notice whats different about them. Yeah, it helps to get the function name correct

-Aura
-
01-13-2009, 07:25 PM #9512QJ Gamer Bronze
- Registriert seit
- Aug 2008
- Ort
- thugz mansion
- Beiträge
- 875
- Points
- 5.594
- Level
- 48
- Downloads
- 0
- Uploads
- 0
been messin around with the vlf library
but it wont load the lateral menu even
though i tell it too any help.
Code://============================================ // Basic includes/start of program //============================================ #include <pspkernel.h> #include <stdlib.h> #include "vlf.h" #include "graphics.h" #include <pspsdk.h> #include <pspdebug.h> #include <pspctrl.h> #include <psppower.h> //-------------------------------------------- PSP_MODULE_INFO("VLFTest", 0x800, 1, 0); PSP_MAIN_THREAD_ATTR(0); //-------------------------------------------- //============================================ // Global variables //============================================ void *ReadFileAllocEx(char *file, int seek, int size, int *retSize); int done = 0; //============================================ // Main //============================================ int app_main() { int mini(); char *items[] = { "Start", "Exit" }; vlfGuiSystemSetup(1, 1, 1); vlfGuiLateralMenu(2, items, 0, mini, 100); vlfGuiSetModelSystem(); void *battery_icon; vlfGuiSetBackgroundPlane(0x00CC99); vlfGuiSetModelSystem(); vlfGuiAddClock(); // Añade el reloj en la esquina superior derecha // vlfGuiAddBatteryIconSystem(&battery_icon, 10*1000*1000); int title_text = vlfGuiAddText(240, 50, "BlackBurd"); // vlfGuiSetTextAlignment(title_text, VLF_ALIGNMENT_CENTER); while(1) { vlfGuiDrawFrame(); } sceKernelSleepThread(); return 0; } //============================================ // Main program //============================================ int mini(int sel) { switch (sel) { case 0: jesus(); return VLF_EV_RET_REMOVE_HANDLERS | VLF_EV_RET_REMOVE_OBJECTS; case 1: sceKernelExitGame(); break; } return VLF_EV_RET_NOTHING; } int jesus (int sel) { vlfGuiAddText(240, 50, "Demo test 2.");
Zitat von SuperBatXS
-
01-14-2009, 10:25 AM #9513QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- The Netherlands
- Beiträge
- 330
- Points
- 3.567
- Level
- 37
- Downloads
- 0
- Uploads
- 0
BlackBurd, your's doesn't work too. Compiles but screen stays black:
Code:#include <pspsdk.h> #include <pspkernel.h> #include <psppower.h> #include <pspctrl.h> #include <pspdisplay.h> #include <pspdebug.h> #define printf pspDebugScreenPrintf PSP_MODULE_INFO("menu", 0, 1, 0); PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER); int exit_callback(int arg1, int arg2, void *common) { sceKernelExitGame(); return 0; } int CallbackThread(SceSize args, void *argp) { int cbid; cbid = sceKernelCreateCallback(" Exit Callback", exit_callback, NULL); sceKernelRegisterExitCallback(cbid); sceKernelSleepThreadCB(); return 0; } int SetupCallbacks(void) { int thid = 0; thid = sceKernelCreateThread("up date_thread", CallbackThread, 0x11, 0xFA0, 0, 0); if(thid >= 0) { sceKernelStartThread(thid , 0, 0); } return thid; } #define N_Entries 3 char *MenuItems[] = { "ITEM", "ITEM2", "ITEM3" }; int main() { SceCtrlData menupad, lastpad; sceCtrlReadBufferPositive (&lastpad, 1); int i, selection = 0; while(1) { pspDebugScreenSetXY(0, 0); printf("Welcome to PROGRAM-NAME\n"); for(i = 0; i < N_Entries; i++) { if (i != selection) printf(" %s\n", MenuItems[i]); else printf(" -> %s\n", MenuItems[i]); } sceCtrlReadBufferPositive (&menupad, 1); if (lastpad.Buttons != menupad.Buttons) { lastpad.Buttons = menupad.Buttons; if (menupad.Buttons & PSP_CTRL_DOWN) { selection++; if (selection >= N_Entries) selection = 0; } else if(menupad.Buttons & PSP_CTRL_UP) { selection--; if (selection < 0) selection = N_Entries - 1; } else if(menupad.Buttons & PSP_CTRL_CROSS) { break; } } } return selection; }[spoiler=My Releases So Far]
PSP_Operator v2.0 Final (and earlier; stopped with this one)
Mario's Road v2.0 (working on 2.5:D)
UMD_Operator v0.0.2 (and earlier; stopped with this one)
PSP-Quiz v0.1 (working on v0.2 already:D)
[/spoiler]
-
01-14-2009, 10:34 AM #9514QJ Gamer Bronze
- Registriert seit
- Aug 2008
- Ort
- thugz mansion
- Beiträge
- 875
- Points
- 5.594
- Level
- 48
- Downloads
- 0
- Uploads
- 0
-
01-14-2009, 11:04 AM #9515QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- The Netherlands
- Beiträge
- 330
- Points
- 3.567
- Level
- 37
- Downloads
- 0
- Uploads
- 0
Hahahahaha, I meant my problem with my menu:P You posted one for me on the previous page
but I meant that one didn't work XD[spoiler=My Releases So Far]
PSP_Operator v2.0 Final (and earlier; stopped with this one)
Mario's Road v2.0 (working on 2.5:D)
UMD_Operator v0.0.2 (and earlier; stopped with this one)
PSP-Quiz v0.1 (working on v0.2 already:D)
[/spoiler]
-
01-14-2009, 11:15 AM #9516QJ Gamer Bronze
- Registriert seit
- Aug 2008
- Ort
- thugz mansion
- Beiträge
- 875
- Points
- 5.594
- Level
- 48
- Downloads
- 0
- Uploads
- 0
-
01-14-2009, 11:17 AM #9517QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- The Netherlands
- Beiträge
- 330
- Points
- 3.567
- Level
- 37
- Downloads
- 0
- Uploads
- 0
The menu works now, Davee helped me out

I have another question again. I have a PRX Plugin now that needs to play MP3 sounds.
It compiles perfect but when I enable it in Recovery Menu and start my PSP the
screen stays black and my PSP turns off.
main.c:
exports.exp:Code:/* PRX psp file */ #include <pspsdk.h> #include <pspkernel.h> #include <string.h> #include <pspsysmem.h> #include <pspctrl.h> #include <pspdebug.h> #include <pspaudio.h> #include <pspaudiolib.h> #include <psppower.h> #include "mp3player.h" PSP_MODULE_INFO("XMB Music", 0x1000, 1, 1); PSP_HEAP_SIZE_KB(20480); #define printf pspDebugScreenPrintf int main() { scePowerSetClockFrequency(333, 333, 166); pspDebugScreenInit(); pspAudioInit(); SceCtrlData pad; int i; MP3_Init(1); MP3_Load("ms0:/music/music.mp3"); while(1) { sceCtrlReadBufferPositive(&pad, 1); if(pad.Buttons & PSP_CTRL_CROSS) { MP3_Play(); } else if(pad.Buttons & PSP_CTRL_CIRCLE) { MP3_Pause(); for(i=0; i<10; i++) { sceDisplayWaitVblankStart(); } } if (MP3_EndOfStream() == 1) { MP3_Stop(); } } MP3_Stop(); MP3_FreeTune(); sceKernelSleepThread(); return 0; } /* Exported function returns the address of module_info */ void* getModuleInfo(void) { return (void *) &module_info; }
Makefile:Code:PSP_BEGIN_EXPORTS # These four lines are mandatory (although you can add other functions like module_stop) # syslib is a psynonym for the single mandatory export. PSP_EXPORT_START(syslib, 0, 0x8000) PSP_EXPORT_FUNC_HASH(module_start) PSP_EXPORT_VAR_HASH(module_info) PSP_EXPORT_END # Export our function PSP_EXPORT_START(MyLib, 0, 0x0001) PSP_EXPORT_FUNC_HASH(getModuleInfo) PSP_EXPORT_END PSP_END_EXPORTS
Code:TARGET = musicplugin OBJS = main.o mp3player.o # Define to build this as a prx (instead of a static elf) BUILD_PRX=1 # Define the name of our custom exports (minus the .exp extension) PRX_EXPORTS=exports.exp USE_PSPSDK_LIBC = 1 INCDIR = CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBDIR = LIBS = -lmad -lpspaudiolib -lpspaudio -lpsppower PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak
Geändert von malliet (01-14-2009 um 12:40 PM Uhr) Grund: Automerged Doublepost
[spoiler=My Releases So Far]
PSP_Operator v2.0 Final (and earlier; stopped with this one)
Mario's Road v2.0 (working on 2.5:D)
UMD_Operator v0.0.2 (and earlier; stopped with this one)
PSP-Quiz v0.1 (working on v0.2 already:D)
[/spoiler]
-
01-14-2009, 12:49 PM #9518I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Just taking one look at your code and I can tell you the problem:
PSP_HEAP_SIZE_KB(20480); allocates all free user memory. I know for a fact that the XMB actually allocates directly to the user memory so if you've allocated it elsewhere then the XMB won't load.
There may be other issues but I've not looked at the code enough to see, I'll update if I find anything else blindly obvious.
-Aura
EDIT:
Another thing, you've selected kernel mode (0x1000) and allocated from user memory, I'm not certain but I don't think thats either possible nor a good idea.Geändert von Auraomega (01-14-2009 um 01:12 PM Uhr)
-
01-14-2009, 02:07 PM #9519QJ Gamer Bronze
- Registriert seit
- Aug 2008
- Ort
- thugz mansion
- Beiträge
- 875
- Points
- 5.594
- Level
- 48
- Downloads
- 0
- Uploads
- 0
any body know anything about vlf library.
i still need help with the lateral menu.
mo one else seems to know how to do it and im very sure i didnt make a typo because it complies.
Zitat von SuperBatXS
-
01-14-2009, 04:03 PM #9520xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
my ones always compile but it never shows anything on screen either :Argh:
~!SlasheR!~!
-
01-14-2009, 04:51 PM #9521QJ Gamer Bronze
- Registriert seit
- Aug 2008
- Ort
- thugz mansion
- Beiträge
- 875
- Points
- 5.594
- Level
- 48
- Downloads
- 0
- Uploads
- 0
-
01-14-2009, 10:56 PM #9522xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
tried dont work

my computers acting up atm tho so... :Argh::Argh::Argh:
~!SlasheR!~
-
01-15-2009, 06:49 AM #9523QJ Gamer Bronze
- Registriert seit
- Aug 2008
- Ort
- thugz mansion
- Beiträge
- 875
- Points
- 5.594
- Level
- 48
- Downloads
- 0
- Uploads
- 0
-
01-15-2009, 09:01 AM #9524QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
Hi
I'm having troubles using FontLoader. I tried to include it in my project but since it is a c++ project I had to rename fontloader.c to fontloader.cpp. Now when I try to compile he tells me
but line 83 is justfontloader.cpp (83) : multiple definition of `ft_library'
main.cpp (30) : first defined here
and there's no ft_library used in my main.cpp at all! In fact 'ft_library' is only used 3 times in the whole project, and only in fontloader.h:Code:u32* fbLine = framebuffer + xofs + yofs * lineSize; for (y = 0; y < bitmap->rows; y++) { // Line 83 u8* column = line;
and fontloader.cpp:Code:FT_Library ft_library;
and there's only 1 definition. All I did was change the filename to .cpp.Code:initError = FT_Init_FreeType( &ft_library ); // line 26 // [...] int error = FT_New_Memory_Face(ft_library, fontData, filesize, 0, &font->face); // line 48
PS: Are there any other libraries for displaying fonts than fontloader? I was told pgeFont is pretty good and fast and stuff, but it doesn't work with Psilocybeing's graphic library on which the rest of the project is heavily built on already.
-
01-15-2009, 09:58 AM #9525QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
This is in a header file? If so, change it to:Code:FT_Library ft_library;
and addCode:extern FT_Library ft_library;
To the top after the includes in FontLibrary.cpp.Code:FT_Library ft_library;
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
01-15-2009, 10:08 AM #9526QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
It compiles and works! Thanks a lot yaustar! :)
-
01-16-2009, 01:27 PM #9527QJ Gamer Bronze
- Registriert seit
- Aug 2008
- Ort
- thugz mansion
- Beiträge
- 875
- Points
- 5.594
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Okay i got my men working but now im having problems with audio playback.
Is there an audio library that is compatible with dax's vlf library.
Zitat von SuperBatXS
-
01-17-2009, 03:26 PM #9528xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
still no luck with the vlf library, could someone please answer my question on the next page?
~!SlasheR!~
-
01-17-2009, 09:59 PM #9529QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
How do I allocate memory to the first dimension of an array?
Something like
?Code:char *array[256]; array = ?
-
01-17-2009, 10:22 PM #9530It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
This only works in initialization, but you can do this:
If there are entries absent, they are set to zero.Code:char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
01-18-2009, 01:25 AM #9531Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
01-18-2009, 01:53 PM #9532QJ Gamer Blue
- Registriert seit
- Nov 2007
- Beiträge
- 29
- Points
- 2.981
- Level
- 33
- Downloads
- 0
- Uploads
- 0
So well, another one of my endless troubles.
So, i'm toying with samples in pspsdk samples.
The clut sample in gu folder is quite interesting, but i have to get it working with Oslib library at once.
So now, with no guessing what i'm doing i just copy&pasted the sample, removed what was unneded (guessing) and put in with oslib.
When compiling to check whenever it works, i have that error -
And now, i have no idea, i'm literraly at dark now. So, any help appreciated.PHP-Code:main.cpp:(.text+0x1dc): relocation truncated to fit: R_MIPS_GPREL16 against `osl_quit'
main.cpp:(.text+0x1e8): relocation truncated to fit: R_MIPS_GPREL16 against `osl_skip'
main.cpp:(.text+0x22c): relocation truncated to fit: R_MIPS_GPREL16 against `osl_frameskip'
main.cpp:(.text+0x230): relocation truncated to fit: R_MIPS_GPREL16 against `osl_maxFrameskip'
main.cpp:(.text+0x238): relocation truncated to fit: R_MIPS_GPREL16 against `osl_vsyncEnabled'
main.cpp:(.text+0x23c): relocation truncated to fit: R_MIPS_GPREL16 against `osl_quit'
Source in the attachement.
Also, if somebody was kind enough to help me make it use only Oslib functions then i would be very grateful.
-
01-18-2009, 04:02 PM #9533QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
drop oslib, trying to use the oslib and direct GU clut is not going to work like you want, trust me, if your going to use the clut than simple drop oslib competly and begin learning the gu, also the CLUT is damn amazing, no worry of my rendering being an issue on my end=-), but like i said competly drop oslib if you plan to use CLUT=-)
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
01-19-2009, 02:18 AM #9534QJ Gamer Blue
- Registriert seit
- Nov 2007
- Beiträge
- 29
- Points
- 2.981
- Level
- 33
- Downloads
- 0
- Uploads
- 0
Too bad, but i have to use oslib. I'm just making a game, and clut will be a background on some maps, so i have to use them both at once, and my pspsdk knowledge isn't good enough to drop oslib, let alone do what i want

So, the question is - direct GU drawing with oslib with no conflicts. How?
-
01-19-2009, 07:04 AM #9535QJ Gamer Bronze

- Registriert seit
- Sep 2006
- Ort
- france
- Beiträge
- 170
- Points
- 6.359
- Level
- 52
- Downloads
- 0
- Uploads
- 0
I got interested when I saw your message, so I tried to include the clut sample into my oslib application, and was successful, I can draw the clut sample and an OSL_IMAGE on top of it.
clutoslib.cpp, where the function is:my makefile (cleaned, only relevant parts):PHP-Code:#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <pspgu.h>
#include <oslib/oslib.h>
//static unsigned int __attribute__((aligned(16))) clut_list[262144];
struct Vertex
{
float u,v;
float x,y,z;
};
#define NUM_SLICES 128
#define NUM_ROWS 128
#define RING_SIZE 2.0f
#define RING_RADIUS 1.0f
#define SPRITE_SIZE 0.025f
unsigned int colors[8] =
{
0xffff0000,
0xffff00ff,
0xff0000ff,
0xff00ffff,
0xff00ff00,
0xffffff00,
0xffffffff,
0xff00ffff
};
unsigned int __attribute__((aligned(16))) clut256[256];
unsigned char __attribute__((aligned(16))) tex256[256*256];
int test_clut()
{
OSL_IMAGE *image=oslLoadImageFilePNG((char *)"test.png", OSL_IN_RAM|OSL_SWIZZLED, OSL_PF_8888);
unsigned int i,j;
for (j = 0; j < 256; ++j)
{
for (i = 0; i < 256; ++i)
{
tex256[i + j * 256] = j ^ i;
}
}
sceKernelDcacheWritebackAll();
int offset = 0;
while(!osl_quit)
{
// animate palette
unsigned int* clut = (unsigned int*)(((unsigned int)clut256)|0x40000000);
for (i = 0; i < 256; ++i)
{
unsigned int j = (i + offset)&0xff;
*(clut++) = (j << 24)|(j << 16)|(j << 8)|(j);
}
oslStartDrawing();
// clear screen
sceGuClearColor(0xff00ff);
sceGuClear(GU_COLOR_BUFFER_BIT);
// setup CLUT texture
sceGuClutMode(GU_PSM_8888,0,0xff,0); // 32-bit palette
sceGuClutLoad((256/8),clut256); // upload 32*8 entries (256)
sceGuTexMode(GU_PSM_T8,0,0,0); // 8-bit image
sceGuTexImage(0,256,256,256,tex256);
sceGuTexFunc(GU_TFX_REPLACE,GU_TCC_RGB);
sceGuTexFilter(GU_LINEAR,GU_LINEAR);
sceGuTexScale(1.0f,1.0f);
sceGuTexOffset(0.0f,0.0f);
sceGuAmbientColor(0xffffffff);
// render sprite
sceGuColor(0xffffffff);
struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(2 * sizeof(struct Vertex));
vertices[0].u = 0; vertices[0].v = 0;
vertices[0].x = 0; vertices[0].y = 0; vertices[0].z = 0;
vertices[1].u = 256; vertices[1].v = 256;
vertices[1].x = 480; vertices[1].y = 272; vertices[1].z = 0;
sceGuDrawArray(GU_SPRITES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D,2,0,vertices);
// oslib drawings
oslDrawImageXY(image, 215, 111);
// wait for next frame
oslEndDrawing();
oslEndFrame();
oslSyncFrame();
offset++;
}
oslDeleteImage(image);
return 0;
}
try to call the test_clut() function into your main(), don't forget to put an image named "test.png" next to the eboot.PHP-Code:TARGET = clutoslib
OBJS = code/main.o
BUILD_PRX = 1
PSP_FW_VERSION = 371
INCDIR =
CFLAGS = -G0 -Wall -O3 -fsingle-precision-constant -falign-functions=64
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm -lstdc++ -lpspmpeg -lpspaudiocodec
LIBS=$(STDLIBS)$(YOURLIBS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = clut oslib
PSP_EBOOT_ICON = ICON0.png
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
if you want to know, I'm using oslibmod by sakya, and I'm initializing it like this:I provide my own callbacks.PHP-Code:oslInitAudioME(OSL_FMT_MP3);
scePowerSetClockFrequency(333, 333, 166);
oslInit(OSL_IF_USEOWNCALLBACKS);
oslInitGfx(OSL_PF_8888, true);
oslSetDithering(false);
oslSetFrameskip(1);
oslSetMaxFrameskip(3);
oslSetTextColor(RGBA(255,255,255,255));
oslSetBkColor(RGBA(0,0,0,0));
Note that I first tried to write the benchmarks from oslib, but the text & bg were white, I don't know why...
-
01-19-2009, 07:46 AM #9536I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I'm having an annoying compiler issue with some code of mine...
makefile:
main.cpp:Code:... OBJS =\ PBPDepack.o\ ...
depack.h:Code:#include "depack.h" ... FILE *fp; fp = fopen("ms0:/test.pbp", "r"); long int one = 0; long int two = 0; getOffsets(fp, 0, &one, &two); fclose(fp);
PBPDepack.s:Code:#include <stdio.h> void getOffsets(FILE *pbp, int position, long int *pointerStart, long int *pointerEnd);
Error:Code:.set noreorder #include "pspstub.s" STUB_START "PBPDepack",0x40090000,0x00010005 STUB_FUNC 0x5FF3D8D7,getOffsets STUB_END
No idea what is going on, its not exclusive to PBPDepack either, I've tried a couple of modules and exports, all giving the same problem that its undefined. Anyone know whats going on here?main.o: In function `loadOption(int)':
...:381: undefined reference to `getOffsets(
__sFILE*, int, long*, long*)'
-Aura
-
01-19-2009, 10:53 AM #9537QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
01-19-2009, 11:34 AM #9538I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Quoting THAT much of a post, it would have been nice if you said something constructive rather than "is rly stupid"... Why is it stupid? What can he do to achieve the same thing (ease of coding with clut)? Your post is just as pointless as this one.
Actually, my post isn't pointless because I'm gonna ask a question. Isn't OSLib just a bunch of functions working with the GU? So how is using the GU with the GU dumb?
-Aura
-
01-19-2009, 11:46 AM #9539QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
no, it's not that, which i meant, while yes oslib uses the GU, it's the way he used it their, they wish to take advantage of the CLUT with oslib, and AFAIK oslib doesn't take advantage of a CLUT, and their's no way to change that, oslib's internal functions take care of handling an image, and displaying it, which makes it not possible(to my knowledge) to be able to use a CLUT with oslib, the only other option is to get oslib's source, and include CLUT handling into oslib, than re-compile oslib with CLUT capabilitie's internally, otherwise it's just one huge big PITA to try and use oslib, with native gu commands, which at that point, your better off using the GU than cluttering up your code with a bunch of oslib calls as well, which is why, it's rly stupid PERIOD.
secondly, i also question if they understand what the CLUT is, copy and pasting code isn't going to help like their doing
edit: and lastly, my post wasn't pointless, do you only take the most negative thing in a post, and immediately think a post is meaningless, when that's said, perhaps you forgot the first part:
Zitat von slicer4ever
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
01-19-2009, 11:46 AM #9540QJ Gamer Bronze

- Registriert seit
- Sep 2006
- Ort
- france
- Beiträge
- 170
- Points
- 6.359
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Netaro wants to include the clut code into his project, which uses oslib. my post just shows him how to integrate it, how is that stupid?
Yep, the graphical part is using the GU, I basically just had to remove all the initialization instructions because it's already done by oslib + subsituing some functions...
Edit: beaten by Slicer :)
You have a point Slicer, but I think what Netaro wants is the pretty effect, nothing more.
-=Double Post Merge =-
I took a look on wikipedia before trying the code... it's helping having a nice background effect, and knowing how to use the GU with oslib, to sometimes do things oslib doesn't allow by itself.


LinkBack URL
About LinkBacks

Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum