Page 1 of 1

IOP Timers?

Posted: Tue Jun 26, 2007 2:16 pm
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.

Posted: Tue Jun 26, 2007 8:48 pm
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.

Posted: Tue Jun 26, 2007 9:48 pm
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!

Posted: Wed Jun 27, 2007 2:13 am
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...

Posted: Wed Jun 27, 2007 5:52 am
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.