You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Merge branch 'develop/2.1.0' of https://github.com/Arceveti/HackerSM64 into develop/2.1.0-four-controllers-base
This commit is contained in:
153
bin/segment2.c
153
bin/segment2.c
@@ -5,40 +5,152 @@
|
||||
#include "macros.h"
|
||||
#include "types.h"
|
||||
#include "game/ingame_menu.h"
|
||||
#include "game/puppyprint.h"
|
||||
|
||||
#include "make_const_nonconst.h"
|
||||
|
||||
// SM64 (US/JP/EU/SH) Segment 02
|
||||
#ifdef PUPPYPRINT
|
||||
ALIGNED8 static const Texture small_font_1[] = {
|
||||
ALIGNED8 static const Texture small_font_default[] = {
|
||||
#include "textures/segment2/custom_text.i4.inc.c"
|
||||
};
|
||||
ALIGNED8 static const Texture small_font_2[] = {
|
||||
#include "textures/segment2/custom_text2.i4.inc.c"
|
||||
ALIGNED8 static const Texture small_font_outline[] = {
|
||||
#include "textures/segment2/custom_text2.ia4.inc.c"
|
||||
};
|
||||
ALIGNED8 static const Texture small_font_plain[] = {
|
||||
#include "textures/segment2/custom_text3.i4.inc.c"
|
||||
};
|
||||
ALIGNED8 static const Texture small_font_vanilla[] = {
|
||||
#include "textures/segment2/custom_text4.i4.inc.c"
|
||||
};
|
||||
|
||||
const Texture *const puppyprint_font_lut[2] = {
|
||||
small_font_1, small_font_2
|
||||
const u8 small_font_kerning_default[] = {
|
||||
/*!*/ 4, /*"*/ 5, /*#*/ 0, /*$*/ 0, /*%*/ 8, /*&*/ 8, /*'*/ 2, /*(*/ 5, /*)*/ 5, /***/ 0, /*+*/ 8, /*,*/ 3, /*-*/ 8, /*.*/ 3, /*/*/ 8, /*0*/ 6,
|
||||
/*1*/ 5, /*2*/ 7, /*3*/ 7, /*4*/ 7, /*5*/ 7, /*6*/ 8, /*7*/ 7, /*8*/ 7, /*9*/ 6, /*:*/ 3, /*;*/ 3, /*<*/ 0, /*=*/ 0, /*>*/ 0, /*?*/ 6, /*@*/ 0,
|
||||
/*A*/ 7, /*B*/ 7, /*C*/ 7, /*D*/ 7, /*E*/ 6, /*F*/ 5, /*G*/ 8, /*H*/ 6, /*I*/ 6, /*J*/ 5, /*K*/ 7, /*L*/ 6, /*M*/ 7, /*N*/ 7, /*O*/ 7, /*P*/ 6,
|
||||
/*Q*/ 8, /*R*/ 6, /*S*/ 7, /*T*/ 7, /*U*/ 7, /*V*/ 7, /*W*/ 8, /*X*/ 7, /*Y*/ 7, /*Z*/ 7, /*[*/ 0, /*\\*/ 0, /*]*/ 0, /*^*/ 8, /*_*/ 0, /*`*/ 0,
|
||||
/*a*/ 7, /*b*/ 7, /*c*/ 6, /*d*/ 7, /*e*/ 7, /*f*/ 7, /*g*/ 7, /*h*/ 7, /*i*/ 3, /*j*/ 5, /*k*/ 8, /*l*/ 4, /*m*/ 7, /*n*/ 7, /*o*/ 7, /*p*/ 7,
|
||||
/*q*/ 7, /*r*/ 6, /*s*/ 6, /*t*/ 6, /*u*/ 6, /*v*/ 7, /*w*/ 8, /*x*/ 6, /*y*/ 8, /*z*/ 7, /*~*/ 8,
|
||||
};
|
||||
|
||||
static const u8 small_font_kerning_1[80] = {
|
||||
/*0*/ 6, /*1*/ 5, /*2*/ 7, /*3*/ 7, /*4*/ 7, /*5*/ 7, /*6*/ 8, /*7*/ 7, /*8*/ 7, /*9*/ 6, /*-*/ 8, /*+*/ 8, /*(*/ 5, /*)*/ 5, /*!*/ 4, /*?*/ 6,
|
||||
/*A*/ 7, /*B*/ 7, /*C*/ 7, /*D*/ 7, /*E*/ 6, /*F*/ 5, /*G*/ 8, /*H*/ 6, /*I*/ 6, /*J*/ 5, /*K*/ 7, /*L*/ 6, /*M*/ 7, /*N*/ 7, /*O*/ 7, /*P*/ 6,
|
||||
/*Q*/ 8, /*R*/ 6, /*S*/ 7, /*T*/ 7, /*U*/ 7, /*V*/ 7, /*W*/ 8, /*X*/ 7, /*Y*/ 7, /*Z*/ 7, /*"*/ 5, /*'*/ 2, /*:*/ 3, /*;*/ 3, /*.*/ 3, /*,*/ 3,
|
||||
/*a*/ 7, /*b*/ 7, /*c*/ 6, /*d*/ 7, /*e*/ 7, /*f*/ 7, /*g*/ 7, /*h*/ 7, /*i*/ 3, /*j*/ 5, /*k*/ 8, /*l*/ 4, /*m*/ 7, /*n*/ 7, /*o*/ 7, /*p*/ 7,
|
||||
/*q*/ 7, /*r*/ 6, /*s*/ 6, /*t*/ 6, /*u*/ 6, /*v*/ 7, /*w*/ 8, /*x*/ 6, /*y*/ 8, /*z*/ 7, /*~*/ 8, /*¨*/ 7, /*^*/ 8, /*/*/ 8, /*%*/ 8, /*&*/ 8,
|
||||
const u16 small_font_offsets_default[] = {
|
||||
/*!*/ 0, /*"*/ 8, /*#*/ 16, /*$*/ 24, /*%*/ 32, /*&*/ 40, /*'*/ 48, /*(*/ 56, /*)*/ 64, /***/ 72, /*+*/ 80, /*,*/ 88, /*-*/ 96, /*.*/ 104, /*/*/ 112,
|
||||
/*0*/ 120, /*1*/ 128, /*2*/ 136, /*3*/ 144, /*4*/ 152, /*5*/ 160, /*6*/ 168, /*7*/ 176, /*8*/ 184, /*9*/ 192, /*:*/ 200, /*;*/ 208, /*<*/ 216, /*=*/ 216,
|
||||
/*>*/ 0, /*?*/ 216, /*@*/ 0, /*A*/ 224, /*B*/ 232, /*C*/ 240, /*D*/ 248, /*E*/ 256, /*F*/ 264, /*G*/ 272, /*H*/ 280, /*I*/ 288, /*J*/ 296, /*K*/ 304,
|
||||
/*L*/ 312, /*M*/ 320, /*N*/ 328, /*O*/ 336, /*P*/ 344, /*Q*/ 352, /*R*/ 360, /*S*/ 368, /*T*/ 376, /*U*/ 384, /*V*/ 392, /*W*/ 400, /*X*/ 408, /*Y*/ 416,
|
||||
/*Z*/ 424, /*[*/ 432, /*\*/ 432, /*]*/ 432, /*^*/ 432, /*_*/ 440, /*`*/ 440, /*a*/ 440, /*b*/ 448, /*c*/ 456, /*d*/ 464, /*e*/ 472, /*f*/ 480, /*g*/ 488,
|
||||
/*h*/ 496, /*i*/ 504, /*j*/ 512, /*k*/ 520, /*l*/ 528, /*m*/ 536, /*n*/ 544, /*o*/ 552, /*p*/ 560, /*q*/ 568, /*r*/ 576, /*s*/ 584, /*t*/ 592, /*u*/ 600,
|
||||
/*v*/ 608, /*w*/ 616, /*x*/ 624, /*y*/ 632, /*z*/ 640, /*{*/ 648, /*|*/ 648, /*}*/ 648, /*~*/ 648, /*:)*/ 656
|
||||
};
|
||||
|
||||
static const u8 small_font_kerning_2[80] = {
|
||||
/*0*/ 6, /*1*/ 6, /*2*/ 6, /*3*/ 6, /*4*/ 6, /*5*/ 6, /*6*/ 6, /*7*/ 6, /*8*/ 6, /*9*/ 6, /*-*/ 6, /*+*/ 6, /*(*/ 3, /*)*/ 3, /*!*/ 4, /*?*/ 5,
|
||||
/*A*/ 6, /*B*/ 6, /*C*/ 6, /*D*/ 6, /*E*/ 6, /*F*/ 6, /*G*/ 6, /*H*/ 6, /*I*/ 6, /*J*/ 6, /*K*/ 6, /*L*/ 6, /*M*/ 6, /*N*/ 6, /*O*/ 6, /*P*/ 6,
|
||||
/*Q*/ 6, /*R*/ 6, /*S*/ 6, /*T*/ 6, /*U*/ 6, /*V*/ 6, /*W*/ 6, /*X*/ 6, /*Y*/ 6, /*Z*/ 6, /*"*/ 4, /*'*/ 1, /*:*/ 2, /*;*/ 2, /*.*/ 2, /*,*/ 2,
|
||||
/*a*/ 5, /*b*/ 5, /*c*/ 5, /*d*/ 5, /*e*/ 5, /*f*/ 5, /*g*/ 5, /*h*/ 5, /*i*/ 1, /*j*/ 5, /*k*/ 5, /*l*/ 3, /*m*/ 5, /*n*/ 5, /*o*/ 5, /*p*/ 5,
|
||||
/*q*/ 5, /*r*/ 5, /*s*/ 5, /*t*/ 5, /*u*/ 5, /*v*/ 5, /*w*/ 5, /*x*/ 5, /*y*/ 5, /*z*/ 5, /*~*/ 6, /*¨*/ 5, /*^*/ 6, /*/*/ 5, /*%*/ 5, /*&*/ 6,
|
||||
static const u8 small_font_kerning_outline[] = {
|
||||
/*!*/ 3, /*"*/ 4, /*#*/ 0, /*$*/ 0, /*%*/ 6, /*&*/ 6, /*'*/ 2, /*(*/ 4, /*)*/ 4, /***/ 0, /*+*/ 6, /*,*/ 2, /*-*/ 6, /*.*/ 2, /*/*/ 6, /*0*/ 6,
|
||||
/*1*/ 6, /*2*/ 6, /*3*/ 6, /*4*/ 6, /*5*/ 6, /*6*/ 6, /*7*/ 6, /*8*/ 6, /*9*/ 6, /*:*/ 2, /*;*/ 2, /*<*/ 0, /*=*/ 0, /*>*/ 0, /*?*/ 6, /*@*/ 0,
|
||||
/*A*/ 6, /*B*/ 6, /*C*/ 6, /*D*/ 6, /*E*/ 6, /*F*/ 6, /*G*/ 6, /*H*/ 6, /*I*/ 5, /*J*/ 7, /*K*/ 6, /*L*/ 6, /*M*/ 6, /*N*/ 6, /*O*/ 6, /*P*/ 6,
|
||||
/*Q*/ 6, /*R*/ 6, /*S*/ 6, /*T*/ 6, /*U*/ 6, /*V*/ 6, /*W*/ 6, /*X*/ 6, /*Y*/ 6, /*Z*/ 6, /*[*/ 0, /*\\*/ 0, /*]*/ 0, /*^*/ 7, /*_*/ 0, /*`*/ 0,
|
||||
/*a*/ 5, /*b*/ 5, /*c*/ 5, /*d*/ 5, /*e*/ 5, /*f*/ 5, /*g*/ 5, /*h*/ 5, /*i*/ 2, /*j*/ 6, /*k*/ 4, /*l*/ 2, /*m*/ 5, /*n*/ 5, /*o*/ 5, /*p*/ 5,
|
||||
/*q*/ 5, /*r*/ 5, /*s*/ 5, /*t*/ 5, /*u*/ 5, /*v*/ 5, /*w*/ 5, /*x*/ 5, /*y*/ 5, /*z*/ 5, /*~*/ 6,
|
||||
};
|
||||
|
||||
const u8 *const puppyprint_kerning_lut[2][80] = {
|
||||
small_font_kerning_1, small_font_kerning_2
|
||||
const u16 small_font_offsets_outline[] = {
|
||||
/*!*/ 0, /*"*/ 8, /*#*/ 16, /*$*/ 24, /*%*/ 32, /*&*/ 40, /*'*/ 48, /*(*/ 56, /*)*/ 64, /***/ 72, /*+*/ 80, /*,*/ 88, /*-*/ 96, /*.*/ 104, /*/*/ 112,
|
||||
/*0*/ 120, /*1*/ 128, /*2*/ 136, /*3*/ 144, /*4*/ 152, /*5*/ 160, /*6*/ 168, /*7*/ 176, /*8*/ 184, /*9*/ 192, /*:*/ 200, /*;*/ 208, /*<*/ 216, /*=*/ 216,
|
||||
/*>*/ 0, /*?*/ 216, /*@*/ 0, /*A*/ 224, /*B*/ 232, /*C*/ 240, /*D*/ 248, /*E*/ 256, /*F*/ 264, /*G*/ 272, /*H*/ 280, /*I*/ 288, /*J*/ 296, /*K*/ 304,
|
||||
/*L*/ 312, /*M*/ 320, /*N*/ 328, /*O*/ 336, /*P*/ 344, /*Q*/ 352, /*R*/ 360, /*S*/ 368, /*T*/ 376, /*U*/ 384, /*V*/ 392, /*W*/ 400, /*X*/ 408, /*Y*/ 416,
|
||||
/*Z*/ 424, /*[*/ 432, /*\*/ 432, /*]*/ 432, /*^*/ 432, /*_*/ 440, /*`*/ 440, /*a*/ 440, /*b*/ 448, /*c*/ 456, /*d*/ 464, /*e*/ 472, /*f*/ 480, /*g*/ 488,
|
||||
/*h*/ 496, /*i*/ 504, /*j*/ 512, /*k*/ 520, /*l*/ 528, /*m*/ 536, /*n*/ 544, /*o*/ 552, /*p*/ 560, /*q*/ 568, /*r*/ 576, /*s*/ 584, /*t*/ 592, /*u*/ 600,
|
||||
/*v*/ 608, /*w*/ 616, /*x*/ 624, /*y*/ 632, /*z*/ 640, /*{*/ 648, /*|*/ 648, /*}*/ 648, /*~*/ 648, /*:)*/ 656
|
||||
};
|
||||
|
||||
static const u8 small_font_kerning_plain[] = {
|
||||
/*!*/ 5, /*"*/ 4, /*#*/ 0, /*$*/ 0, /*%*/ 6, /*&*/ 7, /*'*/ 2, /*(*/ 4, /*)*/ 4, /***/ 0, /*+*/ 6, /*,*/ 2, /*-*/ 6, /*.*/ 2, /*/*/ 6, /*0*/ 6,
|
||||
/*1*/ 5, /*2*/ 5, /*3*/ 5, /*4*/ 5, /*5*/ 5, /*6*/ 5, /*7*/ 5, /*8*/ 5, /*9*/ 5, /*:*/ 3, /*;*/ 3, /*<*/ 0, /*=*/ 0, /*>*/ 0, /*?*/ 6, /*@*/ 0,
|
||||
/*A*/ 6, /*B*/ 6, /*C*/ 6, /*D*/ 6, /*E*/ 6, /*F*/ 6, /*G*/ 6, /*H*/ 6, /*I*/ 4, /*J*/ 6, /*K*/ 6, /*L*/ 6, /*M*/ 7, /*N*/ 7, /*O*/ 6, /*P*/ 6,
|
||||
/*Q*/ 6, /*R*/ 6, /*S*/ 6, /*T*/ 6, /*U*/ 6, /*V*/ 6, /*W*/ 7, /*X*/ 6, /*Y*/ 6, /*Z*/ 6, /*[*/ 0, /*\\*/ 0, /*]*/ 0, /*^*/ 7, /*_*/ 0, /*`*/ 0,
|
||||
/*a*/ 6, /*b*/ 6, /*c*/ 6, /*d*/ 6, /*e*/ 6, /*f*/ 6, /*g*/ 6, /*h*/ 6, /*i*/ 3, /*j*/ 4, /*k*/ 6, /*l*/ 5, /*m*/ 7, /*n*/ 6, /*o*/ 6, /*p*/ 6,
|
||||
/*q*/ 6, /*r*/ 6, /*s*/ 6, /*t*/ 6, /*u*/ 6, /*v*/ 6, /*w*/ 7, /*x*/ 6, /*y*/ 6, /*z*/ 6, /*~*/ 7,
|
||||
};
|
||||
|
||||
const u16 small_font_offsets_plain[] = {
|
||||
/*!*/ 0, /*"*/ 8, /*#*/ 16, /*$*/ 24, /*%*/ 32, /*&*/ 40, /*'*/ 48, /*(*/ 56, /*)*/ 64, /***/ 72, /*+*/ 80, /*,*/ 88, /*-*/ 96, /*.*/ 104, /*/*/ 112,
|
||||
/*0*/ 120, /*1*/ 128, /*2*/ 136, /*3*/ 144, /*4*/ 152, /*5*/ 160, /*6*/ 168, /*7*/ 176, /*8*/ 184, /*9*/ 192, /*:*/ 200, /*;*/ 208, /*<*/ 216, /*=*/ 216,
|
||||
/*>*/ 0, /*?*/ 216, /*@*/ 0, /*A*/ 224, /*B*/ 232, /*C*/ 240, /*D*/ 248, /*E*/ 256, /*F*/ 264, /*G*/ 272, /*H*/ 280, /*I*/ 288, /*J*/ 296, /*K*/ 304,
|
||||
/*L*/ 312, /*M*/ 320, /*N*/ 328, /*O*/ 336, /*P*/ 344, /*Q*/ 352, /*R*/ 360, /*S*/ 368, /*T*/ 376, /*U*/ 384, /*V*/ 392, /*W*/ 400, /*X*/ 408, /*Y*/ 416,
|
||||
/*Z*/ 424, /*[*/ 432, /*\*/ 432, /*]*/ 432, /*^*/ 432, /*_*/ 440, /*`*/ 440, /*a*/ 440, /*b*/ 448, /*c*/ 456, /*d*/ 464, /*e*/ 472, /*f*/ 480, /*g*/ 488,
|
||||
/*h*/ 496, /*i*/ 504, /*j*/ 512, /*k*/ 520, /*l*/ 528, /*m*/ 536, /*n*/ 544, /*o*/ 552, /*p*/ 560, /*q*/ 568, /*r*/ 576, /*s*/ 584, /*t*/ 592, /*u*/ 600,
|
||||
/*v*/ 608, /*w*/ 616, /*x*/ 624, /*y*/ 632, /*z*/ 640, /*{*/ 648, /*|*/ 648, /*}*/ 648, /*~*/ 648, /*:)*/ 656
|
||||
};
|
||||
|
||||
static const u8 small_font_kerning_vanilla[] = {
|
||||
/*!*/ 4, /*"*/ 4, /*#*/ 0, /*$*/ 0, /*%*/ 6, /*&*/ 7, /*'*/ 3, /*(*/ 4, /*)*/ 4, /***/ 0, /*+*/ 6, /*,*/ 2, /*-*/ 4, /*.*/ 3, /*/*/ 4, /*0*/ 5,
|
||||
/*1*/ 5, /*2*/ 6, /*3*/ 6, /*4*/ 6, /*5*/ 6, /*6*/ 6, /*7*/ 6, /*8*/ 6, /*9*/ 6, /*:*/ 4, /*;*/ 4, /*<*/ 0, /*=*/ 0, /*>*/ 0, /*?*/ 5, /*@*/ 0,
|
||||
/*A*/ 5, /*B*/ 5, /*C*/ 5, /*D*/ 5, /*E*/ 5, /*F*/ 5, /*G*/ 5, /*H*/ 5, /*I*/ 3, /*J*/ 5, /*K*/ 5, /*L*/ 5, /*M*/ 7, /*N*/ 7, /*O*/ 6, /*P*/ 5,
|
||||
/*Q*/ 6, /*R*/ 5, /*S*/ 5, /*T*/ 5, /*U*/ 5, /*V*/ 5, /*W*/ 7, /*X*/ 6, /*Y*/ 5, /*Z*/ 5, /*[*/ 0, /*\\*/ 0, /*]*/ 0, /*^*/ 7, /*_*/ 0, /*`*/ 0,
|
||||
/*a*/ 5, /*b*/ 4, /*c*/ 4, /*d*/ 4, /*e*/ 4, /*f*/ 5, /*g*/ 5, /*h*/ 4, /*i*/ 3, /*j*/ 4, /*k*/ 3, /*l*/ 2, /*m*/ 6, /*n*/ 4, /*o*/ 4, /*p*/ 4,
|
||||
/*q*/ 5, /*r*/ 4, /*s*/ 4, /*t*/ 4, /*u*/ 4, /*v*/ 4, /*w*/ 7, /*x*/ 5, /*y*/ 4, /*z*/ 5, /*~*/ 6,
|
||||
};
|
||||
|
||||
const u16 small_font_offsets_vanilla[] = {
|
||||
/*!*/ 0, /*"*/ 8, /*#*/ 16, /*$*/ 24, /*%*/ 32, /*&*/ 40, /*'*/ 48, /*(*/ 56, /*)*/ 64, /***/ 72, /*+*/ 80, /*,*/ 88, /*-*/ 96, /*.*/ 104, /*/*/ 112,
|
||||
/*0*/ 120, /*1*/ 128, /*2*/ 136, /*3*/ 144, /*4*/ 152, /*5*/ 160, /*6*/ 168, /*7*/ 176, /*8*/ 184, /*9*/ 192, /*:*/ 200, /*;*/ 208, /*<*/ 216, /*=*/ 216,
|
||||
/*>*/ 0, /*?*/ 216, /*@*/ 0, /*A*/ 224, /*B*/ 232, /*C*/ 240, /*D*/ 248, /*E*/ 256, /*F*/ 264, /*G*/ 272, /*H*/ 280, /*I*/ 288, /*J*/ 296, /*K*/ 304,
|
||||
/*L*/ 312, /*M*/ 320, /*N*/ 328, /*O*/ 336, /*P*/ 344, /*Q*/ 352, /*R*/ 360, /*S*/ 368, /*T*/ 376, /*U*/ 384, /*V*/ 392, /*W*/ 400, /*X*/ 408, /*Y*/ 416,
|
||||
/*Z*/ 424, /*[*/ 432, /*\*/ 432, /*]*/ 432, /*^*/ 432, /*_*/ 440, /*`*/ 440, /*a*/ 440, /*b*/ 448, /*c*/ 456, /*d*/ 464, /*e*/ 472, /*f*/ 480, /*g*/ 488,
|
||||
/*h*/ 496, /*i*/ 504, /*j*/ 512, /*k*/ 520, /*l*/ 528, /*m*/ 536, /*n*/ 544, /*o*/ 552, /*p*/ 560, /*q*/ 568, /*r*/ 576, /*s*/ 584, /*t*/ 592, /*u*/ 600,
|
||||
/*v*/ 608, /*w*/ 616, /*x*/ 624, /*y*/ 632, /*z*/ 640, /*{*/ 648, /*|*/ 648, /*}*/ 648, /*~*/ 648, /*:)*/ 656
|
||||
};
|
||||
|
||||
const struct PPTextFont sPPFont_default = {
|
||||
small_font_default,
|
||||
small_font_kerning_default,
|
||||
small_font_offsets_default,
|
||||
NULL,
|
||||
G_IM_FMT_I, G_IM_SIZ_4b,
|
||||
672, 12,
|
||||
8, 12
|
||||
};
|
||||
|
||||
const struct PPTextFont sPPFont_outline = {
|
||||
small_font_outline,
|
||||
small_font_kerning_outline,
|
||||
small_font_offsets_outline,
|
||||
NULL,
|
||||
G_IM_FMT_IA, G_IM_SIZ_4b,
|
||||
672, 12,
|
||||
8, 12
|
||||
};
|
||||
|
||||
const struct PPTextFont sPPFont_plain = {
|
||||
small_font_plain,
|
||||
small_font_kerning_plain,
|
||||
small_font_offsets_plain,
|
||||
NULL,
|
||||
G_IM_FMT_I, G_IM_SIZ_4b,
|
||||
672, 12,
|
||||
8, 12
|
||||
};
|
||||
|
||||
const struct PPTextFont sPPFont_vanilla = {
|
||||
small_font_vanilla,
|
||||
small_font_kerning_vanilla,
|
||||
small_font_offsets_vanilla,
|
||||
NULL,
|
||||
G_IM_FMT_I, G_IM_SIZ_4b,
|
||||
672, 12,
|
||||
8, 12
|
||||
};
|
||||
|
||||
const struct PPTextFont *const gPuppyPrintFontTable[] = {
|
||||
&sPPFont_default, &sPPFont_outline, &sPPFont_plain, &sPPFont_vanilla
|
||||
};
|
||||
|
||||
|
||||
const Texture *const puppyprint_font_lut[] = {
|
||||
small_font_default, small_font_outline, small_font_plain, small_font_vanilla
|
||||
};
|
||||
|
||||
const u8 *const puppyprint_kerning_lut[][95] = {
|
||||
small_font_kerning_default, small_font_kerning_outline, small_font_kerning_plain, small_font_kerning_vanilla
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -2753,6 +2865,7 @@ const Gfx dl_waterbox_rgba16_begin[] = {
|
||||
gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA),
|
||||
gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsSPClipRatio(FRUSTRATIO_1),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, (G_TX_WRAP | G_TX_NOMIRROR), 5, G_TX_NOLOD, (G_TX_WRAP | G_TX_NOMIRROR), 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, ((32 - 1) << G_TEXTURE_IMAGE_FRAC), ((32 - 1) << G_TEXTURE_IMAGE_FRAC)),
|
||||
@@ -2765,6 +2878,7 @@ const Gfx dl_waterbox_ia16_begin[] = {
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
|
||||
gsSPClearGeometryMode(G_LIGHTING | G_CULL_BACK),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsSPClipRatio(FRUSTRATIO_1),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, (G_TX_WRAP | G_TX_NOMIRROR), 5, G_TX_NOLOD, (G_TX_WRAP | G_TX_NOMIRROR), 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, ((32 - 1) << G_TEXTURE_IMAGE_FRAC), ((32 - 1) << G_TEXTURE_IMAGE_FRAC)),
|
||||
@@ -2774,6 +2888,7 @@ const Gfx dl_waterbox_ia16_begin[] = {
|
||||
// 0x02014810 - 0x02014838
|
||||
const Gfx dl_waterbox_end[] = {
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsSPClipRatio(FRUSTRATIO_2),
|
||||
gsDPPipeSync(),
|
||||
gsSPSetGeometryMode(G_LIGHTING | G_CULL_BACK),
|
||||
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
|
||||
|
||||
@@ -403,8 +403,8 @@ const BehaviorScript bhvStarDoor[] = {
|
||||
SET_INT(oIntangibleTimer, 0),
|
||||
BEGIN_LOOP(),
|
||||
CALL_NATIVE(bhv_star_door_loop),
|
||||
CALL_NATIVE(bhv_door_rendering_loop),
|
||||
CALL_NATIVE(load_object_collision_model),
|
||||
CALL_NATIVE(bhv_door_rendering_loop),
|
||||
END_LOOP(),
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
/**
|
||||
* Enables a comprehensive standalone profiler. Automatically enabled by PUPPYPRINT_DEBUG.
|
||||
* If not using PUPPYPRINT_DEBUG, press L to toggle the profiler.
|
||||
* If not using PUPPYPRINT_DEBUG, press L + D-Pad Up to toggle the profiler.
|
||||
*/
|
||||
#define USE_PROFILER
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
/**
|
||||
* Enables a custom, enhanced performance profiler. (Enables PUPPYPRINT by default in config_safeguards).
|
||||
*/
|
||||
// #define PUPPYPRINT_DEBUG 1
|
||||
// #define PUPPYPRINT_DEBUG
|
||||
|
||||
/**
|
||||
* Uses cycles instead of microseconds in Puppyprint debug output.
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
#define PUPPYPRINT
|
||||
|
||||
#undef PUPPYPRINT_DEBUG
|
||||
#define PUPPYPRINT_DEBUG 1
|
||||
#define PUPPYPRINT_DEBUG
|
||||
|
||||
#undef VISUAL_DEBUG
|
||||
#define VISUAL_DEBUG
|
||||
|
||||
@@ -55,7 +55,7 @@ enum ObjFlags {
|
||||
OBJ_FLAG_OCCLUDE_SILHOUETTE = (1 << 20), // 0x00100000
|
||||
OBJ_FLAG_OPACITY_FROM_CAMERA_DIST = (1 << 21), // 0x00200000
|
||||
OBJ_FLAG_EMIT_LIGHT = (1 << 22), // 0x00400000
|
||||
OBJ_FLAG_PROCESS_OUTSIDE_ROOM = (1 << 23), // 0x00800000
|
||||
OBJ_FLAG_ONLY_PROCESS_INSIDE_ROOM = (1 << 23), // 0x00800000
|
||||
OBJ_FLAG_HITBOX_WAS_SET = (1 << 30), // 0x40000000
|
||||
};
|
||||
|
||||
@@ -779,7 +779,6 @@ enum ExclamationBoxContentsList { // oBehParams2ndByte, ExclamationBoxContents->
|
||||
EXCLAMATION_BOX_BP_STAR_4,
|
||||
EXCLAMATION_BOX_BP_STAR_5,
|
||||
EXCLAMATION_BOX_BP_STAR_6,
|
||||
EXCLAMATION_BOX_BP_NULL = 99
|
||||
};
|
||||
enum oBehParam1stByteExclamationBox {
|
||||
EXCLAMATION_BOX_BP1_NEEDS_SWITCH,
|
||||
|
||||
@@ -51,11 +51,18 @@ DECLARE_SEGMENT(goddard)
|
||||
DECLARE_SEGMENT(framebuffers)
|
||||
DECLARE_SEGMENT(assets)
|
||||
extern u8 _goddardSegmentStart[];
|
||||
extern u8 _goddardSegmentEnd[];
|
||||
extern u8 _engineSegmentStart[];
|
||||
extern u8 _engineSegmentBssEnd[];
|
||||
extern u8 _mainSegmentStart[];
|
||||
extern u8 _mainSegmentEnd[];
|
||||
extern u8 _engineSegmentEnd[];
|
||||
extern u8 _framebuffersSegmentBssStart[];
|
||||
extern u8 _framebuffersSegmentBssEnd[];
|
||||
extern u8 _zbufferSegmentBssStart[];
|
||||
extern u8 _zbufferSegmentBssEnd[];
|
||||
extern u8 _buffersSegmentBssStart[];
|
||||
extern u8 _buffersSegmentBssEnd[];
|
||||
|
||||
DECLARE_LEVEL_SEGMENT(menu)
|
||||
DECLARE_LEVEL_SEGMENT(intro)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
const RoomData inside_castle_seg7_area_1_rooms[] = {
|
||||
1, 9, 9, 1, 9, 9, 9, 9, // 0-7
|
||||
9, 9, 1, 1, 1, 9, 9, 17, // 8-15
|
||||
1, 9, 9, 9, 9, 9, 17, 9, // 16-23
|
||||
9, 9, 9, 9, 9, 9, 9, 9, // 24-31
|
||||
1, 17, 17, 9, 17, 9, 17, 9, // 16-23
|
||||
9, 9, 17, 9, 9, 9, 9, 9, // 24-31
|
||||
8, 8, 8, 8, 8, 8, 8, 8, // 32-39
|
||||
8, 8, 8, 8, 8, 8, 8, 8, // 40-47
|
||||
8, 8, 8, 8, 8, 8, 8, 8, // 48-55
|
||||
|
||||
@@ -1999,6 +1999,7 @@ static const Gfx ccm_seg7_dl_0701C5C8[] = {
|
||||
// 0x0701CC40 - 0x0701CE30
|
||||
static const Gfx ccm_seg7_dl_0701CC40[] = {
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, snow_09001000),
|
||||
gsSPClipRatio(FRUSTRATIO_1),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsSPVertex(ccm_seg7_vertex_0701AB50, 16, 0),
|
||||
@@ -2035,6 +2036,7 @@ static const Gfx ccm_seg7_dl_0701CC40[] = {
|
||||
gsSPVertex(ccm_seg7_vertex_0701B040, 10, 0),
|
||||
gsSP2Triangles( 0, 1, 2, 0x0, 1, 3, 2, 0x0),
|
||||
gsSP2Triangles( 4, 5, 6, 0x0, 7, 8, 9, 0x0),
|
||||
gsSPClipRatio(FRUSTRATIO_2),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
|
||||
@@ -21,9 +21,7 @@ const GeoLayout ending_geo_area_1[] = {
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_NODE_ORTHO(100),
|
||||
GEO_OPEN_NODE(),
|
||||
#ifdef VERSION_EU
|
||||
GEO_BACKGROUND_COLOR(0x0001),
|
||||
#endif
|
||||
GEO_BACKGROUND_COLOR(GPACK_RGBA5551(0, 0, 0, 1)),
|
||||
GEO_ASM(0, geo_exec_cake_end_screen),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
@@ -37,4 +35,3 @@ const GeoLayout ending_geo_area_1[] = {
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_END(),
|
||||
};
|
||||
|
||||
|
||||
@@ -48,19 +48,19 @@ u32 delaysArr[][NUM_ALLPASS] = {
|
||||
4, 4, 4,
|
||||
4, 4, 4,
|
||||
4, 4, 4,
|
||||
4, 4, 4
|
||||
4, 4, 4,
|
||||
},
|
||||
{ /* 1 */
|
||||
1080, 1352, 1200,
|
||||
1200, 1232, 1432,
|
||||
1384, 1048, 1352,
|
||||
928, 1504, 1512
|
||||
928, 1504, 1512,
|
||||
},
|
||||
{ /* 2 */
|
||||
1384, 1352, 1048,
|
||||
928, 1512, 1504,
|
||||
928, 1512, 1504,
|
||||
1080, 1200, 1352,
|
||||
1200, 1432, 1232
|
||||
1200, 1432, 1232,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -74,34 +74,72 @@ s32 reverbMultsArr[][NUM_ALLPASS / 3] = {
|
||||
|
||||
/**
|
||||
* Format:
|
||||
* - downsampleRate (Higher values exponentially reduce the number of input samples to process, improving perfomance at cost of quality)
|
||||
* - isMono (Only process reverb on the left channel and share it with the right channel, improving performance at cost of quality)
|
||||
* - filterCount (Number of filters to process data with; in general, more filters means higher quality at the cost of performance demand)
|
||||
* - windowSize (Size of circular reverb buffer; higher values work better for a more open soundscape, lower is better for a more compact sound)
|
||||
* - gain (Amount of audio retransmitted into the circular reverb buffer, emulating decay; higher values represent a lengthier decay period)
|
||||
* - gainIndex (Advanced parameter used to tune the outputs of every first two of three filters)
|
||||
* - reverbIndex (Advanced parameter used to tune the incoming output of every third filter)
|
||||
* - useLightweightSettings (Reduce some runtime configurability options in favor of a slight speed boost during processing; Light configurability settings are found in synthesis.h)
|
||||
* - downsampleRate (Higher values exponentially reduce the number of input samples to process, improving perfomance at cost of quality)
|
||||
* - isMono (Only process reverb on the left channel and share it with the right channel, improving performance at cost of quality)
|
||||
* - filterCount (Number of filters to process data with; in general, more filters means higher quality at the cost of performance demand; always 3 with light settings)
|
||||
*
|
||||
* - *delaysL (Array of variable audio buffer sizes / delays for each respective filter [left channel])
|
||||
* - *delaysR (Array of variable audio buffer sizes / delays for each respective filter [right channel])
|
||||
* - *reverbMultsL (Array of multipliers applied to the final output of each group of 3 filters [left channel])
|
||||
* - *reverbMultsR (Array of multipliers applied to the final output of each group of 3 filters [right channel])
|
||||
* - windowSize (Size of circular reverb buffer; higher values work better for a more open soundscape, lower is better for a more compact sound)
|
||||
* - gain (Amount of audio retransmitted into the circular reverb buffer, emulating decay; higher values represent a lengthier decay period)
|
||||
* - gainIndex (Advanced parameter; used to tune the outputs of every first two of three filters; overridden when using light settings)
|
||||
* - reverbIndex (Advanced parameter; used to tune the incoming output of every third filter; overridden when using light settings)
|
||||
*
|
||||
* NOTE: First entry will always be used by default when not using the level commands to specify a preset.
|
||||
* - *delaysL (Advanced parameter; array of variable audio buffer sizes / delays for each respective filter [left channel]; overridden when using light settings)
|
||||
* - *delaysR (Advanced parameter; array of variable audio buffer sizes / delays for each respective filter [right channel]; overridden when using light settings)
|
||||
* - *reverbMultsL (Advanced parameter; array of multipliers applied to the final output of each group of 3 filters [left channel])
|
||||
* - *reverbMultsR (Advanced parameter; array of multipliers applied to the final output of each group of 3 filters [right channel])
|
||||
*
|
||||
* NOTE: The first entry will always be used by default when not using the level commands to specify a preset.
|
||||
* Please reference the HackerSM64 Wiki for more descriptive documentation of these parameters and usage of BETTER_REVERB in general.
|
||||
*/
|
||||
struct BetterReverbSettings gBetterReverbSettings[] = {
|
||||
{ /* 0 */
|
||||
-1, FALSE, NUM_ALLPASS, -1, -1, 0x00, 0x00, // Vanilla Reverb
|
||||
delaysArr[0], delaysArr[0], reverbMultsArr[0], reverbMultsArr[0]
|
||||
{ /* Preset 0 - Vanilla Reverb [Default Preset] */
|
||||
.useLightweightSettings = FALSE, // Ignored with vanilla reverb
|
||||
.downsampleRate = -1, // Signifies use of vanilla reverb
|
||||
.isMono = FALSE, // Ignored with vanilla reverb
|
||||
.filterCount = NUM_ALLPASS, // Ignored with vanilla reverb
|
||||
|
||||
.windowSize = -1, // Use vanilla preset window size
|
||||
.gain = -1, // Use vanilla preset gain value
|
||||
.gainIndex = 0x00, // Ignored with vanilla reverb
|
||||
.reverbIndex = 0x00, // Ignored with vanilla reverb
|
||||
|
||||
.delaysL = delaysArr[0], // Ignored with vanilla reverb
|
||||
.delaysR = delaysArr[0], // Ignored with vanilla reverb
|
||||
.reverbMultsL = reverbMultsArr[0], // Ignored with vanilla reverb
|
||||
.reverbMultsR = reverbMultsArr[0], // Ignored with vanilla reverb
|
||||
},
|
||||
{ /* 1 */
|
||||
2, FALSE, (NUM_ALLPASS - 9), 0xE00, 0x43FF, 0xA0, 0x30, // Default Console
|
||||
delaysArr[1], delaysArr[2], reverbMultsArr[1], reverbMultsArr[2]
|
||||
{ /* Preset 1 - Sample Console Configuration */
|
||||
.useLightweightSettings = TRUE,
|
||||
.downsampleRate = 2,
|
||||
.isMono = FALSE,
|
||||
.filterCount = (NUM_ALLPASS - 9), // Ignored with lightweight settings
|
||||
|
||||
.windowSize = 0x0E00,
|
||||
.gain = 0x43FF,
|
||||
.gainIndex = 0xA0, // Ignored with lightweight settings
|
||||
.reverbIndex = 0x30, // Ignored with lightweight settings
|
||||
|
||||
.delaysL = delaysArr[1],
|
||||
.delaysR = delaysArr[2],
|
||||
.reverbMultsL = reverbMultsArr[1], // Ignored with lightweight settings
|
||||
.reverbMultsR = reverbMultsArr[2], // Ignored with lightweight settings
|
||||
},
|
||||
{ /* 2 */
|
||||
1, FALSE, NUM_ALLPASS, 0xE00, 0x28FF, 0xA0, 0x60, // Default Emulator (RCVI Hack only)
|
||||
delaysArr[1], delaysArr[2], reverbMultsArr[1], reverbMultsArr[2]
|
||||
{ /* Preset 2 - Sample Emulator Configuration (RCVI Hack Only) */
|
||||
.useLightweightSettings = FALSE,
|
||||
.downsampleRate = 1,
|
||||
.isMono = FALSE,
|
||||
.filterCount = NUM_ALLPASS,
|
||||
|
||||
.windowSize = 0x0E00,
|
||||
.gain = 0x28FF,
|
||||
.gainIndex = 0xA0,
|
||||
.reverbIndex = 0x60,
|
||||
|
||||
.delaysL = delaysArr[1],
|
||||
.delaysR = delaysArr[2],
|
||||
.reverbMultsL = reverbMultsArr[1],
|
||||
.reverbMultsR = reverbMultsArr[2],
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -688,6 +688,7 @@ struct SPTask *create_next_audio_frame_task(void) {
|
||||
task->yield_data_size = 0;
|
||||
|
||||
decrease_sample_dma_ttls();
|
||||
|
||||
return gAudioTask;
|
||||
}
|
||||
#endif
|
||||
@@ -2186,7 +2187,7 @@ void play_music(u8 player, u16 seqArgs, u16 fadeTimer) {
|
||||
|
||||
// Abort if the queue is already full.
|
||||
if (sBackgroundMusicQueueSize >= MAX_BACKGROUND_MUSIC_QUEUE_SIZE) {
|
||||
#if PUPPYPRINT_DEBUG
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
append_puppyprint_log("Sequence queue full, aborting.");
|
||||
#endif
|
||||
return;
|
||||
|
||||
@@ -301,7 +301,7 @@ void sound_init_main_pools(s32 sizeForAudioInitPool) {
|
||||
sound_alloc_pool_init(&gAudioSessionPool, (gAudioHeap + sizeForAudioInitPool), (gAudioHeapSize - sizeForAudioInitPool));
|
||||
}
|
||||
|
||||
#if PUPPYPRINT_DEBUG
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
void puppyprint_get_allocated_pools(s32 *audioPoolList) {
|
||||
u32 i, j;
|
||||
const struct SoundAllocPool *pools[NUM_AUDIO_POOLS] = {
|
||||
@@ -1051,6 +1051,7 @@ void init_reverb_us(s32 presetId) {
|
||||
// This will likely crash if given an invalid preset value. Adding a safety check here isn't worth the usability interference.
|
||||
struct BetterReverbSettings *betterReverbPreset = &gBetterReverbSettings[gBetterReverbPreset];
|
||||
|
||||
betterReverbLightweight = betterReverbPreset->useLightweightSettings;
|
||||
betterReverbDownsampleRate = betterReverbPreset->downsampleRate;
|
||||
monoReverb = betterReverbPreset->isMono;
|
||||
reverbFilterCount = betterReverbPreset->filterCount;
|
||||
@@ -1204,7 +1205,7 @@ void audio_reset_session(void) {
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
s8 updatesPerFrame;
|
||||
#endif
|
||||
#if PUPPYPRINT_DEBUG
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
s32 j;
|
||||
@@ -1436,7 +1437,7 @@ void audio_reset_session(void) {
|
||||
gAudioLoadLock = AUDIO_LOCK_NOT_LOADING;
|
||||
}
|
||||
#endif
|
||||
#if PUPPYPRINT_DEBUG
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
#ifdef PUPPYPRINT_DEBUG_CYCLES
|
||||
append_puppyprint_log("Audio Initialised in %dc.", (s32)(osGetTime() - first));
|
||||
#else
|
||||
|
||||
@@ -129,7 +129,7 @@ void *soundAlloc(struct SoundAllocPool *pool, u32 size);
|
||||
void *sound_alloc_uninitialized(struct SoundAllocPool *pool, u32 size);
|
||||
void sound_init_main_pools(s32 sizeForAudioInitPool);
|
||||
void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size);
|
||||
#if PUPPYPRINT_DEBUG
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
void puppyprint_get_allocated_pools(s32 *audioPoolList);
|
||||
#endif
|
||||
#ifdef VERSION_SH
|
||||
|
||||
@@ -87,7 +87,7 @@ enum Codecs {
|
||||
#include "game/puppyprint.h"
|
||||
|
||||
#ifdef VERSION_EU
|
||||
/*#if PUPPYPRINT_DEBUG
|
||||
/*#ifdef PUPPYPRINT_DEBUG
|
||||
#define eu_stubbed_printf_0(msg) append_puppyprint_log(msg)
|
||||
#define eu_stubbed_printf_1(msg, a) append_puppyprint_log(msg, a)
|
||||
#define eu_stubbed_printf_2(msg, a, b) append_puppyprint_log(msg, a, b)
|
||||
@@ -732,6 +732,7 @@ struct NoteSynthesisBuffers {
|
||||
|
||||
#ifdef BETTER_REVERB
|
||||
struct BetterReverbSettings {
|
||||
u8 useLightweightSettings;
|
||||
s8 downsampleRate;
|
||||
u8 isMono;
|
||||
u8 filterCount;
|
||||
|
||||
@@ -2682,8 +2682,10 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
|
||||
// This runs 240 times per second.
|
||||
void process_sequences(UNUSED s32 iterationsRemaining) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < SEQUENCE_PLAYERS; i++) {
|
||||
if (gSequencePlayers[i].enabled == TRUE) {
|
||||
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
sequence_player_process_sequence(&gSequencePlayers[i]);
|
||||
sequence_player_process_sound(&gSequencePlayers[i]);
|
||||
@@ -2693,8 +2695,13 @@ void process_sequences(UNUSED s32 iterationsRemaining) {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SEQUENCES_SCRIPT, PROFILER_TIME_SUB_AUDIO_SEQUENCES_RECLAIM);
|
||||
reclaim_notes();
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SEQUENCES_RECLAIM, PROFILER_TIME_SUB_AUDIO_SEQUENCES_PROCESSING);
|
||||
#else
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SEQUENCES_SCRIPT, PROFILER_TIME_SUB_AUDIO_SEQUENCES_PROCESSING);
|
||||
#endif
|
||||
process_notes();
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
// Do not touch these values manually, unless you want potential for problems.
|
||||
u8 gBetterReverbPreset = 0;
|
||||
u8 toggleBetterReverb = FALSE;
|
||||
u8 betterReverbLightweight = FALSE;
|
||||
u8 monoReverb;
|
||||
s8 betterReverbDownsampleRate;
|
||||
static u8 reverbMultsL[NUM_ALLPASS / 3] = {0};
|
||||
@@ -52,6 +53,8 @@ static s32 delaysL[NUM_ALLPASS] = {0};
|
||||
static s32 delaysR[NUM_ALLPASS] = {0};
|
||||
static s32 **delayBufsL;
|
||||
static s32 **delayBufsR;
|
||||
static s32 lastDelayLightL;
|
||||
static s32 lastDelayLightR;
|
||||
s32 reverbLastFilterIndex;
|
||||
s32 reverbFilterCount;
|
||||
s32 betterReverbWindowsSize;
|
||||
@@ -73,13 +76,11 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
|
||||
#ifdef VERSION_EU
|
||||
u64 *synthesis_process_note(struct Note *note, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s16 *aiBuf, s32 bufLen, u64 *cmd);
|
||||
u64 *load_wave_samples(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamplesToLoad);
|
||||
u64 *final_resample(u64 *cmd, struct NoteSynthesisState *synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags);
|
||||
u64 *process_envelope(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags);
|
||||
u64 *note_apply_headset_pan_effects(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *note, s32 bufLen, s32 flags, s32 leftRight);
|
||||
#else
|
||||
u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd);
|
||||
u64 *load_wave_samples(u64 *cmd, struct Note *note, s32 nSamplesToLoad);
|
||||
u64 *final_resample(u64 *cmd, struct Note *note, s32 count, u16 pitch, u16 dmemIn, u32 flags);
|
||||
u64 *process_envelope(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, s32 headsetPanSettings,
|
||||
u32 flags);
|
||||
u64 *process_envelope_inner(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf,
|
||||
@@ -101,13 +102,13 @@ static void reverb_samples(s16 *outSampleL, s16 *outSampleR, s32 inSampleL, s32
|
||||
s32 *curDelaySampleR;
|
||||
s32 historySampleL;
|
||||
s32 historySampleR;
|
||||
s32 i = 0;
|
||||
s32 j = 0;
|
||||
s32 k = 0;
|
||||
s32 outTmpL = 0;
|
||||
s32 outTmpR = 0;
|
||||
s32 tmpCarryoverL = ((delayBufsL[reverbLastFilterIndex][allpassIdxL[reverbLastFilterIndex]] * betterReverbRevIndex) >> 8) + inSampleL;
|
||||
s32 tmpCarryoverR = ((delayBufsR[reverbLastFilterIndex][allpassIdxR[reverbLastFilterIndex]] * betterReverbRevIndex) >> 8) + inSampleR;
|
||||
s32 i = 0;
|
||||
s32 j = 0;
|
||||
s32 k = 0;
|
||||
|
||||
for (; i <= reverbLastFilterIndex; ++i, ++j) {
|
||||
curDelaySampleL = &delayBufsL[i][allpassIdxL[i]];
|
||||
@@ -143,11 +144,11 @@ static void reverb_samples(s16 *outSampleL, s16 *outSampleR, s32 inSampleL, s32
|
||||
static void reverb_mono_sample(s16 *outSample, s32 inSample) {
|
||||
s32 *curDelaySample;
|
||||
s32 historySample;
|
||||
s32 outTmp = 0;
|
||||
s32 tmpCarryover = ((delayBufsL[reverbLastFilterIndex][allpassIdxL[reverbLastFilterIndex]] * betterReverbRevIndex) >> 8) + inSample;
|
||||
s32 i = 0;
|
||||
s32 j = 0;
|
||||
s32 k = 0;
|
||||
s32 outTmp = 0;
|
||||
s32 tmpCarryover = ((delayBufsL[reverbLastFilterIndex][allpassIdxL[reverbLastFilterIndex]] * betterReverbRevIndex) >> 8) + inSample;
|
||||
|
||||
for (; i <= reverbLastFilterIndex; ++i, ++j) {
|
||||
curDelaySample = &delayBufsL[i][allpassIdxL[i]];
|
||||
@@ -170,6 +171,72 @@ static void reverb_mono_sample(s16 *outSample, s32 inSample) {
|
||||
*outSample = CLAMP_S16(outTmp);
|
||||
}
|
||||
|
||||
// Light reverb processing functions!
|
||||
#define FILTERS_MINUS_1 (BETTER_REVERB_FILTER_COUNT_LIGHT - 1)
|
||||
static void reverb_samples_light(s16 *outSampleL, s16 *outSampleR, s32 inSampleL, s32 inSampleR) {
|
||||
s32 *curDelaySampleL;
|
||||
s32 *curDelaySampleR;
|
||||
s32 historySampleL;
|
||||
s32 historySampleR;
|
||||
s32 tmpCarryoverL = (((delayBufsL[FILTERS_MINUS_1][allpassIdxL[FILTERS_MINUS_1]] * BETTER_REVERB_REVERB_INDEX_LIGHT) >> 8) + inSampleL);
|
||||
s32 tmpCarryoverR = (((delayBufsR[FILTERS_MINUS_1][allpassIdxR[FILTERS_MINUS_1]] * BETTER_REVERB_REVERB_INDEX_LIGHT) >> 8) + inSampleR);
|
||||
s32 i = 0;
|
||||
|
||||
for (; i < FILTERS_MINUS_1; ++i) {
|
||||
curDelaySampleL = &delayBufsL[i][allpassIdxL[i]];
|
||||
curDelaySampleR = &delayBufsR[i][allpassIdxR[i]];
|
||||
historySampleL = *curDelaySampleL;
|
||||
historySampleR = *curDelaySampleR;
|
||||
|
||||
*curDelaySampleL = (((historySampleL * (-BETTER_REVERB_GAIN_INDEX_LIGHT)) >> 8) + tmpCarryoverL);
|
||||
*curDelaySampleR = (((historySampleR * (-BETTER_REVERB_GAIN_INDEX_LIGHT)) >> 8) + tmpCarryoverR);
|
||||
tmpCarryoverL = (((*curDelaySampleL * BETTER_REVERB_GAIN_INDEX_LIGHT) >> 8) + historySampleL);
|
||||
tmpCarryoverR = (((*curDelaySampleR * BETTER_REVERB_GAIN_INDEX_LIGHT) >> 8) + historySampleR);
|
||||
|
||||
if (++allpassIdxL[i] == delaysL[i]) allpassIdxL[i] = 0;
|
||||
if (++allpassIdxR[i] == delaysR[i]) allpassIdxR[i] = 0;
|
||||
}
|
||||
|
||||
curDelaySampleL = &delayBufsL[FILTERS_MINUS_1][allpassIdxL[FILTERS_MINUS_1]];
|
||||
curDelaySampleR = &delayBufsR[FILTERS_MINUS_1][allpassIdxR[FILTERS_MINUS_1]];
|
||||
historySampleL = ((*curDelaySampleL * BETTER_REVERB_MULTIPLE_LIGHT) >> 8); // outTmpL variable not needed, as there is no sample addition happening here. Not really a history sample though.
|
||||
historySampleR = ((*curDelaySampleR * BETTER_REVERB_MULTIPLE_LIGHT) >> 8); // outTmpR variable not needed, as there is no sample addition happening here. Not really a history sample though.
|
||||
*curDelaySampleL = tmpCarryoverL;
|
||||
*curDelaySampleR = tmpCarryoverR;
|
||||
|
||||
if (++allpassIdxL[FILTERS_MINUS_1] == lastDelayLightL) allpassIdxL[FILTERS_MINUS_1] = 0;
|
||||
if (++allpassIdxR[FILTERS_MINUS_1] == lastDelayLightR) allpassIdxR[FILTERS_MINUS_1] = 0;
|
||||
|
||||
*outSampleL = CLAMP_S16(historySampleL);
|
||||
*outSampleR = CLAMP_S16(historySampleR);
|
||||
}
|
||||
|
||||
static void reverb_mono_sample_light(s16 *outSample, s32 inSample) {
|
||||
s32 *curDelaySample;
|
||||
s32 historySample;
|
||||
s32 tmpCarryover = (((delayBufsL[FILTERS_MINUS_1][allpassIdxL[FILTERS_MINUS_1]] * BETTER_REVERB_REVERB_INDEX_LIGHT) >> 8) + inSample);
|
||||
s32 i = 0;
|
||||
|
||||
for (; i < FILTERS_MINUS_1; ++i) {
|
||||
curDelaySample = &delayBufsL[i][allpassIdxL[i]];
|
||||
historySample = *curDelaySample;
|
||||
|
||||
*curDelaySample = (((historySample * (-BETTER_REVERB_GAIN_INDEX_LIGHT)) >> 8) + tmpCarryover);
|
||||
tmpCarryover = (((*curDelaySample * BETTER_REVERB_GAIN_INDEX_LIGHT) >> 8) + historySample);
|
||||
|
||||
if (++allpassIdxL[i] == delaysL[i]) allpassIdxL[i] = 0;
|
||||
}
|
||||
|
||||
curDelaySample = &delayBufsL[FILTERS_MINUS_1][allpassIdxL[FILTERS_MINUS_1]];
|
||||
historySample = ((*curDelaySample * BETTER_REVERB_MULTIPLE_LIGHT) >> 8); // outTmp variable not needed, as there is no sample addition happening here. Not really a history sample though.
|
||||
*curDelaySample = tmpCarryover;
|
||||
|
||||
if (++allpassIdxL[FILTERS_MINUS_1] == lastDelayLightL) allpassIdxL[FILTERS_MINUS_1] = 0;
|
||||
|
||||
*outSample = CLAMP_S16(historySample);
|
||||
}
|
||||
#undef FILTERS_MINUS_1
|
||||
|
||||
void initialize_better_reverb_buffers(void) {
|
||||
delayBufsL = (s32**) soundAlloc(&gBetterReverbPool, BETTER_REVERB_PTR_SIZE);
|
||||
delayBufsR = &delayBufsL[NUM_ALLPASS];
|
||||
@@ -178,6 +245,10 @@ void initialize_better_reverb_buffers(void) {
|
||||
void set_better_reverb_buffers(u32 *inputDelaysL, u32 *inputDelaysR) {
|
||||
s32 bufOffset = 0;
|
||||
s32 i;
|
||||
s32 filterCount = reverbFilterCount;
|
||||
|
||||
if (betterReverbLightweight)
|
||||
filterCount = BETTER_REVERB_FILTER_COUNT_LIGHT;
|
||||
|
||||
gBetterReverbPool.cur = gBetterReverbPool.start + ALIGN16(BETTER_REVERB_PTR_SIZE); // Reset reverb data pool
|
||||
|
||||
@@ -185,9 +256,9 @@ void set_better_reverb_buffers(u32 *inputDelaysL, u32 *inputDelaysR) {
|
||||
if (!toggleBetterReverb)
|
||||
return;
|
||||
|
||||
// NOTE: Using reverbFilterCount over NUM_ALLPASS will report less memory usage with fewer filters, but poses an additional
|
||||
// NOTE: Using filterCount over NUM_ALLPASS will report less memory usage with fewer filters, but poses an additional
|
||||
// risk to anybody testing on console with performance compromises, as emulator can be easily overlooked.
|
||||
for (i = 0; i < reverbFilterCount; ++i) {
|
||||
for (i = 0; i < filterCount; ++i) {
|
||||
delaysL[i] = (s32) (inputDelaysL[i] / gReverbDownsampleRate);
|
||||
delaysR[i] = (s32) (inputDelaysR[i] / gReverbDownsampleRate);
|
||||
delayBufsL[i] = soundAlloc(&gBetterReverbPool, delaysL[i] * sizeof(s32));
|
||||
@@ -198,6 +269,9 @@ void set_better_reverb_buffers(u32 *inputDelaysL, u32 *inputDelaysR) {
|
||||
|
||||
aggress(bufOffset * sizeof(s32) <= BETTER_REVERB_SIZE - ALIGN16(BETTER_REVERB_PTR_SIZE), "BETTER_REVERB_SIZE is too small for this preset!");
|
||||
|
||||
lastDelayLightL = delaysL[filterCount-1];
|
||||
lastDelayLightR = delaysR[filterCount-1];
|
||||
|
||||
bzero(allpassIdxL, sizeof(allpassIdxL));
|
||||
bzero(allpassIdxR, sizeof(allpassIdxR));
|
||||
}
|
||||
@@ -302,40 +376,82 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex) {
|
||||
}
|
||||
#ifdef BETTER_REVERB
|
||||
else if (toggleBetterReverb) {
|
||||
s32 firstLoopMax;
|
||||
s32 secondLoopMax;
|
||||
item = &gSynthesisReverb.items[gSynthesisReverb.curFrame][updateIndex];
|
||||
if (gSoundMode == SOUND_MODE_MONO || monoReverb) {
|
||||
if (gReverbDownsampleRate != 1) {
|
||||
osInvalDCache(item->toDownsampleLeft, DEFAULT_LEN_2CH);
|
||||
for (srcPos = 0, dstPos = item->startPos; dstPos < ((item->lengthA / 2) + item->startPos); srcPos += gReverbDownsampleRate, dstPos++) {
|
||||
reverb_mono_sample(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) item->toDownsampleLeft[srcPos] + (s32) item->toDownsampleRight[srcPos]) / 2);
|
||||
gSynthesisReverb.ringBuffer.right[dstPos] = gSynthesisReverb.ringBuffer.left[dstPos];
|
||||
}
|
||||
for (dstPos = 0; dstPos < (item->lengthB / 2); srcPos += gReverbDownsampleRate, dstPos++) {
|
||||
reverb_mono_sample(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) item->toDownsampleLeft[srcPos] + (s32) item->toDownsampleRight[srcPos]) / 2);
|
||||
gSynthesisReverb.ringBuffer.right[dstPos] = gSynthesisReverb.ringBuffer.left[dstPos];
|
||||
dstPos = item->startPos;
|
||||
firstLoopMax = ((item->lengthA / 2) + item->startPos);
|
||||
secondLoopMax = (item->lengthB / 2);
|
||||
|
||||
// This block could be simplified probably with function pointers or rewriting reverb_mono_sample to support L and R individually. Another idea would be to process more than one sample at a time
|
||||
// for each function call. In practice with HackerSM64, these ideas either aren't super trivial to implement efficiently or don't benefit performance at all, so I'm leaving this as it is for now.
|
||||
if (betterReverbLightweight) {
|
||||
if (gSoundMode == SOUND_MODE_MONO || monoReverb) {
|
||||
if (gReverbDownsampleRate != 1) {
|
||||
osInvalDCache(item->toDownsampleLeft, DEFAULT_LEN_2CH);
|
||||
for (srcPos = 0; dstPos < firstLoopMax; srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_mono_sample_light(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) item->toDownsampleLeft[srcPos] + (s32) item->toDownsampleRight[srcPos]) / 2);
|
||||
bcopy(&gSynthesisReverb.ringBuffer.left[item->startPos], &gSynthesisReverb.ringBuffer.right[item->startPos], (dstPos - item->startPos) * sizeof(s16));
|
||||
|
||||
for (dstPos = 0; dstPos < secondLoopMax; srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_mono_sample_light(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) item->toDownsampleLeft[srcPos] + (s32) item->toDownsampleRight[srcPos]) / 2);
|
||||
bcopy(gSynthesisReverb.ringBuffer.left, gSynthesisReverb.ringBuffer.right, dstPos * sizeof(s16));
|
||||
} else {
|
||||
for (; dstPos < firstLoopMax; dstPos++)
|
||||
reverb_mono_sample_light(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) gSynthesisReverb.ringBuffer.left[dstPos] + (s32) gSynthesisReverb.ringBuffer.right[dstPos]) / 2);
|
||||
bcopy(&gSynthesisReverb.ringBuffer.left[item->startPos], &gSynthesisReverb.ringBuffer.right[item->startPos], (dstPos - item->startPos) * sizeof(s16));
|
||||
|
||||
for (dstPos = 0; dstPos < secondLoopMax; dstPos++)
|
||||
reverb_mono_sample_light(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) gSynthesisReverb.ringBuffer.left[dstPos] + (s32) gSynthesisReverb.ringBuffer.right[dstPos]) / 2);
|
||||
bcopy(gSynthesisReverb.ringBuffer.left, gSynthesisReverb.ringBuffer.right, dstPos * sizeof(s16));
|
||||
}
|
||||
} else {
|
||||
for (dstPos = item->startPos; dstPos < ((item->lengthA / 2) + item->startPos); dstPos++) {
|
||||
reverb_mono_sample(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) gSynthesisReverb.ringBuffer.left[dstPos] + (s32) gSynthesisReverb.ringBuffer.right[dstPos]) / 2);
|
||||
gSynthesisReverb.ringBuffer.right[dstPos] = gSynthesisReverb.ringBuffer.left[dstPos];
|
||||
}
|
||||
for (dstPos = 0; dstPos < (item->lengthB / 2); dstPos++) {
|
||||
reverb_mono_sample(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) gSynthesisReverb.ringBuffer.left[dstPos] + (s32) gSynthesisReverb.ringBuffer.right[dstPos]) / 2);
|
||||
gSynthesisReverb.ringBuffer.right[dstPos] = gSynthesisReverb.ringBuffer.left[dstPos];
|
||||
if (gReverbDownsampleRate != 1) {
|
||||
osInvalDCache(item->toDownsampleLeft, DEFAULT_LEN_2CH);
|
||||
for (srcPos = 0; dstPos < firstLoopMax; srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_samples_light(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], item->toDownsampleLeft[srcPos], item->toDownsampleRight[srcPos]);
|
||||
for (dstPos = 0; dstPos < secondLoopMax; srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_samples_light(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], item->toDownsampleLeft[srcPos], item->toDownsampleRight[srcPos]);
|
||||
} else {
|
||||
for (; dstPos < firstLoopMax; dstPos++)
|
||||
reverb_samples_light(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], gSynthesisReverb.ringBuffer.left[dstPos], gSynthesisReverb.ringBuffer.right[dstPos]);
|
||||
for (dstPos = 0; dstPos < secondLoopMax; dstPos++)
|
||||
reverb_samples_light(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], gSynthesisReverb.ringBuffer.left[dstPos], gSynthesisReverb.ringBuffer.right[dstPos]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (gReverbDownsampleRate != 1) {
|
||||
osInvalDCache(item->toDownsampleLeft, DEFAULT_LEN_2CH);
|
||||
for (srcPos = 0, dstPos = item->startPos; dstPos < ((item->lengthA / 2) + item->startPos); srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_samples(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], item->toDownsampleLeft[srcPos], item->toDownsampleRight[srcPos]);
|
||||
for (dstPos = 0; dstPos < (item->lengthB / 2); srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_samples(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], item->toDownsampleLeft[srcPos], item->toDownsampleRight[srcPos]);
|
||||
if (gSoundMode == SOUND_MODE_MONO || monoReverb) {
|
||||
if (gReverbDownsampleRate != 1) {
|
||||
osInvalDCache(item->toDownsampleLeft, DEFAULT_LEN_2CH);
|
||||
for (srcPos = 0; dstPos < firstLoopMax; srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_mono_sample(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) item->toDownsampleLeft[srcPos] + (s32) item->toDownsampleRight[srcPos]) / 2);
|
||||
bcopy(&gSynthesisReverb.ringBuffer.left[item->startPos], &gSynthesisReverb.ringBuffer.right[item->startPos], (dstPos - item->startPos) * sizeof(s16));
|
||||
|
||||
for (dstPos = 0; dstPos < secondLoopMax; srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_mono_sample(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) item->toDownsampleLeft[srcPos] + (s32) item->toDownsampleRight[srcPos]) / 2);
|
||||
bcopy(gSynthesisReverb.ringBuffer.left, gSynthesisReverb.ringBuffer.right, dstPos * sizeof(s16));
|
||||
} else {
|
||||
for (; dstPos < firstLoopMax; dstPos++)
|
||||
reverb_mono_sample(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) gSynthesisReverb.ringBuffer.left[dstPos] + (s32) gSynthesisReverb.ringBuffer.right[dstPos]) / 2);
|
||||
bcopy(&gSynthesisReverb.ringBuffer.left[item->startPos], &gSynthesisReverb.ringBuffer.right[item->startPos], (dstPos - item->startPos) * sizeof(s16));
|
||||
|
||||
for (dstPos = 0; dstPos < secondLoopMax; dstPos++)
|
||||
reverb_mono_sample(&gSynthesisReverb.ringBuffer.left[dstPos], ((s32) gSynthesisReverb.ringBuffer.left[dstPos] + (s32) gSynthesisReverb.ringBuffer.right[dstPos]) / 2);
|
||||
bcopy(gSynthesisReverb.ringBuffer.left, gSynthesisReverb.ringBuffer.right, dstPos * sizeof(s16));
|
||||
}
|
||||
} else {
|
||||
for (dstPos = item->startPos; dstPos < ((item->lengthA / 2) + item->startPos); dstPos++)
|
||||
reverb_samples(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], gSynthesisReverb.ringBuffer.left[dstPos], gSynthesisReverb.ringBuffer.right[dstPos]);
|
||||
for (dstPos = 0; dstPos < (item->lengthB / 2); dstPos++)
|
||||
reverb_samples(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], gSynthesisReverb.ringBuffer.left[dstPos], gSynthesisReverb.ringBuffer.right[dstPos]);
|
||||
if (gReverbDownsampleRate != 1) {
|
||||
osInvalDCache(item->toDownsampleLeft, DEFAULT_LEN_2CH);
|
||||
for (srcPos = 0; dstPos < firstLoopMax; srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_samples(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], item->toDownsampleLeft[srcPos], item->toDownsampleRight[srcPos]);
|
||||
for (dstPos = 0; dstPos < secondLoopMax; srcPos += gReverbDownsampleRate, dstPos++)
|
||||
reverb_samples(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], item->toDownsampleLeft[srcPos], item->toDownsampleRight[srcPos]);
|
||||
} else {
|
||||
for (; dstPos < firstLoopMax; dstPos++)
|
||||
reverb_samples(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], gSynthesisReverb.ringBuffer.left[dstPos], gSynthesisReverb.ringBuffer.right[dstPos]);
|
||||
for (dstPos = 0; dstPos < secondLoopMax; dstPos++)
|
||||
reverb_samples(&gSynthesisReverb.ringBuffer.left[dstPos], &gSynthesisReverb.ringBuffer.right[dstPos], gSynthesisReverb.ringBuffer.left[dstPos], gSynthesisReverb.ringBuffer.right[dstPos]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -409,29 +525,6 @@ void synthesis_load_note_subs_eu(s32 updateIndex) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef VERSION_EU
|
||||
s32 get_volume_ramping(u16 sourceVol, u16 targetVol, s32 arg2) {
|
||||
// This roughly computes 2^16 * (targetVol / sourceVol) ^ (8 / arg2),
|
||||
// but with discretizations of targetVol, sourceVol and arg2.
|
||||
f32 ret;
|
||||
switch (arg2) {
|
||||
default:
|
||||
ret = gVolRampingLhs136[targetVol >> 8] * gVolRampingRhs136[sourceVol >> 8];
|
||||
break;
|
||||
case 128:
|
||||
ret = gVolRampingLhs128[targetVol >> 8] * gVolRampingRhs128[sourceVol >> 8];
|
||||
break;
|
||||
case 136:
|
||||
ret = gVolRampingLhs136[targetVol >> 8] * gVolRampingRhs136[sourceVol >> 8];
|
||||
break;
|
||||
case 144:
|
||||
ret = gVolRampingLhs144[targetVol >> 8] * gVolRampingRhs144[sourceVol >> 8];
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_EU
|
||||
// TODO: (Scrub C) pointless mask and whitespace
|
||||
u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) {
|
||||
@@ -536,11 +629,22 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) {
|
||||
chunkLen += 8;
|
||||
}
|
||||
}
|
||||
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_UPDATE, PROFILER_TIME_SUB_AUDIO_SEQUENCES);
|
||||
AUDIO_PROFILER_START_SHARED(PROFILER_TIME_SUB_AUDIO_SEQUENCES, PROFILER_TIME_SUB_AUDIO_SEQUENCES_SCRIPT);
|
||||
|
||||
process_sequences(i - 1);
|
||||
|
||||
AUDIO_PROFILER_COMPLETE_AND_SWITCH(PROFILER_TIME_SUB_AUDIO_SEQUENCES_PROCESSING, PROFILER_TIME_SUB_AUDIO_SEQUENCES, PROFILER_TIME_SUB_AUDIO_SYNTHESIS);
|
||||
AUDIO_PROFILER_START_SHARED(PROFILER_TIME_SUB_AUDIO_SYNTHESIS, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB);
|
||||
|
||||
if (gSynthesisReverb.useReverb) {
|
||||
prepare_reverb_ring_buffer(chunkLen, gAudioUpdatesPerFrame - i);
|
||||
}
|
||||
cmd = synthesis_do_one_audio_update((s16 *) aiBufPtr, chunkLen, cmd, gAudioUpdatesPerFrame - i);
|
||||
|
||||
AUDIO_PROFILER_COMPLETE_AND_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB, PROFILER_TIME_SUB_AUDIO_SYNTHESIS, PROFILER_TIME_SUB_AUDIO_UPDATE);
|
||||
|
||||
bufLen -= chunkLen;
|
||||
aiBufPtr += chunkLen;
|
||||
}
|
||||
@@ -705,7 +809,10 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
|
||||
|
||||
if (!gSynthesisReverb.useReverb) {
|
||||
aClearBuffer(cmd++, DMEM_ADDR_LEFT_CH, DEFAULT_LEN_2CH);
|
||||
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING);
|
||||
cmd = synthesis_process_notes(aiBuf, bufLen, cmd);
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB);
|
||||
} else {
|
||||
if (gReverbDownsampleRate == 1) {
|
||||
// Put the oldest samples in the ring buffer into the wet channels
|
||||
@@ -741,7 +848,11 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
|
||||
aMix(cmd++, 0, /*gain*/ 0x8000 + gSynthesisReverb.reverbGain, /*in*/ DMEM_ADDR_LEFT_CH, /*out*/ DMEM_ADDR_LEFT_CH);
|
||||
aDMEMMove(cmd++, DMEM_ADDR_LEFT_CH, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_2CH);
|
||||
}
|
||||
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING);
|
||||
cmd = synthesis_process_notes(aiBuf, bufLen, cmd);
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB);
|
||||
|
||||
if (gReverbDownsampleRate == 1) {
|
||||
aSetSaveBufferPair(cmd++, 0, v1->lengthA, v1->startPos);
|
||||
if (v1->lengthB != 0) {
|
||||
@@ -1020,15 +1131,25 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) {
|
||||
if (audioBookSample->loaded == 0x81) {
|
||||
v0_2 = sampleAddr + temp * 9;
|
||||
} else {
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_DMA);
|
||||
|
||||
v0_2 = dma_sample_data(
|
||||
(uintptr_t) (sampleAddr + temp * 9),
|
||||
t0 * 9, flags, &synthesisState->sampleDmaIndex);
|
||||
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_DMA, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING);
|
||||
}
|
||||
#else
|
||||
// HACKERSM64_TODO: Is the EU thing above applicable to US? Could potentially save some resources.
|
||||
temp = (note->samplePosInt - s2 + 0x10) / 16;
|
||||
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_DMA);
|
||||
|
||||
v0_2 = dma_sample_data(
|
||||
(uintptr_t) (sampleAddr + temp * 9),
|
||||
t0 * 9, flags, ¬e->sampleDmaIndex);
|
||||
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_DMA, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING);
|
||||
#endif
|
||||
a3 = (u32)((uintptr_t) v0_2 & 0xf);
|
||||
aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA, 0, t0 * 9 + a3);
|
||||
@@ -1197,16 +1318,18 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) {
|
||||
noteSubEu->needsInit = FALSE;
|
||||
}
|
||||
|
||||
cmd = final_resample(cmd, synthesisState, bufLen * 2, resamplingRateFixedPoint,
|
||||
noteSamplesDmemAddrBeforeResampling, flags);
|
||||
// final resample
|
||||
aSetBuffer(cmd++, /*flags*/ 0, noteSamplesDmemAddrBeforeResampling, /*dmemout*/ DMEM_ADDR_TEMP, bufLen * 2);
|
||||
aResample(cmd++, flags, resamplingRateFixedPoint, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->finalResampleState));
|
||||
#else
|
||||
if (note->needsInit == TRUE) {
|
||||
flags = A_INIT;
|
||||
note->needsInit = FALSE;
|
||||
}
|
||||
|
||||
cmd = final_resample(cmd, note, bufLen * 2, resamplingRateFixedPoint,
|
||||
noteSamplesDmemAddrBeforeResampling, flags);
|
||||
// final resample
|
||||
aSetBuffer(cmd++, /*flags*/ 0, noteSamplesDmemAddrBeforeResampling, /*dmemout*/ DMEM_ADDR_TEMP, bufLen * 2);
|
||||
aResample(cmd++, flags, resamplingRateFixedPoint, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->finalResampleState));
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_EU
|
||||
@@ -1224,11 +1347,13 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) {
|
||||
leftRight = 0;
|
||||
}
|
||||
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB);
|
||||
#ifdef VERSION_EU
|
||||
cmd = process_envelope(cmd, noteSubEu, synthesisState, bufLen, 0, leftRight, flags);
|
||||
#else
|
||||
cmd = process_envelope(cmd, note, bufLen, 0, leftRight, flags);
|
||||
#endif
|
||||
AUDIO_PROFILER_SWITCH(PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB, PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING);
|
||||
|
||||
#ifdef VERSION_EU
|
||||
if (noteSubEu->usesHeadsetPanEffects) {
|
||||
@@ -1293,20 +1418,6 @@ u64 *load_wave_samples(u64 *cmd, struct Note *note, s32 nSamplesToLoad) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef VERSION_EU
|
||||
u64 *final_resample(u64 *cmd, struct NoteSynthesisState *synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags) {
|
||||
aSetBuffer(cmd++, /*flags*/ 0, dmemIn, /*dmemout*/ DMEM_ADDR_TEMP, count);
|
||||
aResample(cmd++, flags, pitch, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->finalResampleState));
|
||||
return cmd;
|
||||
}
|
||||
#else
|
||||
u64 *final_resample(u64 *cmd, struct Note *note, s32 count, u16 pitch, u16 dmemIn, u32 flags) {
|
||||
aSetBuffer(cmd++, /*flags*/ 0, dmemIn, /*dmemout*/ DMEM_ADDR_TEMP, count);
|
||||
aResample(cmd++, flags, pitch, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->finalResampleState));
|
||||
return cmd;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef VERSION_EU
|
||||
u64 *process_envelope(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, s32 headsetPanSettings,
|
||||
UNUSED u32 flags) {
|
||||
@@ -1406,8 +1517,24 @@ u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisStat
|
||||
rampLeft = gCurrentLeftVolRamping[targetLeft >> 5] * gCurrentRightVolRamping[sourceLeft >> 5];
|
||||
rampRight = gCurrentLeftVolRamping[targetRight >> 5] * gCurrentRightVolRamping[sourceRight >> 5];
|
||||
#else
|
||||
rampLeft = get_volume_ramping(vol->sourceLeft, vol->targetLeft, nSamples);
|
||||
rampRight = get_volume_ramping(vol->sourceRight, vol->targetRight, nSamples);
|
||||
// volume ramping
|
||||
// This roughly computes 2^16 * (targetVol / sourceVol) ^ (8 / arg2),
|
||||
// but with discretizations of targetVol, sourceVol and arg2.
|
||||
switch (nSamples) {
|
||||
case 128:
|
||||
rampLeft = gVolRampingLhs128[vol->targetLeft >> 8] * gVolRampingRhs128[vol->sourceLeft >> 8];
|
||||
rampRight = gVolRampingLhs128[vol->targetRight >> 8] * gVolRampingRhs128[vol->sourceRight >> 8];
|
||||
break;
|
||||
case 144:
|
||||
rampLeft = gVolRampingLhs144[vol->targetLeft >> 8] * gVolRampingRhs144[vol->sourceLeft >> 8];
|
||||
rampRight = gVolRampingLhs144[vol->targetRight >> 8] * gVolRampingRhs144[vol->sourceRight >> 8];
|
||||
break;
|
||||
case 136:
|
||||
default:
|
||||
rampLeft = gVolRampingLhs136[vol->targetLeft >> 8] * gVolRampingRhs136[vol->sourceLeft >> 8];
|
||||
rampRight = gVolRampingLhs136[vol->targetRight >> 8] * gVolRampingRhs136[vol->sourceRight >> 8];
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
// The operation's parameters change meanings depending on flags
|
||||
|
||||
@@ -19,14 +19,37 @@
|
||||
|
||||
#ifdef BETTER_REVERB
|
||||
|
||||
#define REVERB_WINDOW_SIZE_MAX 0x2000
|
||||
|
||||
|
||||
/* ------------ BETTER REVERB GENERAL PARAMETERS ------------ */
|
||||
|
||||
#define NUM_ALLPASS 12 // Maximum number of delay filters to use with better reverb; do not change this value if you don't know what you're doing.
|
||||
#define BETTER_REVERB_PTR_SIZE ALIGN16(NUM_ALLPASS * sizeof(s32*) * 2) // Allocation space consumed by dynamically allocated pointers
|
||||
|
||||
// Size determined by (all delaysL/R values * 8) / (2 ^ Minimum Downsample Factor).
|
||||
// The default value can be increased or decreased in conjunction with the values in delaysL/R
|
||||
#define BETTER_REVERB_SIZE ALIGN16(0x1E000 + BETTER_REVERB_PTR_SIZE) // This can be significantly decreased if a downsample rate of 1 is not being used.
|
||||
// The default value can be increased or decreased in conjunction with the values in delaysL/R.
|
||||
// This can be significantly decreased if a downsample rate of 1 is not being used or if filter count is less than NUM_ALLPASS,
|
||||
// as this default is configured to handle the emulator RCVI settings.
|
||||
#define BETTER_REVERB_SIZE ALIGN16(0x1E000 + BETTER_REVERB_PTR_SIZE)
|
||||
|
||||
|
||||
/* ------ BETTER REVERB LIGHTWEIGHT PARAMETER OVERRIDES ------ */
|
||||
|
||||
// Filter count works differently than normal when used with light settings and can support numbers that are not multiples of 3, though 3 is generally recommended.
|
||||
// This can be reduced to 2 to save a third of runtime overhead, but substantially reduces reverb saturation.
|
||||
// Similarly this can be increased from 3, but likely won't have beneficial outcomes worth the runtime expense compared to the modification of other parameters without using light settings.
|
||||
#define BETTER_REVERB_FILTER_COUNT_LIGHT 3
|
||||
#define BETTER_REVERB_GAIN_INDEX_LIGHT 0xA0 // Advanced parameter; used to tune the outputs of every filter except for the final one
|
||||
#define BETTER_REVERB_REVERB_INDEX_LIGHT 0x30 // Advanced parameter; used to tune the incoming output of the final filter
|
||||
#define BETTER_REVERB_MULTIPLE_LIGHT 0xD0 // Advanced parameter; multiplier applied to the final output signal for both the left and right channels (divided by 256)
|
||||
|
||||
|
||||
/* ------------ BETTER REVERB EXTERNED VARIABLES ------------ */
|
||||
|
||||
extern u8 toggleBetterReverb;
|
||||
extern u8 gBetterReverbPreset;
|
||||
extern u8 betterReverbLightweight;
|
||||
extern s8 betterReverbDownsampleRate;
|
||||
extern u8 monoReverb;
|
||||
extern s32 reverbFilterCount;
|
||||
@@ -36,10 +59,18 @@ extern s32 betterReverbGainIndex;
|
||||
extern s32 *gReverbMultsL;
|
||||
extern s32 *gReverbMultsR;
|
||||
|
||||
extern u8 toggleBetterReverb;
|
||||
#define REVERB_WINDOW_SIZE_MAX 0x2000
|
||||
|
||||
/* ------------ BETTER REVERB EXTERNED FUNCTIONS ------------ */
|
||||
|
||||
void initialize_better_reverb_buffers(void);
|
||||
void set_better_reverb_buffers(u32 *inputDelaysL, u32 *inputDelaysR);
|
||||
|
||||
|
||||
/* -------------- BETTER REVERB STATIC ASSERTS -------------- */
|
||||
|
||||
STATIC_ASSERT(NUM_ALLPASS % 3 == 0, "NUM_ALLPASS must be a multiple of 3!");
|
||||
STATIC_ASSERT(BETTER_REVERB_FILTER_COUNT_LIGHT >= 2, "BETTER_REVERB_FILTER_COUNT_LIGHT should be no less than 2!");
|
||||
STATIC_ASSERT(BETTER_REVERB_FILTER_COUNT_LIGHT <= NUM_ALLPASS, "BETTER_REVERB_FILTER_COUNT_LIGHT cannot be larger than NUM_ALLPASS!");
|
||||
|
||||
#else
|
||||
|
||||
@@ -137,11 +168,6 @@ extern struct SynthesisReverb gSynthesisReverb;
|
||||
extern s16 D_SH_803479B4;
|
||||
#endif
|
||||
|
||||
#ifdef BETTER_REVERB
|
||||
void initialize_better_reverb_buffers(void);
|
||||
void set_better_reverb_buffers(u32 *inputDelaysL, u32 *inputDelaysR);
|
||||
#endif
|
||||
|
||||
u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen);
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
void note_init_volume(struct Note *note);
|
||||
|
||||
@@ -129,7 +129,7 @@ void main_pool_init(void *start, void *end) {
|
||||
sPoolListHeadL->next = NULL;
|
||||
sPoolListHeadR->prev = NULL;
|
||||
sPoolListHeadR->next = NULL;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
mempool = sPoolFreeSpace;
|
||||
#endif
|
||||
}
|
||||
@@ -334,8 +334,9 @@ void *load_segment(s32 segment, u8 *srcStart, u8 *srcEnd, u32 side, u8 *bssStart
|
||||
set_segment_base_addr(segment, addr);
|
||||
}
|
||||
}
|
||||
#if PUPPYPRINT_DEBUG
|
||||
ramsizeSegment[(segment + nameTable) - 2] = ((s32)srcEnd - (s32)srcStart);
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
u32 ppSize = ALIGN16(srcEnd - srcStart) + 16;
|
||||
set_segment_memory_printout(segment, ppSize);
|
||||
#endif
|
||||
return addr;
|
||||
}
|
||||
@@ -411,8 +412,9 @@ void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) {
|
||||
main_pool_free(compressed);
|
||||
}
|
||||
}
|
||||
#if PUPPYPRINT_DEBUG
|
||||
ramsizeSegment[(segment + nameTable) - 2] = (s32)srcEnd - (s32)srcStart;
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
u32 ppSize = ALIGN16((u32)*size) + 16;
|
||||
set_segment_memory_printout(segment, ppSize);
|
||||
#endif
|
||||
return dest;
|
||||
}
|
||||
@@ -543,6 +545,9 @@ struct MemoryPool *mem_pool_init(u32 size, u32 side) {
|
||||
block->next = NULL;
|
||||
block->size = pool->totalSpace;
|
||||
}
|
||||
#ifdef PUPPYPRINT_DEBUG
|
||||
gPoolMem += ALIGN16(size) + 16;
|
||||
#endif
|
||||
return pool;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
#include "game/game_init.h"
|
||||
#include "game/main.h"
|
||||
#include "config.h"
|
||||
#include "audio/data.h"
|
||||
|
||||
extern u8 gDecompressionHeap[];
|
||||
|
||||
extern u8 gAudioHeap[];
|
||||
extern u8 gAudioHeap[DOUBLE_SIZE_ON_64_BIT(AUDIO_HEAP_SIZE)];
|
||||
|
||||
extern u8 gIdleThreadStack[THREAD1_STACK];
|
||||
extern u8 gThread3Stack[THREAD3_STACK];
|
||||
|
||||
@@ -820,13 +820,11 @@ void cur_obj_update(void) {
|
||||
BhvCommandProc bhvCmdProc;
|
||||
s32 bhvProcResult;
|
||||
|
||||
s32 inRoom = is_mario_in_room();
|
||||
s32 inRoom = cur_obj_is_mario_in_room();
|
||||
|
||||
if (!(objFlags & OBJ_FLAG_PROCESS_OUTSIDE_ROOM)) {
|
||||
if (inRoom == MARIO_OUTSIDE_ROOM) {
|
||||
cur_obj_enable_disable_room_rendering(MARIO_OUTSIDE_ROOM);
|
||||
return;
|
||||
}
|
||||
if (inRoom == MARIO_OUTSIDE_ROOM && (objFlags & OBJ_FLAG_ONLY_PROCESS_INSIDE_ROOM)) {
|
||||
cur_obj_disable_rendering_in_room();
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate the distance from the object to Mario.
|
||||
@@ -932,7 +930,11 @@ void cur_obj_update(void) {
|
||||
(objFlags & OBJ_FLAG_ACTIVE_FROM_AFAR)
|
||||
|| distanceFromMario < o->oDrawingDistance
|
||||
) {
|
||||
cur_obj_enable_disable_room_rendering(inRoom);
|
||||
if (inRoom == MARIO_OUTSIDE_ROOM) {
|
||||
cur_obj_disable_rendering_in_room();
|
||||
} else if (inRoom == MARIO_INSIDE_ROOM) {
|
||||
cur_obj_enable_rendering_in_room();
|
||||
}
|
||||
o->activeFlags &= ~ACTIVE_FLAG_FAR_AWAY;
|
||||
} else {
|
||||
o->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user