Skip to content

Commit 6c9d6d8

Browse files
authored
Merge pull request #343 from GrayJack/update/systimer.h
refactor(systimer): Update names on `sceSystimer` stubs and header
2 parents dd6b5ca + f1588cc commit 6c9d6d8

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

src/kernel/SysTimerForKernel.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
IMPORT_FUNC "SysTimerForKernel",0xC105CF38,sceSTimerFree
1313
#endif
1414
#ifdef F_SysTimerForKernel_0003
15-
IMPORT_FUNC "SysTimerForKernel",0xB53534B4,SysTimerForKernel_B53534B4
15+
IMPORT_FUNC "SysTimerForKernel",0xB53534B4,sceSTimerSetPrscl
1616
#endif
1717
#ifdef F_SysTimerForKernel_0004
1818
IMPORT_FUNC "SysTimerForKernel",0x975D8E84,sceSTimerSetHandler
@@ -30,5 +30,5 @@
3030
IMPORT_FUNC "SysTimerForKernel",0x228EDAE4,sceSTimerGetCount
3131
#endif
3232
#ifdef F_SysTimerForKernel_0009
33-
IMPORT_FUNC "SysTimerForKernel",0x53231A15,SysTimerForKernel_53231A15
33+
IMPORT_FUNC "SysTimerForKernel",0x53231A15,sceSTimerSetTMCY
3434
#endif

src/kernel/pspsystimer.h

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,31 @@ void sceSTimerGetCount(SceSysTimerId timer, int* count);
7777
*/
7878
void sceSTimerSetHandler(SceSysTimerId timer, int cycle, int (*handler)(void), int unk1);
7979

80-
/* Unknown functions. */
80+
/**
81+
* Unknown purpose.
82+
*
83+
* Probably something to set the cycle of an active timer.
84+
*
85+
* @param timer The ID of the timer.
86+
* @param unk1 Unknown. Should not be less than `0` and greater `4194304`.
87+
*
88+
* @return `0` on success.
89+
*/
8190
//probably something to set the cycle of an active timer.
82-
void SysTimerForKernel_53231A15(SceSysTimerId timer, int unk1);
83-
//more complex. computes some ratio (unk2/unk1) and saves both parameters into the hardware registers. Might be some sort of scaling factor?
84-
void SysTimerForKernel_B53534B4(SceSysTimerId timer, int unk1, int unk2);
91+
void sceSTimerSetTMCY(SceSysTimerId timer, int unk1);
92+
93+
/**
94+
* Set the prescale of a hardware timer. It can be only set on timers which are in the "not in use" state.
95+
*
96+
* The input signal is divided into the resulting ratio. The ratio has to be less than 1/11.
97+
*
98+
* @param timer The ID of the timer to set the prescale.
99+
* @param numerator The numerator of the prescale. Must not be `0`.
100+
* @param denominator The denominator of the prescale. Must not be `0`.
101+
*
102+
* @return `0` on success.
103+
*/
104+
void sceSTimerSetPrscl(SceSysTimerId timer, int unk1, int unk2);
85105

86106

87107

0 commit comments

Comments
 (0)