Merge pull request #4 from artart78/master

Prxgen fixes
This commit is contained in:
artart78
2012-02-29 04:58:48 -08:00
4 changed files with 78 additions and 45 deletions

View File

@@ -10,7 +10,7 @@ INCLUDES = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel
CFLAGS = @PSPSDK_CFLAGS@
CCASFLAGS = $(CFLAGS) -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel
GE_OBJS = sceGe_user_0000.o sceGe_user_0001.o sceGe_user_0002.o sceGe_user_0003.o sceGe_user_0004.o sceGe_user_0005.o sceGe_user_0006.o sceGe_user_0007.o sceGe_user_0008.o sceGe_user_0009.o sceGe_user_0010.o sceGe_user_0011.o sceGe_user_0012.o sceGe_user_0013.o sceGe_user_0014.o sceGe_user_0015.o sceGe_user_0016.o sceGe_user_0017.o
GE_OBJS = sceGe_user_0000.o sceGe_user_0001.o sceGe_user_0002.o sceGe_user_0003.o sceGe_user_0004.o sceGe_user_0005.o sceGe_user_0006.o sceGe_user_0007.o sceGe_user_0008.o sceGe_user_0009.o sceGe_user_0010.o sceGe_user_0011.o sceGe_user_0012.o sceGe_user_0013.o sceGe_user_0014.o sceGe_user_0015.o sceGe_user_0016.o sceGe_user_0017.o sceGe_user_0018.o
GEDRIVER_OBJS = sceGe_driver_0000.o sceGe_driver_0001.o sceGe_driver_0002.o sceGe_driver_0003.o sceGe_driver_0004.o sceGe_driver_0005.o sceGe_driver_0006.o sceGe_driver_0007.o sceGe_driver_0008.o sceGe_driver_0009.o sceGe_driver_0010.o sceGe_driver_0011.o sceGe_driver_0012.o sceGe_driver_0013.o sceGe_driver_0014.o sceGe_driver_0015.o sceGe_driver_0016.o sceGe_driver_0017.o sceGe_driver_0018.o sceGe_driver_0019.o sceGe_driver_0020.o sceGe_driver_0021.o sceGe_driver_0022.o sceGe_driver_0023.o

View File

@@ -73,18 +73,18 @@ typedef struct PspGeBreakParam {
unsigned int sceGeEdramGetSize(void);
/**
* Get the address of VRAM.
* Get the eDRAM address.
*
* @return A pointer to the base of VRAM.
* @return A pointer to the base of the eDRAM.
*/
void * sceGeEdramGetAddr(void);
/**
* Retrive the current value of a GE command.
* Retrieve the current value of a GE command.
*
* @param cmd - The GE command register to retrieve.
* @param cmd - The GE command register to retrieve (0 to 0xFF, both included).
*
* @return The value of the GE command.
* @return The value of the GE command, < 0 on error.
*/
unsigned int sceGeGetCmd(int cmd);
@@ -114,16 +114,33 @@ typedef enum PspGeMatrixTypes {
* @param type - One of ::PspGeMatrixTypes.
* @param matrix - Pointer to a variable to store the matrix.
*
* @return ???
* @return < 0 on error.
*/
int sceGeGetMtx(int type, void *matrix);
/** Structure storing a stack (for CALL/RET). */
typedef struct
{
/** The stack buffer. */
unsigned int stack[8];
} PspGeStack;
/**
* Retrieve the stack of the display list currently being executed.
*
* @param stackId - The ID of the stack to retrieve.
* @param stack - Pointer to a structure to store the stack, or NULL to not store it.
*
* @return The number of stacks of the current display list, < 0 on error.
*/
int sceGeGetStack(int stackId, PspGeStack *stack);
/**
* Save the GE's current state.
*
* @param context - Pointer to a ::PspGeContext.
*
* @return ???
* @return < 0 on error.
*/
int sceGeSaveContext(PspGeContext *context);
@@ -132,7 +149,7 @@ int sceGeSaveContext(PspGeContext *context);
*
* @param context - Pointer to a ::PspGeContext.
*
* @return ???
* @return < 0 on error.
*/
int sceGeRestoreContext(const PspGeContext *context);
@@ -141,11 +158,11 @@ int sceGeRestoreContext(const PspGeContext *context);
*
* @param list - The head of the list to queue.
* @param stall - The stall address.
* If NULL then no stall address set and the list is transferred immediately.
* If NULL then no stall address is set and the list is transferred immediately.
* @param cbid - ID of the callback set by calling sceGeSetCallback
* @param arg - Structure containing GE context buffer address
*
* @return The ID of the queue.
* @return The ID of the queue, < 0 on error.
*/
int sceGeListEnQueue(const void *list, void *stall, int cbid, PspGeListArgs *arg);
@@ -154,11 +171,11 @@ int sceGeListEnQueue(const void *list, void *stall, int cbid, PspGeListArgs *arg
*
* @param list - The head of the list to queue.
* @param stall - The stall address.
* If NULL then no stall address set and the list is transferred immediately.
* If NULL then no stall address is set and the list is transferred immediately.
* @param cbid - ID of the callback set by calling sceGeSetCallback
* @param arg - Structure containing GE context buffer address
*
* @return The ID of the queue.
* @return The ID of the queue, < 0 on error.
*/
int sceGeListEnQueueHead(const void *list, void *stall, int cbid, PspGeListArgs *arg);
@@ -167,7 +184,7 @@ int sceGeListEnQueueHead(const void *list, void *stall, int cbid, PspGeListArgs
*
* @param qid - The ID of the queue.
*
* @return ???
* @return < 0 on error.
*/
int sceGeListDeQueue(int qid);
@@ -175,73 +192,85 @@ int sceGeListDeQueue(int qid);
* Update the stall address for the specified queue.
*
* @param qid - The ID of the queue.
* @param stall - The stall address to update
* @param stall - The new stall address.
*
* @return Unknown. Probably 0 if successful.
* @return < 0 on error
*/
int sceGeListUpdateStallAddr(int qid, void *stall);
/** Wait condition for ::sceGeListSync() and ::sceGeDrawSync(). */
typedef enum PspGeSyncType {
/** List status for ::sceGeListSync() and ::sceGeDrawSync(). */
typedef enum PspGeListState {
PSP_GE_LIST_DONE = 0,
PSP_GE_LIST_QUEUED,
PSP_GE_LIST_DRAWING_DONE,
PSP_GE_LIST_STALL_REACHED,
PSP_GE_LIST_CANCEL_DONE
} PspGeSyncType;
} PspGeListState;
/**
* Wait for syncronisation of a list.
*
* @param qid - The queue ID of the list to sync.
* @param syncType - Specifies the condition to wait on. One of ::PspGeSyncType.
* @param syncType - 0 if you want to wait for the list to be completed, or 1 if you just want to peek the actual state.
*
* @return ???
* @return The specified queue status, one of ::PspGeListState.
*/
int sceGeListSync(int qid, int syncType);
/**
* Wait for drawing to complete.
*
* @param syncType - Specifies the condition to wait on. One of ::PspGeSyncType.
* @param syncType - 0 if you want to wait for the drawing to be completed, or 1 if you just want to peek the state of the display list currently being executed.
*
* @return ???
* @return The current queue status, one of ::PspGeListState.
*/
int sceGeDrawSync(int syncType);
/**
* Register callback handlers for the the Ge
* Register callback handlers for the the GE.
*
* @param cb - Configured callback data structure
* @return The callback ID, < 0 on error
* @param cb - Configured callback data structure.
*
* @return The callback ID, < 0 on error.
*/
int sceGeSetCallback(PspGeCallbackData *cb);
/**
* Unregister the callback handlers
* Unregister the callback handlers.
*
* @param cbid - The ID of the callbacks, returned by sceGeSetCallback().
*
* @param cbid - The ID of the callbacks from sceGeSetCallback
* @return < 0 on error
*/
int sceGeUnsetCallback(int cbid);
/**
* Interrupt drawing queue
* Interrupt drawing queue.
*
* @param mode - If set to 1, reset all the queues.
* @param pParam - Unused (just K1-checked).
*
* @return The stopped queue ID if mode isn't set to 0, otherwise 0, and < 0 on error.
*/
int sceGeBreak(int mode, PspGeBreakParam *pParam);
/**
* Restart drawing queue
* Restart drawing queue.
*
* @return < 0 on error.
*/
int sceGeContinue(void);
/**
* Set Graphics Engine eDRAM address translation mode
* Set the eDRAM address translation mode.
*
* @param width - 0 to not set the translation width, otherwise 512, 1024, 2048 or 4096.
*
* @return The previous width if it was set, otherwise 0, < 0 on error.
*/
int sceGeEdramSetAddrTranslation(int width);
#ifdef __cplusplus
}
#endif

View File

@@ -21,38 +21,41 @@
IMPORT_FUNC "sceGe_user",0x57C8945B,sceGeGetMtx
#endif
#ifdef F_sceGe_user_0006
IMPORT_FUNC "sceGe_user",0x438A385A,sceGeSaveContext
IMPORT_FUNC "sceGe_user",0xE66CB92E,sceGeGetStack
#endif
#ifdef F_sceGe_user_0007
IMPORT_FUNC "sceGe_user",0x0BF608FB,sceGeRestoreContext
IMPORT_FUNC "sceGe_user",0x438A385A,sceGeSaveContext
#endif
#ifdef F_sceGe_user_0008
IMPORT_FUNC "sceGe_user",0xAB49E76A,sceGeListEnQueue
IMPORT_FUNC "sceGe_user",0x0BF608FB,sceGeRestoreContext
#endif
#ifdef F_sceGe_user_0009
IMPORT_FUNC "sceGe_user",0x1C0D95A6,sceGeListEnQueueHead
IMPORT_FUNC "sceGe_user",0xAB49E76A,sceGeListEnQueue
#endif
#ifdef F_sceGe_user_0010
IMPORT_FUNC "sceGe_user",0x5FB86AB0,sceGeListDeQueue
IMPORT_FUNC "sceGe_user",0x1C0D95A6,sceGeListEnQueueHead
#endif
#ifdef F_sceGe_user_0011
IMPORT_FUNC "sceGe_user",0xE0D68148,sceGeListUpdateStallAddr
IMPORT_FUNC "sceGe_user",0x5FB86AB0,sceGeListDeQueue
#endif
#ifdef F_sceGe_user_0012
IMPORT_FUNC "sceGe_user",0x03444EB4,sceGeListSync
IMPORT_FUNC "sceGe_user",0xE0D68148,sceGeListUpdateStallAddr
#endif
#ifdef F_sceGe_user_0013
IMPORT_FUNC "sceGe_user",0xB287BD61,sceGeDrawSync
IMPORT_FUNC "sceGe_user",0x03444EB4,sceGeListSync
#endif
#ifdef F_sceGe_user_0014
IMPORT_FUNC "sceGe_user",0xB448EC0D,sceGeBreak
IMPORT_FUNC "sceGe_user",0xB287BD61,sceGeDrawSync
#endif
#ifdef F_sceGe_user_0015
IMPORT_FUNC "sceGe_user",0x4C06E472,sceGeContinue
IMPORT_FUNC "sceGe_user",0xB448EC0D,sceGeBreak
#endif
#ifdef F_sceGe_user_0016
IMPORT_FUNC "sceGe_user",0xA4FC06A4,sceGeSetCallback
IMPORT_FUNC "sceGe_user",0x4C06E472,sceGeContinue
#endif
#ifdef F_sceGe_user_0017
IMPORT_FUNC "sceGe_user",0xA4FC06A4,sceGeSetCallback
#endif
#ifdef F_sceGe_user_0018
IMPORT_FUNC "sceGe_user",0x05DB22CE,sceGeUnsetCallback
#endif

View File

@@ -606,8 +606,8 @@ int calculate_outsize(void)
{
reloc_size += g_elfsections[i].iSize;
out_sects++;
str_size += strlen(g_elfsections[i].szName) + 1;
}
str_size += strlen(g_elfsections[i].szName) + 1;
}
else
{
@@ -762,7 +762,8 @@ void output_sh(unsigned char *data)
SW(&shdr->sh_addralign, g_elfsections[i].iAddralign);
SW(&shdr->sh_entsize, g_elfsections[i].iEntsize);
if((g_elfsections[i].iType == SHT_REL) || (g_elfsections[i].iType == SHT_PRXRELOC))
if(((g_elfsections[i].iType == SHT_REL) || (g_elfsections[i].iType == SHT_PRXRELOC))
&& (g_elfsections[g_elfsections[i].iInfo].iFlags & SHF_ALLOC))
{
SW(&shdr->sh_type, SHT_PRXRELOC);
SW(&shdr->sh_info, g_elfsections[i].pRef->iIndex);