Skip to content

Commit

Permalink
update dreamcast port to master
Browse files Browse the repository at this point in the history
  • Loading branch information
asiekierka committed Jan 13, 2019
1 parent 508becc commit 32c0497
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
3 changes: 1 addition & 2 deletions arch/dreamcast/audio.c
Expand Up @@ -25,7 +25,6 @@

#include <kos.h>
#include <string.h>
#include "platform.h"

#ifdef CONFIG_AUDIO

Expand Down Expand Up @@ -57,7 +56,7 @@ static void *dc_audio_thread(void *dud)

void init_audio_platform(struct config_info *conf)
{
audio.buffer_samples = conf->buffer_size / 2;
audio.buffer_samples = conf->audio_buffer_samples / 2;
buffer_size = 4 * audio.buffer_samples;
audio.mix_buffer = cmalloc(buffer_size * 2);
sound_buffer = cmalloc(buffer_size);
Expand Down
20 changes: 10 additions & 10 deletions arch/dreamcast/event.c
Expand Up @@ -36,11 +36,11 @@ void real_warp_mouse(int x, int y)
{
}

bool dc_update_input(void);
boolean dc_update_input(void);

bool __update_event_status(void)
boolean __update_event_status(void)
{
bool retval = false;
boolean retval = false;
retval |= dc_update_input();
return retval;
}
Expand All @@ -56,7 +56,7 @@ void __wait_event(int timeout)

// Taken from arch/nds/event.c
// Send a key up/down event to MZX.
void do_unicode_key_event(struct buffered_status *status, bool down,
void do_unicode_key_event(struct buffered_status *status, boolean down,
enum keycode code, int unicode)
{
if(down)
Expand All @@ -75,23 +75,23 @@ void do_unicode_key_event(struct buffered_status *status, bool down,
}
}

void do_key_event(struct buffered_status *status, bool down,
void do_key_event(struct buffered_status *status, boolean down,
enum keycode code)
{
do_unicode_key_event(status, down, code,
(code >= 32 && code <= 126) ? code : 0);
}

// Send a joystick button up/down event to MZX.
void do_joybutton_event(struct buffered_status *status, bool down,
void do_joybutton_event(struct buffered_status *status, boolean down,
int button)
{
// Look up the keycode for this joystick button.
enum keycode stuffed_key = input.joystick_button_map[0][button];
do_key_event(status, down, stuffed_key);
}

static inline bool check_key(struct buffered_status *status,
static inline boolean check_key(struct buffered_status *status,
Uint32 down, Uint32 up, Uint32 key, enum keycode code)
{
if(down & key)
Expand All @@ -113,7 +113,7 @@ static inline bool check_key(struct buffered_status *status,
}
}

static inline bool check_joy(struct buffered_status *status,
static inline boolean check_joy(struct buffered_status *status,
Uint32 down, Uint32 up, Uint32 key, Uint32 code)
{
if(down & key)
Expand All @@ -138,13 +138,13 @@ static inline bool check_joy(struct buffered_status *status,
static Uint32 last_buttons;
static Uint32 last_ltrig, last_rtrig;

bool dc_update_input(void)
boolean dc_update_input(void)
{
struct buffered_status *status = store_status();
maple_device_t *maple_pad, *maple_kbd;
cont_state_t *pad;
Uint32 down, held, up;
bool retval = false;
boolean retval = false;

maple_pad = maple_enum_type(0, MAPLE_FUNC_CONTROLLER);
if (maple_pad && (pad = (cont_state_t*) maple_dev_status(maple_pad))) {
Expand Down
6 changes: 3 additions & 3 deletions arch/dreamcast/event.h
Expand Up @@ -24,9 +24,9 @@

#include "../../src/event.h"

void do_unicode_key_event(struct buffered_status *status, bool down,
void do_unicode_key_event(struct buffered_status *status, boolean down,
enum keycode code, int unicode);
void do_key_event(struct buffered_status *status, bool down, enum keycode code);
void do_joybutton_event(struct buffered_status *status, bool down, int button);
void do_key_event(struct buffered_status *status, boolean down, enum keycode code);
void do_joybutton_event(struct buffered_status *status, boolean down, int button);

#endif /* __DREAMCAST_EVENT_H__ */
2 changes: 1 addition & 1 deletion arch/dreamcast/platform.c
Expand Up @@ -41,7 +41,7 @@ Uint32 get_ticks(void)
return (Uint32) timer_ms_gettime64();
}

bool platform_init(void)
boolean platform_init(void)
{
return true;
}
Expand Down
1 change: 1 addition & 0 deletions arch/dreamcast/thread.h
Expand Up @@ -25,6 +25,7 @@
__M_BEGIN_DECLS

#include <kos.h>
#include <stdbool.h>

#define THREAD_RES void*
#define THREAD_RETURN do { return; } while(0)
Expand Down

0 comments on commit 32c0497

Please sign in to comment.