From a18eb41a34b947c1d66f15b3bc8b73dc447d6bdb Mon Sep 17 00:00:00 2001 From: Daniel Loffgren Date: Mon, 14 Sep 2015 07:43:46 +0000 Subject: [PATCH] Implemented the cool green screen flash for _doCoolVideoStart git-svn-id: svn+ssh://svn.phoenixbox.net/svn/apple1/trunk@16 64f78de7-aa59-e511-a0e8-0002a5492df0 --- apple1/pia.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apple1/pia.c b/apple1/pia.c index 3686ba1..3590598 100644 --- a/apple1/pia.c +++ b/apple1/pia.c @@ -10,10 +10,12 @@ #include #include #include +#include #define FIXME_I_SHOULDNT_BE_NULL NULL #define KEYBOARD_READY 0xFF // This just needs to meet the requirements of being a negative number in the eyes of the 6502 #define KEYBOARD_NOTREADY 0x00 +#define ANSI_BGCOLOR_GREEN "\x1b[42;1m" char asciiCharFromA1Char(uint8_t c) { switch (c) { @@ -76,7 +78,15 @@ uint8_t keyboardReadCharacterCallback(struct _v6502_memory *memory, uint16_t off } static void _doCoolVideoStart(a1pia *pia) { + printf(ANSI_BGCOLOR_GREEN); + for (int x = 0; x < 80*25; x++) { + printf(" "); + } + + printf(ANSI_COLOR_RESET); + fflush(stdout); + usleep(100000); } a1pia *pia_create(v6502_memory *mem) {