I have more on this... now I'm really confused.
Sorry for the trouble... it's probably a beginner problem. :(
I have a main.c where I run my main code and then I have other units *.c and their *.h header files for individual sections, like graphics, pad and so on.
The above example showed the problem with moving sceGuCopyImage out into it's own procedure. The fact is, if it's in it's own procedure in my main.c file, it works, but as soon as it's in my graphics.c file then it does nothing. And... it is not just linked to that specific sce function. I now found that moving anything to my graphics unit results in doing nothing.
PLEASE HELP!!!
I'll prob feel like an idiot after someone tells me what i'm doing wrong. :)
example code...
graphics.h
Code: Select all
#define SCREEN_WIDTH 480
#define SCREEN_HEIGHT 272
#define SCREEN_BUFWIDTH 512
static unsigned int __attribute__((aligned(16))) Sprites[512*272];
int DoSomething(char* something);
graphics.c
Code: Select all
#include <psptypes.h>
#include <png.h>
#include <graphics.h>
#include <pspgu.h>
#include <stdlib.h>
int DoSomething(char* something)
{
unsigned int x, y;
for (y = 0; y < 272; y++)
{
unsigned int* row = &Sprites[y * 512];
for (x = 0; x < 480; x++)
{
row[x] = 0xffffffff;
}
}
}
makefile
Code: Select all
TARGET = Demo
OBJS = main.o graphics.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS = -lpspgu -lpng -lz -lm
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Demo
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
If I put the code to fill up "Sprites" into my main.c file then it works but as soon as it is called from graphics.c then it does nothing.
You know all the answers to life... don't make me tell you again.