Identify __osTimerCounter

This commit is contained in:
Ryan Myers
2021-09-22 11:56:01 -04:00
parent d26ab990b0
commit a728173652
3 changed files with 12 additions and 11 deletions
@@ -6,10 +6,10 @@ glabel __osSetTimerIntr
/* 0D5CD4 800D50D4 AFA5002C */ sw $a1, 0x2c($sp)
/* 0D5CD8 800D50D8 0C031E34 */ jal osGetCount
/* 0D5CDC 800D50DC AFA2001C */ sw $v0, 0x1c($sp)
/* 0D5CE0 800D50E0 3C018013 */ lui $at, %hi(D_8012D230) # $at, 0x8013
/* 0D5CE4 800D50E4 AC22D230 */ sw $v0, %lo(D_8012D230)($at)
/* 0D5CE8 800D50E8 3C0E8013 */ lui $t6, %hi(D_8012D230) # $t6, 0x8013
/* 0D5CEC 800D50EC 8DCED230 */ lw $t6, %lo(D_8012D230)($t6)
/* 0D5CE0 800D50E0 3C018013 */ lui $at, %hi(__osTimerCounter) # $at, 0x8013
/* 0D5CE4 800D50E4 AC22D230 */ sw $v0, %lo(__osTimerCounter)($at)
/* 0D5CE8 800D50E8 3C0E8013 */ lui $t6, %hi(__osTimerCounter) # $t6, 0x8013
/* 0D5CEC 800D50EC 8DCED230 */ lw $t6, %lo(__osTimerCounter)($t6)
/* 0D5CF0 800D50F0 8FA9002C */ lw $t1, 0x2c($sp)
/* 0D5CF4 800D50F4 8FA80028 */ lw $t0, 0x28($sp)
/* 0D5CF8 800D50F8 01C0C825 */ move $t9, $t6
+6 -6
View File
@@ -10,7 +10,7 @@ OSTimer *__osTimerList = &D_8012D200;
extern OSTime __osCurrentTime;
extern u32 __osBaseCounter;
extern u32 __osViIntrCount;
extern u32 D_8012D230;
extern u32 __osTimerCounter;
OSTime __osInsertTimer(OSTimer *t);
@@ -43,12 +43,12 @@ void __osTimerInterrupt(void) {
t = __osTimerList->next;
if (t == __osTimerList){
__osSetCompare(0);
D_8012D230 = 0;
__osTimerCounter = 0;
break;
}
count = osGetCount();
elapsed_cycles = count - D_8012D230;
D_8012D230 = count;
elapsed_cycles = count - __osTimerCounter;
__osTimerCounter = count;
if (elapsed_cycles < t->remaining){
t->remaining -= elapsed_cycles;
__osSetTimerIntr(t->remaining);
@@ -76,8 +76,8 @@ void __osSetTimerIntr(OSTime tim) {
OSTime NewTime;
u32 savedMask;
savedMask = __osDisableInt();
D_8012D230 = osGetCount();
NewTime = tim + D_8012D230;
__osTimerCounter = osGetCount();
NewTime = tim + __osTimerCounter;
__osSetCompare(NewTime);
__osRestoreInt(savedMask);
}
+2 -1
View File
@@ -29,7 +29,8 @@ OSTimer D_8012D200;
OSTime __osCurrentTime;
s32 __osBaseCounter;
s32 __osViIntrCount;
s32 D_8012D230[4];
u32 __osTimerCounter;
u32 D_8012D234[2];
s32 D_8012D240[108];
MemoryPoolSlot *gMainMemoryPool;