Skip to content

Screen flicker #126

Answered by WojciechGw
grakoczy asked this question in Q&A
Oct 6, 2024 · 4 comments · 6 replies
Discussion options

You must be logged in to vote

First of all thank You very much for 3d transformation functions :)

Magic is done by drawing things to two different address spaces in XRAM and switching between them

  1. clear inactive buffer
  2. draw things to inactive buffer
  3. switch to inactive buffer
  4. goto 0.

I've made some changes to tonyvr's bitmap_graphics library and Your main.c
so all functions are double buffering friendly now

in bitmap_graphics_db.c

void switch_buffer(uint16_t buffer_data_address)
{
    xram0_struct_set(canvas_struct, vga_mode3_config_t, xram_data_ptr, buffer_data_address);
}

main.c in main loop

[...]
     buffers[0] = 0x0000;
     buffers[1] = 0x2580;
[...]
      // draw on inactive buffer
      erase_buffer(buffers[…

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@WojciechGw
Comment options

@grakoczy
Comment options

@WojciechGw
Comment options

Answer selected by grakoczy
@grakoczy
Comment options

@WojciechGw
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@vruumllc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants