add comment

This commit is contained in:
toxieainc 2022-07-18 21:43:13 +02:00
parent dda48d7606
commit 27e071dafb

View file

@ -333,7 +333,7 @@ static inline void DrawTileLine(uint32_t *line, int pixelOffset, uint16_t tile,
uint32_t pattern = vram[patternOffset + patternLine]; uint32_t pattern = vram[patternOffset + patternLine];
for (int p = 7; p >= 0; p--) for (int p = 7; p >= 0; p--)
{ {
if (!clip || (/*pixelOffset >= 0 &&*/ (unsigned int)pixelOffset < 496u)) if (!clip || (/*pixelOffset >= 0 &&*/ (unsigned int)pixelOffset < 496u)) // the >= 0 check is accounted for, as the cast to uint makes them appear as very large unsigned values
{ {
uint16_t maskTest = 1 << (15-((pixelOffset+0)/32)); uint16_t maskTest = 1 << (15-((pixelOffset+0)/32));
bool visible = (mask & maskTest) != 0; bool visible = (mask & maskTest) != 0;
@ -351,7 +351,7 @@ static inline void DrawTileLine(uint32_t *line, int pixelOffset, uint16_t tile,
uint32_t pattern = vram[patternOffset + patternLine + i]; uint32_t pattern = vram[patternOffset + patternLine + i];
for (int p = 3; p >= 0; p--) for (int p = 3; p >= 0; p--)
{ {
if (!clip || (/*pixelOffset >= 0 &&*/ (unsigned int)pixelOffset < 496u)) if (!clip || (/*pixelOffset >= 0 &&*/ (unsigned int)pixelOffset < 496u)) // the >= 0 check is accounted for, as the cast to uint makes them appear as very large unsigned values
{ {
uint16_t maskTest = 1 << (15-((pixelOffset+0)/32)); uint16_t maskTest = 1 << (15-((pixelOffset+0)/32));
bool visible = (mask & maskTest) != 0; bool visible = (mask & maskTest) != 0;