Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Add mario from mario 64 #131

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions include/libsm64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#ifndef LIB_SM64_H
#define LIB_SM64_H

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>

#ifdef _WIN32
#ifdef SM64_LIB_EXPORT
#define SM64_LIB_FN __declspec(dllexport)
#else
#define SM64_LIB_FN __declspec(dllimport)
#endif
#else
#define SM64_LIB_FN
#endif

struct SM64Surface
{
int16_t type;
int16_t force;
uint16_t terrain;
int16_t vertices[3][3];
};

struct SM64MarioInputs
{
float camLookX, camLookZ;
float stickX, stickY;
uint8_t buttonA, buttonB, buttonZ;
};

struct SM64ObjectTransform
{
float position[3];
float eulerRotation[3];
};

struct SM64SurfaceObject
{
struct SM64ObjectTransform transform;
uint32_t surfaceCount;
struct SM64Surface *surfaces;
};

struct SM64MarioState
{
float position[3];
float velocity[3];
float faceAngle;
int16_t health;
};

struct SM64MarioGeometryBuffers
{
float *position;
float *normal;
float *color;
float *uv;
uint16_t numTrianglesUsed;
};

typedef void (*SM64DebugPrintFunctionPtr)( const char * );

enum
{
SM64_TEXTURE_WIDTH = 64 * 11,
SM64_TEXTURE_HEIGHT = 64,
SM64_GEO_MAX_TRIANGLES = 1024,
};

extern SM64_LIB_FN void sm64_global_init( uint8_t *rom, uint8_t *outTexture, SM64DebugPrintFunctionPtr debugPrintFunction );
extern SM64_LIB_FN void sm64_global_terminate( void );

extern SM64_LIB_FN void sm64_static_surfaces_load( const struct SM64Surface *surfaceArray, uint32_t numSurfaces );

extern SM64_LIB_FN int32_t sm64_mario_create( int16_t x, int16_t y, int16_t z );
extern SM64_LIB_FN void sm64_mario_tick( int32_t marioId, const struct SM64MarioInputs *inputs, struct SM64MarioState *outState, struct SM64MarioGeometryBuffers *outBuffers );
extern SM64_LIB_FN void sm64_mario_delete( int32_t marioId );

extern SM64_LIB_FN uint32_t sm64_surface_object_create( const struct SM64SurfaceObject *surfaceObject );
extern SM64_LIB_FN void sm64_surface_object_move( uint32_t objectId, const struct SM64ObjectTransform *transform );
extern SM64_LIB_FN void sm64_surface_object_delete( uint32_t objectId );

#endif//LIB_SM64_H
Binary file added libsm64.so
Binary file not shown.
4 changes: 4 additions & 0 deletions src/debug_print.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/src/debug_print.o: src/debug_print.c src/debug_print.h \
src/libsm64.h
src/debug_print.h:
src/libsm64.h:
Binary file added src/debug_print.o
Binary file not shown.
47 changes: 47 additions & 0 deletions src/decomp/engine/geo_layout.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
build/src/decomp/engine/geo_layout.o: src/decomp/engine/geo_layout.c \
src/decomp/engine/../include/sm64.h src/decomp/engine/../include/types.h \
src/decomp/engine/../include/macros.h \
src/decomp/engine/../include/platform_info.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../include/audio_defines.h \
src/decomp/engine/../include/surface_terrains.h \
src/decomp/engine/geo_layout.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../memory.h src/decomp/engine/../include/types.h \
src/decomp/engine/../include/macros.h \
src/decomp/engine/../include/types.h src/decomp/engine/math_util.h \
src/decomp/engine/../include/PR/gbi.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/graph_node.h src/decomp/engine/../shim.h \
src/decomp/engine/../game/area.h \
src/decomp/engine/../game/../include/PR/ultratypes.h \
src/decomp/engine/../game/../include/types.h \
src/decomp/engine/../game/camera.h src/decomp/engine/../game/area.h \
src/decomp/engine/../game/level_update.h \
src/decomp/engine/../../libsm64.h src/decomp/engine/../global_state.h
src/decomp/engine/../include/sm64.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../include/macros.h:
src/decomp/engine/../include/platform_info.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../include/audio_defines.h:
src/decomp/engine/../include/surface_terrains.h:
src/decomp/engine/geo_layout.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../memory.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../include/macros.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/math_util.h:
src/decomp/engine/../include/PR/gbi.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/graph_node.h:
src/decomp/engine/../shim.h:
src/decomp/engine/../game/area.h:
src/decomp/engine/../game/../include/PR/ultratypes.h:
src/decomp/engine/../game/../include/types.h:
src/decomp/engine/../game/camera.h:
src/decomp/engine/../game/area.h:
src/decomp/engine/../game/level_update.h:
src/decomp/engine/../../libsm64.h:
src/decomp/engine/../global_state.h:
Binary file added src/decomp/engine/geo_layout.o
Binary file not shown.
54 changes: 54 additions & 0 deletions src/decomp/engine/graph_node.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
build/src/decomp/engine/graph_node.o: src/decomp/engine/graph_node.c \
src/decomp/engine/../include/sm64.h src/decomp/engine/../include/types.h \
src/decomp/engine/../include/macros.h \
src/decomp/engine/../include/platform_info.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../include/audio_defines.h \
src/decomp/engine/../include/surface_terrains.h \
src/decomp/engine/../game/level_update.h \
src/decomp/engine/../game/../include/PR/ultratypes.h \
src/decomp/engine/../game/../include/types.h \
src/decomp/engine/math_util.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../include/PR/gbi.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../include/types.h src/decomp/engine/graph_node.h \
src/decomp/engine/../memory.h src/decomp/engine/../include/types.h \
src/decomp/engine/../game/rendering_graph_node.h \
src/decomp/engine/../game/../engine/graph_node.h \
src/decomp/engine/../game/area.h src/decomp/engine/../game/camera.h \
src/decomp/engine/../game/area.h src/decomp/engine/geo_layout.h \
src/decomp/engine/../include/macros.h src/decomp/engine/../shim.h \
src/decomp/engine/../game/area.h \
src/decomp/engine/../game/level_update.h \
src/decomp/engine/../../libsm64.h src/decomp/engine/../global_state.h
src/decomp/engine/../include/sm64.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../include/macros.h:
src/decomp/engine/../include/platform_info.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../include/audio_defines.h:
src/decomp/engine/../include/surface_terrains.h:
src/decomp/engine/../game/level_update.h:
src/decomp/engine/../game/../include/PR/ultratypes.h:
src/decomp/engine/../game/../include/types.h:
src/decomp/engine/math_util.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../include/PR/gbi.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/graph_node.h:
src/decomp/engine/../memory.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../game/rendering_graph_node.h:
src/decomp/engine/../game/../engine/graph_node.h:
src/decomp/engine/../game/area.h:
src/decomp/engine/../game/camera.h:
src/decomp/engine/../game/area.h:
src/decomp/engine/geo_layout.h:
src/decomp/engine/../include/macros.h:
src/decomp/engine/../shim.h:
src/decomp/engine/../game/area.h:
src/decomp/engine/../game/level_update.h:
src/decomp/engine/../../libsm64.h:
src/decomp/engine/../global_state.h:
Binary file added src/decomp/engine/graph_node.o
Binary file not shown.
24 changes: 24 additions & 0 deletions src/decomp/engine/graph_node_manager.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
build/src/decomp/engine/graph_node_manager.o: \
src/decomp/engine/graph_node_manager.c \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../include/types.h \
src/decomp/engine/../include/macros.h \
src/decomp/engine/../include/platform_info.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/geo_layout.h src/decomp/engine/../memory.h \
src/decomp/engine/../include/types.h \
src/decomp/engine/../include/macros.h src/decomp/engine/graph_node.h \
src/decomp/engine/../include/PR/gbi.h \
src/decomp/engine/../include/PR/ultratypes.h
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../include/macros.h:
src/decomp/engine/../include/platform_info.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/geo_layout.h:
src/decomp/engine/../memory.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../include/macros.h:
src/decomp/engine/graph_node.h:
src/decomp/engine/../include/PR/gbi.h:
src/decomp/engine/../include/PR/ultratypes.h:
Binary file added src/decomp/engine/graph_node_manager.o
Binary file not shown.
6 changes: 6 additions & 0 deletions src/decomp/engine/guMtxF2L.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build/src/decomp/engine/guMtxF2L.o: src/decomp/engine/guMtxF2L.c \
src/decomp/engine/guMtxF2L.h src/decomp/engine/../include/PR/gbi.h \
src/decomp/engine/../include/PR/ultratypes.h
src/decomp/engine/guMtxF2L.h:
src/decomp/engine/../include/PR/gbi.h:
src/decomp/engine/../include/PR/ultratypes.h:
Binary file added src/decomp/engine/guMtxF2L.o
Binary file not shown.
47 changes: 47 additions & 0 deletions src/decomp/engine/math_util.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
build/src/decomp/engine/math_util.o: src/decomp/engine/math_util.c \
src/decomp/engine/math_util.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../include/PR/gbi.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../include/types.h \
src/decomp/engine/../include/macros.h \
src/decomp/engine/../include/platform_info.h \
src/decomp/engine/../include/PR/ultratypes.h src/decomp/engine/../shim.h \
src/decomp/engine/../include/types.h src/decomp/engine/../game/area.h \
src/decomp/engine/../game/../include/PR/ultratypes.h \
src/decomp/engine/../game/../include/types.h \
src/decomp/engine/../game/camera.h src/decomp/engine/../game/area.h \
src/decomp/engine/../game/level_update.h \
src/decomp/engine/../../libsm64.h src/decomp/engine/../global_state.h \
src/decomp/engine/guMtxF2L.h src/decomp/engine/../include/sm64.h \
src/decomp/engine/../include/types.h \
src/decomp/engine/../include/audio_defines.h \
src/decomp/engine/../include/surface_terrains.h \
src/decomp/engine/graph_node.h src/decomp/engine/../memory.h \
src/decomp/engine/surface_collision.h
src/decomp/engine/math_util.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../include/PR/gbi.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../include/macros.h:
src/decomp/engine/../include/platform_info.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../shim.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../game/area.h:
src/decomp/engine/../game/../include/PR/ultratypes.h:
src/decomp/engine/../game/../include/types.h:
src/decomp/engine/../game/camera.h:
src/decomp/engine/../game/area.h:
src/decomp/engine/../game/level_update.h:
src/decomp/engine/../../libsm64.h:
src/decomp/engine/../global_state.h:
src/decomp/engine/guMtxF2L.h:
src/decomp/engine/../include/sm64.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../include/audio_defines.h:
src/decomp/engine/../include/surface_terrains.h:
src/decomp/engine/graph_node.h:
src/decomp/engine/../memory.h:
src/decomp/engine/surface_collision.h:
Binary file added src/decomp/engine/math_util.o
Binary file not shown.
39 changes: 39 additions & 0 deletions src/decomp/engine/surface_collision.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
build/src/decomp/engine/surface_collision.o: \
src/decomp/engine/surface_collision.c src/decomp/engine/../shim.h \
src/decomp/engine/../include/types.h \
src/decomp/engine/../include/macros.h \
src/decomp/engine/../include/platform_info.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../game/area.h \
src/decomp/engine/../game/../include/PR/ultratypes.h \
src/decomp/engine/../game/../include/types.h \
src/decomp/engine/../game/camera.h src/decomp/engine/../game/area.h \
src/decomp/engine/../game/level_update.h \
src/decomp/engine/../../libsm64.h src/decomp/engine/../global_state.h \
src/decomp/engine/surface_collision.h \
src/decomp/engine/../include/PR/ultratypes.h \
src/decomp/engine/../include/types.h \
src/decomp/engine/../include/surface_terrains.h \
src/decomp/engine/../../load_surfaces.h \
src/decomp/engine/../../decomp/include/types.h \
src/decomp/engine/../../libsm64.h
src/decomp/engine/../shim.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../include/macros.h:
src/decomp/engine/../include/platform_info.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../game/area.h:
src/decomp/engine/../game/../include/PR/ultratypes.h:
src/decomp/engine/../game/../include/types.h:
src/decomp/engine/../game/camera.h:
src/decomp/engine/../game/area.h:
src/decomp/engine/../game/level_update.h:
src/decomp/engine/../../libsm64.h:
src/decomp/engine/../global_state.h:
src/decomp/engine/surface_collision.h:
src/decomp/engine/../include/PR/ultratypes.h:
src/decomp/engine/../include/types.h:
src/decomp/engine/../include/surface_terrains.h:
src/decomp/engine/../../load_surfaces.h:
src/decomp/engine/../../decomp/include/types.h:
src/decomp/engine/../../libsm64.h:
Binary file added src/decomp/engine/surface_collision.o
Binary file not shown.
52 changes: 52 additions & 0 deletions src/decomp/game/behavior_actions.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
build/src/decomp/game/behavior_actions.o: \
src/decomp/game/behavior_actions.c src/decomp/game/behavior_actions.h \
src/decomp/game/../include/types.h src/decomp/game/../include/macros.h \
src/decomp/game/../include/platform_info.h \
src/decomp/game/../include/PR/ultratypes.h \
src/decomp/game/../mario/model.inc.h \
src/decomp/game/../mario/../include/types.h \
src/decomp/game/../mario/../include/PR/gbi.h \
src/decomp/game/../mario/../include/PR/ultratypes.h \
src/decomp/game/rendering_graph_node.h \
src/decomp/game/../include/PR/ultratypes.h \
src/decomp/game/../engine/graph_node.h \
src/decomp/game/../engine/../include/PR/ultratypes.h \
src/decomp/game/../engine/../include/PR/gbi.h \
src/decomp/game/../engine/../include/types.h \
src/decomp/game/../engine/../memory.h \
src/decomp/game/../engine/../include/types.h \
src/decomp/game/object_stuff.h src/decomp/game/../shim.h \
src/decomp/game/../include/types.h src/decomp/game/../game/area.h \
src/decomp/game/../game/../include/PR/ultratypes.h \
src/decomp/game/../game/../include/types.h \
src/decomp/game/../game/camera.h src/decomp/game/../game/area.h \
src/decomp/game/../game/level_update.h src/decomp/game/../../libsm64.h \
src/decomp/game/../global_state.h
src/decomp/game/behavior_actions.h:
src/decomp/game/../include/types.h:
src/decomp/game/../include/macros.h:
src/decomp/game/../include/platform_info.h:
src/decomp/game/../include/PR/ultratypes.h:
src/decomp/game/../mario/model.inc.h:
src/decomp/game/../mario/../include/types.h:
src/decomp/game/../mario/../include/PR/gbi.h:
src/decomp/game/../mario/../include/PR/ultratypes.h:
src/decomp/game/rendering_graph_node.h:
src/decomp/game/../include/PR/ultratypes.h:
src/decomp/game/../engine/graph_node.h:
src/decomp/game/../engine/../include/PR/ultratypes.h:
src/decomp/game/../engine/../include/PR/gbi.h:
src/decomp/game/../engine/../include/types.h:
src/decomp/game/../engine/../memory.h:
src/decomp/game/../engine/../include/types.h:
src/decomp/game/object_stuff.h:
src/decomp/game/../shim.h:
src/decomp/game/../include/types.h:
src/decomp/game/../game/area.h:
src/decomp/game/../game/../include/PR/ultratypes.h:
src/decomp/game/../game/../include/types.h:
src/decomp/game/../game/camera.h:
src/decomp/game/../game/area.h:
src/decomp/game/../game/level_update.h:
src/decomp/game/../../libsm64.h:
src/decomp/game/../global_state.h:
Binary file added src/decomp/game/behavior_actions.o
Binary file not shown.
Loading