Add sanity check panic for CRTC interactions
This commit is contained in:
parent
b019ac4f7d
commit
02530a4859
|
@ -144,6 +144,9 @@ cgaputc(int c)
|
||||||
} else
|
} else
|
||||||
crt[pos++] = (c&0xff) | 0x0700; // black on white
|
crt[pos++] = (c&0xff) | 0x0700; // black on white
|
||||||
|
|
||||||
|
if(pos > 25*80)
|
||||||
|
panic("pos overflow");
|
||||||
|
|
||||||
if((pos/80) >= 24){ // Scroll up.
|
if((pos/80) >= 24){ // Scroll up.
|
||||||
memmove(crt, crt+80, sizeof(crt[0])*23*80);
|
memmove(crt, crt+80, sizeof(crt[0])*23*80);
|
||||||
pos -= 80;
|
pos -= 80;
|
||||||
|
|
Loading…
Reference in a new issue