From d3ea90f183a1742fe205f06ec6543f65869a6799 Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Tue, 17 May 2022 18:57:48 +1000 Subject: Add Linux support Oh boy this was a bit of a hassle lol - dynamic loading was the easiest part... but then came both sound and x11 Using SDL for now but I'd really like to change it for even lower layer, but then I might have to make my own mixer... oh no. --- board/simple_board.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'board/simple_board.h') diff --git a/board/simple_board.h b/board/simple_board.h index 9d9836b..f0997c7 100644 --- a/board/simple_board.h +++ b/board/simple_board.h @@ -2,17 +2,20 @@ static struct board_data board_data; +#define WAV_LEN(W) PREPROC_CONCAT(W,_len) +#define PREPROC_CONCAT(A, B) A ## B + void board_on_down(void) { #ifdef BOARD_DOWN_WAV - board_data.sound_play(BOARD_DOWN_WAV); + board_data.sound_play(BOARD_DOWN_WAV, WAV_LEN(BOARD_DOWN_WAV)); #endif } void board_on_up(void) { #ifdef BOARD_UP_WAV - board_data.sound_play(BOARD_UP_WAV); + board_data.sound_play(BOARD_UP_WAV, WAV_LEN(BOARD_UP_WAV)); #endif } @@ -30,4 +33,4 @@ struct board *board_init(struct board_data data) { board_data = data; return &board; -} \ No newline at end of file +} -- cgit