use GB_run_frame

This commit is contained in:
radius 2017-04-24 20:50:35 -05:00
parent 33a9c54842
commit 65e6e5f30b
3 changed files with 11 additions and 8 deletions

View File

@ -29,11 +29,14 @@ else ifneq ($(findstring MINGW,$(shell uname -a)),)
system_platform = win system_platform = win
endif endif
ifeq ($(platform), win)
INCLUDES += -I Windows
endif
CORE_DIR += ./Core CORE_DIR += ./Core
LIBRETRO_DIR += ./libretro LIBRETRO_DIR += ./libretro
TARGET_NAME = sameboy TARGET_NAME = sameboy
LIBM = -lc -lm LIBM = -lm
INCLUDES += -I $(CORE_DIR) INCLUDES += -I $(CORE_DIR)
ifeq ($(ARCHFLAGS),) ifeq ($(ARCHFLAGS),)

View File

@ -2,6 +2,7 @@
#include_next <stdio.h> #include_next <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef __LIBRETRO__
static inline int vasprintf(char **str, const char *fmt, va_list args) static inline int vasprintf(char **str, const char *fmt, va_list args)
{ {
size_t size = _vscprintf(fmt, args) + 1; size_t size = _vscprintf(fmt, args) + 1;
@ -14,6 +15,7 @@ static inline int vasprintf(char **str, const char *fmt, va_list args)
} }
return ret; return ret;
} }
#endif
/* This code is public domain -- Will Hartung 4/9/09 */ /* This code is public domain -- Will Hartung 4/9/09 */
static inline size_t getline(char **lineptr, size_t *n, FILE *stream) { static inline size_t getline(char **lineptr, size_t *n, FILE *stream) {

View File

@ -194,8 +194,8 @@ void retro_set_controller_port_device(unsigned port, unsigned device)
void retro_get_system_info(struct retro_system_info *info) void retro_get_system_info(struct retro_system_info *info)
{ {
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
info->library_name = "sameboy"; info->library_name = "SameBoy";
info->library_version = "0.1"; info->library_version = "0.8";
info->need_fullpath = true; info->need_fullpath = true;
info->valid_extensions = "gb|gbc"; info->valid_extensions = "gb|gbc";
} }
@ -204,7 +204,7 @@ void retro_get_system_info(struct retro_system_info *info)
void retro_get_system_av_info(struct retro_system_av_info *info) void retro_get_system_av_info(struct retro_system_av_info *info)
{ {
struct retro_game_geometry geom = { VIDEO_WIDTH, VIDEO_HEIGHT,VIDEO_WIDTH, VIDEO_HEIGHT ,160.0 / 144.0 }; struct retro_game_geometry geom = { VIDEO_WIDTH, VIDEO_HEIGHT,VIDEO_WIDTH, VIDEO_HEIGHT ,160.0 / 144.0 };
struct retro_system_timing timing = { 60.0, 44100.0 }; struct retro_system_timing timing = { 59.72, 44100.0 };
info->geometry = geom; info->geometry = geom;
info->timing = timing; info->timing = timing;
@ -275,9 +275,7 @@ void retro_run(void)
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
check_variables(); check_variables();
while(RLOOP==1)GB_run(&gb); GB_run_frame(&gb);
RLOOP=1;
video_cb(frame_buf, VIDEO_WIDTH, VIDEO_HEIGHT, 0); video_cb(frame_buf, VIDEO_WIDTH, VIDEO_HEIGHT, 0);
} }