fujidude Posted August 6, 2015 Share Posted August 6, 2015 (edited) Like the topic says.... is there a way to use PLOT and DRAWTO to quickly drawn lines with the line drawing characters? Here's what I understand so far after some research: You can use PLOT and DRAWTO in a text mode. The COLOR statement is used to determine what character is output. The COLOR statement is ranged 0-255 (8 bits), but the 1st two bits are said to control color of character, and the last 6 to identify which character. Six bits only allows for 64 possible characters (out of 128 + another 128 inverse). When I wanted to plot an ATASCII 17 (upper left corner drawing character), I instead neded up with a Q, ATASCII 81 (in the next set of 64 chars). So, how do I plot box corner characters and "draw" box side characters between them? Also I'm pondering... normally the COLOR statement determined which color register will be used for subsequent plots. There are 5 color registers (0 - 4). When doing graphics, the least sigificant bits given to the COLOR statement determine which register, Why is it that the same COLOR statement, when using for text mode, has the two most significant bits deal with color? Also, since it is just two bits, it could only refer to teh 1st four color registers and not the 5th one. That's okay I suppose, but do they even refer to color registers at all? Any of you gurus able to help clear this up? Edited August 6, 2015 by fujidude Quote Link to comment Share on other sites More sharing options...
billkendrick Posted August 6, 2015 Share Posted August 6, 2015 It sounds like you're trying to use GRAPHICS 1 or 2 mode (20x24 & 20x12 text). They give you 4 colors to use for the characters, plus the background. As you noticed, you only get 64 characters to work with. So normally, uppercase only, no control characters. If you print a CHR$(17), or COLOR 17 and then PLOT/DRAWTO, you should be getting a green (default color palette) "1" character. So Q, q, inverse Q and inverse q give you four colors of capital "Q". 1, ctrl-Q, inverse 1, and inverse ctrl-Q give you four colors of numeral "1". If you want the lowercase & control characters _instead_ of the uppercase and numeric stuff, you'll want to POKE 756 with the 4K page of your character set (e.g., the internal OS ROM's charset at page 224), but plus 2 pages. e.g. POKE 756,226 Of course, since 32-32 = 0, and character 0 is the heart, this means your screen will be filled with hearts. See attached screenshot. Coffee is wearing off. I hope I made sense, and helped in some way. Quote Link to comment Share on other sites More sharing options...
billkendrick Posted August 6, 2015 Share Posted August 6, 2015 BTW, I've probably mentioned it before, but I've been meaning to write a game that lets me use 64 different 20x12 _multicolor_ characters (each being 8x16 pixels in resolution, so 160x192 total). Simply use GRAPHICS 12 (40x24 multicolor), where you get 128 total characters to use. Every other row in the display list would repeat the previous line (so you get 40x12). Each of your 64 symbols is made of 2 characters (so if you stick to a grid, you get 20x12). Then, on each row that repeats the previous row's characters, use a DLI to switch to an alternate font/character set. So for 480 bytes (40x12) of screen data, and 2KB of character set data, plus a custom display list and a very simple little DLI, you can make a game that has the same constrants as GRAPHICS 2 mode (20x12, 64 unique symbols allowed), but with 2x the resolution per character (like GRAPHICS 1), AND multiple colors _within_ the symbols. Of course, your ability to reuse a symbol/tile, but recolor it, is limited to GRAPHICS 12 (& 13)'s "4th color becomes 5th color" ability... versus GRAPHICS 2's ability to have the same monochrome character/symbol/tile in one of 4 colors. Seems a reasonable trade-off to me, though. Semi off-topic rambling, sorry. 1 Quote Link to comment Share on other sites More sharing options...
fujidude Posted August 6, 2015 Author Share Posted August 6, 2015 (edited) Thanks for the info but no, I am wishing to do this in a graphics 0 environment. So how does it all fit within that construct? Basically what I want to do is have a completely text application, that uses mode 0. Then I want to use box drawing characters to frame certain areas, then have text within them. I can accomplish it with a number of POSTION, PRINT, or PUT statements. I was hoping to save effort in writing code by taking advantage of plotting and drawing "lines" of box drawing characters in the text mode. Edited August 6, 2015 by fujidude Quote Link to comment Share on other sites More sharing options...
drac030 Posted August 6, 2015 Share Posted August 6, 2015 Like the topic says.... is there a way to use PLOT and DRAWTO to quickly drawn lines with the line drawing characters? Here's what I understand so far after some research: You can use PLOT and DRAWTO in a text mode. The COLOR statement is used to determine what character is output. The COLOR statement is ranged 0-255 (8 bits), but the 1st two bits are said to control color of character, and the last 6 to identify which character. Six bits only allows for 64 possible characters (out of 128 + another 128 inverse). When I wanted to plot an ATASCII 17 (upper left corner drawing character), I instead neded up with a Q, ATASCII 81 (in the next set of 64 chars). So, how do I plot box corner characters and "draw" box side characters between them? Also I'm pondering... normally the COLOR statement determined which color register will be used for subsequent plots. There are 5 color registers (0 - 4). When doing graphics, the least sigificant bits given to the COLOR statement determine which register, Why is it that the same COLOR statement, when using for text mode, has the two most significant bits deal with color? Also, since it is just two bits, it could only refer to teh 1st four color registers and not the 5th one. That's okay I suppose, but do they even refer to color registers at all? Any of you gurus able to help clear this up? 10 GRAPHICS 0:COLOR 17:PLOT 10,10 works here (i.e. ASCII 17 is plotted at pos. 10,10). You would just need to disable the cursor. Quote Link to comment Share on other sites More sharing options...
fujidude Posted August 6, 2015 Author Share Posted August 6, 2015 (edited) My bad, I should have stated I did something like this: COLOR 0+64+17 I was thinking that I needed to set the 1st two most significant bits to 01 (for register #1). Thanks a bunch for pointing out that it is as simple as using all 8 bits for the character! (at least in GR.0). Edited August 6, 2015 by fujidude Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 7, 2015 Share Posted August 7, 2015 (edited) Using draws in text mode offers no assistance re selecting of graphical characters to simulate a line, it's up to you for that choice and the one character makes up the entire line. For GR. 0 you should disable the cursor otherwise you'll get unwanted blocks appearing. Also, control characters will be acted upon, you can have them always printed instead of executed by POKE 766,1. Additional to that, you might run into trouble if trying to use COLOR 155. That's the RETURN/EOL character and won't get processed as expected. On top of all that, you can experience problems if trying this stuff out in immediate mode under Basic. The draw command works in Basic programs because when you execute the GRAPHICS command it opens an S: device for it using IOCB #6. That includes GR. 0 which allows the draw commands to work inside the program. The problem you can encounter is when a Basic program runs through you have an "implied END" which will close the other IOCBs. When this occurs you can't use the DRAWTO command. Edited August 7, 2015 by Rybags Quote Link to comment Share on other sites More sharing options...
fujidude Posted August 7, 2015 Author Share Posted August 7, 2015 Thanks for the additional info. I did notice that already about turning off the cursor and the graphics modes. Good to know about location 766 too. Quote Link to comment Share on other sites More sharing options...
Grevle Posted August 12, 2015 Share Posted August 12, 2015 I call this the color plot metode, I used it a lot when i learned Basic Programming and even in some of my newer games. What i usualy do to find the right Color varaiable for the character i want to plot or drawto is to make a small program that prints the value and then plot the character next to the number and by moving the joystick up and down i cycle throug the numbers and then take note of the value that fits the character i want to use..so the same characters may be show up to 3 or 4 times but in different colors, or i guess in gr.0 inverse, It depends what graphics mode your using. Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 13, 2015 Share Posted August 13, 2015 Most of the graphics characters are easy to work out - the character/colour coding equates to which letter of the alphabet you use to type it onscreen, ie Ctrl A = 1, Ctrl Z = 26. Quote Link to comment Share on other sites More sharing options...
fujidude Posted August 13, 2015 Author Share Posted August 13, 2015 I use this: ascii_atascii_table.pdf Quote Link to comment Share on other sites More sharing options...
Grevle Posted August 13, 2015 Share Posted August 13, 2015 (edited) Well i used my little program with modified character sets, So my characters would be designet for drawing backround graphics etc. so for me that way i always was sure i got the right character i wanted to use, It was also nice to see the Modified character , To see if it look right in the same mode its going to be used and cycle trough the Characters make that prosses easier. Just my way of doing that. Nice Table by the way, Wish i knew it sooner Edited August 13, 2015 by BioFreeze Quote Link to comment Share on other sites More sharing options...
fujidude Posted August 14, 2015 Author Share Posted August 14, 2015 I didn't make it, but it came in very handy for my AAC (ASCII ATASCII Converter) program I made recently. I ended up finding that chart after doing some Googling. I also found this: 8-Bit ATASCII.pdf 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.