arakiken / mlterm

Other
156 stars 13 forks source link

Stop hardcode alpha offset to 24 for 32-bpp fb. #22

Closed rokuyama closed 3 years ago

rokuyama commented 3 years ago

For NetBSD/aarch64eb and armeb, framebuffer seems byte-swapped to CPU, which was initially configured to little-endian mode by firmware and switched to big-endian mode by kernel. Therefore, ARGB8888 fb becomes BGRA8888, for example.

For Linux and FreeBSD, use alpha offset set by fb drivers. I cannot test them. Sorry.

For wscons on NetBSD, unfortunately, alpha offset and size are not set by (most?) fb drivers (they are 0). Therefore, we need to guess them from offsets and sizes of red, green, and blue.

arakiken commented 3 years ago

Thanks very much! Sorry for being late.

rokuyama commented 3 years ago

Thank you for merging the pull request!