Skip to content

Commit

Permalink
-improved kernel time conversion to be more accurate over longer time…
Browse files Browse the repository at this point in the history
… periods

-set the initial kernel loop delay to be equal to the one used when a game is running to ensure hid controllers get the same amount of updates in the loader already
  • Loading branch information
FIX94 committed Jun 8, 2016
1 parent 133cc58 commit 3287519
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common/include/NintendontVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define __NINTENDONT_VERSION_H__

#define NIN_MAJOR_VERSION 3
#define NIN_MINOR_VERSION 402
#define NIN_MINOR_VERSION 403

#define NIN_VERSION ((NIN_MAJOR_VERSION << 16) | NIN_MINOR_VERSION)

Expand Down
6 changes: 3 additions & 3 deletions kernel/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ static inline u32 clear32(u32 addr, u32 clear)

static inline u32 TicksToSecs(u32 time)
{
//pretty accurate, it reports the first second is over about 3.2ms early and
//with a full 37.7 minutes difference its off by only about 8.6 seconds
return ((time >> 13)*71)>>14;
//really accurate, it reports the first second is over about 0.5ms early and
//with a full 37.7 minutes difference its off by only about 0.7ms
return ((time >> 9)*283)>>20;
}

static inline u32 TimerDiffTicks(u32 time)
Expand Down
2 changes: 1 addition & 1 deletion kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int _main( int argc, char *argv[] )
sync_after_write((void*)RESET_STATUS, 0x20);
}
HIDUpdateRegisters(1);
mdelay(10);
udelay(20);
}
//get time from loader
InitCurrentTime();
Expand Down
Binary file modified loader/loader.dol
Binary file not shown.

0 comments on commit 3287519

Please sign in to comment.