Main.c
Code: Select all
#include <kubridge.h>
#include <pspkernel.h>
#include <psppower.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <pspiofilemgr.h>
#include <pspdisplay.h>
#include <psputility.h>
#include <pspgu.h>
#include <pspgum.h>
#include <malloc.h>
#include <stdarg.h>
#include "framebuffer.h"
#include "graphics.h"
#include <math.h>
#include <png.h>
#include <pspsdk.h>
#define SCREEN_WIDTH 480
#define SCREEN_HEIGHT 272
#define DATA_WIDTH 240
#define DATA_HEIGHT 136
#define LINESIZE 512 //in short
#define FRAMESIZE 0xAA000 //in byte
#define printf pspDebugScreenPrintf
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
PSP_MODULE_INFO("test", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
#define printf pspDebugScreenPrintf
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
void ErrorExit(int milisecs, char *fmt, ...)
{
va_list list;
char msg[256];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
printf(msg);
sceKernelDelayThread(milisecs*1000);
sceKernelExitGame();
}
int main(void)
{
pspDebugScreenInit();
initGraphics();
SceCtrlData pad;
Image* player = loadImage("player.png");
while(1){
printf(" Loading player \n");
blitAlphaImageToScreen(0, 0, 60, 60, player, 60, 60);
flipScreen();
printf("loaded correctly =] /n");
}
}
Code: Select all
TARGET = Tester
OBJS = main.o graphics.o framebuffer.o
INCDIR = ./include
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS) -c
LIBDIR = ./lib
LDFLAGS =
LIBS = -lpspkubridge -lpspgu -lpng -lz -lm -lpsppower
PSP_FW_VERSION = 371
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Tester
BUILD_PRX = 1
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak