mirror of
https://github.com/BanjoRecomp/BanjoRecomp
synced 2026-06-11 12:39:51 -04:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f581cfc5b7 | |||
| 526fc1f1d6 | |||
| 948e0d5c27 | |||
| dc99e55f7f | |||
| a79304b82b | |||
| bec7bc0e57 |
@@ -0,0 +1,257 @@
|
||||
#include "patches.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern struct {
|
||||
u8 unk0;
|
||||
char* ptr;
|
||||
s32 index;
|
||||
} s_dialogBin;
|
||||
|
||||
extern s32 code94620_func_8031B5B0(void);
|
||||
|
||||
static char dialog_bytes[1024];
|
||||
char* dialog_byte_cursor = NULL;
|
||||
char* dialog_byte_character_cursor = NULL;
|
||||
|
||||
void start_dialog_bin() {
|
||||
dialog_byte_cursor = &dialog_bytes[0];
|
||||
dialog_byte_character_cursor = dialog_byte_cursor;
|
||||
*(dialog_byte_cursor++) = 0;
|
||||
}
|
||||
|
||||
void add_dialog_bin_string(char command, const char* string) {
|
||||
u32 length_with_zero = strlen(string) + 1;
|
||||
*(dialog_byte_cursor++) = command;
|
||||
*(dialog_byte_cursor++) = length_with_zero;
|
||||
memcpy(dialog_byte_cursor, string, length_with_zero);
|
||||
dialog_byte_cursor += length_with_zero;
|
||||
*dialog_byte_character_cursor += 1;
|
||||
}
|
||||
|
||||
void next_dialog_bin_character() {
|
||||
dialog_byte_character_cursor = dialog_byte_cursor;
|
||||
*(dialog_byte_cursor++) = 0;
|
||||
}
|
||||
|
||||
char *end_dialog_bin() {
|
||||
u32 dialog_size = dialog_byte_cursor - dialog_bytes;
|
||||
char *alloc = malloc_recomp(dialog_size);
|
||||
memcpy(alloc, dialog_bytes, dialog_size);
|
||||
#if 0
|
||||
recomp_printf("[%d]: ", dialog_size);
|
||||
|
||||
for (u32 i = 0; i < dialog_size; i++) {
|
||||
recomp_printf("0x%X ", dialog_bytes[i]);
|
||||
}
|
||||
#endif
|
||||
return alloc;
|
||||
}
|
||||
|
||||
RECOMP_PATCH char* dialogBin_get(enum asset_e text_id) {
|
||||
char* sp1C;
|
||||
char* var_v0;
|
||||
s32 var_a0; //offset where text starts (normally 0x3)
|
||||
|
||||
//get text_bin from asset cache
|
||||
s_dialogBin.ptr = assetcache_get(text_id);
|
||||
sp1C = s_dialogBin.ptr + 1;
|
||||
sp1C += code94620_func_8031B5B0() * 2;
|
||||
var_a0 = *(sp1C++);
|
||||
var_a0 += *(sp1C++) << 8;
|
||||
if (sp1C);
|
||||
var_v0 = s_dialogBin.ptr + var_a0;
|
||||
s_dialogBin.index = text_id;
|
||||
|
||||
#if 0
|
||||
recomp_printf("static char dialog_%d[] = {", text_id);
|
||||
|
||||
char* c = var_v0;
|
||||
for (u32 i = 0; i < 2; i++) {
|
||||
char count = *(c++);
|
||||
recomp_printf("0x%X, ", count);
|
||||
|
||||
for (char j = 0; j < count; j++) {
|
||||
char cmd = *(c++);
|
||||
char len = *(c++);
|
||||
recomp_printf("0x%X, ", cmd);
|
||||
recomp_printf("0x%X, ", len);
|
||||
|
||||
for (char k = 0; k < len; k++) {
|
||||
if (*c == '\'') {
|
||||
recomp_printf("'\\'', ");
|
||||
}
|
||||
else if ((*c >= 'a' && *c <= 'z') || (*c >= 'A' && *c <= 'Z') || (*c >= '0' && *c <= '9') || (*c >= ' ' && *c <= '?')) {
|
||||
recomp_printf("'%c', ", *c);
|
||||
}
|
||||
else {
|
||||
recomp_printf("0x%X, ", *c);
|
||||
}
|
||||
|
||||
c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
recomp_printf("}\n");
|
||||
#endif
|
||||
|
||||
#define DIALOGUE_BANJO_HEAD 0x80
|
||||
#define DIALOGUE_KAZOOIE_HEAD 0x81
|
||||
#define DIALOGUE_BOTTLES_HEAD 0x83
|
||||
#define DIALOGUE_MUMBO_HEAD 0x84
|
||||
#define DIALOGUE_COMMAND_END 0x4
|
||||
|
||||
switch (text_id) {
|
||||
case 3599:
|
||||
static char* dialog_3599;
|
||||
if (dialog_3599 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "WOW! THAT LOOKS SO SMOOTH!");
|
||||
add_dialog_bin_string(DIALOGUE_MUMBO_HEAD, "CAN RUN AT 60, 120 OR WHATEVER FPS YOU WANT. MUMBO'S MAGIC PC DOES 360 FPS.");
|
||||
add_dialog_bin_string(DIALOGUE_KAZOOIE_HEAD, "STOP SHOWING OFF SHAMAN BOY. WHAT ABOUT ON MY ULTRAWIDE MONITOR?");
|
||||
add_dialog_bin_string(DIALOGUE_MUMBO_HEAD, "RUDE BIRD NEED NOT WORRY. WIDESCREEN AND MORE SUPPORTED.");
|
||||
add_dialog_bin_string(DIALOGUE_KAZOOIE_HEAD, "IT RUNS WELL TOO. BANJO, EVEN THAT PC YOU GOT OUT OF THE DUMPSTER CAN PROBABLY RUN IT.");
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "KAZOOIE!!!");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "HEY GUYS! CHECK OUT HOW COOL MY MINIGAME LOOKS IN THIS PORT!");
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "OOOH! LOOKS GREAT! CAN'T WAIT TO TRY IT!");
|
||||
add_dialog_bin_string(DIALOGUE_KAZOOIE_HEAD, "I DON'T CARE ABOUT YOUR PUZZLES BOTTLE BRAIN. WHAT ABOUT NEW FEATURES?");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "I'M GLAD YOU ASKED, TAKE A LOOK!");
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "NOTE SAVING? WHAT DOES THAT DO?");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "WHEN YOU USE IT, YOU WON'T LOSE YOUR NOTES EVERY TIME YOU EXIT A WORLD. NEAT, ISN'T IT?");
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "AWESOME! DO WE GET ANY OTHER NEW FEATURES?");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "YES! IF YOU WANT, YOU CAN USE THE RIGHT ANALOG STICK FOR SMOOTHER CAMERA CONTROLS.");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "YOU CAN ALSO USE HIGH DEFINITION TEXTURE PACKS AND CUSTOM MODS!");
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "NEAT! WHAT KIND OF MODS CAN PEOPLE MAKE FOR THIS PORT?");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "PRETTY MUCH ANYTHING! NEW ASSETS, GAMEPLAY CHANGES, YOU NAME IT.");
|
||||
add_dialog_bin_string(DIALOGUE_KAZOOIE_HEAD, "YAWN. DOOM. HOW ORIGINAL. GOT ANYTHING WORTH PLAYING SOIL BRAIN?");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "SURE! MAYBE THESE ONES ARE MORE TO YOUR LIKING...");
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "WOAH! THESE LOOK COOL! ARE THESE NEW ADVENTURES FOR US TO PLAY?");
|
||||
add_dialog_bin_string(DIALOGUE_KAZOOIE_HEAD, "HEY, I THOUGHT OCARINA OF TIME WASN'T READY YET?");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "NO FEATHER BRAIN. IT'S JIGGIES OF TIME BY KURKO MODS, WHICH YOU CAN PLAY IN THIS PORT!");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "WE MADE TOOLS FOR MODDERS TO CONVERT THEIR COMPATIBLE ROMHACKS INTO RECOMP MODS!");
|
||||
add_dialog_bin_string(DIALOGUE_BOTTLES_HEAD, "NOSTALGIA 64 IS ALSO AVAILABLE, AND MORE MODS WILL BE RELEASED IN THE FUTURE!");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3599 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3599;
|
||||
case 3705:
|
||||
static char* dialog_3705;
|
||||
if (dialog_3705 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_MUMBO_HEAD, "HEY...MUMBO GOT SECRET PICTURES!");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3705 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3705;
|
||||
case 3706:
|
||||
static char* dialog_3706;
|
||||
if (dialog_3706 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_KAZOOIE_HEAD, "NICE ONE, BONE BRAIN! WHAT'S ON THEM?");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3706 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3706;
|
||||
case 3707:
|
||||
static char* dialog_3707;
|
||||
if (dialog_3707 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_MUMBO_HEAD, "GOT PICTURES OF NEXT PORT. WISEGUY GAVE THEM TO ME.");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3707 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3707;
|
||||
case 3708:
|
||||
static char* dialog_3708;
|
||||
if (dialog_3708 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "OOOH...DID YOU HEAR THAT KAZOOIE? THERE'S GOING TO BE ANOTHER RECOMP!");
|
||||
add_dialog_bin_string(DIALOGUE_KAZOOIE_HEAD, "IS IT THE ELF BOY AGAIN? HE ALWAYS GETS ALL THE ATTENTION.");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3708 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3708;
|
||||
case 3709:
|
||||
static char* dialog_3709;
|
||||
if (dialog_3709 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_MUMBO_HEAD, "NO OCARINA. TAKING FOREVER. OTHER INSTRUMENTS FIRST.");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3709 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3709;
|
||||
case 3717:
|
||||
static char* dialog_3717;
|
||||
if (dialog_3717 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "SOUNDS EXCITING. WHAT COULD IT BE?");
|
||||
add_dialog_bin_string(DIALOGUE_KAZOOIE_HEAD, "YEAH, SHOW US!");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3717 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3717;
|
||||
case 3719:
|
||||
static char* dialog_3719;
|
||||
if (dialog_3719 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "THAT WAS GREAT! SO WHEN CAN WE PLAY THIS PORT?");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3719 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3719;
|
||||
case 3720:
|
||||
static char* dialog_3720;
|
||||
if (dialog_3720 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_MUMBO_HEAD, "YOU CAN PLAY IT...NOW!");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3720 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3720;
|
||||
case 3721:
|
||||
static char* dialog_3721;
|
||||
if (dialog_3721 == NULL) {
|
||||
start_dialog_bin();
|
||||
add_dialog_bin_string(DIALOGUE_KAZOOIE_HEAD, "REALLY?! COME ON BANJO, I WANT TO GO HOME AND PLAY IT!");
|
||||
add_dialog_bin_string(DIALOGUE_BANJO_HEAD, "WAHEY! SOUNDS LIKE A PLAN!");
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
next_dialog_bin_character();
|
||||
add_dialog_bin_string(DIALOGUE_COMMAND_END, "");
|
||||
dialog_3721 = end_dialog_bin();
|
||||
}
|
||||
|
||||
return dialog_3721;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return var_v0;
|
||||
}
|
||||
|
||||
@@ -28,3 +28,15 @@ RECOMP_PATCH void dummy_func_8025AFB0(void) {
|
||||
// This allows the start indices to account for any changes made by mods.
|
||||
calculate_map_start_note_indices();
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
||||
RECOMP_PATCH enum map_e getDefaultBootMap(void) {
|
||||
return MAP_95_CS_END_ALL_100;
|
||||
}
|
||||
|
||||
RECOMP_PATCH int ability_hasLearned(enum ability_e ability) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -335,6 +335,19 @@ RECOMP_PATCH void func_803163A8(GcZoombox *this, Gfx **gfx, Mtx **mtx) {
|
||||
f32 sp38[3];
|
||||
f32 sp34;
|
||||
|
||||
#if 0
|
||||
// @recomp Greenscreen for recording.
|
||||
const u32 half_height = DEFAULT_FRAMEBUFFER_HEIGHT / 2;
|
||||
const u32 uly = (this->unk172 / half_height) * half_height;
|
||||
const u32 blue = 0x003F003F;
|
||||
const u32 green = 0x07C107C1;
|
||||
const u32 white = 0xFFFFFFFF;
|
||||
gDPSetCycleType((*gfx)++, G_CYC_FILL);
|
||||
gDPSetRenderMode((*gfx)++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor((*gfx)++, white);
|
||||
gDPScisFillRectangle((*gfx)++, 0, uly, DEFAULT_FRAMEBUFFER_WIDTH - 1, uly + half_height - 1);
|
||||
#endif
|
||||
|
||||
// @recomp Align the zoombox to the left of the screen if necessary.
|
||||
// NOTE: gScissorBoxRight/gScissorBoxTop are incorrectly named in the decompilation and must be swapped.
|
||||
if (left_aligned_zoombox(this)) {
|
||||
@@ -362,7 +375,9 @@ RECOMP_PATCH void func_803163A8(GcZoombox *this, Gfx **gfx, Mtx **mtx) {
|
||||
u32 prev_transform_id = cur_drawn_model_transform_id;
|
||||
cur_drawn_model_transform_id = ZOOMBOX_TRANSFORM_ID_START + this->portrait_id;
|
||||
|
||||
#if 1
|
||||
modelRender_draw(gfx, mtx, sp50, sp5C, this->unk198 * sp34, sp38, this->model);
|
||||
#endif
|
||||
|
||||
// @recomp Reset the model transform ID.
|
||||
cur_drawn_model_transform_id = prev_transform_id;
|
||||
@@ -382,6 +397,11 @@ RECOMP_PATCH void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3,
|
||||
if (this->portrait_id == ZOOMBOX_SPRITE_46_TUMBLAR) {
|
||||
arg6 = 0.75f;
|
||||
}
|
||||
|
||||
#if 0
|
||||
arg6 = arg6 < 1.0f ? 0.0f : 1.0f;
|
||||
#endif
|
||||
|
||||
func_80338338(0xFF, 0xFF, 0xFF);
|
||||
func_803382FC(this->unk168 * arg6);
|
||||
func_803382E4(5);
|
||||
@@ -422,10 +442,12 @@ RECOMP_PATCH void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3,
|
||||
// @recomp Create a matrix group for the portrait's model matrix.
|
||||
gEXMatrixGroupDecomposedVerts((*gfx)++, ZOOMBOX_PORTRAIT_TRANSFORM_ID_START + this->portrait_id, G_EX_PUSH, G_MTX_MODELVIEW, G_EX_EDIT_NONE);
|
||||
|
||||
#if 1
|
||||
modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE);
|
||||
func_80344090(arg5, this->unk186, gfx);
|
||||
func_8033687C(gfx);
|
||||
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
|
||||
#endif
|
||||
|
||||
// @recomp Pop the model matrix group.
|
||||
gEXPopMatrixGroup((*gfx)++, G_MTX_MODELVIEW);
|
||||
@@ -438,6 +460,7 @@ RECOMP_PATCH void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3,
|
||||
|
||||
// @recomp Patched to assign an ID to the text drawn by the zoombox.
|
||||
RECOMP_PATCH void func_803162B4(GcZoombox *this) {
|
||||
#if 1
|
||||
// @recomp Align the zoombox to the left of the screen if necessary.
|
||||
if (left_aligned_zoombox(this)) {
|
||||
cur_pushed_text_transform_origin = G_EX_ORIGIN_LEFT;
|
||||
@@ -485,4 +508,5 @@ RECOMP_PATCH void func_803162B4(GcZoombox *this) {
|
||||
|
||||
// @recomp Clear ID assigned to the text.
|
||||
cur_pushed_text_transform_id = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -150,6 +150,17 @@ RECOMP_PATCH Actor *func_802E0738(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx
|
||||
return this;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (marker->modelId == 0x355) {
|
||||
// @recomp Greenscreen for recording concert Banjo.
|
||||
const u32 green = 0x07C107C1;
|
||||
gDPSetCycleType((*gfx)++, G_CYC_FILL);
|
||||
gDPSetRenderMode((*gfx)++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor((*gfx)++, green);
|
||||
gDPScisFillRectangle((*gfx)++, 0, 0, DEFAULT_FRAMEBUFFER_WIDTH - 1, DEFAULT_FRAMEBUFFER_HEIGHT - 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
modelRender_preDraw((GenFunction_1)func_802E0710, (s32)this);
|
||||
modelRender_postDraw((GenFunction_1)actor_postdrawMethod, (s32)marker);
|
||||
modelRender_draw(gfx, mtx, this->position, sp34, this->scale, NULL, marker_loadModelBin(marker));
|
||||
|
||||
@@ -329,6 +329,18 @@ RECOMP_PATCH void gctransition_draw(Gfx **gdl, Mtx **mptr, Vtx **vptr){
|
||||
patch_falling_jiggies_model(transition_model);
|
||||
transition_model->pad0[0] = 0xBA;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (s_current_transition.substate > 2) {
|
||||
// @recomp Greenscreen for recording.
|
||||
const u32 blue = 0x003F003F;
|
||||
const u32 green = 0x07C107C1;
|
||||
gDPSetCycleType((*gdl)++, G_CYC_FILL);
|
||||
gDPSetRenderMode((*gdl)++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor((*gdl)++, 0x07C107C1);
|
||||
gDPScisFillRectangle((*gdl)++, 0, 0, DEFAULT_FRAMEBUFFER_WIDTH - 1, DEFAULT_FRAMEBUFFER_HEIGHT - 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user