diff --git a/platform/bin/platform.uw8 b/platform/bin/platform.uw8 index 444038b..2425d51 100644 Binary files a/platform/bin/platform.uw8 and b/platform/bin/platform.uw8 differ diff --git a/platform/src/platform.cwa b/platform/src/platform.cwa index b8e7789..c6e37fd 100644 --- a/platform/src/platform.cwa +++ b/platform/src/platform.cwa @@ -372,16 +372,7 @@ export fn printChar(char: i32) { global mut controlCodeLength = 0; fn printSingleChar(char: i32) { - if char >= 4 & char <= 6 { - outputChannel = char - 4; - if !outputChannel { - textCursorX = 0; - textCursorY = 0; - } - return; - } - - if outputChannel >= 2 { + if outputChannel >= 2 & (char < 4 | char > 6) { logChar(char); return; } @@ -399,6 +390,15 @@ fn printSingleChar(char: i32) { return; } + if char >= 4 & char <= 6 { + outputChannel = char - 4; + if !outputChannel { + textCursorX = 0; + textCursorY = 0; + } + return; + } + if char == 7 { 80?0 = 80?0 ^ 2; return; diff --git a/test/text_modes.cwa b/test/text_modes.cwa new file mode 100644 index 0000000..68f9c64 --- /dev/null +++ b/test/text_modes.cwa @@ -0,0 +1,13 @@ +include "../examples/include/microw8-api.cwa" + +export fn upd() { + printString(USER_MEM); +} + +data USER_MEM { + i8(12, 31, 5, 6) "Text mode" + i8(5, 31, 4, 5) "Graphics mode" + i8(6) "Console output\nSecond line\n" + i8(4, 31, 4, 12) "Back to text mode" + i8(0) +}