delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/08/01/16:58:32

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references;
b=NrnrfJ2XeKTFYwWicF2jlf/TGOMSPQUmqPnN1BBr+631NLddPucA3hWlXl15r6Rne7zS93smwX9eY1t7VCkl9vtFxwV9vTLTy2xxo5KnwmHIXeEpcDkvGjnKKzpOxAzmZfRA5wnl4vuTpwJTvAAjArDGTQ5CNu2hYbIMMb4XNic=
Message-ID: <2497d9a2050801135729e70314@mail.gmail.com>
Date: Mon, 1 Aug 2005 16:57:42 -0400
From: Matthew Petricone <strstream AT gmail DOT com>
To: djgpp AT delorie DOT com
Subject: Re: Problems writing to video memory
In-Reply-To: <3l6fnlF1102lqU1@news.dfncis.de>
Mime-Version: 1.0
References: <2497d9a20507311923652c1344 AT mail DOT gmail DOT com>
<3l6fnlF1102lqU1 AT news DOT dfncis DOT de>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

------=_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> &lt;<a href=3D"mailto:broeker AT phy=
sik.rwth-aachen.de">broeker AT physik DOT rwth-aachen DOT de</a>&gt; 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 &lt;<a href=3D=
"mailto:strstream AT gmail DOT com">strstream AT gmail DOT com</a>&gt; wrote:<br>&gt; [--=
 text/plain, encoding quoted-printable, charset: ISO-8859-1, 10 lines --]
<br><br>&gt; 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>&gt; Whenever i attemp to write to video memory directly in the 0=
xb8000
<br>&gt; 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>&nbsp;</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>&nbsp;</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>&nbsp;&nbsp;&nbsp; unsigned int i =3D 0;<b=
r>&nbsp;&nbsp;&nbsp; bc_vidmem =3D BCONS_MEM_START;<br>&nbsp;&nbsp;&nbsp; w=
hile (i &lt; BCONS_MAX_LOOP)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp; bc_vidmem[i] =3D ' ';<br>&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; i++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bc_vidm=
em[i] =3D BCONS_TEXT_WHITE;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i++;<br>&nbsp;&nbsp;&nbsp; }=
<br>&nbsp;&nbsp;&nbsp; bc_pos =3D 0;<br>&nbsp;&nbsp;&nbsp; <br>}</p>
<p>void bc_pchar(char fmt)<br>{<br>&nbsp;&nbsp;&nbsp; bc_vidmem[bc_pos++] =
=3D fmt;<br>&nbsp;&nbsp;&nbsp; bc_vidmem[bc_pos++] =3D bc_color;<br>}&nbsp;=
&nbsp;&nbsp; </p>
<p>unsigned int bc_get_line_val(unsigned int line)<br>{<br>&nbsp;&nbsp;&nbs=
p; if (line &gt; 25)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<=
br>&nbsp;&nbsp;&nbsp; return line*80*2;<br>&nbsp;&nbsp;&nbsp; <br>}&nbsp;&n=
bsp;&nbsp; </p>
<p>void bc_set_attrib(char* attrib)<br>{<br>&nbsp;&nbsp;&nbsp; bc_color =3D=
 attrib;<br>} <br>&nbsp; <br>void bc_puts(char* fmt)<br>{<br>&nbsp;&nbsp;&n=
bsp; unsigned int i =3D bc_pos;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp=
; while (*fmt)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; if(*fmt=3D=3D'\n') {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i =3D bc_get_line_val(((i=
/80)/2)+1);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; *fmt++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }=
&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else {<br=
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bc_vidm=
em[i]=3D*fmt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; *fmt++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; i++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; bc_vidmem[i] =3D bc_color;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; }&nbsp; <br>&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;=20
<br>&nbsp;&nbsp;&nbsp; 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>&nbsp;website. It's pretty basic but it used to work.&nbs=
p; </div>

<div>&nbsp;</div>
<div>Thanks for your help with this.</div>
<div>Matthew Petricone</div>

------=_Part_8687_2828274.1122929862053--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019