Fix Desktop and Android builds after headless upheaval

This commit is contained in:
Aaron Culliney 2017-07-31 17:47:58 -07:00
parent 98aecedd65
commit 11cf51753b
8 changed files with 72 additions and 35 deletions

View File

@ -406,10 +406,10 @@ jstring Java_org_deadc0de_apple2ix_Apple2DisksMenu_nativeChooseDisk(JNIEnv *env,
if (err) {
char *diskImageUnreadable = "Disk Image Unreadable";
unsigned int cols = strlen(diskImageUnreadable);
video_animations->animation_showMessage(diskImageUnreadable, cols, 1);
video_getAnimationDriver()->animation_showMessage(diskImageUnreadable, cols, 1);
inserted = false;
} else {
video_animations->animation_showDiskChosen(drive);
video_getAnimationDriver()->animation_showDiskChosen(drive);
}
json_mapSetBoolValue(jsonData, "inserted", inserted);

View File

@ -4,40 +4,62 @@
APPLE2_SRC_PATH := apple2ix-src
APPLE2_X86_SRC := \
$(APPLE2_SRC_PATH)/x86/glue.S $(APPLE2_SRC_PATH)/x86/cpu.S
$(APPLE2_SRC_PATH)/x86/cpu.S \
$(APPLE2_SRC_PATH)/x86/glue.S
APPLE2_ARM_SRC := \
$(APPLE2_SRC_PATH)/arm/glue.S $(APPLE2_SRC_PATH)/arm/cpu.S
$(APPLE2_SRC_PATH)/arm/cpu.S \
$(APPLE2_SRC_PATH)/arm/glue.S
APPLE2_VIDEO_SRC = \
$(APPLE2_SRC_PATH)/video/glvideo.c \
$(APPLE2_SRC_PATH)/video/glnode.c \
$(APPLE2_SRC_PATH)/video/glhudmodel.c \
$(APPLE2_SRC_PATH)/video/glalert.c \
$(APPLE2_SRC_PATH)/video/glhudmodel.c \
$(APPLE2_SRC_PATH)/video/glnode.c \
$(APPLE2_SRC_PATH)/video/gltouchjoy.c \
$(APPLE2_SRC_PATH)/video/gltouchjoy_joy.c \
$(APPLE2_SRC_PATH)/video/gltouchjoy_kpad.c \
$(APPLE2_SRC_PATH)/video/gltouchkbd.c \
$(APPLE2_SRC_PATH)/video/gltouchmenu.c \
$(APPLE2_SRC_PATH)/video/glvideo.c \
$(APPLE2_SRC_PATH)/video_util/matrixUtil.c \
$(APPLE2_SRC_PATH)/video_util/modelUtil.c \
$(APPLE2_SRC_PATH)/video_util/sourceUtil.c \
$(APPLE2_SRC_PATH)/video_util/vectorUtil.c
APPLE2_AUDIO_SRC = \
$(APPLE2_SRC_PATH)/audio/soundcore.c $(APPLE2_SRC_PATH)/audio/soundcore-opensles.c $(APPLE2_SRC_PATH)/audio/speaker.c \
$(APPLE2_SRC_PATH)/audio/mockingboard.c $(APPLE2_SRC_PATH)/audio/AY8910.c
$(APPLE2_SRC_PATH)/audio/AY8910.c \
$(APPLE2_SRC_PATH)/audio/mockingboard.c \
$(APPLE2_SRC_PATH)/audio/soundcore.c \
$(APPLE2_SRC_PATH)/audio/soundcore-opensles.c \
$(APPLE2_SRC_PATH)/audio/speaker.c
APPLE2_META_SRC = \
$(APPLE2_SRC_PATH)/meta/debug.c $(APPLE2_SRC_PATH)/meta/debugger.c $(APPLE2_SRC_PATH)/meta/opcodes.c \
$(APPLE2_SRC_PATH)/meta/lintrace.c $(APPLE2_SRC_PATH)/test/sha1.c $(APPLE2_SRC_PATH)/json_parse.c \
$(APPLE2_SRC_PATH)/memmngt.c $(APPLE2_SRC_PATH)/../externals/jsmn/jsmn.c
$(APPLE2_SRC_PATH)/memmngt.c \
$(APPLE2_SRC_PATH)/meta/debug.c \
$(APPLE2_SRC_PATH)/meta/debugger.c \
$(APPLE2_SRC_PATH)/meta/lintrace.c \
$(APPLE2_SRC_PATH)/meta/log.c \
$(APPLE2_SRC_PATH)/meta/opcodes.c \
$(APPLE2_SRC_PATH)/test/sha1.c \
APPLE2_MAIN_SRC = \
$(APPLE2_SRC_PATH)/font.c $(APPLE2_SRC_PATH)/rom.c $(APPLE2_SRC_PATH)/misc.c $(APPLE2_SRC_PATH)/display.c $(APPLE2_SRC_PATH)/vm.c \
$(APPLE2_SRC_PATH)/timing.c $(APPLE2_SRC_PATH)/zlib-helpers.c $(APPLE2_SRC_PATH)/joystick.c $(APPLE2_SRC_PATH)/keys.c \
$(APPLE2_SRC_PATH)/interface.c $(APPLE2_SRC_PATH)/disk.c $(APPLE2_SRC_PATH)/cpu-supp.c $(APPLE2_SRC_PATH)/prefs.c \
jnihooks.c androidkeys.c
androidkeys.c \
jnihooks.c \
$(APPLE2_SRC_PATH)/cpu-supp.c \
$(APPLE2_SRC_PATH)/disk.c \
$(APPLE2_SRC_PATH)/display.c \
$(APPLE2_SRC_PATH)/font.c \
$(APPLE2_SRC_PATH)/interface.c \
$(APPLE2_SRC_PATH)/joystick.c \
$(APPLE2_SRC_PATH)/json_parse.c \
$(APPLE2_SRC_PATH)/keys.c \
$(APPLE2_SRC_PATH)/misc.c \
$(APPLE2_SRC_PATH)/prefs.c \
$(APPLE2_SRC_PATH)/rom.c \
$(APPLE2_SRC_PATH)/timing.c \
$(APPLE2_SRC_PATH)/vm.c \
$(APPLE2_SRC_PATH)/zlib-helpers.c \
$(APPLE2_SRC_PATH)/../externals/jsmn/jsmn.c
APPLE2_OPTIM_CFLAGS := -Os
APPLE2_BASE_CFLAGS := -DAPPLE2IX=1 -DINTERFACE_TOUCH=1 -DMOBILE_DEVICE=1 -DVIDEO_OPENGL=1 -std=gnu11 -fPIC $(APPLE2_OPTIM_CFLAGS) -I$(APPLE2_SRC_PATH)

View File

@ -11,6 +11,8 @@
#include "common.h"
#include <stdarg.h>
#ifndef NDEBUG
void *_a2_malloc(size_t size) {

View File

@ -16,6 +16,8 @@
#include "common.h"
#include "trace.h"
#include <stdarg.h>
#define MAX_MSG_LEN 1024
#define MAX_ARG_LEN 768

View File

@ -79,6 +79,17 @@ static void _log_rotate(bool performRotation) {
FREE(logPath);
}
#if VIDEO_OPENGL
// 2015/04/01 ... early calls to glGetError()--before a context exists--causes segfaults on MacOS X
extern bool safe_to_do_opengl_logging;
GLenum safeGLGetError(void) {
if (safe_to_do_opengl_logging && video_isRenderThread()) {
return glGetError();
}
return (GLenum)0;
}
#endif
void log_init(void) {
_log_rotate(/*performRotation:*/false);
}

View File

@ -12,22 +12,15 @@
#ifndef _LOG_H_
#define _LOG_H_
#if __cplusplus
extern "C" {
#endif
#if VIDEO_OPENGL
# include "video_util/glUtil.h"
// 2015/04/01 ... early calls to glGetError()--before a context exists--causes segfaults on MacOS X
extern bool safe_to_do_opengl_logging;
static inline GLenum safeGLGetError(void) {
if (safe_to_do_opengl_logging && video_isRenderThread()) {
return glGetError();
}
return (GLenum)0;
}
extern GLenum safeGLGetError(void);
#else
# define GLenum int
# define safeGLGetError() 0
# define glGetError() 0
#endif
// global logging kill switch
@ -137,5 +130,8 @@ void log_outputString(const char * const str);
} \
} while (0)
#if __cplusplus
}
#endif
#endif // whole file

View File

@ -380,9 +380,9 @@ static void alert_applyPrefs(void) {
bool bVal = false;
bool enabled = prefs_parseBoolValue(PREF_DOMAIN_INTERFACE, PREF_DISK_ANIMATIONS_ENABLED, &bVal) ? bVal : true;
if (enabled) {
glnode_animations->animation_showTrackSector = &_animation_showTrackSector;
glnode_animations.animation_showTrackSector = &_animation_showTrackSector;
} else {
glnode_animations->animation_showTrackSector = NULL;
glnode_animations.animation_showTrackSector = NULL;
}
long lVal = 0;
@ -400,11 +400,11 @@ static void alert_prefsChanged(const char *domain) {
static void _init_glalert(void) {
LOG("Initializing message animation subsystem");
glnode_animations->animation_showMessage = &_animation_showMessage;
glnode_animations->animation_showPaused = &_animation_showPaused;
glnode_animations->animation_showCPUSpeed = &_animation_showCPUSpeed;
glnode_animations->animation_showDiskChosen = &_animation_showDiskChosen;
glnode_animations->animation_showTrackSector = &_animation_showTrackSector;
glnode_animations.animation_showMessage = &_animation_showMessage;
glnode_animations.animation_showPaused = &_animation_showPaused;
glnode_animations.animation_showCPUSpeed = &_animation_showCPUSpeed;
glnode_animations.animation_showDiskChosen = &_animation_showDiskChosen;
glnode_animations.animation_showTrackSector = &_animation_showTrackSector;
glnode_registerNode(RENDER_MIDDLE, (GLNode){
.setup = &alert_init,

View File

@ -730,10 +730,14 @@ static void xdriver_init(void *context) {
fprintf(stderr, "red mask:%08x green mask:%08x blue mask:%08x\n", (uint32_t)visualinfo.red_mask, (uint32_t)visualinfo.blue_mask, (uint32_t)visualinfo.green_mask);
fprintf(stderr, "redshift:%08d greenshift:%08d blueshift:%08d alphashift:%08d\n", red_shift, blue_shift, green_shift, alpha_shift);
#if 1
scale = VIDEO_2X;
#else
scale = a2_video_mode;
if (a2_video_mode == VIDEO_FULLSCREEN) {
scale = 1; // HACK FIXME FOR NOW ...
}
#endif
/* Note that in a real Xlib application, x and y would default to 0
* but would be settable from the command line or resource database.