Fixed several bugs, imported math library.
[sphoot.git] / src / ecore / ecore.c
1 #include "ecore.h"
2
3 #include "rreq.h"
4 #include "render.h"
5
6 e_memseg_t shared_mem;
7 shm_region_t *shm_region;
8
9 int main() {
10     e_shm_attach(&shared_mem, "raytrace_shm");
11
12     shm_region = (void *)(shared_mem.ephy_base);
13
14     setup_range_request();
15
16     e_coreid_t eid = e_get_coreid();
17     unsigned x, y;
18     e_coords_from_coreid(eid, &x, &y);
19
20     e_irq_global_mask(E_FALSE);
21     e_irq_mask(E_USER_INT, E_FALSE);
22     e_irq_mask(E_MESSAGE_INT, E_FALSE);
23
24     int id = y*e_group_config.group_rows + x;
25     while(1) {
26         request_new_range(id);
27
28         for(int i = 0; i < NUM_OUT_ELEMENTS; i ++) {
29             out_buffer_ptr[i] = i+1 + (id << 16);
30         }
31
32         // do rendering
33         render_finished();
34     }
35
36     return 0;
37 }