forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IOP Timers?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
ubergeek42



Joined: 13 Jul 2005
Posts: 83

PostPosted: Tue Jun 26, 2007 2:16 pm    Post subject: IOP Timers? Reply with quote

I'm trying to optimize some IOP code I have, and I'm looking for a timer that runs on the IOP. I know of the ee timers, which are very useful, and was wondering what alternatives I have on the IOP. I don't need extreme accuracy, just enough to determine if my changes are helping or hurting.

Also, are there any functions I can use to determine the memory usage of my IOP module?

Any tips/help would be greatly appreciated.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Tue Jun 26, 2007 8:48 pm    Post subject: Reply with quote

I never tried to use any kind of timers on the IOP, but there is atleast the vblank module (vblank.h), where you can register a vblank handler, which can get called 50/60 times/sec (PAL/NTSC).

An alternative would be to look up the MIPS R3000 reference and check the COP0 registers, there is a counter register which is incremented for every instruction. But be careful, this register is also used for threading. There is another register with a reference value and once the counter equals the reference register, an interrupt occours. So it might be that the register is "reset" at some point in your code.

I don't know if there any real timers on the IOP, like the root counters on PSOne.

As for memory management, I'm not quite sure what you are asking. Because if you coded the module yourself, you should be able to keep track of memory usage. But there is also the sysmem (sysmem.h) module.
_________________
Lukasz.dk
Back to top
View user's profile Send private message Visit poster's website
ubergeek42



Joined: 13 Jul 2005
Posts: 83

PostPosted: Tue Jun 26, 2007 9:48 pm    Post subject: Reply with quote

Lukasz wrote:
I never tried to use any kind of timers on the IOP, but there is atleast the vblank module (vblank.h), where you can register a vblank handler, which can get called 50/60 times/sec (PAL/NTSC).

I think that will work just fine, my functions are taking more then a second or so to complete, so thats plenty accurate enough, and I think I'd probably have some difficulty working with the COP0 register.

Lukasz wrote:

As for memory management, I'm not quite sure what you are asking. Because if you coded the module yourself, you should be able to keep track of memory usage. But there is also the sysmem (sysmem.h) module.

I think I was just making sure there wasn't an easy way to do that without going through and adding it all up.

Thanks!
Back to top
View user's profile Send private message AIM Address MSN Messenger
jbit
Site Admin


Joined: 28 May 2005
Posts: 293
Location: København, Danmark

PostPosted: Wed Jun 27, 2007 2:13 am    Post subject: Reply with quote

Check out TIMRMAN (timrman.h), it's the timer manager for the IOP...
The IOP timers are pretty similar to the EE ones...
Back to top
View user's profile Send private message Visit poster's website
ubergeek42



Joined: 13 Jul 2005
Posts: 83

PostPosted: Wed Jun 27, 2007 5:52 am    Post subject: Reply with quote

Wow, I never even noticed that header file had anything to do with timers, that should be very helpful.

Thanks to both of you guys for the suggestions.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group