diff options
author | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-11-28 02:51:33 +1100 |
---|---|---|
committer | alekseiplusplus <alekseijeaves@protonmail.com> | 2023-11-28 02:51:33 +1100 |
commit | 2ded6baaab3946e461a7cf0b39618b31e5806c89 (patch) | |
tree | a30e4069d9c9e98e16651eadb0875d48ecc7c91e /src/video/signetics.c | |
parent | d24ee5f20483aee9acbec9deb0dcc833d78cae49 (diff) |
days end
Diffstat (limited to 'src/video/signetics.c')
-rw-r--r-- | src/video/signetics.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/video/signetics.c b/src/video/signetics.c new file mode 100644 index 0000000..944ac4d --- /dev/null +++ b/src/video/signetics.c @@ -0,0 +1,32 @@ +// signetics.h +// The Apple I came with its own terminal on-board, with a Signetics 2513 character ROM, and multiple shift registers acting as video memory. +#include"cpu/core.h" +#include"stdlib.h" + +const byte CharacterROM[0x40] = { + '@' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' , + 'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' , 'X' , 'Y' , 'Z' , '[' , '\\', ']' , '^' , '_' , + ' ' , '!' , '"' , '#' , '$' , '%' , '&' , '\'', '(' , ')' , '*' , '+' , ',' , '-' , '.' , '/' , + '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , ':' , ';' , '<' , '=' , '>' , '?' +}; + +byte* TerminalShiftRegister; + +int TerminalShiftRegisterOffset; + +byte ToAppleASCII(char x) +{ + if (x < 0x20 || x >= 0x60) + return -1; + if (x >= 0x40) + x -= 0x40; + return x; +} + +byte ToRegularASCII(char x) +{ + if (x < 0x20) + x += 0x40; + return x; +} + |