--- title: "Displaying QL Screens In MS-DOS" type: "article" slug: "displaying-ql-screens-in-ms-dos" url: "http://localhost/article/displaying-ql-screens-in-ms-dos/" markdown_url: "http://localhost/article/displaying-ql-screens-in-ms-dos.md" published_at: "2025-12-18T14:53:13+00:00" modified_at: "2026-06-21T23:26:55+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "[It's not normally the policy of the QHJ to publish programs that are written for other platforms than the QL. But in this case, I can make an exception. The following program by Jeff Kuhlmann is designed to display a QL screen file on an MS-DOS computer. I've tried it with my MS-DOS laptop (CGA…" category: - name: "QL Hacker's Journal" slug: "ql-hackers-journal" taxonomy: "category" url: "http://localhost/category/periodicals/ql-hackers-journal/" post_tag: - name: "C (programming language)" slug: "c-programming-language" taxonomy: "post_tag" url: "http://localhost/tag/c-programming-language/" - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Jeffrey Kuhlmann" slug: "jeffrey-kuhlmann" taxonomy: "indiv" url: "http://localhost/indiv/jeffrey-kuhlmann/" publication_r: id: 33686 title: "QL Hacker’s Journal" type: "periodical" url: "http://localhost/periodical/ql-hackers-journal/" authors_r: - name: "Jeffrey Kuhlmann" slug: "jeffrey-kuhlmann" taxonomy: "indiv" url: "http://localhost/indiv/jeffrey-kuhlmann/" issue: "19" issues_articles: - id: 61555 title: "QL Hacker’s Journal 19" type: "issue" url: "http://localhost/issue/ql-hackers-journal-19/" pubdate: "November 1994" archive_link: true --- [It’s not normally the policy of the QHJ to publish programs that are written for other platforms than the QL. But in this case, I can make an exception. The following program by [Jeff Kuhlmann](http://localhost/indiv/jeffrey-kuhlmann/) is designed to display a QL screen file on an MS-DOS computer. I’ve tried it with my MS-DOS laptop (CGA display) and with a 486 (VGA display) and it works fine on both computers. As more and more QLers are buying PC’s, programs like this are becoming more useful. – ED] ``` /* SHOWGR.C - A 'C' PROGRAM TO DISPLAY '_GR' FILES FROM THE MDOS PROMPT */ /* JEFFREY A. KUHLMANN 27FEB94 */ #include "graphics.h" #include "stdio.h" #include "string.h" #include "stdlib.h" #include "io.h" #include "conio.h" char infn[81]; /* input file name */ char str1[81]; char buf[128*200+128]; FILE inf; int arry[20]; /* utility array */ char rows[81]; /* row string */ char cols[81]; /* columns string */ int ctr,end,delim,col,row; int rctr,cctr,cptr; int chardat[8],chrptr; char hexdat[81]; int hex[4]; int blank[4],where,pval,ccc; int mptr,fd,gm; main(argc,argv) int argc; char **argv; { gm=5; /* Graphic Mode */ if (argc<2) /* If no file name given on command line, */ { /* ask for one */ setvmode(2); puts("QL SCREEN VIEWER FOR MDOS"); puts("Press any key when done"); puts("viewing picture..."); puts("QL SCREEN file name? (w/o .SCR)"); gets(infn); } else strcpy(infn,argv[1]); strcat(infn,".SCR"); /* add required extension */ setvmode(gm); /* change video mode */ fd=open(infn,O_BINARY); /* open file for reading */ mptr=0; if (fd==-1) {setvmode(2); printf("Can't open %s",infn); exit(0);} read(fd,buf,128*200); /* ^ read first 200 lines into a buffer */ for(rctr=0;rctr<200;rctr++) /* ^ 200 pixels in 'y' direction */ for(cctr=0;cctr<128;cctr++) /* ^ each QL line is 128 bytes */ { pval=buf[(rctr)*128+cctr]; if(rctr&1) /* ^ need to take into account odd scan line */ poke(0xba00,(rctr-1)*40+cctr/2+8,pval); else poke(0xb800,rctr*40+cctr/2+8,pval); } while(!kbhit()); /* wait for keypress */ setvmode(2); /* restore 80 col. mode */ exit(0); } ```