Skip to content

Commit 81311ec

Browse files
Support blue/green software flip
Move the player 1 right direction to a new pin
1 parent 1bdc60a commit 81311ec

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

src/ledgames/controls.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define BUTTON_P1_JOYUP 79
88
#define BUTTON_P1_JOYDN 73
99
#define BUTTON_P1_JOYLEFT 74
10-
#define BUTTON_P1_JOYRIGHT 75
10+
#define BUTTON_P1_JOYRIGHT 89
1111
#define BUTTON_P1_ACTION_PRI 76
1212
#define BUTTON_P1_ACTION_SEC 77
1313
#define BUTTON_P2_JOYUP 8

src/ledgames/invaders.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void render_game(Screen *screen) {
281281
}
282282
invader_idx++;
283283
}
284-
invader_speed = 0.05f + ((24 - active_invaders) * 0.08f);
284+
invader_speed = 0.05f + ((24 - active_invaders) * 0.07f);
285285
if (active_invaders == 0) {
286286
reset_invaders(current_player);
287287
}

src/ledscape/ledscape.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,13 @@ ledscape_matrix_panel_copy(
288288
uint8_t * const pix = &out[x*row_stride + (y/(config->panel_height/2))*3 + (y%(config->panel_height/2))*row_len];
289289

290290
pix[0] = (col >> 16) & 0xFF; // red
291+
#if LEDSCAPE_MATRIX_GB_INVERT
292+
pix[1] = (col >> 0) & 0xFF; // green
293+
pix[2] = (col >> 8) & 0xFF; // blue
294+
#else
291295
pix[1] = (col >> 8) & 0xFF; // green
292296
pix[2] = (col >> 0) & 0xFF; // blue
297+
#endif
293298
//printf("%d,%d => %p %p %08x\n", x, y, pix, col_ptr, col);
294299
}
295300
}

src/ledscape/ledscape.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ typedef struct {
3030
#define LEDSCAPE_MATRIX_OUTPUTS 1 // number of outputs on the cape
3131
#define LEDSCAPE_MATRIX_PANELS 4 // number of panels chained per output
3232

33+
#define LEDSCAPE_MATRIX_GB_INVERT 1 // Flips green and blue colors, as this is different panel to panel
34+
3335
typedef struct {
3436
int type;
3537
int width;

0 commit comments

Comments
 (0)