Skip to content
MegaMech edited this page Sep 17, 2023 · 8 revisions

### This is a wip draft ###

A style guide makes PRs easier to review and boosts the quality of feedback. Also, it contributes a consistent naming scheme that keeps the code-base organized.

n64decomp uses a primitive form of the beloved Systems Hungarian Notation. See the sm64 style doc. This page extends that doc. It does not replace it.

Abbreviations

Avoid abbreviations except for very common ones. Long names are preferred.

Common Abbreviations

  • Texture palette --> tlut
  • Lookup table --> LUT
  • Displaylist --> dl
  • Vertex/vertices --> vtx

Code Variables

Variables defined in .c files use gCamelCase.

  • Global variables begin with g --> gMyVariable
  • Static variables begin with s --> sMyVariable (static variables are limited to the file where it is defined)

Segmented Data

Segmented data uses snake_case and are generally defined in .inc.c files.

Course Data

course_course_name_datatype_dataname then course_name, the name of the data, and then the data type. Example: course_royal_raceway_texture_tree

Common Course Data

Begins with the common_ prefix.

common_texture_finishline

Podium Ceremony Trophy and Podium

ceremony_model_gold_trophy

Clone this wiki locally