mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-03 16:51:27 +00:00
Merge branch 'master' into patch-2
This commit is contained in:
@@ -77,14 +77,14 @@ struct Vertex __attribute__((aligned(16))) vertices[12*3] =
|
|||||||
|
|
||||||
int done = 0;
|
int done = 0;
|
||||||
/* Exit callback */
|
/* Exit callback */
|
||||||
int exit_callback(void)
|
int exit_callback(int arg1, int arg2, void *common)
|
||||||
{
|
{
|
||||||
done = 1;
|
done = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Callback thread */
|
/* Callback thread */
|
||||||
void CallbackThread(void *arg)
|
int CallbackThread(SceSize args, void *arg)
|
||||||
{
|
{
|
||||||
int cbid;
|
int cbid;
|
||||||
|
|
||||||
@@ -92,6 +92,7 @@ void CallbackThread(void *arg)
|
|||||||
sceKernelRegisterExitCallback(cbid);
|
sceKernelRegisterExitCallback(cbid);
|
||||||
|
|
||||||
sceKernelSleepThreadCB();
|
sceKernelSleepThreadCB();
|
||||||
|
return cbid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sets up the callback thread and returns its thread id */
|
/* Sets up the callback thread and returns its thread id */
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#include <pspgu.h>
|
#include <pspgu.h>
|
||||||
#include <pspgum.h>
|
#include <pspgum.h>
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
#include "mt19937.h"
|
#include "mt19937.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -31,7 +32,7 @@
|
|||||||
|
|
||||||
float shift23=(float)(1<<23);
|
float shift23=(float)(1<<23);
|
||||||
float OOshift23=1.0f/(float)(1<<23);
|
float OOshift23=1.0f/(float)(1<<23);
|
||||||
static inline float floorf(float i)
|
inline float floorf(float i)
|
||||||
{ // return largest integer that is less than or equal to i
|
{ // return largest integer that is less than or equal to i
|
||||||
float k = (float)((int) i);
|
float k = (float)((int) i);
|
||||||
if (k <= i)
|
if (k <= i)
|
||||||
|
@@ -60,8 +60,8 @@ int SetupCallbacks(void)
|
|||||||
|
|
||||||
|
|
||||||
// Input and Output buffers
|
// Input and Output buffers
|
||||||
char mp3Buf[16*1024] __attribute__((aligned(64)));
|
unsigned char mp3Buf[16*1024] __attribute__((aligned(64)));
|
||||||
short pcmBuf[16*(1152/2)] __attribute__((aligned(64)));
|
unsigned char pcmBuf[16*(1152/2)] __attribute__((aligned(64)));
|
||||||
|
|
||||||
|
|
||||||
// Macro to allow formatted input without having to use stdargs.h
|
// Macro to allow formatted input without having to use stdargs.h
|
||||||
@@ -87,9 +87,9 @@ void error( char* msg )
|
|||||||
|
|
||||||
int fillStreamBuffer( int fd, int handle )
|
int fillStreamBuffer( int fd, int handle )
|
||||||
{
|
{
|
||||||
char* dst;
|
unsigned char* dst;
|
||||||
int write;
|
long int write;
|
||||||
int pos;
|
long int pos;
|
||||||
// Get Info on the stream (where to fill to, how much to fill, where to fill from)
|
// Get Info on the stream (where to fill to, how much to fill, where to fill from)
|
||||||
int status = sceMp3GetInfoToAddStreamData( handle, &dst, &write, &pos);
|
int status = sceMp3GetInfoToAddStreamData( handle, &dst, &write, &pos);
|
||||||
if (status<0)
|
if (status<0)
|
||||||
@@ -208,7 +208,7 @@ int main(int argc, char *argv[])
|
|||||||
printf("PSP Mp3 Sample v1.0 by Raphael\n\n");
|
printf("PSP Mp3 Sample v1.0 by Raphael\n\n");
|
||||||
printf("Playing '%s'...\n", MP3FILE);
|
printf("Playing '%s'...\n", MP3FILE);
|
||||||
printf(" %i Hz\n", samplingRate);
|
printf(" %i Hz\n", samplingRate);
|
||||||
printf(" %i kbit/s\n", sceMp3GetBitRate( handle ));
|
printf(" %li kbit/s\n", sceMp3GetBitRate( handle ));
|
||||||
printf(" %s\n", numChannels==2?"Stereo":"Mono");
|
printf(" %s\n", numChannels==2?"Stereo":"Mono");
|
||||||
printf(" %s\n\n", loop==0?"No loop":"Loop");
|
printf(" %s\n\n", loop==0?"No loop":"Loop");
|
||||||
int playTime = samplingRate>0?numPlayed / samplingRate:0;
|
int playTime = samplingRate>0?numPlayed / samplingRate:0;
|
||||||
|
@@ -125,7 +125,7 @@ int ReadIPLBlockTable(void *pBlockBuf)
|
|||||||
die("can't read IPL block table!");
|
die("can't read IPL block table!");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Found IPL block table at block %d\n", uiBlockNum);
|
printf("Found IPL block table at block %ld\n", uiBlockNum);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -96,7 +96,7 @@ void start_server(const char *szIpAddr)
|
|||||||
int sock;
|
int sock;
|
||||||
int new = -1;
|
int new = -1;
|
||||||
struct sockaddr_in client;
|
struct sockaddr_in client;
|
||||||
unsigned int size;
|
long unsigned int size;
|
||||||
int readbytes;
|
int readbytes;
|
||||||
char data[1024];
|
char data[1024];
|
||||||
fd_set set;
|
fd_set set;
|
||||||
|
@@ -65,7 +65,7 @@ void start_server(const char *szIpAddr)
|
|||||||
int sock;
|
int sock;
|
||||||
int new = -1;
|
int new = -1;
|
||||||
struct sockaddr_in client;
|
struct sockaddr_in client;
|
||||||
size_t size;
|
long unsigned int size;
|
||||||
int readbytes;
|
int readbytes;
|
||||||
char data[1024];
|
char data[1024];
|
||||||
fd_set set;
|
fd_set set;
|
||||||
|
Reference in New Issue
Block a user