- Timestamp:
- Jul 29, 2015, 5:52:18 PM (9 years ago)
- Location:
- soft/giet_vm/applications/raycast
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/raycast/disp.c
r677 r679 14 14 // Globals 15 15 16 static unsigned char buf0[FBUF_X_SIZE * FBUF_Y_SIZE] __attribute__((aligned(64))); 17 static unsigned char buf1[FBUF_X_SIZE * FBUF_Y_SIZE] __attribute__((aligned(64))); 18 static unsigned int sts0[16] __attribute__((aligned(64))); 19 static unsigned int sts1[16] __attribute__((aligned(64))); 20 static unsigned int cur_buf; 16 static unsigned char* buf[2]; 17 static void * sts[2]; 18 static unsigned int cur_buf; 21 19 22 20 // Textures indexed by block number … … 34 32 static void dispDrawColumnTex(int x, int y0, int y1, unsigned char *tex, int tx) 35 33 { 36 unsigned char* buf = (cur_buf == 0 ? buf0 : buf1);37 34 int y; 38 35 … … 46 43 int ty = (y - y0) * TEX_SIZE / (y1 - y0); 47 44 48 buf[ y * FBUF_X_SIZE + x] = tex[ty * TEX_SIZE + tx];45 buf[cur_buf][y * FBUF_X_SIZE + x] = tex[ty * TEX_SIZE + tx]; 49 46 } 50 47 } … … 52 49 static void dispDrawColumnSolid(int x, int y0, int y1, unsigned char color) 53 50 { 54 unsigned char* buf = (cur_buf == 0 ? buf0 : buf1);55 51 int y; 56 52 … … 62 58 y = 0; 63 59 64 buf[ y * FBUF_X_SIZE + x] = color;60 buf[cur_buf][y * FBUF_X_SIZE + x] = color; 65 61 } 66 62 } … … 195 191 void dispInit() 196 192 { 193 // allocate framebuffer 194 buf[0] = almalloc(64, FBUF_X_SIZE * FBUF_Y_SIZE); 195 buf[1] = almalloc(64, FBUF_X_SIZE * FBUF_Y_SIZE); 196 sts[0] = almalloc(64, 64); 197 sts[1] = almalloc(64, 64); 198 197 199 // initialize framebuffer 198 200 giet_fbf_cma_alloc(); 199 giet_fbf_cma_init_buf(buf 0, buf1, sts0, sts1);201 giet_fbf_cma_init_buf(buf[0], buf[1], sts[0], sts[1]); 200 202 giet_fbf_cma_start(FBUF_X_SIZE * FBUF_Y_SIZE); 201 203 -
soft/giet_vm/applications/raycast/raycast.py
r676 r679 30 30 31 31 heap_base = 0x60000000 32 heap_size = 0x00 008000 # 32 Kbytes32 heap_size = 0x00400000 # 4 Mbytes 33 33 34 34 # create vspace … … 52 52 local = False, big = True ) 53 53 54 # heap vseg (unused)54 # heap vseg 55 55 mapping.addVseg( vspace, 'raycast_heap', heap_base, heap_size, 56 56 'C_WU', vtype = 'BUFFER', x = 0 , y = 0 , pseg = 'RAM',
Note: See TracChangeset
for help on using the changeset viewer.