|
How does the Wii update the message board with game play time? June 25, 2009 06:07AM | Registered: 17 years ago Posts: 68 |
|
Re: How does the Wii update the message board with game play time? June 25, 2009 01:51PM | Admin Registered: 17 years ago Posts: 5,132 |
|
Re: How does the Wii update the message board with game play time? June 25, 2009 07:36PM | Registered: 17 years ago Posts: 1,012 |
|
Re: How does the Wii update the message board with game play time? June 25, 2009 08:49PM | Admin Registered: 17 years ago Posts: 5,132 |
16 shouldn't even be on your Wii. It was found on a pink fish disc (no one knows what it does) used to repair Wiis. It was the IOS ised by pirates for warez until Nintendo killed it in 4.0Quote
daniel_c_w
Why can't it be any of that 4, Arikado?
|
Re: How does the Wii update the message board with game play time? June 25, 2009 09:15PM | Registered: 17 years ago Posts: 1,012 |
|
Re: How does the Wii update the message board with game play time? June 25, 2009 09:21PM | Admin Registered: 17 years ago Posts: 5,132 |
|
Re: How does the Wii update the message board with game play time? June 25, 2009 10:04PM | Registered: 16 years ago Posts: 301 |
|
Re: How does the Wii update the message board with game play time? August 10, 2009 10:50PM | Admin Registered: 17 years ago Posts: 271 |
|
Re: How does the Wii update the message board with game play time? August 11, 2009 08:35PM | Registered: 16 years ago Posts: 116 |
|
Re: How does the Wii update the message board with game play time? August 11, 2009 08:38PM | Admin Registered: 17 years ago Posts: 5,132 |
|
Re: How does the Wii update the message board with game play time? August 11, 2009 11:58PM | Registered: 16 years ago Posts: 5,075 |
|
Re: How does the Wii update the message board with game play time? September 08, 2009 11:39AM | Admin Registered: 17 years ago Posts: 271 |
|
Re: How does the Wii update the message board with game play time? September 09, 2009 02:39AM | Registered: 16 years ago Posts: 445 |
|
Re: How does the Wii update the message board with game play time? September 09, 2009 06:26PM | Registered: 16 years ago Posts: 5,075 |
|
Re: How does the Wii update the message board with game play time? September 13, 2009 10:29AM | Registered: 16 years ago Posts: 116 |
|
Re: How does the Wii update the message board with game play time? September 13, 2009 01:41PM | Registered: 16 years ago Posts: 5,075 |
|
Re: How does the Wii update the message board with game play time? September 13, 2009 07:37PM | Registered: 16 years ago Posts: 1,141 |
|
Re: How does the Wii update the message board with game play time? September 13, 2009 09:57PM | Registered: 16 years ago Posts: 445 |
|
Re: How does the Wii update the message board with game play time? September 14, 2009 01:32PM | Admin Registered: 17 years ago Posts: 271 |
int playtime_init(void) {
s32 res;
u32 sum = 0;
int i;
gprintf("initializing playtime\n");
if(_pt_fd >= 0) {
gprintf("playtime already initialized (fd %d)\n",_pt_fd);
return _pt_fd;
}
_pt_fd = IOS_Open(_playtime_path, IPC_OPEN_RW);
if(_pt_fd < 0) {
gprintf("playtime open failed: %d\n",_pt_fd);
return _pt_fd;
}
res = IOS_Read(_pt_fd, &playtime_buf, sizeof(playtime_buf));
if(res < 0) {
gprintf("playtime read failed: %d\n",res);
IOS_Close(_pt_fd);
_pt_fd = -1;
return res;
}
if(res != sizeof(playtime_buf)) {
gprintf("playtime read bad size: %d\n",res);
IOS_Close(_pt_fd);
_pt_fd = -1;
return -1;
}
for(i=0; i<0x1f; i++)
sum += playtime_buf.data;
if(sum != playtime_buf.checksum) {
gprintf("playtime: bad checksum (read %08x, should be %08x)\n",
playtime_buf.checksum,sum);
IOS_Close(_pt_fd);
_pt_fd = -1;
return -1;
}
gprintf("playtime:\n");
gprintf(" Boot: 0x%016llx\n",playtime_buf.ticks_boot);
gprintf(" Last: 0x%016llx\n",playtime_buf.ticks_last);
gprintf(" Title ID: 0x%08x\n",playtime_buf.title_id);
gprintf("current UNIX time(): 0x%08lx\n",time(NULL));
gprintf("current ticks: 0x%08llx\n",get_current_ticks());
if((playtime_buf.ticks_boot == playtime_buf.ticks_last) &&
(playtime_buf.title_id == ((u32)MY_TITLEID))) {
gprintf("playtime: we were started from the System Menu\n");
booted_from_menu = true;
} else {
gprintf("playtime: we were started from somewhere else\n");
booted_from_menu = false;
}
return _pt_fd;
}
int playtime_update(void) {
s32 res;
u32 sum = 0;
int i;
int secs;
if(_pt_fd < 0) {
gprintf("playtime: not inited, can't update\n");
return _pt_fd;
}
if(_playtime_busy) {
gprintf("playtime: busy, can't update\n");
return -1;
}
_playtime_busy = 1;
playtime_buf.ticks_last = get_current_ticks();
secs = ticks_to_secs(playtime_buf.ticks_last - playtime_buf.ticks_boot);
for(i=0; i<0x1f; i++)
sum += playtime_buf.data;
playtime_buf.checksum = sum;
gprintf("starting playtime update:\n");
gprintf(" Boot: 0x%016llx\n",playtime_buf.ticks_boot);
gprintf(" Last: 0x%016llx\n",playtime_buf.ticks_last);
gprintf(" Delta: 0x%016llx\n",playtime_buf.ticks_last -
playtime_buf.ticks_boot);
gprintf(" Playtime: %d:%02d:%02d\n", secs/3600, (secs/60)%60, secs%60);
gprintf(" Checksum: 0x%08x\n",playtime_buf.checksum);
gprintf("current UNIX time(): 0x%08lx\n",time(NULL));
res = IOS_Seek(_pt_fd, 0, SEEK_SET);
if(res < 0) {
gprintf("playtime seek failed: %d\n",res);
_playtime_busy = 0;
return res;
}
res = IOS_WriteAsync(_pt_fd, &playtime_buf, sizeof(playtime_buf),
_playtime_cb, NULL);
if(res < 0) {
gprintf("playtime update write failed (in Async): %d\n",res);
_playtime_busy = 0;
return res;
}
return 0;
}
void playtime_destroy(void) {
s32 res;
s32 pt_fd = -1;
static u8 pt_buf[4] __attribute__((aligned(32)));
gprintf("destroying playtime\n");
res = ISFS_Initialize();
if (res) {
ISFS_Deinitialize();
gprintf("error initializing isfs (%d)\n", res);
return;
}
pt_fd = IOS_Open(_playtime_path, IPC_OPEN_RW);
if(pt_fd < 0) {
ISFS_Deinitialize();
gprintf("playtime open failed: %d\n", pt_fd);
return;
}
memset(pt_buf, 0, sizeof(pt_buf));
res = IOS_Write(pt_fd, &pt_buf, sizeof(pt_buf));
if (res != sizeof(pt_buf)) {
IOS_Close(pt_fd);
ISFS_Deinitialize();
gprintf("error destroying playtime (%d)\n", res);
return;
}
IOS_Close(pt_fd);
ISFS_Deinitialize();
return;
}|
Re: How does the Wii update the message board with game play time? September 14, 2009 06:06PM | Registered: 16 years ago Posts: 5,075 |