GDMike Posted February 3, 2020 Share Posted February 3, 2020 I'm looking for a TEXT mode inverted character set. because I'm lazy..nah not really, but if it's out there I'd rather not go through the pain to create. If there's an algorithm then even sweeter, but a set would work just fine. In the meantime I'll start making em... Thanks in advance!! Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 3, 2020 Author Share Posted February 3, 2020 When I get em made I'll post em Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 3, 2020 Share Posted February 3, 2020 1 hour ago, GDMike said: I'm looking for a TEXT mode inverted character set. because I'm lazy..nah not really, but if it's out there I'd rather not go through the pain to create. If there's an algorithm then even sweeter, but a set would work just fine. In the meantime I'll start making em... Thanks in advance!! Do you mean upside down or color inversion? ...lee 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 3, 2020 Author Share Posted February 3, 2020 Color inverted.. Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 3, 2020 Share Posted February 3, 2020 12 minutes ago, GDMike said: Color inverted.. I believe there is a console routine accessible by GPLLNK that does that. I will look it up. ...lee 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 3, 2020 Share Posted February 3, 2020 2 minutes ago, Lee Stewart said: I believe there is a console routine accessible by GPLLNK that does that. I will look it up. Nope. GPLLNK routine >003B provides mirror-image characters by swapping bits. ...lee 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 4, 2020 Share Posted February 4, 2020 You can write a simple routine to produce the inverse of each byte in the font. The relevant TMS9900 instruction to do this on a word (2-byte) basis via an address pointer in R1 would be INV *R1 I think I will write a Forth word in fbForth 2.0 that will, at the very least, invert a character of your choice from ASCII 0 – 255. You could then use that in another word that would operate on an ASCII range. Stay tuned. ...lee 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 4, 2020 Author Share Posted February 4, 2020 (edited) Slick. I'm gonna try this Blwp @Vsbr Inv *r1 Blwp @vsbw I wish it were that easy... Update, I didn't see any change, so I did a inv R1 and a blwp @vsbw.. I'll wait and see what you come up with..I'm just guessing now..lol VID_20200203_192304978.mp4 Edited February 4, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 4, 2020 Share Posted February 4, 2020 27 minutes ago, GDMike said: Slick. I'm gonna try this Blwp @Vsbr Inv *r1 Blwp @vsbw I wish it were that easy... Update, I didn't see any change In this case, R1 doe not point to the byte you want to INVert, it contains it. Just remove the ‘*’: INV R1 ...lee 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 4, 2020 Author Share Posted February 4, 2020 (edited) Yup I tried that and see the video of the output from post #8 Edited February 4, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 4, 2020 Author Share Posted February 4, 2020 (edited) Was i capturing my cursor instead of the character I was sitting on?..hmm..I'm going to make a change..brb No, things got worse It's no biggy to make all my new fonts.. I tried this but I got a big nothing Kybuf has a copy of keyboard character last pressed Edited February 4, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 4, 2020 Share Posted February 4, 2020 You need to change 8 bytes in the PDT (Pattern Descriptor Table), so you need a loop. Here is the Forth I promised: \ Invert char pattern asc : INVCHR ( asc -- ) 255 AND \ force to 0 - 255 3 SLA PDT + DUP \ dup character pattern location 8 + SWAP DO \ loop through character pattern I VSBR \ get next byte of character pattern -1 XOR \ flip bits I VSBW \ write byte back to PDT LOOP ; \ Invert char patterns asc1 - ascn : INVRNG ( asc1 ascn -- ) 1+ SWAP DO \ loop through char patterns I INVCHR \ invert next char pattern LOOP ; If you need Forth Assembler for it, I can do that as well. ...lee 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 4, 2020 Author Share Posted February 4, 2020 Thx Lee, it's gorgeous! Show me the forth assy version..I'll try to see what I need to do in plain assy.. Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 4, 2020 Author Share Posted February 4, 2020 (edited) Just fyi for anyone else, reverse color characters are already defined in Turboforth. Wilsy included them.. BUT I'm still doing stuff in assy. Not forth assy. So I have to manipulate the pattern table..that's the ticket! Thx Lee as always. Edited February 4, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 4, 2020 Author Share Posted February 4, 2020 I got a plan VID_20200203_200841699.mp4 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 4, 2020 Share Posted February 4, 2020 Here is some ALC to do it, but it looks like you already have some that works: * BL @ICHAR to get here. * R0 must have ASCII character value to change. * ICHAR LI R2,8 load counter SLA R0,3 calculate PDT offset AI R0,>0800 add PDT location ICLOOP BLWP @VSBR get next pattern byte to R1 INV R1 INVert it BLWP @VSBW put it back INC R0 address of next byte DEC R2 decrement counter JNE ICLOOP jump if not done RT ...lee 1 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 4, 2020 Author Share Posted February 4, 2020 Yes, exactly Lee. This is it. I just didn't know how to manipulate the pattern descr table like this. But this is cool.. I can see how this would be useful in a game too, but I'm not making a game, yet anyway. Lol I'm mad at myself for not knowing how to do this.. but I'm still green real green. Thank you! Quote Link to comment Share on other sites More sharing options...
+TheBF Posted February 4, 2020 Share Posted February 4, 2020 When I get back to my editor this is on my list as well. I was thinking that I just needed to replicated the entire font in the upper part of the pattern table and invert that copy. Then whenever I need high-lighting I use ASCII+128 and I get the reversed version on the screen. Is that what Willsy does in Turbo Forth? 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 4, 2020 Share Posted February 4, 2020 8 minutes ago, TheBF said: When I get back to my editor this is on my list as well. I was thinking that I just needed to replicated the entire font in the upper part of the pattern table and invert that copy. Then whenever I need high-lighting I use ASCII+128 and I get the reversed version on the screen. Is that what Willsy does in Turbo Forth? I think that is so. I will check in a little while. ...lee 1 Quote Link to comment Share on other sites More sharing options...
+9640News Posted February 4, 2020 Share Posted February 4, 2020 Mike Riccio did a similar trick with the INV command. He inverted the character patterns for characters 0 through 127 buffering the inverted pattern, and then with a VMBW wrote it back out for character patterns 128 to 255. Thus, for "drop down" menus, as he dropped down one row at a time, he would read the characters for the next row and add 128 to each position, write it back out, to give the effect of highlighting. Then, the row above or below he had just scrolled off, he would subtract 128 to return to the normal characters. I hope that makes sense. With a 9938, you also have the option of the blinking which you can set to ON with no time off to get the same effect. If you look for the MyTerm source code, more the original and not telnet capable version, it has the code. You would just need to change the VDP ports for the TI-99/4A instead of the Geneve ports. It has code for drop down menus, etc. Beery 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted February 4, 2020 Share Posted February 4, 2020 1 hour ago, TheBF said: When I get back to my editor this is on my list as well. I was thinking that I just needed to replicated the entire font in the upper part of the pattern table and invert that copy. Then whenever I need high-lighting I use ASCII+128 and I get the reversed version on the screen. Is that what Willsy does in Turbo Forth? 55 minutes ago, Lee Stewart said: I think that is so. I will check in a little while. Indeed, that is what @Willsy does—except that his offset into the inverse table is 96 instead of 128. And, here is his code (converted to work with the E/A assembler)— * initialise inverse characters * ascii codes 144 to 218 are inverse of 48 to 122 DOINV LI R5,>900 ; vdp source LI R6,>C00 ; vdp destination LI R4,728 ; count INVLOP MOV R5,R0 ; get source address in r0 for VDP ops BL @_VSBR ; go read the vdp data (result in R1) INV R1 ; invert it MOV R6,R0 ; load destination address BL @_VSBW0 ; write r1 to destination address INC R5 ; advance source address INC R6 ; advance destination address DEC R4 ; decrement counter JNE INVLOP ; loop until finished ...lee 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted February 4, 2020 Share Posted February 4, 2020 (edited) 20 hours ago, GDMike said: I'm looking for a TEXT mode inverted character set. because I'm lazy..nah not really, but if it's out there I'd rather not go through the pain to create. If there's an algorithm then even sweeter, but a set would work just fine. In the meantime I'll start making em... Thanks in advance!! Hmm easy load that CHARACTER SET into RXB 2015 and type: CALL INVERSE(ALL) If you want the definition type CALL CHARPAT(charvalue,$tringvariable) Edited February 4, 2020 by RXB 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted February 4, 2020 Share Posted February 4, 2020 Thanks Rich. This has made me realize something obvious. I can invert the patterns OR I can simply reverse the colours of the alternate charset at ASCII 128, which would be much faster to do. I gotta write some code. 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted February 4, 2020 Share Posted February 4, 2020 (edited) As it turns out I am accumulating enough tools in the CAMEL99 library that I could write this as a little script that does the following: Allocates a buffer in low memory copies the font patterns into the buffer copies the buffer back to patterns for chars >80 and up compiles a little program to invert the high ascii chars compiles a program to see the characters inverts the characters shows the characters releases the memory removes itself from Forth I am pretty happy with it. \ HIGHFONT script copy font into the 8bit range & INVERT NEEDS MARKER FROM DSK1.MARKER MARKER REMOVE ( erases everything in Forth to here) NEEDS MALLOC FROM DSK1.MALLOC HEX 800 CONSTANT PDT ( Pattern table address) 800 CONSTANT 2K 400 CONSTANT 1K 2K MALLOC CONSTANT MYBUFFER PDT MYBUFFER 1K VREAD ( read low chars to buffer) MYBUFFER PDT 1K + 1K VWRITE ( write them back to 8bit chars) : INVERTCHARS ( -- ) PDT 1K + \ start VDP address 1K \ number of bytes BOUNDS ( -- VDPend VDPstart ) DO I VC@ INVERT I VC! LOOP ; : .CHARSET CR 101 0 DO I EMIT LOOP ; ( show 256 chars) INVERTCHARS .CHARSET 2K MFREE ( release the memory) REMOVE ( remove all this from Forth) The video is running Normal speed. Edit: Replaced video clip with clean version HIGHFONTINVERT.mp4 Edited February 5, 2020 by TheBF 1 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted February 5, 2020 Author Share Posted February 5, 2020 Thx everyone! I've learned a couple things for sure. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.