Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions libraries/picosystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,13 @@ namespace picosystem {
blend_func_t _bf = ALPHA;

#ifndef DYNAMIC_BUFFER
#ifdef PIXEL_DOUBLE
color_t _fb[120 * 120] __attribute__ ((aligned (4))) = { };
buffer_t *SCREEN = buffer(120, 120, _fb);
int32_t _cx = 0, _cy = 0, _cw = 120, _ch = 120;
#else
color_t _fb[240 * 240] __attribute__ ((aligned (4))) = { };
buffer_t *SCREEN = buffer(240, 240, _fb);
int32_t _cx = 0, _cy = 0, _cw = 240, _ch = 240;
#endif

color_t _fb[SCREEN_WIDTH * SCREEN_HEIGHT] __attribute__ ((aligned (4))) = { };
buffer_t *SCREEN = buffer(SCREEN_WIDTH, SCREEN_HEIGHT, _fb);
int32_t _cx = 0, _cy = 0, _cw = SCREEN_WIDTH, _ch = SCREEN_HEIGHT;
#else
buffer_t *SCREEN = nullptr;
int32_t _cx = 0, _cy = 0, _cw = 120, _ch = 120;
int32_t _cx = 0, _cy = 0, _cw = SCREEN_WIDTH, _ch = SCREEN_HEIGHT;
#endif

buffer_t *_dt = SCREEN;
Expand Down
10 changes: 10 additions & 0 deletions libraries/picosystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@

#include "pico/stdlib.h"

#ifdef PIXEL_DOUBLE

#define SCREEN_WIDTH 120
#define SCREEN_HEIGHT 120
#else

#define SCREEN_WIDTH 240
#define SCREEN_HEIGHT 240
#endif // PIXEL_DOUBLE

void init();
void update(uint32_t tick);
void draw(uint32_t tick);
Expand Down