|
Post by stiggity on Jun 16, 2020 4:01:49 GMT
I wrote a small routine, to position and read 30 characters from the vdc, and them store them in a buffer. It works... kind of. I've tried all sorts of adding, subtraction of the byte retrieved from $cdd8 to convert it to ascii... is there any existing code that demonstrates how to do the conversions needed... If this sounds bland, please let me know. What im attempting to do is, setup $cdd8 to retrieve a byte from the screen, do this 30x, and each time store the value retrieved into a variable. Any sort of help is greatly appreciated...
|
|
|
Post by stiggity on Jun 16, 2020 20:52:06 GMT
ive gotten a little further. if the 30 chatacters are all lowercase and there are spaces.. lik
'hello world"
i can get ..
"HELLO WORLD"
i messed with it for an hour... whenever theres a capital letter like "S" its retrieved/converted to a clr home.. i wrote routines to got bcd to ascii and ascii to bcd , i just got home from wr0k! and will be working on it. Thanks for reading this
|
|
|
Post by oziphantom on Jun 18, 2020 6:55:47 GMT
basically you need a bunch of if if peek(53272) AND 2 = 2 then goto upperLower if screen < 32 then ascii = screen + 64 : goto done if screen < 64 then ascii = screen : goto done upperLower: if screen < 32 then ascii = screen + 64 + 32 : goto done if screen < 64 then ascii = screen : goto done done: This won't handle control codes such as clr home, function keys etc, but if it has been printed into the VDC buffer then it shouldn't be anything other than a-z, punctuation and 0-9 Screen codes don't have Upper and lower at the same time normally, so you have to handle the case where they do.
|
|
|
Post by gsteemso on Jul 8, 2020 19:21:51 GMT
Also be aware that, unless character attributes are outright disabled, text on the VDC can technically draw from both character sets at once (the "which character set to use" bit, effectively the ninth bit of the character code, is stashed in with the other attributes like foreground colour, BLINK, etc.). I've got absolutely no idea if or how that interacts with whatever BASIC's built-in screen editor expects its working data to look like. I do recall that if you toggle the keyboard between "text" and "graphics" modes, the computer treats your input accordingly -- but unlike with the VIC-II or -IIe, any text already on the screen stays as you typed it, because the VDC has that extra attribute bit to keep track of it with.
|
|