How to detect the text mode? (Developers)
Hello Laaca, hello Japheth,
> > So the question is, how to easily distinguish between text mode and
> graphic
> > mode.
> If the graphics card is VGA compatible, there are at least 2 options:
> 1. graphics controller, port 3CEh, index 6: if bit 0=1, graphics mode
> active
> 2. attribute controller, port 3C0h, index 10h: if bit 0=1, graphics mode.
Is there anything that will also work with MDA or CGA graphics cards?
I think a good way to test specifically whether one can directly peek and poke 0xb800:0 or 0xb000:0, etc., would be to query the mode number. To do this, what my libi86 project currently does is to call int 0x10, ax = 0x4f03, and if that fails, fall back on int 0x10, ah = 0x0f.
I expect that most if not all tweaked 80×__ modes will have a mode number of 0x0003, except with differing numbers of text rows.
(To spot for text modes in general, for my libi86, I currently use bit 1 of 0x40:0x65 (see Ralf Brown's Interrupt List). I am not sure how reliable that is though.)
Thank you!
---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"
Complete thread:
- How to detect the text mode? - Laaca, 14.11.2020, 11:00 (Developers)
- How to detect the text mode? - Japheth, 14.11.2020, 16:01
- How to detect the text mode? - tkchia, 15.11.2020, 08:01
- How to detect the text mode? - jassenna, 30.12.2020, 17:56
- How to detect the text mode? - tkchia, 31.12.2020, 08:16
- How to detect the text mode? - jassenna, 01.02.2021, 00:02
- How to detect the text mode? - tkchia, 01.02.2021, 14:26
- How to detect the text mode? - rr, 01.02.2021, 17:56
- How to detect the text mode? - tkchia, 01.02.2021, 14:26
- How to detect the text mode? - jassenna, 01.02.2021, 00:02
- How to detect the text mode? - tkchia, 31.12.2020, 08:16
- How to detect the text mode? - DosWorld, 15.11.2020, 15:12
- How to detect the text mode? - Japheth, 15.11.2020, 17:13
- How to detect the text mode? - DosWorld, 15.11.2020, 18:49
- How to detect the text mode? - Japheth, 15.11.2020, 17:13
- How to detect the text mode? - bretjohn, 31.12.2020, 17:52
- How to detect the text mode? - Japheth, 14.11.2020, 16:01