+therealbountybob Posted July 19, 2009 Share Posted July 19, 2009 (edited) Has anyone got the default Atari font or any others in string format for use with this routine (Page 6 Magazine Issue 26) Or 2nd best any basic games that have an entire font in data statements Thanks INSTANT FONT ROUTINE 10 REM DIM CC$(1024):GOTO 29000 29000 REM Instant character set by Les Howarth re Page 6 Issue 29 29020 MTOP=PEEK(106)-4:POKE 106,MTOP-4:GRAPHICS 28:POKE 16,64:POKE 53774,64 29030 D=PEEK(140)+256*PEEK(141):R=PEEK(134)+256*PEEK(135) 29040 Q=MTOP*256-D:R1=INT(Q/256):T=Q-R1*256:POKE R+2,T:POKE R+3,R1 31009 REM strings of font data from this point 1 - 1024 characters 31010 CC$(1,80)="fgbgjgojkerog5j5teoje5o5r5igj" various ataskii characters etc 31020 CC$(81,160)"fjgiorejgergejdfjbnigdfhoigjio" etc 32000 POKE 756,MTOP:REM goto start of game from here. Edited July 19, 2009 by therealbountybob Quote Link to comment Share on other sites More sharing options...
Rybags Posted July 19, 2009 Share Posted July 19, 2009 You could easily just read font files and put them in strings yourself. You get a problem with data type 155 though... it can't be represented by a printable character, you have to put it in the string with CHR$. That aside, there's better ways to do that kinda thing in BASIC. You're way better off just keeping fonts and Asm routines in seperate files, then just reading them in instead of duplicating data in memory. Quote Link to comment Share on other sites More sharing options...
+therealbountybob Posted July 20, 2009 Author Share Posted July 20, 2009 (edited) You could easily just read font files and put them in strings yourself. You get a problem with data type 155 though... it can't be represented by a printable character, you have to put it in the string with CHR$. That aside, there's better ways to do that kinda thing in BASIC. You're way better off just keeping fonts and Asm routines in seperate files, then just reading them in instead of duplicating data in memory. Thanks, Ok third best, has anyone got any font files that are suitable I'm really hoping someone has a string based font or two sitting there somewhere [Edit] I've found some .fnt filese here if anyone has a routine to read/use them in a basic program would be appreciated. Edited July 20, 2009 by therealbountybob Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted July 20, 2009 Share Posted July 20, 2009 You can just use the native SIO routine to put them into your string. Basically, you just open a channel, POKE in the appropriate values of start, length, and operation type (read or write)...then flip to a USR subroutine to call the native routine (that is very short, and can be put into a string of it's own). Here are the lines. Precede them with any line numbers you want. REMarks can be omitted...just here to explain what each line is doing. 4 "throw-away" variables are being used here...ACTION, CHANNEL, ERROR, and TEMP...but the could be done away with if you are going to be using the same values repeatedly (just place the values directly in the line if that is the case)...or not concerned with error codes. ACTION = 4 : REM 4=READ...SET TO 8 FOR WRITING CHANNEL = 1 : REM I/O CHANNEL USED BELOW OPEN #CHANNEL,ACTION,0,"D:FILENAME.FNT" : REM REPLACE FILENAME W/ACTUAL POKE TEMP=INT(ADR($CC)/256) : REM POKE IN THE START ADDRESS... POKE 836+CHANNEL*16,ADR($CC)-TEMP*256 : REM LSB... POKE 837+CHANNEL*16,TEMP : REM ...AND MSB POKE 840+CHANNEL*16,0 : REM SET THE LENGTH. LSB... POKE 841+CHANNEL*16,4 : REM ...AND MSB (0+4*256=1024 BYTES) POKE 834+CHANNEL*16,ACTION+3 : REM SET OPERATION TYPE TEMP=USR(ADR("{lower}hhh{inverse}*{normal}{upper}LV{inverse}{lower}d"),CHANNEL*16) : REM SIO CALL ERROR=PEEK(835+CHANNEL*16) : REM THIS HOLDS THE ERROR VALUE IF PRESENT CLOSE #1 : REM ALL DONE! NOTE: in the USR command above, 2 characters need to be typed in inverse (use the fuji key)...and some are lower-case (use the upper/lower key). You don't type the brackets and "inverse" when typing the asterisk, for example...just hit fuji and type in *. The string will be "hhh*LVd" with just the asterisk and d in inverse text. Here's a thread with some character set editors... http://www.atariage.com/forums/index.php?showtopic=92994 1 Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted July 20, 2009 Share Posted July 20, 2009 BTW to avoid any problems, your program should initialize the string to it's full length. You can use this to quickly accomplish it... CC$=CHR$(0) : CC$(1024)=CC$ : CC$(2)=CC$ That sets all of the font area to zeros. Quote Link to comment Share on other sites More sharing options...
+therealbountybob Posted July 22, 2009 Author Share Posted July 22, 2009 Thanks ever so much for your help . I have managed to combine your code with the existing routing to load a font into CC$. What I need to do know is select one with suitable text and add my Graphics characters to it, preferably without having to draw them all (as I already have them in string and data formats). I downloaded Envision a while ago so will take a look at this again. As you know Whistler's Brother is the current game in the HSC; I can see how this font change method can be used to great effect to quickly change the graphics over on each level. Cheers Jason. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 10, 2009 Share Posted August 10, 2009 I have written a program in Atari BASIC which will take a font file (or any file), convert it into strings or data statements, and automatically generate a .lst file with the necessary code to move this data into any memory location. Let me know what you think! convert.zip 4 Quote Link to comment Share on other sites More sharing options...
dwhyte Posted August 11, 2009 Share Posted August 11, 2009 (edited) EDIT: D'oh! Wrote this post before reading the above one... Edited August 11, 2009 by dwhyte Quote Link to comment Share on other sites More sharing options...
+therealbountybob Posted August 25, 2009 Author Share Posted August 25, 2009 I have written a program in Atari BASIC which will take a font file (or any file), convert it into strings or data statements, and automatically generate a .lst file with the necessary code to move this data into any memory location. Let me know what you think! Thanks Synthpopalloza, I've just checked this out and it's a nice program (by Bobby Clark who did the SkyScraper game on another recent thread). I am going to look at animating characters next... then maybe have a go at another game once I get an 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.