-
Notifications
You must be signed in to change notification settings - Fork 157
Some clean ups around sceGu
#285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
}; | ||
|
||
/** Values for retro compatibility */ | ||
#define PSP_DISPLAY_SETBUF_IMMEDIATE PSP_DISPLAY_SETBUF_NEXTHSYNC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping previous values for retro compatibility
@@ -116,7 +116,7 @@ extern GuLightSettings light_settings[4]; | |||
|
|||
void callbackSig(int id, void *arg); | |||
void callbackFin(int id, void *arg); | |||
void resetValues(); | |||
void _sceGuResetGlobalVariables(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use better function name to avoid name conflicts when linking the binary.
src/gu/sceGuFinishId.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same content was before in sceGuFinish
src/gu/sceGuInit.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improving sceGuInit
now it has better error check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not able to do testing with this this weekend unfortunately, but the code looks pretty good to me. I just had some small things I don't understand, but I did not spot any issues.
GuContext *context = &gu_contexts[ctype]; | ||
unsigned int *local_list = (unsigned int *)(((unsigned int)list) | 0x40000000); | ||
|
||
intr = sceKernelCpuSuspendIntr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expensive to do? Do we have a chance to lose input because of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it shouldn't be expensive, is the best way to assure atomic operations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair
|
||
if (!gu_object_stack_depth && !gu_curr_context) | ||
sceGeListUpdateStallAddr(ge_list_executed[0], gu_list->current); | ||
static inline int _sceGuUpdateStallAddr(void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if I understand correctly the stalli function was used to make sure that if you are using direct mode, the function you called before cannot be interrupted? This looks more readable, but I do wonder how this looks in cpu cycles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the GCC compiler is clever enough like to put the exactly same ASM code as before
Description
Some improvements and clean-ups in
sceGu
:PspDisplaySetBufSync
sceGuFinish
andsceGUFinishId
sendCommandiStall
function, it was previously adding the command and then updating the stall address, now we have a new function called_sceGuUpdateStallAddr
which updates the stall address.sceGuInit
sceGuCallList
resetValues
to_sceGuResetGlobalVariables
, which is a more appropriate name for a "kind of private function"sceGuInit
by being sure we cover failure scenarios and make it more robust for concurrency scenarios.sceGuSendList
Cheers!