diff --git a/Makefile.libretro b/Makefile.libretro index 6ca782f..d76fd09 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -29,11 +29,14 @@ else ifneq ($(findstring MINGW,$(shell uname -a)),) system_platform = win endif +ifeq ($(platform), win) + INCLUDES += -I Windows +endif CORE_DIR += ./Core LIBRETRO_DIR += ./libretro TARGET_NAME = sameboy -LIBM = -lc -lm +LIBM = -lm INCLUDES += -I $(CORE_DIR) ifeq ($(ARCHFLAGS),) diff --git a/Windows/stdio.h b/Windows/stdio.h index 33ced45..ceba4d1 100755 --- a/Windows/stdio.h +++ b/Windows/stdio.h @@ -2,6 +2,7 @@ #include_next #include +#ifndef __LIBRETRO__ static inline int vasprintf(char **str, const char *fmt, va_list args) { 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; } +#endif /* This code is public domain -- Will Hartung 4/9/09 */ static inline size_t getline(char **lineptr, size_t *n, FILE *stream) { diff --git a/libretro/libretro.c b/libretro/libretro.c index a841ae4..4bf118e 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -194,8 +194,8 @@ void retro_set_controller_port_device(unsigned port, unsigned device) void retro_get_system_info(struct retro_system_info *info) { memset(info, 0, sizeof(*info)); - info->library_name = "sameboy"; - info->library_version = "0.1"; + info->library_name = "SameBoy"; + info->library_version = "0.8"; info->need_fullpath = true; 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) { 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->timing = timing; @@ -275,9 +275,7 @@ void retro_run(void) if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) check_variables(); - while(RLOOP==1)GB_run(&gb); - RLOOP=1; - + GB_run_frame(&gb); video_cb(frame_buf, VIDEO_WIDTH, VIDEO_HEIGHT, 0); } @@ -349,7 +347,7 @@ bool retro_load_game(const struct retro_game_info *info) /* Configure battery */ replace_extension(retro_game_path, path_length, battery_save_path, ".sav"); GB_load_battery(&gb, battery_save_path); -printf("(%s)\n",battery_save_path); + printf("(%s)\n",battery_save_path); /* Configure symbols */ sprintf(TMPC,"%s/registers.sym",retro_base_directory);