52#ifndef __JO_PROFILE_H__
53# define __JO_PROFILE_H__
107# define JO_PROFILE_USER(N) ((jo_profile_slot)(JO_PROFILE_FIRST_USER + (N)))
110# define JO_PROFILE_FRAMES (32)
112#ifdef JO_COMPILE_WITH_PROFILER_SUPPORT
123extern jo_profile_cpu __jo_profile_cpu[2];
133 high = *(
volatile unsigned char *)0xFFFFFE12;
134 return ((high << 8) | *(
volatile unsigned char *)0xFFFFFE13);
147 __asm__
volatile (
"mov r15, %0" :
"=r" (sp));
148 return (&__jo_profile_cpu[(sp & 0x000FFFFF) < 0x4000 ? 1 : 0]);
157 cpu->sum[slot] += value;
158 if (value > cpu->max[slot])
159 cpu->max[slot] = value;
168 __jo_profile_current_cpu()->start[slot] = (
unsigned short)jo_profile_ticks();
179 cpu = __jo_profile_current_cpu();
180 __jo_profile_add(cpu, slot, (jo_profile_ticks() - cpu->start[slot]) & 0xFFFF);
189 __jo_profile_add(__jo_profile_current_cpu(), slot, value);
199bool jo_profile_get(
const jo_profile_slot slot,
unsigned int *average,
unsigned int *maximum);
206extern bool __jo_profile_pixels;
223# define JO_PROFILE_SAMPLING_CODE_START (0x06004000)
225# define JO_PROFILE_SAMPLING_BIN_SIZE (16)
227# define JO_PROFILE_SAMPLING_BINS (16384)
244void __jo_profile_init(
void);
247void __jo_profile_end_frame(
void);
250void __jo_profile_vdp1_start(
void);
254# define jo_profile_begin(SLOT) do {} while (0)
255# define jo_profile_end(SLOT) do {} while (0)
256# define jo_profile_count(SLOT, VALUE) do {} while (0)
257# define jo_profile_set_name(SLOT, NAME) do {} while (0)
258# define jo_profile_print(X, Y) do {} while (0)
259# define jo_profile_count_pixels(ENABLED) do {} while (0)
260# define jo_profile_sampling_start(M, S) do {} while (0)
261# define __jo_profile_slave_job() do {} while (0)
#define jo_profile_print(X, Y)
Definition profile.h:258
#define jo_profile_begin(SLOT)
Definition profile.h:254
#define jo_profile_sampling_start(M, S)
Definition profile.h:260
#define jo_profile_end(SLOT)
Definition profile.h:255
jo_profile_slot
Measures of the engine and of the program (jo_profile_begin(), jo_profile_end(), jo_profile_count()).
Definition profile.h:57
@ JO_PROFILE_3D_VERTEX_COUNT
3D vertices transformed per frame (count, both CPUs)
Definition profile.h:85
@ JO_PROFILE_3D_VERTICES
3D: transformation and projection of the vertices (both CPUs)
Definition profile.h:87
@ JO_PROFILE_CALLBACKS
Callbacks of the master CPU (jo_core_add_callback()).
Definition profile.h:61
@ JO_PROFILE_VDP1_DRAW
VDP1: from the display of a new command table to the end of its drawing.
Definition profile.h:75
@ JO_PROFILE_VBLANKS
VBLANK per frame (count, x 100).
Definition profile.h:77
@ JO_PROFILE_FIRST_USER
First measure of the program (see JO_PROFILE_USER()).
Definition profile.h:99
@ JO_PROFILE_VDP1_COPY
Copy of the VDP1 commands of a frame into the VDP1 VRAM.
Definition profile.h:69
@ JO_PROFILE_3D_LIGHT
3D: lighting of the polygons (JO_3D_USE_LIGHT), both CPUs (included in JO_PROFILE_3D_POLYGONS)
Definition profile.h:93
@ JO_PROFILE_COUNT
Measures count.
Definition profile.h:101
@ JO_PROFILE_3D_POLYGON_COUNT
3D polygons tested per frame, visible or not (count, both CPUs)
Definition profile.h:83
@ JO_PROFILE_VDP1_COMMANDS
VDP1 commands per frame (count).
Definition profile.h:79
@ JO_PROFILE_SLAVE
Slave CPU busy (all its jobs: the callbacks of jo_core_exec_on_slave() and the engine jobs).
Definition profile.h:65
@ JO_PROFILE_VDP1_WAIT
Wait for the VDP1 before the copy (previous table not displayed yet, or still drawn).
Definition profile.h:71
@ JO_PROFILE_FRAME
Frame: from the start of the callbacks of a frame to the start of the next one.
Definition profile.h:59
@ JO_PROFILE_VDP1_SORT
Sort of the VDP1 commands of a frame.
Definition profile.h:67
@ JO_PROFILE_3D_PIXELS
3D: estimate of the pixels the VDP1 draws for the polygons of a frame (count, both CPUs): the VDP1 dr...
Definition profile.h:97
@ JO_PROFILE_VSYNC
Master CPU waiting for the VBLANK at the end of the frame (JO_FRAMERATE).
Definition profile.h:73
@ JO_PROFILE_POLYGONS
3D polygons displayed per frame (count)
Definition profile.h:81
@ JO_PROFILE_3D_CLIP
3D: polygons near the camera (subdivided) or crossing the near plane (clipped), both CPUs (included i...
Definition profile.h:91
@ JO_PROFILE_WAIT_SLAVE
Master CPU waiting for the slave CPU (jo_core_wait_for_slave()).
Definition profile.h:63
@ JO_PROFILE_3D_POLYGONS
3D: polygons (visibility, clipping, lighting, VDP1 commands), both CPUs
Definition profile.h:89
#define jo_profile_set_name(SLOT, NAME)
Definition profile.h:257
#define jo_profile_count(SLOT, VALUE)
Definition profile.h:256
#define __jo_profile_slave_job()
Definition profile.h:261
#define jo_profile_count_pixels(ENABLED)
Definition profile.h:259
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition types.h:39