Cite as
banjo.decomp/banjo-kazooie
Original
https://gitlab.com/banjo.decomp/banjo-kazooie
Pinned
banjo.decomp/banjo-kazooie @ e8d31fa53645616fcac6e051543222b973a2edb0
Accessed
2026-10-22
Licence
CC0 1.0 Universal (LICENSE), for the decompilers' own work; the game is Rare's and Nintendo's
Credit
The banjo.decomp team's matching C decompilation of Banjo-Kazooie, which builds US 1.0, US 1.1, Japanese, and PAL ROMs. Names and comments quoted in banjo-kazooie claims are theirs.
Notes
The project lives on GitLab; github.com/n64decomp/banjo-kazooie had the same HEAD on 2026-10-22. The README scores the decompilation at 100%, lists each baserom's SHA-1 (US 1.0 1fe1632098865f639e22c11b9a81ee8f29c75d7a), and builds US 1.0 by default (`VERSION=us.v11`, `jp`, or `pal` for the others); the build extracts assets from a copy of the ROM. The repo also holds tools, symbol and split files, and progress data; the atlas fetches only src/, include/, the README, and the license. Banjo's movement states are in src/core2/bs/ (jump.c, bFlap.c, bbuster.c, walk.c), his physics in src/core2/ba/physics.c, and the stick and buttons in src/core2/bastick.c, bakey.c, and bainput.c. Many helpers and variables are still unnamed (`func_802B6FA8`, `D_8037D4C0`). One version builds per `VERSION` define (include/version.h); claims read US 1.0.

Cited on

Claims (6)

Banjo-Kazooie keeps Banjo's speeds in world units per second and his gravity in units per second squared, scaled by each frame's time: __baphysics_update_normal adds the gravity times time_getDelta() to his vertical speed, then moves him by his velocity times that same time. The frame's time is a count from the video manager over 60 (50 on a PAL build): viMgr_entry adds 1 to D_802808D8 for each message on its queue, and each buffer swap copies the count to D_80280724 and zeroes it; the atlas reads the messages as vertical blanks, so the count as the blanks the frame took. func_8033DC20 turns the count into seconds and the caller back into a whole count, clamped to 1 to 15, then capped at 0.05 s in US 1.0 (0.06 s on PAL), so at most three sixtieths (computed); that is multiplied by a multiplier that time_reset sets to 1.src/core2/ba/physics.c L97–107src/core2/time.c L14–40src/core2/code_5C870.c L426src/core2/code_B6C60.c L22–26src/core1/vimgr.c L92–93src/core1/vimgr.c L180–188src/core1/vimgr.c L219–225src/core2/ba/physics.c L80–83include/version.h L34–48Code
A jump sets Banjo's vertical speed to 710 units/s (610 from water) and his gravity to −1350 units/s², half the usual −2700, and sets his horizontal speed at once to the target speed the stick gives on the ground (banjo-kazooie/walking-speed). On a frame of the jump with A up while he still rises, bsjump_update resets the gravity to −2700 for the rest of the jump; nothing sets −1350 again, and with A held the lighter gravity lasts past the peak. Until Banjo has learned the ability the code names ABILITY_A_HOLD_A_JUMP_HIGHER, it resets the gravity every frame. A jump entered from a peck sets neither the speed nor the gravity. A take-off from a spring pad sets a flag that skips the reset; the first frame with A up clears it after the check, so the reset starts the frame after. While that flag is set, the jump's second phase turns into the Shock Spring Jump's charge (BS_21_BSHOCK_CHARGE). Leaving the jump state for anything but a peck restores −2700. Computed without the frame steps, a held jump rises about 187 units in 0.53 s, and one released at once about 93. Super Mario 64 instead adds a quarter of the forward speed to its take-off (sm64/jump-speed) and divides the rise by 4 on each frame A is up while Mario rises faster than 20 units/frame (sm64/jump-release).src/core2/bs/jump.c L20–21src/core2/bs/jump.c L25src/core2/bs/jump.c L41src/core2/bs/jump.c L47–54src/core2/bs/jump.c L55src/core2/bs/jump.c L69–76src/core2/bs/jump.c L101–104src/core2/bs/jump.c L121–128src/core2/bs/jump.c L143–144src/core2/bs/jump.c L171–173src/core2/bakey.c L50–52src/core2/bakey.c L79–81src/core2/ba/physics.c L10–11src/core2/ba/physics.c L397–399src/core2/playerutils.c L67–68Code
With the Feathery Flap learned, A pressed during a jump or a fall starts it, once per time in the air: the flag it sets clears only on stable ground, while climbing, or in water, and a peck in the air blocks it. It stops Banjo's rise (vertical speed 0, gravity −1100 units/s²); when the opening animation reaches 0.9 of its length, it sets him rising at 280 units/s with his fall capped at −399.9, against the usual cap of −4000. A let go in the first 0.67 s of the flap, counted from its start through the opening animation by D_8037D308 (the atlas's reading of that unnamed variable as elapsed time), does nothing; after that, A up restores the usual gravity and cap. A 2.5-second timer ends the flap in any case. Once D_8037D301, which counts the frames the flap animation passes 0.9 of its length from the lift on (the atlas reads it as a loop count), reaches 4, holding A scales the target horizontal speed to 0.35 of what the stick gives. Super Mario 64's act_jump checks B and Z but not A; its second jump comes from a press during a landing (sm64/double-jump).src/core2/bainput.c L40–42src/core2/playerutils.c L53–56src/core2/code_D9B0.c L187–195src/core2/bs/jump.c L146–147src/core2/bs/jump.c L225–226src/core2/bs/bFlap.c L13–15src/core2/bs/bFlap.c L33–37src/core2/bs/bFlap.c L55–60src/core2/bs/bFlap.c L86–89src/core2/bs/bFlap.c L113–182src/core2/ba/physics.c L10–11Code
With the Beak Buster learned, Z pressed during a jump (or in the air in another state) starts it. Banjo stops dead: his velocity, his target horizontal speed, and his gravity all go to 0, and he hangs until the opening stretch of his animation stops and then one more frame. Then he pops up at 2300 units/s under a gravity of −20000 units/s², 7.4 times the usual −2700 (computed), with his fall capped at −5000 instead of −4000. Water ends the move at any phase. When he lands (stable ground, an unnamed flag BA_FLAG_8, or four frames in a row with under 1 unit of an unnamed vertical measure from func_8029445C), a landing with fall damage goes to a splat (BS_72_SPLAT); otherwise his speed and gravity go to 0 for 0.09 s; then he bounces up at 730 units/s under −2110, or at 400 under −800 if the Beak Buster hit an object whose marker id is 0x9E or 0xA1, which the hit kills. Super Mario 64's ground pound has no upward pop: Mario rises at most 110 units over 10 frames while he holds, then falls from −50 units/frame (sm64/ground-pound).src/core2/bainput.c L12–14src/core2/playerutils.c L27–28src/core2/bs/jump.c L152–153src/core2/bs/bbuster.c L9–17src/core2/bs/bbuster.c L64–78src/core2/bs/bbuster.c L98–113src/core2/bs/bbuster.c L128–148src/core2/bs/bbuster.c L152–154src/core2/bs/bbuster.c L195–196src/core2/bs/bbuster.c L163–171src/core2/bs/bbuster.c L209–210src/core2/ba/marker.c L273src/core2/ba/marker.c L313–317Code
On the ground the stick's tilt sets Banjo's target speed in five bands of the stick's distance from center, each axis clamped to a raw 7 to 59 (x) or 7 to 61 (y) and scaled to 0 to 1, and the distance capped at 1. Up to 0.12 the target is 0; above it the target rises linearly within each band: 30 to 80 units/s up to 0.2, 80 to 150 up to 0.5, 150 to 225 up to 0.75, and 225 to 500 at full tilt. The decompilers name the bands creep, slow walk, walk, and fast walk. On ground flagged BA_FLAG_13_TOUCHING_DANGEROUS_GROUND, the target is instead 30 to 150 by the distance itself, and 0 inside the 0.12 dead zone. Each frame the horizontal velocity closes the gap to the target by a fraction from a five-entry table (0, 0.07, 0.29, 0.15, 0.05) indexed by the unnamed D_8037C284 (the atlas reads the index as a movement state), unless func_8029CF48 has set an override for that index, which func_8029CED0 then returns instead, times the frame's time over 1/30 s; when an unnamed floor check (func_80294548) passes, the target is first scaled by the slope. Super Mario 64's target is 32 times the square of the tilt, and Mario gains a fixed 1.1 − speed/43 units/frame below it (sm64/walking-speed).src/core2/bs/walk.c L18–24src/core2/bs/walk.c L41–72src/core2/bastick.c L28–69src/core2/bastick.c L85–102src/core1/joy.c L51–72src/core1/joy.c L155–156src/core1/ml.c L705–707src/core2/playerutils.c L188–189src/core2/ba/physics.c L49–86src/core2/code_15F20.c L16–23src/core2/code_15F20.c L30–33src/core2/code_C4B0.c L440–441src/core2/commonParticle.c L77–83src/core2/commonParticle.c L97–98Code
In Super Mario Sunshine, by the decompilers' Player code, which doesn't yet match, FLUDD's hover nozzle holds Mario up through the status the code calls MARIO_STATUS_ROCKET. rocketCheck, which the jumps, the wall kick, standing, and running call, enters it, unless Mario is already in it or in MARIO_STATUS_ROCKET_LANDING, when he has FLUDD, the current nozzle's mRocketType parameter is 1, his upper body is in UPPER_STATE_PUMPING, and the nozzle is spraying (canSpray, a name a decompilers' comment calls fabricated), and sets a target height mHoverHeight (default 160) above him; standing or running, the callers set it above the floor instead. The status's entry code has a voice for the hover, rocket, and turbo nozzles, and the height-holding code in rocketing runs only for the hover. Each update rocketing sets his vertical speed to the gap to the target times the parameter mAccelRate (default 0.03) and multiplies his forward speed by mBrake (default 0.95), the stick adding forward speed or turning him, and then jumpProcess moves him a quarter of his velocity: with the defaults he closes 0.75% of the gap each update (computed), and any rise or fall he carried in is dropped at once. The hover is a trigger nozzle (TNozzleTrigger). While Mario pumps, and in water only with a full tank, each update adds 150 times R's analog reading to mInsidePressure, and every update takes away mInsidePressureDec (default 100); when the pressure passes mInsidePressureMax (default 4500) while the spray is idle and the nozzle's mRumbleOnCharge is false, the spray starts with a timer of mTriggerTime updates (with mRumbleOnCharge true, an A press with R held starts it instead). An empty tank sets the spray back to idle; the timer running out or the pumping stopping sets it to the state the code calls SPRAY_STATE_DEAD, which returns to idle only once R reads 0. Without a spray, rocketing ends in MARIO_STATUS_ROCKET_LANDING. On each update it sprays, each of the nozzle's emitters asks the water manager for drops, between mNumMin and mNum by the pressure, and the tank, which holds mAmountMax (default 2100), loses mDecRate for each drop accepted. Which nozzles have mRocketType 1, the timer, and the tank are data in each nozzle's file, NozzleTrgHover.prm for the hover. Banjo-Kazooie's Feathery Flap, a lift of 280 units/s and a fall capped at −399.9 units/s for up to 2.5 s, slows a fall where the hover holds a height (banjo-kazooie/feathery-flap).src/core2/bs/bFlap.c L13–15src/core2/bs/bFlap.c L126–128src/core2/bs/bFlap.c L180–181src/core2/bs/bFlap.c L33–37Code notes