Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Quastions about Altera Ap372

Hi everybody http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif

I want to do my new board based on reference design auto_graphics_ref_design-v1.0.4

And i found to many C files in design and it&#39;s dificault to understand all software design http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif

I just want to do my custom animation with two video pages where i move triangle and i don&#39;t understand how to do it correct without blinking.

Maybe someone have an experience with this ref design - help me please to make first steps.

Here is my program - it work but i not understant a too many strings.

void my_main()

{

point quad[4];

alt_u32 i, j, x1, y1, x2, y2;

alt_32 rects[8] = {80, 160, 240, 320, 400, 480, 560, 640};

alt_32 num_objects = 500;

printf("My triangle\n\n");

if ((bmpFile = fopen("/mnt/rozipfs/backdrop.bmp","rb")) == NULL) {

printf("Unable to open backdrop.bmp\n");

return ;

}

bmpTo565(bmpFile, frameBuffer3); // why i don&#39;t see any pictute ?

// clear frame buffers

vga_paint_screen_8bit(P_TRANS, frameBuffer11);

//////////////////////////////

lcd_sync();

// Set up DMA for layer 2 from frame buffer 11

lcdDoDMA8(2, frameBuffer11, SCREENSIZE, 0x2f);

lcd.const_alpha2 = 0x3f;

// Set up DMA for layer 3 from frame buffer 12

lcdDoDMA8(4, frameBuffer12, SCREENSIZE, 0x3f);

lcd_sync();

// Enable DMA and turn on layers

lcdLayers(0x04);

// I copy this strings from sources and i don&#39;t understand what they mean - can some one to write comments ?

//////////////////////////////

quad[0].x = 10;

quad[0].y = 10;

quad[1].x = 100;

quad[1].y = 10;

quad[2].x = 150;

quad[2].y = 100;

quad[3].x = 0;

quad[3].y = 0;

for (i=0;i<512;i++)

{

quad[0].x = i;

quad[0].y = i;

quad[1].x = 100;

quad[1].y = 10;

quad[2].x = 150;

quad[2].y = 100;

lcd_sync();

vga_draw_polygon_8bit(quad, 3, 1, P_GREEN, DO_FILL, frameBuffer11);

//here i draw triangle but how to draw it with 2 videopages mechansim ?

}

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by alexs@Apr 7 2006, 12:33 AM

    hi everybody http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/smile.gif

    i want to do my new board based on reference design auto_graphics_ref_design-v1.0.4

    and i found to many c files in design and it&#39;s dificault to understand all software design http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/sad.gif

    i just want to do my custom animation with two video pages where i move triangle and i don&#39;t understand how to do it correct without blinking.

    maybe someone have an experience with this ref design - help me please to make first steps.

    here is my program - it work but i not understant a too many strings.

    void my_main()

    {

    point quad[4];

    alt_u32 i, j, x1, y1, x2, y2;

    alt_32 rects[8] = {80, 160, 240, 320, 400, 480, 560, 640};

    alt_32 num_objects = 500;

    printf("my triangle\n\n");

    if ((bmpfile = fopen("/mnt/rozipfs/backdrop.bmp","rb")) == null) {

    printf("unable to open backdrop.bmp\n");

    return ;

    }

    bmpto565(bmpfile, framebuffer3); // why i don&#39;t see any pictute ?

    // clear frame buffers

    vga_paint_screen_8bit(p_trans, framebuffer11);

    //////////////////////////////

    lcd_sync();

    // set up dma for layer 2 from frame buffer 11

    lcddodma8(2, framebuffer11, screensize, 0x2f);

    lcd.const_alpha2 = 0x3f;

    // set up dma for layer 3 from frame buffer 12

    lcddodma8(4, framebuffer12, screensize, 0x3f);

    lcd_sync();

    // enable dma and turn on layers

    lcdlayers(0x04);

    // i copy this strings from sources and i don&#39;t understand what they mean - can some one to write comments ?

    //////////////////////////////

    quad[0].x = 10;

    quad[0].y = 10;

    quad[1].x = 100;

    quad[1].y = 10;

    quad[2].x = 150;

    quad[2].y = 100;

    quad[3].x = 0;

    quad[3].y = 0;

    for (i=0;i<512;i++)

    {

    quad[0].x = i;

    quad[0].y = i;

    quad[1].x = 100;

    quad[1].y = 10;

    quad[2].x = 150;

    quad[2].y = 100;

    lcd_sync();

    vga_draw_polygon_8bit(quad, 3, 1, p_green, do_fill, framebuffer11);

    //here i draw triangle but how to draw it with 2 videopages mechansim ?

    }

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=14116)

    --- quote end ---

    --- Quote End ---

    could you tell me ..

    when you use this reference design , the picture is normal ?

    I use this reference design, there is some green mask to cover the picture..

    do you have this problem?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok i understand how it works

    The idea is good but need strong work to make normal LCD controller with good alpha support.

    Unfortunaly alpha processing in this example is verry poor http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif

    And for gaming this core not good !!!!!!!

    Can i ask some quastion to altera team who make this aplication note

    Why you make 8-bit drawing layers ? what problem with 16bit drawing layers ?

    And i want to know your opinion about reality of my planes to rebuilding this core

    and what possible problems will be ?

    I want to make 4 layers core

    where

    layer 1 is 32 bit layer with 8 bit per pixel alpha

    layer 2 is 32 bit layer with 8 bit per pixel alpha

    layer 3 is 32 bit background layer 1

    layer 4 is 32 bit background layer 2

    layers 1 and 2 for drawing and srtite processing with alpha channel (2 videopages animation)

    Layers 3 and 4 - need to make background scrolling or animation (2 videopages animation too )

    What you think is it real to make on one SDRAM x32 memory ?

    or need to do separate SDRAM x32 videobanks ?Plus programm sdram ?

    in this case on Cyclone_1C20 board is not possible to do it.