Super Mario 64, on the Gameboy Advance
Find a file
2024-09-12 13:36:29 +02:00
arch Began working on new fixed-point lib 2024-09-04 19:17:16 +01:00
common Merge pull request 'Larry-Koopa-Update' (#13) from Larry-Koopa-Update into main 2024-09-12 13:36:29 +02:00
data Merge pull request 'Larry-Koopa-Update' (#13) from Larry-Koopa-Update into main 2024-09-12 13:36:29 +02:00
doc Updated README 2024-08-23 17:15:58 +01:00
linker_scripts Resolved UI issue 2024-08-11 14:22:02 +01:00
math Dt-independent ori lerp 2024-09-11 21:26:22 +01:00
src Improved pause menu 2024-09-12 12:24:58 +01:00
.gitattributes Added assets 2024-08-22 18:29:12 +01:00
.gitignore Added .blend temporaries to gitignore 2024-08-23 11:52:45 +01:00
build.rs Merge pull request 'Larry-Koopa-Update' (#13) from Larry-Koopa-Update into main 2024-09-12 13:36:29 +02:00
Cargo.lock Began working on new fixed-point lib 2024-09-04 19:17:16 +01:00
Cargo.toml Use 16-bit sin/cos table 2024-09-05 21:41:16 +01:00
README.md Fixed README 2024-09-12 12:32:09 +01:00
rust-toolchain.toml Initial tests 2024-04-27 18:42:54 +01:00

An icon showing Mario's head Super Mario 64, GBA Edition

A screenshot showing Peach's Castle, the starting stage

Status

  • [-] Rendering
    • Implement basic rasterisation
    • Texture support
    • Figures
      • Animation
    • Stage
      • [-] Water
        • Water level
        • Switch palette when underwater
        • [-] Interaction with figures
    • Translucent shadows
    • [-] Particles
  • Level geometry
    • Build-time mesh processing
    • Build-time flat colour derivation
    • Acceleration structure
    • Render sky texture
  • [-] Camera
    • Vertex matrix transform
    • Perspective transform
    • Basic movement
    • [-] Camera reorientation
    • [-] First person
  • [-] Mario
    • Basic rendering (blob)
    • Basic camera-relative movement
    • Gravity
    • More complex movement
      • Wall slide/jump
      • Long jump
      • Triple jump
      • Ground pound
      • Crouch
      • Dive
      • Belly slide
      • Butt slide
      • [-] Punch
      • [-] Kick
      • [-] Side jump
      • [-] Ledge grab
      • [-] Swimming
    • Pre-render sprites for each limb
    • Animations
  • [-] Physics
    • Collision detection
    • Basic collision resolution
    • [-] Ordered/iterative collision resolution
    • [-] Moving terrain-like objects
  • [-] Entities
    • Implement ECS
    • [-] Objects
      • Doors
      • Stars
      • [-] Coins
      • [-] Trees
    • [-] Enemies
      • [-] Goombas
    • [-] Characters
      • [-] Toads
      • [-] Koopa the Quick
  • [-] Scenes
    • Stage changes
    • [-] Scene transitions
      • Doors allow transitions
      • Allow toggling stage elements when going through transitions
      • Porthole
      • Bowser face
    • [-] Separate 'stage' and 'scene'
    • [-] Intro sequence
  • [-] Progression
    • Stars
    • [-] Saving game state
    • [-] Associate stars with save state
  • [-] Gameplay
    • Scene changes
    • Health
    • [-] Lives
  • [-] Menu/UI
    • Pause menu
    • [-] Main menu
    • [-] Signs
  • [-] Audio
    • Basic sample-based audio
    • Simple additive mixer
    • Support for playing sound effects through channels
    • Background music
    • [-] Sequenced music
  • [-] Debugging
    • Build-time metrics switch
    • Metric: pixel tests
    • Metric: pixel draws
    • Metric: vertex transforms
    • Metric: polygon draws

Build & run (mGBA)

Requirements:

  1. Install rustup.

  2. Install mGBA (on Ubuntu, the package is mgba-qt).

Run the executable with mGBA (mGBA can run ELF executables directly):

# Build and run the game executable
cargo --config arch/gba.toml run --release

Build (hardware / other emulators)

Requirements:

  1. Install rustup.

  2. Install the freestanding ARM version of GCC's binutils (on Ubuntu, the package is binutils-arm-none-eabi).

  3. Install gbafix (there are several implementations. Since you have Rust installed, cargo install gbafix will do).

# Build the game executable
cargo --config arch/gba.toml run --release

# Copy the contents of the game executable's ELF into a ROM binary
arm-none-eabi-objcopy -O binary target/gba/release/sm64-gba target/sm64-gba.gba

# Fix-up the ROM header such that it is compatible with the GBA's BIOS
gbafix target/sm64-gba.gba

Side-load the .gba using your desired method, such as a flash cart.

Debugging

Requirements:

  1. Installed cargo-asm, by running cargo install cargo-show-asm.

When developing, it's often useful to disassemble a specific function to ensure that the compiler is generating good assembly code.

# Disassemble the given function with inline Rust annotations
cargo --config arch/gba.toml asm -p sm64-gba --bin sm64-gba --rust --simplify <function name>

# Disassemble math code
cargo --config arch/gba.toml asm --target armv5te-unknown-linux-gnueabi --rust -p sm64-gba-math --lib

Testing

# Run tests
cargo test -p sm64-gba-math

Material attributes

Stage material attributes are applied with material names like <name>:attr0,attr1,attr2.

Attributes include:

  • slide: causes the player to enter a sliding state when standing on the surface
  • slippery: reduces friction when moving on the surface
  • unsolid: Surface does not partake in collision detection
  • floor: Surface always behaves like a floor, no matter how steep
  • animate_u=<f32> and animate_v=<f32>: Surface texture coordinates scroll by the given amount over one second
  • double_sided: causes surfaces to have a front and back side, useful for transparent objects like fences