ref: 753bb6b87a598995ae7f13b889686229332e88d5
parent: 68b8351f8c176057e4e07ddbce94235f2ae23159
author: ftrvxmtrx <ftrvxmtrx@gmail.com>
date: Fri Jan 2 14:07:01 EST 2015
aux/vga: revert vbegetmode
--- a/sys/src/cmd/aux/vga/vesa.c
+++ b/sys/src/cmd/aux/vga/vesa.c
@@ -895,18 +895,11 @@
vbegetmode(Vbe *vbe)
{
Ureg u;
- char size[32];
- Mode *m;
- vbesetup(vbe, &u, 0x5F29);
- u.bx = 0x8000; /* current mode */
- vbecall(vbe, &u);
- if(u.ax != 0x5f)
- return -1;
- snprint(size, sizeof(size), "%dx%dx%d",
- (int)u.bx>>16, (int)u.bx & 0xffff, (int)u.cx & 0xff);
- m = dbvesamode(size);
- return m == nil ? -1 : atoi(dbattr(m->attr, "id"));
+ vbesetup(vbe, &u, 0x4F03);
+ if(vbecall(vbe, &u) < 0)
+ return 0;
+ return u.bx;
}
int