implement more control codes

This commit is contained in:
2021-12-31 23:09:49 +01:00
parent cd1275a78f
commit ed9d9fdeb5
3 changed files with 48 additions and 3 deletions

View File

@@ -331,6 +331,20 @@ fn printSingleChar(char: i32) {
return;
}
if char == 8 {
textCursorX = textCursorX - 8;
if !graphicsText & textCursorX < 0 {
textCursorX = 320-8;
printSingleChar(11);
}
return;
}
if char == 9 {
textCursorX = textCursorX + 8;
return;
}
if char == 10 {
textCursorY = textCursorY + 8;
if !graphicsText & textCursorY >= 240 {
@@ -345,6 +359,20 @@ fn printSingleChar(char: i32) {
return;
}
if char == 11 {
textCursorY = textCursorY - 8;
if !graphicsText & textCursorY < 0 {
textCursorY = 0;
let i = 320 * (240 - 8);
loop scroll_copy {
i!(116 + 320 * 8) = i!116;
branch_if (i := i - 4): scroll_copy;
}
rectangle(0 as f32, 0 as f32, 320 as f32, 8 as f32, bgColor);
}
return;
}
if char == 12 {
cls(bgColor);
return;
@@ -365,6 +393,19 @@ fn printSingleChar(char: i32) {
return;
}
if char == 24 {
let tmp = textColor;
textColor = bgColor;
bgColor = tmp;
return;
}
if char == 31 {
textCursorX = 0x12d20?1 * (8 - graphicsText * 6);
textCursorY = 0x12d20?2 * (8 - graphicsText * 7);
return;
}
drawChar(char);
}
@@ -373,11 +414,11 @@ data(0x12d00) {
1, 2, 1, 1, // 0-3
1, 1, 1, 1, // 4-7
1, 1, 1, 1, // 8-11
1, 1, 2, 1, // 12-15,
1, 1, 2, 2, // 12-15,
1, 1, 1, 1, // 16-19,
1, 1, 1, 1, // 20-23,
1, 1, 1, 1, // 24-27,
1, 1, 1, 1 // 28-31
1, 1, 1, 3 // 28-31
)
}