Skip to content

Commit

Permalink
Merge pull request #820 from Daft-Freak/misc-atb-patches
Browse files Browse the repository at this point in the history
Misc patches
  • Loading branch information
Daft-Freak authored Jul 8, 2023
2 parents fc23c1d + 77e4456 commit ca63486
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
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);

0 comments on commit ca63486

Please sign in to comment.