6 years ago
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
NEW 6 years ago
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
NEW 6 years ago
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.
NEW 6 years ago
Some car races for example ;) You definitively have to make some simple tuto if you can Alban... It's could be useful...
Alban
6 years ago
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.
NEW 6 years ago
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.
NEW 6 years ago
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
NEW 6 years ago
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!
NEW 6 years ago
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.
NEW 6 years ago
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.
NEW 6 years ago
A specialized chip with its own memory for graphics rendering, and sometimes facilities for effects (e.g. the famous SNES mode 7)
NEW 6 years ago
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