Skip to content

Instantly share code, notes, and snippets.

@ryu10
Last active September 10, 2021 16:49
Show Gist options
  • Save ryu10/ae87f73c41feac2fd5129f86ecff6018 to your computer and use it in GitHub Desktop.
Save ryu10/ae87f73c41feac2fd5129f86ecff6018 to your computer and use it in GitHub Desktop.
Suppresses 'Unknown Event' log messages from a2pid of David Schmenk's Apple II Pi https://github.com/dschmenk/apple2pi
--- src/a2pid.c 2021-08-16 01:50:14.596595180 -0700
+++ a2pid.c 2021-08-16 01:51:22.776233603 -0700
@@ -470,6 +470,7 @@
fd_set readset, openset;
char *devtty = deftty;
char *vdrvdir = "/usr/share/a2pi/"; /* default vdrv image directory */
+ char unk_msg[30]; /* for Unknown Event err msg test */
/*
* Parse arguments
@@ -896,8 +897,13 @@
//printf("vclock: resend request %04X\n", a2reqlist->type);
}
break;
+ case 0x00: /* NULL event, received when Apple II is off */
+ /* do nothing */
+ break;
default:
- prlog("a2pid: Unknown Event\n");
+ // prlog("a2pid: Unknown Event\n");
+ sprintf(unk_msg, "a2pid: Unknown Event: %0x\n", iopkt[0]);
+ prlog(unk_msg);
tcflush(a2fd, TCIFLUSH);
//stop = TRUE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment