Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc patches #820

Merged
merged 4 commits into from
Jul 8, 2023
Merged
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
1 change: 1 addition & 0 deletions 32blit-pico/board/vgaboard/config.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set(BLIT_BOARD_NAME "VGA Board")

set(BLIT_BOARD_DEFINITIONS
PICO_AUDIO_I2S_BUFFER_SAMPLE_LENGTH=256
PICO_SCANVIDEO_PLANE1_VARIABLE_FRAGMENT_DMA=1
PICO_SCANVIDEO_MAX_SCANLINE_BUFFER_WORDS=12
)
Expand Down
3 changes: 0 additions & 3 deletions 32blit-pico/display_scanvideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ static volatile int buf_index = 0;

static volatile bool do_render = true;

// user render function
void render(uint32_t);

static bool do_render_soon = false; // slightly delayed to handle the queue

static void fill_scanline_buffer(struct scanvideo_scanline_buffer *buffer) {
Expand Down
4 changes: 3 additions & 1 deletion 32blit-pico/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ static uint32_t random() {
}

static void debug(const char *message) {
fputs(message, stdout);
auto p = message;
while(*p)
putchar(*p++);

usb_debug(message);
}
Expand Down
6 changes: 4 additions & 2 deletions 32blit-sdl/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

blit::AudioChannel channels[CHANNEL_COUNT];

static void _audio_callback(void *userdata, uint8_t *stream, int len);

Audio::Audio() {
blit::api.channels = channels;

Expand All @@ -35,14 +37,14 @@ Audio::~Audio() {
SDL_CloseAudioDevice(audio_device);
}

void _audio_bufferfill(short *buffer, int buffer_size){
static void _audio_bufferfill(short *buffer, int buffer_size){
memset(buffer, 0, buffer_size);

for(auto sample = 0; sample < buffer_size; sample++){
buffer[sample] = (int)blit::get_audio_frame() - 0x8000;
}
}

void _audio_callback(void *userdata, uint8_t *stream, int len){
static void _audio_callback(void *userdata, uint8_t *stream, int len){
_audio_bufferfill((short *)stream, len / 2);
}
3 changes: 0 additions & 3 deletions 32blit-sdl/Audio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ class Audio {

SDL_AudioDeviceID audio_device;
};

void _audio_bufferfill(short *pBuffer, int pBufferSize);
void _audio_callback(void *userdata, uint8_t *stream, int len);