colorscrolling

Général

tikkel

il y a 2 mois

Hello!

I wanted to ask if the META also has hardware special effects.
For example, like game consoles, hardwarescrolling, colorscrolling and various graphics modes.

Especially a colorscrolling would interest me.

Greeting from me

Martisse

NEW il y a 2 mois

I dont think so. But you can add Arduino components with the backpack. Like LED...

The gamebuino has also led . Go to tutorial section to learn it. Go hereTutorial of led

Alban

NEW il y a 2 mois

It's just a plain Cortex-M0+ architecture, so no gaming-dedicated hardware, but enough horspower to emulate all these effects to a certain extent.

Some games have already implemented rotations, zooms, palette cycling etc.

jicehel

NEW il y a 2 mois

Some car races for example  ;) You definitively have to make some simple tuto if you can Alban... It's could be useful...

Alban

il y a 2 mois

I know, but my code is so ugly I would have to rewrite from scratch to have something worth presenting. It was my first gamebuino project, grew organically, and I got so fed up with the Arduino IDE that I ended up writing code as it came.

My next project, if I manage to complete it, is designed a much better way, and in much better conditions ;-) I plan to document it more seriously.

Alban

NEW il y a 2 mois

jicehel jicehel

I know, but my code is so ugly I would have to rewrite from scratch to have something worth presenting. It was my first gamebuino project, grew organically, and I got so fed up with the Arduino IDE that I ended up writing code as it came.

My next project, if I manage to complete it, is designed a much better way, and in much better conditions ;-) I plan to document it more seriously.

jicehel

NEW il y a 2 mois

Maybe you could some very short program to illustrate the technics used (and complement the already existing tuto) Your tutos / examples could be agregated later to do a workshop on doing a race car from scratch. (And then your code could be reorganised in the tuto to have a more academic code) but it's another subject. I just bouncing on this subject as tikkel was talking about one of the technics used


Steph

NEW il y a 2 mois

Try this!

#include <Gamebuino-Meta.h>

const uint8_t GRADIENT[] = {
    16,   // frame width
    2,    // frame height
    1,    // number of frames
    0,    // ?... don't understand this value
    0,    // animation speed (0 means no animation)
    0x10, // transparent color (any value greater than 0xf is transparent)
    1,    // indexed color mode
          // colormap (2 pixels per byte)
    0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
    0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10
};

// must have 16 colors
const Color REFERENCE_PALETTE[] = {
    (Color)0x47e9, (Color)0x37e6, (Color)0x1fe4, (Color)0x0fe1,
    (Color)0x07a0, (Color)0x0700, (Color)0x0661, (Color)0x05c1,
    (Color)0x0501, (Color)0x0461, (Color)0x03c1, (Color)0x0320,
    (Color)0x0280, (Color)0x01e0, (Color)0x0140, (Color)0x00a0
};

const Image IMAGE(GRADIENT);

Color palette[16];

void setup() {
    gb.begin();
}

void loop() {
    while (!gb.update());

    // rotating palette
    for (uint8_t i=0; i<16; i++) {
        palette[i] = REFERENCE_PALETTE[(gb.frameCount+i)%16];
    }

    // draw image with new palette
    gb.display.setPalette(palette);
    gb.display.drawImage(32, 32, IMAGE);
}



Only works with indexed images... If you want the same effect in full RGB565, you'll have to write the bits in the right place by yourself!

jicehel

NEW il y a 2 mois

It's one of the technics for simulate quick races movements. It's can been used to make water, lava, lead, grass moving with good use of colors.

tikkel

NEW il y a 2 mois

OK,

so I have to paint all the effects.
Unfortunately, it is not possible to manipulate the color palette or image memory address directly on the graphics controller registers.

I was hoping to save some CPU time.

Thank you for the tips and the example.

Alban

il y a 2 mois

Indeed, there's just no graphics controller :-)

Alban

NEW il y a 2 mois

tikkel tikkel

Indeed, there's just no graphics controller :-)

Martisse

il y a 2 mois

What is a graphics controller?

Martisse

NEW il y a 2 mois

Alban Alban

What is a graphics controller?

Alban

il y a 2 mois

A specialized chip with its own memory for graphics rendering, and sometimes facilities for effects (e.g. the famous SNES mode 7)

jicehel

NEW il y a 2 mois

you can manipulate the color of the palette if you use indexed colors

tikkel

il y a 2 mois

... so I can change a color of the palette afterwards and this change would be visible immediately?

Alban

NEW il y a 2 mois

Martisse Martisse

A specialized chip with its own memory for graphics rendering, and sometimes facilities for effects (e.g. the famous SNES mode 7)

Sorunome

NEW il y a 2 mois

The screen controller actually has some hardware effects, such as color inversion. No scrolling, though.

For example. gb.setRotation() also uses screen hardware to rotate the contents

tikkel

NEW il y a 2 mois

jicehel jicehel

... so I can change a color of the palette afterwards and this change would be visible immediately?

Steph

il y a 2 mois

Yes, you don't need to redraw the image :-)

Steph

NEW il y a 2 mois

tikkel tikkel

Yes, you don't need to redraw the image :-)

You must be logged in in order to post a message on the forum

Connexion