I hate neomagic

Unfortunately, my notebook has one

Ok, here are at least some of info about neomagic magicgraph chipset. To unlock neo registers, do this:

#define GRA_I   0x3CE

int vgaIOBase;

static void enable(void)
{
  unsigned char temp;
  int vgaIOBase = (inb(0x3CC) & 0x01) ? 0x3D0 : 0x3B0;

  /* Unprotect CRTC[0-7] */
  outb(0x11, vgaIOBase + 4); temp = inb(vgaIOBase + 5);
  outb(temp & 0x7F, vgaIOBase + 5);

  outw(0x2609, GRA_I);  /* Unlock neo registers */
}

To read and set registers, use this routines:

void setGRA( int reg, int val ) { outb(reg, GRA_I); outb(val, GRA_I+1); }
int readGRA( int reg ) { outb(reg, GRA_I); return inb(GRA_I+1); }

And now, individual register meanings are (from what I guessed); all numbers are in hexadecimal:

GRA register	Meaning
e               Some timing/addressing mode select? When set to f1,
		display is corrupted, when more, blank screen 
f		Low bits: addressing mode?
15              Also something strange with videoram not too working.
20              Bitfield
                1 = use external display
                2 = use internal LCD
		8 = make picture bigger if stretchs are in effect
		20 = we are using 800x600  \
		40 = we are using 1024x768 -+ both: we are using 1280x???
25		Value
                21 = small picture in center
		e6 = full screen
		Bitfield
		1 = shift picture down
		2 = stretch display vertically
		8 = make external display very bright
		30 = set cursor blinking speed 
		40 = stretch picture horizontally
2f		Bitfield
                (do not use)
		1 = stretch display vertically
		2 = stretch display horizontally
		5 = insert extra lines in vertical places
26		strangely affect number of copies of picture on LCD
30		Bitfield
		0..3 = number of spaces after each character
                10 = shift picture to the right
		(setting this to 12/13 does something _very_ wrong with LCD)
31		Bitfield
		1 = when set to 0, do something strange with CRT 
82		hardware cursor control (?)
                8 = enable
		4 = big
		high bits: hide most of/full screen
90		video ram access mode?
                8 = no new characters written into videoram   
		
34		PanelHorizCenterReg2 

32		PanelVertCenterReg4

Copyright 1998 Pavel Machek (pavel@ucw.cz). Copy this as you wish. If you have modifications, please let me know, and I'll publish them here. http://www.mnsinc.com/js/Neomagic.html was used as a great source of information...


This page was created by Pavel Machek.