mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
* Remove useless comment * Small amounts of documenting, official names, and use some new knowledge to match what was previously thought to be only possible with hasm. * Define the proper type for the stack_pointer function, and come up with a solution for GCC builds that should hopefully work. * Partial revert to support getting the actual stack pointer for GCC builds * Come up with a better GCC build option for getting the stack pointer * Update the score
22 lines
474 B
C
22 lines
474 B
C
#include "memory.h"
|
|
|
|
#ifdef __sgi
|
|
/**
|
|
* Uses IDO specific -dollar compiler flag to get the current stack pointer.
|
|
* Official Name: diCpuTraceCurrentStack
|
|
*/
|
|
StackInfo *stack_pointer(void) {
|
|
return (StackInfo *) __$sp;
|
|
}
|
|
#else
|
|
/**
|
|
* Uses GCC specific code to get the current stack pointer.
|
|
* Official Name: diCpuTraceCurrentStack
|
|
*/
|
|
StackInfo *stack_pointer(void) {
|
|
register StackInfo *sp;
|
|
asm volatile ("move %0, $sp\n": "=r"(sp));
|
|
return sp;
|
|
}
|
|
#endif
|