Path: utzoo!attcan!uunet!lll-winken!ames!killer!igloo!andyross From: andyross@igloo.UUCP (Andrew Rossmann) Newsgroups: comp.sys.tandy Subject: Re: Tandy 1000 graphics/sound in Turbo C/Pascal? Message-ID: <1370@igloo.UUCP> Date: 8 Jan 89 19:36:42 GMT References: <1945@ogccse.ogc.edu> <1946@ogccse.ogc.edu> Reply-To: andyross@igloo.UUCP (Andrew Rossmann) Organization: igloo, Northbrook, IL Lines: 29 In article <1946@ogccse.ogc.edu> mwolfe@cse.ogc.edu (Michael Wolfe) writes: >Is there any way to access the Tandy 1000 graphics (16 color CGA mode, >instead of normal 4 color) and sound (3 voices) through a high level >language, such as Turbo C or Pascal (which I have) or something else >(which I don't have). I haven't found any documentation for getting >to these except through Basic, but then I haven't looked too hard either. > >Replies can be sent to: mwolfe@cse.ogc.edu or !sequent!ogccse!mwolfe >tnx. The easiest way to access the Tandy/PCjr graphic modes is to use the BIOS (ugh!). First, be sure to release unnecessary memory, as the computer will have to expand the RAM allocated to video from 16K to 32K. In Pascal, make sure to specify a small Heap size, 0 if you don't need it at all, otherwise TP will grab all of available memory. To start the mode, define a registers variable, set AL=mode (9 is 320x200x16, 10 is 640x200x4, 8 is 160x200x16 [mode 8 only need 16K]). Also, set AH=0. Then call BIOS interrupt 10h using Intr($10, regs). To read/write from the screen, use function 0Ch (AH=$0C) to write, and function 0Dh (AH=$0D) to read. In writing, AL=color, CX=pixel column, and DX=pixel row. In reading, AL will return the color of the specifed pixel. This is admittedly slow, but it is the easiest. I used this to convert some CGA pictures to Tandy mode for eventual pick-up into PCPaintbrush. I'm pretty sure there are some routines to make it much easier. The guy who wrote the Monopoly games had gotten some from someone. Also, with TP4 and 5 using BGI's to access video, some company has surely written one for the Tandy 1000's. If you find out anything more, let me know! andyross@igloo.UUCP or andyross@ddsw1.MCS.COM