I created a VGA driver that I use with my C code that is based on VGA_640_x_480_8bpp.spin2, and I ran into a problem with it. In my driver I removed the BMP file that was included with the file, and I use a separate screen buffer at a different location in memory instead. With this change the last two lines of the driver are:
x res 1
y res 1
x and y are used to copy the color palette to the LUT memory. The code assumes that x has a value of zero initially. Of course, when you use res
you can't guarantee the value of the memory location, so in my code the colors in the LUT memory were offset by some unknown value. I replaced the "res 1
" by "long 0
" to fix the problem.
BTW, the original code works OK because there is an ORGH after x and y are defined, which causes lots of padding zeroes to be inserted.