Refresh 12

This commit is contained in:
n64
2020-09-20 11:15:47 -04:00
parent 9214dddabc
commit 8b872a71e8
137 changed files with 2102 additions and 1582 deletions

20
CHANGES
View File

@@ -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
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)
3.) Avoid UB in synthesis_resample_and_mix_reverb (#1048)
4.) Change some void * to correct type (#1047)

View File

@@ -528,8 +528,6 @@ $(BUILD_DIR)/actors/%.o: OPT_FLAGS := -g
$(BUILD_DIR)/bin/%.o: OPT_FLAGS := -g
$(BUILD_DIR)/src/goddard/%.o: OPT_FLAGS := -g
$(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/math/ll%.o: MIPSISET := -mips3 -32
$(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/sprintf.o: OPT_FLAGS := -O3
# enable loop unrolling except for external.c (external.c might also have used
# unrolling, but it makes one loop harder to match)
$(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2
$(BUILD_DIR)/src/audio/load.o: OPT_FLAGS := -O2
# Enable loop unrolling except for external.c (external.c might also have used
# unrolling, but it makes one loop harder to match).
# For all audio files other than external.c and port_eu.c, put string literals
# 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
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
# 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/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

View File

@@ -138,36 +138,34 @@ docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 --user $UID:
Resulting artifacts can be found in the `build` directory.
## Project Structure
```
sm64
├── actors: object behaviors, geo layout, and display lists
├── asm: handwritten assembly code, rom header
│ └── non_matchings: asm for non-matching sections
├── assets: animation and demo data
── anims: animation data
│ └── demos: demo data
├── bin: C files for ordering display lists and textures
├── build: output directory
├── data: behavior scripts, misc. data
├── doxygen: documentation infrastructure
├── enhancements: example source modifications
├── include: header files
├── levels: level scripts, geo layout, and display lists
├── lib: SDK library code
├── rsp: audio and Fast3D RSP assembly code
├── sound: sequences, sound samples, and sound banks
├── src: C source code for game
│ ├── audio: audio code
│ ├── buffers: stacks, heaps, and task buffers
│ ├── engine: script processing engines and utils
│ ├── game: behaviors and rest of game source
── goddard: Mario intro screen
│ └── menu: title screen and file, act, and debug level selection menus
├── text: dialog, level names, act names
── textures: skybox and generic texture data
└── tools: build tools
```
sm64
├── actors: object behaviors, geo layout, and display lists
├── asm: handwritten assembly code, rom header
│ └── non_matchings: asm for non-matching sections
├── assets: animation and demo data
├── anims: animation data
── demos: demo data
├── bin: C files for ordering display lists and textures
├── build: output directory
├── data: behavior scripts, misc. data
├── doxygen: documentation infrastructure
├── enhancements: example source modifications
├── include: header files
├── levels: level scripts, geo layout, and display lists
├── lib: SDK library code
├── rsp: audio and Fast3D RSP assembly code
├── sound: sequences, sound samples, and sound banks
├── src: C source code for game
│ ├── audio: audio code
│ ├── buffers: stacks, heaps, and task buffers
│ ├── engine: script processing engines and utils
│ ├── game: behaviors and rest of game source
│ ├── goddard: Mario intro screen
── menu: title screen and file, act, and debug level selection menus
├── text: dialog, level names, act names
├── textures: skybox and generic texture data
── tools: build tools
## 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.
Official Discord: https://discord.gg/DuYH3Fh
Official Discord: [discord.gg/DuYH3Fh](https://discord.gg/DuYH3Fh)

View File

@@ -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_alignment 4
glabel jtbl_EU_80306714

View File

@@ -5,7 +5,7 @@
.byte 0x80, 0x37, 0x12, 0x40 /* PI BSD Domain 1 register */
.word 0x0000000F /* Clockrate setting*/
.word entry_point /* Entrypoint */
.word entry_point /* Entrypoint */
/* Revision */
.if VERSION_SH == 1
@@ -39,8 +39,7 @@
.endif
.if VERSION_SH == 1
.byte 0x03 /* Version (Shindou) */
.byte 0x03 /* Version (Shindou) */
.else
.byte 0x00 /* Version */
.endif

460
diff.py

File diff suppressed because it is too large Load Diff

View File

@@ -8,24 +8,24 @@ index 240605d8..88c1a314 100644
#include "save_file.h"
#include "level_table.h"
+#include "debug_box.h"
struct SpawnInfo gPlayerSpawnInfos[1];
struct GraphNode *D_8033A160[0x100];
@@ -353,6 +354,8 @@ void render_game(void) {
if (gCurrentArea != NULL && !gWarpTransition.pauseRendering) {
geo_process_root(gCurrentArea->unk04, D_8032CE74, D_8032CE78, gFBSetColor);
+ render_debug_boxes();
+
gSPViewport(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_8032CF00));
gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 0, BORDER_HEIGHT, SCREEN_WIDTH,
diff --git a/src/game/debug_box.c b/src/game/debug_box.c
new file mode 100644
index 00000000..0ee87ec7
--- /dev/null
+++ b/src/game/debug_box.c
@@ -0,0 +1,244 @@
@@ -0,0 +1,281 @@
+#include <ultra64.h>
+
+#include "sm64.h"
@@ -52,7 +52,7 @@ index 00000000..0ee87ec7
+ * gSPViewport(...);
+ * gDPSetScissor(...);
+ * //...
+ *
+ *
+ * Now just call debug_box() whenever you want to draw one!
+ *
+ * debug_box by default takes two arguments: a center and bounds vec3f.
@@ -67,24 +67,39 @@ index 00000000..0ee87ec7
+ * Internal struct containing box info
+ */
+struct DebugBox {
+ u32 color;
+ Vec3s center;
+ Vec3s bounds;
+ s16 yaw;
+};
+
+struct DebugBox *sBoxes[MAX_DEBUG_BOXES];
+struct DebugBox sBoxes[MAX_DEBUG_BOXES];
+s16 sNumBoxes = 0;
+
+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
@@ -107,14 +122,14 @@ index 00000000..0ee87ec7
+ * Actually draws the box
+ */
+static const Gfx dl_debug_draw_box[] = {
+ gsSP2Triangles( 0, 1, 2, 0x0, 2, 1, 3, 0x0),
+ gsSP2Triangles( 2, 3, 6, 0x0, 6, 3, 7, 0x0),
+ gsSP2Triangles(5, 4, 6, 0x0, 5, 6, 7, 0x0), // front
+ gsSP2Triangles(0, 1, 2, 0x0, 2, 1, 3, 0x0), // back
+
+ gsSP2Triangles( 4, 0, 2, 0x0, 2, 6, 4, 0x0),
+ gsSP2Triangles( 1, 5, 3, 0x0, 3, 5, 7, 0x0),
+
+ gsSP2Triangles( 1, 0, 4, 0x0, 1, 4, 5, 0x0),
+ gsSP2Triangles( 5, 4, 6, 0x0, 5, 6, 7, 0x0),
+ gsSP2Triangles(4, 0, 2, 0x0, 2, 6, 4, 0x0), // left
+ gsSP2Triangles(1, 5, 3, 0x0, 3, 5, 7, 0x0), // right
+
+ gsSP2Triangles(1, 0, 4, 0x0, 1, 4, 5, 0x0), // top
+ gsSP2Triangles(2, 3, 6, 0x0, 6, 3, 7, 0x0), // bottom
+
+ gsSPEndDisplayList(),
+};
@@ -126,20 +141,32 @@ index 00000000..0ee87ec7
+ */
+static void append_debug_box(Vec3f center, Vec3f bounds, s16 yaw)
+{
+ if (sNumBoxes >= MAX_DEBUG_BOXES ||
+ (sBoxes[sNumBoxes] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct DebugBox))) == NULL) {
+ if (sNumBoxes >= MAX_DEBUG_BOXES) {
+ return;
+ }
+
+ vec3f_to_vec3s(sBoxes[sNumBoxes]->center, center);
+ vec3f_to_vec3s(sBoxes[sNumBoxes]->bounds, bounds);
+ vec3f_to_vec3s(sBoxes[sNumBoxes].center, center);
+ vec3f_to_vec3s(sBoxes[sNumBoxes].bounds, bounds);
+
+ sBoxes[sNumBoxes]->yaw = yaw;
+ sBoxes[sNumBoxes].yaw = yaw;
+ sBoxes[sNumBoxes].color = sCurBoxColor;
+
+ ++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)
+ * To draw a rotated box, use debug_box_rot()
+ *
@@ -176,9 +203,9 @@ index 00000000..0ee87ec7
+{
+ Vec3f center, bounds;
+
+ bounds[0] = pMax[0] - pMin[0] / 2.0f;
+ bounds[1] = pMax[1] - pMin[1] / 2.0f;
+ bounds[2] = pMax[2] - pMin[2] / 2.0f;
+ bounds[0] = (pMax[0] - pMin[0]) / 2.0f;
+ bounds[1] = (pMax[1] - pMin[1]) / 2.0f;
+ bounds[2] = (pMax[2] - pMin[2]) / 2.0f;
+
+ center[0] = pMin[0] + bounds[0];
+ center[1] = pMin[1] + bounds[1];
@@ -187,12 +214,15 @@ index 00000000..0ee87ec7
+ 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 *rotate;
+ Mtx *translateback;
+ struct DebugBox *box = &sBoxes[index];
+ u32 color = box->color;
+
+ s32 x0 = box->center[0],
+ y0 = box->center[1],
+ z0 = box->center[2];
@@ -201,6 +231,13 @@ index 00000000..0ee87ec7
+ yb = box->bounds[1],
+ 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 (box->yaw != 0) {
+ // Translate to the origin, rotate, then translate back, effectively rotating the box about
@@ -217,7 +254,8 @@ index 00000000..0ee87ec7
+ gSPMatrix(gDisplayListHead++, rotate, 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)
+ DBG_BOX_VTX(0, x0 - xb, y0 + yb, z0 - zb);
+ DBG_BOX_VTX(1, x0 + xb, y0 + yb, z0 - zb);
@@ -228,7 +266,7 @@ index 00000000..0ee87ec7
+ DBG_BOX_VTX(6, x0 - xb, y0 - yb, z0 + zb);
+ DBG_BOX_VTX(7, x0 + xb, y0 - yb, z0 + zb);
+#undef DBG_BOX_VTX
+
+
+ gSPVertex(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(verts), 8, 0);
+
+ gSPDisplayList(gDisplayListHead++, dl_debug_draw_box);
@@ -244,15 +282,15 @@ index 00000000..0ee87ec7
+ s32 i;
+ Mtx *mtx;
+
+ debug_box_color(DBG_BOX_DEF_COLOR);
+
+ if (sNumBoxes == 0) {
+ return;
+ }
+
+ mtx = alloc_display_list(sizeof(Mtx));
+ if (mtx == NULL) {
+ for (i = 0; i < sNumBoxes; ++i) {
+ mem_pool_free(gEffectsMemoryPool, sBoxes[i]);
+ }
+ // Don't draw if there isn't space for the configuration + at least one box
+ if (mtx == NULL || ((Gfx*)gGfxPoolEnd - gDisplayListHead) <= (s32)(2 * sizeof(Gfx)) + DBG_BOX_DLSIZE) {
+ sNumBoxes = 0;
+ return;
+ }
@@ -264,8 +302,7 @@ index 00000000..0ee87ec7
+ gSPDisplayList(gDisplayListHead++, dl_debug_box_begin);
+
+ for (i = 0; i < sNumBoxes; ++i) {
+ render_box(sBoxes[i]);
+ mem_pool_free(gEffectsMemoryPool, sBoxes[i]);
+ render_box(i);
+ }
+
+ sNumBoxes = 0;
@@ -275,23 +312,24 @@ new file mode 100644
index 00000000..cdb3dc9d
--- /dev/null
+++ b/src/game/debug_box.h
@@ -0,0 +1,25 @@
+#ifndef _DEBUG_DRAW_CUBE_H
+#define _DEBUG_DRAW_CUBE_H
@@ -0,0 +1,26 @@
+#ifndef DEBUG_BOX_H
+#define 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"
+
+/**
+ * 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_rot(Vec3f center, Vec3f bounds, s16 yaw);
+
@@ -300,4 +338,4 @@ index 00000000..cdb3dc9d
+
+void render_debug_boxes(void);
+
+#endif /* _DEBUG_DRAW_CUBE_H */
+#endif /* DEBUG_BOX_H */

View File

@@ -170,7 +170,7 @@ index a3afffee..8b05fcf1 100644
+ create_thread(&gGameLoopThread, 5, thread5_mem_error_message_loop, NULL, gThread5Stack + 0x2000, 10);
osStartThread(&gGameLoopThread);
while (1) {
while (TRUE) {
diff --git a/src/game/mem_error_screen.c b/src/game/mem_error_screen.c
new file mode 100644
index 00000000..81efaf91

View File

@@ -1,7 +1,7 @@
#ifndef 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.
#ifdef VERSION_EU
#define LANGUAGE_ARRAY(cmd) cmd[LANGUAGE_FUNCTION]

View File

@@ -634,15 +634,15 @@
#define UKIKI_TEXT_DEFAULT 0
#define UKIKI_TEXT_CAGE_TEXTBOX 1
#define UKIKI_TEXT_GO_TO_CAGE 2
#define UKIKI_TEXT_STOLE_HAT 3
#define UKIKI_TEXT_HAS_HAT 4
#define UKIKI_TEXT_GAVE_HAT_BACK 5
#define UKIKI_TEXT_STOLE_CAP 3
#define UKIKI_TEXT_HAS_CAP 4
#define UKIKI_TEXT_GAVE_CAP_BACK 5
#define UKIKI_TEXT_DO_NOT_LET_GO 6
#define UKIKI_TEXT_STEAL_HAT 7
#define UKIKI_TEXT_STEAL_CAP 7
/* oBehParams2ndByte */
#define UKIKI_CAGE 0
#define UKIKI_HAT 1
#define UKIKI_CAP 1
/* Animations */
#define UKIKI_ANIM_RUN 0
@@ -662,10 +662,10 @@
/* oAnimState */
#define UKIKI_ANIM_STATE_DEFAULT 0
#define UKIKI_ANIM_STATE_EYE_CLOSED 1
#define UKIKI_ANIM_STATE_HAT_ON 2
#define UKIKI_ANIM_STATE_CAP_ON 2
/* oUkikiHasHat */
#define UKIKI_HAT_ON 1
/* oUkikiHasCap */
#define UKIKI_CAP_ON 1
/* Ukiki Cage Star */
/* oAction */

View File

@@ -504,9 +504,9 @@
#define /*0x0F8*/ oBlueFlameUnkF8 OBJECT_FIELD_F32(0x1C)
/* Small Piranha Flame */
#define /*0x0F4*/ oSmallPiranhaFlameUnkF4 OBJECT_FIELD_F32(0x1B)
#define /*0x0F8*/ oSmallPiranhaFlameUnkF8 OBJECT_FIELD_F32(0x1C)
#define /*0x0FC*/ oSmallPiranhaFlameUnkFC OBJECT_FIELD_S32(0x1D)
#define /*0x0F4*/ oSmallPiranhaFlameStartSpeed OBJECT_FIELD_F32(0x1B)
#define /*0x0F8*/ oSmallPiranhaFlameEndSpeed OBJECT_FIELD_F32(0x1C)
#define /*0x0FC*/ oSmallPiranhaFlameModel OBJECT_FIELD_S32(0x1D)
#define /*0x100*/ oSmallPiranhaFlameUnk100 OBJECT_FIELD_S32(0x1E)
#define /*0x104*/ oSmallPiranhaFlameUnk104 OBJECT_FIELD_F32(0x1F)
@@ -959,7 +959,7 @@
#define /*0x10C*/ oTiltingPyramidMarioOnPlatform OBJECT_FIELD_S32(0x21)
/* Toad Message */
#define /*0x108*/ oToadMessageDialogId OBJECT_FIELD_U32(0x20)
#define /*0x108*/ oToadMessageDialogId OBJECT_FIELD_U32(0x20)
#define /*0x10C*/ oToadMessageRecentlyTalked OBJECT_FIELD_S32(0x21)
#define /*0x110*/ oToadMessageState OBJECT_FIELD_S32(0x22)
@@ -1050,7 +1050,7 @@
#define /*0x1AC*/ oUkikiTextState OBJECT_FIELD_S16(0x49, 0)
#define /*0x1AE*/ oUkikiTextboxTimer OBJECT_FIELD_S16(0x49, 1)
#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*/
#define /*0x088*/ oUkikiCageNextAction OBJECT_FIELD_S32(0x00)
@@ -1084,7 +1084,7 @@
#define /*0x0F4*/ oCannonBarrelBubblesUnkF4 OBJECT_FIELD_F32(0x1B)
/* Water Level Pillar */
#define /*0x0F8*/ oWaterLevelPillarUnkF8 OBJECT_FIELD_S32(0x1C)
#define /*0x0F8*/ oWaterLevelPillarDrained OBJECT_FIELD_S32(0x1C)
/* Water Level Trigger */
#define /*0x0F4*/ oWaterLevelTriggerUnkF4 OBJECT_FIELD_S32(0x1B)

View File

@@ -44,7 +44,7 @@
*/
#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_FRAMEBUFFERS 0x8022A800 // 0x0070800 in size
#define SEG_POOL_START 0x8029B000 // 0x0165000 in size

View File

@@ -132,7 +132,8 @@
#define MARIO_UNKNOWN_30 0x40000000
#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
@@ -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_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_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_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)

View File

@@ -86,11 +86,11 @@ struct VblankHandler
struct Animation {
/*0x00*/ s16 flags;
/*0x02*/ s16 unk02;
/*0x04*/ s16 unk04;
/*0x06*/ s16 unk06;
/*0x08*/ s16 unk08;
/*0x0A*/ s16 unk0A;
/*0x02*/ s16 animYTransDivisor;
/*0x04*/ s16 startFrame;
/*0x06*/ s16 loopStart;
/*0x08*/ s16 loopEnd;
/*0x0A*/ s16 unusedBoneCount;
/*0x0C*/ const s16 *values;
/*0x10*/ const u16 *index;
/*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;
};
// struct AnimInfo?
struct GraphNodeObject_sub
struct AnimInfo
{
/*0x00 0x38*/ s16 animID;
/*0x02 0x3A*/ s16 animYTrans;
@@ -124,12 +123,12 @@ struct GraphNodeObject
{
/*0x00*/ struct GraphNode node;
/*0x14*/ struct GraphNode *sharedChild;
/*0x18*/ s8 unk18;
/*0x19*/ s8 unk19;
/*0x18*/ s8 areaIndex;
/*0x19*/ s8 activeAreaIndex;
/*0x1A*/ Vec3s angle;
/*0x20*/ Vec3f pos;
/*0x2C*/ Vec3f scale;
/*0x38*/ struct GraphNodeObject_sub unk38;
/*0x38*/ struct AnimInfo animInfo;
/*0x4C*/ struct SpawnInfo *unk4C;
/*0x50*/ Mat4 *throwMatrix; // matrix ptr
/*0x54*/ Vec3f cameraToObject;

View File

@@ -12,15 +12,12 @@ void osViSetSpecialFeatures(u32 func) {
D_80334914->features |= OS_VI_GAMMA_DITHER;
}
if (func & OS_VI_GAMMA_DITHER_OFF) {
D_80334914->features &= ~OS_VI_GAMMA_DITHER;
}
if (func & OS_VI_DIVOT_ON) {
D_80334914->features |= OS_VI_DIVOT;
}
if (func & OS_VI_DIVOT_OFF) {
D_80334914->features &= ~OS_VI_DIVOT;
}
if (func & OS_VI_DITHER_FILTER_ON) {

View File

@@ -420,6 +420,12 @@ SECTIONS
/* wildcard doesn't match on EU due to files being moved to engine/ */
BUILD_DIR/src/game*.o(.data*);
#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/port_eu.o(.data*);
BUILD_DIR/src/audio/data.o(.data*);

View File

@@ -333,11 +333,11 @@ s16 gEuUnknownWave7[256] = {
0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e,
0x0000, 0x1eb2, 0xb1e0, 0x72d2,
};
// u8 buffer_remove2[764] = { 0 };
s16 *gWaveSamples[6] = { sSawtoothWaves, sTriangleWaves, sSineWaves, sSquareWaves, sEuUnknownWave6, gEuUnknownWave7 };
#endif
#ifndef VERSION_EU
#else
// !VERSION_EU
s16 sSineWave[0x40] = {
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, 23169, 25329, 27244,
28897, 30272, 31356, 32137, 32609, 0x7FFF, 32609, 32137, 31356, 30272, 28897,
@@ -584,7 +584,7 @@ f32 gVolRampingRhs128[128] = {
s16 gTatumsPerBeat = TATUMS_PER_BEAT;
s8 gUnusedCount80333EE8 = UNUSED_COUNT_80333EE8;
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;
#ifdef VERSION_EU

View File

@@ -62,8 +62,8 @@ extern f32 gVolRampingRhs128[128];
// non-constant .data
extern s16 gTatumsPerBeat;
extern s8 gUnusedCount80333EE8;
extern s32 gAudioHeapSize;
extern s32 D_80333EF0; // amount of heap designated to gAudioInitPool, 0x2500
extern s32 gAudioHeapSize; // AUDIO_HEAP_SIZE
extern s32 gAudioInitPoolSize; // AUDIO_INIT_POOL_SIZE
extern volatile s32 gAudioLoadLock;
// .bss
@@ -103,15 +103,14 @@ extern u16 gUnused80226E98[0x10];
extern u32 gAudioRandom;
//make my life easier
#ifdef VERSION_EU
#define UNUSED_COUNT_80333EE8 24
#define AUDIO_HEAP_SIZE 0x2c500
#define D_80333EF0_VAL 0x2c00
#define AUDIO_INIT_POOL_SIZE 0x2c00
#else
#define UNUSED_COUNT_80333EE8 16
#define AUDIO_HEAP_SIZE 0x31150
#define D_80333EF0_VAL 0x2500
#define AUDIO_INIT_POOL_SIZE 0x2500
#endif

View File

@@ -502,6 +502,7 @@ s32 adsr_update(struct AdsrState *adsr) {
return 0.0f;
}
if (adsr->current > 1.0f) {
eu_stubbed_printf_1("Audio:Envp: overflow %f\n", adsr->current);
return 1.0f;
}
return adsr->current;

View File

@@ -19,136 +19,6 @@
#define EU_FLOAT(x) x
#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
// files. We should really fix our naming to be less ambiguous...
#define MAX_BG_MUSIC_QUEUE_SIZE 6
@@ -160,15 +30,6 @@ u8 audioString118__[] = "";
#define SAMPLES_TO_OVERPRODUCE 0x10
#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 {
s32 soundBits;
f32 *position;

Some files were not shown because too many files have changed in this diff Show More