changeset 1986:a042e046f7f2 tip

Fix libretro target
author Michael Pavone <pavone@retrodev.com>
date Sat, 16 May 2020 10:36:58 -0700
parents 7ebcbef45362
children
files Makefile event_log.c gen_player.c gen_player.h render.h
diffstat 5 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sat May 16 10:36:50 2020 -0700
+++ b/Makefile	Sat May 16 10:36:58 2020 -0700
@@ -217,7 +217,7 @@
 
 LIBOBJS=libblastem.o system.o genesis.o debug.o gdb_remote.o vdp.o io.o romdb.o hash.o xband.o realtec.o \
 	i2c.o nor.o sega_mapper.o multi_game.o megawifi.o $(NET) serialize.o $(TERMINAL) $(CONFIGOBJS) gst.o \
-	$(M68KOBJS) $(TRANSOBJS) $(AUDIOOBJS) saves.o jcart.o rom.db.o
+	$(M68KOBJS) $(TRANSOBJS) $(AUDIOOBJS) saves.o jcart.o rom.db.o gen_player.o
 	
 ifdef NONUKLEAR
 CFLAGS+= -DDISABLE_NUKLEAR
--- a/event_log.c	Sat May 16 10:36:50 2020 -0700
+++ b/event_log.c	Sat May 16 10:36:58 2020 -0700
@@ -10,6 +10,8 @@
 #include <netinet/tcp.h>
 #endif
 
+#include <stdlib.h>
+#include <string.h>
 #include <errno.h>
 #include "event_log.h"
 #include "util.h"
--- a/gen_player.c	Sat May 16 10:36:50 2020 -0700
+++ b/gen_player.c	Sat May 16 10:36:58 2020 -0700
@@ -1,7 +1,14 @@
+#include <stdlib.h>
 #include "gen_player.h"
 #include "event_log.h"
 #include "render.h"
 
+#define MCLKS_NTSC 53693175
+#define MCLKS_PAL  53203395
+#define MCLKS_PER_YM  7
+#define MCLKS_PER_Z80 15
+#define MCLKS_PER_PSG (MCLKS_PER_Z80*16)
+
 #ifdef IS_LIB
 #define MAX_SOUND_CYCLES (MCLKS_PER_YM*NUM_OPERATORS*6*4)
 #else
@@ -103,7 +110,9 @@
 {
 	gen_player *player = (gen_player *)sys;
 	if (player->reader.socket) {
+#ifndef IS_LIB
 		render_create_thread(&player->thread, "player", thread_main, player);
+#endif
 	} else {
 		run(player);
 	}
@@ -121,12 +130,6 @@
 	reader_send_gamepad_event(&player->reader, gamepad_num, button, 0);
 }
 
-#define MCLKS_NTSC 53693175
-#define MCLKS_PAL  53203395
-#define MCLKS_PER_YM  7
-#define MCLKS_PER_Z80 15
-#define MCLKS_PER_PSG (MCLKS_PER_Z80*16)
-
 static void config_common(gen_player *player)
 {
 	uint8_t vid_std = load_int8(&player->reader.buffer);
--- a/gen_player.h	Sat May 16 10:36:50 2020 -0700
+++ b/gen_player.h	Sat May 16 10:36:58 2020 -0700
@@ -14,7 +14,9 @@
 	vdp_context     *vdp;
 	ym2612_context  *ym;
 	psg_context     *psg;
+#ifndef IS_LIB
 	render_thread   thread;
+#endif
 	event_reader    reader;
 } gen_player;
 
--- a/render.h	Sat May 16 10:36:50 2020 -0700
+++ b/render.h	Sat May 16 10:36:58 2020 -0700
@@ -6,6 +6,8 @@
 #ifndef RENDER_H_
 #define RENDER_H_
 
+#include <stdint.h>
+
 #ifndef IS_LIB
 #ifdef USE_FBDEV
 #include "special_keys_evdev.h"
@@ -138,7 +140,9 @@
 void render_video_loop(void);
 uint8_t render_should_release_on_exit(void);
 void render_set_external_sync(uint8_t ext_sync_on);
+#ifndef IS_LIB
 uint8_t render_create_thread(render_thread *thread, const char *name, render_thread_fun fun, void *data);
+#endif
 
 #endif //RENDER_H_