minor demo1 fixes

pull/19/head
graham sanderson 2021-05-05 12:02:35 -05:00
rodzic 7b53edc861
commit 457c725c21
1 zmienionych plików z 4 dodań i 5 usunięć

Wyświetl plik

@ -7,9 +7,7 @@
#include <string.h> #include <string.h>
#include "pico.h" #include "pico.h"
#include "hardware/uart.h"
#include "hardware/gpio.h" #include "hardware/gpio.h"
#include "hardware/divider.h"
#include "spans.h" #include "spans.h"
#include "pico/scanvideo.h" #include "pico/scanvideo.h"
#include "pico/scanvideo/composable_scanline.h" #include "pico/scanvideo/composable_scanline.h"
@ -421,12 +419,13 @@ int vga_main(void) {
#endif #endif
#ifndef IRQS_ON_CORE1 #ifndef IRQS_ON_CORE1
setup_video(); setup_video();
#else
sem_acquire_blocking(&video_setup_complete);
#endif #endif
#ifdef RENDER_ON_CORE0 #ifdef RENDER_ON_CORE0
render_loop(); render_loop();
#else #else
sem_acquire(&video_setup_complete);
while (true) { while (true) {
#ifndef TEST_WAIT_FOR_SCANLINE #ifndef TEST_WAIT_FOR_SCANLINE
// Just use vblank to print out a value every second // Just use vblank to print out a value every second
@ -439,7 +438,7 @@ int vga_main(void) {
#else #else
static uint32_t sl = 0; static uint32_t sl = 0;
sl = scanvideo_wait_for_scanline_complete(sl); sl = scanvideo_wait_for_scanline_complete(sl);
scanline_color = (scanline_color + 0x10u) & 0xffu; scanline_color = (scanline_color + 1) & 0x1fu;
#endif #endif
} }
#endif #endif
@ -554,7 +553,7 @@ bool render_scanline_test_pattern(struct scanvideo_scanline_buffer *dest, int co
#ifndef TEST_WAIT_FOR_SCANLINE #ifndef TEST_WAIT_FOR_SCANLINE
uint16_t c = 0xffff; uint16_t c = 0xffff;
#else #else
uint16_t c = 0x0421 * (scanline_color >> 4); uint16_t c = PICO_SCANVIDEO_PIXEL_FROM_RGB5(1,1,1) * scanline_color;
#endif #endif
if (w == 1) { if (w == 1) {
buf16[pos++] = COMPOSABLE_RAW_1P; buf16[pos++] = COMPOSABLE_RAW_1P;