makefile
Code: Select all
TARGET = DeathCoreV0.1
OBJS = graphics.o mp3player.o main.o
INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
BUILD_PRX=1
PSP_FW_VERSION=390
LIBDIR =
LIBS = -lpng -lpspgu -lz -lmad -lpspaudiolib -lpspaudio -lpsppower 
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = DeathCoreV0.1
PSP_EBOOT_ICON = icon0.png
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Code: Select all
#include <stdlib.h>
#include <malloc.h>
#include <pspdisplay.h>
#include <psputils.h>
#include <png.h>
#include <pspgu.h>
#include <pspge.h>
#include "graphics.h"
#include "framebuffer.h"
#define IS_ALPHA(color) (((color)&0xff000000)==0xff000000?0:1)
#define FRAMEBUFFER_SIZE (PSP_LINE_SIZE*SCREEN_HEIGHT*4)
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
typedef struct
{
	unsigned short u, v;
	short x, y, z;
} Vertex;
extern u8 msx[];
unsigned int __attribute__((aligned(16))) list[262144];
static int dispBufferNumber;
static int initialized = 0;
static int getNextPower2(int width)
{
	int b = width;
	int n;
	for (n = 0; b != 0; n++) b >>= 1;
	b = 1 << n;
	if (b == 2 * width) b >>= 1;
	return b;
}
Color* getVramDrawBuffer()
{
	Color* vram = (Color*) g_vram_base;
	if (dispBufferNumber == 0) vram += FRAMEBUFFER_SIZE / sizeof(Color);
	return vram;
}
Color* getVramDisplayBuffer()
{
	Color* vram = (Color*) g_vram_base;
	if (dispBufferNumber == 1) vram += FRAMEBUFFER_SIZE / sizeof(Color);
	return vram;
}
void user_warning_fn(png_structp png_ptr, png_const_charp warning_msg)
{
}
Image* loadImage(const char* filename)
{
	png_structp png_ptr;
	png_infop info_ptr;
	unsigned int sig_read = 0;
	png_uint_32 width, height;
	int bit_depth, color_type, interlace_type, x, y;
	u32* line;
	FILE *fp;
	Image* image = (Image*) malloc(sizeof(Image));
	if (!image) return NULL;
	if ((fp = fopen(filename, "rb")) == NULL) return NULL;
	png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
	if (png_ptr == NULL) {
		free(image);
		fclose(fp);
		return NULL;;
	}
	png_set_error_fn(png_ptr, (png_voidp) NULL, (png_error_ptr) NULL, user_warning_fn);
	info_ptr = png_create_info_struct(png_ptr);
	if (info_ptr == NULL) {
		free(image);
		fclose(fp);
		png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
		return NULL;
	}
	png_init_io(png_ptr, fp);
	png_set_sig_bytes(png_ptr, sig_read);
	png_read_info(png_ptr, info_ptr);
	png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, int_p_NULL, int_p_NULL);
	if (width > 512 || height > 512) {
		free(image);
		fclose(fp);
		png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
		return NULL;
	}
	image->imageWidth = width;
	image->imageHeight = height;
	image->textureWidth = getNextPower2(width);
	image->textureHeight = getNextPower2(height);
	png_set_strip_16(png_ptr);
	png_set_packing(png_ptr);
	if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr);
	if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
	if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
	png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
	image->data = (Color*) memalign(16, image->textureWidth * image->textureHeight * sizeof(Color));
	if (!image->data) {
		free(image);
		fclose(fp);
		png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
		return NULL;
	}
	line = (u32*) malloc(width * 4);
	if (!line) {
		free(image->data);
		free(image);
		fclose(fp);
		png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
		return NULL;
	}
	for (y = 0; y < height; y++) {
		png_read_row(png_ptr, (u8*) line, png_bytep_NULL);
		for (x = 0; x < width; x++) {
			u32 color = line[x];
			image->data[x + y * image->textureWidth] =  color;
		}
	}
	free(line);
	png_read_end(png_ptr, info_ptr);
	png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
	fclose(fp);
	return image;
}
void blitImageToImage(int sx, int sy, int width, int height, Image* source, int dx, int dy, Image* destination)
{
	Color* destinationData = &destination->data[destination->textureWidth * dy + dx];
	int destinationSkipX = destination->textureWidth - width;
	Color* sourceData = &source->data[source->textureWidth * sy + sx];
	int sourceSkipX = source->textureWidth - width;
	int x, y;
	for (y = 0; y < height; y++, destinationData += destinationSkipX, sourceData += sourceSkipX) {
		for (x = 0; x < width; x++, destinationData++, sourceData++) {
			*destinationData = *sourceData;
		}
	}
}
void blitImageToScreen(int sx, int sy, int width, int height, Image* source, int dx, int dy)
{
	if (!initialized) return;
	Color* vram = getVramDrawBuffer();
	sceKernelDcacheWritebackInvalidateAll();
	guStart();
	sceGuCopyImage(GU_PSM_8888, sx, sy, width, height, source->textureWidth, source->data, dx, dy, PSP_LINE_SIZE, vram);
	sceGuFinish();
	sceGuSync(0,0);
}
void blitAlphaImageToImage(int sx, int sy, int width, int height, Image* source, int dx, int dy, Image* destination)
{
	// TODO Blend!
	Color* destinationData = &destination->data[destination->textureWidth * dy + dx];
	int destinationSkipX = destination->textureWidth - width;
	Color* sourceData = &source->data[source->textureWidth * sy + sx];
	int sourceSkipX = source->textureWidth - width;
	int x, y;
	for (y = 0; y < height; y++, destinationData += destinationSkipX, sourceData += sourceSkipX) {
		for (x = 0; x < width; x++, destinationData++, sourceData++) {
			Color color = *sourceData;
			if (!IS_ALPHA(color)) *destinationData = color;
		}
	}
}
void blitAlphaImageToScreen(int sx, int sy, int width, int height, Image* source, int dx, int dy)
{
	if (!initialized) return;
	sceKernelDcacheWritebackInvalidateAll();
	guStart();
	sceGuTexImage(0, source->textureWidth, source->textureHeight, source->textureWidth, (void*) source->data);
	float u = 1.0f / ((float)source->textureWidth);
	float v = 1.0f / ((float)source->textureHeight);
	sceGuTexScale(u, v);
	
	int j = 0;
	while (j < width) {
		Vertex* vertices = (Vertex*) sceGuGetMemory(2 * sizeof(Vertex));
		int sliceWidth = 64;
		if (j + sliceWidth > width) sliceWidth = width - j;
		vertices[0].u = sx + j;
		vertices[0].v = sy;
		vertices[0].x = dx + j;
		vertices[0].y = dy;
		vertices[0].z = 0;
		vertices[1].u = sx + j + sliceWidth;
		vertices[1].v = sy + height;
		vertices[1].x = dx + j + sliceWidth;
		vertices[1].y = dy + height;
		vertices[1].z = 0;
		sceGuDrawArray(GU_SPRITES, GU_TEXTURE_16BIT | GU_VERTEX_16BIT | GU_TRANSFORM_2D, 2, 0, vertices);
		j += sliceWidth;
	}
	
	sceGuFinish();
	sceGuSync(0, 0);
}
Image* createImage(int width, int height)
{
	Image* image = (Image*) malloc(sizeof(Image));
	if (!image) return NULL;
	image->imageWidth = width;
	image->imageHeight = height;
	image->textureWidth = getNextPower2(width);
	image->textureHeight = getNextPower2(height);
	image->data = (Color*) memalign(16, image->textureWidth * image->textureHeight * sizeof(Color));
	if (!image->data) return NULL;
	memset(image->data, 0, image->textureWidth * image->textureHeight * sizeof(Color));
	return image;
}
void freeImage(Image* image)
{
	free(image->data);
	free(image);
}
void clearImage(Color color, Image* image)
{
	int i;
	int size = image->textureWidth * image->textureHeight;
	Color* data = image->data;
	for (i = 0; i < size; i++, data++) *data = color;
}
void clearScreen(Color color)
{
	if (!initialized) return;
	guStart();
	sceGuClearDepth(0);
	sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
	sceGuFinish();
	sceGuSync(0, 0);
}
void fillImageRect(Color color, int x0, int y0, int width, int height, Image* image)
{
	int skipX = image->textureWidth - width;
	int x, y;
	Color* data = image->data + x0 + y0 * image->textureWidth;
	for (y = 0; y < height; y++, data += skipX) {
		for (x = 0; x < width; x++, data++) *data = color;
	}
}
void fillScreenRect(Color color, int x0, int y0, int width, int height)
{
	if (!initialized) return;
	int skipX = PSP_LINE_SIZE - width;
	int x, y;
	Color* data = getVramDrawBuffer() + x0 + y0 * PSP_LINE_SIZE;
	for (y = 0; y < height; y++, data += skipX) {
		for (x = 0; x < width; x++, data++) *data = color;
	}
}
void putPixelScreen(Color color, int x, int y)
{
	Color* vram = getVramDrawBuffer();
	vram[PSP_LINE_SIZE * y + x] = color;
}
void putPixelImage(Color color, int x, int y, Image* image)
{
	image->data[x + y * image->textureWidth] = color;
}
Color getPixelScreen(int x, int y)
{
	Color* vram = getVramDrawBuffer();
	return vram[PSP_LINE_SIZE * y + x];
}
Color getPixelImage(int x, int y, Image* image)
{
	return image->data[x + y * image->textureWidth];
}
void printTextScreen(int x, int y, const char* text, u32 color)
{
	int c, i, j, l;
	u8 *font;
	Color *vram_ptr;
	Color *vram;
	
	if (!initialized) return;
	for (c = 0; c < strlen(text); c++) {
		if (x < 0 || x + 8 > SCREEN_WIDTH || y < 0 || y + 8 > SCREEN_HEIGHT) break;
		char ch = text[c];
		vram = getVramDrawBuffer() + x + y * PSP_LINE_SIZE;
		
		font = &msx[ (int)ch * 8];
		for (i = l = 0; i < 8; i++, l += 8, font++) {
			vram_ptr  = vram;
			for (j = 0; j < 8; j++) {
				if ((*font & (128 >> j))) *vram_ptr = color;
				vram_ptr++;
			}
			vram += PSP_LINE_SIZE;
		}
		x += 8;
	}
}
void printTextImage(int x, int y, const char* text, u32 color, Image* image)
{
	int c, i, j, l;
	u8 *font;
	Color *data_ptr;
	Color *data;
	
	if (!initialized) return;
	for (c = 0; c < strlen(text); c++) {
		if (x < 0 || x + 8 > image->imageWidth || y < 0 || y + 8 > image->imageHeight) break;
		char ch = text[c];
		data = image->data + x + y * image->textureWidth;
		
		font = &msx[ (int)ch * 8];
		for (i = l = 0; i < 8; i++, l += 8, font++) {
			data_ptr  = data;
			for (j = 0; j < 8; j++) {
				if ((*font & (128 >> j))) *data_ptr = color;
				data_ptr++;
			}
			data += image->textureWidth;
		}
		x += 8;
	}
}
void saveImage(const char* filename, Color* data, int width, int height, int lineSize, int saveAlpha)
{
	png_structp png_ptr;
	png_infop info_ptr;
	FILE* fp;
	int i, x, y;
	u8* line;
	
	if ((fp = fopen(filename, "wb")) == NULL) return;
	png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
	if (!png_ptr) return;
	info_ptr = png_create_info_struct(png_ptr);
	if (!info_ptr) {
		png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
		return;
	}
	png_init_io(png_ptr, fp);
	png_set_IHDR(png_ptr, info_ptr, width, height, 8,
		saveAlpha ? PNG_COLOR_TYPE_RGBA : PNG_COLOR_TYPE_RGB,
		PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
	png_write_info(png_ptr, info_ptr);
	line = (u8*) malloc(width * (saveAlpha ? 4 : 3));
	for (y = 0; y < height; y++) {
		for (i = 0, x = 0; x < width; x++) {
			Color color = data[x + y * lineSize];
			u8 r = color & 0xff; 
			u8 g = (color >> 8) & 0xff;
			u8 b = (color >> 16) & 0xff;
			u8 a = saveAlpha ? (color >> 24) & 0xff : 0xff;
			line[i++] = r;
			line[i++] = g;
			line[i++] = b;
			if (saveAlpha) line[i++] = a;
		}
		png_write_row(png_ptr, line);
	}
	free(line);
	png_write_end(png_ptr, info_ptr);
	png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
	fclose(fp);
}
void flipScreen()
{
	if (!initialized) return;
	sceGuSwapBuffers();
	dispBufferNumber ^= 1;
}
static void drawLine(int x0, int y0, int x1, int y1, int color, Color* destination, int width)
{
	int dy = y1 - y0;
	int dx = x1 - x0;
	int stepx, stepy;
	
	if (dy < 0) { dy = -dy;  stepy = -width; } else { stepy = width; }
	if (dx < 0) { dx = -dx;  stepx = -1; } else { stepx = 1; }
	dy <<= 1;
	dx <<= 1;
	
	y0 *= width;
	y1 *= width;
	destination[x0+y0] = color;
	if (dx > dy) {
		int fraction = dy - (dx >> 1);
		while (x0 != x1) {
			if (fraction >= 0) {
				y0 += stepy;
				fraction -= dx;
			}
			x0 += stepx;
			fraction += dy;
			destination[x0+y0] = color;
		}
	} else {
		int fraction = dx - (dy >> 1);
		while (y0 != y1) {
			if (fraction >= 0) {
				x0 += stepx;
				fraction -= dy;
			}
			y0 += stepy;
			fraction += dx;
			destination[x0+y0] = color;
		}
	}
}
void drawLineScreen(int x0, int y0, int x1, int y1, Color color)
{
	drawLine(x0, y0, x1, y1, color, getVramDrawBuffer(), PSP_LINE_SIZE);
}
void drawLineImage(int x0, int y0, int x1, int y1, Color color, Image* image)
{
	drawLine(x0, y0, x1, y1, color, image->data, image->textureWidth);
}
#define BUF_WIDTH (512)
#define SCR_WIDTH (480)
#define SCR_HEIGHT (272)
#define PIXEL_SIZE (4) /* change this if you change to another screenmode */
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2) /* zbuffer seems to be 16-bit? */
void initGraphics()
{
	dispBufferNumber = 0;
	sceGuInit();
	guStart();
	sceGuDrawBuffer(GU_PSM_8888, (void*)FRAMEBUFFER_SIZE, PSP_LINE_SIZE);
	sceGuDispBuffer(SCREEN_WIDTH, SCREEN_HEIGHT, (void*)0, PSP_LINE_SIZE);
	sceGuClear(GU_COLOR_BUFFER_BIT | GU_DEPTH_BUFFER_BIT);
	sceGuDepthBuffer((void*) (FRAMEBUFFER_SIZE*2), PSP_LINE_SIZE);
	sceGuOffset(2048 - (SCREEN_WIDTH / 2), 2048 - (SCREEN_HEIGHT / 2));
	sceGuViewport(2048, 2048, SCREEN_WIDTH, SCREEN_HEIGHT);
	sceGuDepthRange(0xc350, 0x2710);
	sceGuScissor(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
	sceGuEnable(GU_SCISSOR_TEST);
	sceGuAlphaFunc(GU_GREATER, 0, 0xff);
	sceGuEnable(GU_ALPHA_TEST);
	sceGuDepthFunc(GU_GEQUAL);
	sceGuEnable(GU_DEPTH_TEST);
	sceGuFrontFace(GU_CW);
	sceGuShadeModel(GU_SMOOTH);
	sceGuEnable(GU_CULL_FACE);
	sceGuEnable(GU_TEXTURE_2D);
	sceGuEnable(GU_CLIP_PLANES);
	sceGuTexMode(GU_PSM_8888, 0, 0, 0);
	sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
	sceGuTexFilter(GU_NEAREST, GU_NEAREST);
	sceGuAmbientColor(0xffffffff);
	sceGuEnable(GU_BLEND);
	sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
	sceGuFinish();
	sceGuSync(0, 0);
	sceDisplayWaitVblankStart();
	sceGuDisplay(GU_TRUE);
	initialized = 1;
}
void disableGraphics()
{
	initialized = 0;
}
void guStart()
{
	sceGuStart(GU_DIRECT, list);
}
Code: Select all
// mp3player.c: MP3 Player Implementation in C for Sony PSP
//
////////////////////////////////////////////////////////////////////////////
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspiofilemgr.h>
#include <pspdisplay.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <pspaudiolib.h>
#include "mp3player.h"
#define FALSE 0
#define TRUE !FALSE
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
#define MadErrorString(x) mad_stream_errorstr(x)
#define INPUT_BUFFER_SIZE	(5*8192)
#define OUTPUT_BUFFER_SIZE	2048	/* Must be an integer multiple of 4. */
/* This table represents the subband-domain filter characteristics. It
* is initialized by the ParseArgs() function and is used as
* coefficients against each subband samples when DoFilter is non-nul.
*/
mad_fixed_t Filter[32];
/* DoFilter is non-nul when the Filter table defines a filter bank to
* be applied to the decoded audio subbands.
*/
int DoFilter = 0;
/* Define printf, just to make typing easier */
#define printf	pspDebugScreenPrintf
#define NUMCHANNELS 2
u8 *ptr;
long size;
long samplesInOutput = 0;
//////////////////////////////////////////////////////////////////////
// Global local variables
//////////////////////////////////////////////////////////////////////
//libmad lowlevel stuff
// The following variables contain the music data, ie they don't change value until you load a new file
struct mad_stream Stream;
struct mad_frame Frame;
struct mad_synth Synth;
mad_timer_t Timer;
signed short OutputBuffer[OUTPUT_BUFFER_SIZE];
unsigned char InputBuffer[INPUT_BUFFER_SIZE + MAD_BUFFER_GUARD],
    *OutputPtr = (unsigned char *) OutputBuffer, *GuardPtr = NULL;
const unsigned char *OutputBufferEnd = (unsigned char *) OutputBuffer + OUTPUT_BUFFER_SIZE * 2;
int Status = 0, i;
unsigned long FrameCount = 0;
// The following variables are maintained and updated by the tracker during playback
static int isPlaying;		// Set to true when a mod is being played
//////////////////////////////////////////////////////////////////////
// These are the public functions
//////////////////////////////////////////////////////////////////////
static int myChannel;
static int eos;
/* Define printf, just to make typing easier */
#define printf	pspDebugScreenPrintf
/*void MP3setStubs(codecStubs * stubs)
{
    stubs->init = MP3_Init;
    stubs->load = MP3_Load;
    stubs->play = MP3_Play;
    stubs->pause = MP3_Pause;
    stubs->stop = MP3_Stop;
    stubs->end = MP3_End;
    stubs->time = MP3_GetTimeString;
    stubs->tick = NULL;
    stubs->eos = MP3_EndOfStream;
    memcpy(stubs->extension, "mp3\0" "\0\0\0\0", 2 * 4);
}*/
static int PrintFrameInfo(struct mad_header *Header)
{
    const char *Layer, *Mode, *Emphasis;
    /* Convert the layer number to it's printed representation. */
    switch (Header->layer) {
    case MAD_LAYER_I:
	Layer = "I";
	break;
    case MAD_LAYER_II:
	Layer = "II";
	break;
    case MAD_LAYER_III:
	Layer = "III";
	break;
    default:
	Layer = "(unexpected layer value)";
	break;
    }
    /* Convert the audio mode to it's printed representation. */
    switch (Header->mode) {
    case MAD_MODE_SINGLE_CHANNEL:
	Mode = "single channel";
	break;
    case MAD_MODE_DUAL_CHANNEL:
	Mode = "dual channel";
	break;
    case MAD_MODE_JOINT_STEREO:
	Mode = "joint (MS/intensity) stereo";
	break;
    case MAD_MODE_STEREO:
	Mode = "normal LR stereo";
	break;
    default:
	Mode = "(unexpected mode value)";
	break;
    }
    /* Convert the emphasis to it's printed representation. Note that
     * the MAD_EMPHASIS_RESERVED enumeration value appeared in libmad
     * version 0.15.0b.
     */
    switch (Header->emphasis) {
    case MAD_EMPHASIS_NONE:
	Emphasis = "no";
	break;
    case MAD_EMPHASIS_50_15_US:
	Emphasis = "50/15 us";
	break;
    case MAD_EMPHASIS_CCITT_J_17:
	Emphasis = "CCITT J.17";
	break;
#if (MAD_VERSION_MAJOR>=1) || \
  ((MAD_VERSION_MAJOR==0) && (MAD_VERSION_MINOR>=15))
    case MAD_EMPHASIS_RESERVED:
	Emphasis = "reserved(!)";
	break;
#endif
    default:
	Emphasis = "(unexpected emphasis value)";
	break;
    }
    pspDebugScreenSetXY(0, 29);
    printf("%lu kb/s audio MPEG layer %s stream at %dHz\n", Header->bitrate / 1000, Layer, Header->samplerate);
    sceDisplayWaitVblankStart();
    return (0);
}
/****************************************************************************
* Applies a frequency-domain filter to audio data in the subband-domain.	*
****************************************************************************/
static void ApplyFilter(struct mad_frame *Frame)
{
    int Channel, Sample, Samples, SubBand;
    /* There is two application loops, each optimized for the number
     * of audio channels to process. The first alternative is for
     * two-channel frames, the second is for mono-audio.
     */
    Samples = MAD_NSBSAMPLES(&Frame->header);
    if (Frame->header.mode != MAD_MODE_SINGLE_CHANNEL)
	for (Channel = 0; Channel < 2; Channel++)
	    for (Sample = 0; Sample < Samples; Sample++)
		for (SubBand = 0; SubBand < 32; SubBand++)
		    Frame->sbsample[Channel][Sample][SubBand] =
			mad_f_mul(Frame->sbsample[Channel][Sample][SubBand], Filter[SubBand]);
    else
	for (Sample = 0; Sample < Samples; Sample++)
	    for (SubBand = 0; SubBand < 32; SubBand++)
		Frame->sbsample[0][Sample][SubBand] = mad_f_mul(Frame->sbsample[0][Sample][SubBand], Filter[SubBand]);
}
/****************************************************************************
* Converts a sample from libmad's fixed point number format to a signed	*
* short (16 bits).															*
****************************************************************************/
static signed short MadFixedToSshort(mad_fixed_t Fixed)
{
    /* A fixed point number is formed of the following bit pattern:
     *
     * SWWWFFFFFFFFFFFFFFFFFFFFFFFFFFFF
     * MSB                          LSB
     * S ==> Sign (0 is positive, 1 is negative)
     * W ==> Whole part bits
     * F ==> Fractional part bits
     *
     * This pattern contains MAD_F_FRACBITS fractional bits, one
     * should alway use this macro when working on the bits of a fixed
     * point number. It is not guaranteed to be constant over the
     * different platforms supported by libmad.
     *
     * The signed short value is formed, after clipping, by the least
     * significant whole part bit, followed by the 15 most significant
     * fractional part bits. Warning: this is a quick and dirty way to
     * compute the 16-bit number, madplay includes much better
     * algorithms.
     */
    /* Clipping */
    if (Fixed >= MAD_F_ONE)
	return (SHRT_MAX);
    if (Fixed <= -MAD_F_ONE)
	return (-SHRT_MAX);
    /* Conversion. */
    Fixed = Fixed >> (MAD_F_FRACBITS - 15);
    return ((signed short) Fixed);
}
static void MP3Callback(void *_buf2, unsigned int numSamples, void *pdata)
{
  short *_buf = (short *)_buf2;
    unsigned long samplesOut = 0;
    //      u8 justStarted = 1;
    if (isPlaying == TRUE) {	//  Playing , so mix up a buffer
	if (samplesInOutput > 0) {
	    //printf("%d samples in buffer\n", samplesInOutput);
	    if (samplesInOutput > numSamples) {
		memcpy((char *) _buf, (char *) OutputBuffer, numSamples * 2 * 2);
		samplesOut = numSamples;
		samplesInOutput -= numSamples;
	    } else {
		memcpy((char *) _buf, (char *) OutputBuffer, samplesInOutput * 2 * 2);
		samplesOut = samplesInOutput;
		samplesInOutput = 0;
	    }
	}
	while (samplesOut < numSamples) {
	    if (Stream.buffer == NULL || Stream.error == MAD_ERROR_BUFLEN) {
		//size_t ReadSize, Remaining;
		//unsigned char *ReadStart;
		/* {2} libmad may not consume all bytes of the input
		 * buffer. If the last frame in the buffer is not wholly
		 * contained by it, then that frame's start is pointed by
		 * the next_frame member of the Stream structure. This
		 * common situation occurs when mad_frame_decode() fails,
		 * sets the stream error code to MAD_ERROR_BUFLEN, and
		 * sets the next_frame pointer to a non NULL value. (See
		 * also the comment marked {4} bellow.)
		 *
		 * When this occurs, the remaining unused bytes must be
		 * put back at the beginning of the buffer and taken in
		 * account before refilling the buffer. This means that
		 * the input buffer must be large enough to hold a whole
		 * frame at the highest observable bit-rate (currently 448
		 * kb/s). XXX=XXX Is 2016 bytes the size of the largest
		 * frame? (448000*(1152/32000))/8
		 */
		/*if(Stream.next_frame!=NULL)
		   {
		   Remaining=Stream.bufend-Stream.next_frame;
		   memmove(InputBuffer,Stream.next_frame,Remaining);
		   ReadStart=InputBuffer+Remaining;
		   ReadSize=INPUT_BUFFER_SIZE-Remaining;
		   }
		   else
		   ReadSize=INPUT_BUFFER_SIZE,
		   ReadStart=InputBuffer,
		   Remaining=0;
		 */
		/* Fill-in the buffer. If an error occurs print a message
		 * and leave the decoding loop. If the end of stream is
		 * reached we also leave the loop but the return status is
		 * left untouched.
		 */
		//ReadSize=BstdRead(ReadStart,1,ReadSize,BstdFile);
		//printf("readsize: %d\n", ReadSize);
		//sceDisplayWaitVblankStart();
		/*if(ReadSize<=0)
		   {
		   //printf("read error on bit-stream (%s - %d)\n", error_to_string(errno), errno);
		   //   Status=1;
		   if(BstdFile->eof) {
		   printf("end of input stream\n");
		   sceDisplayWaitVblankStart();
		   }
		   //break;
		   printf("Readsize was <=0 in player callback\n");
		   sceDisplayWaitVblankStart();
		   } */
		/* {3} When decoding the last frame of a file, it must be
		 * followed by MAD_BUFFER_GUARD zero bytes if one wants to
		 * decode that last frame. When the end of file is
		 * detected we append that quantity of bytes at the end of
		 * the available data. Note that the buffer can't overflow
		 * as the guard size was allocated but not used the the
		 * buffer management code. (See also the comment marked
		 * {1}.)
		 *
		 * In a message to the mad-dev mailing list on May 29th,
		 * 2001, Rob Leslie explains the guard zone as follows:
		 *
		 *    "The reason for MAD_BUFFER_GUARD has to do with the
		 *    way decoding is performed. In Layer III, Huffman
		 *    decoding may inadvertently read a few bytes beyond
		 *    the end of the buffer in the case of certain invalid
		 *    input. This is not detected until after the fact. To
		 *    prevent this from causing problems, and also to
		 *    ensure the next frame's main_data_begin pointer is
		 *    always accessible, MAD requires MAD_BUFFER_GUARD
		 *    (currently 8) bytes to be present in the buffer past
		 *    the end of the current frame in order to decode the
		 *    frame."
		 */
		/*if(BstdFileEofP(BstdFile))
		   {
		   GuardPtr=ReadStart+ReadSize;
		   memset(GuardPtr,0,MAD_BUFFER_GUARD);
		   ReadSize+=MAD_BUFFER_GUARD;
		   } */
		/* Pipe the new buffer content to libmad's stream decoder
		 * facility.
		 */
		mad_stream_buffer(&Stream, ptr, size);
		Stream.error = 0;
	    }
	    /* Decode the next MPEG frame. The streams is read from the
	     * buffer, its constituents are break down and stored the the
	     * Frame structure, ready for examination/alteration or PCM
	     * synthesis. Decoding options are carried in the Frame
	     * structure from the Stream structure.
	     *
	     * Error handling: mad_frame_decode() returns a non zero value
	     * when an error occurs. The error condition can be checked in
	     * the error member of the Stream structure. A mad error is
	     * recoverable or fatal, the error status is checked with the
	     * MAD_RECOVERABLE macro.
	     *
	     * {4} When a fatal error is encountered all decoding
	     * activities shall be stopped, except when a MAD_ERROR_BUFLEN
	     * is signaled. This condition means that the
	     * mad_frame_decode() function needs more input to complete
	     * its work. One shall refill the buffer and repeat the
	     * mad_frame_decode() call. Some bytes may be left unused at
	     * the end of the buffer if those bytes forms an incomplete
	     * frame. Before refilling, the remaining bytes must be moved
	     * to the beginning of the buffer and used for input for the
	     * next mad_frame_decode() invocation. (See the comments
	     * marked {2} earlier for more details.)
	     *
	     * Recoverable errors are caused by malformed bit-streams, in
	     * this case one can call again mad_frame_decode() in order to
	     * skip the faulty part and re-sync to the next frame.
	     */
	    if (mad_frame_decode(&Frame, &Stream)) {
		if (MAD_RECOVERABLE(Stream.error)) {
		    /* Do not print a message if the error is a loss of
		     * synchronization and this loss is due to the end of
		     * stream guard bytes. (See the comments marked {3}
		     * supra for more informations about guard bytes.)
		     */
		    if (Stream.error != MAD_ERROR_LOSTSYNC || Stream.this_frame != GuardPtr) {
			printf("recoverable frame level error (%s)\n", MadErrorString(&Stream));
			sceDisplayWaitVblankStart();
		    }
		    return;	//continue;
		} else if (Stream.error == MAD_ERROR_BUFLEN) {
		    eos = 1;
		    return;	//continue;
		} else {
		    printf("unrecoverable frame level error (%s).\n", MadErrorString(&Stream));
		    sceDisplayWaitVblankStart();
		    Status = 1;
		    MP3_Stop();	//break;
		}
	    }
	    /* The characteristics of the stream's first frame is printed
	     * on stderr. The first frame is representative of the entire
	     * stream.
	     */
	    if (FrameCount == 0)
		if (PrintFrameInfo(&Frame.header)) {
		    Status = 1;
		    //break;
		}
	    /* Accounting. The computed frame duration is in the frame
	     * header structure. It is expressed as a fixed point number
	     * whole data type is mad_timer_t. It is different from the
	     * samples fixed point format and unlike it, it can't directly
	     * be added or subtracted. The timer module provides several
	     * functions to operate on such numbers. Be careful there, as
	     * some functions of libmad's timer module receive some of
	     * their mad_timer_t arguments by value!
	     */
	    FrameCount++;
	    mad_timer_add(&Timer, Frame.header.duration);
	    /* Between the frame decoding and samples synthesis we can
	     * perform some operations on the audio data. We do this only
	     * if some processing was required. Detailed explanations are
	     * given in the ApplyFilter() function.
	     */
	    if (DoFilter)
		ApplyFilter(&Frame);
	    /* Once decoded the frame is synthesized to PCM samples. No errors
	     * are reported by mad_synth_frame();
	     */
	    mad_synth_frame(&Synth, &Frame);
	    /* Synthesized samples must be converted from libmad's fixed
	     * point number to the consumer format. Here we use unsigned
	     * 16 bit big endian integers on two channels. Integer samples
	     * are temporarily stored in a buffer that is flushed when
	     * full.
	     */
	    for (i = 0; i < Synth.pcm.length; i++) {
		signed short Sample;
		//printf("%d < %d\n", samplesOut, numSamples);
		if (samplesOut < numSamples) {
		    //printf("I really get here\n");
		    /* Left channel */
		    Sample = MadFixedToSshort(Synth.pcm.samples[0][i]);
		    // *(OutputPtr++)=Sample>>8;
		    // *(OutputPtr++)=Sample&0xff;
		    _buf[samplesOut * 2] = Sample;
		    /* Right channel. If the decoded stream is monophonic then
		     * the right output channel is the same as the left one.
		     */
		    if (MAD_NCHANNELS(&Frame.header) == 2)
			Sample = MadFixedToSshort(Synth.pcm.samples[1][i]);
		    // *(OutputPtr++)=Sample>>8;
		    // *(OutputPtr++)=Sample&0xff;
		    //_buf[samplesOut*2]=0;//Sample;
		    _buf[samplesOut * 2 + 1] = Sample;
		    samplesOut++;
		} else {
		    //printf("%d < %d of %d\n", samplesOut, numSamples, Synth.pcm.length);
		    Sample = MadFixedToSshort(Synth.pcm.samples[0][i]);
		    OutputBuffer[samplesInOutput * 2] = Sample;
		    //OutputBuffer[samplesInOutput*4+1]=0;//Sample>>8;
		    //OutputBuffer[samplesInOutput*4+2]=0;//Sample&0xff;
		    if (MAD_NCHANNELS(&Frame.header) == 2)
			Sample = MadFixedToSshort(Synth.pcm.samples[1][i]);
		    OutputBuffer[samplesInOutput * 2 + 1] = Sample;
		    //OutputBuffer[samplesInOutput*4+3]=0;//Sample>>8;
		    //OutputBuffer[samplesInOutput*4+4]=0;//Sample&0xff;
		    samplesInOutput++;
		}
	    }
	}
    } else {			//  Not Playing , so clear buffer
	{
	    int count;
	    for (count = 0; count < numSamples * 2; count++)
		*(_buf + count) = 0;
	}
    }
}
void MP3_Init(int channel)
{
    myChannel = channel;
    isPlaying = FALSE;
    pspAudioSetChannelCallback(myChannel, MP3Callback,0);
    /* First the structures used by libmad must be initialized. */
    mad_stream_init(&Stream);
    mad_frame_init(&Frame);
    mad_synth_init(&Synth);
    mad_timer_reset(&Timer);
    //ModPlay_Load("",data);
}
void MP3_FreeTune()
{
    /* The input file was completely read; the memory allocated by our
     * reading module must be reclaimed.
     */
    if (ptr)
	free(ptr);
    //sceIoClose(BstdFile->fd);
    //BstdFileDestroy(BstdFile);
    /* Mad is no longer used, the structures that were initialized must
     * now be cleared.
     */
    mad_synth_finish(&Synth);
    mad_frame_finish(&Frame);
    mad_stream_finish(&Stream);
    /* If the output buffer is not empty and no error occurred during
     * the last write, then flush it.
     */
    /*if(OutputPtr!=OutputBuffer && Status!=2)
       {
       size_t       BufferSize=OutputPtr-OutputBuffer;
       if(fwrite(OutputBuffer,1,BufferSize,OutputFp)!=BufferSize)
       {
       fprintf(stderr,"%s: PCM write error (%s).\n",
       ProgName,strerror(errno));
       Status=2;
       }
       } */
    /* Accounting report if no error occurred. */
    if (!Status) {
	char Buffer[80];
	/* The duration timer is converted to a human readable string
	 * with the versatile, but still constrained mad_timer_string()
	 * function, in a fashion not unlike strftime(). The main
	 * difference is that the timer is broken into several
	 * values according some of it's arguments. The units and
	 * fracunits arguments specify the intended conversion to be
	 * executed.
	 *
	 * The conversion unit (MAD_UNIT_MINUTES in our example) also
	 * specify the order and kind of conversion specifications
	 * that can be used in the format string.
	 *
	 * It is best to examine libmad's timer.c source-code for details
	 * of the available units, fraction of units, their meanings,
	 * the format arguments, etc.
	 */
	mad_timer_string(Timer, Buffer, "%lu:%02lu.%03u", MAD_UNITS_MINUTES, MAD_UNITS_MILLISECONDS, 0);
	printf("%lu frames decoded (%s).\n", FrameCount, Buffer);
	sceDisplayWaitVblankStart();
	sceKernelDelayThread(500000);
    }
}
void MP3_End()
{
    MP3_Stop();
    pspAudioSetChannelCallback(myChannel, 0,0);
    MP3_FreeTune();
}
//////////////////////////////////////////////////////////////////////
// Functions - Local and not public
//////////////////////////////////////////////////////////////////////
//  This is the initialiser and module loader
//  This is a general call, which loads the module from the 
//  given address into the modplayer
//
//  It basically loads into an internal format, so once this function
//  has returned the buffer at 'data' will not be needed again.
int MP3_Load(char *filename)
{
    int fd;
    eos = 0;
    //psp_stats pstat;
    //sceIoGetstat(filename, &pstat);
    if ((fd = sceIoOpen(filename, PSP_O_RDONLY, 0777)) > 0) {
	//  opened file, so get size now
	size = sceIoLseek(fd, 0, PSP_SEEK_END);
	sceIoLseek(fd, 0, PSP_SEEK_SET);
	ptr = (unsigned char *) malloc(size + 8);
	memset(ptr, 0, size + 8);
	if (ptr != 0) {		// Read file in
	    sceIoRead(fd, ptr, size);
	} else {
	    printf("Error allocing\n");
	    sceIoClose(fd);
	    return 0;
	}
	// Close file
	sceIoClose(fd);
    } else {
	return 0;
    }
    //  Set volume to full ready to play
    //SetMasterVolume(64);
    isPlaying = FALSE;
    return 1;
}
// This function initialises for playing, and starts
int MP3_Play()
{
    // See if I'm already playing
    if (isPlaying)
	return FALSE;
    isPlaying = TRUE;
    return TRUE;
}
void MP3_Pause()
{
    isPlaying = !isPlaying;
}
int MP3_Stop()
{
    //stop playing
    isPlaying = FALSE;
    //clear buffer
    memset(OutputBuffer, 0, OUTPUT_BUFFER_SIZE);
    OutputPtr = (unsigned char *) OutputBuffer;
    //seek to beginning of file
    //sceIoLseek(BstdFile->fd, 0, SEEK_SET);
    return TRUE;
}
void MP3_GetTimeString(char *dest)
{
    mad_timer_string(Timer, dest, "%02lu:%02u:%02u", MAD_UNITS_HOURS, MAD_UNITS_MILLISECONDS, 0);
}
int MP3_EndOfStream()
{
    if (eos == 1)
	return 1;
    return 0;
}
Code: Select all
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspdebug.h>
#include <pspaudio.h>
#include <psppower.h>
#include <png.h>
#include "mp3player.h"
#include "graphics.h"
PSP_MODULE_INFO("deathcore", 0, 1, 1);
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback() {
 	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 Music_player(char* fileName)
{
	pspAudioInit();
	MP3_Init(1);
	MP3_Load(fileName);
	MP3_Play();
if(MP3_EndOfStream)
	{
	MP3_Stop();
	MP3_FreeTune();
	}
    return 0;
}
int SetupMenu(void)
{
pspDebugScreenSetXY(0,0);
printf("\t\t\t\t<--DeathCorev1.0 by Rangu2057-->\n\n");
printf("\t\t\tNew Game\n\n");
printf("\t\t\tLoad Game\n\n");
printf("\t\t\tCredits\n\n");
}
int main(void){
SceCtrlData pad;
pspDebugScreenInit();
SetupCallbacks;
Image* bg;
bg = loadImage("./menu.png");
while(1) {
      sceCtrlReadBufferPositive(&pad, 1);
	blitAlphaImageToScreen(0, 0 , 480, 272, bg, 0, 0);
	sceDisplayWaitVblankStart();
	flipScreen();
	}
SetupMenu();
Music_player("menu.mp3");
if(pad.buttons & PSP_CTRL_HOME)
	{
	MP3_Stop();
	MP3_FreeTune();
	sceKernelExitGame();
	}
}
Code: Select all
graphics.c:173: error: expected declaration specifiers or '...' before 'Image'
graphics.c:174: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:207: error: expected declaration specifiers before 'Image'
graphics.c:221: error: expected ')' before '*' token
graphics.c:227: error: expected ')' before 'color'
graphics.c:235: error: expected ')' before 'color'
graphics.c:245: error: expected ')' before 'color'
graphics.c:255: error: expected ')' before 'color'
graphics.c:266: error: expected ')' before 'color'
graphics.c:272: error: expected ')' before 'color'
graphics.c:277: error: expected declaration specifiers before 'Color'
graphics.c:283: error: expected declaration specifiers before 'Color'
graphics.c:289: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:315: error: expected declaration specifiers or '...' before 'Image'
graphics.c:316: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:342: error: expected declaration specifiers or '...' before 'Color'
graphics.c:343: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:385: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:391: error: expected declaration specifiers or '...' before 'Color'
graphics.c:392: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:430: error: expected declaration specifiers or '...' before 'Color'
graphics.c:431: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:435: error: expected declaration specifiers or '...' before 'Color'
graphics.c:435: error: expected declaration specifiers or '...' before 'Image'
graphics.c:436: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:448: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:487: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:492: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
{' token
graphics.c:26: error: declaration for parameter 'initialized' but no such parame
ter
graphics.c:25: error: declaration for parameter 'dispBufferNumber' but no such p
arameter
graphics.c:24: error: declaration for parameter 'list' but no such parameter
graphics.c:22: error: declaration for parameter 'msx' but no such parameter
graphics.c:20: error: declaration for parameter 'Vertex' but no such parameter
framebuffer.h:6: error: declaration for parameter 'g_vram_base' but no such para
meter
graphics.h:294: error: declaration for parameter 'guStart' but no such parameter
graphics.h:278: error: declaration for parameter 'drawLineImage' but no such par
ameter
graphics.h:266: error: declaration for parameter 'drawLineScreen' but no such pa
rameter
graphics.h:254: error: declaration for parameter 'disableGraphics' but no such p
arameter
graphics.h:249: error: declaration for parameter 'initGraphics' but no such para
meter
graphics.h:244: error: declaration for parameter 'flipScreen' but no such parame
ter
graphics.h:239: error: declaration for parameter 'saveImage' but no such paramet
er
graphics.h:226: error: declaration for parameter 'printTextImage' but no such pa
rameter
graphics.h:215: error: declaration for parameter 'printTextScreen' but no such p
arameter
graphics.h:106: error: declaration for parameter 'blitAlphaImageToScreen' but no
 such parameter
graphics.h:88: error: declaration for parameter 'blitAlphaImageToImage' but no s
uch parameter
graphics.h:69: error: declaration for parameter 'blitImageToScreen' but no such
parameter
graphics.h:51: error: declaration for parameter 'blitImageToImage' but no such p
arameter
graphics.h:23: error: declaration for parameter 'Image' but no such parameter
graphics.h:10: error: declaration for parameter 'Color' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1438: error: declaration for parameter 'guSwap
BuffersBehaviour' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1426: error: declaration for parameter 'sceGuD
rawArrayN' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1424: error: declaration for parameter 'sceGuM
orphWeight' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1409: error: declaration for parameter 'sceGuB
oneMatrix' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1394: error: declaration for parameter 'sceGuS
etMatrix' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1380: error: declaration for parameter 'sceGuD
rawSpline' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1378: error: declaration for parameter 'sceGuP
atchPrim' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1371: error: declaration for parameter 'sceGuP
atchFrontFace' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1369: error: declaration for parameter 'sceGuP
atchDivide' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1361: error: declaration for parameter 'sceGuD
rawBezier' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1350: error: declaration for parameter 'sceGuV
iewport' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1335: error: declaration for parameter 'sceGuS
cissor' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1323: error: declaration for parameter 'sceGuO
ffset' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1308: error: declaration for parameter 'sceGuC
lutMode' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1292: error: declaration for parameter 'sceGuC
lutLoad' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1282: error: declaration for parameter 'sceGuT
exWrap' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1270: error: declaration for parameter 'sceGuT
exSync' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1262: error: declaration for parameter 'sceGuT
exSlope' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1261: error: declaration for parameter 'sceGuT
exScale' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1250: error: declaration for parameter 'sceGuT
exProjMapMode' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1237: error: declaration for parameter 'sceGuT
exOffset' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1226: error: declaration for parameter 'sceGuT
exMode' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1208: error: declaration for parameter 'sceGuT
exMapMode' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1194: error: declaration for parameter 'sceGuT
exLevelMode' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1181: error: declaration for parameter 'sceGuT
exImage' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1165: error: declaration for parameter 'sceGuT
exFunc' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1133: error: declaration for parameter 'sceGuT
exFlush' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1125: error: declaration for parameter 'sceGuT
exFilter' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1109: error: declaration for parameter 'sceGuT
exEnvColor' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1098: error: declaration for parameter 'sceGuC
opyImage' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1074: error: declaration for parameter 'sceGuS
hadeModel' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1063: error: declaration for parameter 'sceGuS
etDither' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1054: error: declaration for parameter 'sceGuL
ogicalOp' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1027: error: declaration for parameter 'sceGuF
rontFace' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1014: error: declaration for parameter 'sceGuS
pecular' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:1006: error: declaration for parameter 'sceGuS
tencilOp' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:986: error: declaration for parameter 'sceGuSt
encilFunc' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:967: error: declaration for parameter 'sceGuMo
delColor' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:962: error: declaration for parameter 'sceGuMa
terial' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:960: error: declaration for parameter 'sceGuBl
endFunc' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:924: error: declaration for parameter 'sceGuAm
bientColor' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:923: error: declaration for parameter 'sceGuAm
bient' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:921: error: declaration for parameter 'sceGuAl
phaFunc' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:902: error: declaration for parameter 'sceGuCo
lorMaterial' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:890: error: declaration for parameter 'sceGuCo
lorFunc' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:868: error: declaration for parameter 'sceGuCo
lor' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:861: error: declaration for parameter 'sceGuPi
xelMask' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:853: error: declaration for parameter 'sceGuCl
earStencil' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:845: error: declaration for parameter 'sceGuCl
earDepth' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:838: error: declaration for parameter 'sceGuCl
earColor' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:831: error: declaration for parameter 'sceGuCl
ear' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:819: error: declaration for parameter 'sceGuLi
ghtSpot' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:809: error: declaration for parameter 'sceGuLi
ghtMode' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:795: error: declaration for parameter 'sceGuLi
ghtColor' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:779: error: declaration for parameter 'sceGuLi
ghtAtt' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:769: error: declaration for parameter 'sceGuLi
ght' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:749: error: declaration for parameter 'sceGuDi
sable' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:740: error: declaration for parameter 'sceGuEn
able' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:717: error: declaration for parameter 'sceGuGe
tAllStatus' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:708: error: declaration for parameter 'sceGuSe
tAllStatus' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:699: error: declaration for parameter 'sceGuGe
tStatus' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:689: error: declaration for parameter 'sceGuSe
tStatus' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:679: error: declaration for parameter 'sceGuEn
dObject' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:674: error: declaration for parameter 'sceGuBe
ginObject' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:653: error: declaration for parameter 'sceGuDr
awArray' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:585: error: declaration for parameter 'sceGuSy
nc' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:562: error: declaration for parameter 'sceGuSw
apBuffers' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:555: error: declaration for parameter 'sceGuSe
ndList' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:542: error: declaration for parameter 'sceGuCh
eckList' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:535: error: declaration for parameter 'sceGuCa
llMode' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:527: error: declaration for parameter 'sceGuCa
llList' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:520: error: declaration for parameter 'sceGuFi
nishId' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:507: error: declaration for parameter 'sceGuFi
nish' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:492: error: declaration for parameter 'sceGuSt
art' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:477: error: declaration for parameter 'sceGuGe
tMemory' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:465: error: declaration for parameter 'sceGuSe
ndCommandi' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:455: error: declaration for parameter 'sceGuSe
ndCommandf' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:445: error: declaration for parameter 'sceGuSi
gnal' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:433: error: declaration for parameter 'sceGuSe
tCallback' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:420: error: declaration for parameter 'sceGuCo
ntinue' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:419: error: declaration for parameter 'sceGuBr
eak' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:417: error: declaration for parameter 'sceGuTe
rm' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:410: error: declaration for parameter 'sceGuIn
it' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:403: error: declaration for parameter 'sceGuFo
g' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:401: error: declaration for parameter 'sceGuDe
pthRange' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:386: error: declaration for parameter 'sceGuDe
pthOffset' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:384: error: declaration for parameter 'sceGuDe
pthMask' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:377: error: declaration for parameter 'sceGuDe
pthFunc' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:360: error: declaration for parameter 'sceGuDi
splay' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:348: error: declaration for parameter 'sceGuDr
awBufferList' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:339: error: declaration for parameter 'sceGuDr
awBuffer' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:319: error: declaration for parameter 'sceGuDi
spBuffer' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:303: error: declaration for parameter 'sceGuDe
pthBuffer' but no such parameter
C:/pspsdk/psp/sdk/include/pspgu.h:291: error: declaration for parameter 'GuSwapB
uffersCallback' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:201: error: declaration for parameter 'sceGeUn
setCallback' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:185: error: declaration for parameter 'sceGeDr
awSync' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:176: error: declaration for parameter 'sceGeLi
stSync' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:166: error: declaration for parameter 'PspGeSy
ncType' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:156: error: declaration for parameter 'sceGeLi
stUpdateStallAddr' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:146: error: declaration for parameter 'sceGeLi
stDeQueue' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:137: error: declaration for parameter 'sceGeLi
stEnQueueHead' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:124: error: declaration for parameter 'sceGeLi
stEnQueue' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:93: error: declaration for parameter 'sceGeGet
Mtx' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:83: error: declaration for parameter 'PspGeMat
rixTypes' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:63: error: declaration for parameter 'sceGeGet
Cmd' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:54: error: declaration for parameter 'sceGeEdr
amGetAddr' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:47: error: declaration for parameter 'sceGeEdr
amGetSize' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:40: error: declaration for parameter 'PspGeCal
lbackData' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:27: error: declaration for parameter 'PspGeCal
lback' but no such parameter
C:/pspsdk/psp/sdk/include/pspge.h:24: error: declaration for parameter 'PspGeCon
text' but no such parameter
graphics.c:494: error: expected '{' at end of input
MAKE: *** [graphics.o] Error 1
C:\PSPSDK\DV1>