AlgorithMan-de / wyoos

Source codes for the "Write your own Operating System" video-series on YouTube
http://wyoos.org
GNU General Public License v3.0
719 stars 222 forks source link

Using char (aka unsigned int8) with bitwise operations #12

Open purpl3F0x opened 5 years ago

purpl3F0x commented 5 years ago

https://github.com/AlgorithMan-de/wyoos/blob/22bf3f7df7ad8abdb4a49053428f0dd961fffd91/src/kernel.cpp#L53

Should be

VideoMemory[80*y + x] = (VideoMemory[80u*y + x] & 0xFF00u) | (uint8_t)str[i];

else you end up writing to the color addresses, on most characters with more than 127 as value