Mail Archives: djgpp/2005/08/01/16:58:32
------=_Part_8687_2828274.1122929862053
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
On 1 Aug 2005 11:35:17 GMT, Hans-Bernhard Broeker <
broeker AT physik DOT rwth-aachen DOT de> wrote:=20
>=20
> Matthew Petricone <strstream AT gmail DOT com> wrote:
> > [-- text/plain, encoding quoted-printable, charset: ISO-8859-1, 10 line=
s=20
> --]
>=20
> > Since updating to a the latest version of djgpp
>=20
> From what version were you coming, and to which one did you upgrade?
> On which OS?
>=20
> > Whenever i attemp to write to video memory directly in the 0xb8000
> > range.
>=20
> And how, exactly, do you attempt that?
>=20
> --
> Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
> Even if all the snow were burnt, ashes would remain.
>=20
My HD crashed and i don't remember which version of djgpp i had (stupid i=
=20
know) but it was most likely 2.9 something or early 3 Now i have 4.0.1 on=
=20
windows XP pro (sp2). here is the code that is causing the problem.
=20
#define BCONS_MEM_START (char*) 0xb8000
// 80*25*2 (80 chars * 25 lines, 2 bytes per line)=20
#define BCONS_MAX_LOOP 0xfa0
// Text Colors
#define BCONS_TEXT_WHITE 0x07
#define BCONS_TEXT_BOOT 0x2f
const char* bc_vidmem =3D BCONS_MEM_START;
char* bc_color =3D (char*) BCONS_TEXT_WHITE;
int bc_pos =3D 0;;
void bc_cls(void)
{
unsigned int i =3D 0;
bc_vidmem =3D BCONS_MEM_START;
while (i < BCONS_MAX_LOOP)
{
bc_vidmem[i] =3D ' ';
i++;
bc_vidmem[i] =3D BCONS_TEXT_WHITE;
i++;
}
bc_pos =3D 0;
}
void bc_pchar(char fmt)
{
bc_vidmem[bc_pos++] =3D fmt;
bc_vidmem[bc_pos++] =3D bc_color;
}=20
unsigned int bc_get_line_val(unsigned int line)
{
if (line > 25)
return;
return line*80*2;
}=20
void bc_set_attrib(char* attrib)
{
bc_color =3D attrib;
}=20
void bc_puts(char* fmt)
{
unsigned int i =3D bc_pos;
while (*fmt)
{
if(*fmt=3D=3D'\n') {
i =3D bc_get_line_val(((i/80)/2)+1);
*fmt++;
}=20
else {
bc_vidmem[i]=3D*fmt;
*fmt++;
i++;
bc_vidmem[i] =3D bc_color;
i++;
}=20
}=20
bc_pos =3D i;=20
}
The definititions are in a header file. Alot of this was derived from=20
tutorials and info on the http://www.osdever.net/ website. It's pretty basi=
c=20
but it used to work.=20
Thanks for your help with this.
Matthew Petricone
------=_Part_8687_2828274.1122929862053
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<br><br>
<div><span class=3D"gmail_quote">On 1 Aug 2005 11:35:17 GMT, <b class=3D"gm=
ail_sendername">Hans-Bernhard Broeker</b> <<a href=3D"mailto:broeker AT phy=
sik.rwth-aachen.de">broeker AT physik DOT rwth-aachen DOT de</a>> wrote:</span>
<blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0=
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Matthew Petricone <<a href=3D=
"mailto:strstream AT gmail DOT com">strstream AT gmail DOT com</a>> wrote:<br>> [--=
text/plain, encoding quoted-printable, charset: ISO-8859-1, 10 lines --]
<br><br>> Since updating to a the latest version of djgpp<br><br>From wh=
at version were you coming, and to which one did you upgrade?<br>On which O=
S?<br><br>> Whenever i attemp to write to video memory directly in the 0=
xb8000
<br>> range.<br><br>And how, exactly, do you attempt that?<br><br>--<br>=
Hans-Bernhard Broeker (<a href=3D"mailto:broeker AT physik DOT rwth-aachen DOT de">bro=
eker AT physik DOT rwth-aachen DOT de</a>)<br>Even if all the snow were burnt, ashes w=
ould remain.
<br></blockquote></div>
<div> </div>
<div>My HD crashed and i don't remember which version of djgpp i had (stupi=
d i know) but it was most likely 2.9 something or early 3 Now i have 4.0.1&=
nbsp;on windows XP pro (sp2). here is the code that is causing the problem.
</div>
<div> </div>
<div>
<p>#define BCONS_MEM_START (char*) 0xb8000<br>// 80*25*2 (80 chars * 25 lin=
es, 2 bytes per line) <br>#define BCONS_MAX_LOOP 0xfa0</p>
<p>// Text Colors<br>#define BCONS_TEXT_WHITE 0x07<br>#define BCONS_TEXT_BO=
OT 0x2f</p></div>
<p>const char* bc_vidmem =3D BCONS_MEM_START;<br>char* bc_color =3D (char*)=
BCONS_TEXT_WHITE;<br>int bc_pos =3D 0;;</p>
<p><br>void bc_cls(void)<br>{<br> unsigned int i =3D 0;<b=
r> bc_vidmem =3D BCONS_MEM_START;<br> w=
hile (i < BCONS_MAX_LOOP)<br> {<br> &=
nbsp; bc_vidmem[i] =3D ' ';<br> &n=
bsp; i++;<br> bc_vidm=
em[i] =3D BCONS_TEXT_WHITE;
<br> i++;<br> }=
<br> bc_pos =3D 0;<br> <br>}</p>
<p>void bc_pchar(char fmt)<br>{<br> bc_vidmem[bc_pos++] =
=3D fmt;<br> bc_vidmem[bc_pos++] =3D bc_color;<br>} =
</p>
<p>unsigned int bc_get_line_val(unsigned int line)<br>{<br> &nbs=
p; if (line > 25)<br> return;<=
br> return line*80*2;<br> <br>} &n=
bsp; </p>
<p>void bc_set_attrib(char* attrib)<br>{<br> bc_color =3D=
attrib;<br>} <br> <br>void bc_puts(char* fmt)<br>{<br> &n=
bsp; unsigned int i =3D bc_pos;<br> <br>  =
; while (*fmt)<br> {<br> &nb=
sp; if(*fmt=3D=3D'\n') {<br>  =
; i =3D bc_get_line_val(((i=
/80)/2)+1);
<br>  =
; *fmt++;<br> }=
<br> else {<br=
> bc_vidm=
em[i]=3D*fmt;<br> &nbs=
p; *fmt++;<br> &=
nbsp; i++;<br> &=
nbsp; bc_vidmem[i] =3D bc_color;<br> &nb=
sp; i++;<br> &nb=
sp; } <br> } =20
<br> bc_pos =3D i; <br>}</p>
<div><br>The definititions are in a header file. Alot of this was derived f=
rom tutorials and info on the <a href=3D"http://www.osdever.net/">http://ww=
w.osdever.net/</a> website. It's pretty basic but it used to work.&nbs=
p; </div>
<div> </div>
<div>Thanks for your help with this.</div>
<div>Matthew Petricone</div>
------=_Part_8687_2828274.1122929862053--
- Raw text -