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 To: djgpp AT delorie DOT com Subject: Re: Problems writing to video memory In-Reply-To: <3l6fnlF1102lqU1@news.dfncis.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8687_2828274.1122929862053" 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 Precedence: bulk ------=_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 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

On 1 Aug 2005 11:35:17 GMT, Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote:
Matthew Petricone <strstream AT gmail DOT com> wrote:
> [--= text/plain, encoding quoted-printable, charset: ISO-8859-1, 10 lines --]

> Since updating to a the latest version of djgpp

From wh= at version were you coming, and to which one did you upgrade?
On which O= S?

> Whenever i attemp to write to video memory directly in the 0= xb8000
> range.

And how, exactly, do you attempt that?

--
= Hans-Bernhard Broeker (bro= eker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes w= ould remain.
 
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.
 

#define BCONS_MEM_START (char*) 0xb8000
// 80*25*2 (80 chars * 25 lin= es, 2 bytes per line)
#define BCONS_MAX_LOOP 0xfa0

// Text Colors
#define BCONS_TEXT_WHITE 0x07
#define BCONS_TEXT_BO= OT 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;
    w= hile (i < BCONS_MAX_LOOP)
    {
   &= nbsp;    bc_vidmem[i] =3D ' ';
    &n= bsp;   i++;
        bc_vidm= em[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;
} =   

unsigned int bc_get_line_val(unsigned int line)
{
  &nbs= p; if (line > 25)
        return;<= br>    return line*80*2;
   
} &n= bsp; 

void bc_set_attrib(char* attrib)
{
    bc_color =3D= attrib;
}
 
void bc_puts(char* fmt)
{
  &n= bsp; unsigned int i =3D bc_pos;
   
   = ; while (*fmt)
    {
     &nb= sp;  if(*fmt=3D=3D'\n') {
       = ;         i =3D bc_get_line_val(((i= /80)/2)+1);
            = ;    *fmt++;
        }=    
        else {            bc_vidm= em[i]=3D*fmt;
         &nbs= p;  *fmt++;
         &= nbsp;  i++;
         &= nbsp;  bc_vidmem[i] =3D bc_color;
     &nb= sp;      i++;
     &nb= sp;  } 
    }   =20
    bc_pos =3D i;
}


The definititions are in a header file. Alot of this was derived f= rom tutorials and info on the http://ww= w.osdever.net/ website. It's pretty basic but it used to work.&nbs= p;
 
Thanks for your help with this.
Matthew Petricone
------=_Part_8687_2828274.1122929862053--