1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-14 11:54:39 +00:00

More documentation for z_std_dma.c (#1415)

* More documentation for z_std_dma

* uintptr casts for rom symbols in z64animation.h and z_kanfont.c

* Format

* Suggested changes, more defines for static texture sizes

* PI Interface -> PI

* Further suggested changes

* Format

* Comments about item_name and map_name texture assumptions
This commit is contained in:
Tharo 2022-11-17 02:57:02 +00:00 committed by GitHub
parent 40639e698d
commit 7ecafcfe7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 549 additions and 320 deletions

View file

@ -9,9 +9,9 @@ void func_8006EE50(Font* font, u16 arg1, u16 arg2) {
* at `codePointIndex`. The value of `character` is the ASCII codepoint subtract ' '/0x20.
*/
void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) {
DmaMgr_SendRequest1(&font->charTexBuf[codePointIndex],
(u32)&_nes_font_staticSegmentRomStart[character * FONT_CHAR_TEX_SIZE], FONT_CHAR_TEX_SIZE,
"../z_kanfont.c", 93);
DmaMgr_RequestSyncDebug(&font->charTexBuf[codePointIndex],
(uintptr_t)_nes_font_staticSegmentRomStart + character * FONT_CHAR_TEX_SIZE,
FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 93);
}
/**
@ -20,9 +20,10 @@ void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) {
* The different icons are given in the MessageBoxIcon enum.
*/
void Font_LoadMessageBoxIcon(Font* font, u16 icon) {
DmaMgr_SendRequest1(font->iconBuf,
(u32)&_message_staticSegmentRomStart[4 * MESSAGE_STATIC_TEX_SIZE + icon * FONT_CHAR_TEX_SIZE],
FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 100);
DmaMgr_RequestSyncDebug(font->iconBuf,
(uintptr_t)_message_staticSegmentRomStart + 4 * MESSAGE_STATIC_TEX_SIZE +
icon * FONT_CHAR_TEX_SIZE,
FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 100);
}
/**
@ -31,18 +32,18 @@ void Font_LoadMessageBoxIcon(Font* font, u16 icon) {
*/
void Font_LoadOrderedFont(Font* font) {
u8* fontBuf;
u32 fontStatic;
uintptr_t fontStatic;
s32 len;
s32 jj;
s32 codePointIndex;
s32 fontBufIndex;
u32 offset;
size_t offset;
font->msgOffset = _message_0xFFFC_nes - (const char*)_nes_message_data_staticSegmentStart;
len = font->msgLength = _message_0xFFFD_nes - _message_0xFFFC_nes;
DmaMgr_SendRequest1(font->msgBuf, (u32)&_nes_message_data_staticSegmentRomStart[font->msgOffset], len,
"../z_kanfont.c", 122);
DmaMgr_RequestSyncDebug(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset, len,
"../z_kanfont.c", 122);
osSyncPrintf("msg_data=%x, msg_data0=%x jj=%x\n", font->msgOffset, font->msgLength, jj = len);
len = jj;
@ -54,12 +55,12 @@ void Font_LoadOrderedFont(Font* font) {
if (font->msgBuf[codePointIndex] != MESSAGE_NEWLINE) {
fontBuf = font->fontBuf + fontBufIndex * 8;
fontStatic = (u32)_nes_font_staticSegmentRomStart;
fontStatic = (uintptr_t)_nes_font_staticSegmentRomStart;
osSyncPrintf("nes_mes_buf[%d]=%d\n", codePointIndex, font->msgBuf[codePointIndex]);
offset = (font->msgBuf[codePointIndex] - '\x20') * FONT_CHAR_TEX_SIZE;
DmaMgr_SendRequest1(fontBuf, fontStatic + offset, FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134);
offset = (font->msgBuf[codePointIndex] - ' ') * FONT_CHAR_TEX_SIZE;
DmaMgr_RequestSyncDebug(fontBuf, fontStatic + offset, FONT_CHAR_TEX_SIZE, "../z_kanfont.c", 134);
fontBufIndex += FONT_CHAR_TEX_SIZE / 8;
}
}