Claim set · data/claims/dkr.yaml

Diddy Kong Racing (the DavidSM64 decompilation, DavidSM64/Diddy-Kong-Racing)

Game: Diddy Kong Racing.

In the US 1.0 version of Diddy Kong Racing, a race, challenge, or time trial starts its countdown at 80, and once the HUD signals the start each update takes the update rate off it; "Get Ready" shows while it reads 2 or more. A racer's first fresh press of A after the countdown drops below 80 decides its start boost. A press while the countdown reads 29 to 15 sets a boost timer of 4 up to 11 as the reading falls, half of 24 less the reading's excess over 14, rounded down (computed), and a press while it reads 14 or less sets 20 with a select sound; holding Z also counts a reading of 15 as 20. A first press while it reads 30 to 79 gives no boost and spends the chance. A Master CPU driver takes the start boost a human set, or 5 if none did, and an Expert one copies a human's if there is one. In the car's ground routine, while the boost timer is above 0 after the countdown, the throttle is held open and the factor the code calls traction, unless it's 0, becomes 2.0. Mario Kart 64 instead takes a press of A that begins within 8 race frame counts of its window opening (20 in Time Trials), while the kart's THROTTLE flag isn't already set, and every such start gets the Mushroom's boost timer, 80. dkr/start-boost

About: Diddy Kong Racing Rocket start

Value
{
 "countdown": 80,
 "window-opens": 29,
 "best-from": 14,
 "best-boost": 20,
 "other-boosts": [
  4,
  11
 ],
 "forfeit-from": 79,
 "master-default": 5
}
CodeDiddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/objects.c#L1474-L1478if (raceType == RACETYPE_DEFAULT || raceType & RACETYPE_CHALLENGE || gIsTimeTrial || D_8011AD3C != 0) { gEventCountdown = 80; } else { gEventCountdown = 0;Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/objects.c#L2831-L2840gEventStartTimer = gEventCountdown; if (gEventCountdown > 0 && race_starting() != FALSE) { gEventCountdown -= updateRate; … if (gEventCountdown <= 0) { gEventCountdown = 0;Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L4143gRaceStartTimer = get_race_countdown();Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/game_ui.c#L805countdown = get_race_countdown() >> 1;Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/game_ui.c#L1901-L1904if (countdown > 0) { if (gHudRaceStart) { … hud_element_render(&gHudDL, &gHudMtx, &gHudVtx, &gCurrentHud->entry[HUD_RACE_START_READY]);Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L7465-L7499timer3 = get_race_start_timer(); … if (gRaceStartTimer > 0 && gRaceStartTimer < 30 && !racer->startInput) { timer = gRaceStartTimer - 14; if (gCurrentButtonsPressed & A_BUTTON) { if (timer < 0 && timer3 >= 0) { timer = 0; … if (gCurrentRacerInput & Z_TRIG) { if (timer < 2) { timer = 0; … …Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L7501-L7508// For the AI, expert AI will match the players start, and master AI will get a good start always. if (racer->playerIndex == PLAYER_COMPUTER && (racer->aiSkill == AI_MASTER || (racer->aiSkill == AI_EXPERT && gStartBoostTime))) { if (gStartBoostTime) { racer->boostTimer = gStartBoostTime; } else { racer->boostTimer = normalise_time(5);Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L7521-L7523if (gRaceStartTimer < 80 && gCurrentButtonsPressed & A_BUTTON) { racer->startInput = 1;Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/objects.c#L938-L944s32 normalise_time(s32 timer) { if (osTvType != OS_TV_TYPE_PAL || timer < 0) { return timer; } else { return (timer * 5) / 6;Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L5492-L5499// Force the throttle wide open if boosting if (racer->boostTimer > 0) { if (gRaceStartTimer == 0) { racer->throttle = 1.0f; if (traction != 0.0) { traction = 2.0f; } racer->boostTimer -= updateRate;mk64: a decompilation of Mario Kart 64 (n64decomp/mk64) · src/player_controller.c#L3669-L3685if (D_801656F0 == 1) { time_delta = gRaceFrameCounter - D_801652E0[playerIndex]; if (gModeSelection == TIME_TRIALS) { var_v0 = 0x14; } else { var_v0 = 8; … if ((time_delta < var_v0) && ((player->kartProps & THROTTLE) != THROTTLE)) { player->triggers |= START_BOOST_TRIGGER;mk64: a decompilation of Mario Kart 64 (n64decomp/mk64) · src/player_controller.c#L1112-L1120void func_8002A704(Player* player, s8 playerIndex) { player->effects |= MUSHROOM_EFFECT; player->triggers &= ~START_BOOST_TRIGGER; … player->boostTimer = 0x0050;Checked by claude, 2026-10-22 — read the countdown's set-up and its step in obj_update, which copies the old value into gEventStartTimer (what get_race_start_timer returns) before taking off the update rate and clamps at 0, so timer3 is never negative and every reading of 14 or less becomes 0; then handle_racer_top_speed whole, the HUD's Get Ready test, normalise_time, and the car ground routine's boost branch; for Mario Kart 64, the start window test and func_8002A704. No VERSION or REGION conditional in the cited ranges.

The press test runs before the line that sets startInput in the same call, so a press at 29 or below still counts. boostType (small below 20, medium at 20) picks the boost's look; the lines read don't use it for speed. The countdown counts the update rate, which fb_update (src/video.c) returns as the number of video messages since the last frame, capped at 6; the decompilers' comment calls the default 2 "LOGIC_30FPS". At 2 a step, readings are even, so seven updates (14 down to 2) give the best boost; that isn't measured. normalise_time scales the boost timers by 5/6 on a PAL console. Holding Z is the code's Z_TRIG in the held input, read as is.

Cited by: Diddy Kong Racing, Rocket start

In the US 1.0 version of Diddy Kong Racing, a weapon balloon's type is set by its entry in the track's object list, with no roll: the code names five types, boost, missile, trap, shield, and magnet, which the decompilers' names for the all-balloons cheats pair with blue, red, green, yellow, and rainbow. A racer that touches a balloon takes its type. If the racer already held the same type with any left, the weapon's level rises by one, up to the third (level 2); otherwise it starts at the first. In a challenge the level stops at the second, and trap balloons start there; the Maximum Power-up cheat makes every pickup third-level, and CPU-driven boss vehicles collect none. The weapon and its quantity come from a table the game loads as an asset, two bytes for each type and level, so they aren't in the repo. A CPU racer's driving routine func_80042D20 can also raise a first-level pickup by one, on a percent chance from the AI behavior table. Mario Kart 64 instead picks an item box's item in Grand Prix from a 100-slot row for the driver's place. dkr/weapon-balloons

About: Diddy Kong Racing Item distribution

Value
{
 "types": 5,
 "levels": 3,
 "challenge-levels": 2
}
CodeDiddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · include/enums.h#L120-L126typedef enum BalloonType { BALLOON_TYPE_BOOST, BALLOON_TYPE_MISSILE, BALLOON_TYPE_TRAP, BALLOON_TYPE_SHIELD, BALLOON_TYPE_MAGNETDiddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · include/level_object_entries.h#L193-L196typedef struct LevelObjectEntry_WeaponBalloon { … /* 0x09 */ u8 balloonType; Hint((Enum:BalloonType))Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/object_functions.c#L4658-L4667if (cheats & CHEAT_ALL_BALLOONS_ARE_BLUE) { entry->balloonType = BALLOON_TYPE_BOOST; } else if (cheats & CHEAT_ALL_BALLOONS_ARE_RED) { entry->balloonType = BALLOON_TYPE_MISSILE; } else if (cheats & CHEAT_ALL_BALLOONS_ARE_GREEN) { entry->balloonType = BALLOON_TYPE_TRAP; } else if (cheats & CHEAT_ALL_BALLOONS_ARE_YELLOW) { entry->balloonType = BALLOON_TYPE_SHIELD; } else if (cheats & CHEAT_ALL_BALLOONS_ARE_RAINBOW) { entry->balloonType = BALLOON_TYPE_MAGNET;Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/object_functions.c#L4679-L4680obj->modelIndex = entry->balloonType; obj->properties.weaponBalloon.balloonID = obj->modelIndex;Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/object_functions.c#L4745-L4775if (racer->vehicleID < VEHICLE_BOSSES || racer->playerIndex != PLAYER_COMPUTER) { prevBalloonType = racer->balloon_type; racer->balloon_type = weaponBalloonObj->properties.weaponBalloon.balloonID; if (prevBalloonType == racer->balloon_type && racer->balloon_quantity != 0) { racer->balloon_level++; } else { racer->balloon_level = 0; … if (level_type() & RACETYPE_CHALLENGE) { if (racer->balloon_level > 1) { racer->balloon_level = 1; … …Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L7009-L7010miscAsset = (s8 *) get_misc_asset(ASSET_MISC_BALLOON_DATA); weaponID = miscAsset[(racer->balloon_type * 10) + (racer->balloon_level * 2)];Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L327-L337sp38 = sp54->percentages[1][0] + (((sp54->percentages[1][1] - sp54->percentages[1][0]) * (7 - var_t5)) / 7); … if (racer->unk209 & 1) { if (racer->unk201 == 0) { if (racer->balloon_level == 0) { if (roll_percent_chance(sp38)) { racer->balloon_level++;Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L4303-L4304} else { racer_AI_pathing_inputs(obj, tempRacer, updateRate);Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/game.c#L750-L751gAIBehaviourTable = mempool_alloc_safe(temp, COLOUR_TAG_YELLOW); asset_load(ASSET_AI_BEHAVIOUR, (u32) gAIBehaviourTable, temp2, temp);mk64: a decompilation of Mario Kart 64 (n64decomp/mk64) · src/update_objects.c#L3687-L3696} else if (gModeSelection == BATTLE) { curve = segmented_to_virtual((void*) common_battle_item_curve); randomItem = curve[sRandomItemIndex]; } else { // GP Mode if (isCpu == 0) { curve = segmented_to_virtual((void*) common_grand_prix_human_item_curve); } else { curve = segmented_to_virtual((void*) common_grand_prix_cpu_item_curve); } randomItem = *((rank * 100) + curve + sRandomItemIndex);Checked by claude, 2026-10-22 — read obj_init_weaponballoon and obj_loop_weaponballoon whole, the balloon entry struct, the type enum, the weapon read in handle_racer_items, and func_80042D20's pickup branch, which racer_AI_pathing_inputs reaches through func_80045C48 outside challenges; for Mario Kart 64, gen_random_item's table pick. No VERSION or REGION conditional in the cited ranges.

unk209 & 1 is the flag the pickup sets and func_80042D20 clears. The percent chance interpolates between two values of the AI behavior table by var_t5, which counts the CPU racers ahead of this one; unk201 (a 30-count timer set elsewhere) must be 0. The same branch can, on another roll, change a CPU's balloon to the boost type when a human leads and fewer than three CPUs are ahead (L339-L342). The weapon enum names three Nitro, three magnet, and three shield levels, rockets, a homing rocket, a tripmine, an oil slick, and a bubble trap (src/racer.h#L84-L104); which type and level gives which weapon is in the asset table. A taken balloon regrows over 90 counts once the racer has moved 45 away.

Cited by: Diddy Kong Racing, Item distribution

In the US 1.0 version of Diddy Kong Racing, a car's power slide starts in its ground routine when R is held, the stick is past 15 either way, and the car is going forward faster than 3 (the code's velocity below -3). While R stays held the routine multiplies the top-speed value by 1.1. Letting go of R, or slowing to a velocity above -2, ends the slide and sets nothing else. During a slide the car update clamps the stick to 50 either way, quarters steering into the slide, and adds 60 toward it; holding the stick 26 or more against the slide adds the update rate to a count, and past 80 the car spins out and the slide ends. In an atlas search of src/, every write to the boost timer belongs to a zip pad, zipper, the start, a Nitro, a magnet, a plane trick, the loop-the-loop vehicle, or a boss, so a slide ends without a boost. Mario Kart 64 instead charges stages toward a mini-turbo while the stick counter-steers a drift. dkr/power-slide

About: Diddy Kong Racing Drift boost

Value
{
 "slide-top-speed": 1.1,
 "start-stick": 15,
 "counter-stick": 26,
 "spin-out-after": 80
}
CodeDiddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L5224-L5251// Decide which way to drift when the R button is held if (racer->drift_direction == 0 && gCurrentRacerInput & R_TRIG && racer->velocity < -3.0 && (gCurrentStickX > 15 || gCurrentStickX < -15)) { … // Disable drifting if going too slow if (racer->velocity > -2.0) { racer->drift_direction = 0; } // Get top speed value topSpeed = handle_racer_top_speed(obj, racer); // If currently drifting, apply a minor speed multiplier and tilt the natural steering towards the drift direction if (gCurrentRacerInput & R_TRIG && racer->drift_direction != 0) { …Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L5519racer->velocity -= traction * racer->throttle;Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L4751-L4785if (racer->drift_direction != 0) { if (racer->drift_direction < 0 && gCurrentStickX >= 26) { racer->unk16E += updateRate; … } else if (racer->drift_direction > 0 && gCurrentStickX <= -26) { racer->unk16E -= updateRate; … } else { racer->unk16E = 0; … if (spB8 > 80.0f) { racer_play_sound(racerObj, SOUND_CAR_BRAKE); …Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L4794-L4797if (racer->spinout_timer != 0) { racer_spinout_car(racerObj, racer, updateRate, updateRateF); } else if (racer->groundedWheels > 0) { update_player_car_velocity_ground(racerObj, racer, updateRate, updateRateF);mk64: a decompilation of Mario Kart 64 (n64decomp/mk64) · src/player_controller.c#L1148-L1160void update_drift_state_counter(Player* player, s8 playerIndex) { if (((s16) player->unk_0C0 / DEGREES(1)) > 0) { if (((s32) player->steerPosition >> 16) <= -10) { if (player->driftStateCounter <= 100) { player->driftStateCounter++; … if ((player->driftStateCounter >= 18) && (player->driftStateCounter < 100)) { if (player->driftState < 3) { player->driftState++;Checked by claude, 2026-10-22 — read the drift lines of update_player_car_velocity_ground and the slide branch of update_car that runs before it, then searched src/ and include/ for every assignment to boostTimer: object_functions.c L1020 (ground zipper); racer.c L1699, L1907, L2796, L2880, L5422, L6532 (zip pads and zippers), L2989 and L3009 (plane tricks), L3688 and L3692 (the loop-the-loop vehicle), L7094-L7104 (Nitro), L7360 (magnet), L7485-L7507 (the start); the boss vehicles' files; and resets to 0. For Mario Kart 64, update_drift_state_counter. No VERSION or REGION conditional in the cited ranges.

Forward is negative in the car's velocity: the throttle subtracts from it (L5519). The counter-steer count resets when the stick isn't held against the slide, so the 80 must be unbroken. The hovercraft and plane routines set drift_direction in their own code, not read here. racer_spinout_car is the decompilers' name.

Cited by: Diddy Kong Racing, Drift boost

In the US 1.0 version of Diddy Kong Racing, a zip-pad surface sets a racer's boost timer to 45 when it's at 0, in the car, hovercraft, and plane routines alike, and a ground zipper object sets 45 for a grounded racer within its radius whenever the timer is below 15. A Nitro sets 35, 55, or 75 at its first, second, and third level. In the car's ground routine, while the timer is above 0 after the countdown, the throttle is held open and the factor the code calls traction, unless it's 0, becomes 2.0. dkr/zip-pads

About: Diddy Kong Racing Boost pad

Value
{
 "zip-pad": 45,
 "zipper-refresh-below": 15,
 "nitro": [
  35,
  55,
  75
 ]
}
CodeDiddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L5420-L5422// If driving over a zip pad, apply a boost. if (racer->boostTimer == 0 && surfaceType == SURFACE_ZIP_PAD) { racer->boostTimer = normalise_time(45);Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L4400-L4411switch (tempRacer->vehicleID) { case VEHICLE_CAR: update_car(updateRate, updateRateF, obj, tempRacer); … case VEHICLE_HOVERCRAFT: func_80046524(updateRate, updateRateF, obj, tempRacer); break; case VEHICLE_PLANE: func_80049794(updateRate, updateRateF, obj, tempRacer);Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L1906-L1907if ((racer->boostTimer == 0) && (lastWheelSurface == 3)) { racer->boostTimer = normalise_time(45);Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · include/enums.h#L152-L156typedef enum SurfaceType { SURFACE_DEFAULT, SURFACE_GRASS, SURFACE_SAND, SURFACE_ZIP_PAD,Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L2795-L2796if (racer->boostTimer == 0 && i == SURFACE_ZIP_PAD) { racer->boostTimer = normalise_time(45);Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/object_functions.c#L1011-L1020if (racer->boostTimer < 15 && racer->groundedWheels) { … if ((s32) sqrtf((diffX * diffX) + (diffY * diffY) + (diffZ * diffZ)) < obj->properties.zipper.radius) { … racer->boostTimer = normalise_time(45);Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L7092-L7104case WEAPON_NITRO_LEVEL_3: … racer->boostTimer = normalise_time(75); \ … case WEAPON_NITRO_LEVEL_2: … racer->boostTimer = normalise_time(55); \ … default: … racer->boostTimer = normalise_time(35); \Diddy-Kong-Racing: a decompilation of Diddy Kong Racing (DavidSM64/Diddy-Kong-Racing) · src/racer.c#L5492-L5499// Force the throttle wide open if boosting if (racer->boostTimer > 0) { if (gRaceStartTimer == 0) { racer->throttle = 1.0f; if (traction != 0.0) { traction = 2.0f; } racer->boostTimer -= updateRate;Checked by claude, 2026-10-22 — read the zip-pad tests in update_player_car_velocity_ground, func_80046524 (the hovercraft, by the vehicle switch; its surface test compares 3, SURFACE_ZIP_PAD's place in the enum), and func_80049794 (the plane); obj_loop_groundzipper; the Nitro cases of handle_racer_items, whose default arm takes level 1; and the car's boost branch. No VERSION or REGION conditional in the cited ranges.

The timer loses the update rate each update (src/racer.c#L5499), so at 2 a step, the rate the decompilers' comment calls the default, a zip pad lasts 23 updates (computed, not measured). normalise_time scales 45 to 37 on a PAL console. Releasing A before a boost sets an "empowered" flag in boostType (throttleReleased); the lines read use it to pick the boost's look, and its effect on speed isn't traced. The hovercraft also takes a boost from zipper objects on water (L1685-L1702), and the AI car routine has its own zip-pad test (L6531-L6533).

Cited by: Boost pad, Diddy Kong Racing