Initial changes for __ANDROID__

This commit is contained in:
James Sanford 2012-08-06 16:56:51 -07:00
parent cc7bd844d6
commit 9750667958
6 changed files with 31 additions and 16 deletions

View File

@ -14,6 +14,8 @@ const char rcsid_dis_c[] = "@(#)$KmKId: dis.c,v 1.103 2004-11-24 16:41:41-05 ken
#include "defc.h"
#include <stdarg.h>
#include <android/log.h>
#include "disas.h"
#define LINE_SIZE 160
@ -1170,8 +1172,9 @@ halt_printf(const char *fmt, ...)
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
__android_log_vprint(ANDROID_LOG_ERROR,"libkegs",fmt,args);
va_end(args);
while(1) { sleep(600); } // sleep forever
set_halt(1);
}

View File

@ -13,9 +13,11 @@ const char rcsid_joystick_driver_c[] = "@(#)$KmKId: joystick_driver.c,v 1.12 200
#include "defc.h"
#include <sys/time.h>
#ifndef __ANDROID__
#ifdef __linux__
# include <linux/joystick.h>
#endif
#endif
#ifdef _WIN32
# include <windows.h>
@ -37,6 +39,7 @@ int g_joystick_num_axes = 0;
int g_joystick_num_buttons = 0;
#ifndef __ANDROID__
#ifdef __linux__
# define JOYSTICK_DEFINED
void
@ -128,6 +131,7 @@ joystick_update_buttons()
{
}
#endif /* LINUX */
#endif
#ifdef _WIN32
# define JOYSTICK_DEFINED

View File

@ -21,11 +21,13 @@ const char rcsid_sim65816_c[] = "@(#)$KmKId: sim65816.c,v 1.367 2004-11-22 02:39
char g_argv0_path[256] = "./";
const char *g_kegs_default_paths[] = { "", "./", "${HOME}/",
"${HOME}/Library/KEGS/",
"${0}/Contents/Resources/", "/usr/local/lib/",
"/usr/local/kegs/", "/usr/local/lib/kegs/", "/usr/share/kegs/",
"/var/lib/", "/usr/lib/kegs/", "${0}/", 0 };
const char *g_kegs_default_paths[] = { "", "./", "/mnt/sdcard/KEGS/",
"/sdcard/KEGS/",
"/storage/sdcard0/KEGS/",
"/mnt/sdcard/kegs/",
"/sdcard/kegs/",
"/storage/sdcard0/kegs/",
"${0}/", 0 };
#define MAX_EVENTS 64

View File

@ -45,7 +45,7 @@ int g_queued_samps = 0;
int g_queued_nonsamps = 0;
int g_num_osc_interrupting = 0;
#if defined(HPUX) || defined(__linux__) || defined(_WIN32) || defined(MAC)
#if defined(HPUX) || (defined(__linux__) && !defined(__ANDROID__)) || defined(_WIN32) || defined(MAC)
int g_audio_enable = -1;
#else
# if defined(OSS)
@ -237,7 +237,7 @@ sound_init()
void
sound_init_general()
{
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC)
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC) && !defined(__ANDROID__)
int pid;
int shmid;
int tmp;
@ -247,7 +247,7 @@ sound_init_general()
int size;
int ret;
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC)
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC) && !defined(__ANDROID__)
if(!g_use_shmem) {
if(g_audio_enable < 0) {
printf("Defaulting audio off for slow X display\n");
@ -264,7 +264,7 @@ sound_init_general()
size = SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE;
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC)
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC) && !defined(__ANDROID__)
shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777);
if(shmid < 0) {
printf("sound_init: shmget ret: %d, errno: %d\n", shmid,
@ -295,7 +295,7 @@ sound_init_general()
fflush(stdout);
#if !defined(MAC) && !defined(_WIN32) && !defined(__CYGWIN__)
#if !defined(MAC) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__ANDROID__)
/* prepare pipe so parent can signal child each other */
/* pipe[0] = read side, pipe[1] = write end */
ret = pipe(&g_pipe_fd[0]);
@ -348,8 +348,10 @@ sound_init_general()
# ifdef MAC
macsnd_init(shmaddr);
# else
# if !defined(__ANDROID__)
/* windows */
win32snd_init(shmaddr);
# endif
# endif
#endif /* _WIN32 */
@ -1009,7 +1011,7 @@ sound_play(double dsamps)
outptr += 2;
#if defined(__linux__) || defined(OSS)
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(OSS)
/* Linux seems to expect little-endian */
/* samples always, even on PowerPC */
# ifdef KEGS_LITTLE_ENDIAN

View File

@ -12,7 +12,7 @@
const char rcsid_sound_h[] = "@(#)$KmKId: sound.h,v 1.17 2003-11-21 15:15:57-05 kentd Exp $";
#endif
#if !defined(_WIN32) && !defined(__CYGWIN__)
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__ANDROID__)
# include <sys/ipc.h>
# include <sys/shm.h>
#endif

View File

@ -17,7 +17,7 @@ const char rcsid_sound_driver_c[] = "@(#)$KmKId: sound_driver.c,v 1.17 2004-09-2
# include <sys/audio.h>
#endif
#if defined(__linux__) || defined(OSS)
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(OSS)
# include <sys/soundcard.h>
#endif
@ -128,10 +128,14 @@ child_sound_loop(int read_fd, int write_fd, word32 *shm_addr)
g_childsnd_vbl = 0;
g_childsnd_shm_addr = shm_addr;
#if defined(__ANDROID__)
return;
#endif
#ifdef HPUX
child_sound_init_hpdev();
#endif
#if defined(__linux__) || defined(OSS)
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(OSS)
child_sound_init_linux();
#endif
#ifdef _WIN32
@ -351,7 +355,7 @@ child_sound_init_hpdev()
}
#endif /* HPUX */
#if defined(__linux__) || defined(OSS)
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(OSS)
void
child_sound_init_linux()
{