Skip to content

Commit

Permalink
use GB_run_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
andres-asm committed Oct 9, 2017
1 parent 33a9c54 commit 65e6e5f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Makefile.libretro
Original file line number Diff line number Diff line change
Expand Up @@ -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),)
Expand Down
2 changes: 2 additions & 0 deletions Windows/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include_next <stdio.h>
#include <stdlib.h>

#ifndef __LIBRETRO__
static inline int vasprintf(char **str, const char *fmt, va_list args)
{
size_t size = _vscprintf(fmt, args) + 1;
Expand All @@ -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) {
Expand Down
12 changes: 5 additions & 7 deletions libretro/libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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;
Expand Down Expand Up @@ -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);

}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 65e6e5f

Please sign in to comment.