gbdev / rgbds

Rednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color
https://rgbds.gbdev.io
MIT License
1.35k stars 172 forks source link

GB graphic prefix bug #87

Closed ghost closed 8 years ago

ghost commented 8 years ago

When you define a GB graphic constant, like DW `00133100 the resulting two bytes of planar data seem to get stored in the wrong order. It should store the least significant bits first and the most significant ones after them.

Currently DW `00133100 results in $18 $3C being stored instead of $3C $18.

Due to this bug, all pixels with ligh-gray or dark-gray shades get swapped.

AntonioND commented 8 years ago

I'll try to take a look at it this weekend, but at least I've looked for the location of the bug if someone wants to do it before: https://github.com/bentley/rgbds/blob/master/src/asm/globlex.c#L83

Probably just swapping the 2 bits in here could do the trick: https://github.com/bentley/rgbds/blob/master/src/asm/globlex.c#L100

bentley commented 8 years ago

@AntonioND fixed this in fbb825af3b5ee5c24d4633e06320759bc1d08179.