X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Problems writing to video memory Date: 2 Aug 2005 10:42:29 GMT Lines: 57 Message-ID: <3l910lF11ls9vU1@news.dfncis.de> References: <2497d9a20507311923652c1344 AT mail DOT gmail DOT com> <3l6fnlF1102lqU1 AT news DOT dfncis DOT de> <2497d9a2050801135729e70314 AT mail DOT gmail DOT com> X-Trace: news.dfncis.de HgDLejzjxpC0uglTcf6eXQFi6/Nmn3Qd8AFzKGF7eM5ojlFSshO3bPgQcX X-Orig-Path: not-for-mail To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Matthew Petricone wrote: > > > My HD crashed and i don't remember which version of djgpp i had (stupid i > know) but it was most likely 2.9 something or early 3 None of those are DJGPP versions. They're GCC version numbers. Your DJGPP, if you had this working on XP before, must have been 2.03 refresh 2, or the 2.04 development version. > #define BCONS_MEM_START (char*) 0xb8000 > #define BCONS_MAX_LOOP 0xfa0 > #define BCONS_TEXT_WHITE 0x07 > #define BCONS_TEXT_BOOT 0x2f > const char* bc_vidmem = BCONS_MEM_START; You almost certainly don't want this 'const'. If at all, it might make sense to have it char * const bc_vidmem = BCONS_MEM_START; to indicate that the pointer is constant, not what it points to. > char* bc_color = (char*) BCONS_TEXT_WHITE; Why on earth would you store a colour as a pointer? If this ever worked, that was by pure happenstance. > void bc_cls(void) > { > unsigned int i = 0; > bc_vidmem = BCONS_MEM_START; If you made the pointer 'const' above, then you should not, and cannot re-assign it here. > while (i < BCONS_MAX_LOOP) > { > bc_vidmem[i] = ' '; At this point, you're writing through a pointer that was declared to point to const chars, i.e. you're doing something that's explicitly forbidden by the language. This cannot ever have worked. I seriously doubt this is the same source code that used to compile with GCC-2.95. GCC-4 is pickier than previous editions used to be, but not even the ancient gcc-2.5 was *that* careless, IIRC. > i++; > bc_vidmem[i] = BCONS_TEXT_WHITE; This is even worse. Now you're trying to store a pointer into a char variable. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.