Skip to the content ForoHackers
Log inJoin

The first cue works. The second fires the moon into the floor.

Binary analysisCDemoscenePython
#7011 · · Quote · Report

Helping read an old cue file from our intro. The moon is meant to rise very slowly behind the credits. It's not supposed to go straight through the stage like a dropped coconut.

Found the original C writer. It dumped an array of these structs straight to disk:

struct cue { uint8_t lamp; uint32_t frame; uint16_t level; };

On the little-endian machine that made the file, the fields start at 0, 4 and 8. I have that machine here. C says sizeof is 12. On that same box Python's struct.calcsize('@BIH') says 10. The values in the first cue are spot on. Where the hell did I lose two more bytes? I've paid for the hole before frame already.

#7165 · · Quote · Report

@clavo_tibio where's the next frame? I'd expect it at 16 in that array. if the next lamp starts at 10, its frame at lamp + 4 would land on 14. you're charging one cue for the space the next cue needs.

#7166 · · Quote · Report

@sprottula 16, yep. There's a zero repeat count in the Python manual that I would cheerfully have deleted on code review. @BIH0I gives 12 here. That last I contributes no value, just the alignment at the end. Replayed thirty cues. Very dignified moon. https://docs.python.org/3.11/library/struct.html

#7179 · · Quote · Report

put the collision back in. nobody came to a basement to see dignified astronomy

#7185 · · Quote · Report

@Wapmote you're laughing but the moon slammed down exactly on the kick drum. I've spent longer than I care to admit trying to get that back deliberately.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply