this post was submitted on 10 Jun 2026
86 points (98.9% liked)
Programmer Humor
31765 readers
836 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
He is streaming data to the joypad faster than my internet connection
If he's on the actual hardware, the CPU frequencies are between 4.19 MHz~8.38 MHz. Not sure how that translates into joypad I/O speeds, but still cool.
On old consoles, inputs are usually directly memory-mapped, so you can use them as fast as the cpu can read them. If inputs are crammed into bytes (which is also usual), you can probably create one custom byte per cpu operation via controller inputs, and copy it into ram for example.
If there are say 4 controllers, sitting next to each other, you can probably use an instruction that copies a 32 bit value, and copy 4 bytes to ram. If that copy takes 3 cycles (and the cpu has no fancy modern prediction), that would be 11 MB/s or 90mbit/s, modern lower-midrange internet speeds.
notyetEdit:
https://bgb.bircd.org/pandocs.htm#joypadinput
This info here seems to state we can only read 4 of the 8 buttons of gameboy controllers at a time, not 8. Also we might have to poll them and wait. Assuming the waiting is only for physical button debouncing reasons and not needed when you pump electric signals into a controller or mechanically operate it very rigidly, and assuming we can select one half and just keep reading, and taking the 4 controllers it mwntions in the text, that leaves 45mbit. The data might have to be densified after writing, or there might be instructions that can do it in-flight without soowing the operation.
actualEdit:
Plain GB only has 1 controller, and the cpu only has 4.194304 (later fancier GBs had a mode to double that). Having only 1 controller doesn't really make it worse anyway, because the cpu is 8 bit with some limited 16 bit functionality. The insteuction to read from io memory and copy to ram, F2, takes 8 cycles. So I think that means we can do at most 2mbit/s, potentially less depending on how the assembly can be coded up. Definitely upper "the internet doesn't work" speed territory.
Thank you! The day I can give somebody an answer on this level will be the day that I am content with life.