Detecting PCjr/Tandy video?
-
CommodoreJohn
- Posts: 28
- Joined: Thu Apr 29, 2010 4:13 pm
- Location: Minnesota, USA
- Contact:
Detecting PCjr/Tandy video?
I'm wondering if there's a good way to detect the video system for the PCjr or Tandy computers without either having to perform a bunch of attempted mode changes (annoying) or prompting the user (slow and annoying.) Assembler examples would be nice, but any explanation of how to do it would be very welcome.
Packard-Bell 286 (DOS 3.3, 32MB HD, 2.6MB RAM, HGC/EGA)
Tandy 1000TX (DOS 3.2, 640KB RAM, TGA)
Tandy 1000TX (DOS 3.2, 640KB RAM, TGA)
Re: Detecting PCjr/Tandy video?
On a PCjr this is pretty easy. Look for the ID byte at the high end of ROM - it should say 0xFD. You can check the BIOS date too to be sure - there was only one PCjr BIOS version, so it is always the same. (June 1983 or something like that.) And then lastly check the BIOS RAM area for the amount of installed memory - a PCjr with 64KB does not have access to the extended video modes, but a 128KB Jr can do them all.
The Tandy machines are going to be a problem. There must be a common copyright string you can look for. I'm not sure what ROM ID byte they use - that might vary. And there is no secret port that I know of that says what a machine is capable of displaying, or that provides a rock solid ID for the machine. Which is why way back when all of the games asked you what kind of graphics you wanted to use.
The Tandy machines are going to be a problem. There must be a common copyright string you can look for. I'm not sure what ROM ID byte they use - that might vary. And there is no secret port that I know of that says what a machine is capable of displaying, or that provides a rock solid ID for the machine. Which is why way back when all of the games asked you what kind of graphics you wanted to use.
-
CommodoreJohn
- Posts: 28
- Joined: Thu Apr 29, 2010 4:13 pm
- Location: Minnesota, USA
- Contact:
Re: Detecting PCjr/Tandy video?
Hmm. I looked around a bit, and found two things. First, on all the Tandy 1000x BIOS ROMs I looked through, the text "Tandy Corporation" appears somewhere after 0xC000 in the ROM file (F000:C000 in the machine, I think;) it's not at the same address across revisions, but it seems to be within the first 256 bytes of that area, so it would be easy to search for. More simply, though, this thread over on the VOGONS forums says that Tandy systems have a special ID byte of 0x21 at exactly F000:C000 (the normal ID byte looks to be 0xFF.) The ROMs I looked through seem to confirm this. I dunno about the Tandy 2000, though.
Thanks for your help!
Thanks for your help!
Packard-Bell 286 (DOS 3.3, 32MB HD, 2.6MB RAM, HGC/EGA)
Tandy 1000TX (DOS 3.2, 640KB RAM, TGA)
Tandy 1000TX (DOS 3.2, 640KB RAM, TGA)
-
deathshadow60
- Posts: 62
- Joined: Mon Jan 10, 2011 5:17 am
- Location: Keene, NH
- Contact:
Re: Detecting PCjr/Tandy video?
Not to bump a seven month old post, but my latest blog entry is related -- which Is part of my Winter-warm up for the 2011 retro challenge.
http://my.opera.com/deathshadow/blog/
For those of you who don't want to click through to the blog, the meat of it being my current video card detection routine: (TP7/ASM mix)
I'm hoping to add AT&T "400", 8514 and 3270 support to that as well in the near future.
http://my.opera.com/deathshadow/blog/
For those of you who don't want to click through to the blog, the meat of it being my current video card detection routine: (TP7/ASM mix)
Code: Select all
const
videoCard_mda=0;
videoCard_cga=1;
videoCard_pcJr=2;
videoCard_tandy1000=3;
videoCard_tandySLTL=4;
videoCard_ega=5;
videoCard_vga=6;
function detectCard:byte; assembler;
asm
mov ax,$1200
mov bl,$32 { VGA only enable video }
int $10
cmp al,$12 { VGA returns $12, all others leave it unmodified! }
jne @notVGA { not a vga, test for EGA }
mov al,videoCard_vga
ret
@notVGA: { We eliminated VGA, so an EGA/VGA true must be EGA }
mov ah,$12
mov bl,$10 { EGA/VGA get configuration info }
int $10
and bl,$03 { EGA/VGA returns a 0..3 value here }
jz @notEGA { not a VGA, test for MDA }
mov al,videoCard_ega
ret
@notEGA: { MDA all we need to detect is video mode 7 }
mov ah,$0F { get Video mode }
int $10
cmp al,$07
jne @notMDA
mov al,videoCard_mda
ret
@notMDA: { not MDA, check for Jr. }
mov ax,$FFFF
mov es,ax
mov di,$000E { second to last byte PCjr/Tandy BIOS info area }
mov al,$FD { ends up $FD only on the Jr. }
cmp es:[di],al
jne @notJr
mov al,videoCard_pcJr
ret
@notJr: { not junior, test for tandy }
mov al,$FF { all tandy's return $FF here }
cmp es:[di],al
jne @notTandy
mov ax,$FC00
mov es,ax
xor di,di
mov al,$21
cmp es:[di],al
jne @notTandy
mov ah,$C0 { test for SL/TL }
int $15 { Get System Environment }
jnc @tandySLTL { early Tandy's leave the carry bit set, TL/SL does not }
mov al,videoCard_tandy1000
ret
@tandySLTL:
mov al,videoCard_tandySLTL
ret
@notTandy:
mov al,videoCard_cga { all other cards eliminated, must be CGA }
end;
The only thing about Adobe web development products that can be considered professional grade tools are the people promoting their use.