removed inter-frame input polling

This commit is contained in:
Anthony Pesch 2017-07-18 00:07:37 -04:00
parent df82a79f23
commit 4b45de9d7c
6 changed files with 3 additions and 30 deletions

View File

@ -335,12 +335,6 @@ static void emu_start_tracing(struct emu *emu) {
/*
* dreamcast guest interface
*/
static void emu_guest_poll_input(void *userdata) {
struct emu *emu = userdata;
input_poll(emu->host);
}
static void emu_guest_vertical_blank(void *userdata) {
struct emu *emu = userdata;
@ -759,7 +753,6 @@ struct emu *emu_create(struct host *host) {
emu->dc->start_render = &emu_guest_start_render;
emu->dc->finish_render = &emu_guest_finish_render;
emu->dc->vertical_blank = &emu_guest_vertical_blank;
emu->dc->poll_input = &emu_guest_poll_input;
/* add all textures to free list by default */
for (int i = 0; i < array_size(emu->textures); i++) {

View File

@ -16,14 +16,6 @@
#include "guest/scheduler.h"
#include "guest/sh4/sh4.h"
void dc_poll_input(struct dreamcast *dc) {
if (!dc->poll_input) {
return;
}
dc->poll_input(dc->userdata);
}
void dc_vertical_blank(struct dreamcast *dc) {
if (!dc->vertical_blank) {
return;

View File

@ -126,7 +126,6 @@ typedef void (*push_audio_cb)(void *, const int16_t *, int);
typedef void (*start_render_cb)(void *, struct tile_context *);
typedef void (*finish_render_cb)(void *);
typedef void (*vertical_blank_cb)(void *);
typedef void (*poll_input_cb)(void *);
struct dreamcast {
int running;
@ -156,7 +155,6 @@ struct dreamcast {
start_render_cb start_render;
finish_render_cb finish_render;
vertical_blank_cb vertical_blank;
poll_input_cb poll_input;
};
struct dreamcast *dc_create();
@ -195,6 +193,5 @@ void dc_push_audio(struct dreamcast *dc, const int16_t *data, int frames);
void dc_start_render(struct dreamcast *dc, struct tile_context *ctx);
void dc_finish_render(struct dreamcast *dc);
void dc_vertical_blank(struct dreamcast *dc);
void dc_poll_input(struct dreamcast *dc);
#endif

View File

@ -33,12 +33,6 @@ struct controller {
struct maple_cond cnd;
};
static void controller_update(struct controller *ctrl) {
/* dc_poll_input will call into controller_input if new values are
available */
dc_poll_input(ctrl->dc);
}
static int controller_input(struct maple_device *dev, int button,
int16_t value) {
struct controller *ctrl = (struct controller *)dev;
@ -101,8 +95,6 @@ static int controller_frame(struct maple_device *dev,
}
case MAPLE_REQ_GETCOND: {
controller_update(ctrl);
res->header.command = MAPLE_RES_TRANSFER;
res->header.recv_addr = frame->header.send_addr;
res->header.send_addr = frame->header.recv_addr;

View File

@ -30,7 +30,6 @@ struct render_backend *video_create_renderer(struct host *host);
void video_destroy_renderer(struct host *host, struct render_backend *r);
/* input */
void input_poll(struct host *host);
int16_t input_get(struct host *host, int port, int button);
#endif

View File

@ -112,9 +112,7 @@ int video_width(struct host *base) {
/*
* input
*/
void input_poll(struct host *base) {
struct retro_host *host = (struct retro_host *)base;
static void input_poll(struct retro_host *host) {
input_poll_cb();
/* send updates for any inputs that've changed */
@ -265,6 +263,8 @@ void retro_set_controller_port_device(unsigned port, unsigned device) {}
void retro_reset() {}
void retro_run() {
input_poll(g_host);
/* bind the framebuffer provided by retroarch before calling into the
emulator */
uintptr_t fb = hw_render.get_current_framebuffer();