mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-11 14:30:08 +00:00
Simplify code paths for POSIX desktop testing and fix testcpu breakage
This commit is contained in:
parent
4fee1ee0be
commit
c393ea81a0
@ -128,7 +128,6 @@ static void _glnode_initGLUTPost(void) {
|
|||||||
glutReshapeFunc(_glnode_reshapeGLUT);
|
glutReshapeFunc(_glnode_reshapeGLUT);
|
||||||
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS);
|
glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS);
|
||||||
|
|
||||||
#if !TESTING
|
|
||||||
glutKeyboardFunc(gldriver_on_key_down);
|
glutKeyboardFunc(gldriver_on_key_down);
|
||||||
glutKeyboardUpFunc(gldriver_on_key_up);
|
glutKeyboardUpFunc(gldriver_on_key_up);
|
||||||
glutSpecialFunc(gldriver_on_key_special_down);
|
glutSpecialFunc(gldriver_on_key_special_down);
|
||||||
@ -136,7 +135,6 @@ static void _glnode_initGLUTPost(void) {
|
|||||||
//glutMouseFunc(gldriver_mouse);
|
//glutMouseFunc(gldriver_mouse);
|
||||||
//glutMotionFunc(gldriver_mouse_drag);
|
//glutMotionFunc(gldriver_mouse_drag);
|
||||||
c_joystick_reset();
|
c_joystick_reset();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -255,7 +253,7 @@ static void _init_glnode_manager(void) {
|
|||||||
interface_onTouchEvent = &glnode_onTouchEvent;
|
interface_onTouchEvent = &glnode_onTouchEvent;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_GLUT
|
#if USE_GLUT && !TEST_CPU
|
||||||
joydriver_resetJoystick = &_glutJoystickReset;
|
joydriver_resetJoystick = &_glutJoystickReset;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
#include "video/glinput.h"
|
#include "video/glinput.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#if !TESTING
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// keyboard
|
// keyboard
|
||||||
@ -232,5 +230,3 @@ void _glutJoystickReset(void) {
|
|||||||
glutJoystickFunc(gldriver_joystick_callback, (int)JOYSTICK_POLL_INTERVAL_MILLIS);
|
glutJoystickFunc(gldriver_joystick_callback, (int)JOYSTICK_POLL_INTERVAL_MILLIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TESTING
|
|
||||||
|
|
||||||
|
@ -191,7 +191,6 @@ static void getshm(int size) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !TESTING
|
|
||||||
// Map X keysyms into Apple//ix internal-representation scancodes.
|
// Map X keysyms into Apple//ix internal-representation scancodes.
|
||||||
static int keysym_to_scancode(void) {
|
static int keysym_to_scancode(void) {
|
||||||
int rc = XkbKeycodeToKeysym(display, xevent.xkey.keycode, 0, 0);
|
int rc = XkbKeycodeToKeysym(display, xevent.xkey.keycode, 0, 0);
|
||||||
@ -332,7 +331,6 @@ static int keysym_to_scancode(void) {
|
|||||||
assert(rc < 0x80);
|
assert(rc < 0x80);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void post_image() {
|
static void post_image() {
|
||||||
// copy Apple //e video memory into XImage uint32_t buffer
|
// copy Apple //e video memory into XImage uint32_t buffer
|
||||||
@ -411,11 +409,6 @@ void video_driver_sync(void) {
|
|||||||
// also process other input events
|
// also process other input events
|
||||||
post_image();
|
post_image();
|
||||||
|
|
||||||
#if TESTING
|
|
||||||
// no input processing if test-driven ...
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!XPending(display)) {
|
if (!XPending(display)) {
|
||||||
c_keys_handle_input(/*scancode:*/-1, /*pressed:*/0, 0);
|
c_keys_handle_input(/*scancode:*/-1, /*pressed:*/0, 0);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user