mirror of
https://github.com/jamessanford/kegs.git
synced 2024-08-06 14:29:30 +00:00
Initial changes for __ANDROID__
This commit is contained in:
parent
cc7bd844d6
commit
9750667958
@ -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 "defc.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#include <android/log.h>
|
||||||
|
|
||||||
#include "disas.h"
|
#include "disas.h"
|
||||||
|
|
||||||
#define LINE_SIZE 160
|
#define LINE_SIZE 160
|
||||||
@ -1170,8 +1172,9 @@ halt_printf(const char *fmt, ...)
|
|||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
vprintf(fmt, args);
|
__android_log_vprint(ANDROID_LOG_ERROR,"libkegs",fmt,args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
while(1) { sleep(600); } // sleep forever
|
||||||
|
|
||||||
set_halt(1);
|
set_halt(1);
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,11 @@ const char rcsid_joystick_driver_c[] = "@(#)$KmKId: joystick_driver.c,v 1.12 200
|
|||||||
#include "defc.h"
|
#include "defc.h"
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
#ifndef __ANDROID__
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
# include <linux/joystick.h>
|
# include <linux/joystick.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
@ -37,6 +39,7 @@ int g_joystick_num_axes = 0;
|
|||||||
int g_joystick_num_buttons = 0;
|
int g_joystick_num_buttons = 0;
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __ANDROID__
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
# define JOYSTICK_DEFINED
|
# define JOYSTICK_DEFINED
|
||||||
void
|
void
|
||||||
@ -128,6 +131,7 @@ joystick_update_buttons()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif /* LINUX */
|
#endif /* LINUX */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# define JOYSTICK_DEFINED
|
# define JOYSTICK_DEFINED
|
||||||
|
@ -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] = "./";
|
char g_argv0_path[256] = "./";
|
||||||
|
|
||||||
const char *g_kegs_default_paths[] = { "", "./", "${HOME}/",
|
const char *g_kegs_default_paths[] = { "", "./", "/mnt/sdcard/KEGS/",
|
||||||
"${HOME}/Library/KEGS/",
|
"/sdcard/KEGS/",
|
||||||
"${0}/Contents/Resources/", "/usr/local/lib/",
|
"/storage/sdcard0/KEGS/",
|
||||||
"/usr/local/kegs/", "/usr/local/lib/kegs/", "/usr/share/kegs/",
|
"/mnt/sdcard/kegs/",
|
||||||
"/var/lib/", "/usr/lib/kegs/", "${0}/", 0 };
|
"/sdcard/kegs/",
|
||||||
|
"/storage/sdcard0/kegs/",
|
||||||
|
"${0}/", 0 };
|
||||||
|
|
||||||
#define MAX_EVENTS 64
|
#define MAX_EVENTS 64
|
||||||
|
|
||||||
|
14
jni/sound.c
14
jni/sound.c
@ -45,7 +45,7 @@ int g_queued_samps = 0;
|
|||||||
int g_queued_nonsamps = 0;
|
int g_queued_nonsamps = 0;
|
||||||
int g_num_osc_interrupting = 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;
|
int g_audio_enable = -1;
|
||||||
#else
|
#else
|
||||||
# if defined(OSS)
|
# if defined(OSS)
|
||||||
@ -237,7 +237,7 @@ sound_init()
|
|||||||
void
|
void
|
||||||
sound_init_general()
|
sound_init_general()
|
||||||
{
|
{
|
||||||
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC)
|
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC) && !defined(__ANDROID__)
|
||||||
int pid;
|
int pid;
|
||||||
int shmid;
|
int shmid;
|
||||||
int tmp;
|
int tmp;
|
||||||
@ -247,7 +247,7 @@ sound_init_general()
|
|||||||
int size;
|
int size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC)
|
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC) && !defined(__ANDROID__)
|
||||||
if(!g_use_shmem) {
|
if(!g_use_shmem) {
|
||||||
if(g_audio_enable < 0) {
|
if(g_audio_enable < 0) {
|
||||||
printf("Defaulting audio off for slow X display\n");
|
printf("Defaulting audio off for slow X display\n");
|
||||||
@ -264,7 +264,7 @@ sound_init_general()
|
|||||||
|
|
||||||
size = SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE;
|
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);
|
shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777);
|
||||||
if(shmid < 0) {
|
if(shmid < 0) {
|
||||||
printf("sound_init: shmget ret: %d, errno: %d\n", shmid,
|
printf("sound_init: shmget ret: %d, errno: %d\n", shmid,
|
||||||
@ -295,7 +295,7 @@ sound_init_general()
|
|||||||
|
|
||||||
fflush(stdout);
|
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 */
|
/* prepare pipe so parent can signal child each other */
|
||||||
/* pipe[0] = read side, pipe[1] = write end */
|
/* pipe[0] = read side, pipe[1] = write end */
|
||||||
ret = pipe(&g_pipe_fd[0]);
|
ret = pipe(&g_pipe_fd[0]);
|
||||||
@ -348,9 +348,11 @@ sound_init_general()
|
|||||||
# ifdef MAC
|
# ifdef MAC
|
||||||
macsnd_init(shmaddr);
|
macsnd_init(shmaddr);
|
||||||
# else
|
# else
|
||||||
|
# if !defined(__ANDROID__)
|
||||||
/* windows */
|
/* windows */
|
||||||
win32snd_init(shmaddr);
|
win32snd_init(shmaddr);
|
||||||
# endif
|
# endif
|
||||||
|
# endif
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1009,7 +1011,7 @@ sound_play(double dsamps)
|
|||||||
|
|
||||||
outptr += 2;
|
outptr += 2;
|
||||||
|
|
||||||
#if defined(__linux__) || defined(OSS)
|
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(OSS)
|
||||||
/* Linux seems to expect little-endian */
|
/* Linux seems to expect little-endian */
|
||||||
/* samples always, even on PowerPC */
|
/* samples always, even on PowerPC */
|
||||||
# ifdef KEGS_LITTLE_ENDIAN
|
# ifdef KEGS_LITTLE_ENDIAN
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
const char rcsid_sound_h[] = "@(#)$KmKId: sound.h,v 1.17 2003-11-21 15:15:57-05 kentd Exp $";
|
const char rcsid_sound_h[] = "@(#)$KmKId: sound.h,v 1.17 2003-11-21 15:15:57-05 kentd Exp $";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(__CYGWIN__)
|
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__ANDROID__)
|
||||||
# include <sys/ipc.h>
|
# include <sys/ipc.h>
|
||||||
# include <sys/shm.h>
|
# include <sys/shm.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,7 +17,7 @@ const char rcsid_sound_driver_c[] = "@(#)$KmKId: sound_driver.c,v 1.17 2004-09-2
|
|||||||
# include <sys/audio.h>
|
# include <sys/audio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__) || defined(OSS)
|
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(OSS)
|
||||||
# include <sys/soundcard.h>
|
# include <sys/soundcard.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -128,10 +128,14 @@ child_sound_loop(int read_fd, int write_fd, word32 *shm_addr)
|
|||||||
g_childsnd_vbl = 0;
|
g_childsnd_vbl = 0;
|
||||||
g_childsnd_shm_addr = shm_addr;
|
g_childsnd_shm_addr = shm_addr;
|
||||||
|
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HPUX
|
#ifdef HPUX
|
||||||
child_sound_init_hpdev();
|
child_sound_init_hpdev();
|
||||||
#endif
|
#endif
|
||||||
#if defined(__linux__) || defined(OSS)
|
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(OSS)
|
||||||
child_sound_init_linux();
|
child_sound_init_linux();
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -351,7 +355,7 @@ child_sound_init_hpdev()
|
|||||||
}
|
}
|
||||||
#endif /* HPUX */
|
#endif /* HPUX */
|
||||||
|
|
||||||
#if defined(__linux__) || defined(OSS)
|
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(OSS)
|
||||||
void
|
void
|
||||||
child_sound_init_linux()
|
child_sound_init_linux()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user