Files
pspsdk/src/gu/sceGuEndObject.c
Francisco Javier Trujillo Mata b1bf44e88a Adding assertions
- Adding assertions to each specific sceGu function
- Also adding printf for verbose output
2025-07-17 21:41:15 +02:00

44 lines
997 B
C

/*
* PSP Software Development Kit - https://github.com/pspdev
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* Copyright (c) 2005 Jesper Svennevid
*/
#include "guInternal.h"
#define ERROR_NOT_FOUND 0x80000025
int sceGuEndObject(void)
{
#ifdef GU_DEBUG
printf("sceGuEndObject();\n");
assert(gu_init && "GU not initialized");
assert(gu_object_stack_depth > 0 && "Object stack underflow");
#endif
int res;
gu_object_stack_depth--;
if (gu_object_stack_depth < 0) {
return -ERROR_NOT_FOUND;
}
unsigned int *current = gu_list->current;
gu_list->current = gu_object_stack[gu_object_stack_depth];
sendCommandi(BASE, (((unsigned int)current) >> 8) & 0xf0000);
sendCommandi(BJUMP, (unsigned int)current);
gu_list->current = current;
if (gu_curr_context == GU_DIRECT) {
res = _sceGuUpdateStallAddr();
if (res < 0) {
return res;
}
}
return gu_object_stack_depth;
}