this post was submitted on 17 Jun 2023
1 points (100.0% liked)

Programming Horror

2064 readers
28 users here now

Welcome to Programming Horror!

This is a place to share strange or terrible code you come across.

For more general memes about programming there's also Programmer Humor.

Looking for mods. If youre interested in moderating the community feel free to dm @[email protected]

Rules

Credits

founded 2 years ago
MODERATORS
 
top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 0 points 2 years ago (1 children)

Context please, what is this bit shifting shenanigans that im witnessing right now?

[โ€“] [email protected] 1 points 2 years ago

PA_ prefixed functions seem to be from palibds, which is a Nintendo DS homebrew development library.

DS being a constrained device it is logical that whoever wrote this code packed multiple byte-sized info into a bigger 16-bit short and using bit shifting to extract a specific byte