VAX/QVSS: Added debugging support to sim_video
This commit is contained in:
parent
ab028c0a37
commit
8617a58c8f
3 changed files with 16 additions and 3 deletions
|
@ -270,6 +270,9 @@ DEBTAB vc_debug[] = {
|
||||||
{"MBC", DBG_INT6},
|
{"MBC", DBG_INT6},
|
||||||
{"SPARE", DBG_INT7},
|
{"SPARE", DBG_INT7},
|
||||||
{"INT", DBG_INT0|DBG_INT1|DBG_INT2|DBG_INT3|DBG_INT4|DBG_INT5|DBG_INT6|DBG_INT7},
|
{"INT", DBG_INT0|DBG_INT1|DBG_INT2|DBG_INT3|DBG_INT4|DBG_INT5|DBG_INT6|DBG_INT7},
|
||||||
|
{"VMOUSE", SIM_VID_DBG_MOUSE},
|
||||||
|
{"VKEY", SIM_VID_DBG_KEY},
|
||||||
|
{"VVIDEO", SIM_VID_DBG_VIDEO},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -798,7 +801,7 @@ if (dptr->flags & DEV_DIS)
|
||||||
return vid_close ();
|
return vid_close ();
|
||||||
|
|
||||||
if (!vid_active) {
|
if (!vid_active) {
|
||||||
r = vid_open (VC_XSIZE, VC_YSIZE); /* display size */
|
r = vid_open (dptr, VC_XSIZE, VC_YSIZE); /* display size */
|
||||||
if (r != SCPE_OK)
|
if (r != SCPE_OK)
|
||||||
return r;
|
return r;
|
||||||
printf ("QVSS Display Created. ");
|
printf ("QVSS Display Created. ");
|
||||||
|
|
|
@ -71,8 +71,9 @@ SDL_Thread *vid_thread_id; /* event thread handle *
|
||||||
SDL_Color vid_palette[256];
|
SDL_Color vid_palette[256];
|
||||||
KEY_EVENT_QUEUE vid_key_events; /* keyboard events */
|
KEY_EVENT_QUEUE vid_key_events; /* keyboard events */
|
||||||
MOUSE_EVENT_QUEUE vid_mouse_events; /* mouse events */
|
MOUSE_EVENT_QUEUE vid_mouse_events; /* mouse events */
|
||||||
|
DEVICE *vid_dev;
|
||||||
|
|
||||||
t_stat vid_open (uint32 width, uint32 height)
|
t_stat vid_open (DEVICE *dptr, uint32 width, uint32 height)
|
||||||
{
|
{
|
||||||
if (!vid_active) {
|
if (!vid_active) {
|
||||||
vid_active = TRUE;
|
vid_active = TRUE;
|
||||||
|
@ -106,6 +107,7 @@ if (!vid_active) {
|
||||||
SDL_SetColors (vid_image, vid_palette, 0, 2);
|
SDL_SetColors (vid_image, vid_palette, 0, 2);
|
||||||
|
|
||||||
memset (&vid_key_state, 0, sizeof(vid_key_state));
|
memset (&vid_key_state, 0, sizeof(vid_key_state));
|
||||||
|
vid_dev = dptr;
|
||||||
}
|
}
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
}
|
}
|
||||||
|
@ -120,6 +122,7 @@ if (vid_active) {
|
||||||
user_event.user.code = EVENT_CLOSE;
|
user_event.user.code = EVENT_CLOSE;
|
||||||
user_event.user.data1 = NULL;
|
user_event.user.data1 = NULL;
|
||||||
user_event.user.data2 = NULL;
|
user_event.user.data2 = NULL;
|
||||||
|
vid_dev = NULL;
|
||||||
|
|
||||||
SDL_PushEvent (&user_event);
|
SDL_PushEvent (&user_event);
|
||||||
}
|
}
|
||||||
|
@ -536,6 +539,7 @@ if (vid_mouse_captured) {
|
||||||
if (!sim_is_running)
|
if (!sim_is_running)
|
||||||
return;
|
return;
|
||||||
if (SDL_SemWait (vid_key_events.sem) == 0) {
|
if (SDL_SemWait (vid_key_events.sem) == 0) {
|
||||||
|
sim_debug (SIM_VID_DBG_KEY,vid_dev, "Keyboard Event: State: %d, Keysym: %d\n", event->state, event->keysym);
|
||||||
if (vid_key_events.count < MAX_EVENTS) {
|
if (vid_key_events.count < MAX_EVENTS) {
|
||||||
if (event->state == SDL_PRESSED) {
|
if (event->state == SDL_PRESSED) {
|
||||||
if (!vid_key_state[event->keysym.sym]) { /* Key was not down before */
|
if (!vid_key_state[event->keysym.sym]) { /* Key was not down before */
|
||||||
|
@ -585,6 +589,7 @@ if ((event->x == 0) ||
|
||||||
if (!sim_is_running)
|
if (!sim_is_running)
|
||||||
return;
|
return;
|
||||||
if (SDL_SemWait (vid_mouse_events.sem) == 0) {
|
if (SDL_SemWait (vid_mouse_events.sem) == 0) {
|
||||||
|
sim_debug (SIM_VID_DBG_MOUSE,vid_dev, "Mouse Move Event: (%d,%d)\n", event->xrel, event->yrel);
|
||||||
if (vid_mouse_events.count < MAX_EVENTS) {
|
if (vid_mouse_events.count < MAX_EVENTS) {
|
||||||
ev.x_rel = event->xrel;
|
ev.x_rel = event->xrel;
|
||||||
ev.y_rel = (-event->yrel);
|
ev.y_rel = (-event->yrel);
|
||||||
|
@ -628,6 +633,7 @@ if (!vid_mouse_captured) {
|
||||||
if (!sim_is_running)
|
if (!sim_is_running)
|
||||||
return;
|
return;
|
||||||
if (SDL_SemWait (vid_mouse_events.sem) == 0) {
|
if (SDL_SemWait (vid_mouse_events.sem) == 0) {
|
||||||
|
sim_debug (SIM_VID_DBG_MOUSE,vid_dev, "Mouse Button Event: State: %d, Button: %d, (%d,%d)\n", event->state, event->button, event->x, event->y);
|
||||||
if (vid_mouse_events.count < MAX_EVENTS) {
|
if (vid_mouse_events.count < MAX_EVENTS) {
|
||||||
state = (event->state == SDL_PRESSED) ? TRUE : FALSE;
|
state = (event->state == SDL_PRESSED) ? TRUE : FALSE;
|
||||||
ev.x_rel = 0;
|
ev.x_rel = 0;
|
||||||
|
|
|
@ -168,7 +168,7 @@ struct key_event {
|
||||||
typedef struct mouse_event SIM_MOUSE_EVENT;
|
typedef struct mouse_event SIM_MOUSE_EVENT;
|
||||||
typedef struct key_event SIM_KEY_EVENT;
|
typedef struct key_event SIM_KEY_EVENT;
|
||||||
|
|
||||||
t_stat vid_open (uint32 width, uint32 height);
|
t_stat vid_open (DEVICE *dptr, uint32 width, uint32 height);
|
||||||
t_stat vid_close (void);
|
t_stat vid_close (void);
|
||||||
t_stat vid_poll_kb (SIM_KEY_EVENT *ev);
|
t_stat vid_poll_kb (SIM_KEY_EVENT *ev);
|
||||||
t_stat vid_poll_mouse (SIM_MOUSE_EVENT *ev);
|
t_stat vid_poll_mouse (SIM_MOUSE_EVENT *ev);
|
||||||
|
@ -180,4 +180,8 @@ t_stat vid_show_release_key (FILE* st, UNIT* uptr, int32 val, void* desc);
|
||||||
|
|
||||||
extern t_bool vid_active;
|
extern t_bool vid_active;
|
||||||
|
|
||||||
|
#define SIM_VID_DBG_MOUSE 0x01000000
|
||||||
|
#define SIM_VID_DBG_KEY 0x02000000
|
||||||
|
#define SIM_VID_DBG_VIDEO 0x04000000
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue