mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-10 19:20:13 +00:00
Skelanime + Kanfont Retail OK (#1729)
* Skelanime retail OK * kanfont retail OK * PR review
This commit is contained in:
parent
bc9c1f2be2
commit
92203011b8
2 changed files with 18 additions and 15 deletions
|
@ -9,8 +9,10 @@ void func_8006EE50(Font* font, u16 arg1, u16 arg2) {
|
||||||
* at `codePointIndex`. The value of `character` is the ASCII codepoint subtract ' '/0x20.
|
* at `codePointIndex`. The value of `character` is the ASCII codepoint subtract ' '/0x20.
|
||||||
*/
|
*/
|
||||||
void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) {
|
void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) {
|
||||||
|
u8 charTmp = character;
|
||||||
|
|
||||||
DMA_REQUEST_SYNC(&font->charTexBuf[codePointIndex],
|
DMA_REQUEST_SYNC(&font->charTexBuf[codePointIndex],
|
||||||
(uintptr_t)_nes_font_staticSegmentRomStart + character * FONT_CHAR_TEX_SIZE, FONT_CHAR_TEX_SIZE,
|
(uintptr_t)_nes_font_staticSegmentRomStart + charTmp * FONT_CHAR_TEX_SIZE, FONT_CHAR_TEX_SIZE,
|
||||||
"../z_kanfont.c", 93);
|
"../z_kanfont.c", 93);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,10 +33,7 @@ void Font_LoadMessageBoxIcon(Font* font, u16 icon) {
|
||||||
* the font buffer.
|
* the font buffer.
|
||||||
*/
|
*/
|
||||||
void Font_LoadOrderedFont(Font* font) {
|
void Font_LoadOrderedFont(Font* font) {
|
||||||
u8* fontBuf;
|
|
||||||
uintptr_t fontStatic;
|
|
||||||
s32 len;
|
s32 len;
|
||||||
s32 jj;
|
|
||||||
s32 codePointIndex;
|
s32 codePointIndex;
|
||||||
s32 fontBufIndex;
|
s32 fontBufIndex;
|
||||||
u32 offset;
|
u32 offset;
|
||||||
|
@ -44,23 +43,22 @@ void Font_LoadOrderedFont(Font* font) {
|
||||||
|
|
||||||
DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len,
|
DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len,
|
||||||
"../z_kanfont.c", 122);
|
"../z_kanfont.c", 122);
|
||||||
PRINTF("msg_data=%x, msg_data0=%x jj=%x\n", font->msgOffset, font->msgLength, jj = len);
|
|
||||||
|
|
||||||
len = jj;
|
PRINTF("msg_data=%x, msg_data0=%x jj=%x\n", font->msgOffset, font->msgLength, len * 1);
|
||||||
for (fontBufIndex = 0, codePointIndex = 0; font->msgBuf[codePointIndex] != MESSAGE_END; codePointIndex++) {
|
|
||||||
if (codePointIndex > len) {
|
fontBufIndex = 0;
|
||||||
|
for (codePointIndex = 0; font->msgBuf[codePointIndex] != MESSAGE_END; codePointIndex++) {
|
||||||
|
if (codePointIndex > (len * 1)) {
|
||||||
PRINTF("ERROR!! エラー!!! error───!!!!\n");
|
PRINTF("ERROR!! エラー!!! error───!!!!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (font->msgBuf[codePointIndex] != MESSAGE_NEWLINE) {
|
if (font->msgBuf[codePointIndex] != MESSAGE_NEWLINE) {
|
||||||
fontBuf = font->fontBuf + fontBufIndex * 8;
|
|
||||||
fontStatic = (uintptr_t)_nes_font_staticSegmentRomStart;
|
|
||||||
|
|
||||||
PRINTF("nes_mes_buf[%d]=%d\n", codePointIndex, font->msgBuf[codePointIndex]);
|
PRINTF("nes_mes_buf[%d]=%d\n", codePointIndex, font->msgBuf[codePointIndex]);
|
||||||
|
|
||||||
offset = (font->msgBuf[codePointIndex] - ' ') * FONT_CHAR_TEX_SIZE;
|
offset = (font->msgBuf[codePointIndex] - ' ') * FONT_CHAR_TEX_SIZE;
|
||||||
DMA_REQUEST_SYNC(fontBuf, fontStatic + offset, FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134);
|
DMA_REQUEST_SYNC(font->fontBuf + fontBufIndex * 8, (uintptr_t)_nes_font_staticSegmentRomStart + offset,
|
||||||
|
FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134);
|
||||||
fontBufIndex += FONT_CHAR_TEX_SIZE / 8;
|
fontBufIndex += FONT_CHAR_TEX_SIZE / 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,6 +152,7 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton,
|
||||||
}
|
}
|
||||||
(*mtx)++;
|
(*mtx)++;
|
||||||
} else if (limbDList != NULL) {
|
} else if (limbDList != NULL) {
|
||||||
|
if (1) {}
|
||||||
MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 954);
|
MATRIX_TO_MTX(*mtx, "../z_skelanime.c", 954);
|
||||||
(*mtx)++;
|
(*mtx)++;
|
||||||
}
|
}
|
||||||
|
@ -366,6 +367,7 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton,
|
||||||
gSPDisplayList(POLY_OPA_DISP++, newDList);
|
gSPDisplayList(POLY_OPA_DISP++, newDList);
|
||||||
(*limbMatrices)++;
|
(*limbMatrices)++;
|
||||||
} else if (limbDList != NULL) {
|
} else if (limbDList != NULL) {
|
||||||
|
if (1) {}
|
||||||
MATRIX_TO_MTX(*limbMatrices, "../z_skelanime.c", 1249);
|
MATRIX_TO_MTX(*limbMatrices, "../z_skelanime.c", 1249);
|
||||||
(*limbMatrices)++;
|
(*limbMatrices)++;
|
||||||
}
|
}
|
||||||
|
@ -467,7 +469,7 @@ void SkelAnime_GetFrameData(AnimationHeader* animation, s32 frame, s32 limbCount
|
||||||
u16 staticIndexMax = animHeader->staticIndexMax;
|
u16 staticIndexMax = animHeader->staticIndexMax;
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
for (i = 0; i < limbCount; i++, frameTable++, jointIndices++) {
|
for (i = 0; i < limbCount; i++) {
|
||||||
if ((frameTable == NULL) || (jointIndices == NULL) || (dynamicData == NULL) || (staticData == NULL)) {
|
if ((frameTable == NULL) || (jointIndices == NULL) || (dynamicData == NULL) || (staticData == NULL)) {
|
||||||
LOG_ADDRESS("out", frameTable, "../z_skelanime.c", 1392);
|
LOG_ADDRESS("out", frameTable, "../z_skelanime.c", 1392);
|
||||||
LOG_ADDRESS("ref_tbl", jointIndices, "../z_skelanime.c", 1393);
|
LOG_ADDRESS("ref_tbl", jointIndices, "../z_skelanime.c", 1393);
|
||||||
|
@ -481,6 +483,8 @@ void SkelAnime_GetFrameData(AnimationHeader* animation, s32 frame, s32 limbCount
|
||||||
(jointIndices->y >= staticIndexMax) ? dynamicData[jointIndices->y] : staticData[jointIndices->y];
|
(jointIndices->y >= staticIndexMax) ? dynamicData[jointIndices->y] : staticData[jointIndices->y];
|
||||||
frameTable->z =
|
frameTable->z =
|
||||||
(jointIndices->z >= staticIndexMax) ? dynamicData[jointIndices->z] : staticData[jointIndices->z];
|
(jointIndices->z >= staticIndexMax) ? dynamicData[jointIndices->z] : staticData[jointIndices->z];
|
||||||
|
jointIndices++;
|
||||||
|
frameTable++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1024,10 +1028,11 @@ void AnimationContext_Update(PlayState* play, AnimationContext* animationCtx) {
|
||||||
AnimationContext_LoadFrame, AnimationContext_CopyAll, AnimationContext_Interp,
|
AnimationContext_LoadFrame, AnimationContext_CopyAll, AnimationContext_Interp,
|
||||||
AnimationContext_CopyTrue, AnimationContext_CopyFalse, AnimationContext_MoveActor,
|
AnimationContext_CopyTrue, AnimationContext_CopyFalse, AnimationContext_MoveActor,
|
||||||
};
|
};
|
||||||
AnimationEntry* entry;
|
AnimationEntry* entry = animationCtx->entries;
|
||||||
|
|
||||||
for (entry = animationCtx->entries; animationCtx->animationCount != 0; entry++, animationCtx->animationCount--) {
|
for (; animationCtx->animationCount != 0; animationCtx->animationCount--) {
|
||||||
animFuncs[entry->type](play, &entry->data);
|
animFuncs[entry->type](play, &entry->data);
|
||||||
|
entry++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sAnimQueueFlags = 1;
|
sAnimQueueFlags = 1;
|
||||||
|
|
Loading…
Reference in a new issue