OxC0FFEE Posted February 2, 2017 Share Posted February 2, 2017 (edited) Hi, New/old A8 basic coder here (haven't touched it in ~30y). Trying to remember how to use ML strings to redefine character sets... My most immediate problem is that I can't get certain characters on the screen. CHR$(127) does not output the right-facing triangle character. I need to get that in a string to redefine my character set but I'm forgetting how. The screenshot attached shows another person's program that contains said character in a string, but I don't know how it was done. I have access to Atari800MacX, Envision on a windows XP VM, and I'm open to other mac/win/a8 tools if there's an easy-peasy character set generator that outputs what I need. I also don't mind converting the values by hand into ATASCII but I figure there's easier ways My requirements are that the code be self-contained in the basic file and that it be as compact as possible, so I can't use external files to load the charset data, and I figure strings are better than data statements. Edited February 2, 2017 by OxC0FFEE Quote Link to comment Share on other sites More sharing options...
+Stephen Posted February 2, 2017 Share Posted February 2, 2017 Funny how my memory works. I often can't remember what I had for dinner one or two nights ago, but I remembered this, and verified on my real machine. Type ESC (escape key), then hit the tab key. Quote Link to comment Share on other sites More sharing options...
OxC0FFEE Posted February 2, 2017 Author Share Posted February 2, 2017 ! thank you! And I know what you mean about long-disused latent memories. Does anyone know if there's a general-purpose escaping method for all non-printing characters into strings, not just 127? Quote Link to comment Share on other sites More sharing options...
+Stephen Posted February 2, 2017 Share Posted February 2, 2017 Yeah - any character you want to print (such as the arrow for clear-screen), just hit ESC before typing the character. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted February 2, 2017 Share Posted February 2, 2017 Carriage returns would still have to be handled with STRING$(X,X)=CHR$(155), tho. BTW if the data or ML routine is short enough, you don't need to DIM a string variable for it. Just USR(ADR("{ml routine}")). 4 Quote Link to comment Share on other sites More sharing options...
kenjennings Posted February 3, 2017 Share Posted February 3, 2017 Carriage returns would still have to be handled with STRING$(X,X)=CHR$(155), tho. Also, the double quote character. CHR$(34) ? 1 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted February 3, 2017 Share Posted February 3, 2017 Carriage returns would still have to be handled with STRING$(X,X)=CHR$(155), tho. BTW if the data or ML routine is short enough, you don't need to DIM a string variable for it. Just USR(ADR("{ml routine}")). I seem to recall making a variable to point to the string (ROUTINE=ADR("ML_ROUTINE")) and then poking in quotes and carriage returns (POKE ROUTINE+n,155) before calling the subroutine. Best of both worlds. 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 4, 2017 Share Posted February 4, 2017 With implied assignment, e.g. A$="abcdef" the trouble is with embedding quotes and Return code. With DATA statements the trouble is with embedding commas and Return code. IMO the best method is a mix of reading and concatenating from DATA then use the method FJC suggested. Maintain extra data elsewhere of indexes into the string where characters need to be changed to those codes. Or in the case where there aren't many occurrences to be fixed just include the program code to do the change, e.g. A$(400,400)="," : POKE ADR(A$)+600,155 Actually that second example would probably be better due to less memory use. Also note with the Poke method, use <string index - 1> 1 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted February 4, 2017 Share Posted February 4, 2017 I always seemed to be running out of space in BASIC and data statements eat RAM. 1 Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted February 4, 2017 Share Posted February 4, 2017 (edited) I have a utility called convert.bas which does all this for you and even messes with the variable name table so that you can use string assignments to write directly to memory Http://atariage.com/forums/topic/147473-basic-program-fonts-wanted-in-string-format/?p=1813361&fromsearch=1#entry1813361 Edited February 4, 2017 by Synthpopalooza 2 Quote Link to comment Share on other sites More sharing options...
kenjennings Posted February 4, 2017 Share Posted February 4, 2017 (edited) I always seemed to be running out of space in BASIC and data statements eat RAM. Yup. Even if data is worked down to strings in data statements or assignments there is still redundant data. The most efficient use of memory is having no string data staged as DATA or assignments. Instead, put it in a file (or files) and read it at startup. Unfortunately, Atari BASIC is brain damaged when using CIO to put/get arbitrary lengths of binary data, so a program has to do it the slow way and GET one character at a time. (OSS BASIC XL and others have working Bget commands that fix this.) I posted a bit of blather about this in the blog including a new version of XIO that does what it should, here: http://atariage.com/forums/blog/576/entry-13185-part-10-of-11-simple-assembly-for-atari-basic/ Edited February 4, 2017 by kenjennings 1 Quote Link to comment Share on other sites More sharing options...
ricortes Posted February 4, 2017 Share Posted February 4, 2017 Poke 766,1 I seem to recall there were more then a few problems with this like you have to get to a clean line and enter poke 766,0 before you could move the cursor back up to hit enter on the line. Worked great for cls character anyway. IIRC the technique was something like hit BREAK key repeatedly to move down screen. 2 Quote Link to comment Share on other sites More sharing options...
pirx Posted February 18, 2017 Share Posted February 18, 2017 Yup. Even if data is worked down to strings in data statements or assignments there is still redundant data. not necessarily for strings - if your routine is relocatable you can keep and run it directly from string, so no overhead here. On quotes and return char -- few times I have avoided them by redesigning the data/code. It's just another constraint ; ) 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.