diff -urN pspsdk-2450-orig/src/gu/sceGuDepthRange.c pspsdk-2450/src/gu/sceGuDepthRange.c --- pspsdk-2450-orig/src/gu/sceGuDepthRange.c 2009-01-09 03:15:40 +0900 +++ pspsdk-2450/src/gu/sceGuDepthRange.c 2009-10-02 09:20:53 +0900 @@ -12,9 +12,7 @@ { GuContext* context = &gu_contexts[gu_curr_context]; - unsigned int max = (unsigned int)near + (unsigned int)far; - int val = (int)((max >> 31) + max); - float z = (float)(val >> 1); + float z = (float)((near + far) / 2); context->near_plane = near; context->far_plane = far; diff -urN pspsdk-2450-orig/src/gu/sceGuGetMemory.c pspsdk-2450/src/gu/sceGuGetMemory.c --- pspsdk-2450-orig/src/gu/sceGuGetMemory.c 2009-01-09 03:15:40 +0900 +++ pspsdk-2450/src/gu/sceGuGetMemory.c 2009-10-02 09:20:53 +0900 @@ -13,10 +13,8 @@ void* sceGuGetMemory(int size) { - // some kind of 4-byte alignment? - size += 3; - size += ((unsigned int)(size >> 31)) >> 30; - size = (size >> 2) << 2; + // Round up to a multiple of 4 bytes + size = ((size+3) / 4) * 4; unsigned int* orig_ptr = gu_list->current; unsigned int* new_ptr = (unsigned int*)(((unsigned int)orig_ptr) + size + 8);