gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Profiling GBA code

#7120 - Vortex - Mon Jun 09, 2003 10:48 pm

I was wondering is there a way to make sure a piece of code can be executed in a given timeframe (VBlank for example) ? Are there any free profiling tools for the GBA ?

Thanks

#7135 - Sweex - Tue Jun 10, 2003 11:34 am

I don't believe there are. But writing you own profiling code shouldn't be too hard I'd say. You can either use the timing registers to measure how long a certain piece of code takes, or you can use the vcount register...

#7139 - gb_feedback - Tue Jun 10, 2003 12:19 pm

Most people output something to the screen to indicate which line the vblank processing ends on. In mode 3 for example I output a pixel on the line in question. This is a fast and accurate method with hardly any code.
_________________
http://www.bookreader.co.uk/

#7152 - tepples - Tue Jun 10, 2003 5:53 pm

Checking vcount works, as gb_feedback implied.

What I normally use (for mode 0, 1, 2) is changing the background color (PALRAM[0] in my header).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.