A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Kinoko Namespace Reference

Namespaces

namespace  Abstract
 An abstraction of components from the nw4r and RVL libraries.
namespace  EGG
 EGG core library.
namespace  Field
 Pertains to collision.
namespace  Host
 Represents the host application.
namespace  Item
 Pertains to item handling.
namespace  Kart
 Pertains to kart-related functionality.
namespace  Render
 Pertains to rendering the kart model.
namespace  Scene
 Pertains to scene handling.
namespace  System
 High-level handling for generic system operations, such as input reading, race configuration, and resource management.

Concepts

concept  IntegralType
concept  ParseableType

Classes

class  fixed_vector
 Dynamically sized array that only allocates once. More...
struct  is_derived_from_template
 Helper template which uses function overloading and implicit up-casting to determine whether or not a class is derived from a templated base class (i.e. MapdataPointInfoAccessor derives from MapdataAccessorBase). See: https://en.cppreference.com/w/cpp/language/sfinae. More...
class  KReplaySystem
 Kinoko system designed to execute replays. More...
class  KSystem
 Base interface for a Kinoko system. More...
class  KTestSystem
 Kinoko system designed to execute tests. More...
class  owning_span
 A contiguous storage container that manages the lifecycle of a buffer of a given size. More...
class  ScopeLock
class  ScopeLock< GroupID >
struct  TestHeader

Typedefs

typedef int8_t s8
typedef int16_t s16
typedef int32_t s32
typedef int64_t s64
typedef uint8_t u8
typedef uint16_t u16
typedef uint32_t u32
typedef uint64_t u64
typedef float f32
typedef double f64

Enumerations

enum  Changelog {
  Initial = 1 ,
  AddedExtVel = 2 ,
  AddedIntVel = 3 ,
  AddedSpeed = 4 ,
  AddedRotation = 5 ,
  AddedCheckpoints = 6
}
enum class  Course {
  Mario_Circuit = 0 ,
  Moo_Moo_Meadows = 1 ,
  Mushroom_Gorge = 2 ,
  Grumble_Volcano = 3 ,
  Toads_Factory = 4 ,
  Coconut_Mall = 5 ,
  DK_Summit = 6 ,
  Wario_Gold_Mine = 7 ,
  Luigi_Circuit = 8 ,
  Daisy_Circuit = 9 ,
  Moonview_Highway = 10 ,
  Maple_Treeway = 11 ,
  Bowsers_Castle = 12 ,
  Rainbow_Road = 13 ,
  Dry_Dry_Ruins = 14 ,
  Koopa_Cape = 15 ,
  GCN_Peach_Beach = 16 ,
  GCN_Mario_Circuit = 17 ,
  GCN_Waluigi_Stadium = 18 ,
  GCN_DK_Mountain = 19 ,
  DS_Yoshi_Falls = 20 ,
  DS_Desert_Hills = 21 ,
  DS_Peach_Gardens = 22 ,
  DS_Delfino_Square = 23 ,
  SNES_Mario_Circuit_3 = 24 ,
  SNES_Ghost_Valley_2 = 25 ,
  N64_Mario_Raceway = 26 ,
  N64_Sherbet_Land = 27 ,
  N64_Bowsers_Castle = 28 ,
  N64_DKs_Jungle_Parkway = 29 ,
  GBA_Bowser_Castle_3 = 30 ,
  GBA_Shy_Guy_Beach = 31 ,
  Delfino_Pier = 32 ,
  Block_Plaza = 33 ,
  Chain_Chomp_Roulette = 34 ,
  Funky_Stadium = 35 ,
  Thwomp_Desert = 36 ,
  GCN_Cookie_Land = 37 ,
  DS_Twilight_House = 38 ,
  SNES_Battle_Course_4 = 39 ,
  GBA_Battle_Course_3 = 40 ,
  N64_Skyscraper = 41 ,
  Galaxy_Colosseum = 54 ,
  Win_Demo = 55 ,
  Lose_Demo = 56 ,
  Draw_Demo = 57 ,
  Ending_Demo = 58
}
enum class  Vehicle {
  Standard_Kart_S = 0 ,
  Standard_Kart_M = 1 ,
  Standard_Kart_L = 2 ,
  Baby_Booster = 3 ,
  Classic_Dragster = 4 ,
  Offroader = 5 ,
  Mini_Beast = 6 ,
  Wild_Wing = 7 ,
  Flame_Flyer = 8 ,
  Cheep_Charger = 9 ,
  Super_Blooper = 10 ,
  Piranha_Prowler = 11 ,
  Tiny_Titan = 12 ,
  Daytripper = 13 ,
  Jetsetter = 14 ,
  Blue_Falcon = 15 ,
  Sprinter = 16 ,
  Honeycoupe = 17 ,
  Standard_Bike_S = 18 ,
  Standard_Bike_M = 19 ,
  Standard_Bike_L = 20 ,
  Bullet_Bike = 21 ,
  Mach_Bike = 22 ,
  Flame_Runner = 23 ,
  Bit_Bike = 24 ,
  Sugarscoot = 25 ,
  Wario_Bike = 26 ,
  Quacker = 27 ,
  Zip_Zip = 28 ,
  Shooting_Star = 29 ,
  Magikruiser = 30 ,
  Sneakster = 31 ,
  Spear = 32 ,
  Jet_Bubble = 33 ,
  Dolphin_Dasher = 34 ,
  Phantom = 35 ,
  Max = 36
}
enum class  Character {
  Mario = 0 ,
  Baby_Peach = 1 ,
  Waluigi = 2 ,
  Bowser = 3 ,
  Baby_Daisy = 4 ,
  Dry_Bones = 5 ,
  Baby_Mario = 6 ,
  Luigi = 7 ,
  Toad = 8 ,
  Donkey_Kong = 9 ,
  Yoshi = 10 ,
  Wario = 11 ,
  Baby_Luigi = 12 ,
  Toadette = 13 ,
  Koopa_Troopa = 14 ,
  Daisy = 15 ,
  Peach = 16 ,
  Birdo = 17 ,
  Diddy_Kong = 18 ,
  King_Boo = 19 ,
  Bowser_Jr = 20 ,
  Dry_Bowser = 21 ,
  Funky_Kong = 22 ,
  Rosalina = 23 ,
  Small_Mii_Outfit_A_Male = 24 ,
  Small_Mii_Outfit_A_Female = 25 ,
  Small_Mii_Outfit_B_Male = 26 ,
  Small_Mii_Outfit_B_Female = 27 ,
  Small_Mii_Outfit_C_Male = 28 ,
  Small_Mii_Outfit_C_Female = 29 ,
  Medium_Mii_Outfit_A_Male = 30 ,
  Medium_Mii_Outfit_A_Female = 31 ,
  Medium_Mii_Outfit_B_Male = 32 ,
  Medium_Mii_Outfit_B_Female = 33 ,
  Medium_Mii_Outfit_C_Male = 34 ,
  Medium_Mii_Outfit_C_Female = 35 ,
  Large_Mii_Outfit_A_Male = 36 ,
  Large_Mii_Outfit_A_Female = 37 ,
  Large_Mii_Outfit_B_Male = 38 ,
  Large_Mii_Outfit_B_Female = 39 ,
  Large_Mii_Outfit_C_Male = 40 ,
  Large_Mii_Outfit_C_Female = 41 ,
  Medium_Mii = 42 ,
  Small_Mii = 43 ,
  Large_Mii = 44 ,
  Peach_Biker_Outfit = 45 ,
  Daisy_Biker_Outfit = 46 ,
  Rosalina_Biker_Outfit = 47 ,
  Max = 48
}
enum class  WeightClass {
  Invalid = -1 ,
  Light = 0 ,
  Medium = 1 ,
  Heavy = 2
}
enum class  GroupID : u16 {
  None = 0 ,
  Race = 1 ,
  Gfx = 2 ,
  Kart = 3 ,
  Object = 4 ,
  Course = 5 ,
  UI = 6 ,
  Effect = 7 ,
  Sound = 8 ,
  Resource = 10 ,
  HomeMenu = 11 ,
  Item = 12 ,
  Net = 13
}

Functions

static uintptr_t GetAddrNum (const void *p)
static void * GetAddrPtr (uintptr_t n)
static void * AddOffset (const void *p, size_t offset)
static void * SubOffset (const void *p, size_t offset)
static uintptr_t RoundUp (uintptr_t value, uintptr_t alignment)
static void * RoundUp (void *ptr, uintptr_t alignment)
static uintptr_t RoundDown (uintptr_t value, uintptr_t alignment)
static void * RoundDown (void *ptr, uintptr_t alignment)
static constexpr WeightClass CharacterToWeight (Character character)
static constexpr WeightClass VehicleToWeight (Vehicle vehicle)
template<IntegralType T>
static T form (const u8 *data)
template<ParseableType T>
static constexpr T parse (T val, std::endian endian=std::endian::big)
static constexpr u32 f2u (f32 val)

Variables

static constexpr f32 F_PI = 3.1415927f
 Floating point representation of pi.
static constexpr f32 F_TAU = 6.2831855f
 Floating point representation of tau/2pi.
static constexpr f32 DEG2RAD = 0.017453292f
 F_PI / 180.0f. Double precision and casted down.
static constexpr f32 DEG2RAD360 = 0.034906585f
 F_PI / 360.0f. Double precision, casted down.
static constexpr f32 RAD2DEG = 57.2957795f
 180.0f / F_PI. Double precision and casted down.
static constexpr f32 DEG2FIDX = 256.0f / 360.0f
 Degrees to fixed index.
static constexpr f32 RAD2FIDX = 128.0f / F_PI
 Radians to fixed index.
static constexpr f32 FIDX2RAD = F_PI / 128.0f
 Fixed index to radians.
static constexpr f32 HALF_PI = F_PI / 2.0f
static constexpr const char * COURSE_NAMES [59]
static constexpr const char * VEHICLE_NAMES [36]
template<template< typename... > class Base, typename Derived>
constexpr bool is_derived_from_template_v = is_derived_from_template<Base, Derived>::value
static constexpr size_t MEMORY_SPACE_SIZE = 0x1000000
static constexpr auto DEFAULT_OPT = Abstract::Memory::MEMiHeapHead::OptFlag()

Typedef Documentation

◆ s8

typedef int8_t s8

Definition at line 11 of file Memory.hh.

◆ s16

typedef int16_t s16

Definition at line 12 of file Memory.hh.

◆ s32

typedef int32_t s32

Definition at line 13 of file Memory.hh.

◆ s64

typedef int64_t s64

Definition at line 14 of file Memory.hh.

◆ u8

typedef uint8_t u8

Definition at line 16 of file Memory.hh.

◆ u16

typedef uint16_t u16

Definition at line 17 of file Memory.hh.

◆ u32

typedef uint32_t u32

Definition at line 18 of file Memory.hh.

◆ u64

typedef uint64_t u64

Definition at line 19 of file Memory.hh.

◆ f32

typedef float f32

Definition at line 21 of file Memory.hh.

◆ f64

typedef double f64

Definition at line 22 of file Memory.hh.

Enumeration Type Documentation

◆ Changelog

enum Changelog
Enumerator
Initial 1 
AddedExtVel 2 
AddedIntVel 3 
AddedSpeed 4 
AddedRotation 5 
AddedCheckpoints 6 

Definition at line 16 of file KTestSystem.cc.

◆ Course

enum class Course
strong
Enumerator
Mario_Circuit 0 
Moo_Moo_Meadows 1 
Mushroom_Gorge 2 
Grumble_Volcano 3 
Toads_Factory 4 
Coconut_Mall 5 
DK_Summit 6 
Wario_Gold_Mine 7 
Luigi_Circuit 8 
Daisy_Circuit 9 
Moonview_Highway 10 
Maple_Treeway 11 
Bowsers_Castle 12 
Rainbow_Road 13 
Dry_Dry_Ruins 14 
Koopa_Cape 15 
GCN_Peach_Beach 16 
GCN_Mario_Circuit 17 
GCN_Waluigi_Stadium 18 
GCN_DK_Mountain 19 
DS_Yoshi_Falls 20 
DS_Desert_Hills 21 
DS_Peach_Gardens 22 
DS_Delfino_Square 23 
SNES_Mario_Circuit_3 24 
SNES_Ghost_Valley_2 25 
N64_Mario_Raceway 26 
N64_Sherbet_Land 27 
N64_Bowsers_Castle 28 
N64_DKs_Jungle_Parkway 29 
GBA_Bowser_Castle_3 30 
GBA_Shy_Guy_Beach 31 
Delfino_Pier 32 
Block_Plaza 33 
Chain_Chomp_Roulette 34 
Funky_Stadium 35 
Thwomp_Desert 36 
GCN_Cookie_Land 37 
DS_Twilight_House 38 
SNES_Battle_Course_4 39 
GBA_Battle_Course_3 40 
N64_Skyscraper 41 
Galaxy_Colosseum 54 
Win_Demo 55 
Lose_Demo 56 
Draw_Demo 57 
Ending_Demo 58 

Definition at line 16 of file Common.hh.

◆ Vehicle

enum class Vehicle
strong
Enumerator
Standard_Kart_S 0 
Standard_Kart_M 1 
Standard_Kart_L 2 
Baby_Booster 3 
Classic_Dragster 4 
Offroader 5 
Mini_Beast 6 
Wild_Wing 7 
Flame_Flyer 8 
Cheep_Charger 9 
Super_Blooper 10 
Piranha_Prowler 11 
Tiny_Titan 12 
Daytripper 13 
Jetsetter 14 
Blue_Falcon 15 
Sprinter 16 
Honeycoupe 17 
Standard_Bike_S 18 
Standard_Bike_M 19 
Standard_Bike_L 20 
Bullet_Bike 21 
Mach_Bike 22 
Flame_Runner 23 
Bit_Bike 24 
Sugarscoot 25 
Wario_Bike 26 
Quacker 27 
Zip_Zip 28 
Shooting_Star 29 
Magikruiser 30 
Sneakster 31 
Spear 32 
Jet_Bubble 33 
Dolphin_Dasher 34 
Phantom 35 
Max 36 

Definition at line 66 of file Common.hh.

◆ Character

enum class Character
strong
Enumerator
Mario 0 
Baby_Peach 1 
Waluigi 2 
Bowser 3 
Baby_Daisy 4 
Dry_Bones 5 
Baby_Mario 6 
Luigi 7 
Toad 8 
Donkey_Kong 9 
Yoshi 10 
Wario 11 
Baby_Luigi 12 
Toadette 13 
Koopa_Troopa 14 
Daisy 15 
Peach 16 
Birdo 17 
Diddy_Kong 18 
King_Boo 19 
Bowser_Jr 20 
Dry_Bowser 21 
Funky_Kong 22 
Rosalina 23 
Small_Mii_Outfit_A_Male 24 
Small_Mii_Outfit_A_Female 25 
Small_Mii_Outfit_B_Male 26 
Small_Mii_Outfit_B_Female 27 
Small_Mii_Outfit_C_Male 28 
Small_Mii_Outfit_C_Female 29 
Medium_Mii_Outfit_A_Male 30 
Medium_Mii_Outfit_A_Female 31 
Medium_Mii_Outfit_B_Male 32 
Medium_Mii_Outfit_B_Female 33 
Medium_Mii_Outfit_C_Male 34 
Medium_Mii_Outfit_C_Female 35 
Large_Mii_Outfit_A_Male 36 
Large_Mii_Outfit_A_Female 37 
Large_Mii_Outfit_B_Male 38 
Large_Mii_Outfit_B_Female 39 
Large_Mii_Outfit_C_Male 40 
Large_Mii_Outfit_C_Female 41 
Medium_Mii 42 
Small_Mii 43 
Large_Mii 44 
Peach_Biker_Outfit 45 
Daisy_Biker_Outfit 46 
Rosalina_Biker_Outfit 47 
Max 48 

Definition at line 106 of file Common.hh.

◆ WeightClass

enum class WeightClass
strong
Enumerator
Invalid -1 
Light 0 
Medium 1 
Heavy 2 

Definition at line 158 of file Common.hh.

◆ GroupID

enum class GroupID : u16
strong
Enumerator
None 0 
Race 1 
Gfx 2 
Kart 3 
Object 4 
Course 5 
UI 6 
Effect 7 
Sound 8 
Resource 10 
HomeMenu 11 
Item 12 
Net 13 

Definition at line 165 of file Common.hh.

Function Documentation

◆ GetAddrNum()

uintptr_t GetAddrNum ( const void * p)
inlinestatic

Definition at line 24 of file Memory.hh.

Referenced by AddOffset(), GetAddrNum(), RoundDown(), RoundUp(), and SubOffset().

◆ GetAddrPtr()

void * GetAddrPtr ( uintptr_t n)
inlinestatic

Definition at line 28 of file Memory.hh.

Referenced by AddOffset(), GetAddrPtr(), RoundDown(), RoundUp(), and SubOffset().

◆ AddOffset()

void * AddOffset ( const void * p,
size_t offset )
inlinestatic

Definition at line 32 of file Memory.hh.

Referenced by AddOffset().

◆ SubOffset()

void * SubOffset ( const void * p,
size_t offset )
inlinestatic

Definition at line 36 of file Memory.hh.

Referenced by SubOffset().

◆ RoundUp() [1/2]

uintptr_t RoundUp ( uintptr_t value,
uintptr_t alignment )
inlinestatic

Definition at line 40 of file Memory.hh.

Referenced by RoundUp(), and RoundUp().

◆ RoundUp() [2/2]

void * RoundUp ( void * ptr,
uintptr_t alignment )
inlinestatic

Definition at line 44 of file Memory.hh.

◆ RoundDown() [1/2]

uintptr_t RoundDown ( uintptr_t value,
uintptr_t alignment )
inlinestatic

Definition at line 48 of file Memory.hh.

Referenced by RoundDown(), and RoundDown().

◆ RoundDown() [2/2]

void * RoundDown ( void * ptr,
uintptr_t alignment )
inlinestatic

Definition at line 52 of file Memory.hh.

◆ CharacterToWeight()

constexpr WeightClass CharacterToWeight ( Character character)
staticconstexpr

Definition at line 181 of file Common.hh.

Referenced by CharacterToWeight().

◆ VehicleToWeight()

constexpr WeightClass VehicleToWeight ( Vehicle vehicle)
staticconstexpr

Definition at line 215 of file Common.hh.

Referenced by VehicleToWeight().

◆ form()

template<IntegralType T>
T form ( const u8 * data)
inlinestatic

Definition at line 393 of file Common.hh.

Referenced by form().

◆ parse()

template<ParseableType T>
constexpr T parse ( T val,
std::endian endian = std::endian::big )
inlinestaticconstexpr

Definition at line 403 of file Common.hh.

Referenced by parse().

◆ f2u()

constexpr u32 f2u ( f32 val)
inlinestaticconstexpr

Definition at line 416 of file Common.hh.

Referenced by f2u().

Variable Documentation

◆ F_PI

f32 F_PI = 3.1415927f
staticconstexpr

Floating point representation of pi.

Definition at line 9 of file Math.hh.

◆ F_TAU

f32 F_TAU = 6.2831855f
staticconstexpr

Floating point representation of tau/2pi.

Definition at line 10 of file Math.hh.

◆ DEG2RAD

f32 DEG2RAD = 0.017453292f
staticconstexpr

F_PI / 180.0f. Double precision and casted down.

Definition at line 11 of file Math.hh.

◆ DEG2RAD360

f32 DEG2RAD360 = 0.034906585f
staticconstexpr

F_PI / 360.0f. Double precision, casted down.

Definition at line 12 of file Math.hh.

◆ RAD2DEG

f32 RAD2DEG = 57.2957795f
staticconstexpr

180.0f / F_PI. Double precision and casted down.

Definition at line 13 of file Math.hh.

◆ DEG2FIDX

f32 DEG2FIDX = 256.0f / 360.0f
staticconstexpr

Degrees to fixed index.

Definition at line 14 of file Math.hh.

◆ RAD2FIDX

f32 RAD2FIDX = 128.0f / F_PI
staticconstexpr

Radians to fixed index.

Definition at line 15 of file Math.hh.

Referenced by Kinoko::EGG::Mathf::cos(), and Kinoko::EGG::Mathf::sin().

◆ FIDX2RAD

f32 FIDX2RAD = F_PI / 128.0f
staticconstexpr

Fixed index to radians.

Definition at line 16 of file Math.hh.

Referenced by Kinoko::EGG::Mathf::atan2().

◆ HALF_PI

f32 HALF_PI = F_PI / 2.0f
staticconstexpr

Definition at line 17 of file Math.hh.

◆ COURSE_NAMES

const char* COURSE_NAMES[59]
staticconstexpr

Definition at line 261 of file Common.hh.

◆ VEHICLE_NAMES

const char* VEHICLE_NAMES[36]
staticconstexpr

Definition at line 323 of file Common.hh.

◆ is_derived_from_template_v

template<template< typename... > class Base, typename Derived>
bool is_derived_from_template_v = is_derived_from_template<Base, Derived>::value
inlineconstexpr

Definition at line 382 of file Common.hh.

◆ MEMORY_SPACE_SIZE

size_t MEMORY_SPACE_SIZE = 0x1000000
staticconstexpr

Definition at line 421 of file Common.hh.

◆ DEFAULT_OPT

auto DEFAULT_OPT = Abstract::Memory::MEMiHeapHead::OptFlag()
staticconstexpr

Definition at line 427 of file Common.hh.