Mail Archives: djgpp/2005/08/02/12:31:35
Matthew Petricone <strstream AT gmail DOT com> 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.
- Raw text -