mwolfe@ogccse.ogc.edu (Michael Wolfe) (01/08/89)
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.
andyross@igloo.UUCP (Andrew Rossmann) (01/09/89)
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
gdh@raider.MFEE.TN.US (Gordon Hull) (01/10/89)
In article <1370@igloo.UUCP>, andyross@igloo.UUCP (Andrew Rossmann) writes: > 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. I didn't think that video memory had to be allocated; i.e. the extra 16k is already there somewhere. Am I wrong on this? It is still at $b800, isn't it (unless you specicfically set otherwise)? I know for a fact that Microsoft QuickBASIC does NOT support them - tho it supports most everything else. Oh, well. Please add me to the list of people interested in any more info that comes up! -- Gordon Hull Internet: gdh@raider.MFEE.TN.US Gordon_Hull@oraider.FIDONET.ORG FIDO: 1:116/9 Flames: ..!nether!inferno!lowest!circle!asmodeus (or ..!file13)
andyross@igloo.UUCP (Andrew Rossmann) (01/11/89)
In article <75@raider.MFEE.TN.US> gdh@raider.MFEE.TN.US (Gordon Hull) writes: >In article <1370@igloo.UUCP>, andyross@igloo.UUCP (Andrew Rossmann) writes: >> 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. > >I didn't think that video memory had to be allocated; i.e. the extra 16k is >already there somewhere. Am I wrong on this? It is still at $b800, isn't >it (unless you specicfically set otherwise)? > >Gordon Hull On the 1000 series, references to the $B800 segment are actually re-routed to the top 16K of memory. (About $9C00 in a 640K machine.) When you set up the 320x200x16 or 640x200x4 graphics modes, that 16K must be expanded to 32K. Also, references to $B800 will now access the top 32K of RAM. (About $9800.) In reality (at least on my SX) there are 4 64Kx4 RAMs (128K total). Any or all of this is available for video or normal use. These RAM chips are ALWAYS the top 128K, whether you have 384K or 640K. Normally, the top 16K is set for video, and the other 112K is available for normal RAM. Unfortunately, any access to this memory is subject to additional wait states. This is because the chip can only be accessed 1 part at a time, and waits are added to prevent video 'snow.' My Technical reference manual shows that there is the possibility of up to 256K of RAM for video, but I think only 128K is possible on the SX. That is why you can only allocate up to 128K of video RAM using Tandy BASIC's CLEAR command. The newer L series may support larger video RAM (they have a 640x200x16 color mode, in addition to Hercules [if you have a true mono monitor.]) andyross@igloo.UUCP, andyross@ddsw1.MCS.COM