Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
msg.h File Reference

Go to the source code of this file.

Functions

s32 msg_get_print_char_width (s32 character, s32 charset, s32 variation, f32 msgScale, s32 overrideCharWidth, u8 flags)
 
void msg_get_glyph (s32 font, s32 variation, s32 charIndex, s32 palette, MesasgeFontGlyphData *out)
 
void dma_load_msg (u32 msgID, void *dest)
 

Function Documentation

◆ msg_get_print_char_width()

s32 msg_get_print_char_width ( s32 character,
s32 charset,
s32 variation,
f32 msgScale,
s32 overrideCharWidth,
u8 flags )

Definition at line 1580 of file msg.c.

1580 {
1581 f32 charWidth;
1582
1587 return 0;
1588 }
1589
1590#if VERSION_IQUE
1592 charWidth = 16.0;
1593 return charWidth * msgScale;
1594 }
1595#endif
1596
1597 if (overrideCharWidth != 0) {
1598 charWidth = overrideCharWidth;
1599 } else if (flags != 0) {
1600 u8* charWidthTable = MsgCharsets[charset]->rasters[variation].charWidthTable;
1601
1602 if (charWidthTable != nullptr
1606 charWidth = charWidthTable[character];
1607 } else {
1608 charWidth = MsgCharsets[charset]->rasters[variation].monospaceWidth;
1609 }
1610 } else {
1611 charWidth = MsgCharsets[charset]->rasters[variation].monospaceWidth;
1612 }
1613
1615 return charWidth * msgScale * CHAR_SPACE_MULTIPLIER;
1616 }
1618 f64 retWidth = charWidth * msgScale;
1619 return retWidth;
1620 }
1622 return charWidth * msgScale * 0.5;
1623 }
1624 if (character >= MSG_CONTROL_CHAR) {
1625 return 0;
1626 }
1627 return charWidth * msgScale;
1628}
BSS s32 PopupMenu_SelectedIndex
MessageCharData * rasters
s8 flags
Definition demo_api.c:15
@ MSG_CHAR_READ_HALF_SPACE
Definition enums.h:5637
@ MSG_CHAR_READ_SPACE
Definition enums.h:5635
@ MSG_CHAR_READ_FULL_SPACE
Definition enums.h:5636
@ MSG_CONTROL_CHAR
Definition enums.h:5646
MessageCharset * MsgCharsets[5]
Definition msg_data.c:865
#define CHAR_SPACE_MULTIPLIER
Definition msg.c:1577

Referenced by get_msg_properties().

◆ msg_get_glyph()

void msg_get_glyph ( s32 font,
s32 variation,
s32 charIndex,
s32 palette,
MesasgeFontGlyphData * out )

Definition at line 2277 of file msg_draw.c.

2277 {
2278 out->raster = &MsgCharsets[font]->rasters[variation].raster[(u16)MsgCharsets[font]->charRasterSize * charIndex];
2279 out->palette = D_802F4560[palette];
2280 out->texSize.x = MsgCharsets[font]->texSize.x;
2281 out->texSize.y = MsgCharsets[font]->texSize.y;
2282 out->charWidth = msg_get_draw_char_width(charIndex, font, variation, 1.0f, 0, 0);
2283 out->charHeight = out->texSize.y;
2284}
s32 msg_get_draw_char_width(s32 character, s32 charset, s32 variation, f32 msgScale, s32 overrideCharWidth, u16 flags)
Definition msg.c:1630
PAL_BIN D_802F4560[80][8]
MessageCharset * MsgCharsets[5]
Definition msg_data.c:865

◆ dma_load_msg()

void dma_load_msg ( u32 msgID,
void * dest )

Definition at line 1398 of file msg.c.

1398 {
1399 u8* addr = (u8*) MSG_ROM_START + (msgID >> 14); // (msgID >> 16) * 4
1400 u8* offset[2]; // start, end
1401
1402 dma_copy(addr, addr + 4, &offset[0]); // Load section offset
1403
1404 addr = MSG_ROM_START + offset[0] + (msgID & 0xFFFF) * 4;
1405 dma_copy(addr, addr + 8, &offset); // Load message start and end offsets
1406
1407 // Load the msg data
1408 dma_copy(MSG_ROM_START + offset[0], MSG_ROM_START + offset[1], dest);
1409}
u32 dma_copy(Addr romStart, Addr romEnd, void *vramDest)
Definition 43F0.c:442
#define MSG_ROM_START
Definition msg.c:23

Referenced by draw_msg(), get_msg_properties(), load_message_to_buffer(), and set_message_text_var().