You've already forked ultrasm64-2
mirror of
https://github.com/HackerN64/ultrasm64-2.git
synced 2026-01-21 10:38:08 -08:00
Refresh 12
This commit is contained in:
20
CHANGES
20
CHANGES
@@ -1,5 +1,23 @@
|
|||||||
|
Refresh 12
|
||||||
|
|
||||||
|
1.) Debug box improvements (#1066)
|
||||||
|
2.) Improve 'geo_render_mirror_mario' (#1064)
|
||||||
|
3.) Cleanup and small labeling (#1063)
|
||||||
|
4.) Anim renames and other related renames (#1062)
|
||||||
|
5.) remove do while 0 and make one line comments consistent (#1061)
|
||||||
|
6.) fixed typo in segments.h (#1060)
|
||||||
|
7.) Name unknown fields (from public repo) (#1058)
|
||||||
|
8.) Change 'void *' to 'struct MainPoolState *' (#1057)
|
||||||
|
9.) Fix type of freeList (#1056)
|
||||||
|
10.) Newer version of diff script (#1055)
|
||||||
|
11.) Add stubbed_printfs based on unused audio strings (#1054)
|
||||||
|
12.) Fix comment in paintings.c (#1053)
|
||||||
|
13.) Add defines for hardcoded cell/floor height values (#1051)
|
||||||
|
14.) Update README.md: Remove GitHub specific Markdown syntax (#1052)
|
||||||
|
15.) Properly label interation status that handle's Bowser's shockwave attack (#1050)
|
||||||
|
|
||||||
Refresh 11
|
Refresh 11
|
||||||
1.) (HEAD -> master, origin/master, origin/HEAD) Make geo_process_level_of_detail endian-independent (#1049)
|
1.) Make geo_process_level_of_detail endian-independent (#1049)
|
||||||
2.) Label oMoveFlags and slight cleanup. (#1046)
|
2.) Label oMoveFlags and slight cleanup. (#1046)
|
||||||
3.) Avoid UB in synthesis_resample_and_mix_reverb (#1048)
|
3.) Avoid UB in synthesis_resample_and_mix_reverb (#1048)
|
||||||
4.) Change some void * to correct type (#1047)
|
4.) Change some void * to correct type (#1047)
|
||||||
|
|||||||
17
Makefile
17
Makefile
@@ -528,8 +528,6 @@ $(BUILD_DIR)/actors/%.o: OPT_FLAGS := -g
|
|||||||
$(BUILD_DIR)/bin/%.o: OPT_FLAGS := -g
|
$(BUILD_DIR)/bin/%.o: OPT_FLAGS := -g
|
||||||
$(BUILD_DIR)/src/goddard/%.o: OPT_FLAGS := -g
|
$(BUILD_DIR)/src/goddard/%.o: OPT_FLAGS := -g
|
||||||
$(BUILD_DIR)/src/goddard/%.o: MIPSISET := -mips1
|
$(BUILD_DIR)/src/goddard/%.o: MIPSISET := -mips1
|
||||||
$(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0
|
|
||||||
$(BUILD_DIR)/src/audio/load.o: OPT_FLAGS := -O2 -framepointer -Wo,-loopunroll,0
|
|
||||||
$(BUILD_DIR)/lib/src/%.o: OPT_FLAGS :=
|
$(BUILD_DIR)/lib/src/%.o: OPT_FLAGS :=
|
||||||
$(BUILD_DIR)/lib/src/math/ll%.o: MIPSISET := -mips3 -32
|
$(BUILD_DIR)/lib/src/math/ll%.o: MIPSISET := -mips3 -32
|
||||||
$(BUILD_DIR)/lib/src/math/%.o: OPT_FLAGS := -O2
|
$(BUILD_DIR)/lib/src/math/%.o: OPT_FLAGS := -O2
|
||||||
@@ -545,15 +543,22 @@ $(BUILD_DIR)/lib/src/_Ldtob.o: OPT_FLAGS := -O3
|
|||||||
$(BUILD_DIR)/lib/src/_Printf.o: OPT_FLAGS := -O3
|
$(BUILD_DIR)/lib/src/_Printf.o: OPT_FLAGS := -O3
|
||||||
$(BUILD_DIR)/lib/src/sprintf.o: OPT_FLAGS := -O3
|
$(BUILD_DIR)/lib/src/sprintf.o: OPT_FLAGS := -O3
|
||||||
|
|
||||||
# enable loop unrolling except for external.c (external.c might also have used
|
# Enable loop unrolling except for external.c (external.c might also have used
|
||||||
# unrolling, but it makes one loop harder to match)
|
# unrolling, but it makes one loop harder to match).
|
||||||
$(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2
|
# For all audio files other than external.c and port_eu.c, put string literals
|
||||||
$(BUILD_DIR)/src/audio/load.o: OPT_FLAGS := -O2
|
# in .data. (In Shindou, the port_eu.c string literals also moved to .data.)
|
||||||
|
$(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2 -use_readwrite_const
|
||||||
|
$(BUILD_DIR)/src/audio/port_eu.o: OPT_FLAGS := -O2
|
||||||
$(BUILD_DIR)/src/audio/external.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0
|
$(BUILD_DIR)/src/audio/external.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0
|
||||||
else
|
else
|
||||||
|
|
||||||
|
$(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0
|
||||||
|
$(BUILD_DIR)/src/audio/load.o: OPT_FLAGS := -O2 -framepointer -Wo,-loopunroll,0
|
||||||
|
|
||||||
# The source-to-source optimizer copt is enabled for audio. This makes it use
|
# The source-to-source optimizer copt is enabled for audio. This makes it use
|
||||||
# acpp, which needs -Wp,-+ to handle C++-style comments.
|
# acpp, which needs -Wp,-+ to handle C++-style comments.
|
||||||
|
# All other files than external.c should really use copt, but only a few have
|
||||||
|
# been matched so far.
|
||||||
$(BUILD_DIR)/src/audio/effects.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0 -sopt,-inline=sequence_channel_process_sound,-scalaroptimize=1 -Wp,-+
|
$(BUILD_DIR)/src/audio/effects.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0 -sopt,-inline=sequence_channel_process_sound,-scalaroptimize=1 -Wp,-+
|
||||||
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := -O2 -sopt,-scalaroptimize=1 -Wp,-+
|
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := -O2 -sopt,-scalaroptimize=1 -Wp,-+
|
||||||
#$(BUILD_DIR)/src/audio/seqplayer.o: OPT_FLAGS := -O2 -sopt,-inline_manual,-scalaroptimize=1 -Wp,-+ #-Wo,-v,-bb,-l,seqplayer_list.txt
|
#$(BUILD_DIR)/src/audio/seqplayer.o: OPT_FLAGS := -O2 -sopt,-inline_manual,-scalaroptimize=1 -Wp,-+ #-Wo,-v,-bb,-l,seqplayer_list.txt
|
||||||
|
|||||||
58
README.md
58
README.md
@@ -139,35 +139,33 @@ Resulting artifacts can be found in the `build` directory.
|
|||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
```
|
sm64
|
||||||
sm64
|
├── actors: object behaviors, geo layout, and display lists
|
||||||
├── actors: object behaviors, geo layout, and display lists
|
├── asm: handwritten assembly code, rom header
|
||||||
├── asm: handwritten assembly code, rom header
|
│ └── non_matchings: asm for non-matching sections
|
||||||
│ └── non_matchings: asm for non-matching sections
|
├── assets: animation and demo data
|
||||||
├── assets: animation and demo data
|
│ ├── anims: animation data
|
||||||
│ ├── anims: animation data
|
│ └── demos: demo data
|
||||||
│ └── demos: demo data
|
├── bin: C files for ordering display lists and textures
|
||||||
├── bin: C files for ordering display lists and textures
|
├── build: output directory
|
||||||
├── build: output directory
|
├── data: behavior scripts, misc. data
|
||||||
├── data: behavior scripts, misc. data
|
├── doxygen: documentation infrastructure
|
||||||
├── doxygen: documentation infrastructure
|
├── enhancements: example source modifications
|
||||||
├── enhancements: example source modifications
|
├── include: header files
|
||||||
├── include: header files
|
├── levels: level scripts, geo layout, and display lists
|
||||||
├── levels: level scripts, geo layout, and display lists
|
├── lib: SDK library code
|
||||||
├── lib: SDK library code
|
├── rsp: audio and Fast3D RSP assembly code
|
||||||
├── rsp: audio and Fast3D RSP assembly code
|
├── sound: sequences, sound samples, and sound banks
|
||||||
├── sound: sequences, sound samples, and sound banks
|
├── src: C source code for game
|
||||||
├── src: C source code for game
|
│ ├── audio: audio code
|
||||||
│ ├── audio: audio code
|
│ ├── buffers: stacks, heaps, and task buffers
|
||||||
│ ├── buffers: stacks, heaps, and task buffers
|
│ ├── engine: script processing engines and utils
|
||||||
│ ├── engine: script processing engines and utils
|
│ ├── game: behaviors and rest of game source
|
||||||
│ ├── game: behaviors and rest of game source
|
│ ├── goddard: Mario intro screen
|
||||||
│ ├── goddard: Mario intro screen
|
│ └── menu: title screen and file, act, and debug level selection menus
|
||||||
│ └── menu: title screen and file, act, and debug level selection menus
|
├── text: dialog, level names, act names
|
||||||
├── text: dialog, level names, act names
|
├── textures: skybox and generic texture data
|
||||||
├── textures: skybox and generic texture data
|
└── tools: build tools
|
||||||
└── tools: build tools
|
|
||||||
```
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -176,4 +174,4 @@ discuss what you would like to change.
|
|||||||
|
|
||||||
Run `clang-format` on your code to ensure it meets the project's coding standards.
|
Run `clang-format` on your code to ensure it meets the project's coding standards.
|
||||||
|
|
||||||
Official Discord: https://discord.gg/DuYH3Fh
|
Official Discord: [discord.gg/DuYH3Fh](https://discord.gg/DuYH3Fh)
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
|
.data
|
||||||
|
.asciiz "Audio:Track :Call Macro Level Over Error!\n"
|
||||||
|
.balign 4
|
||||||
|
.asciiz "Audio:Track :Loops Macro Level Over Error!\n"
|
||||||
|
.balign 4
|
||||||
|
.asciiz "SUB:ERR:BANK %d NOT CACHED.\n"
|
||||||
|
.balign 4
|
||||||
|
.asciiz "SUB:ERR:BANK %d NOT CACHED.\n"
|
||||||
|
.balign 4
|
||||||
|
.asciiz "Audio:Track: CTBLCALL Macro Level Over Error!\n"
|
||||||
|
.balign 4
|
||||||
|
.asciiz "Err :Sub %x ,address %x:Undefined SubTrack Function %x"
|
||||||
|
.balign 4
|
||||||
|
|
||||||
.late_rodata
|
.late_rodata
|
||||||
.late_rodata_alignment 4
|
.late_rodata_alignment 4
|
||||||
glabel jtbl_EU_80306714
|
glabel jtbl_EU_80306714
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
.byte 0x80, 0x37, 0x12, 0x40 /* PI BSD Domain 1 register */
|
.byte 0x80, 0x37, 0x12, 0x40 /* PI BSD Domain 1 register */
|
||||||
.word 0x0000000F /* Clockrate setting*/
|
.word 0x0000000F /* Clockrate setting*/
|
||||||
.word entry_point /* Entrypoint */
|
.word entry_point /* Entrypoint */
|
||||||
|
|
||||||
/* Revision */
|
/* Revision */
|
||||||
.if VERSION_SH == 1
|
.if VERSION_SH == 1
|
||||||
@@ -39,8 +39,7 @@
|
|||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if VERSION_SH == 1
|
.if VERSION_SH == 1
|
||||||
.byte 0x03 /* Version (Shindou) */
|
.byte 0x03 /* Version (Shindou) */
|
||||||
.else
|
.else
|
||||||
.byte 0x00 /* Version */
|
.byte 0x00 /* Version */
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ new file mode 100644
|
|||||||
index 00000000..0ee87ec7
|
index 00000000..0ee87ec7
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/game/debug_box.c
|
+++ b/src/game/debug_box.c
|
||||||
@@ -0,0 +1,244 @@
|
@@ -0,0 +1,281 @@
|
||||||
+#include <ultra64.h>
|
+#include <ultra64.h>
|
||||||
+
|
+
|
||||||
+#include "sm64.h"
|
+#include "sm64.h"
|
||||||
@@ -67,24 +67,39 @@ index 00000000..0ee87ec7
|
|||||||
+ * Internal struct containing box info
|
+ * Internal struct containing box info
|
||||||
+ */
|
+ */
|
||||||
+struct DebugBox {
|
+struct DebugBox {
|
||||||
|
+ u32 color;
|
||||||
+ Vec3s center;
|
+ Vec3s center;
|
||||||
+ Vec3s bounds;
|
+ Vec3s bounds;
|
||||||
+ s16 yaw;
|
+ s16 yaw;
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+struct DebugBox *sBoxes[MAX_DEBUG_BOXES];
|
+struct DebugBox sBoxes[MAX_DEBUG_BOXES];
|
||||||
+s16 sNumBoxes = 0;
|
+s16 sNumBoxes = 0;
|
||||||
+
|
+
|
||||||
+extern Mat4 gMatStack[32]; //XXX: Hack
|
+extern Mat4 gMatStack[32]; //XXX: Hack
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
+ * The debug boxes' transparency
|
+ * The debug boxes' default transparency
|
||||||
+ */
|
+ */
|
||||||
+#define DBG_BOX_ALPHA 0x7F
|
+#define DBG_BOX_ALPHA 0x7F
|
||||||
+/**
|
+/**
|
||||||
+ * The debug boxes' color
|
+ * The debug boxes' default color. sCurBoxColor is reset to this every frame.
|
||||||
+ */
|
+ */
|
||||||
+#define DBG_BOX_COL 0xFF, 0x00, 0x00, DBG_BOX_ALPHA
|
+#define DBG_BOX_DEF_COLOR 0xFF0000
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * The color that new boxes will be drawn with.
|
||||||
|
+ */
|
||||||
|
+u32 sCurBoxColor = DBG_BOX_ALPHA << 24 | DBG_BOX_DEF_COLOR;
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * The allocated size of a rotated box's dl
|
||||||
|
+ */
|
||||||
|
+#define DBG_BOX_ROT_DLSIZE ((s32)(6 * sizeof(Gfx) + 8 * sizeof(Vtx)))
|
||||||
|
+/**
|
||||||
|
+ * The allocated size of a normal box's dl
|
||||||
|
+ */
|
||||||
|
+#define DBG_BOX_DLSIZE ((s32)(2 * sizeof(Gfx) + 8 * sizeof(Vtx)))
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
+ * Sets up the RCP for drawing the boxes
|
+ * Sets up the RCP for drawing the boxes
|
||||||
@@ -107,14 +122,14 @@ index 00000000..0ee87ec7
|
|||||||
+ * Actually draws the box
|
+ * Actually draws the box
|
||||||
+ */
|
+ */
|
||||||
+static const Gfx dl_debug_draw_box[] = {
|
+static const Gfx dl_debug_draw_box[] = {
|
||||||
+ gsSP2Triangles( 0, 1, 2, 0x0, 2, 1, 3, 0x0),
|
+ gsSP2Triangles(5, 4, 6, 0x0, 5, 6, 7, 0x0), // front
|
||||||
+ gsSP2Triangles( 2, 3, 6, 0x0, 6, 3, 7, 0x0),
|
+ gsSP2Triangles(0, 1, 2, 0x0, 2, 1, 3, 0x0), // back
|
||||||
+
|
+
|
||||||
+ gsSP2Triangles( 4, 0, 2, 0x0, 2, 6, 4, 0x0),
|
+ gsSP2Triangles(4, 0, 2, 0x0, 2, 6, 4, 0x0), // left
|
||||||
+ gsSP2Triangles( 1, 5, 3, 0x0, 3, 5, 7, 0x0),
|
+ gsSP2Triangles(1, 5, 3, 0x0, 3, 5, 7, 0x0), // right
|
||||||
+
|
+
|
||||||
+ gsSP2Triangles( 1, 0, 4, 0x0, 1, 4, 5, 0x0),
|
+ gsSP2Triangles(1, 0, 4, 0x0, 1, 4, 5, 0x0), // top
|
||||||
+ gsSP2Triangles( 5, 4, 6, 0x0, 5, 6, 7, 0x0),
|
+ gsSP2Triangles(2, 3, 6, 0x0, 6, 3, 7, 0x0), // bottom
|
||||||
+
|
+
|
||||||
+ gsSPEndDisplayList(),
|
+ gsSPEndDisplayList(),
|
||||||
+};
|
+};
|
||||||
@@ -126,20 +141,32 @@ index 00000000..0ee87ec7
|
|||||||
+ */
|
+ */
|
||||||
+static void append_debug_box(Vec3f center, Vec3f bounds, s16 yaw)
|
+static void append_debug_box(Vec3f center, Vec3f bounds, s16 yaw)
|
||||||
+{
|
+{
|
||||||
+ if (sNumBoxes >= MAX_DEBUG_BOXES ||
|
+ if (sNumBoxes >= MAX_DEBUG_BOXES) {
|
||||||
+ (sBoxes[sNumBoxes] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct DebugBox))) == NULL) {
|
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ vec3f_to_vec3s(sBoxes[sNumBoxes]->center, center);
|
+ vec3f_to_vec3s(sBoxes[sNumBoxes].center, center);
|
||||||
+ vec3f_to_vec3s(sBoxes[sNumBoxes]->bounds, bounds);
|
+ vec3f_to_vec3s(sBoxes[sNumBoxes].bounds, bounds);
|
||||||
+
|
+
|
||||||
+ sBoxes[sNumBoxes]->yaw = yaw;
|
+ sBoxes[sNumBoxes].yaw = yaw;
|
||||||
|
+ sBoxes[sNumBoxes].color = sCurBoxColor;
|
||||||
+
|
+
|
||||||
+ ++sNumBoxes;
|
+ ++sNumBoxes;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
|
+ * Draw new boxes with the given color.
|
||||||
|
+ * Color format is 32-bit ARGB.
|
||||||
|
+ * If the alpha component is zero, DBG_BOX_ALPHA (0x7f) will be used instead.
|
||||||
|
+ * Ex: 0xFF0000 becomes 0x7FFF0000
|
||||||
|
+ */
|
||||||
|
+void debug_box_color(u32 color)
|
||||||
|
+{
|
||||||
|
+ if ((color >> 24) == 0) color |= (DBG_BOX_ALPHA << 24);
|
||||||
|
+ sCurBoxColor = color;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/**
|
||||||
+ * Draws a debug box from (center - bounds) to (center + bounds)
|
+ * Draws a debug box from (center - bounds) to (center + bounds)
|
||||||
+ * To draw a rotated box, use debug_box_rot()
|
+ * To draw a rotated box, use debug_box_rot()
|
||||||
+ *
|
+ *
|
||||||
@@ -176,9 +203,9 @@ index 00000000..0ee87ec7
|
|||||||
+{
|
+{
|
||||||
+ Vec3f center, bounds;
|
+ Vec3f center, bounds;
|
||||||
+
|
+
|
||||||
+ bounds[0] = pMax[0] - pMin[0] / 2.0f;
|
+ bounds[0] = (pMax[0] - pMin[0]) / 2.0f;
|
||||||
+ bounds[1] = pMax[1] - pMin[1] / 2.0f;
|
+ bounds[1] = (pMax[1] - pMin[1]) / 2.0f;
|
||||||
+ bounds[2] = pMax[2] - pMin[2] / 2.0f;
|
+ bounds[2] = (pMax[2] - pMin[2]) / 2.0f;
|
||||||
+
|
+
|
||||||
+ center[0] = pMin[0] + bounds[0];
|
+ center[0] = pMin[0] + bounds[0];
|
||||||
+ center[1] = pMin[1] + bounds[1];
|
+ center[1] = pMin[1] + bounds[1];
|
||||||
@@ -187,12 +214,15 @@ index 00000000..0ee87ec7
|
|||||||
+ append_debug_box(center, bounds, yaw);
|
+ append_debug_box(center, bounds, yaw);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static void render_box(struct DebugBox *box)
|
+static void render_box(int index)
|
||||||
+{
|
+{
|
||||||
+ Vtx *verts = alloc_display_list(8 * sizeof(Vtx));
|
+ Vtx *verts;
|
||||||
+ Mtx *translate;
|
+ Mtx *translate;
|
||||||
+ Mtx *rotate;
|
+ Mtx *rotate;
|
||||||
+ Mtx *translateback;
|
+ Mtx *translateback;
|
||||||
|
+ struct DebugBox *box = &sBoxes[index];
|
||||||
|
+ u32 color = box->color;
|
||||||
|
+
|
||||||
+ s32 x0 = box->center[0],
|
+ s32 x0 = box->center[0],
|
||||||
+ y0 = box->center[1],
|
+ y0 = box->center[1],
|
||||||
+ z0 = box->center[2];
|
+ z0 = box->center[2];
|
||||||
@@ -201,6 +231,13 @@ index 00000000..0ee87ec7
|
|||||||
+ yb = box->bounds[1],
|
+ yb = box->bounds[1],
|
||||||
+ zb = box->bounds[2];
|
+ zb = box->bounds[2];
|
||||||
+
|
+
|
||||||
|
+ if (box->yaw != 0 && (Gfx*)gGfxPoolEnd - gDisplayListHead < DBG_BOX_ROT_DLSIZE)
|
||||||
|
+ return;
|
||||||
|
+ else if ((Gfx*)gGfxPoolEnd - gDisplayListHead < DBG_BOX_DLSIZE)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ verts = alloc_display_list(8 * sizeof(Vtx));
|
||||||
|
+
|
||||||
+ if (verts != NULL) {
|
+ if (verts != NULL) {
|
||||||
+ if (box->yaw != 0) {
|
+ if (box->yaw != 0) {
|
||||||
+ // Translate to the origin, rotate, then translate back, effectively rotating the box about
|
+ // Translate to the origin, rotate, then translate back, effectively rotating the box about
|
||||||
@@ -218,6 +255,7 @@ index 00000000..0ee87ec7
|
|||||||
+ gSPMatrix(gDisplayListHead++, translateback, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
|
+ gSPMatrix(gDisplayListHead++, translateback, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
+#define DBG_BOX_COL /**/ (color >> 16) & 0xff, (color >> 8) & 0xff, color & 0xff, (color >> 24) & 0xff
|
||||||
+#define DBG_BOX_VTX(i, x, y, z) make_vertex(verts, i, x, y, z, 0, 0, DBG_BOX_COL)
|
+#define DBG_BOX_VTX(i, x, y, z) make_vertex(verts, i, x, y, z, 0, 0, DBG_BOX_COL)
|
||||||
+ DBG_BOX_VTX(0, x0 - xb, y0 + yb, z0 - zb);
|
+ DBG_BOX_VTX(0, x0 - xb, y0 + yb, z0 - zb);
|
||||||
+ DBG_BOX_VTX(1, x0 + xb, y0 + yb, z0 - zb);
|
+ DBG_BOX_VTX(1, x0 + xb, y0 + yb, z0 - zb);
|
||||||
@@ -244,15 +282,15 @@ index 00000000..0ee87ec7
|
|||||||
+ s32 i;
|
+ s32 i;
|
||||||
+ Mtx *mtx;
|
+ Mtx *mtx;
|
||||||
+
|
+
|
||||||
|
+ debug_box_color(DBG_BOX_DEF_COLOR);
|
||||||
|
+
|
||||||
+ if (sNumBoxes == 0) {
|
+ if (sNumBoxes == 0) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ mtx = alloc_display_list(sizeof(Mtx));
|
+ mtx = alloc_display_list(sizeof(Mtx));
|
||||||
+ if (mtx == NULL) {
|
+ // Don't draw if there isn't space for the configuration + at least one box
|
||||||
+ for (i = 0; i < sNumBoxes; ++i) {
|
+ if (mtx == NULL || ((Gfx*)gGfxPoolEnd - gDisplayListHead) <= (s32)(2 * sizeof(Gfx)) + DBG_BOX_DLSIZE) {
|
||||||
+ mem_pool_free(gEffectsMemoryPool, sBoxes[i]);
|
|
||||||
+ }
|
|
||||||
+ sNumBoxes = 0;
|
+ sNumBoxes = 0;
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
@@ -264,8 +302,7 @@ index 00000000..0ee87ec7
|
|||||||
+ gSPDisplayList(gDisplayListHead++, dl_debug_box_begin);
|
+ gSPDisplayList(gDisplayListHead++, dl_debug_box_begin);
|
||||||
+
|
+
|
||||||
+ for (i = 0; i < sNumBoxes; ++i) {
|
+ for (i = 0; i < sNumBoxes; ++i) {
|
||||||
+ render_box(sBoxes[i]);
|
+ render_box(i);
|
||||||
+ mem_pool_free(gEffectsMemoryPool, sBoxes[i]);
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ sNumBoxes = 0;
|
+ sNumBoxes = 0;
|
||||||
@@ -275,23 +312,24 @@ new file mode 100644
|
|||||||
index 00000000..cdb3dc9d
|
index 00000000..cdb3dc9d
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/game/debug_box.h
|
+++ b/src/game/debug_box.h
|
||||||
@@ -0,0 +1,25 @@
|
@@ -0,0 +1,26 @@
|
||||||
+#ifndef _DEBUG_DRAW_CUBE_H
|
+#ifndef DEBUG_BOX_H
|
||||||
+#define _DEBUG_DRAW_CUBE_H
|
+#define DEBUG_BOX_H
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
+ * @file debug_box.h
|
+ * @file debug_box.h
|
||||||
+ * Draws debug boxes, see debug_box.inc.c for details
|
+ * Draws debug boxes, see debug_box.c for details
|
||||||
+ */
|
+ */
|
||||||
+
|
+
|
||||||
+#include "types.h"
|
+#include "types.h"
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
+ * The max amount of debug boxes before debug_box() just returns.
|
+ * The max amount of debug boxes before debug_box() just returns.
|
||||||
+ * You can set this to something higher like 1000, but things like text will stop rendering.
|
+ * You can set this to something higher, but you might run out of space in the gfx pool.
|
||||||
+ */
|
+ */
|
||||||
+#define MAX_DEBUG_BOXES 100
|
+#define MAX_DEBUG_BOXES 512
|
||||||
+
|
+
|
||||||
|
+void debug_box_color(u32 color);
|
||||||
+void debug_box(Vec3f center, Vec3f bounds);
|
+void debug_box(Vec3f center, Vec3f bounds);
|
||||||
+void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw);
|
+void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw);
|
||||||
+
|
+
|
||||||
@@ -300,4 +338,4 @@ index 00000000..cdb3dc9d
|
|||||||
+
|
+
|
||||||
+void render_debug_boxes(void);
|
+void render_debug_boxes(void);
|
||||||
+
|
+
|
||||||
+#endif /* _DEBUG_DRAW_CUBE_H */
|
+#endif /* DEBUG_BOX_H */
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ index a3afffee..8b05fcf1 100644
|
|||||||
+ create_thread(&gGameLoopThread, 5, thread5_mem_error_message_loop, NULL, gThread5Stack + 0x2000, 10);
|
+ create_thread(&gGameLoopThread, 5, thread5_mem_error_message_loop, NULL, gThread5Stack + 0x2000, 10);
|
||||||
osStartThread(&gGameLoopThread);
|
osStartThread(&gGameLoopThread);
|
||||||
|
|
||||||
while (1) {
|
while (TRUE) {
|
||||||
diff --git a/src/game/mem_error_screen.c b/src/game/mem_error_screen.c
|
diff --git a/src/game/mem_error_screen.c b/src/game/mem_error_screen.c
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..81efaf91
|
index 00000000..81efaf91
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef EU_TRANSLATION_H
|
#ifndef EU_TRANSLATION_H
|
||||||
#define EU_TRANSLATION_H
|
#define EU_TRANSLATION_H
|
||||||
|
|
||||||
// PAL changes most text to arrays for each language. This define allows these
|
// EU changes most text to arrays for each language. This define allows these
|
||||||
// differences to be combined.
|
// differences to be combined.
|
||||||
#ifdef VERSION_EU
|
#ifdef VERSION_EU
|
||||||
#define LANGUAGE_ARRAY(cmd) cmd[LANGUAGE_FUNCTION]
|
#define LANGUAGE_ARRAY(cmd) cmd[LANGUAGE_FUNCTION]
|
||||||
|
|||||||
@@ -634,15 +634,15 @@
|
|||||||
#define UKIKI_TEXT_DEFAULT 0
|
#define UKIKI_TEXT_DEFAULT 0
|
||||||
#define UKIKI_TEXT_CAGE_TEXTBOX 1
|
#define UKIKI_TEXT_CAGE_TEXTBOX 1
|
||||||
#define UKIKI_TEXT_GO_TO_CAGE 2
|
#define UKIKI_TEXT_GO_TO_CAGE 2
|
||||||
#define UKIKI_TEXT_STOLE_HAT 3
|
#define UKIKI_TEXT_STOLE_CAP 3
|
||||||
#define UKIKI_TEXT_HAS_HAT 4
|
#define UKIKI_TEXT_HAS_CAP 4
|
||||||
#define UKIKI_TEXT_GAVE_HAT_BACK 5
|
#define UKIKI_TEXT_GAVE_CAP_BACK 5
|
||||||
#define UKIKI_TEXT_DO_NOT_LET_GO 6
|
#define UKIKI_TEXT_DO_NOT_LET_GO 6
|
||||||
#define UKIKI_TEXT_STEAL_HAT 7
|
#define UKIKI_TEXT_STEAL_CAP 7
|
||||||
|
|
||||||
/* oBehParams2ndByte */
|
/* oBehParams2ndByte */
|
||||||
#define UKIKI_CAGE 0
|
#define UKIKI_CAGE 0
|
||||||
#define UKIKI_HAT 1
|
#define UKIKI_CAP 1
|
||||||
|
|
||||||
/* Animations */
|
/* Animations */
|
||||||
#define UKIKI_ANIM_RUN 0
|
#define UKIKI_ANIM_RUN 0
|
||||||
@@ -662,10 +662,10 @@
|
|||||||
/* oAnimState */
|
/* oAnimState */
|
||||||
#define UKIKI_ANIM_STATE_DEFAULT 0
|
#define UKIKI_ANIM_STATE_DEFAULT 0
|
||||||
#define UKIKI_ANIM_STATE_EYE_CLOSED 1
|
#define UKIKI_ANIM_STATE_EYE_CLOSED 1
|
||||||
#define UKIKI_ANIM_STATE_HAT_ON 2
|
#define UKIKI_ANIM_STATE_CAP_ON 2
|
||||||
|
|
||||||
/* oUkikiHasHat */
|
/* oUkikiHasCap */
|
||||||
#define UKIKI_HAT_ON 1
|
#define UKIKI_CAP_ON 1
|
||||||
|
|
||||||
/* Ukiki Cage Star */
|
/* Ukiki Cage Star */
|
||||||
/* oAction */
|
/* oAction */
|
||||||
|
|||||||
@@ -504,9 +504,9 @@
|
|||||||
#define /*0x0F8*/ oBlueFlameUnkF8 OBJECT_FIELD_F32(0x1C)
|
#define /*0x0F8*/ oBlueFlameUnkF8 OBJECT_FIELD_F32(0x1C)
|
||||||
|
|
||||||
/* Small Piranha Flame */
|
/* Small Piranha Flame */
|
||||||
#define /*0x0F4*/ oSmallPiranhaFlameUnkF4 OBJECT_FIELD_F32(0x1B)
|
#define /*0x0F4*/ oSmallPiranhaFlameStartSpeed OBJECT_FIELD_F32(0x1B)
|
||||||
#define /*0x0F8*/ oSmallPiranhaFlameUnkF8 OBJECT_FIELD_F32(0x1C)
|
#define /*0x0F8*/ oSmallPiranhaFlameEndSpeed OBJECT_FIELD_F32(0x1C)
|
||||||
#define /*0x0FC*/ oSmallPiranhaFlameUnkFC OBJECT_FIELD_S32(0x1D)
|
#define /*0x0FC*/ oSmallPiranhaFlameModel OBJECT_FIELD_S32(0x1D)
|
||||||
#define /*0x100*/ oSmallPiranhaFlameUnk100 OBJECT_FIELD_S32(0x1E)
|
#define /*0x100*/ oSmallPiranhaFlameUnk100 OBJECT_FIELD_S32(0x1E)
|
||||||
#define /*0x104*/ oSmallPiranhaFlameUnk104 OBJECT_FIELD_F32(0x1F)
|
#define /*0x104*/ oSmallPiranhaFlameUnk104 OBJECT_FIELD_F32(0x1F)
|
||||||
|
|
||||||
@@ -959,7 +959,7 @@
|
|||||||
#define /*0x10C*/ oTiltingPyramidMarioOnPlatform OBJECT_FIELD_S32(0x21)
|
#define /*0x10C*/ oTiltingPyramidMarioOnPlatform OBJECT_FIELD_S32(0x21)
|
||||||
|
|
||||||
/* Toad Message */
|
/* Toad Message */
|
||||||
#define /*0x108*/ oToadMessageDialogId OBJECT_FIELD_U32(0x20)
|
#define /*0x108*/ oToadMessageDialogId OBJECT_FIELD_U32(0x20)
|
||||||
#define /*0x10C*/ oToadMessageRecentlyTalked OBJECT_FIELD_S32(0x21)
|
#define /*0x10C*/ oToadMessageRecentlyTalked OBJECT_FIELD_S32(0x21)
|
||||||
#define /*0x110*/ oToadMessageState OBJECT_FIELD_S32(0x22)
|
#define /*0x110*/ oToadMessageState OBJECT_FIELD_S32(0x22)
|
||||||
|
|
||||||
@@ -1050,7 +1050,7 @@
|
|||||||
#define /*0x1AC*/ oUkikiTextState OBJECT_FIELD_S16(0x49, 0)
|
#define /*0x1AC*/ oUkikiTextState OBJECT_FIELD_S16(0x49, 0)
|
||||||
#define /*0x1AE*/ oUkikiTextboxTimer OBJECT_FIELD_S16(0x49, 1)
|
#define /*0x1AE*/ oUkikiTextboxTimer OBJECT_FIELD_S16(0x49, 1)
|
||||||
#define /*0x1B0*/ oUkikiCageSpinTimer OBJECT_FIELD_S16(0x4A, 0)
|
#define /*0x1B0*/ oUkikiCageSpinTimer OBJECT_FIELD_S16(0x4A, 0)
|
||||||
#define /*0x1B2*/ oUkikiHasHat OBJECT_FIELD_S16(0x4A, 1)
|
#define /*0x1B2*/ oUkikiHasCap OBJECT_FIELD_S16(0x4A, 1)
|
||||||
|
|
||||||
/* Ukiki Cage*/
|
/* Ukiki Cage*/
|
||||||
#define /*0x088*/ oUkikiCageNextAction OBJECT_FIELD_S32(0x00)
|
#define /*0x088*/ oUkikiCageNextAction OBJECT_FIELD_S32(0x00)
|
||||||
@@ -1084,7 +1084,7 @@
|
|||||||
#define /*0x0F4*/ oCannonBarrelBubblesUnkF4 OBJECT_FIELD_F32(0x1B)
|
#define /*0x0F4*/ oCannonBarrelBubblesUnkF4 OBJECT_FIELD_F32(0x1B)
|
||||||
|
|
||||||
/* Water Level Pillar */
|
/* Water Level Pillar */
|
||||||
#define /*0x0F8*/ oWaterLevelPillarUnkF8 OBJECT_FIELD_S32(0x1C)
|
#define /*0x0F8*/ oWaterLevelPillarDrained OBJECT_FIELD_S32(0x1C)
|
||||||
|
|
||||||
/* Water Level Trigger */
|
/* Water Level Trigger */
|
||||||
#define /*0x0F4*/ oWaterLevelTriggerUnkF4 OBJECT_FIELD_S32(0x1B)
|
#define /*0x0F4*/ oWaterLevelTriggerUnkF4 OBJECT_FIELD_S32(0x1B)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define SEG_BUFFERS 0x8005C000 // 0x0085000 in size
|
#define SEG_BUFFERS 0x8005C000 // 0x0085000 in size
|
||||||
#define SEG_MAIN 0x800E1000 // 0x1328000 in size
|
#define SEG_MAIN 0x800E1000 // 0x0132800 in size
|
||||||
#define SEG_ENGINE 0x80213800 // 0x0017000 in size
|
#define SEG_ENGINE 0x80213800 // 0x0017000 in size
|
||||||
#define SEG_FRAMEBUFFERS 0x8022A800 // 0x0070800 in size
|
#define SEG_FRAMEBUFFERS 0x8022A800 // 0x0070800 in size
|
||||||
#define SEG_POOL_START 0x8029B000 // 0x0165000 in size
|
#define SEG_POOL_START 0x8029B000 // 0x0165000 in size
|
||||||
|
|||||||
@@ -132,7 +132,8 @@
|
|||||||
#define MARIO_UNKNOWN_30 0x40000000
|
#define MARIO_UNKNOWN_30 0x40000000
|
||||||
#define MARIO_UNKNOWN_31 0x80000000
|
#define MARIO_UNKNOWN_31 0x80000000
|
||||||
|
|
||||||
#define MARIO_CAP_FLAGS 0x0000001F
|
#define MARIO_SPECIAL_CAPS (MARIO_VANISH_CAP | MARIO_METAL_CAP | MARIO_WING_CAP)
|
||||||
|
#define MARIO_CAPS (MARIO_NORMAL_CAP | MARIO_SPECIAL_CAPS)
|
||||||
|
|
||||||
#define ACT_ID_MASK 0x000001FF
|
#define ACT_ID_MASK 0x000001FF
|
||||||
|
|
||||||
@@ -183,6 +184,7 @@
|
|||||||
#define ACT_COUGHING 0x0C40020A // (0x00A | ACT_FLAG_STATIONARY | ACT_FLAG_IDLE | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
#define ACT_COUGHING 0x0C40020A // (0x00A | ACT_FLAG_STATIONARY | ACT_FLAG_IDLE | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
||||||
#define ACT_SHIVERING 0x0C40020B // (0x00B | ACT_FLAG_STATIONARY | ACT_FLAG_IDLE | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
#define ACT_SHIVERING 0x0C40020B // (0x00B | ACT_FLAG_STATIONARY | ACT_FLAG_IDLE | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
||||||
#define ACT_IN_QUICKSAND 0x0002020D // (0x00D | ACT_FLAG_STATIONARY | ACT_FLAG_INVULNERABLE)
|
#define ACT_IN_QUICKSAND 0x0002020D // (0x00D | ACT_FLAG_STATIONARY | ACT_FLAG_INVULNERABLE)
|
||||||
|
#define ACT_UNKNOWN_0002020E 0x0002020E // (0x00E | ACT_FLAG_STATIONARY | ACT_FLAG_INVULNERABLE)
|
||||||
#define ACT_CROUCHING 0x0C008220 // (0x020 | ACT_FLAG_STATIONARY | ACT_FLAG_SHORT_HITBOX | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
#define ACT_CROUCHING 0x0C008220 // (0x020 | ACT_FLAG_STATIONARY | ACT_FLAG_SHORT_HITBOX | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
||||||
#define ACT_START_CROUCHING 0x0C008221 // (0x021 | ACT_FLAG_STATIONARY | ACT_FLAG_SHORT_HITBOX | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
#define ACT_START_CROUCHING 0x0C008221 // (0x021 | ACT_FLAG_STATIONARY | ACT_FLAG_SHORT_HITBOX | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
||||||
#define ACT_STOP_CROUCHING 0x0C008222 // (0x022 | ACT_FLAG_STATIONARY | ACT_FLAG_SHORT_HITBOX | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
#define ACT_STOP_CROUCHING 0x0C008222 // (0x022 | ACT_FLAG_STATIONARY | ACT_FLAG_SHORT_HITBOX | ACT_FLAG_ALLOW_FIRST_PERSON | ACT_FLAG_PAUSE_EXIT)
|
||||||
|
|||||||
@@ -86,11 +86,11 @@ struct VblankHandler
|
|||||||
|
|
||||||
struct Animation {
|
struct Animation {
|
||||||
/*0x00*/ s16 flags;
|
/*0x00*/ s16 flags;
|
||||||
/*0x02*/ s16 unk02;
|
/*0x02*/ s16 animYTransDivisor;
|
||||||
/*0x04*/ s16 unk04;
|
/*0x04*/ s16 startFrame;
|
||||||
/*0x06*/ s16 unk06;
|
/*0x06*/ s16 loopStart;
|
||||||
/*0x08*/ s16 unk08;
|
/*0x08*/ s16 loopEnd;
|
||||||
/*0x0A*/ s16 unk0A;
|
/*0x0A*/ s16 unusedBoneCount;
|
||||||
/*0x0C*/ const s16 *values;
|
/*0x0C*/ const s16 *values;
|
||||||
/*0x10*/ const u16 *index;
|
/*0x10*/ const u16 *index;
|
||||||
/*0x14*/ u32 length; // only used with Mario animations to determine how much to load. 0 otherwise.
|
/*0x14*/ u32 length; // only used with Mario animations to determine how much to load. 0 otherwise.
|
||||||
@@ -108,8 +108,7 @@ struct GraphNode
|
|||||||
/*0x10*/ struct GraphNode *children;
|
/*0x10*/ struct GraphNode *children;
|
||||||
};
|
};
|
||||||
|
|
||||||
// struct AnimInfo?
|
struct AnimInfo
|
||||||
struct GraphNodeObject_sub
|
|
||||||
{
|
{
|
||||||
/*0x00 0x38*/ s16 animID;
|
/*0x00 0x38*/ s16 animID;
|
||||||
/*0x02 0x3A*/ s16 animYTrans;
|
/*0x02 0x3A*/ s16 animYTrans;
|
||||||
@@ -124,12 +123,12 @@ struct GraphNodeObject
|
|||||||
{
|
{
|
||||||
/*0x00*/ struct GraphNode node;
|
/*0x00*/ struct GraphNode node;
|
||||||
/*0x14*/ struct GraphNode *sharedChild;
|
/*0x14*/ struct GraphNode *sharedChild;
|
||||||
/*0x18*/ s8 unk18;
|
/*0x18*/ s8 areaIndex;
|
||||||
/*0x19*/ s8 unk19;
|
/*0x19*/ s8 activeAreaIndex;
|
||||||
/*0x1A*/ Vec3s angle;
|
/*0x1A*/ Vec3s angle;
|
||||||
/*0x20*/ Vec3f pos;
|
/*0x20*/ Vec3f pos;
|
||||||
/*0x2C*/ Vec3f scale;
|
/*0x2C*/ Vec3f scale;
|
||||||
/*0x38*/ struct GraphNodeObject_sub unk38;
|
/*0x38*/ struct AnimInfo animInfo;
|
||||||
/*0x4C*/ struct SpawnInfo *unk4C;
|
/*0x4C*/ struct SpawnInfo *unk4C;
|
||||||
/*0x50*/ Mat4 *throwMatrix; // matrix ptr
|
/*0x50*/ Mat4 *throwMatrix; // matrix ptr
|
||||||
/*0x54*/ Vec3f cameraToObject;
|
/*0x54*/ Vec3f cameraToObject;
|
||||||
|
|||||||
@@ -12,15 +12,12 @@ void osViSetSpecialFeatures(u32 func) {
|
|||||||
D_80334914->features |= OS_VI_GAMMA_DITHER;
|
D_80334914->features |= OS_VI_GAMMA_DITHER;
|
||||||
}
|
}
|
||||||
if (func & OS_VI_GAMMA_DITHER_OFF) {
|
if (func & OS_VI_GAMMA_DITHER_OFF) {
|
||||||
|
|
||||||
D_80334914->features &= ~OS_VI_GAMMA_DITHER;
|
D_80334914->features &= ~OS_VI_GAMMA_DITHER;
|
||||||
}
|
}
|
||||||
if (func & OS_VI_DIVOT_ON) {
|
if (func & OS_VI_DIVOT_ON) {
|
||||||
|
|
||||||
D_80334914->features |= OS_VI_DIVOT;
|
D_80334914->features |= OS_VI_DIVOT;
|
||||||
}
|
}
|
||||||
if (func & OS_VI_DIVOT_OFF) {
|
if (func & OS_VI_DIVOT_OFF) {
|
||||||
|
|
||||||
D_80334914->features &= ~OS_VI_DIVOT;
|
D_80334914->features &= ~OS_VI_DIVOT;
|
||||||
}
|
}
|
||||||
if (func & OS_VI_DITHER_FILTER_ON) {
|
if (func & OS_VI_DITHER_FILTER_ON) {
|
||||||
|
|||||||
6
sm64.ld
6
sm64.ld
@@ -420,6 +420,12 @@ SECTIONS
|
|||||||
/* wildcard doesn't match on EU due to files being moved to engine/ */
|
/* wildcard doesn't match on EU due to files being moved to engine/ */
|
||||||
BUILD_DIR/src/game*.o(.data*);
|
BUILD_DIR/src/game*.o(.data*);
|
||||||
#endif
|
#endif
|
||||||
|
BUILD_DIR/src/audio/synthesis.o(.data*);
|
||||||
|
BUILD_DIR/src/audio/heap.o(.data*);
|
||||||
|
BUILD_DIR/src/audio/load.o(.data*);
|
||||||
|
BUILD_DIR/src/audio/playback.o(.data*);
|
||||||
|
BUILD_DIR/src/audio/effects.o(.data*);
|
||||||
|
BUILD_DIR/src/audio/seqplayer.o(.data*);
|
||||||
BUILD_DIR/src/audio/external.o(.data*);
|
BUILD_DIR/src/audio/external.o(.data*);
|
||||||
BUILD_DIR/src/audio/port_eu.o(.data*);
|
BUILD_DIR/src/audio/port_eu.o(.data*);
|
||||||
BUILD_DIR/src/audio/data.o(.data*);
|
BUILD_DIR/src/audio/data.o(.data*);
|
||||||
|
|||||||
@@ -333,11 +333,11 @@ s16 gEuUnknownWave7[256] = {
|
|||||||
0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e,
|
0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e,
|
||||||
0x0000, 0x1eb2, 0xb1e0, 0x72d2,
|
0x0000, 0x1eb2, 0xb1e0, 0x72d2,
|
||||||
};
|
};
|
||||||
// u8 buffer_remove2[764] = { 0 };
|
|
||||||
s16 *gWaveSamples[6] = { sSawtoothWaves, sTriangleWaves, sSineWaves, sSquareWaves, sEuUnknownWave6, gEuUnknownWave7 };
|
s16 *gWaveSamples[6] = { sSawtoothWaves, sTriangleWaves, sSineWaves, sSquareWaves, sEuUnknownWave6, gEuUnknownWave7 };
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef VERSION_EU
|
#else
|
||||||
|
// !VERSION_EU
|
||||||
|
|
||||||
s16 sSineWave[0x40] = {
|
s16 sSineWave[0x40] = {
|
||||||
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244,
|
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244,
|
||||||
28897, 30272, 31356, 32137, 32609, 0x7FFF, 32609, 32137, 31356, 30272, 28897,
|
28897, 30272, 31356, 32137, 32609, 0x7FFF, 32609, 32137, 31356, 30272, 28897,
|
||||||
@@ -584,7 +584,7 @@ f32 gVolRampingRhs128[128] = {
|
|||||||
s16 gTatumsPerBeat = TATUMS_PER_BEAT;
|
s16 gTatumsPerBeat = TATUMS_PER_BEAT;
|
||||||
s8 gUnusedCount80333EE8 = UNUSED_COUNT_80333EE8;
|
s8 gUnusedCount80333EE8 = UNUSED_COUNT_80333EE8;
|
||||||
s32 gAudioHeapSize = DOUBLE_SIZE_ON_64_BIT(AUDIO_HEAP_SIZE);
|
s32 gAudioHeapSize = DOUBLE_SIZE_ON_64_BIT(AUDIO_HEAP_SIZE);
|
||||||
s32 D_80333EF0 = DOUBLE_SIZE_ON_64_BIT(D_80333EF0_VAL);
|
s32 gAudioInitPoolSize = DOUBLE_SIZE_ON_64_BIT(AUDIO_INIT_POOL_SIZE);
|
||||||
volatile s32 gAudioLoadLock = AUDIO_LOCK_UNINITIALIZED;
|
volatile s32 gAudioLoadLock = AUDIO_LOCK_UNINITIALIZED;
|
||||||
|
|
||||||
#ifdef VERSION_EU
|
#ifdef VERSION_EU
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ extern f32 gVolRampingRhs128[128];
|
|||||||
// non-constant .data
|
// non-constant .data
|
||||||
extern s16 gTatumsPerBeat;
|
extern s16 gTatumsPerBeat;
|
||||||
extern s8 gUnusedCount80333EE8;
|
extern s8 gUnusedCount80333EE8;
|
||||||
extern s32 gAudioHeapSize;
|
extern s32 gAudioHeapSize; // AUDIO_HEAP_SIZE
|
||||||
extern s32 D_80333EF0; // amount of heap designated to gAudioInitPool, 0x2500
|
extern s32 gAudioInitPoolSize; // AUDIO_INIT_POOL_SIZE
|
||||||
extern volatile s32 gAudioLoadLock;
|
extern volatile s32 gAudioLoadLock;
|
||||||
|
|
||||||
// .bss
|
// .bss
|
||||||
@@ -103,15 +103,14 @@ extern u16 gUnused80226E98[0x10];
|
|||||||
|
|
||||||
extern u32 gAudioRandom;
|
extern u32 gAudioRandom;
|
||||||
|
|
||||||
//make my life easier
|
|
||||||
#ifdef VERSION_EU
|
#ifdef VERSION_EU
|
||||||
#define UNUSED_COUNT_80333EE8 24
|
#define UNUSED_COUNT_80333EE8 24
|
||||||
#define AUDIO_HEAP_SIZE 0x2c500
|
#define AUDIO_HEAP_SIZE 0x2c500
|
||||||
#define D_80333EF0_VAL 0x2c00
|
#define AUDIO_INIT_POOL_SIZE 0x2c00
|
||||||
#else
|
#else
|
||||||
#define UNUSED_COUNT_80333EE8 16
|
#define UNUSED_COUNT_80333EE8 16
|
||||||
#define AUDIO_HEAP_SIZE 0x31150
|
#define AUDIO_HEAP_SIZE 0x31150
|
||||||
#define D_80333EF0_VAL 0x2500
|
#define AUDIO_INIT_POOL_SIZE 0x2500
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -502,6 +502,7 @@ s32 adsr_update(struct AdsrState *adsr) {
|
|||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
if (adsr->current > 1.0f) {
|
if (adsr->current > 1.0f) {
|
||||||
|
eu_stubbed_printf_1("Audio:Envp: overflow %f\n", adsr->current);
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
return adsr->current;
|
return adsr->current;
|
||||||
|
|||||||
@@ -19,136 +19,6 @@
|
|||||||
#define EU_FLOAT(x) x
|
#define EU_FLOAT(x) x
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VERSION_EU
|
|
||||||
u8 audioString1[] = "pitch %x: delaybytes %d : olddelay %d\n";
|
|
||||||
u8 audioString2[] = "cont %x: delaybytes %d : olddelay %d\n";
|
|
||||||
u8 audioString3[] = "Warning:Kill Note %x \n";
|
|
||||||
u8 audioString4[] = "Kill Voice %d (ID %d) %d\n";
|
|
||||||
u8 audioString5[] = "Warning: Running Sequence's data disappear!\n";
|
|
||||||
u8 audioString6[] = "Heap OverFlow : Not Allocate %d!\n";
|
|
||||||
u8 audioString7[] = "DataHeap Not Allocate \n";
|
|
||||||
u8 audioString8[] = "StayHeap Not Allocate %d\n";
|
|
||||||
u8 audioString9[] = "AutoHeap Not Allocate %d\n";
|
|
||||||
u8 audioString10[] = "WARNING: NO FREE AUTOSEQ AREA.\n";
|
|
||||||
u8 audioString11[] = "WARNING: NO STOP AUTO AREA.\n";
|
|
||||||
u8 audioString12[] = " AND TRY FORCE TO STOP SIDE \n";
|
|
||||||
u8 audioString13[] = "TWO SIDES ARE LOADING... ALLOC CANCELED.\n";
|
|
||||||
u8 audioString14[] = "WARNING: Before Area Overlaid After.";
|
|
||||||
u8 audioString15[] = "WARNING: After Area Overlaid Before.";
|
|
||||||
u8 audioString16[] = "MEMORY:SzHeapAlloc ERROR: sza->side %d\n";
|
|
||||||
u8 audioString17[] = "MEMORY:StayHeap OVERFLOW.";
|
|
||||||
u8 audioString18[] = "MEMORY:StayHeap OVERFLOW (REQ:%d)";
|
|
||||||
u8 audioString19[] = "Auto Heap Unhit for ID %d\n";
|
|
||||||
u8 audioString20[] = "Cache hit %d at stay %d\n";
|
|
||||||
u8 audioString20_[] = "%d ";
|
|
||||||
u8 audioString20__[] = "\n";
|
|
||||||
u8 audioString20___[] = "%d ";
|
|
||||||
u8 audioString20____[] = "\n";
|
|
||||||
u8 audioString21[] = "Heap Reconstruct Start %x\n";
|
|
||||||
u8 audioString22[] = "SFrame Sample %d %d %d\n";
|
|
||||||
u8 audioString23[] = "AHPBASE %x\n";
|
|
||||||
u8 audioString24[] = "AHPCUR %x\n";
|
|
||||||
u8 audioString25[] = "HeapTop %x\n";
|
|
||||||
u8 audioString26[] = "SynoutRate %d / %d \n";
|
|
||||||
u8 audioString27[] = "FXSIZE %d\n";
|
|
||||||
u8 audioString28[] = "FXCOMP %d\n";
|
|
||||||
u8 audioString29[] = "FXDOWN %d\n";
|
|
||||||
u8 audioString30[] = "WaveCacheLen: %d\n";
|
|
||||||
u8 audioString31[] = "SpecChange Finished\n";
|
|
||||||
u8 audioString31_[] = "";
|
|
||||||
u8 audioString32[] = "Romcopy %x -> %x ,size %x\n";
|
|
||||||
u8 audioString33[] = "Romcopyend\n";
|
|
||||||
u8 audioString34[] = "CAUTION:WAVE CACHE FULL %d";
|
|
||||||
u8 audioString35[] = "BASE %x %x\n";
|
|
||||||
u8 audioString36[] = "LOAD %x %x %x\n";
|
|
||||||
u8 audioString37[] = "INSTTOP %x\n";
|
|
||||||
u8 audioString38[] = "INSTMAP[0] %x\n";
|
|
||||||
u8 audioString39[] = "already flags %d\n";
|
|
||||||
u8 audioString40[] = "already flags %d\n";
|
|
||||||
u8 audioString41[] = "ERR:SLOW BANK DMA BUSY\n";
|
|
||||||
u8 audioString42[] = "ERR:SLOW DMA BUSY\n";
|
|
||||||
u8 audioString43[] = "Check %d bank %d\n";
|
|
||||||
u8 audioString44[] = "Cache Check\n";
|
|
||||||
u8 audioString45[] = "NO BANK ERROR\n";
|
|
||||||
u8 audioString46[] = "BANK %d LOADING START\n";
|
|
||||||
u8 audioString47[] = "BANK %d LOAD MISS (NO MEMORY)!\n";
|
|
||||||
u8 audioString48[] = "BANK %d ALREADY CACHED\n";
|
|
||||||
u8 audioString49[] = "BANK LOAD MISS! FOR %d\n";
|
|
||||||
u8 audioString50[] = "Seq %d Loading Start\n";
|
|
||||||
u8 audioString51[] = "Heap Overflow Error\n";
|
|
||||||
u8 audioString52[] = "SEQ %d ALREADY CACHED\n";
|
|
||||||
u8 audioString53[] = "Ok,one bank slow load Start \n";
|
|
||||||
u8 audioString54[] = "Sorry,too many %d bank is none.fast load Start \n";
|
|
||||||
u8 audioString55[] = "Seq %d:Default Load Id is %d\n";
|
|
||||||
u8 audioString56[] = "Seq Loading Start\n";
|
|
||||||
u8 audioString57[] = "Error:Before Sequence-SlowDma remain.\n";
|
|
||||||
u8 audioString58[] = " Cancel Seq Start.\n";
|
|
||||||
u8 audioString59[] = "SEQ %d ALREADY CACHED\n";
|
|
||||||
u8 audioString60[] = "Clear Workarea %x -%x size %x \n";
|
|
||||||
u8 audioString61[] = "AudioHeap is %x\n";
|
|
||||||
u8 audioString62[] = "Heap reset.Synth Change %x \n";
|
|
||||||
u8 audioString63[] = "Heap %x %x %x\n";
|
|
||||||
u8 audioString64[] = "Main Heap Initialize.\n";
|
|
||||||
u8 audioString65[] = "---------- Init Completed. ------------\n";
|
|
||||||
u8 audioString66[] = " Syndrv :[%6d]\n";
|
|
||||||
u8 audioString67[] = " Seqdrv :[%6d]\n";
|
|
||||||
u8 audioString68[] = " audiodata :[%6d]\n";
|
|
||||||
u8 audioString69[] = "---------------------------------------\n";
|
|
||||||
u8 audioString69_[] = "";
|
|
||||||
u8 audioString70[] = "Audio: setvol: volume minus %f\n";
|
|
||||||
u8 audioString71[] = "Audio: setvol: volume overflow %f\n";
|
|
||||||
u8 audioString72[] = "Audio: setpitch: pitch minus %f\n";
|
|
||||||
u8 audioString73[] = "Audio: voiceman: No bank error %d\n";
|
|
||||||
u8 audioString74[] = "Audio: voiceman: progNo. overflow %d,%d\n";
|
|
||||||
u8 audioString75[] = "Audio: voiceman: progNo. undefined %d,%d\n";
|
|
||||||
u8 audioString76[] = "Audio: voiceman: BAD Voicepointer %x,%d,%d\n";
|
|
||||||
u8 audioString77[] = "Audio: voiceman: Percussion Overflow %d,%d\n";
|
|
||||||
u8 audioString78[] = "Percussion Pointer Error\n";
|
|
||||||
u8 audioString79[] = "Audio: voiceman: Percpointer NULL %d,%d\n";
|
|
||||||
u8 audioString80[] = "CAUTION:SUB IS SEPARATED FROM GROUP";
|
|
||||||
u8 audioString81[] = "Error:Wait Track disappear\n";
|
|
||||||
u8 audioString82[] = "Slow Release Batting\n";
|
|
||||||
u8 audioString83[] = "Audio:Wavemem: Bad voiceno (%d)\n";
|
|
||||||
u8 audioString84[] = "Audio: C-Alloc : Dealloc voice is NULL\n";
|
|
||||||
u8 audioString85[] = "Alloc Error:Dim voice-Alloc %d";
|
|
||||||
u8 audioString86[] = "Error:Same List Add\n";
|
|
||||||
u8 audioString87[] = "Already Cut\n";
|
|
||||||
u8 audioString88[] = "Audio: C-Alloc : lowerPrio is NULL\n";
|
|
||||||
u8 audioString89[] = "Sub Limited Warning: Drop Voice";
|
|
||||||
u8 audioString90[] = "Warning: Drop Voice";
|
|
||||||
u8 audioString91[] = "Warning: Drop Voice";
|
|
||||||
u8 audioString92[] = "Warning: Drop Voice";
|
|
||||||
u8 audioString93[] = "Audio:Envp: overflow %f\n";
|
|
||||||
u8 audioString93_[] = "";
|
|
||||||
u8 audioString94[] = "Audio:Track:Warning: No Free Notetrack\n";
|
|
||||||
u8 audioString95[] = "SUBTRACK DIM\n";
|
|
||||||
u8 audioString96[] = "Audio:Track: Warning SUBTRACK PARENT CHANGED\n";
|
|
||||||
u8 audioString97[] = "GROUP 0:";
|
|
||||||
u8 audioString98[] = "GROUP 1:";
|
|
||||||
u8 audioString99[] = "SEQID %d,BANKID %d\n";
|
|
||||||
u8 audioString100[] = "ERR:SUBTRACK %d NOT ALLOCATED\n";
|
|
||||||
u8 audioString101[] = "Error:Same List Add\n";
|
|
||||||
u8 audioString102[] = "Macro Level Over Error!\n";
|
|
||||||
u8 audioString103[] = "Macro Level Over Error!\n";
|
|
||||||
u8 audioString104[] = "WARNING: NPRG: cannot change %d\n";
|
|
||||||
u8 audioString105[] = "Audio:Track:NOTE:UNDEFINED NOTE COM. %x\n";
|
|
||||||
u8 audioString106[] = "Audio: Note:Velocity Error %d\n";
|
|
||||||
u8 audioString107[] = "Error: Your assignchannel is stolen.\n";
|
|
||||||
u8 audioString108[] = "Audio:Track :Call Macro Level Over Error!\n";
|
|
||||||
u8 audioString109[] = "Audio:Track :Loops Macro Level Over Error!\n";
|
|
||||||
u8 audioString110[] = "SUB:ERR:BANK %d NOT CACHED.\n";
|
|
||||||
u8 audioString111[] = "SUB:ERR:BANK %d NOT CACHED.\n";
|
|
||||||
u8 audioString112[] = "Audio:Track: CTBLCALL Macro Level Over Error!\n";
|
|
||||||
u8 audioString113[] = "Err :Sub %x ,address %x:Undefined SubTrack Function %x";
|
|
||||||
u8 audioString114[] = "Disappear Sequence or Bank %d\n";
|
|
||||||
u8 audioString115[] = "Macro Level Over Error!\n";
|
|
||||||
u8 audioString116[] = "Macro Level Over Error!\n";
|
|
||||||
u8 audioString117[] = "Group:Undefine upper C0h command (%x)\n";
|
|
||||||
u8 audioString118[] = "Group:Undefined Command\n";
|
|
||||||
u8 audioString118_[] = "";
|
|
||||||
u8 audioString118__[] = "";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// N.B. sound banks are different from the audio banks referred to in other
|
// N.B. sound banks are different from the audio banks referred to in other
|
||||||
// files. We should really fix our naming to be less ambiguous...
|
// files. We should really fix our naming to be less ambiguous...
|
||||||
#define MAX_BG_MUSIC_QUEUE_SIZE 6
|
#define MAX_BG_MUSIC_QUEUE_SIZE 6
|
||||||
@@ -160,15 +30,6 @@ u8 audioString118__[] = "";
|
|||||||
#define SAMPLES_TO_OVERPRODUCE 0x10
|
#define SAMPLES_TO_OVERPRODUCE 0x10
|
||||||
#define EXTRA_BUFFERED_AI_SAMPLES_TARGET 0x40
|
#define EXTRA_BUFFERED_AI_SAMPLES_TARGET 0x40
|
||||||
|
|
||||||
// No-op printf macro which leaves string literals in rodata in IDO. (IDO
|
|
||||||
// doesn't support variadic macros, so instead they let the parameter list
|
|
||||||
// expand to a no-op comma expression.) See also goddard/gd_main.h.
|
|
||||||
#ifdef __sgi
|
|
||||||
#define stubbed_printf
|
|
||||||
#else
|
|
||||||
#define stubbed_printf(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct Sound {
|
struct Sound {
|
||||||
s32 soundBits;
|
s32 soundBits;
|
||||||
f32 *position;
|
f32 *position;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user