comparison vdp.c @ 488:32f053ad9b02 opengl

Basic OpenGL rendering is working
author Mike Pavone <pavone@retrodev.com>
date Sun, 27 Oct 2013 01:29:50 -0700
parents 1f3450d1129f
children 27345a67225d
comparison
equal deleted inserted replaced
487:c08a4efeee7f 488:32f053ad9b02
48 void init_vdp_context(vdp_context * context) 48 void init_vdp_context(vdp_context * context)
49 { 49 {
50 memset(context, 0, sizeof(*context)); 50 memset(context, 0, sizeof(*context));
51 context->vdpmem = malloc(VRAM_SIZE); 51 context->vdpmem = malloc(VRAM_SIZE);
52 memset(context->vdpmem, 0, VRAM_SIZE); 52 memset(context->vdpmem, 0, VRAM_SIZE);
53 context->oddbuf = context->framebuf = malloc(FRAMEBUF_ENTRIES * (render_depth() / 8)); 53 /*context->oddbuf = context->framebuf = malloc(FRAMEBUF_ENTRIES * (render_depth() / 8));
54 memset(context->framebuf, 0, FRAMEBUF_ENTRIES * (render_depth() / 8)); 54 memset(context->framebuf, 0, FRAMEBUF_ENTRIES * (render_depth() / 8));
55 context->evenbuf = malloc(FRAMEBUF_ENTRIES * (render_depth() / 8)); 55 context->evenbuf = malloc(FRAMEBUF_ENTRIES * (render_depth() / 8));
56 memset(context->evenbuf, 0, FRAMEBUF_ENTRIES * (render_depth() / 8)); 56 memset(context->evenbuf, 0, FRAMEBUF_ENTRIES * (render_depth() / 8));
57 */
58 render_alloc_surfaces(context);
59 context->framebuf = context->oddbuf;
57 context->linebuf = malloc(LINEBUF_SIZE + SCROLL_BUFFER_SIZE*2); 60 context->linebuf = malloc(LINEBUF_SIZE + SCROLL_BUFFER_SIZE*2);
58 memset(context->linebuf, 0, LINEBUF_SIZE + SCROLL_BUFFER_SIZE*2); 61 memset(context->linebuf, 0, LINEBUF_SIZE + SCROLL_BUFFER_SIZE*2);
59 context->tmp_buf_a = context->linebuf + LINEBUF_SIZE; 62 context->tmp_buf_a = context->linebuf + LINEBUF_SIZE;
60 context->tmp_buf_b = context->tmp_buf_a + SCROLL_BUFFER_SIZE; 63 context->tmp_buf_b = context->tmp_buf_a + SCROLL_BUFFER_SIZE;
61 context->sprite_draws = MAX_DRAWS; 64 context->sprite_draws = MAX_DRAWS;