IOP Timers?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
ubergeek42
Posts: 83
Joined: Wed Jul 13, 2005 12:25 am

IOP Timers?

Post by ubergeek42 »

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.
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

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.
ubergeek42
Posts: 83
Joined: Wed Jul 13, 2005 12:25 am

Post by ubergeek42 »

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!
User avatar
jbit
Site Admin
Posts: 293
Joined: Sat May 28, 2005 3:11 am
Location: København, Danmark
Contact:

Post by jbit »

Check out TIMRMAN (timrman.h), it's the timer manager for the IOP...
The IOP timers are pretty similar to the EE ones...
ubergeek42
Posts: 83
Joined: Wed Jul 13, 2005 12:25 am

Post by ubergeek42 »

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.
Post Reply