]> Chaos Git - corbenik/ctrulib.git/commitdiff
support more codes
authorDave Murphy <davem@devkitpro.org>
Sat, 13 Dec 2014 02:51:57 +0000 (02:51 +0000)
committerDave Murphy <davem@devkitpro.org>
Sat, 13 Dec 2014 02:51:57 +0000 (02:51 +0000)
libctru/include/3ds/console.h
libctru/source/console.c

index fd65284c608864b2e55a181bd178ec93773cd555..95b39a14869a15bfe15a2cc171230b9869fcf1e2 100644 (file)
@@ -94,7 +94,13 @@ typedef struct PrintConsole
 \r
 #define CONSOLE_COLOR_BOLD     (1<<0)\r
 #define CONSOLE_COLOR_FAINT    (1<<1)\r
-#define CONSOLE_COLOR_REVERSE  (1<<2)\r
+#define CONSOLE_ITALIC         (1<<2)\r
+#define CONSOLE_UNDERLINE      (1<<3)\r
+#define CONSOLE_BLINK_SLOW     (1<<4)\r
+#define CONSOLE_BLINK_FAST     (1<<5)\r
+#define CONSOLE_COLOR_REVERSE  (1<<6)\r
+#define CONSOLE_CONCEAL                (1<<7)\r
+#define CONSOLE_CROSSED_OUT    (1<<8)\r
 \r
 /*!    \brief Loads the font into the console\r
        \param console pointer to the console to update, if NULL it will update the current console\r
index 9dd3dfd7009042a08637cb77d8a41906f08dc236..a00e765b968bb90a9f5212847372e68860b07320 100644 (file)
@@ -326,8 +326,64 @@ ssize_t con_write(struct _reent *r,int fd,const char *ptr, size_t len) {
                                                                currentConsole->flags |= CONSOLE_COLOR_FAINT;\r
                                                                break;\r
 \r
-                                                       case 7: // reverse video\r
-                                                               currentConsole->flags |= CONSOLE_COLOR_REVERSE;\r
+                                                       case 3: // italic\r
+                                                               currentConsole->flags |= CONSOLE_ITALIC;\r
+                                                               break;\r
+\r
+                                                       case 4: // underline\r
+                                                               currentConsole->flags |= CONSOLE_UNDERLINE;\r
+                                                               break;\r
+\r
+                                                       case 5: // blink slow\r
+                                                               currentConsole->flags &= ~CONSOLE_BLINK_FAST;\r
+                                                               currentConsole->flags |= CONSOLE_BLINK_SLOW;\r
+                                                               break;\r
+\r
+                                                       case 6: // blink fast\r
+                                                               currentConsole->flags &= ~CONSOLE_BLINK_SLOW;\r
+                                                               currentConsole->flags |= CONSOLE_BLINK_FAST;\r
+                                                               break;\r
+\r
+                                                       case 7: // reverse video\r
+                                                               currentConsole->flags |= CONSOLE_COLOR_REVERSE;\r
+                                                               break;\r
\r
+                                                       case 8: // conceal\r
+                                                               currentConsole->flags |= CONSOLE_CONCEAL;\r
+                                                               break;\r
+\r
+                                                       case 9: // crossed-out\r
+                                                               currentConsole->flags |= CONSOLE_CROSSED_OUT;\r
+                                                               break;\r
+\r
+                                                       case 21: // bold off\r
+                                                               currentConsole->flags &= ~CONSOLE_COLOR_BOLD;\r
+                                                               break;\r
+\r
+                                                       case 22: // normal color\r
+                                                               currentConsole->flags &= ~CONSOLE_COLOR_BOLD;\r
+                                                               currentConsole->flags &= ~CONSOLE_COLOR_FAINT;\r
+                                                               break;\r
+\r
+                                                       case 23: // italic off\r
+                                                               currentConsole->flags &= ~CONSOLE_ITALIC;\r
+                                                               break;\r
+\r
+                                                       case 24: // underline off\r
+                                                               currentConsole->flags &= ~CONSOLE_UNDERLINE;\r
+                                                               break;\r
+\r
+                                                       case 25: // blink off\r
+                                                               currentConsole->flags &= ~CONSOLE_BLINK_SLOW;\r
+                                                               currentConsole->flags &= ~CONSOLE_BLINK_FAST;\r
+                                                               break;\r
+\r
+                                                       case 27: // reverse off\r
+                                                               currentConsole->flags &= ~CONSOLE_COLOR_REVERSE;\r
+                                                               break;\r
+\r
+                                                       case 29: // crossed-out off\r
+                                                               currentConsole->flags &= ~CONSOLE_CROSSED_OUT;\r
                                                                break;\r
 \r
                                                        case 30 ... 37: // writing color\r