refresh 5

This commit is contained in:
n64
2020-01-03 10:38:57 -05:00
parent 04732af90b
commit 9273f38df1
165 changed files with 12516 additions and 10252 deletions

15
CHANGES
View File

@@ -1,3 +1,18 @@
Refresh #5
1.) mem_error_screen.inc.c updated for C (#775)
2.) updated patch_libultra_math to work directly on libultra.a (#781)
3.) Enhancement: Debug boxes (#783)
4.) Label effects MemoryPool (#784)
5.) Use full-width characters for JP text and rename mislabeled stuff (#772)
6.) Small asset extraction fixes (#785)
7.) Fix incremental asset extraction after the last PR (#790)
8.) Labelled behavior script commands, tidied up behavior scripts and ren…
9.) Document camera.c (#741)
10.) Fix a HMC texture asset (#795)
11.) Fix UB in angle conversion for paintings. Needed for pc-port. (#796)
12.) Fix PSS texture assets (#801)
13.) Fix some camera typos (#802)
Refresh #4
1.) Label screen_transition.c (#737)
2.) Revamp macros (#738)

View File

@@ -441,6 +441,7 @@ $(BUILD_DIR)/assets/mario_anim_data.c: $(wildcard assets/anims/*.inc.c)
$(BUILD_DIR)/assets/demo_data.c: assets/demo_data.json $(wildcard assets/demos/*.bin)
$(PYTHON) tools/demo_data_converter.py assets/demo_data.json $(VERSION_CFLAGS) > $@
# Source code
$(BUILD_DIR)/src/goddard/%.o: OPT_FLAGS := -g
$(BUILD_DIR)/src/goddard/%.o: MIPSISET := -mips1
@@ -471,11 +472,6 @@ $(GLOBAL_ASM_DEP).$(NON_MATCHING):
@rm -f $(GLOBAL_ASM_DEP).*
touch $@
$(BUILD_DIR)/lib/src/math/%.o: lib/src/math/%.c
@$(CC_CHECK) -MMD -MP -MT $@ -MF $(BUILD_DIR)/lib/src/math/$*.d $<
$(CC) -c $(CFLAGS) -o $@ $<
tools/patch_libultra_math $@
$(BUILD_DIR)/%.o: %.c
@$(CC_CHECK) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $<
$(CC) -c $(CFLAGS) -o $@ $<
@@ -493,6 +489,7 @@ $(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT)
$(BUILD_DIR)/libultra.a: $(ULTRA_O_FILES)
$(AR) rcs -o $@ $(ULTRA_O_FILES)
tools/patch_libultra_math $@
$(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES)
$(AR) rcs -o $@ $(GODDARD_O_FILES)

View File

@@ -188,7 +188,7 @@
"actors/haunted_cage/bbh_cage_floor.rgba16.png": [32,32,2048,{"jp":[1462368,49800],"us":[1469536,49800],"eu":[1341504,49800]}],
"actors/haunted_cage/bbh_cage_ornament.rgba16.png": [32,16,1024,{"jp":[1462368,53896],"us":[1469536,53896],"eu":[1341504,53896]}],
"actors/haunted_cage/bbh_cage_wooden_base.rgba16.png": [32,16,1024,{"jp":[1462368,54920],"us":[1469536,54920],"eu":[1341504,54920]}],
"actors/haunted_cage/bbh_cage_garbage.rgba16.png": [32,32,2048,{"jp:":[1462368,57992],"us":[1469536,57992],"eu":[1341504,57992]}],
"actors/haunted_cage/bbh_cage_garbage.rgba16.png": [32,32,2048,{"jp":[1462368,57992],"us":[1469536,57992],"eu":[1341504,57992]}],
"actors/heart/spinning_heart.rgba16.png": [32,32,2048,{"jp":[2032944,55264],"us":[2040320,55264],"eu":[1912288,55264]}],
"actors/heave_ho/heave-ho_arm_ornament.rgba16.png": [32,32,2048,{"jp":[1215456,68040],"us":[1222624,68040],"eu":[1094592,68040]}],
"actors/heave_ho/heave-ho_face.rgba16.png": [32,32,2048,{"jp":[1215456,59848],"us":[1222624,59848],"eu":[1094592,59848]}],
@@ -1031,8 +1031,7 @@
"sound/sequences/us/22_cutscene_lakitu.m64": [313,{"us":[8176864]}],
"textures/cave/hmc_textures.00000.rgba16.png": [32,64,4096,{"jp":[3432432,0],"us":[3439184,0],"eu":[3312784,0]}],
"textures/cave/hmc_textures.01000.rgba16.png": [32,32,2048,{"jp":[3432432,4096],"us":[3439184,4096],"eu":[3312784,4096]}],
"textures/cave/hmc_textures.01800.rgba16.png": [32,32,2048,{"jp":[3432432,6144],"us":[3439184,6144],"eu":[3312784,6144]}],
"textures/cave/hmc_textures.02000.rgba16.png": [32,32,2048,{"jp":[3432432,8192],"us":[3439184,8192],"eu":[3312784,8192]}],
"textures/cave/hmc_textures.01800.rgba16.png": [32,64,4096,{"jp":[3432432,6144],"us":[3439184,6144],"eu":[3312784,6144]}],
"textures/cave/hmc_textures.02800.rgba16.png": [32,32,2048,{"jp":[3432432,10240],"us":[3439184,10240],"eu":[3312784,10240]}],
"textures/cave/hmc_textures.03000.rgba16.png": [32,32,2048,{"jp":[3432432,12288],"us":[3439184,12288],"eu":[3312784,12288]}],
"textures/cave/hmc_textures.03800.rgba16.png": [32,64,4096,{"jp":[3432432,14336],"us":[3439184,14336],"eu":[3312784,14336]}],
@@ -1155,8 +1154,7 @@
"textures/inside/inside_castle_textures.07000.rgba16.png": [32,64,4096,{"jp":[3555104,28672],"us":[3561856,28672],"eu":[3435456,28672]}],
"textures/inside/inside_castle_textures.08000.rgba16.png": [32,32,2048,{"jp":[3555104,32768],"us":[3561856,32768],"eu":[3435456,32768]}],
"textures/inside/inside_castle_textures.08800.rgba16.png": [32,32,2048,{"jp":[3555104,34816],"us":[3561856,34816],"eu":[3435456,34816]}],
"textures/inside/inside_castle_textures.09000.rgba16.png": [32,32,2048,{"jp":[3555104,36864],"us":[3561856,36864],"eu":[3435456,36864]}],
"textures/inside/inside_castle_textures.09800.rgba16.png": [32,32,2048,{"jp":[3555104,38912],"us":[3561856,38912],"eu":[3435456,38912]}],
"textures/inside/inside_castle_textures.09000.rgba16.png": [32,64,4096,{"jp":[3555104,36864],"us":[3561856,36864],"eu":[3435456,36864]}],
"textures/inside/inside_castle_textures.0A000.rgba16.png": [32,64,4096,{"jp":[3555104,40960],"us":[3561856,40960],"eu":[3435456,40960]}],
"textures/inside/inside_castle_textures.0B000.rgba16.png": [32,32,2048,{"jp":[3555104,45056],"us":[3561856,45056],"eu":[3435456,45056]}],
"textures/inside/inside_castle_textures.0B800.rgba16.png": [64,32,4096,{"jp":[3555104,47104],"us":[3561856,47104],"eu":[3435456,47104]}],
@@ -1204,16 +1202,14 @@
"textures/machine/ttc_textures.08400.rgba16.png": [32,32,2048,{"jp":[3460352,33792],"us":[3467104,33792],"eu":[3340704,33792]}],
"textures/mountain/ttm_textures.00000.rgba16.png": [32,32,2048,{"jp":[3473152,0],"us":[3479904,0],"eu":[3353504,0]}],
"textures/mountain/ttm_textures.00800.rgba16.png": [64,32,4096,{"jp":[3473152,2048],"us":[3479904,2048],"eu":[3353504,2048]}],
"textures/mountain/ttm_textures.01800.rgba16.png": [32,32,2048,{"jp":[3473152,6144],"us":[3479904,6144],"eu":[3353504,6144]}],
"textures/mountain/ttm_textures.02000.rgba16.png": [32,32,2048,{"jp":[3473152,8192],"us":[3479904,8192],"eu":[3353504,8192]}],
"textures/mountain/ttm_textures.01800.rgba16.png": [32,64,4096,{"jp":[3473152,6144],"us":[3479904,6144],"eu":[3353504,6144]}],
"textures/mountain/ttm_textures.02800.rgba16.png": [32,32,2048,{"jp":[3473152,10240],"us":[3479904,10240],"eu":[3353504,10240]}],
"textures/mountain/ttm_textures.03000.rgba16.png": [32,32,2048,{"jp":[3473152,12288],"us":[3479904,12288],"eu":[3353504,12288]}],
"textures/mountain/ttm_textures.03800.rgba16.png": [32,32,2048,{"jp":[3473152,14336],"us":[3479904,14336],"eu":[3353504,14336]}],
"textures/mountain/ttm_textures.04000.rgba16.png": [32,32,2048,{"jp":[3473152,16384],"us":[3479904,16384],"eu":[3353504,16384]}],
"textures/mountain/ttm_textures.04800.rgba16.png": [32,32,2048,{"jp":[3473152,18432],"us":[3479904,18432],"eu":[3353504,18432]}],
"textures/mountain/ttm_textures.05000.rgba16.png": [32,32,2048,{"jp":[3473152,20480],"us":[3479904,20480],"eu":[3353504,20480]}],
"textures/mountain/ttm_textures.05800.rgba16.png": [32,32,2048,{"jp":[3473152,22528],"us":[3479904,22528],"eu":[3353504,22528]}],
"textures/mountain/ttm_textures.06000.rgba16.png": [32,32,2048,{"jp":[3473152,24576],"us":[3479904,24576],"eu":[3353504,24576]}],
"textures/mountain/ttm_textures.05800.rgba16.png": [32,64,4096,{"jp":[3473152,22528],"us":[3479904,22528],"eu":[3353504,22528]}],
"textures/mountain/ttm_textures.06800.rgba16.png": [32,32,2048,{"jp":[3473152,26624],"us":[3479904,26624],"eu":[3353504,26624]}],
"textures/mountain/ttm_textures.07000.rgba16.png": [32,32,2048,{"jp":[3473152,28672],"us":[3479904,28672],"eu":[3353504,28672]}],
"textures/mountain/ttm_textures.07800.rgba16.png": [32,32,2048,{"jp":[3473152,30720],"us":[3479904,30720],"eu":[3353504,30720]}],

View File

@@ -17,11 +17,6 @@ ALIGNED8 const u8 cave_09001800[] = {
#include "textures/cave/hmc_textures.01800.rgba16.inc.c"
};
// 0x09002000
ALIGNED8 const u8 cave_09002000[] = {
#include "textures/cave/hmc_textures.02000.rgba16.inc.c"
};
// 0x09002800
ALIGNED8 const u8 cave_09002800[] = {
#include "textures/cave/hmc_textures.02800.rgba16.inc.c"

View File

@@ -72,11 +72,6 @@ ALIGNED8 const u8 inside_09009000[] = {
#include "textures/inside/inside_castle_textures.09000.rgba16.inc.c"
};
// 0x09009800
ALIGNED8 const u8 inside_09009800[] = {
#include "textures/inside/inside_castle_textures.09800.rgba16.inc.c"
};
// 0x0900A000
ALIGNED8 const u8 inside_0900A000[] = {
#include "textures/inside/inside_castle_textures.0A000.rgba16.inc.c"

View File

@@ -17,11 +17,6 @@ ALIGNED8 const u8 mountain_09001800[] = {
#include "textures/mountain/ttm_textures.01800.rgba16.inc.c"
};
// 0x09002000
ALIGNED8 const u8 mountain_09002000[] = {
#include "textures/mountain/ttm_textures.02000.rgba16.inc.c"
};
// 0x09002800
ALIGNED8 const u8 mountain_09002800[] = {
#include "textures/mountain/ttm_textures.02800.rgba16.inc.c"
@@ -57,11 +52,6 @@ ALIGNED8 const u8 mountain_09005800[] = {
#include "textures/mountain/ttm_textures.05800.rgba16.inc.c"
};
// 0x09006000
ALIGNED8 const u8 mountain_09006000[] = {
#include "textures/mountain/ttm_textures.06000.rgba16.inc.c"
};
// 0x09006800
ALIGNED8 const u8 mountain_09006800[] = {
#include "textures/mountain/ttm_textures.06800.rgba16.inc.c"

View File

@@ -738,7 +738,7 @@ ALIGNED8 static const u8 texture_font_char_jp_hiragana_small_tsu[] = {
#include "textures/segment2/segment2.07710.ia1.inc.c"
};
ALIGNED8 static const u8 texture_font_char_jp_hiragana_small_ka[] = {
ALIGNED8 static const u8 texture_font_char_jp_hiragana_small_ya[] = {
#include "textures/segment2/segment2.07720.ia1.inc.c"
};
@@ -962,7 +962,7 @@ ALIGNED8 static const u8 texture_font_char_jp_katakana_small_tsu[] = {
#include "textures/segment2/segment2.07A90.ia1.inc.c"
};
ALIGNED8 static const u8 texture_font_char_jp_katakana_small_ka[] = {
ALIGNED8 static const u8 texture_font_char_jp_katakana_small_ya[] = {
#include "textures/segment2/segment2.07AA0.ia1.inc.c"
};
@@ -2028,7 +2028,7 @@ const u8 *const main_font_lut[] = {
texture_font_char_jp_katakana_yu, texture_font_char_jp_katakana_yo, texture_font_char_jp_katakana_ra, texture_font_char_jp_katakana_ri,
texture_font_char_jp_katakana_ru, texture_font_char_jp_katakana_re, texture_font_char_jp_katakana_ro, texture_font_char_jp_katakana_wa,
0x0, texture_font_char_jp_katakana_n, 0x0, texture_font_char_jp_long_vowel,
texture_font_char_jp_hiragana_small_e, texture_font_char_jp_hiragana_small_tsu, texture_font_char_jp_hiragana_small_ka, texture_font_char_jp_hiragana_small_yu,
texture_font_char_jp_hiragana_small_e, texture_font_char_jp_hiragana_small_tsu, texture_font_char_jp_hiragana_small_ya, texture_font_char_jp_hiragana_small_yu,
texture_font_char_jp_hiragana_small_yo, texture_font_char_jp_hiragana_small_a, texture_font_char_jp_hiragana_small_i, texture_font_char_jp_hiragana_small_u,
texture_font_char_jp_hiragana_small_o, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
@@ -2040,7 +2040,7 @@ const u8 *const main_font_lut[] = {
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
texture_font_char_jp_katakana_small_e, texture_font_char_jp_katakana_small_tsu, texture_font_char_jp_katakana_small_ka, texture_font_char_jp_katakana_small_yu,
texture_font_char_jp_katakana_small_e, texture_font_char_jp_katakana_small_tsu, texture_font_char_jp_katakana_small_ya, texture_font_char_jp_katakana_small_yu,
texture_font_char_jp_katakana_small_yo, texture_font_char_jp_katakana_small_a, texture_font_char_jp_katakana_small_i, texture_font_char_jp_katakana_small_u,
texture_font_char_jp_katakana_small_o, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,

View File

@@ -1,39 +1,75 @@
'0' = 0x00
'' = 0x00
'1' = 0x01
'' = 0x01
'2' = 0x02
'' = 0x02
'3' = 0x03
'' = 0x03
'4' = 0x04
'' = 0x04
'5' = 0x05
'' = 0x05
'6' = 0x06
'' = 0x06
'7' = 0x07
'' = 0x07
'8' = 0x08
'' = 0x08
'9' = 0x09
'' = 0x09
'A' = 0x0A
'' = 0x0A
'B' = 0x0B
'' = 0x0B
'C' = 0x0C
'' = 0x0C
'D' = 0x0D
'' = 0x0D
'E' = 0x0E
'' = 0x0E
'F' = 0x0F
'' = 0x0F
'G' = 0x10
'' = 0x10
'H' = 0x11
'' = 0x11
'I' = 0x12
'' = 0x12
'J' = 0x13
'' = 0x13
'K' = 0x14
'' = 0x14
'L' = 0x15
'' = 0x15
'M' = 0x16
'' = 0x16
'N' = 0x17
'' = 0x17
'O' = 0x18
'' = 0x18
'P' = 0x19
'' = 0x19
'Q' = 0x1A
'' = 0x1A
'R' = 0x1B
'' = 0x1B
'S' = 0x1C
'' = 0x1C
'T' = 0x1D
'' = 0x1D
'U' = 0x1E
'' = 0x1E
'V' = 0x1F
'' = 0x1F
'W' = 0x20
'' = 0x20
'X' = 0x21
'' = 0x21
'Y' = 0x22
'' = 0x22
'Z' = 0x23
'' = 0x23
'a' = 0x24
'b' = 0x25
'c' = 0x26
@@ -114,6 +150,7 @@
'ん' = 0x6D
'。' = 0x6E
',' = 0x6F
'、' = 0x6F
'ア' = 0x70
'イ' = 0x71
'ウ' = 0x72
@@ -162,7 +199,9 @@
'ヲ' = 0x9C
'ン' = 0x9D
' ' = 0x9E
' ' = 0x9E
'-' = 0x9F
'ー' = 0x9F
'ぇ' = 0xA0
'っ' = 0xA1
'ゃ' = 0xA2
@@ -183,17 +222,27 @@
'ォ' = 0xD8
'[%]' = 0xE0
'(' = 0xE1
'' = 0xE1
')(' = 0xE2
'' = 0xE2
')' = 0xE3
'' = 0xE3
'+' = 0xE4
'↔' = 0xE4
'&' = 0xE5
':' = 0xE6
'゛' = 0xF0
'゜' = 0xF1
'!' = 0xF2
'' = 0xF2
'%' = 0xF3
'' = 0xF3
'?' = 0xF4
'' = 0xF4
'『' = 0xF5
'』' = 0xF6
'~' = 0xF7
'' = 0xF7
'…' = 0xF8
'$' = 0xF9
'★' = 0xFA
@@ -202,7 +251,7 @@
'☆' = 0xFD
'\n' = 0xFE
# kana or hira with dakuten
# hiragana or katakana with dakuten
'が' = 0xF0, 0x45
'ぎ' = 0xF0, 0x46
'ぐ' = 0xF0, 0x47
@@ -244,7 +293,7 @@
'ベ' = 0xF0, 0x8C
'ボ' = 0xF0, 0x8D
# kana or hira with handakuten
# hiragana or katakana with handakuten
'ぱ' = 0xF1, 0x59
'ぴ' = 0xF1, 0x5A
'ぷ' = 0xF1, 0x5B

View File

@@ -23,7 +23,7 @@
'み' = 0x14
'ど' = 0x15
'の' = 0x16
'?' = 0x17
'' = 0x17
'サ' = 0x18
'ウ' = 0x19
'ン' = 0x1A

File diff suppressed because it is too large Load Diff

23
enhancements/debug_box.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _DEBUG_DRAW_CUBE_H
#define _DEBUG_DRAW_CUBE_H
/**
* @file debug_box.h
* Draws debug boxes, see debug_box.inc.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.
*/
#define MAX_DEBUG_BOXES 100
void debug_box(Vec3f center, Vec3f bounds);
void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw);
void debug_box_pos(Vec3f pMin, Vec3f pMax);
void debug_box_pos_rot(Vec3f pMin, Vec3f pMax, s16 yaw);
#endif /* _DEBUG_DRAW_CUBE_H */

View File

@@ -0,0 +1,248 @@
#include <ultra64.h>
#include "sm64.h"
#include "game/game.h"
#include "game/geo_misc.h"
#include "engine/math_util.h"
#include "debug_box.h"
/**
* @file debug_box.inc.c
* Draws 3D boxes for debugging purposes.
*
* How to use:
*
* In area.c, add this to the list of includes:
*
* #include "enhancements/debug_box.inc.c"
*
* Then in render_game() in the same file, add a call to render_debug_boxes():
*
* void render_game(void) {
* if (gCurrentArea != NULL && !gWarpTransition.pauseRendering) {
* geo_process_root(...);
*
* render_debug_boxes(); // add here
*
* 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.
* This will draw a box starting from the point (center - bounds) to (center + bounds).
*
* Use debug_box_rot to draw a box rotated in the xz-plane.
*
* If you want to draw a box by specifying min and max points, use debug_box_pos() instead.
*/
/**
* Internal struct containing box info
*/
struct DebugBox {
Vec3s center;
Vec3s bounds;
s16 yaw;
};
struct DebugBox *sBoxes[MAX_DEBUG_BOXES];
s16 sNumBoxes = 0;
extern Mat4 gMatStack[32]; //XXX: Hack
/**
* The debug boxes' transparency
*/
#define DBG_BOX_ALPHA 0x7F
/**
* The debug boxes' color
*/
#define DBG_BOX_COL 0xFF, 0x00, 0x00, DBG_BOX_ALPHA
/**
* Sets up the RCP for drawing the boxes
*/
static const Gfx dl_debug_box_begin[] = {
gsDPPipeSync(),
#if DBG_BOX_ALPHA < 0xFF
gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_NOOP2),
#else
gsDPSetRenderMode(G_RM_ZB_OPA_SURF, G_RM_NOOP2),
#endif
gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPTexture(0, 0, 0, 0, G_OFF),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsSPEndDisplayList(),
};
/**
* 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( 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),
gsSPEndDisplayList(),
};
/**
* Adds a box to the list to be rendered this frame.
*
* If there are already MAX_DEBUG_BOXES boxes, does nothing.
*/
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) {
return;
}
vec3f_to_vec3s(sBoxes[sNumBoxes]->center, center);
vec3f_to_vec3s(sBoxes[sNumBoxes]->bounds, bounds);
sBoxes[sNumBoxes]->yaw = yaw;
++sNumBoxes;
}
/**
* Draws a debug box from (center - bounds) to (center + bounds)
* To draw a rotated box, use debug_box_rot()
*
* @see debug_box_rot()
*/
void debug_box(Vec3f center, Vec3f bounds)
{
append_debug_box(center, bounds, 0);
}
/**
* Draws a debug box from (center - bounds) to (center + bounds), rotating it by `yaw`
*/
void debug_box_rot(Vec3f center, Vec3f bounds, s16 yaw)
{
append_debug_box(center, bounds, yaw);
}
/**
* Draws a debug box from pMin to pMax
* To draw a rotated box this way, use debug_box_pos_rot()
*
* @see debug_box_pos_rot()
*/
void debug_box_pos(Vec3f pMin, Vec3f pMax)
{
debug_box_pos_rot(pMin, pMax, 0);
}
/**
* Draws a debug box from pMin to pMax, rotating it in the xz-plane by `yaw`
*/
void debug_box_pos_rot(Vec3f pMin, Vec3f pMax, s16 yaw)
{
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;
center[0] = pMin[0] + bounds[0];
center[1] = pMin[1] + bounds[1];
center[2] = pMin[2] + bounds[2];
append_debug_box(center, bounds, yaw);
}
static void render_box(struct DebugBox *box)
{
Vtx *verts = alloc_display_list(8 * sizeof(Vtx));
Mtx *translate;
Mtx *rotate;
Mtx *translateback;
s32 x0 = box->center[0],
y0 = box->center[1],
z0 = box->center[2];
s32 xb = box->bounds[0],
yb = box->bounds[1],
zb = box->bounds[2];
if (verts != NULL) {
if (box->yaw != 0) {
// Translate to the origin, rotate, then translate back, effectively rotating the box about
// its center
translate = alloc_display_list(sizeof(Mtx));
rotate = alloc_display_list(sizeof(Mtx));
translateback = alloc_display_list(sizeof(Mtx));
guTranslate(translate, box->center[0], box->center[1], box->center[2]);
guRotate(rotate, box->yaw / (float)0x10000 * 360.0f, 0, 1.0f, 0);
guTranslate(translateback, -box->center[0], -box->center[1], -box->center[2]);
gSPMatrix(gDisplayListHead++, translate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH);
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_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);
DBG_BOX_VTX(2, x0 - xb, y0 - yb, z0 - zb);
DBG_BOX_VTX(3, x0 + xb, y0 - yb, z0 - zb);
DBG_BOX_VTX(4, x0 - xb, y0 + yb, z0 + zb);
DBG_BOX_VTX(5, x0 + xb, y0 + yb, z0 + zb);
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);
if (box->yaw != 0) {
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
}
}
}
void render_debug_boxes()
{
s32 i;
Mtx *mtx;
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]);
}
sNumBoxes = 0;
return;
}
//XXX: This is hacky. Ths camera's look-at matrix is stored in gMatStack[1], so this is a simple way
// of using it without reconstructing the matrix.
mtxf_to_mtx(mtx, gMatStack[1]);
gSPMatrix(gDisplayListHead++, mtx, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(gDisplayListHead++, dl_debug_box_begin);
for (i = 0; i < sNumBoxes; ++i) {
render_box(sBoxes[i]);
mem_pool_free(gEffectsMemoryPool, sBoxes[i]);
}
sNumBoxes = 0;
}

View File

@@ -9,13 +9,14 @@
* Make sure that USE_EXT_RAM is defined in include/segments.h
#define USE_EXT_RAM
*
* There are 6 files you will need to edit:
* There are 7 files you will need to edit:
* src/game/main.c
* src/engine/level_script.h
* include/text_strings.h.in
* levels/entry.s
* levels/intro/script.s
* levels/intro/geo.s
* levels/entry.c
* levels/intro/script.c
* levels/intro/geo.c
* levels/intro/header.h
*
* First, in main.c, you will need to add this line below the includes:
#include "../enhancements/mem_error_screen.inc.c"
@@ -45,48 +46,55 @@
#define TEXT_PJ64 _("If you are using PJ64 1.6, go to:\nOptions > Settings > Rom Settings Tab > Memory Size\nthen select 8 MB from the drop-down box.")
#define TEXT_PJ64_2 _("If you are using PJ64 2.X, go to:\nOptions > Settings > Config: > Memory Size, select 8 MB")
*
* In levels/entry.s, simply append the following to the file:
glabel level_script_entry_error_screen
init_level
sleep 2
blackout FALSE
set_reg 0
execute 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_error_screen
jump level_script_entry_error_screen
.align 4
* In levels/entry.c, simply append the following to the file:
const LevelScript level_script_entry_error_screen[] {
INIT_LEVEL(),
SLEEP(2),
BLACKOUT(FALSE),
SET_REG(0),
EXECUTE(0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_error_screen),
JUMP(level_script_entry_error_screen),
};
*
* In levels/intro/script.s, add the following to the top of the file:
glabel level_intro_entry_error_screen
init_level
fixed_load _goddardSegmentStart, _goddardSegmentRomStart, _goddardSegmentRomEnd
load_mio0 0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd
alloc_level_pool
* In levels/intro/script.c, add the following to the top of the file:
const LevelScript level_intro_entry_error_screen[] {
INIT_LEVEL(),
FIXED_LOAD(_goddardSegmentStart, _goddardSegmentRomStart, _goddardSegmentRomEnd),
LOAD_MIO0(0x07, _intro_segment_7SegmentRomStart, _intro_segment_7SegmentRomEnd),
ALLOC_LEVEL_POOL(),
area 1, intro_geo_error_screen
end_area
AREA(1, intro_geo_error_screen),
END_AREA(),
free_level_pool
load_area 1
sleep 32767
exit_and_execute 0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_error_screen
FREE_LEVEL_POOL(),
LOAD_AREA(1),
SLEEP(32767),
EXIT_AND_EXECUTE(0x14, _introSegmentRomStart, _introSegmentRomEnd, level_intro_entry_error_screen),
};
*
* Finally, add the following to the top of levels/intro/geo.s:
glabel intro_geo_error_screen
geo_node_screen_area 0, 160, 120, 160, 120
geo_open_node
geo_zbuffer 0
geo_open_node
geo_node_ortho 100
geo_open_node
geo_background 0x0001
geo_close_node
geo_close_node
geo_zbuffer 0
geo_open_node
geo_asm 0, geo18_display_error_message
geo_close_node
geo_close_node
geo_end
* Add the following to the top of levels/intro/geo.c:
const GeoLayout intro_geo_error_screen[] {
GEO_NODE_SCREEN_AREA(0, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2),
GEO_OPEN_NODE(),
GEO_ZBUFFER(0),
GEO_OPEN_NODE(),
GEO_NODE_ORTHO(100),
GEO_OPEN_NODE(),
GEO_BACKGROUND_COLOR(0x0001),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_ZBUFFER(0),
GEO_OPEN_NODE(),
GEO_ASM(0, geo18_display_error_message),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_END(),
};
* Finally, add the following to the bottom of levels/intro/header.h:
extern const GeoLayout intro_geo_error_screen[];
extern const LevelScript level_intro_entry_error_screen[];
extern Gfx *geo18_display_error_message(u32 run, UNUSED struct GraphNode *sp44, UNUSED u32 sp48);
*/
/* clang-format on */

View File

@@ -20,6 +20,12 @@ def read_local_asset_list(f):
def asset_needs_update(asset, version):
if version <= 4 and asset in ["textures/mountain/ttm_textures.01800.rgba16.png", "textures/mountain/ttm_textures.05800.rgba16.png"]:
return True
if version <= 3 and asset == "textures/cave/hmc_textures.01800.rgba16.png":
return True
if version <= 2 and asset == "textures/inside/inside_castle_textures.09000.rgba16.png":
return True
if version <= 1 and asset.endswith(".m64"):
return True
if version <= 0 and asset.endswith(".aiff"):
@@ -51,7 +57,7 @@ def clean_assets(local_asset_file):
def main():
# In case we ever need to change formats of generated files, we keep a
# revision ID in the local asset file.
new_version = 2
new_version = 5
try:
local_asset_file = open(".assets-local.txt")

View File

@@ -50,7 +50,7 @@ extern const BehaviorScript bhvWarp[];
extern const BehaviorScript bhvWarpPipe[];
extern const BehaviorScript bhvWhitePuffExplosion[];
extern const BehaviorScript bhvSpawnedStar[];
extern const BehaviorScript bhvUnused080C[];
extern const BehaviorScript bhvSpawnedStarNoLevelExit[];
extern const BehaviorScript bhvMrIBlueCoin[];
extern const BehaviorScript bhvCoinInsideBoo[];
extern const BehaviorScript bhvCoinFormationSpawn[];

View File

@@ -4,17 +4,16 @@
// Start of the 3 cap courses in a row.
#define COURSE_CAP_COURSES COURSE_COTMC
#define DEFINE_COURSE(courseenum, _1, _2, _3, _4) courseenum,
#define DEFINE_COURSE(courseenum, _1) courseenum,
#define DEFINE_COURSES_END() \
COURSE_BONUS_STAGES, \
COURSE_STAGES_MAX = COURSE_BONUS_STAGES - 1, \
COURSE_STAGES_COUNT = COURSE_STAGES_MAX,
#define DEFINE_BONUS_COURSE(courseenum, _1, _2, _3, _4) courseenum,
#define DEFINE_BONUS_COURSE(courseenum, _1) courseenum,
enum CourseNum
{
COURSE_NONE, // (0) Overworld (Castle Grounds, etc)
#include "levels/course_defines.h"
COURSE_END, // To mark end + 1 for marking max and count.
// Todo: clean this up. This is still bad. Which

View File

@@ -163,12 +163,12 @@
* 0x0F: Create a camera scene graph node.
* 0x01: unused
* 0x02: s16 camera type
* 0x04: s16 fromX
* 0x06: s16 fromY
* 0x08: s16 fromZ
* 0x0A: s16 toX
* 0x0C: s16 toY
* 0x0E: s16 toZ
* 0x04: s16 posX
* 0x06: s16 posY
* 0x08: s16 posZ
* 0x0A: s16 focusX
* 0x0C: s16 focusY
* 0x0E: s16 focusZ
* 0x10: GraphNodeFunc function
*/
#define GEO_CAMERA(type, x1, y1, z1, x2, y2, z2, function) \

View File

@@ -46,7 +46,7 @@
#define SURFACE_BOSS_FIGHT_CAMERA 0x0065 // Wide camera for BOB and WF bosses
#define SURFACE_CAMERA_FREE_ROAM 0x0066 // Free roam camera for THI and TTC
#define SURFACE_THI3_WALLKICK 0x0068 // Surface where there's a wall kick section in THI 3rd area, has no action defined
#define SURFACE_CAMERA_PLATFORM 0x0069 // Surface that enables far camera for platforms, used in THI
#define SURFACE_CAMERA_8_DIR 0x0069 // Surface that enables far camera for platforms, used in THI
#define SURFACE_CAMERA_MIDDLE 0x006E // Surface camera that returns to the middle, used on the 4 pillars of SSL
#define SURFACE_CAMERA_ROTATE_RIGHT 0x006F // Surface camera that rotates to the right (Bowser 1 & THI)
#define SURFACE_CAMERA_ROTATE_LEFT 0x0070 // Surface camera that rotates to the left (BOB & TTM)

View File

@@ -10,7 +10,7 @@
*/
#define TEXT_JPHUD_MARIO _("マリオ")
#define TEXT_JPHUD_SELECT_FILE _("ファイルセレクト")
#define TEXT_JPHUD_CHECK_FILE _("どのスコアをみる?")
#define TEXT_JPHUD_CHECK_FILE _("どのスコアをみる")
#define TEXT_JPHUD_COPY_FILE _("ファイルコピーする")
#define TEXT_JPHUD_ERASE_FILE _("ファイルけす")
#define TEXT_JPHUD_SOUND_SELECT _("サウンドセレクト")

View File

@@ -39,14 +39,14 @@
#define TEXT_ERASE_FILE TEXT_JPHUD_ERASE_FILE
#define TEXT_SOUND_SELECT TEXT_JPHUD_SOUND_SELECT
#define TEXT_FILE_MARIO_A _("マリオA")
#define TEXT_FILE_MARIO_B _("マリオB")
#define TEXT_FILE_MARIO_C _("マリオC")
#define TEXT_FILE_MARIO_D _("マリオD")
#define TEXT_FILE_MARIO_A _("マリオ")
#define TEXT_FILE_MARIO_B _("マリオ")
#define TEXT_FILE_MARIO_C _("マリオ")
#define TEXT_FILE_MARIO_D _("マリオ")
// Menu Options
#define TEXT_SCORE _("スコア")
#define TEXT_COPY _("コピ-")
#define TEXT_COPY _("コピ")
#define TEXT_ERASE _("けす")
// Sound Options
@@ -55,72 +55,72 @@
#define TEXT_HEADSET _("ヘッドホン")
// Misc Menu Text
#define TEXT_SAVED_DATA_EXISTS _("ファイルにデ-タがはいってます")
#define TEXT_NO_SAVED_DATA_EXISTS _("ファイルにデ-タがありません")
#define TEXT_SAVED_DATA_EXISTS _("ファイルにデタがはいってます")
#define TEXT_NO_SAVED_DATA_EXISTS _("ファイルにデタがありません")
// Inside a Menu
#define TEXT_RETURN _("もどる")
#define TEXT_CHECK_SCORE _("スコアをみる")
#define TEXT_COPY_FILE_BUTTON _("ファイルコピ-")
#define TEXT_COPY_FILE_BUTTON _("ファイルコピ")
#define TEXT_ERASE_FILE_BUTTON _("ファイルけす")
// Score Menu
#define TEXT_HI_SCORE _("ハイスコア")
#define TEXT_MY_SCORE _("マイスコア")
#define TEXT_SCORE_MARIO_A _("マリオA")
#define TEXT_SCORE_MARIO_B _("マリオB")
#define TEXT_SCORE_MARIO_C _("マリオC")
#define TEXT_SCORE_MARIO_D _("マリオD")
#define TEXT_SCORE_MARIO_A _("マリオ")
#define TEXT_SCORE_MARIO_B _("マリオ")
#define TEXT_SCORE_MARIO_C _("マリオ")
#define TEXT_SCORE_MARIO_D _("マリオ")
// Copy Menu
#define TEXT_COPY_IT_TO_WHERE _("どこにコピ-しますか?")
#define TEXT_COPYING_COMPLETED _("コピ-おわりました")
#define TEXT_COPY_IT_TO_WHERE _("どこにコピしますか")
#define TEXT_COPYING_COMPLETED _("コピおわりました")
#define TEXT_NO_FILE_TO_COPY_FROM _("からのファイルがありません")
// Erase Menu
#define TEXT_SURE _("ほんと?")
#define TEXT_SURE _("ほんと")
#define TEXT_YES _("はい")
#define TEXT_NO _("いいえ")
#define TEXT_FILE_MARIO_A_JUST_ERASED _("マリオAをけしました")
#define TEXT_FILE_MARIO_A_JUST_ERASED _("マリオをけしました")
/**
* Menus Text (Pause, Course Completed)
*/
// Main Courses
#define TEXT_COURSE _("コ-ス")
#define TEXT_COURSE _("コス")
#define TEXT_MYSCORE _("マイスコア")
#define TEXT_CONTINUE _("つづけて マリオする?")
#define TEXT_EXIT_COURSE _("コ-スからでる?")
#define TEXT_CAMERA_ANGLE_R _("Rボタンのカメラきりかえ")
#define TEXT_CONTINUE _("つづけて マリオする")
#define TEXT_EXIT_COURSE _("コスからでる")
#define TEXT_CAMERA_ANGLE_R _("ボタンのカメラきりかえ")
// Camera Options
#define TEXT_LAKITU_MARIO _("ジュゲム+マリオ")
#define TEXT_LAKITU_STOP _("ジュゲム+ストップ")
#define TEXT_NORMAL_UPCLOSE _("(おすすめ)(リアル)")
#define TEXT_NORMAL_FIXED _("(おすすめ)(とまる)")
#define TEXT_LAKITU_MARIO _("ジュゲムマリオ")
#define TEXT_LAKITU_STOP _("ジュゲムストップ")
#define TEXT_NORMAL_UPCLOSE _("おすすめリアル")
#define TEXT_NORMAL_FIXED _("おすすめとまる")
// Course Completed Misc Text
#define TEXT_CATCH _("キャッチ!")
#define TEXT_CLEAR _("クリア!")
#define TEXT_HUD_HI_SCORE _("HISCORE")
#define TEXT_CATCH _("キャッチ")
#define TEXT_CLEAR _("クリア")
#define TEXT_HUD_HI_SCORE _("")
// Save Options
#define TEXT_SAVE_AND_CONTINUE _("セ-ブしてつづける?")
#define TEXT_SAVE_AND_QUIT _("セ-ブしておわる?")
#define TEXT_CONTINUE_WITHOUT_SAVING _("セ-ブしないでつづける?")
#define TEXT_SAVE_AND_CONTINUE _("セブしてつづける")
#define TEXT_SAVE_AND_QUIT _("セブしておわる")
#define TEXT_CONTINUE_WITHOUT_SAVING _("セブしないでつづける")
/**
* Ending Peach cutscene text.
*/
#define TEXT_FILE_MARIO_EXCLAMATION _("マリオ!!")
#define TEXT_POWER_STARS_RESTORED _("おしろにスタ-が もどったのね")
#define TEXT_THANKS_TO_YOU _("みんな あなたのおかげだわ!")
#define TEXT_THANK_YOU_MARIO _("ありがとう マリオ")
#define TEXT_SOMETHING_SPECIAL _("なにか おれいをしなくちゃ・・")
#define TEXT_LISTEN_EVERYBODY _("さあ みんな")
#define TEXT_LETS_HAVE_CAKE _("おいしいケ-キを やきましょう")
#define TEXT_FOR_MARIO _("マリオの ために・・・")
#define TEXT_FILE_MARIO_QUESTION _("マリオ?")
#define TEXT_FILE_MARIO_EXCLAMATION _("マリオ")
#define TEXT_POWER_STARS_RESTORED _("おしろにスターが もどったのね")
#define TEXT_THANKS_TO_YOU _("みんな あなたのおかげだわ")
#define TEXT_THANK_YOU_MARIO _("ありがとう マリオ")
#define TEXT_SOMETHING_SPECIAL _("なにか おれいをしなくちゃ・・")
#define TEXT_LISTEN_EVERYBODY _("さあ みんな")
#define TEXT_LETS_HAVE_CAKE _("おいしいケキを やきましょう")
#define TEXT_FOR_MARIO _("マリオの ために・・・")
#define TEXT_FILE_MARIO_QUESTION _("マリオ")
#endif

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