forked from zesterer/sm64-gba
Super Mario 64, on the Gameboy Advance
- Rust 100%
|
|
||
|---|---|---|
| arch | ||
| common | ||
| data | ||
| doc | ||
| linker_scripts | ||
| math | ||
| src | ||
| .gitattributes | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
| rust-toolchain.toml | ||
Super Mario 64, GBA Edition
Status
- [-] Rendering
- Implement basic rasterisation
- Texture support
- Figures
- Animation
- Stage
- [-] Water
- Water level
- Switch palette when underwater
- [-] Interaction with figures
- [-] Water
- 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:
-
Install
rustup. -
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:
-
Install
rustup. -
Install the freestanding ARM version of GCC's
binutils(on Ubuntu, the package isbinutils-arm-none-eabi). -
Install
gbafix(there are several implementations. Since you have Rust installed,cargo install gbafixwill 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:
- Installed
cargo-asm, by runningcargo 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 surfaceslippery: reduces friction when moving on the surfaceunsolid: Surface does not partake in collision detectionfloor: Surface always behaves like a floor, no matter how steepanimate_u=<f32>andanimate_v=<f32>: Surface texture coordinates scroll by the given amount over one seconddouble_sided: causes surfaces to have a front and back side, useful for transparent objects like fences
