+Philsan Posted December 3, 2022 Share Posted December 3, 2022 On Mapping the Atari there's this Atari Basic code to draw text on a graphics 8 screen. Could it be converted to FastBasic? Could there be something faster? Thanks! Mapping The Atari - BITMAP8.basMapping The Atari - BITMAP8.txt 1 GRAPHICS 8 5 DLIST=PEEK(560)+PEEK(561)*256 6 LOBYTE=DLIST+4:HIBYTE=DLIST+5 7 REAL=PEEK(LOBYTE)+PEEK(HIBYTE)*256:SCREEN=REAL:TV=SCREEN 10 CHBASE=57344 20 DIM A$(128),BYTE(128),WANT(128) 27 PRINT "INPUT A 40 CHARACTER STRING:" 30 INPUT A$ 35 TIME=TIME+1 40 FOR LOOK=1 TO LEN(A$) 50 BYTE(LOOK)=ASC(A$(LOOK,LOOK)) 51 IF BYTE(LOOK)>127 THEN BYTE(LOOK)=BYTE(LOOK)-128 52 IF BYTE(LOOK)<32 THEN BYTE(LOOK)=BVTE(LOOK)+64:GOTO 55 53 IF BYTE(LOOK)<97 THEN BYTE(LOOK)=BYTE(LOOK)-32 55 NEXT LOOK 59 FOR EXTRA=0 TO 7 60 FOR LOOK=1 TO LEN(A$) 70 WANT(LOOK)=PEEK(CHBASE+EXTRA+BYTE(LOOK)*8) 80 POKE TV+EXTRA,WANT(LOOK):TV=TV+1 82 NEXT LOOK 85 SCREEN=SCREEN+39:TV=SCREEN 90 NEXT EXTRA 100 SCREEN=REAL+TIME*320 110 IF SCREEN>REAL+6080 THEN TIME=0:GOTO 100 120 GOTO 30 Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 3, 2022 Share Posted December 3, 2022 You'll never really render text to bitmap very fast in Basic, even compiled. That code looks really inefficient, it's calculating things like character bitmap for every scanline and also doing Ascii to internal character translation. Also no stacked lines. It could be sped up fairly easily. With a bit more effort, ie write most of it in assembler, it could be much more usable. 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted December 3, 2022 Share Posted December 3, 2022 I can never get Fast BASIC to work, but I would think very easy to convert to it for those that have it working. Other than that, I don't think it would be too hard to convert it to Assembler. Quote Link to comment Share on other sites More sharing options...
+Philsan Posted December 3, 2022 Author Share Posted December 3, 2022 I miss Turbo-Basic XL TEXT command. I would like a FastBasic code to write text, I think it could be fast enough. 2 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted December 3, 2022 Share Posted December 3, 2022 Try this, just a quick conversion to cc65, not done any real conversion to make it faster, tried to keep as close to the original code just for fun, sure it could be a lot quicker with a little work. Here's the code, warts and all #include <stdlib.h> #include <string.h> #include <errno.h> // #include <conio.h> #include <peekpoke.h> #include <stdio.h> #include <atari.h> // #include <atarisyseq.h> char *dlist; int lobyte,hibyte; int real,screen,tv; char *chbase; char A[128],byte[128],want[128]; int time=0; int main(void) { char look,extra; _graphics(8); dlist=(char *)(PEEK(560)+PEEK(561)*256); lobyte=(int)dlist+4; hibyte=(int)dlist+5; real=PEEK(lobyte)+PEEK(hibyte)*256; screen=real; tv=screen; chbase=(char *)0xe000; do { printf("Input a 40 Character String\n"); scanf("%s",&A); time=time+1; for(look=0;look<strlen(A)+1;look++) { byte[look]=A[look]; if(byte[look]>127) byte[look]=byte[look]-127; if(byte[look]<32) byte[look]=byte[look]+64; if(byte[look]<97) byte[look]=byte[look]-32; } for(extra=0;extra<8;extra++) { for(look=0;look<strlen(A)+1;look++) { want[look]=PEEK(chbase+extra+byte[look]*8); POKE(tv+extra,want[look]); tv++; } screen=screen+39; tv=screen; } do { screen=real+time*320; } while(screen>real+6080); time=0; }while(1); temp1.xex 2 1 Quote Link to comment Share on other sites More sharing options...
dmsc Posted December 3, 2022 Share Posted December 3, 2022 Hi! 5 hours ago, Philsan said: On Mapping the Atari there's this Atari Basic code to draw text on a graphics 8 screen. Could it be converted to FastBasic? Could there be something faster? Here I published a simple implementation of the "TEXT" command in Fast Basic, you can use it in your code: Have Fun! 1 1 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 3, 2022 Share Posted December 3, 2022 (edited) 8 hours ago, Philsan said: Could there be something faster? In Compute's 1st Book of Atari Graphics, there's a machine language routine for text in graphics 8 (by Douglas Crockford). The routine is on the first side of the disk (in both list and tokenized form). The filename is "P048L1"; the 48 stands for pg. 48, which is where the listing appears in the book. Edited December 3, 2022 by MrFish 4 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 3, 2022 Share Posted December 3, 2022 1 hour ago, MrFish said: In Compute's 1st Book of Atari Graphics, there's a machine language routine for text in graphics 8 (by Douglas Crockford). The routine is on the first side of the disk (in both list and tokenized form). The filename is "P048L1"; the 48 stands for pg. 48, which is where the listing appears in the book. Here's a commented disassembly of the routine, by @kenjennings Mixing Graphics 0 & 8 (Compute).asm 2 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 3, 2022 Share Posted December 3, 2022 There's also J.D. Casten's 80-column routine for BASIC. Easy 80.pdf easy80.bas 5 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 3, 2022 Share Posted December 3, 2022 3 hours ago, MrFish said: There's also J.D. Casten's 80-column routine for BASIC. Easy 80.pdf 22.12 kB · 2 downloads easy80.bas 4.1 kB · 2 downloads Sorry, I didn't look at exactly what I posted here before doing so. What I posted was a version of the program that I altered to read the 80-column character set off the "H:" drive (for Altirra); and then I forgot to post the character set too. So, here's the original (unaltered version) and the set. easy80.bas column80.set 2 Quote Link to comment Share on other sites More sharing options...
tebe Posted December 5, 2022 Share Posted December 5, 2022 https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/graph/canvas 2 Quote Link to comment Share on other sites More sharing options...
Gury Posted December 5, 2022 Share Posted December 5, 2022 Mad Pascal power Including character pattern fill routine. Quote Link to comment Share on other sites More sharing options...
+DjayBee Posted December 5, 2022 Share Posted December 5, 2022 6 hours ago, tebe said: You might change your text in (either of these): ATARI POWER without the PRICE ATARI POWER with PRIDE APPLE POWER with PRICE 3 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted December 5, 2022 Share Posted December 5, 2022 11 minutes ago, DjayBee said: ATARI POWER without the PRICE You haven't been on Ebay lately. 7 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.